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