Commit 266ca1b5 authored by suhuiguang's avatar suhuiguang

refactor(大编辑):管道增减功能开发

1.删除后再删除保存报错
parent 2a2ae497
......@@ -75,22 +75,26 @@ public class EquipBackupHandler {
private String buildDeleteData(List<String> records) {
List<Map<String, Object>> data = records.stream().map(record -> {
IdxBizJgRegisterInfo registerInfo = registerInfoService.getOneData(record);
Map<String, Object> item = new HashMap<>();
item.put(BACKUP_JSON_KEY_OTHER_INFO, otherInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_REGISTER_INFO, registerInfo);
item.put(BACKUP_JSON_KEY_SUPERVISION_INFO, supervisionInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_FACTORY_INFO, factoryInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_USE_INFO, useInfoService.getOneData(record));
// 技术参数
item.put(BACKUP_JSON_KEY_TECH_PARAM_INFO, this.getTechParamByEquListAndRecord(registerInfo.getEquList(), record));
// 检验流水数组
item.put(BACKUP_JSON_KEY_INSPECTION_DETECTION_INFO, this.getInspectList(record));
// 施工流水
item.put(BACKUP_JSON_KEY_CONSTRUCTION_INFO, this.getConstructionList(record));
Optional<ESEquipmentCategoryDto> op = equipmentCategory.findById(record);
op.ifPresent(e -> item.put(BACKUP_JSON_KEY_INSPECTION_ES_INFO, e));
return item;
}).collect(Collectors.toList());
if(registerInfo != null) {
Map<String, Object> item = new HashMap<>();
item.put(BACKUP_JSON_KEY_OTHER_INFO, otherInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_REGISTER_INFO, registerInfo);
item.put(BACKUP_JSON_KEY_SUPERVISION_INFO, supervisionInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_FACTORY_INFO, factoryInfoService.getOneData(record));
item.put(BACKUP_JSON_KEY_USE_INFO, useInfoService.getOneData(record));
// 技术参数
item.put(BACKUP_JSON_KEY_TECH_PARAM_INFO, this.getTechParamByEquListAndRecord(registerInfo.getEquList(), record));
// 检验流水数组
item.put(BACKUP_JSON_KEY_INSPECTION_DETECTION_INFO, this.getInspectList(record));
// 施工流水
item.put(BACKUP_JSON_KEY_CONSTRUCTION_INFO, this.getConstructionList(record));
Optional<ESEquipmentCategoryDto> op = equipmentCategory.findById(record);
op.ifPresent(e -> item.put(BACKUP_JSON_KEY_INSPECTION_ES_INFO, e));
return item;
}
return null;
}).filter(Objects::nonNull).collect(Collectors.toList());
return JSONObject.toJSONString(data);
}
......
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