|
@@ -1,6 +1,7 @@
|
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.rongwei.bscommon.sys.service.*;
|
|
@@ -101,7 +102,7 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
dto.setSaveType("update");
|
|
|
}
|
|
|
entity.setOuttimes(itpDo.getInspectioncount());
|
|
|
-//取消
|
|
|
+ //取消
|
|
|
if("10".equals(operType)) {
|
|
|
entity.setOutstate("40");
|
|
|
}
|
|
@@ -183,15 +184,97 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
|
|
|
@Override
|
|
|
public void initRelationInspection() {
|
|
|
//外部报验单
|
|
|
+ List<RelactionNodeStateBo> nodeStaeList = initNodeStatusOutside();
|
|
|
|
|
|
//内部报验单
|
|
|
+ List<RelactionNodeStateBo> nodeStateInsideList = initNodeStatusInside();
|
|
|
+
|
|
|
+ nodeStaeList.addAll(nodeStateInsideList);
|
|
|
+
|
|
|
+
|
|
|
+ SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
+
|
|
|
+ OperDto oper = new OperDto();
|
|
|
+ oper.setOperTime(new Date());
|
|
|
+ oper.setOperUser(user);
|
|
|
+
|
|
|
+ //保存关联关系
|
|
|
+ relationInspection(nodeStaeList, oper);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存外部报验单
|
|
|
*/
|
|
|
- private void saveNodeStatusOutside() {
|
|
|
+ private List<RelactionNodeStateBo> initNodeStatusInside() {
|
|
|
+ List<JSONObject> inspectionList = insideInspectionService.getInitNodeStateInspection();
|
|
|
|
|
|
+ return assembleInitNodeStatusList(inspectionList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存外部报验单
|
|
|
+ */
|
|
|
+ private List<RelactionNodeStateBo> initNodeStatusOutside() {
|
|
|
+ List<JSONObject> inspectionList = outsideInspectionItpService.getInitNodeStateInspection();
|
|
|
+
|
|
|
+ return assembleInitNodeStatusList(inspectionList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组装保存数据
|
|
|
+ *
|
|
|
+ * @param inspectionList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<RelactionNodeStateBo> assembleInitNodeStatusList(List<JSONObject> inspectionList) {
|
|
|
+ if(ObjectUtil.isEmpty(inspectionList)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<RelactionNodeStateBo> list = new ArrayList<>();
|
|
|
+ for(JSONObject inspection : inspectionList) {
|
|
|
+ String machineNoStr = inspection.getString("MACHINENO");
|
|
|
+ if(ObjectUtil.isEmpty(machineNoStr)) {
|
|
|
+ machineNoStr = inspection.getString("STRUCTUREMACHINENO");
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isEmpty(machineNoStr)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] machinenos = machineNoStr.split(",");
|
|
|
+
|
|
|
+ for(String machineNo : machinenos) {
|
|
|
+
|
|
|
+ RelactionNodeStateBo nodeStateBo = RelactionNodeStateBo.builder()
|
|
|
+ .projectId(inspection.getString("PROJECTID"))
|
|
|
+ .projectCode(inspection.getString("PROJECTCODE"))
|
|
|
+ .projectName(inspection.getString("PROJECTNAME"))
|
|
|
+ .nodeId(inspection.getString("INSPECTIONCONTENTID"))
|
|
|
+ .machineNo(machineNo)
|
|
|
+ .conclusion(inspection.getString("INSPECTIONCONCLUSION"))
|
|
|
+ .inspectionCount(inspection.getInteger("INSPECTIONCOUNT"))
|
|
|
+ .complateTime(inspection.getDate("INSPECTIONCOMPLATETIME"))
|
|
|
+ .type("outside")
|
|
|
+ .build();
|
|
|
+ if("40".equals(inspection.getString("INSPECTIONSTATUS"))) {
|
|
|
+ nodeStateBo.setConclusion("40");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<RelactionNodeStateInspectionBo> stateInspectionList = new ArrayList<>(1);
|
|
|
+ stateInspectionList.add(RelactionNodeStateInspectionBo.builder()
|
|
|
+ .inspectionId(inspection.getString("ID"))
|
|
|
+ .inspectionCode(inspection.getString("INSPECTIONCODE"))
|
|
|
+ .launchType(inspection.getString("LAUNCHTYPE"))
|
|
|
+ .build());
|
|
|
+
|
|
|
+ nodeStateBo.setInspectionList(stateInspectionList);
|
|
|
+
|
|
|
+ list.add(nodeStateBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/**
|