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

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

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