|
@@ -8,12 +8,14 @@ import cn.hutool.core.util.*;
|
|
|
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.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpDao;
|
|
|
import com.rongwei.bscommon.sys.feign.BsPlatformService;
|
|
|
import com.rongwei.bscommon.sys.service.*;
|
|
|
+import com.rongwei.bscommon.sys.utils.StrUtils;
|
|
|
import com.rongwei.bscommon.sys.utils.ZhcxCommon;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.dto.*;
|
|
@@ -902,6 +904,7 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
List<ZhcxOutsideInspectionItpDo> updateList = new ArrayList<>();
|
|
|
List<String> newItpIdList = new ArrayList<>();
|
|
|
List<ZhcxOutsideInspectionComponentTrackDo> trackDos = new ArrayList<>();
|
|
|
+ List<ZhcxOutsideInspectionComponentTrackDo> updateTrackDos = new ArrayList<>();
|
|
|
|
|
|
//操作记录
|
|
|
List<ZhcxOutsideInspectionItpOperLogDo> logList = new ArrayList<>();
|
|
@@ -925,7 +928,32 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
//跟踪
|
|
|
ZhcxOutsideInspectionComponentTrackDo trackDo = inspectionComponentTrackService.getByItp(itpDo);
|
|
|
if(ObjectUtil.isNotNull(trackDo)) {
|
|
|
- trackDos.add(trackDo);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ZhcxOutsideInspectionComponentTrackDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxOutsideInspectionComponentTrackDo::getStructurename, itpDo.getStructurename())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getMachineno, itpDo.getMachineno())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getStructuremachineno, itpDo.getStructuremachineno())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getDeleted, "0")
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getProjectid, itpDo.getProjectid());
|
|
|
+ List<ZhcxOutsideInspectionComponentTrackDo> trackDoList = inspectionComponentTrackService.list(queryWrapper);
|
|
|
+
|
|
|
+ //不存在,新增项目构件中总装与结构机号的关系
|
|
|
+ if(ObjectUtil.isEmpty(trackDoList)) {
|
|
|
+ trackDos.add(trackDo);
|
|
|
+ } else { //存在的话更新总装和结构机号所对应分包商关系
|
|
|
+ final ZhcxOutsideInspectionComponentTrackDo trackEntity = trackDoList.get(0);
|
|
|
+
|
|
|
+ final String unitIds = StrUtils.addIdAndDeduplicate(trackEntity.getSubcontractorunitid(), itpDo.getSubcontractorunitid());
|
|
|
+ final String strctUnitIds = StrUtils.addIdAndDeduplicate(trackEntity.getStructsubcontractorunitid(), itpDo.getSubcontractorunitid());
|
|
|
+
|
|
|
+ trackDo = new ZhcxOutsideInspectionComponentTrackDo();
|
|
|
+ trackDo.setId(trackEntity.getId());
|
|
|
+ trackDo.setSubcontractorunitid(unitIds);
|
|
|
+ trackDo.setStructsubcontractorunitid(strctUnitIds);
|
|
|
+ updateTrackDos.add(trackDo);
|
|
|
+ }
|
|
|
+
|
|
|
+// trackDos.add(trackDo);
|
|
|
}
|
|
|
|
|
|
ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
|
|
@@ -958,7 +986,31 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
//跟踪
|
|
|
ZhcxOutsideInspectionComponentTrackDo trackDo = inspectionComponentTrackService.getByItp(entity);
|
|
|
if(ObjectUtil.isNotNull(trackDo)) {
|
|
|
- trackDos.add(trackDo);
|
|
|
+// trackDos.add(trackDo);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ZhcxOutsideInspectionComponentTrackDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxOutsideInspectionComponentTrackDo::getStructurename, itpDo.getStructurename())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getMachineno, itpDo.getMachineno())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getStructuremachineno, itpDo.getStructuremachineno())
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getDeleted, "0")
|
|
|
+ .eq(ZhcxOutsideInspectionComponentTrackDo::getProjectid, itpDo.getProjectid());
|
|
|
+ List<ZhcxOutsideInspectionComponentTrackDo> trackDoList = inspectionComponentTrackService.list(queryWrapper);
|
|
|
+
|
|
|
+ //不存在,新增项目构件中总装与结构机号的关系
|
|
|
+ if(ObjectUtil.isEmpty(trackDoList)) {
|
|
|
+ trackDos.add(trackDo);
|
|
|
+ } else { //存在的话更新总装和结构机号所对应分包商关系
|
|
|
+ final ZhcxOutsideInspectionComponentTrackDo trackEntity = trackDoList.get(0);
|
|
|
+
|
|
|
+ final String unitIds = StrUtils.addIdAndDeduplicate(trackEntity.getSubcontractorunitid(), itpDo.getSubcontractorunitid());
|
|
|
+ final String strctUnitIds = StrUtils.addIdAndDeduplicate(trackEntity.getStructsubcontractorunitid(), itpDo.getSubcontractorunitid());
|
|
|
+
|
|
|
+ trackDo = new ZhcxOutsideInspectionComponentTrackDo();
|
|
|
+ trackDo.setId(trackEntity.getId());
|
|
|
+ trackDo.setSubcontractorunitid(unitIds);
|
|
|
+ trackDo.setStructsubcontractorunitid(strctUnitIds);
|
|
|
+ updateTrackDos.add(trackDo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -978,6 +1030,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
inspectionComponentTrackService.saveBatch(trackDos);
|
|
|
}
|
|
|
|
|
|
+ if(ObjectUtil.isNotEmpty(updateTrackDos)) {
|
|
|
+ inspectionComponentTrackService.updateBatchById(updateTrackDos);
|
|
|
+ }
|
|
|
+
|
|
|
//日志
|
|
|
zhcxOutsideInspectionItpOperLogService.saveBatch(logList);
|
|
|
}
|