|
@@ -182,25 +182,35 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
*
|
|
|
*/
|
|
|
@Override
|
|
|
- public void initRelationInspection() {
|
|
|
+ public void initRelationOutSide() {
|
|
|
//外部报验单
|
|
|
List<RelactionNodeStateBo> nodeStaeList = initNodeStatusOutside();
|
|
|
|
|
|
- //内部报验单
|
|
|
- List<RelactionNodeStateBo> nodeStateInsideList = initNodeStatusInside();
|
|
|
+ SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
+ OperDto oper = new OperDto();
|
|
|
+ oper.setOperTime(new Date());
|
|
|
+ oper.setOperUser(user);
|
|
|
|
|
|
- nodeStaeList.addAll(nodeStateInsideList);
|
|
|
+ //保存关联关系
|
|
|
+ relationInspection4Init(nodeStaeList, oper);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
+ /**
|
|
|
+ * 初始化-内部报验单
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void initRelationInSide() {
|
|
|
+ //内部报验单
|
|
|
+ List<RelactionNodeStateBo> nodeStateInsideList = initNodeStatusInside();
|
|
|
|
|
|
+ SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
OperDto oper = new OperDto();
|
|
|
oper.setOperTime(new Date());
|
|
|
oper.setOperUser(user);
|
|
|
|
|
|
//保存关联关系
|
|
|
- relationInspection(nodeStaeList, oper);
|
|
|
-
|
|
|
+ relationInspection4Init(nodeStateInsideList, oper);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -415,6 +425,110 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 初始化-关联报验单
|
|
|
+ *
|
|
|
+ * @param list
|
|
|
+ * @param oper
|
|
|
+ */
|
|
|
+ private void relationInspection4Init(List<RelactionNodeStateBo> list, OperDto oper) {
|
|
|
+ if(ObjectUtil.isEmpty(list)) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ ProjectNodeStateBo prjNodeState = ProjectNodeStateBo.builder()
|
|
|
+ .insertList(new ArrayList<>())
|
|
|
+ .updateList(new ArrayList<>())
|
|
|
+ .insideStateList(new ArrayList<>())
|
|
|
+ .outsideStateList(new ArrayList<>())
|
|
|
+ .build();
|
|
|
+ for(RelactionNodeStateBo state : list) {
|
|
|
+ LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, state.getProjectId())
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getMathinecode, state.getMachineNo())
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getNodeid, state.getNodeId());
|
|
|
+ List<ZhcxItpProjectNodeStateDo> stateList = list(queryWrapper);
|
|
|
+ ZhcxItpProjectNodeStateDo stateDo = BusinessFunUtils.getPrjNodeState(stateList);
|
|
|
+
|
|
|
+ ZhcxItpProjectNodeStateDo entity = new ZhcxItpProjectNodeStateDo();
|
|
|
+ //内部报验单
|
|
|
+ if("inside".equals(state.getType())) {
|
|
|
+ entity.setIntimes(state.getInspectionCount());
|
|
|
+ entity.setInstate(state.getConclusion());
|
|
|
+
|
|
|
+ if("10".equals(state.getConclusion()) || "30".equals(state.getConclusion())) {
|
|
|
+ entity.setIncompletetime(state.getComplateTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //外部
|
|
|
+ else {
|
|
|
+ entity.setOuttimes(state.getInspectionCount());
|
|
|
+ entity.setOutstate(state.getConclusion());
|
|
|
+
|
|
|
+ if("10".equals(state.getConclusion()) || "30".equals(state.getConclusion())) {
|
|
|
+ entity.setOutcompletetime(state.getComplateTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
+ } else {
|
|
|
+ entity.setId(stateDo.getId());
|
|
|
+ prjNodeState.getUpdateList().add(entity);
|
|
|
+ }
|
|
|
+
|
|
|
+ if("inside".equals(state.getType())) {
|
|
|
+ //内部报验报验点明细
|
|
|
+ for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
|
|
|
+ //同一个报验点,只能存一份
|
|
|
+// LambdaQueryWrapper<ZhcxItpProjectNodeStateInsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
+// delWrapper.eq(ZhcxItpProjectNodeStateInsideDo::getInsideid, nodeInspection.getInspectionId())
|
|
|
+// .eq(ZhcxItpProjectNodeStateInsideDo::getStateid, entity.getId());
|
|
|
+// nodeStateInsideService.remove(delWrapper);
|
|
|
+// nodeStateInsideService.delBySide(nodeInspection.getInspectionId(), entity.getId());
|
|
|
+
|
|
|
+ ZhcxItpProjectNodeStateInsideDo insideState = new ZhcxItpProjectNodeStateInsideDo();
|
|
|
+ insideState.setId(SecurityUtil.getUUID());
|
|
|
+ insideState.setInspectioncode(nodeInspection.getInspectionCode());
|
|
|
+ insideState.setLaunchtype(nodeInspection.getLaunchType());
|
|
|
+ insideState.setDeleted("0");
|
|
|
+ insideState.setStateid(entity.getId());
|
|
|
+ insideState.setInsideid(nodeInspection.getInspectionId());
|
|
|
+
|
|
|
+ prjNodeState.getInsideStateList().add(insideState);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //外部报验报验点明细
|
|
|
+ for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
|
|
|
+ //同一个报验点,只能存一份
|
|
|
+// LambdaQueryWrapper<ZhcxItpProjectNodeStateOutsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
+// delWrapper.eq(ZhcxItpProjectNodeStateOutsideDo::getOutsideid, nodeInspection.getInspectionId())
|
|
|
+// .eq(ZhcxItpProjectNodeStateOutsideDo::getStateid, entity.getId());
|
|
|
+// nodeStateOutsideService.remove(delWrapper);
|
|
|
+// nodeStateOutsideService.delBySide(nodeInspection.getInspectionId(), entity.getId());
|
|
|
+
|
|
|
+ ZhcxItpProjectNodeStateOutsideDo outsideState = new ZhcxItpProjectNodeStateOutsideDo();
|
|
|
+ outsideState.setId(SecurityUtil.getUUID());
|
|
|
+ outsideState.setInspectioncode(nodeInspection.getInspectionCode());
|
|
|
+ outsideState.setLaunchtype(nodeInspection.getLaunchType());
|
|
|
+ outsideState.setDeleted("0");
|
|
|
+ outsideState.setStateid(entity.getId());
|
|
|
+ outsideState.setOutsideid(nodeInspection.getInspectionId());
|
|
|
+
|
|
|
+ prjNodeState.getOutsideStateList().add(outsideState);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //持久化
|
|
|
+ saveNode(prjNodeState);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 关联报验单
|
|
|
*
|
|
@@ -476,10 +590,11 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
//内部报验报验点明细
|
|
|
for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
|
|
|
//同一个报验点,只能存一份
|
|
|
- LambdaQueryWrapper<ZhcxItpProjectNodeStateInsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
- delWrapper.eq(ZhcxItpProjectNodeStateInsideDo::getInsideid, nodeInspection.getInspectionId())
|
|
|
- .eq(ZhcxItpProjectNodeStateInsideDo::getStateid, entity.getId());
|
|
|
- nodeStateInsideService.remove(delWrapper);
|
|
|
+// LambdaQueryWrapper<ZhcxItpProjectNodeStateInsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
+// delWrapper.eq(ZhcxItpProjectNodeStateInsideDo::getInsideid, nodeInspection.getInspectionId())
|
|
|
+// .eq(ZhcxItpProjectNodeStateInsideDo::getStateid, entity.getId());
|
|
|
+// nodeStateInsideService.remove(delWrapper);
|
|
|
+ nodeStateInsideService.delBySide(nodeInspection.getInspectionId(), entity.getId());
|
|
|
|
|
|
ZhcxItpProjectNodeStateInsideDo insideState = new ZhcxItpProjectNodeStateInsideDo();
|
|
|
insideState.setId(SecurityUtil.getUUID());
|
|
@@ -495,10 +610,11 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
//外部报验报验点明细
|
|
|
for(RelactionNodeStateInspectionBo nodeInspection : state.getInspectionList()) {
|
|
|
//同一个报验点,只能存一份
|
|
|
- LambdaQueryWrapper<ZhcxItpProjectNodeStateOutsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
- delWrapper.eq(ZhcxItpProjectNodeStateOutsideDo::getOutsideid, nodeInspection.getInspectionId())
|
|
|
- .eq(ZhcxItpProjectNodeStateOutsideDo::getStateid, entity.getId());
|
|
|
- nodeStateOutsideService.remove(delWrapper);
|
|
|
+// LambdaQueryWrapper<ZhcxItpProjectNodeStateOutsideDo> delWrapper = Wrappers.lambdaQuery();
|
|
|
+// delWrapper.eq(ZhcxItpProjectNodeStateOutsideDo::getOutsideid, nodeInspection.getInspectionId())
|
|
|
+// .eq(ZhcxItpProjectNodeStateOutsideDo::getStateid, entity.getId());
|
|
|
+// nodeStateOutsideService.remove(delWrapper);
|
|
|
+ nodeStateOutsideService.delBySide(nodeInspection.getInspectionId(), entity.getId());
|
|
|
|
|
|
ZhcxItpProjectNodeStateOutsideDo outsideState = new ZhcxItpProjectNodeStateOutsideDo();
|
|
|
outsideState.setId(SecurityUtil.getUUID());
|