Commit 40420db8 authored by 刘凡's avatar 刘凡

*)修改应急模板报错问题

parent 657fb729
...@@ -38,15 +38,13 @@ public class DPSubController { ...@@ -38,15 +38,13 @@ public class DPSubController {
public ResponseModel<JSONObject> commonQuery(@PathVariable String template, @RequestBody Map<String, Object> param) { public ResponseModel<JSONObject> commonQuery(@PathVariable String template, @RequestBody Map<String, Object> param) {
if (template.equals("company")) { if (template.equals("company")) {
Assert.notNull(param.get("useUnitCode"), "企业统一信用代码不能为空"); Assert.notNull(param.get("useUnitCode"), "企业统一信用代码不能为空");
} else if (template.equals("emergency")) {
Assert.notNull(param.get("id"), "id不能为空");
} else if (template.equals("equip")) { } else if (template.equals("equip")) {
param.put("record", param.get("SEQUENCE_NBR")); param.put("record", param.get("SEQUENCE_NBR"));
param.put("equList", param.get("EQU_LIST_CODE")); param.put("equList", param.get("EQU_LIST_CODE"));
Assert.notNull(param.get("record"), "设备ID不能为空"); Assert.notNull(param.get("record"), "设备ID不能为空");
Assert.notNull(param.get("equList"), "设备种类不能为空"); Assert.notNull(param.get("equList"), "设备种类不能为空");
template = template + "_" + param.get("equList"); template = template + "_" + param.get("equList");
} else if (template.equals("issue")) { } else if (template.equals("emergency") || template.equals("problem")) {
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空"); Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else { } else {
throw new RuntimeException("暂无模板"); throw new RuntimeException("暂无模板");
......
...@@ -65,9 +65,11 @@ public class DPSubServiceImpl { ...@@ -65,9 +65,11 @@ public class DPSubServiceImpl {
//1、替换json中所有的变量 //1、替换json中所有的变量
if (!ValidationUtil.isEmpty(param)) { if (!ValidationUtil.isEmpty(param)) {
for (Map.Entry item : param.entrySet()) { for (Map.Entry item : param.entrySet()) {
if(!ValidationUtil.isEmpty(item.getValue())){
templateJson = templateJson.replaceAll("\\{" + item.getKey() + "\\}", item.getValue().toString()); templateJson = templateJson.replaceAll("\\{" + item.getKey() + "\\}", item.getValue().toString());
} }
} }
}
//2、解析结构 //2、解析结构
result = JSON.parseObject(templateJson); result = JSON.parseObject(templateJson);
JSONArray tabs = result.getJSONArray("tabs"); JSONArray tabs = result.getJSONArray("tabs");
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/detail/{id}" "apiPath":"/elevator/alert-called/detail/{sequenceNbr}"
} }
} }
}, },
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/basicDetail/{id}" "apiPath":"/elevator/alert-called/basicDetail/{sequenceNbr}"
} }
} }
}, },
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/dispatchRecord/{id}" "apiPath":"/elevator/alert-called/dispatchRecord/{sequenceNbr}"
} }
} }
}, },
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/followRecords/{id}" "apiPath":"/elevator/alert-called/followRecords/{sequenceNbr}"
} }
} }
}, },
...@@ -48,11 +48,10 @@ ...@@ -48,11 +48,10 @@
"key": "callRecords", "key": "callRecords",
"displayName": "通话记录", "displayName": "通话记录",
"renderType": "table", "renderType": "table",
"formSeq": "",
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/callRecords/{id}" "apiPath":"/elevator/alert-called/callRecords/{sequenceNbr}"
} }
}, },
......
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