Commit 56880ed8 authored by 刘凡's avatar 刘凡

*)业务履历、问题履历合并

parent 09d8856a
......@@ -46,11 +46,11 @@ public class DPSubBizServiceImpl {
/**
* 问题记录列表
* @param equipId
* @param sourceId
* @return
*/
public List<Map<String, String>> queryProblemListByEquipId(String equipId) {
return dpSubBizMapper.queryForSafetyProblemTracingList(equipId).stream()
public List<Map<String, String>> queryProblemListBySourceId(String sourceId) {
return dpSubBizMapper.queryForSafetyProblemTracingList(sourceId).stream()
.map(x -> {
Map<String, String> map = new HashMap<>();
map.put("key", x.get("sequence_nbr"));
......
......@@ -32,9 +32,7 @@ import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -240,10 +238,10 @@ public class DPSubServiceImpl {
this.processLabel(status, param.getString("EQU_STATE"));
// 处理问题列表
List<Map<String, String>> problem = dpSubBizService.queryProblemListByEquipId(param.getString("record"));
List<Map<String, String>> problem = dpSubBizService.queryProblemListBySourceId(param.getString("record"));
if (!ValidationUtil.isEmpty(problem)){
JSONObject qrcode = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.qrcode");
qrcode.put("problem", problem);
qrcode.put("problem", problem.subList(0, 1));
}
// 处理监管履历
......@@ -251,6 +249,23 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(datas)){
JSONObject infoRecords = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.infoRecords");
infoRecords.put("datas", datas);
if (!ValidationUtil.isEmpty(problem)){ // 设备业务履历跟问题履历需要合并
List<Map<String, String>> list = new ArrayList<>();
list.addAll(datas);
List<Map<String, String>> collect = problem.stream().map(x -> {
Map<String, String> map = new HashMap<>();
map.put("label", x.get("type"));
map.put("operater", x.get("descr"));
map.put("operatingTime", x.get("createDate"));
return map;
}).collect(Collectors.toList());
list.addAll(collect);
list.sort(Comparator.comparing(
(Map<String, String> map) -> map.get("operatingTime"),
Comparator.comparing(String::toString).reversed()
));
infoRecords.put("datas", list);
}
param.put("reghistory", datas);
}
} else if(tab.getString("template").contains("company")){
......@@ -258,7 +273,25 @@ public class DPSubServiceImpl {
JSONArray status = (JSONArray)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.status");
this.processLabel(status, result.getString("unitType"));
this.processLabel(status, result.getString("operatingStatus"));
// 处理问题列表
List<Map<String, String>> problem = dpSubBizService.queryProblemListBySourceId(param.getString("sequenceNbr"));
if (!ValidationUtil.isEmpty(problem)){
JSONObject qrcode = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.qrcode");
qrcode.put("problem", problem.subList(0, 1));
// 企业时间轴显示问题履历
List<Map<String, String>> list = problem.stream().map(x -> {
Map<String, String> map = new HashMap<>();
map.put("label", x.get("type"));
map.put("operater", x.get("descr"));
map.put("operatingTime", x.get("createDate"));
return map;
}).sorted(Comparator.comparing(
(Map<String, String> map) -> map.get("operatingTime"),
Comparator.comparing(String::toString).reversed()
)).collect(Collectors.toList());
JSONObject infoRecords = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.infoRecords");
infoRecords.put("datas", list);
}
// 处理图片
JSONArray jsonArray = result.getJSONArray("unitBusinessLicense");
if (!ValidationUtil.isEmpty(jsonArray)){
......
......@@ -52,7 +52,7 @@
"apiPath":"/jg/equipment-register/page",
"params": {
"number": 1,
"size": 14,
"size": 10,
"USE_UNIT_CREDIT_CODE": "{useUnitCode}"
}
}
......@@ -89,7 +89,12 @@
{ "key": "useContact", "label": "单位联系人" },
{ "key": "contactPhone", "label": "联系电话" },
{ "key": "keyUnit", "label": "是否重点监控单位" }
]
],
"infoRecords": {
"title": "问题记录",
"renderType": "timeline",
"datas": []
}
},
"basic": {
"columns": 2,
......
......@@ -111,7 +111,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -115,7 +115,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -111,7 +111,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -107,7 +107,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -103,7 +103,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -97,7 +97,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -103,7 +103,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -103,7 +103,7 @@
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"current": 1,
"size": 14,
"size": 10,
"record": "{record}"
}
}
......
......@@ -26,7 +26,7 @@
"apiPath":"/jg/safety-problem-tracing/equip/list",
"params": {
"current": 1,
"size": 14,
"size": 10,
"sequenceNbr": "{sequenceNbr}"
}
}
......@@ -54,7 +54,7 @@
"apiPath":"/jg/safety-problem-tracing/unit/list",
"params": {
"current": 1,
"size": 14,
"size": 10,
"sequenceNbr": "{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