|
@@ -20,6 +20,7 @@ import com.rongwei.bsentity.domain.ZhcxCommissionCheckParameterSetDetalDo;
|
|
|
import com.rongwei.bsentity.domain.ZhcxCommissionCheckParameterSetDo;
|
|
|
import com.rongwei.bsentity.dto.CheckDetailDTO;
|
|
|
import com.rongwei.bsentity.dto.CommissionCheckDTO;
|
|
|
+import com.rongwei.bsentity.dto.commission.CopyDetailDto;
|
|
|
import com.rongwei.bsentity.dto.commission.ImportProjectCheckBO;
|
|
|
import com.rongwei.bsentity.dto.commission.ImportProjectCheckDto;
|
|
|
import com.rongwei.bsentity.dto.commission.ParseDocBO;
|
|
@@ -84,6 +85,9 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
@Autowired
|
|
|
private ZhcxProjectManageService zhcxProjectManageService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZhcxProjectDeviceNumberService zhcxProjectDeviceNumberService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysFileItemService sysFileItemService;
|
|
|
|
|
@@ -1419,10 +1423,11 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
final ParseDocBO docBO = ParseDocBO.builder()
|
|
|
.id(importDto.getId())
|
|
|
.dictMap(dictMap)
|
|
|
+ .project(project)
|
|
|
.build();
|
|
|
|
|
|
//解析word文档
|
|
|
- return ImportCommissionHelp.parseDoc(doc, project, docBO);
|
|
|
+ return ImportCommissionHelp.parseDoc(doc, docBO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1438,15 +1443,22 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
final ZhcxCommissionCheckDo commissionCheckDo = getById(importDto.getId());
|
|
|
importDto.setProjectId(commissionCheckDo.getProjectid());
|
|
|
|
|
|
+ //不同机台试车
|
|
|
+ final LambdaQueryWrapper<ZhcxCommissionCheckDo> queryCheckWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryCheckWrapper.eq(ZhcxCommissionCheckDo::getProjectid, commissionCheckDo.getProjectid());
|
|
|
+ final List<ZhcxCommissionCheckDo> commissionCheckDos = list(queryCheckWrapper);
|
|
|
+
|
|
|
+ final LambdaQueryWrapper<ZhcxProjectDeviceNumberDo> queryDeviceWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryDeviceWrapper.eq(ZhcxProjectDeviceNumberDo::getPid, commissionCheckDo.getProjectid());
|
|
|
+ final List<ZhcxProjectDeviceNumberDo> deviceNumberList = zhcxProjectDeviceNumberService.list(queryDeviceWrapper);
|
|
|
+ Map<String, ZhcxProjectDeviceNumberDo> deviceMap = new HashMap<>(deviceNumberList.size());
|
|
|
+ deviceNumberList.stream().forEach(item -> deviceMap.put(item.getId(), item));
|
|
|
+
|
|
|
//删除树
|
|
|
- final LambdaQueryWrapper<ZhcxCommissionCheckDetailTreeDo> removeTreeWrapper = Wrappers.lambdaQuery();
|
|
|
- removeTreeWrapper.eq(ZhcxCommissionCheckDetailTreeDo::getBaseinfoid, commissionCheckDo.getProjectcode());
|
|
|
- zhcxCommissionCheckDetailTreeService.remove(removeTreeWrapper);
|
|
|
+ zhcxCommissionCheckDetailTreeService.delByPrjId(commissionCheckDo.getProjectid());
|
|
|
|
|
|
//删除明细
|
|
|
- final LambdaQueryWrapper<ZhcxCommissionCheckDetailDo> removeDetailWrapper = Wrappers.lambdaQuery();
|
|
|
- removeDetailWrapper.eq(ZhcxCommissionCheckDetailDo::getPid, importDto.getId());
|
|
|
- zhcxCommissionCheckDetailService.remove(removeDetailWrapper);
|
|
|
+ zhcxCommissionCheckDetailService.delByPrjId(commissionCheckDo.getProjectid());
|
|
|
|
|
|
//导出明细
|
|
|
final ImportProjectCheckBO importCheckDetail = importCheckDetail(importDto, file);
|
|
@@ -1458,6 +1470,26 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
if(ObjectUtil.isNotEmpty(importCheckDetail.getDetailList())) {
|
|
|
zhcxCommissionCheckDetailService.saveBatch(importCheckDetail.getDetailList());
|
|
|
}
|
|
|
+
|
|
|
+ //其他机台
|
|
|
+ for(ZhcxCommissionCheckDo check : commissionCheckDos) {
|
|
|
+
|
|
|
+ if(check.getId().equals(importDto.getId())) { //自身不做处理
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发运状态机号不做导入
|
|
|
+ if(ObjectUtil.isNotEmpty(deviceMap.get(check.getMachineid())) && "发运".equals(deviceMap.get(check.getMachineid()).getStatus())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ final CopyDetailDto copyDto = CopyDetailDto.builder()
|
|
|
+ .sourcePid(importDto.getId())
|
|
|
+ .targetPid(check.getId())
|
|
|
+ .build();
|
|
|
+ zhcxCommissionCheckDetailTreeService.copyByPid(copyDto);//树
|
|
|
+ zhcxCommissionCheckDetailService.copyByPid(copyDto);//详情
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|