Browse Source

报验点状态报表改造

wangming 11 tháng trước cách đây
mục cha
commit
e663a2febf

+ 11 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxOutsideInspectionItpDao.java

@@ -1,5 +1,6 @@
 package com.rongwei.bscommon.sys.dao;
 
+import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwei.bsentity.dto.OutsideInspactionSyncDto;
@@ -57,4 +58,14 @@ public interface ZhcxOutsideInspectionItpDao extends BaseMapper<ZhcxOutsideInspe
             "</where>" +
             "</script>")
     List<OutsideInspactionSyncDto> getInspection(OutsideInspactionSyncReqquest req);
+
+    @Select("SELECT " +
+            " itp.*, " +
+            " dis.INSPECTIONCONCLUSION " +
+            "FROM " +
+            " ZHCX_OUTSIDE_INSPECTION_ITP itp " +
+            "JOIN ZHCX_OUTSIDE_INSPECTION_ITP_SUPERVISION_DISPATCH dis ON dis.ITPID = itp.ID AND dis.DELETED = '0' " +
+            "WHERE itp.DELETED = '0' " +
+            "AND INSPECTIONSTATUS IN ('30', '40')")
+    List<JSONObject> getInitNodeStateInspection();
 }

+ 14 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxItpProjectNodeStateService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpDo;
 import com.rongwei.bsentity.dto.ZhcxItpProjectNodeStateResultDto;
 import com.rongwei.bsentity.dto.project.node.ProjectNodeStateBo;
+import com.rongwei.bsentity.dto.project.node.RelationInspectionRequest;
 
 import java.util.List;
 
@@ -33,4 +34,17 @@ public interface ZhcxItpProjectNodeStateService extends IService<ZhcxItpProjectN
      * @param nodeStateBo
      */
     void saveNode(ProjectNodeStateBo nodeStateBo);
+
+    /**
+     * 关联报验单
+     *
+     * @param req
+     */
+    void relationInspection(RelationInspectionRequest req);
+
+    /**
+     * 初始化
+     *
+     */
+    void initRelationInspection();
 }

+ 6 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxOutsideInspectionItpService.java

@@ -1,5 +1,6 @@
 package com.rongwei.bscommon.sys.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpDo;
 import com.rongwei.bsentity.dto.OutsideInspactionSyncReqquest;
@@ -66,5 +67,10 @@ public interface ZhcxOutsideInspectionItpService extends IService<ZhcxOutsideIns
      * @param req
      */
     void sync2SubmissionPlatform(OutsideInspactionSyncReqquest req);
+
+    /**
+     * 获取初始化报验点状态报验单
+     */
+    List<JSONObject> getInitNodeStateInspection();
 }
 

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

@@ -238,6 +238,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
             InsideOperDto inOper = getInsideOperDto(insideId);
             inOper.setOperTime(operDto.getOperTime());
             inOper.setOperUser(operDto.getOperUser());
+            inOper.setOperType(operDto.getOperType());
 
             //校验
             String msg = checkParam4Cancel(inOper, req);
@@ -713,6 +714,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
             InsideOperDto inOper = getInsideOperDto(insideId);
             inOper.setOperTime(operDto.getOperTime());
             inOper.setOperUser(operDto.getOperUser());
+            inOper.setOperType(operDto.getOperType());
 //            if (ObjectUtil.isEmpty(inOper.getDispatch().getSupervisionid())) {
 //                log.info("单据号:".concat(inOper.getInspection().getInspectioncode()).concat("未派单,现将主表检验员覆盖到派单表上"));
 //                inOper.getDispatch().setSupervisionid(inOper.getInspection().getCheckerid());
@@ -1648,6 +1650,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
             stateInside.setStateid(stateDo.getId());
             stateInside.setInspectioncode(itpDo.getInspectioncode());
             stateInside.setLaunchtype(itpDo.getLaunchtype());
+            stateInside.setStateid(stateDo.getId());
             nodeStateBo.getInsideStateList().add(stateInside);
         }
     }

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

@@ -3,23 +3,24 @@ package com.rongwei.bscommon.sys.service.impl;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateInsideService;
-import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateOutsideService;
+import com.rongwei.bscommon.sys.service.*;
 import com.rongwei.bscommon.sys.utils.BusinessFunUtils;
