Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

sola 11 hónapja
szülő
commit
5ff50c4ac1

+ 2 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxInsideInspectionDao.java

@@ -76,8 +76,8 @@ public interface ZhcxInsideInspectionDao extends BaseMapper<ZhcxInsideInspection
             "  ziid.INSPECTIONCONCLUSION   " +
             " FROM   " +
             "  ZHCX_INSIDE_INSPECTION zii  " +
-            " JOIN ZHCX_INSIDE_INSPECTION_DISPATCH ziid ON ziid.INSIDEID = zii.ID AND ziid.DELETED = '0'   " +
+            " left JOIN ZHCX_INSIDE_INSPECTION_DISPATCH ziid ON ziid.INSIDEID = zii.ID AND ziid.DELETED = '0'   " +
             " WHERE zii.DELETED = '0'   " +
-            " AND zii.INSPECTIONSTATUS IN ('30', '40') ORDER by zii.CREATEDATE ASC")
+            " AND zii.INSPECTIONSTATUS IN ('30', '40') ORDER by zii.INSPECTIONCODE ASC")
     List<JSONObject> getInitNodeStateInspection();
 }

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

@@ -64,8 +64,8 @@ public interface ZhcxOutsideInspectionItpDao extends BaseMapper<ZhcxOutsideInspe
             " 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' " +
+            "left 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') ORDER by itp.CREATEDATE ASC")
+            "AND INSPECTIONSTATUS IN ('30', '40') ORDER by itp.INSPECTIONCODE ASC")
     List<JSONObject> getInitNodeStateInspection();
 }

+ 10 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxInsideInspectionCoreIndicatorsService.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.service;
 
 import com.rongwei.bsentity.domain.ZhcxInsideInspectionCoreIndicatorsDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.rwcommon.vo.generalsql.SlaveDMLVo;
 
 import java.util.List;
 
@@ -30,4 +31,13 @@ public interface ZhcxInsideInspectionCoreIndicatorsService extends IService<Zhcx
      * @param newIinsideIdList
      */
     void copyByInsideId(String insideId, List<String> newIinsideIdList);
+
+    /**
+     * 更改记录
+     *
+     * @param insideId
+     * @param update
+     * @return
+     */
+    List<String> editColsHistory(String insideId, SlaveDMLVo update);
 }

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

@@ -34,6 +34,20 @@ public interface ZhcxInsideInspectionService extends IService<ZhcxInsideInspecti
      */
     void updateInspection(InsideInspectionUpdateRequest req);
 
