Commit f92b1dc2 authored by Lambertliu's avatar Lambertliu

fix(jg):管道使用登记功能Bug修改

parent 1af30530
......@@ -2995,7 +2995,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JgRegistrationHistory history = jgRegistrationHistoryService.queryLatestRegistrationHistory(Long.valueOf(jgUseRegistration.getProjectContraptionId()));
if (history != null && history.getChangeData() != null) {
JSONObject hisJson = JSON.parseObject(history.getChangeData());
boolean isFirstMerge = (boolean) hisJson.get("isFirstMerge");
boolean isFirstMerge = Optional.ofNullable(hisJson.get("isFirstMerge"))
.map(Boolean.class::cast)
.orElse(false);
//合并到无证总工程
if (isFirstMerge) {
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
......@@ -4185,9 +4187,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.put("projectContraptionNo", projectContraption.getProjectContraptionNo())
.put("isFirstMerge", projectContraption.getIsFirstMerge())
.put("pipelineLength", totalPipelineLength);
if (Objects.nonNull(projectContraption.getUseRegistrationCode())){
setProjectContraptionInfo(projectContraption, resultBuilder);
}
setProjectContraptionInfo(projectContraption, resultBuilder);
return resultBuilder.build();
}
......@@ -4195,11 +4195,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 查询最新的历史记录
JgRegistrationHistory history = jgRegistrationHistoryService.queryLatestRegistrationHistory(projectContraption.getSequenceNbr());
Map<String, Object> fieldMappings = new HashMap<>();
if (history != null && history.getChangeData() != null) {
JSONObject hisJson = JSON.parseObject(history.getChangeData());
Map<String, Object> fieldMappings = new HashMap<>();
fieldMappings.put("useRegistrationCode", projectContraption.getUseRegistrationCode());
fieldMappings.put("safetyManager", hisJson.get("safetyManagerId") + "_" +hisJson.get("safetyManager"));
fieldMappings.put("safetyManager", hisJson.get("safetyManagerId") + "_" + hisJson.get("safetyManager"));
fieldMappings.put("useDate", hisJson.get("useDate"));
fieldMappings.put("otherAccessories", hisJson.get("otherAccessories"));
fieldMappings.put("factoryUseSiteStreet", hisJson.get("factoryUseSiteStreet"));
......@@ -4218,8 +4218,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
hisJson.get("endLatitudeLongitude"));
fieldMappings.put("estateUnitName", hisJson.get("estateUnitName"));
fieldMappings.put("orgBranchCode", hisJson.get("orgBranchCode"));
fieldMappings.forEach(re::put);
} else {
fieldMappings.put("province", projectContraption.getProvince());
fieldMappings.put("city", projectContraption.getCity());
fieldMappings.put("county", projectContraption.getCounty());
fieldMappings.put("factoryUseSiteStreet", projectContraption.getStreet());
fieldMappings.put("address", projectContraption.getAddress());
fieldMappings.put("startLatitudeLongitude", JSON.parseObject(projectContraption.getStartLatitudeLongitude()));
fieldMappings.put("endLatitudeLongitude", JSON.parseObject(projectContraption.getEndLatitudeLongitude()));
fieldMappings.put("orgBranchCode", projectContraption.getOrgCode()+"_"+ projectContraption.getOrgName());
}
fieldMappings.forEach(re::put);
}
private void setConstructionInfo(String projectContraptionSeq, Map<String, Object> re) {
......
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