-import com.rongwei.bsentity.domain.ZhcxItpProjectNodeStateDo;
+import com.rongwei.bscommon.sys.utils.ZhcxCommon;
+import com.rongwei.bsentity.domain.*;
 import com.rongwei.bscommon.sys.dao.ZhcxItpProjectNodeStateDao;
-import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpDo;
+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.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 
 /**
  * <p>
@@ -37,6 +38,22 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
 
     @Autowired
     private ZhcxItpProjectNodeStateInsideService nodeStateInsideService;
+
+    @Autowired
+    private ZhcxOutsideInspectionItpService outsideInspectionItpService;
+
+    @Autowired
+    private ZhcxOutsideInspectionItpSupervisionDispatchService outsideInspectionItpSupervisionDispatchService;
+
+    @Autowired
+    private ZhcxInsideInspectionService insideInspectionService;
+
+    @Autowired
+    private ZhcxInsideInspectionDispatchService insideInspectionDispatchService;
+
+    @Autowired
+    private ZhcxCommon zhcxCommon;
+
     /**
      * 获取项目各机号报验点状态
      *
@@ -135,6 +152,288 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
         }
     }
 
+    /**
+     * 关联报验单
+     *
+     * @param req
+     */
+    @Override
+    public void relationInspection(RelationInspectionRequest req) {
+        List<RelactionNodeStateBo> stateBoList = null;
+        if("outside".equals(req.getType())) {
+            stateBoList = assembleRelationByOutside(req);
+        } else if("inside".equals(req.getType())) {
+            stateBoList = assembleRelationByInside(req);
+        }
+
+        SysUserVo user = zhcxCommon.getCurrentUser();
+
+        OperDto oper = new OperDto();
+        oper.setOperTime(new Date());
+        oper.setOperUser(user);
+
+        //保存关联关系
+        relationInspection(stateBoList, oper);
+    }
+
+    /**
+     * 初始化
+     *
+     */
+    @Override
+    public void initRelationInspection() {
+        //外部报验单
+
+        //内部报验单
+    }
+
+    /**
+     * 保存外部报验单
+     */
+    private void saveNodeStatusOutside() {
+
+    }
+
+    /**
+     * 组装内部报验单参数
+     *
+     * @param req
+     * @return
+     */
+    private List<RelactionNodeStateBo> assembleRelationByInside(RelationInspectionRequest req) {
+
+        //外部报验单
+        Collection<ZhcxInsideInspectionDo> insideList = insideInspectionService.listByIds(req.getSideIdList());
+
+        if(ObjectUtil.isEmpty(insideList)) {
+            return Collections.emptyList();
+        }
+
+        List<RelactionNodeStateBo> result = new ArrayList<>();
+
+        List<String> machineNoList = new ArrayList<>();
+        machineNoList.addAll(splitMachineNo(req.getMachineNo()));
+
+        //外部报验单
+        for(ZhcxInsideInspectionDo inside : insideList) {
+            String machineNos = getMachinesNoByInside(inside);
+            machineNoList.addAll(splitMachineNo(machineNos));
+
+            machineNoList = new ArrayList<>(new HashSet<>(machineNoList));
+
+            ZhcxInsideInspectionDispatchDo dispatchDo = null;
+            if(!"40".equals(inside.getInspectionstatus())) {
+                LambdaQueryWrapper<ZhcxInsideInspectionDispatchDo> queryWrapper = Wrappers.lambdaQuery();
+                queryWrapper.eq(ZhcxInsideInspectionDispatchDo::getDeleted, "0")
+                        .eq(ZhcxInsideInspectionDispatchDo::getInsideid, inside.getId());
+                dispatchDo = insideInspectionDispatchService.getOne(queryWrapper);
+            }
+
+            //机号
+            for(String machineNo : machineNoList) {
+                RelactionNodeStateBo nodeStateBo = RelactionNodeStateBo.builder()
+                        .machineNo(machineNo)
+                        .projectId(inside.getProjectid())
+                        .projectCode(inside.getProjectcode())
+                        .projectName(inside.getProjectname())
+                        .nodeId(req.getNodeId())
+                        .inspectionCount(inside.getInspectioncount())
+                        .complateTime(inside.getInspectioncomplatetime())
+                        .type("inside")
+                        .build();
+
+                if("40".equals(inside.getInspectionstatus())) {
+                    nodeStateBo.setConclusion("40");
+                } else {
+                    nodeStateBo.setConclusion(dispatchDo.getInspectionconclusion());
+                }
+
+                List<RelactionNodeStateInspectionBo> inspectionList = new ArrayList<>(1);
+                inspectionList.add(RelactionNodeStateInspectionBo.builder()
+                        .inspectionCode(inside.getInspectioncode())
+                        .inspectionId(inside.getId())
+                        .launchType(inside.getLaunchtype())
+                        .build());
+                nodeStateBo.setInspectionList(inspectionList);
+
+                result.add(nodeStateBo);
+            }
+
+        }
+
+        return result;
+    }
+
+    /**
+     * 组装外部报验单参数
+     *
+     * @param req
+     * @return
+     */
+    private List<RelactionNodeStateBo> assembleRelationByOutside(RelationInspectionRequest req) {
+
+        //外部报验单
+        Collection<ZhcxOutsideInspectionItpDo> outsideList = outsideInspectionItpService.listByIds(req.getSideIdList());
+
+        if(ObjectUtil.isEmpty(outsideList)) {
+            return Collections.emptyList();
+        }
+
+        List<RelactionNodeStateBo> result = new ArrayList<>();
+
+        List<String> machineNoList = new ArrayList<>();
+        machineNoList.addAll(splitMachineNo(req.getMachineNo()));
+
+        //外部报验单
+        for(ZhcxOutsideInspectionItpDo outside : outsideList) {
+            String machineNos = getMachinesNoByItp(outside);
+            machineNoList.addAll(splitMachineNo(machineNos));
+
+            ZhcxOutsideInspectionItpSupervisionDispatchDo dispatchDo = null;
+            if(!"40".equals(outside.getInspectionstatus())) {
+                LambdaQueryWrapper<ZhcxOutsideInspectionItpSupervisionDispatchDo> queryWrapper = Wrappers.lambdaQuery();
+                queryWrapper.eq(ZhcxOutsideInspectionItpSupervisionDispatchDo::getDeleted, "0")
+                        .eq(ZhcxOutsideInspectionItpSupervisionDispatchDo::getItpid, outside.getId());
+                dispatchDo = outsideInspectionItpSupervisionDispatchService.getOne(queryWrapper);
+            }
+
+            //机号
+            for(String machineNo : machineNoList) {
+                RelactionNodeStateBo nodeStateBo = RelactionNodeStateBo.builder()
+                        .machineNo(machineNo)
+                        .projectId(outside.getProjectid())
+                        .projectCode(outside.getProjectcode())
+                        .projectName(outside.getProjectname())
+                        .nodeId(req.getNodeId())
+                        .inspectionCount(outside.getInspectioncount())
+                        .complateTime(outside.getInspectioncomplatetime())
+                        .type("outside")
+                        .build();
+
+                if("40".equals(outside.getInspectionstatus())) {
+                    nodeStateBo.setConclusion("40");
+                } else {
+                    nodeStateBo.setConclusion(dispatchDo.getInspectionconclusion());
+                }
+
+                List<RelactionNodeStateInspectionBo> inspectionList = new ArrayList<>(1);
+                inspectionList.add(RelactionNodeStateInspectionBo.builder()
+                        .inspectionCode(outside.getInspectioncode())
+                        .inspectionId(outside.getId())
+                        .launchType(outside.getLaunchtype())
+                        .build());
+                nodeStateBo.setInspectionList(inspectionList);
+
+                result.add(nodeStateBo);
+            }
+
+        }
+
+        return result;
+    }
+
+    /**
+     * 关联报验单
+     *
+     * @param list
+     * @param oper
+     */
+    private void relationInspection(List<RelactionNodeStateBo> list, OperDto oper) {
+        if(ObjectUtil.isEmpty(list)) {
+            return ;
+        }
+
+        ProjectNodeStateBo prjNodeState = ProjectNodeStateBo.builder()
+                .insertList(new ArrayList<>())
+                .updateList(new ArrayList<>())
+                .insideStateList(new ArrayList<>())
+                .outsideStateList(new ArrayList<>())
+                .build();
+        for(RelactionNodeStateBo state : list) {
+            LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, state.getProjectId())
+                    .eq(ZhcxItpProjectNodeStateDo::getMathinecode, state.getMachineNo())
+                    .eq(ZhcxItpProjectNodeStateDo::getNodeid, state.getNodeId());
+            List<ZhcxItpProjectNodeStateDo> stateList = list(queryWrapper);
+            ZhcxItpProjectNodeStateDo stateDo = BusinessFunUtils.getPrjNodeState(stateList);
+
+            ZhcxItpProjectNodeStateDo entity = new ZhcxItpProjectNodeStateDo();
+            //内部报验单
+            if("inside".equals(state.getType())) {
+                entity.setIntimes(state.getInspectionCount());
+                entity.setInstate(state.getConclusion());
+
+                if("10".equals(state.getConclusion()) || "30".equals(state.getConclusion())) {
+                    entity.setIncompletetime(state.getComplateTime());
+                }
+            }
+            //外部
+            else {
+                entity.setOuttimes(state.getInspectionCount());
+                entity.setOutstate(state.getConclusion());
+
+                if("10".equals(state.getConclusion()) || "30".equals(state.getConclusion())) {
+                    entity.setOutcompletetime(state.getComplateTime());
+                }
+            }
+
+            if(ObjectUtil.isNull(stateDo)) {
+                entity.setId(SecurityUtil.getUUID());
+                entity.setMathinecode(state.getMachineNo());
+                entity.setPrjid(state.getProjectId());
+                entity.setNodeid(state.getNodeId());
+                entity.setDeleted("0");
+                prjNodeState.getInsertList().add(entity);
+            } else {
+                entity.setId(stateDo.getId());
+                prjNodeState.getUpdateList().add(entity);
+            }
+
+            if("inside".equals(state.getType())) {
+                //内部报验报验点明细
+                for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
+                    //同一个报验点,只能存一份
+                    LambdaQueryWrapper<ZhcxItpProjectNodeStateInsideDo> delWrapper = Wrappers.lambdaQuery();
+                    delWrapper.eq(ZhcxItpProjectNodeStateInsideDo::getInsideid, nodeInspection.getInspectionId())
+                            .eq(ZhcxItpProjectNodeStateInsideDo::getStateid, entity.getId());
+                    nodeStateInsideService.remove(delWrapper);
+
+                    ZhcxItpProjectNodeStateInsideDo insideState = new ZhcxItpProjectNodeStateInsideDo();
+                    insideState.setId(SecurityUtil.getUUID());
+                    insideState.setInspectioncode(nodeInspection.getInspectionCode());
+                    insideState.setLaunchtype(nodeInspection.getLaunchType());
+                    insideState.setDeleted("0");
+                    insideState.setStateid(entity.getId());
+                    insideState.setInsideid(nodeInspection.getInspectionId());
+
+                    prjNodeState.getInsideStateList().add(insideState);
+                }
+            } else {
+                //外部报验报验点明细
+                for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
+                    //同一个报验点,只能存一份
+                    LambdaQueryWrapper<ZhcxItpProjectNodeStateOutsideDo> delWrapper = Wrappers.lambdaQuery();
+                    delWrapper.eq(ZhcxItpProjectNodeStateOutsideDo::getOutsideid, nodeInspection.getInspectionId())
+                            .eq(ZhcxItpProjectNodeStateOutsideDo::getStateid, entity.getId());
+                    nodeStateOutsideService.remove(delWrapper);
+
+                    ZhcxItpProjectNodeStateOutsideDo outsideState = new ZhcxItpProjectNodeStateOutsideDo();
+                    outsideState.setId(SecurityUtil.getUUID());
+                    outsideState.setInspectioncode(nodeInspection.getInspectionCode());
+                    outsideState.setLaunchtype(nodeInspection.getLaunchType());
+                    outsideState.setDeleted("0");
+                    outsideState.setStateid(entity.getId());
+                    outsideState.setOutsideid(nodeInspection.getInspectionId());
+
+                    prjNodeState.getOutsideStateList().add(outsideState);
+                }
+            }
+        }
+
+        //持久化
+        saveNode(prjNodeState);
+    }
+
     /**
      * 选择机号
      *
@@ -148,4 +447,32 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
 
         return itpDo.getStructuremachineno();
     }
+
+    /**
+     * 选择机号
+     *
+     * @param itpDo
+     * @return
+     */
+    private String getMachinesNoByInside(ZhcxInsideInspectionDo itpDo) {
+        if(ObjectUtil.isNotEmpty(itpDo.getMachineno())) {
+            return itpDo.getMachineno();
+        }
+
+        return itpDo.getStructuremachineno();
+    }
+
+    /**
+     * 拆分机号
+     *
+     * @param machineNo
+     * @return
+     */
+    private List<String> splitMachineNo(String machineNo) {
+        if(ObjectUtil.isEmpty(machineNo)) {
+            return Collections.emptyList();
+        }
+
+        return Arrays.asList(machineNo.split(","));
+    }
 }

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

