Commit 8566b8a5 authored by suhuiguang's avatar suhuiguang

1.应急故障原因卡片没数据

parent b5414efe
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -83,6 +84,14 @@ public class YJDPStatisticsServiceImpl {
private DataDictionaryServiceImpl dataDictionaryService;
private static final Map<String, String> BLL_LX_LEGEND = new LinkedHashMap<>();
static {
BLL_LX_LEGEND.put("trapped", "困人");
BLL_LX_LEGEND.put("complaint", "投诉");
BLL_LX_LEGEND.put("fault", "故障");
}
/**
* 电梯设备品种
*/
......@@ -106,11 +115,9 @@ public class YJDPStatisticsServiceImpl {
String endDate = DateUtil.getNow(DateUtil.Y_M_D);
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto);
JSONObject jsonObject = new JSONObject();
List<String> everyDay = this.getEveryDay(beginDate, endDate);
JSONObject jsonObject = this.buildLegendData(null, "trapped", "困人");
this.buildLegendData(jsonObject, "complaint", "投诉");
this.buildLegendData(jsonObject, "fault", "故障");
this.buildLegendData(jsonObject);
List<String> xdata = new ArrayList<>();
List<Object> trapped = new ArrayList<>();
List<Object> complaint = new ArrayList<>();
......@@ -133,7 +140,6 @@ public class YJDPStatisticsServiceImpl {
complaint.add(!ValidationUtil.isEmpty(map.get("投诉咨询")) ? Integer.parseInt(map.get("投诉咨询").toString()) : 0);
fault.add(!ValidationUtil.isEmpty(map.get("故障维修")) ? Integer.parseInt(map.get("故障维修").toString()) : 0);
});
jsonObject.put("xdata", xdata);
jsonObject.put("trapped", trapped);
jsonObject.put("complaint", complaint);
......@@ -383,19 +389,6 @@ public class YJDPStatisticsServiceImpl {
return dateList;
}
private JSONObject buildLegendData(JSONObject jsonObject, String dataKey, String value) {
if (ValidationUtil.isEmpty(jsonObject)) {
jsonObject = new JSONObject();
}
JSONObject legendData = jsonObject.getJSONObject("legendData");
if (ValidationUtil.isEmpty(legendData)) {
legendData = new JSONObject();
jsonObject.put("legendData", legendData);
}
legendData.put(dataKey, value);
return jsonObject;
}
public List<Map<String, Object>> getCenterMapCountDataForOverview(DPFilterParamDto dpFilterParamDto) {
return stCommonService.setRegionIfRootParent(dpFilterParamDto).stream().map(r -> {
DPFilterParamDto filterParamDto = new DPFilterParamDto();
......@@ -412,6 +405,18 @@ public class YJDPStatisticsServiceImpl {
}).collect(Collectors.toList());
}
private void buildLegendData(JSONObject jsonObject) {
JSONArray jsonArray = new JSONArray();
BLL_LX_LEGEND.forEach((k, v) -> {
JSONObject item = new JSONObject();
item.put("dataKey", k);
item.put("value", v);
jsonArray.add(item);
});
jsonObject.put("legendData", jsonArray);
}
private Map<String, Object> getCenterMapOverviewData(String orgCode, DPFilterParamDto filterParamDto) {
Map<String, Object> result = new HashMap<>();
// 统计完成的事件包括困人、故障、投诉咨询
......
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