Commit 54f409ca authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715
parents 428c43b3 a4d6ebc5
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.context.annotation.Bean;
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -15,6 +14,7 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
......@@ -47,6 +47,7 @@ public class DPSubServiceImpl {
private static final String GATEWAY_SERVER_NAME = "AMOS-SERVER-GATEWAY";
@Autowired
@LoadBalanced
private RestTemplate restTemplate;
@Autowired
......@@ -84,7 +85,7 @@ public class DPSubServiceImpl {
tab.put("param", param);
JSONObject map = content.getJSONObject(tab.getString("key"));
if (ValidationUtil.isEmpty(map)) {
if (ValidationUtil.isEmpty(map)){
map = new JSONObject();
}
Object apiResult = null;
......@@ -140,9 +141,9 @@ public class DPSubServiceImpl {
map.getJSONArray("subs").add(matinfo);
}
} else {
if ("timeline".equals(renderType)) {
if ("timeline".equals(renderType)){
content.put(tab.getString("key"), apiResult);
} else if ("table".equals(renderType)) {
} else if("table".equals(renderType)){
Object columns = JsonValueUtils.getValueByKey(tab, "visualParams", "visualParams.columns");
map.put("columns", columns);
map.put("dataList", apiResult);
......@@ -387,9 +388,9 @@ public class DPSubServiceImpl {
JSONObject param = tab.getJSONObject("param");
jsonObject.put("type", "text");
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));
} 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 -> {
JSONObject yObj = (JSONObject) y;
String dictionaryType = yObj.getString("dictionaryType");
......@@ -408,7 +409,7 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject();
String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName)) {
if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")";
}
attachmentUploadDatasObj.put("label", label);
......@@ -423,15 +424,15 @@ public class DPSubServiceImpl {
attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept");
String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName)) {
if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")";
}
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");
} else if (accept.contains("png") || accept.contains("img")) {
} else if(accept.contains("png") || accept.contains("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");
}
attachmentUploadDatas.add(attachmentUploadDatasObj);
......@@ -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);
}
return datas;
......@@ -502,16 +503,16 @@ public class DPSubServiceImpl {
String url = apiObj.getString("apiPath");
String reqType = !ValidationUtil.isEmpty(apiObj.getString("httpMethod")) ? apiObj.getString("httpMethod") : "GET";
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();
JSONArray queryParams = apiObj.getJSONArray("queryParams");
queryParams.stream().forEach(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"));
}
});
if (!ValidationUtil.isEmpty(queryParam)) {
if (!ValidationUtil.isEmpty(queryParam)){
params = queryParam;
}
}
......@@ -558,7 +559,7 @@ public class DPSubServiceImpl {
Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert);
ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class);
if (200 != responseModel.getStatus()) {
if (200 != responseModel.getStatus()){
log.info("调用第三方接口失败, 请求地址:{}", apiObj);
}
......
......@@ -14,7 +14,17 @@
"useCode": "{useUnitCode}"
}
},
"resultConvert": ""
"resultConvert": "",
"dictionaryFieldKeys": [
{
"fieldKey": "industrySupervisor",
"dictionaryType": "HYZGBM"
},
{
"fieldKey": "registeredOrganCode",
"dictionaryType": "DJJG"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"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 @@
"ruleData": {
"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 @@
"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 @@
"ruleData": {
"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 @@
"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 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "CONTROL_MODE",
"dictionaryType": "KZFS"
},
{
"fieldKey": "EXPLOSIONPROOF_GRADE",
"dictionaryType": "FBDJ"
},
{
"fieldKey": "JACKING_TYPE",
"dictionaryType": "DSXS"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"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 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "WORK_LEVEL",
"dictionaryType": "GZJB"
},
{
"fieldKey": "select_bq8h7v9tj1",
"dictionaryType": "FBDJ"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"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 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "PROTECT_GRADE",
"dictionaryType": "FBDJ"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"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 @@
"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 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "GDLB",
"dictionaryType": "GDLB"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"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 @@
"ruleData": {
"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