浏览代码

报验点状态

wangming 11 月之前
父节点
当前提交
43439d9829

+ 25 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxItpProjectNodeStateDao.java

@@ -2,6 +2,8 @@ package com.rongwei.bscommon.sys.dao;
 
 import com.rongwei.bsentity.domain.ZhcxItpProjectNodeStateDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.dto.project.node.UnItpNodeStateBo;
+import org.apache.ibatis.annotations.Update;
 
 /**
  * <p>
@@ -13,4 +15,27 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ZhcxItpProjectNodeStateDao extends BaseMapper<ZhcxItpProjectNodeStateDo> {
 
+    @Update("<script>" +
+            "update ZHCX_ITP_PROJECT_NODE_STATE state, ZHCX_ITP_PROJECT_NODE_STATE_INSIDE side " +
+            "<set>" +
+            "state.INSTATE = #{conclusion}, state.INTIMES = #{inspectionCount}" +
+            "<if test=\"conclusion == '10' or conclusion == '30'\">" +
+            ", state.INCOMPLETETIME = #{complateTime}" +
+            "</if>" +
+            "</set>" +
+            "where state.ID = side.STATEID and side.INSPECTIONCODE = #{inspectionCode} and state.DELETED = '0' and side.DELETED = '0'" +
+            "</script>")
+    void updateByInsideBo(UnItpNodeStateBo bo);
+
+    @Update("<script>" +
+            "update ZHCX_ITP_PROJECT_NODE_STATE state, ZHCX_ITP_PROJECT_NODE_STATE_OUTSIDE side " +
+            "<set>" +
+            "state.OUTSTATE = #{conclusion}, state.OUTTIMES = #{inspectionCount}" +
+            "<if test=\"conclusion == '10' or conclusion == '30'\">" +
+            ", state.OUTCOMPLETETIME = #{complateTime}" +
+            "</if>" +
+            "</set>" +
+            "where state.ID = side.STATEID and side.INSPECTIONCODE = #{inspectionCode} and state.DELETED = '0' and side.DELETED = '0'" +
+            "</script>")
+    void updateByOutsideBo(UnItpNodeStateBo bo);
 }

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

@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bsentity.dto.*;
 import com.rongwei.bsentity.dto.inside.*;
 import com.rongwei.bsentity.dto.project.node.ProjectNodeStateBo;
+import com.rongwei.bsentity.dto.project.node.UnItpNodeStateBo;
 import com.rongwei.bsentity.vo.ZhcxInsideInspectionVo;
 import com.rongwei.commonservice.serial.service.SysSerialNumberService;
 import com.rongwei.rwadmincommon.system.domain.SysRoleDo;
@@ -848,6 +849,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
                 .insertList(new ArrayList<>())
                 .updateList(new ArrayList<>())
                 .insideStateList(new ArrayList<>())
+                .unItpList(new ArrayList<>())
                 .build();
 
         for(String insideId : req.getInsideIdList()) {
@@ -1816,11 +1818,45 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * operType 操作类型 10: 取消 20: 拒收 30: 派单 40: 转派 50: 接收 60: 有条件接收 70:修改检验开始结束时间
      */
     private void assembleResultToNodeState(InsideOperDto inOper, ProjectNodeStateBo nodeStateBo, Date complateTime) {
-        if(!"itp".equals(inOper.getInspection().getLaunchtype())) {
+
+        //非itp
+        if("unitp".equals(inOper.getInspection().getLaunchtype())) {
+
+            final UnItpNodeStateBo stateBo = UnItpNodeStateBo.builder()
+                    .inspectionCount(inOper.getInspection().getInspectioncount())
+                    .inspectionCode(inOper.getInspection().getInspectioncode())
+                    .type("inside")
+                    .build();
+
+            //取消
+            if("10".equals(inOper.getOperType())) {
+                stateBo.setConclusion("40");
+            }
+            //拒收
+            if("20".equals(inOper.getOperType())) {
+                stateBo.setConclusion("20");
+            }
+
+            //接收
+            if("50".equals(inOper.getOperType())) {
+                stateBo.setConclusion("10");
+                stateBo.setComplateTime(complateTime);
+            }
+
+            //有条件接收
+            if ("60".equals(inOper.getOperType())) {
+                stateBo.setConclusion("30");
+                stateBo.setComplateTime(complateTime);
+            }
+            nodeStateBo.getUnItpList().add(stateBo);
+
             return;
         }
-        ZhcxInsideInspectionDo itpDo = inOper.getInspection();
+        if(!"itp".equals(inOper.getInspection().getLaunchtype())) {
+            return ;
+        }
 
+        ZhcxInsideInspectionDo itpDo = inOper.getInspection();
         String machineNo = inOper.getInspection().getMachineno();
         if (StringUtils.isBlank(machineNo)) {
             machineNo = inOper.getInspection().getStructuremachineno();

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

@@ -12,10 +12,7 @@ import com.rongwei.bscommon.sys.dao.ZhcxItpProjectNodeStateDao;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bsentity.dto.OperDto;
 import com.rongwei.bsentity.dto.ZhcxItpProjectNodeStateResultDto;
-import com.rongwei.bsentity.dto.project.node.ProjectNodeStateBo;
-import com.rongwei.bsentity.dto.project.node.RelactionNodeStateBo;
-import com.rongwei.bsentity.dto.project.node.RelactionNodeStateInspectionBo;
-import com.rongwei.bsentity.dto.project.node.RelationInspectionRequest;
+import com.rongwei.bsentity.dto.project.node.*;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,6 +52,9 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
     @Autowired
     private ZhcxCommon zhcxCommon;
 
+    @Autowired
+    private ZhcxItpProjectNodeStateDao dao;
+
     /**
      * 获取项目各机号报验点状态
      *
@@ -151,6 +151,16 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
         if(ObjectUtil.isNotEmpty(nodeStateBo.getInsideStateList())) {
             nodeStateInsideService.saveBatch(nodeStateBo.getInsideStateList());
         }
+
+        if(ObjectUtil.isNotEmpty(nodeStateBo.getUnItpList())) {
+            for(UnItpNodeStateBo unState : nodeStateBo.getUnItpList()) {
+                if("inside".equals(unState.getType())) {
+                    dao.updateByInsideBo(unState);
+                } else if("outside".equals(unState.getType())) {
+                    dao.updateByOutsideBo(unState);
+                }
+            }
+        }
     }
 
     /**

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

@@ -23,6 +23,7 @@ import com.rongwei.bsentity.dto.*;
 import com.rongwei.bsentity.dto.outside.OutsideInspectionInsertRequest;
 import com.rongwei.bsentity.dto.outside.OutsideInspectionUpdateRequest;
 import com.rongwei.bsentity.dto.project.node.ProjectNodeStateBo;
+import com.rongwei.bsentity.dto.project.node.UnItpNodeStateBo;
 import com.rongwei.bsentity.vo.*;
 import com.rongwei.commonservice.serial.service.SysSerialNumberService;
 import com.rongwei.rwadmincommon.system.service.SysGeneralCRUDService;
@@ -235,6 +236,7 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                 .insertList(new ArrayList<>())
                 .updateList(new ArrayList<>())
                 .outsideStateList(new ArrayList<>())
+                .unItpList(new ArrayList<>())
                 .build();
 
         List<ZhcxOutsideInspectionItpOperLogDo> logList = new ArrayList<>();
@@ -332,6 +334,14 @@ 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);
+
             }
             //拒收
             else if ("20".equals(operType)) {
@@ -410,6 +420,32 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                 List<ZhcxItpProjectNodeStateResultDto> nodeStateResultList = zhcxItpProjectNodeStateService.getByItp(inspectionItpDo, operType);
                 assembleNodeState(nodeStateResultList, inspectionItpDo, nodeStateBo);
 
+                UnItpNodeStateBo stateBo = UnItpNodeStateBo.builder()
+                        .inspectionCount(inspectionItpDo.getInspectioncount())
+                        .inspectionCode(inspectionItpDo.getInspectioncode())
+                        .type("outside")
+                        .build();
+
+                //拒收
+                if("20".equals(operType)) {
+                    stateBo.setConclusion("20");
+                }
+
+                //接收
+                if("50".equals(operType)) {
+                    stateBo.setConclusion("10");
+                    stateBo.setComplateTime(inspectionItpDo.getInspectioncomplatetime());
+                }
+
+                //有条件接收
+                if ("60".equals(operType)) {
+                    stateBo.setConclusion("30");
+                    stateBo.setComplateTime(inspectionItpDo.getInspectioncomplatetime());
+                }
+
+
+                nodeStateBo.getUnItpList().add(stateBo);
+
             }
             /* 当前操作人 */
             if (user != null && user.getId() != null) {

+ 5 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/project/node/ProjectNodeStateBo.java

@@ -33,4 +33,9 @@ public class ProjectNodeStateBo {
      * 外部报验单
      */
     private List<ZhcxItpProjectNodeStateInsideDo> insideStateList;
+
+    /**
+     * 非itp
+     */
+    private List<UnItpNodeStateBo> unItpList;
 }

+ 40 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/project/node/UnItpNodeStateBo.java

@@ -0,0 +1,40 @@
+package com.rongwei.bsentity.dto.project.node;
+
+import lombok.*;
+
+import java.util.Date;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class UnItpNodeStateBo {
+
+    /**
+     * 报验单编码
+     */
+    private String inspectionCode;
+
+    /**
+     * 报验次数
+     */
+    private Integer inspectionCount;
+
+    /**
+     * 完成时间
+     */
+    private Date complateTime;
+
+    /**
+     * 报验结论:40:取消,10:接收,20:拒收,30:有条件接收,
+     */
+    private String conclusion;
+
+    /**
+     * 报验单类型
+     * inside: 内部
+     * outside: 外部
+     */
+    private String type;
+}