@@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -528,7 +529,8 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
             outsideState.setInspectioncode(inspectionItpDo.getInspectioncode());
             outsideState.setLaunchtype(inspectionItpDo.getLaunchtype());
             outsideState.setDeleted("0");
-            outsideState.setOutsideid(resultDto.getEntity().getId());
+            outsideState.setStateid(resultDto.getEntity().getId());
+            outsideState.setOutsideid(inspectionItpDo.getId());
 
             nodeStateBo.getOutsideStateList().add(outsideState);
         }
@@ -1247,6 +1249,14 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         syncRecordService.saveBatch(recordList);
     }
 
+    /**
+     * 获取初始化报验点状态报验单
+     */
+    @Override
+    public List<JSONObject> getInitNodeStateInspection() {
+        return dao.getInitNodeStateInspection();
+    }
+
     private void getIds(String files, List<String> fileIds) {
         String[] split = files.split("\\^_\\^");
         for(String fileItem : split){

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

@@ -0,0 +1,66 @@
+package com.rongwei.bsentity.dto.project.node;
+
+import lombok.*;
+
+import java.util.Date;
+import java.util.List;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class RelactionNodeStateBo {
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 编码
+     */
+    private String projectCode;
+
+    /**
+     * 名称
+     */
+    private String projectName;
+
+    /**
+     * 项目报验点id
+     */
+    private String nodeId;
+
+    /**
+     * 机号
+     */
+    private String machineNo;
+
+    /**
+     * 类型:40:取消,10:接收,20:拒收,30:有条件接收,
+     */
+    private String conclusion;
+
+    /**
+     * 报验次数
+     */
+    private Integer inspectionCount;
+
+    /**
+     * 报验完成时间
+     */
+    private Date complateTime;
+
+    /**
+     * 报验单类型
+     * inside: 内部
+     * outside: 外部
+     */
+    private String type;
+
+    /**
+     * 报验单列表
+     */
+    private List<RelactionNodeStateInspectionBo> inspectionList;
+}

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

@@ -0,0 +1,26 @@
+package com.rongwei.bsentity.dto.project.node;
+
+import lombok.*;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class RelactionNodeStateInspectionBo {
+
+    /**
+     * 报验单id
+     */
+    private String inspectionId;
+
+    /**
+     * 报验单编码
+     */
+    private String inspectionCode;
+
+    /**
+     * 报验单发起类型
+     */
+    private String launchType;
+}

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

@@ -0,0 +1,34 @@
+package com.rongwei.bsentity.dto.project.node;
+
+import lombok.*;
+
+import java.util.List;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class RelationInspectionRequest {
+
+    /**
+     * 报验单id
+     */
+    private List<String> sideIdList;
+
+    /**
+     * inside: 内部
+     * outside: 外部
+     */
+    private String type;
+
+    /**
+     * 项目报验点id
+     */
+    private String nodeId;
+
+    /**
+     * 机号
+     */
+    private String machineNo;
+}

+ 34 - 0
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxItpProjectNodeStateController.java

@@ -0,0 +1,34 @@
+package com.rongwei.bsserver.controller;
+
+import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateService;
+import com.rongwei.bsentity.dto.project.node.RelationInspectionRequest;
+import com.rongwei.rwcommon.base.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/project/node/state")
+@Api(tags = "itp地图项目报验点状态")
+public class ZhcxItpProjectNodeStateController {
+
+    @Autowired
+    private ZhcxItpProjectNodeStateService service;
+
+    /**
+     * 关联报验单
+     *
+     * @param req
+     * @return
+     */
+    @ApiOperation("关联报验单")
+    @PostMapping("/relation")
+    public R relationInspection(@RequestBody RelationInspectionRequest req){
+        service.relationInspection(req);
+        return R.ok();
+    }
+}