Commit d7322845 authored by 刘凡's avatar 刘凡

*)修改模板

parent d66d5e50
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.utils.JsonValueUtils; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.utils.JsonValueUtils;
import com.yeejoin.amos.boot.biz.common.utils.RestTemplateUtils; import com.yeejoin.amos.boot.biz.common.utils.RestTemplateUtils;
import com.yeejoin.amos.boot.biz.common.utils.StringUtils; import com.yeejoin.amos.boot.biz.common.utils.StringUtils;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.DpSubUtils; import com.yeejoin.amos.boot.module.statistcs.biz.utils.DpSubUtils;
import com.yeejoin.amos.boot.module.statistics.api.enums.DPStatusEnum;
import com.yeejoin.amos.boot.module.statistics.api.mapper.*; import com.yeejoin.amos.boot.module.statistics.api.mapper.*;
import com.yeejoin.amos.feign.morphic.Morphic; import com.yeejoin.amos.feign.morphic.Morphic;
import com.yeejoin.amos.feign.morphic.model.FormSceneModel; import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
...@@ -105,6 +106,11 @@ public class DPSubServiceImpl { ...@@ -105,6 +106,11 @@ public class DPSubServiceImpl {
log.info("{}tab页获取详情接口,共耗时:{} 毫秒", tab.get("displayName"), (e - s)); log.info("{}tab页获取详情接口,共耗时:{} 毫秒", tab.get("displayName"), (e - s));
} }
if (tab.getString("template").contains("emergency")){
content.put(tab.getString("key"), JSONObject.parseObject(apiResult.toString()));
return;
}
if (!ValidationUtil.isEmpty(formSeq)) { if (!ValidationUtil.isEmpty(formSeq)) {
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
FormSceneModel formPage = Morphic.formSceneClient.seleteOne(formSeq).getResult(); FormSceneModel formPage = Morphic.formSceneClient.seleteOne(formSeq).getResult();
...@@ -165,10 +171,6 @@ public class DPSubServiceImpl { ...@@ -165,10 +171,6 @@ public class DPSubServiceImpl {
public JSONObject buildContentKeyinfoData(JSONObject tab, JSONObject content, Object apiResult){ public JSONObject buildContentKeyinfoData(JSONObject tab, JSONObject content, Object apiResult){
JSONObject result = JSONObject.parseObject(apiResult.toString()); JSONObject result = JSONObject.parseObject(apiResult.toString());
if (tab.getString("template").contains("emergency")){
content.put("keyinfo", result);
return content;
}
JSONObject param = tab.getJSONObject("param"); JSONObject param = tab.getJSONObject("param");
Object keyParams = JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.keyParams"); Object keyParams = JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.keyParams");
if (ValidationUtil.isEmpty(keyParams)){ if (ValidationUtil.isEmpty(keyParams)){
...@@ -204,21 +206,31 @@ public class DPSubServiceImpl { ...@@ -204,21 +206,31 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(jsonArray)){ if (!ValidationUtil.isEmpty(jsonArray)){
content.getJSONObject("keyinfo").put("photo", jsonArray.getJSONObject(0).getString("url")); content.getJSONObject("keyinfo").put("photo", jsonArray.getJSONObject(0).getString("url"));
} }
// 处理标签
// 处理标签
JSONArray status = (JSONArray)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.status");
this.processLabel(status, param.getString("EQU_STATE"));
// 处理问题列表 // 处理问题列表
List<Map<String, String>> problem = dpSubBizService.queryProblemListByEquipId(param.getString("record")); List<Map<String, String>> problem = dpSubBizService.queryProblemListByEquipId(param.getString("record"));
if (!ValidationUtil.isEmpty(problem)){ if (!ValidationUtil.isEmpty(problem)){
Object qrcode = JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.qrcode"); JSONObject qrcode = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.qrcode");
((JSONObject)qrcode).put("problem", problem); qrcode.put("problem", problem);
} }
// 处理监管履历 // 处理监管履历
List<Map<String, String>> datas = dpSubBizService.equOnJgServiceOperationRecords(param.getString("record")); List<Map<String, String>> datas = dpSubBizService.equOnJgServiceOperationRecords(param.getString("record"));
if (!ValidationUtil.isEmpty(datas)){ if (!ValidationUtil.isEmpty(datas)){
Object infoRecords = JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.infoRecords"); JSONObject infoRecords = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.infoRecords");
((JSONObject)infoRecords).put("datas", datas); infoRecords.put("datas", datas);
param.put("reghistory", datas); param.put("reghistory", datas);
} }
} else if(tab.getString("template").contains("company")){ } else if(tab.getString("template").contains("company")){
// 处理标签
JSONArray status = (JSONArray)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.status");
this.processLabel(status, result.getString("unitType"));
this.processLabel(status, result.getString("operatingStatus"));
// 处理图片 // 处理图片
JSONArray jsonArray = result.getJSONArray("unitBusinessLicense"); JSONArray jsonArray = result.getJSONArray("unitBusinessLicense");
if (!ValidationUtil.isEmpty(jsonArray)){ if (!ValidationUtil.isEmpty(jsonArray)){
...@@ -228,6 +240,16 @@ public class DPSubServiceImpl { ...@@ -228,6 +240,16 @@ public class DPSubServiceImpl {
return content; return content;
} }
private JSONArray processLabel(JSONArray status, String value){
if (!ValidationUtil.isEmpty(value)){
DPStatusEnum enumByStatus = DPStatusEnum.getEnumByStatus(value);
if (!ValidationUtil.isEmpty(enumByStatus)){
status.add(DPStatusEnum.toMap(enumByStatus));
}
}
return status;
}
private JSONArray processShowHideRules(JSONArray children, Object showHideRules, Object apiResult) { private JSONArray processShowHideRules(JSONArray children, Object showHideRules, Object apiResult) {
JSONObject result = JSONObject.parseObject(apiResult.toString()); JSONObject result = JSONObject.parseObject(apiResult.toString());
if (!ValidationUtil.isEmpty(showHideRules)) { if (!ValidationUtil.isEmpty(showHideRules)) {
......
...@@ -74,11 +74,7 @@ ...@@ -74,11 +74,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "2", "label": "在业", "icon": "", "value": "success" },
{ "key": "3", "label": "否", "icon": "", "value": "error" },
{ "key": "4", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -120,10 +120,7 @@ ...@@ -120,10 +120,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -124,10 +124,7 @@ ...@@ -124,10 +124,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -120,11 +120,7 @@ ...@@ -120,11 +120,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" },
{ "key": "3", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -116,10 +116,7 @@ ...@@ -116,10 +116,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -112,10 +112,7 @@ ...@@ -112,10 +112,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -106,10 +106,7 @@ ...@@ -106,10 +106,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -112,10 +112,7 @@ ...@@ -112,10 +112,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
...@@ -112,10 +112,7 @@ ...@@ -112,10 +112,7 @@
], ],
"content": { "content": {
"keyinfo": { "keyinfo": {
"status": [ "status": [],
{ "key": "1", "label": "在用", "icon": "", "value": "success" },
{ "key": "2", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": { "qrcode": {
"title": "监管码", "title": "监管码",
"problem": [] "problem": []
......
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