Commit a4d6ebc5 authored by 刘凡's avatar 刘凡

*)抽服务引发的少文件问题

parent bf35debb
package com.yeejoin.amos.boot.module.jyjc.biz.config; package com.yeejoin.amos.boot.module.statistcs.biz.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -15,6 +14,7 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel; ...@@ -15,6 +14,7 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
import jdk.nashorn.api.scripting.ScriptObjectMirror; import jdk.nashorn.api.scripting.ScriptObjectMirror;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -47,6 +47,7 @@ public class DPSubServiceImpl { ...@@ -47,6 +47,7 @@ public class DPSubServiceImpl {
private static final String GATEWAY_SERVER_NAME = "AMOS-SERVER-GATEWAY"; private static final String GATEWAY_SERVER_NAME = "AMOS-SERVER-GATEWAY";
@Autowired @Autowired
@LoadBalanced
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Autowired @Autowired
...@@ -84,7 +85,7 @@ public class DPSubServiceImpl { ...@@ -84,7 +85,7 @@ public class DPSubServiceImpl {
tab.put("param", param); tab.put("param", param);
JSONObject map = content.getJSONObject(tab.getString("key")); JSONObject map = content.getJSONObject(tab.getString("key"));
if (ValidationUtil.isEmpty(map)) { if (ValidationUtil.isEmpty(map)){
map = new JSONObject(); map = new JSONObject();
} }
Object apiResult = null; Object apiResult = null;
...@@ -140,9 +141,9 @@ public class DPSubServiceImpl { ...@@ -140,9 +141,9 @@ public class DPSubServiceImpl {
map.getJSONArray("subs").add(matinfo); map.getJSONArray("subs").add(matinfo);
} }
} else { } else {
if ("timeline".equals(renderType)) { if ("timeline".equals(renderType)){
content.put(tab.getString("key"), apiResult); content.put(tab.getString("key"), apiResult);
} else if ("table".equals(renderType)) { } else if("table".equals(renderType)){
Object columns = JsonValueUtils.getValueByKey(tab, "visualParams", "visualParams.columns"); Object columns = JsonValueUtils.getValueByKey(tab, "visualParams", "visualParams.columns");
map.put("columns", columns); map.put("columns", columns);
map.put("dataList", apiResult); map.put("dataList", apiResult);
...@@ -387,9 +388,9 @@ public class DPSubServiceImpl { ...@@ -387,9 +388,9 @@ public class DPSubServiceImpl {
JSONObject param = tab.getJSONObject("param"); JSONObject param = tab.getJSONObject("param");
jsonObject.put("type", "text"); jsonObject.put("type", "text");
jsonObject.put("value", value); jsonObject.put("value", value);
if (!ValidationUtil.isEmpty(paramFieldKeys) && ((JSONArray) paramFieldKeys).contains(fieldKey)) { if (!ValidationUtil.isEmpty(paramFieldKeys) && ((JSONArray) paramFieldKeys).contains(fieldKey)){
jsonObject.put("value", param.getString(fieldKey)); jsonObject.put("value", param.getString(fieldKey));
} else if (!ValidationUtil.isEmpty(dictionaryFieldKeys) && ((JSONArray) dictionaryFieldKeys).stream().anyMatch(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey")))) { } else if(!ValidationUtil.isEmpty(dictionaryFieldKeys) && ((JSONArray) dictionaryFieldKeys).stream().anyMatch(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey")))){
((JSONArray) dictionaryFieldKeys).stream().filter(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey"))).findFirst().ifPresent(y -> { ((JSONArray) dictionaryFieldKeys).stream().filter(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey"))).findFirst().ifPresent(y -> {
JSONObject yObj = (JSONObject) y; JSONObject yObj = (JSONObject) y;
String dictionaryType = yObj.getString("dictionaryType"); String dictionaryType = yObj.getString("dictionaryType");
...@@ -408,7 +409,7 @@ public class DPSubServiceImpl { ...@@ -408,7 +409,7 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(value)) { if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject(); JSONObject attachmentUploadDatasObj = new JSONObject();
String label = visualParams.getString("label"); String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName)) { if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")"; label = label + "(" + displayName + ")";
} }
attachmentUploadDatasObj.put("label", label); attachmentUploadDatasObj.put("label", label);
...@@ -423,15 +424,15 @@ public class DPSubServiceImpl { ...@@ -423,15 +424,15 @@ public class DPSubServiceImpl {
attachmentUploadDatasObj.put("value", value); attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept"); String accept = visualParams.getString("accept");
String label = visualParams.getString("label"); String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName)) { if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")"; label = label + "(" + displayName + ")";
} }
attachmentUploadDatasObj.put("label", label); attachmentUploadDatasObj.put("label", label);
if (accept.equals(".*") || accept.contains("doc") || accept.contains("docx") || accept.contains("pdf") || accept.contains("xls") || accept.contains("xlsx")) { if (accept.equals(".*") || accept.contains("doc") || accept.contains("docx") || accept.contains("pdf") || accept.contains("xls") || accept.contains("xlsx")){
attachmentUploadDatasObj.put("type", "file"); attachmentUploadDatasObj.put("type", "file");
} else if (accept.contains("png") || accept.contains("img")) { } else if(accept.contains("png") || accept.contains("img")){
attachmentUploadDatasObj.put("type", "img"); attachmentUploadDatasObj.put("type", "img");
} else if (accept.contains("mp4") || accept.contains("flv")) { } else if(accept.contains("mp4") || accept.contains("flv")){
attachmentUploadDatasObj.put("type", "video"); attachmentUploadDatasObj.put("type", "video");
} }
attachmentUploadDatas.add(attachmentUploadDatasObj); attachmentUploadDatas.add(attachmentUploadDatasObj);
...@@ -458,7 +459,7 @@ public class DPSubServiceImpl { ...@@ -458,7 +459,7 @@ public class DPSubServiceImpl {
} }
} }
} }
if (!("upload".equals(xObj.getString("componentKey")) || "attachmentUpload".equals(xObj.getString("componentKey")))) { if (!("upload".equals(xObj.getString("componentKey")) || "attachmentUpload".equals(xObj.getString("componentKey")))){
datas.add(jsonObject); datas.add(jsonObject);
} }
return datas; return datas;
...@@ -502,16 +503,16 @@ public class DPSubServiceImpl { ...@@ -502,16 +503,16 @@ public class DPSubServiceImpl {
String url = apiObj.getString("apiPath"); String url = apiObj.getString("apiPath");
String reqType = !ValidationUtil.isEmpty(apiObj.getString("httpMethod")) ? apiObj.getString("httpMethod") : "GET"; String reqType = !ValidationUtil.isEmpty(apiObj.getString("httpMethod")) ? apiObj.getString("httpMethod") : "GET";
Object params = apiObj.get("params"); Object params = apiObj.get("params");
if (ValidationUtil.isEmpty(params) && !ValidationUtil.isEmpty(apiObj.get("queryParams"))) { if (ValidationUtil.isEmpty(params) && !ValidationUtil.isEmpty(apiObj.get("queryParams"))){
JSONObject queryParam = new JSONObject(); JSONObject queryParam = new JSONObject();
JSONArray queryParams = apiObj.getJSONArray("queryParams"); JSONArray queryParams = apiObj.getJSONArray("queryParams");
queryParams.stream().forEach(x -> { queryParams.stream().forEach(x -> {
JSONObject xObj = (JSONObject) x; JSONObject xObj = (JSONObject) x;
if ("staticValue".equals(JsonValueUtils.getValueByKey(x, "value", "value.source"))) { if ("staticValue".equals(JsonValueUtils.getValueByKey(x, "value", "value.source"))){
queryParam.put(xObj.getString("name"), xObj.getJSONObject("value").getString("value")); queryParam.put(xObj.getString("name"), xObj.getJSONObject("value").getString("value"));
} }
}); });
if (!ValidationUtil.isEmpty(queryParam)) { if (!ValidationUtil.isEmpty(queryParam)){
params = queryParam; params = queryParam;
} }
} }
...@@ -558,7 +559,7 @@ public class DPSubServiceImpl { ...@@ -558,7 +559,7 @@ public class DPSubServiceImpl {
Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert); Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert);
ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class); ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class);
if (200 != responseModel.getStatus()) { if (200 != responseModel.getStatus()){
log.info("调用第三方接口失败, 请求地址:{}", apiObj); log.info("调用第三方接口失败, 请求地址:{}", apiObj);
} }
......
...@@ -14,7 +14,17 @@ ...@@ -14,7 +14,17 @@
"useCode": "{useUnitCode}" "useCode": "{useUnitCode}"
} }
}, },
"resultConvert": "" "resultConvert": "",
"dictionaryFieldKeys": [
{
"fieldKey": "industrySupervisor",
"dictionaryType": "HYZGBM"
},
{
"fieldKey": "registeredOrganCode",
"dictionaryType": "DJJG"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,21 @@ ...@@ -35,7 +49,21 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "DEVICE_LEVEL",
"dictionaryType": "GLJB"
},
{
"fieldKey": "FUEL_TYPE",
"dictionaryType": "GLZL"
},
{
"fieldKey": "NAME_OF_PRESSURE_PARTS",
"dictionaryType": "GLBJMC"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,25 @@ ...@@ -35,7 +49,25 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "QP_LOSSLESS",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "RQJCFF",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "MAIN_STRUCTURE_TYPE",
"dictionaryType": "RQJG"
},
{
"fieldKey": "CHECK_LOSSLESS",
"dictionaryType": "RQJCFF"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,21 @@ ...@@ -35,7 +49,21 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "CONTROL_MODE",
"dictionaryType": "KZFS"
},
{
"fieldKey": "EXPLOSIONPROOF_GRADE",
"dictionaryType": "FBDJ"
},
{
"fieldKey": "JACKING_TYPE",
"dictionaryType": "DSXS"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,17 @@ ...@@ -35,7 +49,17 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "WORK_LEVEL",
"dictionaryType": "GZJB"
},
{
"fieldKey": "select_bq8h7v9tj1",
"dictionaryType": "FBDJ"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "PROTECT_GRADE",
"dictionaryType": "FBDJ"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "GDLB",
"dictionaryType": "GDLB"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "CARRIER_LINE",
"dictionaryType": "YZS"
}
]
} }
}, },
{ {
......
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