|
@@ -200,7 +200,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
inspection.setCheckercontact(StringUtils.toString(updateColsMap.get("CHECKERCONTACT"), ""));
|
|
|
}
|
|
|
//生成空派单信息
|
|
|
- dispatchService.genDispatch(inspection);
|
|
|
+ final ZhcxInsideInspectionDispatchDo dispatch = dispatchService.genDispatch(inspection);
|
|
|
+
|
|
|
+ //拆单
|
|
|
+ splitOrderByPoint(inspection, dispatch);
|
|
|
}
|
|
|
//重新报验
|
|
|
else if("reInspection".equals(req.getOperType())) {
|
|
@@ -361,7 +364,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
//生成报验单号
|
|
|
updateInspection(inspectionDo, req);
|
|
|
//生成空派单信息
|
|
|
- dispatchService.genDispatch(inspectionDo);
|
|
|
+ final ZhcxInsideInspectionDispatchDo dispatch = dispatchService.genDispatch(inspectionDo);
|
|
|
+
|
|
|
+ //拆单
|
|
|
+ splitOrderByPoint(inspectionDo, dispatch);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -446,9 +452,6 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxInsideInspectionDo inside = new ZhcxInsideInspectionDo();
|
|
|
inside.setId(insideId);
|
|
|
inside.setInspectionstatus("40");
|
|
|
- //取消的时候清空
|
|
|
- inside.setCheckername("");
|
|
|
-
|
|
|
inspectionList.add(inside);
|
|
|
|
|
|
NotifyDto notify = getMailInfo4Cancel(inOper, req);
|
|
@@ -1131,6 +1134,73 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
doDeletedPoint(project.getId());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过报验点拆单
|
|
|
+ *
|
|
|
+ * @param inside
|
|
|
+ * @param dispatch
|
|
|
+ */
|
|
|
+ private void splitOrderByPoint(ZhcxInsideInspectionDo inside, ZhcxInsideInspectionDispatchDo dispatch) {
|
|
|
+ if(inside.getSplitflag() == 2) { //不拆单
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ final String[] inspectionContents = inside.getInspectioncontent().split(","); // 报验点
|
|
|
+ if(inspectionContents.length <= 1) { //只选择了一个报验点不需要拆单
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ final String[] inspectionContentIds = inside.getInspectioncontentid().split(","); // 报验点
|
|
|
+
|
|
|
+ //第一个单据
|
|
|
+ ZhcxInsideInspectionDo source = new ZhcxInsideInspectionDo();
|
|
|
+ source.setInspectioncontent(inspectionContents[0]);
|
|
|
+ source.setInspectioncontentid(inspectionContentIds[0]);
|
|
|
+ String inspectionPoint = inspectionContents[0].replace(inside.getStructurename().concat("-"), "");
|
|
|
+ source.setInspectionpoint(inspectionPoint);
|
|
|
+
|
|
|
+ source.setId(inside.getId());
|
|
|
+ updateById(source);
|
|
|
+
|
|
|
+ //其他单据 复制第一个单据
|
|
|
+ List<ZhcxInsideInspectionDo> insertInsideList = new ArrayList<>(inspectionContents.length - 1);
|
|
|
+ List<ZhcxInsideInspectionDispatchDo> insertDispatchList = new ArrayList<>(inspectionContents.length - 1);
|
|
|
+ for(int m = 1, n = inspectionContents.length; m < n; m++) {
|
|
|
+
|
|
|
+ inspectionPoint = inspectionContents[m].replace(inside.getStructurename().concat("-"), "");
|
|
|
+ //报验单
|
|
|
+ ZhcxInsideInspectionDo insideEntity = new ZhcxInsideInspectionDo();
|
|
|
+ BeanUtil.copyProperties(inside, insideEntity);
|
|
|
+ insideEntity.setId(SecurityUtil.getUUID());
|
|
|
+ insideEntity.setInspectioncode(genCode());
|
|
|
+ insideEntity.setInspectioncontent(inspectionContents[m]);
|
|
|
+ insideEntity.setInspectioncontentid(inspectionContentIds[m]);
|
|
|
+ insideEntity.setInspectionpoint(inspectionPoint);
|
|
|
+ insertInsideList.add(insideEntity);
|
|
|
+
|
|
|
+ //派单明细
|
|
|
+ ZhcxInsideInspectionDispatchDo dispatchEntity = new ZhcxInsideInspectionDispatchDo();
|
|
|
+ BeanUtil.copyProperties(dispatch, dispatchEntity);
|
|
|
+ dispatchEntity.setId(SecurityUtil.getUUID());
|
|
|
+ dispatchEntity.setInsideid(insideEntity.getId());
|
|
|
+ insertDispatchList.add(dispatchEntity);
|
|
|
+
|
|
|
+ // 核心检验
|
|
|
+ insideInspectionCoreIndicatorsService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inside.getId());
|
|
|
+ //细节完善项目
|
|
|
+ insideInspectionDetailImprovementItemService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inspectionPoint, inside.getId());
|
|
|
+ //标书要点
|
|
|
+ insideInspectionBiddingDocPointService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inside.getId());
|
|
|
+
|
|
|
+ //操作日志
|
|
|
+ operLogService.copyByInsideId(inside.getId(), Arrays.asList(new String[] {insideEntity.getId()}));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ saveBatch(insertInsideList);
|
|
|
+ dispatchService.saveBatch(insertDispatchList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 报验单list转map
|
|
|
*
|
|
@@ -2285,6 +2355,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxInsideInspectionDo entity = new ZhcxInsideInspectionDo();
|
|
|
entity.setId(inspectionDo.getId());
|
|
|
entity.setInspectioncode(genCode());
|
|
|
+ entity.setInspectionpoint(inspectionDo.getInspectioncontent().replace(inspectionDo.getStructurename().concat("-"), ""));
|
|
|
updateById(entity);
|
|
|
|
|
|
//生成操作记录
|
|
@@ -2357,26 +2428,25 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
- ZhcxInsideInspectionDo inside = inOper.getInspection();
|
|
|
+ ZhcxInsideInspectionDo itpDo = inOper.getInspection();
|
|
|
String machineNo = inOper.getInspection().getMachineno();
|
|
|
if (StringUtils.isBlank(machineNo)) {
|
|
|
machineNo = inOper.getInspection().getStructuremachineno();
|
|
|
}
|
|
|
if (StringUtils.isBlank(machineNo)) {
|
|
|
- log.error("{}-{}:总装机号和结构机号都没有", inside.getId(), inside.getInspectioncode());
|
|
|
+ log.error("{}-{}:总装机号和结构机号都没有", itpDo.getId(), itpDo.getInspectioncode());
|
|
|
return;
|
|
|
}
|
|
|
- String[] machinenos = machineNo.split(","); //机号
|
|
|
- final String[] nodeIds = inside.getInspectioncontentid().split(","); //报验点id
|
|
|
+ String[] machinenos = machineNo.split(",");
|
|
|
+ for (String mn : machinenos) {
|
|
|
|
|
|
- for(String nodeId : nodeIds) { // 报验点
|
|
|
- for (String mn : machinenos) { // 机号
|
|
|
+ final String[] inspectionIds = itpDo.getInspectioncontentid().split(",");
|
|
|
|
|
|
- //查询报验点状态表中
|
|
|
+ for(String inspectionId : inspectionIds) {
|
|
|
LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, inside.getProjectid())
|
|
|
+ queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, itpDo.getProjectid())
|
|
|
.eq(ZhcxItpProjectNodeStateDo::getMathinecode, mn)
|
|
|
- .eq(ZhcxItpProjectNodeStateDo::getNodeid, nodeId);
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getNodeid, inspectionId);
|
|
|
List<ZhcxItpProjectNodeStateDo> stateList = itpProjectNodeStateService.list(queryWrapper);
|
|
|
ZhcxItpProjectNodeStateDo stateDo = BusinessFunUtils.getPrjNodeState(stateList);
|
|
|
|
|
@@ -2384,8 +2454,8 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
stateDo = new ZhcxItpProjectNodeStateDo();
|
|
|
stateDo.setId(SecurityUtil.getUUID());
|
|
|
stateDo.setMathinecode(mn);
|
|
|
- stateDo.setPrjid(inside.getProjectid());
|
|
|
- stateDo.setNodeid(nodeId);
|
|
|
+ stateDo.setPrjid(itpDo.getProjectid());
|
|
|
+ stateDo.setNodeid(itpDo.getInspectioncontentid());
|
|
|
stateDo.setDeleted("0");
|
|
|
|
|
|
stateDo.setCreatedate(inOper.getOperTime());
|
|
@@ -2406,10 +2476,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxItpProjectNodeStateInsideDo stateInside = new ZhcxItpProjectNodeStateInsideDo();
|
|
|
stateInside.setId(SecurityUtil.getUUID());
|
|
|
stateInside.setDeleted("0");
|
|
|
- stateInside.setInsideid(inside.getId());
|
|
|
+ stateInside.setInsideid(itpDo.getId());
|
|
|
stateInside.setStateid(stateDo.getId());
|
|
|
- stateInside.setInspectioncode(inside.getInspectioncode());
|
|
|
- stateInside.setLaunchtype(inside.getLaunchtype());
|
|
|
+ stateInside.setInspectioncode(itpDo.getInspectioncode());
|
|
|
+ stateInside.setLaunchtype(itpDo.getLaunchtype());
|
|
|
stateInside.setStateid(stateDo.getId());
|
|
|
nodeStateBo.getInsideStateList().add(stateInside);
|
|
|
}
|