+    /**
+     * 暂存-保存
+     *
+     * @param req
+     */
+    void saveStaging4Insert(InsideInspectionInsertRequest req);
+
+    /**
+     * 暂存-更新
+     *
+     * @param req
+     */
+    void saveStaging4Update(InsideInspectionUpdateRequest req);
+
     /**
      * 发起
      *

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

@@ -1,16 +1,20 @@
 package com.rongwei.bscommon.sys.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.rongwei.bsentity.domain.ZhcxInsideInspectionCoreIndicatorsDo;
 import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionCoreIndicatorsDao;
 import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionCoreIndicatorsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.rwcommon.vo.generalsql.GeneralUpdateVo;
+import com.rongwei.rwcommon.vo.generalsql.SlaveDMLVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -59,4 +63,261 @@ public class ZhcxInsideInspectionCoreIndicatorsServiceImpl extends ServiceImpl<Z
             dao.insertBySelect(map);
         }
     }
+
+    /**
+     * 更改记录
+     *
+     * @param insideId
+     * @param update
+     * @return
+     */
+    @Override
+    public List<String> editColsHistory(String insideId, SlaveDMLVo update) {
+        final LambdaQueryWrapper<ZhcxInsideInspectionCoreIndicatorsDo> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(ZhcxInsideInspectionCoreIndicatorsDo::getInsideid, insideId)
+                .eq(ZhcxInsideInspectionCoreIndicatorsDo::getDeleted, "0");
+        final List<ZhcxInsideInspectionCoreIndicatorsDo> list = list(queryWrapper);
+
+        return editCosHistory(list, update.getSlaveUpdate());
+    }
+
+    /**
+     * 找出修改记录
+     *
+     * @param coreList
+     * @param slaveUpdate
+     * @return
+     */
+    private List<String> editCosHistory(List<ZhcxInsideInspectionCoreIndicatorsDo> coreList, List<GeneralUpdateVo> slaveUpdate) {
+        if(ObjectUtil.isEmpty(coreList) && ObjectUtil.isEmpty(slaveUpdate)) {
+            return Collections.emptyList();
+        }
+
+        List<String> result = new ArrayList<>();
+        if(ObjectUtil.isEmpty(coreList) && ObjectUtil.isNotEmpty(slaveUpdate)) {
+//            for(GeneralUpdateVo update : slaveUpdate) {
+//                difSelfCoreIndicatorCoreNull4Update(update.getUpdatecolumns(), result);
+//            }
+            result.add("添加核心检验指标");
+            return result;
+        }
+        if(ObjectUtil.isEmpty(slaveUpdate) && ObjectUtil.isNotEmpty(coreList)) {
+//            for(ZhcxInsideInspectionCoreIndicatorsDo core : coreList) {
+//                difSelfCoreIndicatorUpdateNull4Entity(core, result);
+//            }
+            result.add("移除核心检验指标");
+            return result;
+        }
+
+        Map<String, ZhcxInsideInspectionCoreIndicatorsDo> coreMap = new HashMap<>(coreList.size());
+        coreList.stream().forEach(item -> coreMap.put(item.getId(), item));
+
+        for(GeneralUpdateVo update : slaveUpdate) {
+            String id = update.getUpdatecolumns().get("ID").toString();
+            ZhcxInsideInspectionCoreIndicatorsDo indicators = coreMap.get(id);
+
+            if(ObjectUtil.isNull(indicators)) {
+                difSelfCoreIndicatorCoreNull4Update(update.getUpdatecolumns(), result);
+                continue;
+            }
+
+            difSelfCoreIndicator(indicators, update.getUpdatecolumns(), result);
+        }
+
+        return result;
+    }
+
+    /**
+     * 自检员实测记录不同
+     *
+     * @param core
+     * @param updatecolumns
+     * @param result
+     */
+    private void diffSelfActualRecord(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String,Object> updatecolumns, List<String> result) {
+        if(ObjectUtil.isEmpty(core.getSelfactualrecord()) && ObjectUtil.isNull(updatecolumns.get("SELFACTUALRECORD"))) {
+            return ;
+        }
+
+        if(ObjectUtil.isEmpty(core.getSelfactualrecord()) && ObjectUtil.isNotNull(updatecolumns.get("SELFACTUALRECORD"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员实测记录:"
+                    , "空变更为:"
+                    , updatecolumns.get("SELFACTUALRECORD").toString()
+            );
+            result.add(reservationinspectiontime);
+            return ;
+        }
+
+        if(ObjectUtil.isNotEmpty(core.getSelfactualrecord()) && ObjectUtil.isNull(updatecolumns.get("SELFACTUALRECORD"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员实测记录:"
+                    , core.getSelfactualrecord()
+                    , "变更为空"
+            );
+            result.add(reservationinspectiontime);
+            return ;
+        }
+
+        if(core.getSelfactualrecord().equals(updatecolumns.get("SELFACTUALRECORD").toString())) {
+            return ;
+        }
+
+        String reservationinspectiontime = StrUtil.concat(true, "自检员实测记录:"
+                , core.getSelfactualrecord()
+                , "变更为"
+                , updatecolumns.get("SELFACTUALRECORD").toString()
+        );
+        result.add(reservationinspectiontime);
+    }
+
+    /**
+     * 自检员判定结果不同
+     *
+     * @param core
+     * @param updatecolumns
+     * @param result
+     */
+    private void diffSelfResult(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String,Object> updatecolumns, List<String> result) {
+        if(ObjectUtil.isEmpty(core.getSelfresult()) && ObjectUtil.isNull(updatecolumns.get("SELFRESULT"))) {
+            return ;
+        }
+
+        if(ObjectUtil.isEmpty(core.getSelfresult()) && ObjectUtil.isNotNull(updatecolumns.get("SELFRESULT"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员结果判定:"
+                    , "空变更为:"
+                    , updatecolumns.get("SELFRESULT").toString()
+            );
+            result.add(reservationinspectiontime);
+            return ;
+        }
+
+        if(ObjectUtil.isNotEmpty(core.getSelfresult()) && ObjectUtil.isNull(updatecolumns.get("SELFRESULT"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员结果判定:"
+                    , core.getSelfresult()
+                    , "变更为空"
+            );
+            result.add(reservationinspectiontime);
+            return;
+        }
+
+        if(core.getSelfresult().equals(updatecolumns.get("SELFRESULT").toString())) {
+            return ;
+        }
+
+        String reservationinspectiontime = StrUtil.concat(true, "自检员结果判定:"
+                , core.getSelfresult()
+                , "变更为"
+                , updatecolumns.get("SELFRESULT").toString()
+        );
+        result.add(reservationinspectiontime);
+    }
+
+    /**
+     * 自检员备注不同
+     *
+     * @param core
+     * @param updatecolumns
+     * @param result
+     */
+    private void diffSelfRemark(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String,Object> updatecolumns, List<String> result) {
+        if(ObjectUtil.isEmpty(core.getSelfremark()) && ObjectUtil.isNull(updatecolumns.get("SELFREMARK"))) {
+            return ;
+        }
+
+        if(ObjectUtil.isEmpty(core.getSelfremark()) && ObjectUtil.isNotNull(updatecolumns.get("SELFREMARK"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员备注:"
+                    , "空变更为:"
+                    , updatecolumns.get("SELFREMARK").toString()
+            );
+            result.add(reservationinspectiontime);
+            return ;
+        }
+
+        if(ObjectUtil.isNotEmpty(core.getSelfremark()) && ObjectUtil.isNull(updatecolumns.get("SELFREMARK"))) {
+            String reservationinspectiontime = StrUtil.concat(true, "自检员备注:"
+                    , core.getSelfremark()
+                    , "变更为空"
+            );
+            result.add(reservationinspectiontime);
+            return ;
+        }
+
+        if(core.getSelfremark().equals(updatecolumns.get("SELFREMARK").toString())) {
+            return ;
+        }
+
+        String reservationinspectiontime = StrUtil.concat(true, "自检员备注:"
+                , core.getSelfremark()
+                , "变更为"
+                , updatecolumns.get("SELFREMARK").toString()
+        );
+        result.add(reservationinspectiontime);
+    }
+
+    /**
+     * 单个核心检验指标不同
+     *
+     * @param core
+     * @param updatecolumns
+     * @param result
+     */
+    private void difSelfCoreIndicator(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String,Object> updatecolumns, List<String> result) {
+
+        List<String> updateCols = new ArrayList<>();
+        StringBuilder editRow = new StringBuilder("检查项:");
+        if(ObjectUtil.isNull(updatecolumns.get("INSPECTON_ITEMS"))) {
+            editRow.append(StringUtils.toString(core.getInspectonItems(), ""));
+        } else {
+            editRow.append(StringUtils.toString(updatecolumns.get("INSPECTON_ITEMS"), ""));
+        }
+
+        //自检员实测记录
+        diffSelfActualRecord(core, updatecolumns, updateCols);
+        //判定结果
+        diffSelfResult(core, updatecolumns, updateCols);
+        //判定结果
+        diffSelfRemark(core, updatecolumns, updateCols);
+
+        if(ObjectUtil.isEmpty(updateCols)) {
+            return ;
+        }
+
+        editRow.append(StringUtils.join(updateCols, ","));
+        result.add(editRow.toString());
+    }
+
+    /**
+     * 单个核心检验指标不同
+     *
+     * @param updateRow
+     * @param result
+     */
+    private void difSelfCoreIndicatorCoreNull4Update(Map<String,Object> updateRow, List<String> result) {
+
+        if(ObjectUtil.isNull(updateRow)) {
+            return ;
+        }
+
+        ZhcxInsideInspectionCoreIndicatorsDo empty = new ZhcxInsideInspectionCoreIndicatorsDo();
+
+        //修改记录
+        difSelfCoreIndicator(empty, updateRow, result);
+    }
+
+    /**
+     * 单个核心检验指标不同
+     *
+     * @param core
+     * @param result
+     */
+    private void difSelfCoreIndicatorUpdateNull4Entity(ZhcxInsideInspectionCoreIndicatorsDo core, List<String> result) {
+
+        if(ObjectUtil.isNull(core)) {
+            return ;
+        }
+
+        Map<String, Object> emptyMap = Collections.emptyMap();
+
+        //修改记录
+        difSelfCoreIndicator(core, emptyMap, result);
+    }
 }

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

@@ -33,6 +33,7 @@ import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
 import com.rongwei.rwcommon.vo.generalsql.MasterSlaveUpdateVo;
+import com.rongwei.rwcommon.vo.generalsql.SlaveDMLVo;
 import com.rongwei.rwcommoncomponent.excel.aspose.ExcelFormData;
 import com.rongwei.rwcommoncomponent.excel.vo.FormData;
 import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
@@ -140,9 +141,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
 
             //生成修改记录
             //报验单中编码不存在,为首次提交,不需要生成修改记录
-            if(ObjectUtil.isNotEmpty(inspection.getInspectioncode())) {
-                saveEditHistory(inspection, req);
-            }
+            //暂存也需要产生操作记录2024年9月4日
+//            if(ObjectUtil.isNotEmpty(inspection.getInspectioncode())) {
+//                saveEditHistory(inspection, req);
+//            }
+            saveEditHistory(inspection, req);
 
             //保存单据
             try {
@@ -173,6 +176,75 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         }
     }
 
+    /**
+     * 暂存-保存
+     *
+     * @param req
+     */
+    @Override
+    public void saveStaging4Insert(InsideInspectionInsertRequest req) {
+
+        SysUserVo user = zhcxCommon.getCurrentUser();
+        final Date nowDate = new Date();
+        final String nowDateStr = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
+
+        req.getInsert().getMasterInsert().getInsertcolumns().put("INSPECTIONSTATUS", "10");
+        req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEUSERID", user.getId());
+        req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEUSERNAME", user.getName());
+        req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEDATE", nowDateStr);
+        req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYUSERID", user.getId());
+        req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYUSERNAME", user.getName());
+        req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYDATE", nowDateStr);
+
+        //保存单据
+        try {
+            generalCRUDService.generalMsInsert(req.getInsert());
+        } catch (Exception e) {
+            log.error("保存失败: {}", e);
+            throw new CustomException("保存失败");
+        }
+
+        //生成操作记录
+        InsideOperLogDto operLogDto = InsideOperLogDto.builder()
+                .id(req.getId())
+                .operType("90")
+                .launchSource(ObjectUtil.isEmpty(req.getLaunchSource()) ? "mobile" : req.getLaunchSource())
+                .build();
+        operLogDto.setOperUser(user);
+        operLogDto.setOperTime(nowDate);
+        operLogService.saveOperLog(operLogDto);
+    }
+
+    /**
+     * 暂存-更新
+     *
+     * @param req
+     */
+    @Override
+    public void saveStaging4Update(InsideInspectionUpdateRequest req) {
+
+        ZhcxInsideInspectionDo inspection = this.getById(req.getId());//报验单
+
+        //生成记录
+        saveEditHistory(inspection, req);
+
+        SysUserVo user = zhcxCommon.getCurrentUser();
+        final Date nowDate = new Date();
+        final String nowDateStr = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
+
+        req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYUSERID", user.getId());
+        req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYUSERNAME", user.getName());
+        req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYDATE", nowDateStr);
+
+        //保存单据
+        try {
+            generalCRUDService.generalMsUpdate(req.getUpdate());
+        } catch (Exception e) {
+            log.error("保存失败: {}", e);
+            throw new CustomException("保存失败");
+        }
+    }
+
     /**
      * 保存重新报验
      *
@@ -649,7 +721,19 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
     private void saveEditHistory(ZhcxInsideInspectionDo inspection, InsideInspectionUpdateRequest req) {
         Map<String, String> descMap = new HashMap<>();
 
+        //主表单
         List<String> editList = editColsHistory(inspection, req.getUpdate().getMasterUpdate().getUpdatecolumns());
+
+        //核心检验指标
+        if(ObjectUtil.isNotEmpty(req.getUpdate().getSlaveUpdate())) {
+            final Optional<SlaveDMLVo> first = req.getUpdate().getSlaveUpdate().stream()
+                    .filter(item -> "ZHCX_INSIDE_INSPECTION_CORE_INDICATORS".equals(item.getTableName())).findFirst();
+            if(first.isPresent()) {
+                final List<String> list = insideInspectionCoreIndicatorsService.editColsHistory(inspection.getId(), first.get());
+                editList.addAll(list);
+            }
+        }
+
         if(ObjectUtil.isNotEmpty(editList)) {
             descMap.put(req.getId(), StringUtils.join(editList, "; "));
         }
@@ -1027,6 +1111,18 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
                 .eq(ZhcxInsideInspectionDispatchDo::getDeleted, "0");
         ZhcxInsideInspectionDispatchDo dispatch = dispatchService.getOne(dispatchLambdaQueryWrapper);
 
+        //操作日志
+        List<String> editList = editColsHistory(inside, masterSlaveUpdate.getMasterUpdate().getUpdatecolumns());
+        //核心检验指标
+        if(ObjectUtil.isNotEmpty(masterSlaveUpdate.getSlaveUpdate())) {
+            final Optional<SlaveDMLVo> first = masterSlaveUpdate.getSlaveUpdate().stream()
+                    .filter(item -> "ZHCX_INSIDE_INSPECTION_CORE_INDICATORS".equals(item.getTableName())).findFirst();
+            if(first.isPresent()) {
+                final List<String> list = insideInspectionCoreIndicatorsService.editColsHistory(id, first.get());
+                editList.addAll(list);
+            }
+        }
+
         //保存历史
         saveReHistory(inside, dispatch);
 
@@ -1034,7 +1130,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         saveReNew(inside, dispatch, masterSlaveUpdate);
 
         //修改字段
-        return editColsHistory(inside, masterSlaveUpdate.getMasterUpdate().getUpdatecolumns());
+        return editList;
     }
 
     /**
@@ -1129,9 +1225,20 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         }
 
         //项目工号
-        if(!oldInside.getProjectcode().equals(updatecolumns.get("PROJECTCODE").toString())) {
-            String projectcode = StrUtil.concat(true, "项目工号:", oldInside.getProjectcode()
-                    , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
+        String projectcode = null;
+        if(ObjectUtil.isEmpty(oldInside.getProjectcode())) {
+            if(ObjectUtil.isNotNull(updatecolumns.get("PROJECTCODE"))) {
+                projectcode = StrUtil.concat(true, "项目工号"
+                        , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
+
+            }
+        } else {
+            if(!oldInside.getProjectcode().equals(StringUtils.toString(updatecolumns.get("PROJECTCODE"), null))) {
+                projectcode = StrUtil.concat(true, "项目工号:", oldInside.getProjectcode()
+                        , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
+            }
+        }
+        if(ObjectUtil.isNotEmpty(projectcode)) {
             editDataList.add(projectcode);
         }
 
@@ -1192,24 +1299,58 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         }
 
         //构件名称
-        if(!oldInside.getStructurename().equals(updatecolumns.get("STRUCTURENAME").toString())) {
-            String structurename = StrUtil.concat(true, "构件名称:", oldInside.getStructurename()
-                    , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
+        String structurename = null;
+        if(ObjectUtil.isEmpty(oldInside.getStructurename())) {
+            if(ObjectUtil.isNotNull(updatecolumns.get("STRUCTURENAME"))) {
+                structurename = StrUtil.concat(true, "构件名称"
+                        , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
+
+            }
+        } else {
+            if(!oldInside.getStructurename().equals(StringUtils.toString(updatecolumns.get("STRUCTURENAME"), null))) {
+                structurename = StrUtil.concat(true, "构件名称:", oldInside.getStructurename()
+                        , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
+            }
+        }
+        if(ObjectUtil.isNotEmpty(structurename)) {
             editDataList.add(structurename);
         }
 
         //报验内容
-        if(!oldInside.getInspectioncontent().equals(updatecolumns.get("INSPECTIONCONTENT").toString())) {
-            String structurename = StrUtil.concat(true, "报验内容:", oldInside.getInspectioncontent()
-                    , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
-            editDataList.add(structurename);
+        String inspectionContent = null;
+        if(ObjectUtil.isEmpty(oldInside.getInspectioncontent())) {
+            if(ObjectUtil.isNotNull(updatecolumns.get("INSPECTIONCONTENT"))) {
+                inspectionContent = StrUtil.concat(true, "报验内容"
+                        , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
+
+            }
+        } else {
+            if(!oldInside.getInspectioncontent().equals(StringUtils.toString(updatecolumns.get("INSPECTIONCONTENT"), null))) {
+                inspectionContent = StrUtil.concat(true, "报验内容:", oldInside.getInspectioncontent()
+                        , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
+            }
+        }
+        if(ObjectUtil.isNotEmpty(inspectionContent)) {
+            editDataList.add(inspectionContent);
         }
 
+
         //检查地点
-        if(!oldInside.getInspectionlocation().equals(updatecolumns.get("INSPECTIONLOCATION").toString())) {
-            String structurename = StrUtil.concat(true, "检查地点:", oldInside.getInspectionlocation()
-                    , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
-            editDataList.add(structurename);
+        String inspectionLocation = null;
+        if(ObjectUtil.isEmpty(oldInside.getInspectionlocation())) {
+            if(ObjectUtil.isNotNull(updatecolumns.get("INSPECTIONLOCATION"))) {
+                inspectionLocation = StrUtil.concat(true, "检查地点"
+                        , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
+
+            }
+        } else {
+            if(!oldInside.getInspectionlocation().equals(StringUtils.toString(updatecolumns.get("INSPECTIONLOCATION"), null))) {
+                inspectionLocation = StrUtil.concat(true, "检查地点:", oldInside.getInspectionlocation()
+                        , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
+            }
+        }
+        if(ObjectUtil.isNotEmpty(inspectionLocation)) {
+            editDataList.add(inspectionLocation);
         }
 
         //检查地点补充

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

@@ -442,6 +442,9 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
                 .insideStateList(new ArrayList<>())
                 .outsideStateList(new ArrayList<>())
                 .build();
+
+        Map<String, ZhcxItpProjectNodeStateDo> nodeStateSet = new HashMap<>();
+
         for(RelactionNodeStateBo state : list) {
             LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
             queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, state.getProjectId())
@@ -471,12 +474,26 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
             }
 
             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);
+
+                StringBuilder sb = new StringBuilder();
+                sb.append(state.getProjectId());
+                sb.append(state.getMachineNo());
+                sb.append(state.getNodeId());
+                stateDo = nodeStateSet.get(sb.toString());
+
+                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);
+
+                    nodeStateSet.put(sb.toString(), entity);
+                } else {
+                    entity.setId(stateDo.getId());
+                    prjNodeState.getUpdateList().add(entity);
+                }
             } else {
                 entity.setId(stateDo.getId());
                 prjNodeState.getUpdateList().add(entity);

+ 26 - 0
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxInsideInspectionController.java

@@ -164,6 +164,19 @@ public class ZhcxInsideInspectionController {
         return R.ok();
     }
 
+    /**
+     * 保存-暂存
+     *
+     * @param req
+     * @return
+     */
+    @ApiOperation("暂存内部报验")
+    @PostMapping("/insertStagingInspection")
+    public R insertStagingInspection(@RequestBody InsideInspectionInsertRequest req){
+        service.saveStaging4Insert(req);
+        return R.ok();
+    }
+
     /**
      * 修改/重新报验
      *
@@ -177,6 +190,19 @@ public class ZhcxInsideInspectionController {
         return R.ok();
     }
 
+    /**
+     * 修改-暂存
+     *
+     * @param req
+     * @return
+     */
+    @ApiOperation("修改暂存内部报验")
+    @PostMapping("/updateStagingInspection")
+    public R updateStagingInspection(@RequestBody InsideInspectionUpdateRequest req){
+        service.saveStaging4Update(req);
+        return R.ok();
+    }
+
     /**
      * 内部执行导入
      * @param file