Commit 1752420f authored by 韩桐桐's avatar 韩桐桐

fix(jg):改造告知-添加没有删除管道的判断

parent e0e533ef
...@@ -975,8 +975,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -975,8 +975,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 1.更新工程装置数据 // 1.更新工程装置数据
JgRegistrationHistory registrationHistory = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr())); JgRegistrationHistory registrationHistory = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr()));
JSONObject newData = JSONObject.parseObject(registrationHistory.getChangeData()); JSONObject newData = JSONObject.parseObject(registrationHistory.getChangeData());
JSONArray newPipData = JSONArray.parseArray(newData.getString(DEVICE_LIST)); JSONArray newPipData = Optional.ofNullable(JSONArray.parseArray(newData.getString(DEVICE_LIST))).orElse(new JSONArray());
JSONArray delPipData = JSONArray.parseArray(newData.getString(DEL_DEVICE_LIST)); JSONArray delPipData = Optional.ofNullable(JSONArray.parseArray(newData.getString(DEL_DEVICE_LIST))).orElse(new JSONArray());
// JSONObject oldData = JSONObject.parseObject(registrationHistory.getOldData()); // JSONObject oldData = JSONObject.parseObject(registrationHistory.getOldData());
// JSONArray oldPipData = JSONArray.parseArray(oldData.getString(DEVICE_LIST)); // JSONArray oldPipData = JSONArray.parseArray(oldData.getString(DEVICE_LIST));
// 1.1更新工程装置中的【管道信息】增加减少或修改管道信息 // 1.1更新工程装置中的【管道信息】增加减少或修改管道信息
...@@ -1321,10 +1321,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -1321,10 +1321,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
return; return;
} }
JgRegistrationHistory registrationHistory = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr())); JgRegistrationHistory registrationHistory = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr()));
JSONObject newData = JSONObject.parseObject(registrationHistory.getChangeData()); JSONObject newData = Optional.ofNullable(JSONObject.parseObject(registrationHistory.getChangeData())).orElse(new JSONObject());
JSONArray alreadyDelPipData = JSONArray.parseArray(newData.getString(DEL_DEVICE_LIST)); JSONArray alreadyDelPipData = Optional.ofNullable(JSONArray.parseArray(newData.getString(DEL_DEVICE_LIST))).orElse(new JSONArray());
JSONObject oldData = JSONObject.parseObject(registrationHistory.getOldData()); JSONObject oldData = Optional.ofNullable(JSONObject.parseObject(registrationHistory.getOldData())).orElse(new JSONObject());
JSONArray oldPipData = JSONArray.parseArray(oldData.getString(DEVICE_LIST)); JSONArray oldPipData = Optional.ofNullable(JSONArray.parseArray(oldData.getString(DEVICE_LIST))).orElse(new JSONArray());
double oldPipLength = oldPipData.stream().mapToDouble(item -> JSON.parseObject(item.toString()).getDoubleValue(PIPE_LENGTH)).sum(); double oldPipLength = oldPipData.stream().mapToDouble(item -> JSON.parseObject(item.toString()).getDoubleValue(PIPE_LENGTH)).sum();
List<String> oldPipDataRecords = oldPipData.stream().map(item -> JSON.parseObject(item.toString()).getString(RECORD)).collect(Collectors.toList()); List<String> oldPipDataRecords = oldPipData.stream().map(item -> JSON.parseObject(item.toString()).getString(RECORD)).collect(Collectors.toList());
List<String> nowPipDataRecords = idxBizJgProjectContraptionMapper.selectEquipList(notice.getProjectContraptionId()).stream().map(item -> String.valueOf(item.get("record"))).collect(Collectors.toList()); List<String> nowPipDataRecords = idxBizJgProjectContraptionMapper.selectEquipList(notice.getProjectContraptionId()).stream().map(item -> String.valueOf(item.get("record"))).collect(Collectors.toList());
......
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