Bladeren bron

内部报验功能-修改记录,取消发送邮件

wangming 1 jaar geleden
bovenliggende
commit
ae69f74826

+ 21 - 18
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -80,20 +80,9 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
     public void launch(InsideInspectionOperRequest req) {
         ZhcxInsideInspectionDo inspectionDo = getById(req.getId());
         //生成报验单号
-        updateInspection(inspectionDo);
+        updateInspection(inspectionDo, req);
         //生成空派单信息
         dispatchService.genDispatch(inspectionDo);
-
-        //生成操作记录
-        SysUserVo user = zhcxCommon.getCurrentUser();
-        InsideOperLogDto operLogDto = InsideOperLogDto.builder()
-                .id(req.getId())
-                .operType("5")
-                .launchSource(ObjectUtil.isEmpty(req.getLaunchSource()) ? "mobile" : req.getLaunchSource())
-                .build();
-        operLogDto.setOperUser(user);
-        operLogDto.setOperTime(new Date());
-        operLogService.saveOperLog(operLogDto);
     }
 
     /**
@@ -378,6 +367,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
             }
         }
 
+        //没有更改,不存修改日志
+        if(ObjectUtil.isEmpty(descMap)) {
+            return ;
+        }
+
         //添加日志
         operLogService.saveOperLog(req, operDto, descMap);
     }
@@ -458,7 +452,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         saveReNew(inside, dispatch, masterSlaveUpdate);
 
         //修改字段
-        return editColsHistory(inside, masterSlaveUpdate);
+        return editColsHistory(inside, masterSlaveUpdate.getMasterUpdate().getUpdatecolumns());
     }
 
     /**
@@ -500,14 +494,12 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * 修改字段历史
      *
      * @param oldInside
-     * @param masterSlaveUpdate
+     * @param updatecolumns
      * @return
      */
-    private List<String> editColsHistory(ZhcxInsideInspectionDo oldInside, MasterSlaveUpdateVo masterSlaveUpdate) {
+    private List<String> editColsHistory(ZhcxInsideInspectionDo oldInside, Map<String,Object> updatecolumns) {
 
         List<String> editDataList = new ArrayList<>();
-
-        Map<String, Object> updatecolumns = masterSlaveUpdate.getMasterUpdate().getUpdatecolumns();
         //预约报验时间
 //        if(ObjectUtil.isNotEmpty(updatecolumns.get("RESERVATIONINSPECTIONTIME"))) {
 //            String reservationinspectiontime = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString();
@@ -911,7 +903,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      *
      * @param inspectionDo
      */
-    private void updateInspection(ZhcxInsideInspectionDo inspectionDo) {
+    private void updateInspection(ZhcxInsideInspectionDo inspectionDo, InsideInspectionOperRequest req) {
         //存在报验单号,则不再生成
         if(ObjectUtil.isNotEmpty(inspectionDo.getInspectioncode())) {
             return ;
@@ -921,6 +913,17 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         entity.setId(inspectionDo.getId());
         entity.setInspectioncode(genCode());
         updateById(entity);
+
+        //生成操作记录
+        SysUserVo user = zhcxCommon.getCurrentUser();
+        InsideOperLogDto operLogDto = InsideOperLogDto.builder()
+                .id(req.getId())
+                .operType("5")
+                .launchSource(ObjectUtil.isEmpty(req.getLaunchSource()) ? "mobile" : req.getLaunchSource())
+                .build();
+        operLogDto.setOperUser(user);
+        operLogDto.setOperTime(new Date());
+        operLogService.saveOperLog(operLogDto);
     }
 
     /**

+ 2 - 1
business-entity/src/main/java/com/rongwei/bsentity/dto/inside/InsideInspectionModifyRecordRequest.java

@@ -17,6 +17,7 @@ public class InsideInspectionModifyRecordRequest extends InsideInspectionOperBas
 
     /**
      * 保存数据
+     * value,新的表单数据
      */
-    private Map<String, MasterSlaveUpdateVo> map;
+    private Map<String, Map<String,Object>> map;
 }