Commit ebc93f74 authored by 刘凡's avatar 刘凡

*)修改合并问题

parent 62a5eb61
......@@ -239,35 +239,38 @@ public class DPSubServiceImpl {
// 处理问题列表
List<Map<String, String>> problem = dpSubBizService.queryProblemListBySourceId(param.getString("record"));
List<Map<String, String>> list = new ArrayList<>();
if (!ValidationUtil.isEmpty(problem)){
JSONObject qrcode = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.qrcode");
qrcode.put("problem", problem.subList(0, 1));
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<Map<String, String>> datas = dpSubBizService.equOnJgServiceOperationRecords(param.getString("record"));
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);
}
if (!ValidationUtil.isEmpty(datas) || !ValidationUtil.isEmpty(problem)){
list.addAll(datas);
param.put("reghistory", datas);
}
// 设备业务履历跟问题履历需要合并
if (!ValidationUtil.isEmpty(list)){
JSONObject infoRecords = (JSONObject)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.infoRecords");
list.sort(Comparator.comparing(
(Map<String, String> map) -> map.get("operatingTime"),
Comparator.comparing(String::toString).reversed()
));
infoRecords.put("datas", list);
}
} else if(tab.getString("template").contains("company")){
// 处理标签
JSONArray status = (JSONArray)JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.status");
......
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