|
@@ -1836,31 +1836,42 @@ public class InformationWriteQueryController extends BladeController {
|
|
if (wtc != null) {
|
|
if (wtc != null) {
|
|
try {
|
|
try {
|
|
String tableName = wtc.getInitTableName();
|
|
String tableName = wtc.getInitTableName();
|
|
- if (parent == null) {
|
|
|
|
- parent = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(wtc.getParentId(), Long.parseLong(wtc.getContractId()));
|
|
|
|
- }
|
|
|
|
- if (checkG8(tableName) && !ekvMap.containsKey(tableName)) {
|
|
|
|
- List<Map<String, Object>> listMaps = this.jdbcTemplate.queryForList("select rely from m_formula where number ='TURN_POINT' limit 1");
|
|
|
|
- if (listMaps.size() > 0) {
|
|
|
|
- String rely = listMaps.get(0).get("rely").toString();
|
|
|
|
- ekvMap.put(tableName, Arrays.stream(rely.split("[,]")).skip(1).map(e -> e.split(":")[1]).collect(Collectors.toMap(e -> e, e -> "null")));
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- FormulaOption formulaOption = this.formulaClient.option(parent.getPKeyId());
|
|
|
|
- if (formulaOption != null) {
|
|
|
|
- JSONObject root = JSON.parseObject(formulaOption.getVal());
|
|
|
|
- JSONObject table = (JSONObject) root.computeIfAbsent(wtc.getInitTableName(), (k) -> new JSONObject());
|
|
|
|
- Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());
|
|
|
|
- table.forEach((k, v) -> {
|
|
|
|
- if (!k.contains("@")) {
|
|
|
|
- /*元素级别*/
|
|
|
|
- JSONObject elementJson = (JSONObject) v;
|
|
|
|
- JSONArray rgJson = elementJson.getJSONArray(RangeInfo.RG);
|
|
|
|
- if (rgJson != null) {
|
|
|
|
- map.put(k, rgJson.toJSONString());
|
|
|
|
|
|
+ if(!ekvMap.containsKey(tableName)) {
|
|
|
|
+ Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());
|
|
|
|
+ if (parent == null) {
|
|
|
|
+ parent = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(wtc.getParentId(), Long.parseLong(wtc.getContractId()));
|
|
|
|
+ }
|
|
|
|
+ /*节点公式*/
|
|
|
|
+ List<Map<String, Object>> paramKey = this.jdbcTemplate.queryForList("select DISTINCT b.e_key ek from m_table_info a join m_wbs_form_element b on a.id=b.f_id join m_element_formula_mapping c on b.id = c.element_id where a.tab_en_name='" + tableName + "' and b.is_deleted=0 and c.scope=35 ");
|
|
|
|
+ if (paramKey.size() > 0) {
|
|
|
|
+ map.putAll(paramKey.stream().map(m -> m.get("ek").toString()).collect(Collectors.toMap(s -> s, s -> StringPool.NULL)));
|
|
|
|
+ }
|
|
|
|
+ /*G8肯定不会用右键生成数据*/
|
|
|
|
+ if (checkG8(tableName)) {
|
|
|
|
+ List<Map<String, Object>> listMaps = this.jdbcTemplate.queryForList("select rely from m_formula where number ='TURN_POINT' limit 1");
|
|
|
|
+ if (listMaps.size() > 0) {
|
|
|
|
+ String rely = listMaps.get(0).get("rely").toString();
|
|
|
|
+ /* Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());*/
|
|
|
|
+ map.putAll(Arrays.stream(rely.split("[,]")).skip(1).map(e -> e.split(":")[1]).collect(Collectors.toMap(e -> e, e -> StringPool.NULL)));
|
|
|
|
+ /*ekvMap.put(tableName, Arrays.stream(rely.split("[,]")).skip(1).map(e -> e.split(":")[1]).collect(Collectors.toMap(e -> e, e -> "null")));*/
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ FormulaOption formulaOption = this.formulaClient.option(parent.getPKeyId());
|
|
|
|
+ if (formulaOption != null) {
|
|
|
|
+ JSONObject root = JSON.parseObject(formulaOption.getVal());
|
|
|
|
+ JSONObject table = (JSONObject) root.computeIfAbsent(wtc.getInitTableName(), (k) -> new JSONObject());
|
|
|
|
+ /*Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());*/
|
|
|
|
+ table.forEach((k, v) -> {
|
|
|
|
+ if (!k.contains("@")) {
|
|
|
|
+ /*元素级别*/
|
|
|
|
+ JSONObject elementJson = (JSONObject) v;
|
|
|
|
+ JSONArray rgJson = elementJson.getJSONArray(RangeInfo.RG);
|
|
|
|
+ if (rgJson != null) {
|
|
|
|
+ map.put(k, rgJson.toJSONString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ekvMap.getOrDefault(tableName, new HashMap<>());
|
|
return ekvMap.getOrDefault(tableName, new HashMap<>());
|