Commit 76714de6 authored by 韩桐桐's avatar 韩桐桐

fix(jg):改造告知接口调整

parent 07e45265
...@@ -814,7 +814,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -814,7 +814,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<Object> factoryNumList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber")).collect(Collectors.toList()); List<Object> factoryNumList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber")).collect(Collectors.toList());
placeholders.put("equipTypeList", equipTypeList); placeholders.put("equipTypeList", equipTypeList);
placeholders.put("produceCodeList", factoryNumList); placeholders.put("produceCodeList", factoryNumList);
placeholders.put("productName", historyJson.get("projectContraption")); placeholders.put("productName", Optional.ofNullable(historyJson.get("projectContraption")).orElse(historyJson.get("PROJECT_CONTRAPTION")));
} else { } else {
placeholders.put("equipType", getValue.apply("equType")); placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("produceCode", getValue.apply("factoryNum")); placeholders.put("produceCode", getValue.apply("factoryNum"));
......
...@@ -295,11 +295,17 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -295,11 +295,17 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
notice.setNextTaskId(workflowResultDto.getNextTaskId()); notice.setNextTaskId(workflowResultDto.getNextTaskId());
notice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); notice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
notice.setCreateDate(new Date()); notice.setCreateDate(new Date());
updateById(notice);
// 上个代办改为已办 // 上个代办改为已办
TaskV2Model taskV2Model = this.updateLastTodo(notice, FlowStatusEnum.TO_BE_PROCESSED); TaskV2Model taskV2Model = this.updateLastTodo(notice, FlowStatusEnum.TO_BE_PROCESSED);
// 创建新的代办 // 创建新的代办
this.createNewTodo(notice, workflowResultDto, taskV2Model, FlowStatusEnum.TO_BE_PROCESSED); this.createNewTodo(notice, workflowResultDto, taskV2Model, FlowStatusEnum.TO_BE_PROCESSED);
// 压力管道情况处理
if (EquipmentClassifityEnum.YLGD.getCode().equals(notice.getEquListCode())) {
oldPipJsonData = this.getNowPipJsonData(noticeDto.getProjectContraptionId());
notice.setPipeLengthChanged(this.calculatePipeLengthChange(JSONArray.parseArray(JSON.toJSONString(oldPipJsonData.get(DEVICE_LIST))),
JSONArray.parseArray(JSON.toJSONString(noticeDto.getDeviceList()))));
}
this.updateById(notice);
} }
commonService.saveExecuteFlowData2Redis(notice.getInstanceId(), this.buildInstanceRuntimeData(notice)); commonService.saveExecuteFlowData2Redis(notice.getInstanceId(), this.buildInstanceRuntimeData(notice));
} else { } else {
...@@ -423,14 +429,23 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -423,14 +429,23 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
String tempFileName = "改造告知单_" + System.currentTimeMillis() + "_temp"; String tempFileName = "改造告知单_" + System.currentTimeMillis() + "_temp";
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
for (JgReformNoticeEq noticeEq : noticeEqs) { // 管道按照装置打一份告知书
if (EquipmentClassifityEnum.YLGD.getCode().equals(notice.getEquListCode()) && !noticeEqs.isEmpty()) {
Map<String, Object> information = jgReformNoticeMapper.queryEquipInformation(noticeEq.getSequenceNbr()); Map<String, Object> information = jgReformNoticeMapper.queryEquipInformation(noticeEqs.get(0).getSequenceNbr());
if (CollectionUtils.isEmpty(information)) { if (CollectionUtils.isEmpty(information)) {
throw new IllegalArgumentException("改造告知单不存在"); throw new IllegalArgumentException("改造告知单不存在");
} }
Map<String, Object> stringObjectMap = jgInstallationNoticeService.fullFillTemplateObj(Collections.singletonList(information), BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName().substring(0, 2)); Map<String, Object> stringObjectMap = jgInstallationNoticeService.fullFillTemplateObj(Collections.singletonList(information), BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName().substring(0, 2));
maps.add(stringObjectMap); maps.add(stringObjectMap);
} else {
for (JgReformNoticeEq noticeEq : noticeEqs) {
Map<String, Object> information = jgReformNoticeMapper.queryEquipInformation(noticeEq.getSequenceNbr());
if (CollectionUtils.isEmpty(information)) {
throw new IllegalArgumentException("改造告知单不存在");
}
Map<String, Object> stringObjectMap = jgInstallationNoticeService.fullFillTemplateObj(Collections.singletonList(information), BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName().substring(0, 2));
maps.add(stringObjectMap);
}
} }
data.put("equipBasicInfoList", maps); data.put("equipBasicInfoList", maps);
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", data, response); WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", data, response);
...@@ -1051,13 +1066,19 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -1051,13 +1066,19 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = new ArrayList<>(15); List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = new ArrayList<>(15);
List<IdxBizJgTechParamsPipeline> paramsPipelineList = new ArrayList<>(15); List<IdxBizJgTechParamsPipeline> paramsPipelineList = new ArrayList<>(15);
List<ESEquipmentCategoryDto> esEquipmentCategoryList = new ArrayList<>(15); List<ESEquipmentCategoryDto> esEquipmentCategoryList = new ArrayList<>(15);
// eq关系表
List<JgReformNoticeEq> noticeEqs = new ArrayList<>(15);
// 设备信息 // 设备信息
toAddPipData.forEach(pipData -> { toAddPipData.forEach(pipData -> {
String record = UUID.randomUUID().toString(); String record = UUID.randomUUID().toString();
Date date = new Date(); Date date = new Date();
// eq表
JgReformNoticeEq jgRelationEquip = new JgReformNoticeEq();
jgRelationEquip.setEquId(record);
jgRelationEquip.setEquipTransferId(String.valueOf(notice.getSequenceNbr()));
noticeEqs.add(jgRelationEquip);
// 使用信息 // 使用信息
IdxBizJgUseInfo useInfo = JSON.parseObject(toJSONString(pipData), IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfo = JSON.parseObject(toJSONString(pipData), IdxBizJgUseInfo.class);
// 使用信息
useInfo.setRecord(record); useInfo.setRecord(record);
useInfo.setSequenceNbr(null); useInfo.setSequenceNbr(null);
useInfo.setRecDate(date); useInfo.setRecDate(date);
...@@ -1173,6 +1194,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -1173,6 +1194,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
idxBizJgInspectionDetectionInfoService.saveBatch(inspectionDetectionInfoList); idxBizJgInspectionDetectionInfoService.saveBatch(inspectionDetectionInfoList);
iIdxBizJgTechParamsPipelineService.saveBatch(paramsPipelineList); iIdxBizJgTechParamsPipelineService.saveBatch(paramsPipelineList);
esEquipmentCategory.saveAll(esEquipmentCategoryList); esEquipmentCategory.saveAll(esEquipmentCategoryList);
jgReformNoticeEqMapper.insertBatchSomeColumn(noticeEqs);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment