Commit 040c027c authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents 8053f3d6 bd72a9c9
...@@ -98,18 +98,18 @@ public class ChangeEquipImpactCertListener { ...@@ -98,18 +98,18 @@ public class ChangeEquipImpactCertListener {
switch (category) { switch (category) {
case "USE_CERT": case "USE_CERT":
this.updateUseCertField(manage, meta); this.updateUseCertField(manage, meta);
keysToJson.addAll(Arrays.asList("CERTIFICATE_NORMAL", "CERTIFICATE_NESTED")); keysToJson.addAll(Arrays.asList(CERTIFICATE_NORMAL, CERTIFICATE_NESTED));
break; break;
case "USE_FLAG": case "USE_FLAG":
case "USE_FLAG_VEHICLE": case "USE_FLAG_VEHICLE":
keysToJson.addAll(Arrays.asList("USE_FLAG_NORMAL", "USE_FLAG_NESTED")); keysToJson.addAll(Arrays.asList(USE_FLAG_NORMAL, USE_FLAG_NESTED));
break; break;
case "PIPELINE_SUMMARY": case "PIPELINE_SUMMARY":
case "NOTICE": case "NOTICE":
keysToJson.add("EXPORT_SUMMARY_TABLE"); keysToJson.add(EXPORT_SUMMARY_TABLE);
break; break;
case "USE_CYLINDER_SUMMARY": case "USE_CYLINDER_SUMMARY":
keysToJson.add("CERTIFICATE_NORMAL"); keysToJson.add(CERTIFICATE_NORMAL);
break; break;
default: default:
log.warn("未知分类字段:[{}]", category); log.warn("未知分类字段:[{}]", category);
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.map.MapBuilder; import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -100,15 +101,13 @@ public class JgBizChangeLogServiceImpl extends BaseService<JgBizChangeLogDto, Jg ...@@ -100,15 +101,13 @@ public class JgBizChangeLogServiceImpl extends BaseService<JgBizChangeLogDto, Jg
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit);
JSONObject source = jsonObject.getJSONObject("sourceAsMap"); JSONObject source = jsonObject.getJSONObject("sourceAsMap");
if (!ValidationUtil.isEmpty(source.get("columnType")) && !"String".equals(source.get("columnType"))) { if (!ValidationUtil.isEmpty(source.get("columnType")) && !"String".equals(source.get("columnType"))) {
Object before = source.get("beforeData"); for (String key : new String[]{"beforeData", "afterData", "displayOldValue", "displayNewValue"}) {
Object after = source.get("afterData"); String value = Objects.toString(source.get(key), "").trim();
Object displayOldValue = source.get("displayOldValue"); if (value.startsWith("[")) {
Object displayNewValue = source.get("displayNewValue"); source.put(key, JSONObject.parseArray(value));
if (Objects.toString(before, "").trim().startsWith("[") && Objects.toString(after, "").trim().startsWith("[")) { } else {
source.put("beforeData", JSONObject.parseArray(Objects.toString(before, ""))); source.put(key, new JSONArray());
source.put("afterData", JSONObject.parseArray(Objects.toString(after, ""))); }
source.put("displayOldValue", JSONObject.parseArray(Objects.toString(displayOldValue, "")));
source.put("displayNewValue", JSONObject.parseArray(Objects.toString(displayNewValue, "")));
} }
} }
list.add(source); list.add(source);
......
...@@ -4455,45 +4455,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -4455,45 +4455,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return resultBuilder.build(); return resultBuilder.build();
} }
private void setProjectContraptionInfo(IdxBizJgProjectContraption projectContraption, MapBuilder<String, Object> re) { private void setProjectContraptionInfo(IdxBizJgProjectContraption p, MapBuilder<String, Object> re) {
// 查询最新的历史记录 JSONObject h = Optional.ofNullable(jgRegistrationHistoryService.queryLatestRegistrationHistory(p.getSequenceNbr()))
JgRegistrationHistory history = jgRegistrationHistoryService.queryLatestRegistrationHistory(projectContraption.getSequenceNbr()); .map(JgRegistrationHistory::getChangeData)
.map(JSON::parseObject)
Map<String, Object> fieldMappings = new HashMap<>(); .orElse(new JSONObject());
if (history != null && history.getChangeData() != null) { re.put("useRegistrationCode", p.getUseRegistrationCode());
JSONObject hisJson = JSON.parseObject(history.getChangeData()); re.put("safetyManager", h.getOrDefault("safetyManagerId", "") + "_" + h.getOrDefault("safetyManager", ""));
fieldMappings.put("useRegistrationCode", projectContraption.getUseRegistrationCode()); re.put("useDate", h.getOrDefault("useDate", p.getUseDate()));
fieldMappings.put("safetyManager", hisJson.get("safetyManagerId") + "_" + hisJson.get("safetyManager")); re.put("otherAccessories", h.get("otherAccessories"));
fieldMappings.put("useDate", hisJson.get("useDate")); re.put("province", h.getOrDefault("province", p.getProvince()));
fieldMappings.put("otherAccessories", hisJson.get("otherAccessories")); re.put("city", h.getOrDefault("city", p.getCity()));
fieldMappings.put("factoryUseSiteStreet", hisJson.get("factoryUseSiteStreet")); re.put("county", h.getOrDefault("county", p.getCounty()));
fieldMappings.put("province", hisJson.get("province")); re.put("factoryUseSiteStreet", h.getOrDefault("factoryUseSiteStreet", p.getStreet()));
fieldMappings.put("address", hisJson.get("address")); re.put("address", h.getOrDefault("address", p.getAddress()));
fieldMappings.put("city", hisJson.get("city")); re.put("isXixian", h.get("isXixian"));
fieldMappings.put("isXixian", hisJson.get("isXixian")); re.put("startLatitudeLongitude", Optional.ofNullable(h.get("startLatitudeLongitude"))
fieldMappings.put("county", hisJson.get("county")); .orElseGet(() -> Optional.ofNullable(h.get("longitudeLatitude"))
fieldMappings.put("startLatitudeLongitude", .orElse(JSON.parseObject(p.getStartLatitudeLongitude()))));
Objects.isNull(hisJson.get("startLatitudeLongitude")) ? re.put("endLatitudeLongitude", Optional.ofNullable(h.get("startLatitudeLongitude"))
hisJson.get("longitudeLatitude") : .map(x -> Optional.ofNullable(h.get("endLatitudeLongitude")).orElse(h.get("longitudeLatitude")))
hisJson.get("startLatitudeLongitude")); .orElse(JSON.parseObject(p.getEndLatitudeLongitude())));
fieldMappings.put("endLatitudeLongitude", re.put("estateUnitName", h.get("estateUnitName"));
Objects.isNull(hisJson.get("startLatitudeLongitude")) ? re.put("orgBranchCode", h.getOrDefault("orgBranchCode", p.getOrgCode() + "_" + p.getOrgName()));
hisJson.get("longitudeLatitude") :
hisJson.get("endLatitudeLongitude"));
fieldMappings.put("estateUnitName", hisJson.get("estateUnitName"));
fieldMappings.put("orgBranchCode", hisJson.get("orgBranchCode"));
} 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) { 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