Ver código fonte

取消时已存在执行情况,不做任何处理

wangming 9 meses atrás
pai
commit
66672c639a

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

@@ -1962,12 +1962,12 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
                 stateDo.setCreateuserid(inOper.getOperUser().getId());
                 stateDo.setCreateusername(inOper.getOperUser().getName());
 //                entity.setIncompletetime(itpDoPa.getInspectioncomplatetime());
-                assembleUpdateNodeState(stateDo, inOper, complateTime);
+                assembleUpdateNodeState(stateDo, inOper, complateTime, false);
 
                 nodeStateBo.getInsertList().add(stateDo);
             } else {
 //                stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
-                assembleUpdateNodeState(stateDo, inOper, complateTime);
+                assembleUpdateNodeState(stateDo, inOper, complateTime, true);
 
                 nodeStateBo.getUpdateList().add(stateDo);
             }
@@ -1992,27 +1992,31 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param inOper
      * @param complateTime
      */
-    private void assembleUpdateNodeState(ZhcxItpProjectNodeStateDo entity, InsideOperDto inOper, Date complateTime) {
+    private void assembleUpdateNodeState(ZhcxItpProjectNodeStateDo entity, InsideOperDto inOper, Date complateTime, boolean recordExistsFlag) {
         entity.setModifydate(inOper.getOperTime());
         entity.setModifyuserid(inOper.getOperUser().getId());
         entity.setModifyusername(inOper.getOperUser().getName());
         //取消
-        if("10".equals(inOper.getOperType())) {
+        if((!recordExistsFlag || ObjectUtil.isEmpty(entity.getInstate())) && "10".equals(inOper.getOperType())) {
             entity.setInstate("40");
+            entity.setIntimes(inOper.getInspection().getInspectioncount());
         }
         //拒收
         if("20".equals(inOper.getOperType())) {
             entity.setInstate("20");
+            entity.setIntimes(inOper.getInspection().getInspectioncount());
         }
 
         //接收
         if("50".equals(inOper.getOperType())) {
             entity.setInstate("10");
+            entity.setIntimes(inOper.getInspection().getInspectioncount());
         }
 
         //有条件接收
         if ("60".equals(inOper.getOperType())) {
             entity.setInstate("30");
+            entity.setIntimes(inOper.getInspection().getInspectioncount());
         }
 
         //接收
@@ -2023,8 +2027,6 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         else if ("60".equals(inOper.getOperType())) {
             entity.setIncompletetime(complateTime);
         }
-
-        entity.setIntimes(inOper.getInspection().getInspectioncount());
     }
 
 }

+ 16 - 5
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxItpProjectNodeStateServiceImpl.java

@@ -97,15 +97,26 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
                 entity.setNodeid(itpDo.getInspectioncontentid());
                 entity.setDeleted("0");
                 dto.setSaveType("insert");
+
+                //取消
+                if("10".equals(operType)) {
+                    entity.setOutstate("40");
+                }
+                entity.setOuttimes(itpDo.getInspectioncount());
             } else {
                 entity.setId(stateDo.getId());
                 dto.setSaveType("update");
+
+                if("10".equals(operType)) {
+                    if(ObjectUtil.isEmpty(stateDo.getOutstate())) {
+                        entity.setOutstate("40");
+                        entity.setOuttimes(itpDo.getInspectioncount());
+                    }
+                } else {
+                    entity.setOuttimes(itpDo.getInspectioncount());
+                }
             }
-            entity.setOuttimes(itpDo.getInspectioncount());
-            //取消
-            if("10".equals(operType)) {
-                entity.setOutstate("40");
-            }
+
             //拒收
             if("20".equals(operType)) {
                 entity.setOutstate("20");

+ 9 - 7
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxOutsideInspectionItpServiceImpl.java

@@ -334,13 +334,15 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                 List<ZhcxItpProjectNodeStateResultDto> nodeStateResultList = zhcxItpProjectNodeStateService.getByItp(inspectionItpDo, "10");
                 assembleNodeState(nodeStateResultList, inspectionItpDo, nodeStateBo);
 
-                UnItpNodeStateBo stateBo = UnItpNodeStateBo.builder()
-                        .inspectionCount(inspectionItpDo.getInspectioncount())
-                        .inspectionCode(inspectionItpDo.getInspectioncode())
-                        .type("outside")
-                        .conclusion("40")
-                        .build();
-                nodeStateBo.getUnItpList().add(stateBo);
+                if(!"itp".equals(inspectionItpDo.getLaunchtype())) {
+                    UnItpNodeStateBo stateBo = UnItpNodeStateBo.builder()
+                            .inspectionCount(inspectionItpDo.getInspectioncount())
+                            .inspectionCode(inspectionItpDo.getInspectioncode())
+                            .type("outside")
+                            .conclusion("40")
+                            .build();
+                    nodeStateBo.getUnItpList().add(stateBo);
+                }
 
             }
             //拒收