Browse Source

内部报验核心检验指标

wangming 11 months ago
parent
commit
23c2b034c0

+ 6 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxInsideInspectionCoreIndicatorsDao.java

@@ -2,6 +2,9 @@ package com.rongwei.bscommon.sys.dao;
 
 import com.rongwei.bsentity.domain.ZhcxInsideInspectionCoreIndicatorsDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Insert;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ZhcxInsideInspectionCoreIndicatorsDao extends BaseMapper<ZhcxInsideInspectionCoreIndicatorsDo> {
 
+    @Insert("INSERT INTO INCONTROL.ZHCX_INSIDE_INSPECTION_CORE_INDICATORS(ID,TENANTID,ROPTION,DELETED,REMARK,CREATEUSERID,CREATEUSERNAME,CREATEDATE,MODIFYUSERID,MODIFYUSERNAME,MODIFYDATE,INSIDEID,COREID,CORECODE,CORENAME,COREITEMID,INSPECTON_ITEMS,RECEIVING_CONDITIONS,ACCORDING_TO_STANDARDS,SELFACTUALRECORD,SELFRESULT,SELFFILES,SELFREMARK,CHECKACTUALRECORD,CHECKRESULT,CHECKFILES,CHECKREMARK,SORT) " +
+            "select guid(),TENANTID,ROPTION,DELETED,REMARK,CREATEUSERID,CREATEUSERNAME,CREATEDATE,MODIFYUSERID,MODIFYUSERNAME,MODIFYDATE,#{newItpId},COREID,CORECODE,CORENAME,COREITEMID,INSPECTON_ITEMS,RECEIVING_CONDITIONS,ACCORDING_TO_STANDARDS,SELFACTUALRECORD,SELFRESULT,SELFFILES,SELFREMARK,CHECKACTUALRECORD,CHECKRESULT,CHECKFILES,CHECKREMARK,SORT FROM INCONTROL.ZHCX_INSIDE_INSPECTION_CORE_INDICATORS WHERE INSIDEID = #{itpId}")
+    int insertBySelect(Map<String, String> map);
 }

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

@@ -3,6 +3,8 @@ package com.rongwei.bscommon.sys.service;
 import com.rongwei.bsentity.domain.ZhcxInsideInspectionCoreIndicatorsDo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 内部报验-报验管理-核心检验指标 服务类
@@ -13,4 +15,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ZhcxInsideInspectionCoreIndicatorsService extends IService<ZhcxInsideInspectionCoreIndicatorsDo> {
 
+    /**
+     * 复制报验单核心检验指标
+     *
+     * @param insideId
+     * @param newIinsideIdList
+     */
+    void copyByInsideId(String insideId, List<String> newIinsideIdList);
 }

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

@@ -1,11 +1,17 @@
 package com.rongwei.bscommon.sys.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 内部报验-报验管理-核心检验指标 服务实现类
@@ -17,4 +23,27 @@ import org.springframework.stereotype.Service;
 @Service
 public class ZhcxInsideInspectionCoreIndicatorsServiceImpl extends ServiceImpl<ZhcxInsideInspectionCoreIndicatorsDao, ZhcxInsideInspectionCoreIndicatorsDo> implements ZhcxInsideInspectionCoreIndicatorsService {
 
+    @Autowired
+    private ZhcxInsideInspectionCoreIndicatorsDao dao;
+
+    /**
+     * 复制报验单核心检验指标
+     *
+     * @param insideId
+     * @param newIinsideIdList
+     */
+    @Override
+    public void copyByInsideId(String insideId, List<String> newIinsideIdList) {
+
+        if(ObjectUtil.isEmpty(newIinsideIdList)) {
+            return ;
+        }
+
+        for(String newItpId : newIinsideIdList) {
+            Map<String, String> map = new HashMap<>();
+            map.put("itpId", insideId);
+            map.put("newItpId", newItpId);
+            dao.insertBySelect(map);
+        }
+    }
 }

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

@@ -12,13 +12,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionDispatchService;
-import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionOperLogService;
-import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateService;
+import com.rongwei.bscommon.sys.service.*;
 import com.rongwei.bscommon.sys.utils.ZhcxCommon;
 import com.rongwei.bsentity.domain.*;
 import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
-import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bsentity.dto.*;
 import com.rongwei.bsentity.dto.inside.*;
@@ -91,6 +88,9 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
     @Autowired
     private ZhcxItpProjectNodeStateService itpProjectNodeStateService;
 
+    @Autowired
+    private ZhcxInsideInspectionCoreIndicatorsService insideInspectionCoreIndicatorsService;
+
     @Value("${temp.filepath:#{null}}")
     private String filepath;
 
@@ -1333,6 +1333,9 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         List<String> newItpIdList = new ArrayList<>();
         newItpIdList.add(entity.getId());
 
+        //保存核心检验指标
+        insideInspectionCoreIndicatorsService.copyByInsideId(inside.getId(), newItpIdList);
+
         //保存操作记录
         operLogService.copyByInsideId(inside.getId(), newItpIdList);
     }