Commit 14bbcbe3 authored by zhangsen's avatar zhangsen

公共方法修改

parent ea7996a1
...@@ -196,7 +196,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -196,7 +196,7 @@ public class BigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception { public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea(); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
Map<String, BigDecimal> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> new BigDecimal(t.get("healthIndex").toString()))); Map<String, Integer> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> Integer.valueOf(t.get("healthIndex").toString())));
// List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区"); // List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
...@@ -214,7 +214,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -214,7 +214,7 @@ public class BigScreenAnalyseController extends BaseController {
} }
list = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList()); list = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100")))); list.forEach(item -> seriesData.add(collect.getOrDefault(item, 100)));
resultMap.put("axisData", list); resultMap.put("axisData", list);
resultMap.put("seriesData", seriesData); resultMap.put("seriesData", seriesData);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
...@@ -478,14 +478,14 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -478,14 +478,14 @@ public class BigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, stationBasic.getFanGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, Integer> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Integer.valueOf(t.get("healthIndex").toString())));
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName);
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100.0); Integer equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100);
seriesData.add(equipmentHealthScore); seriesData.add(equipmentHealthScore);
axisData.add(item.get("subSystem")); axisData.add(item.get("subSystem"));
}); });
......
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
<select id="getSubSystemInfo" resultType="java.util.Map"> <select id="getSubSystemInfo" resultType="java.util.Map">
SELECT SELECT
IFNULL( HEALTH_INDEX, 100 ) AS healthIndex, CEILING(IFNULL( HEALTH_INDEX, 100 )) AS healthIndex,
SUB_SYSTEM AS subSystem SUB_SYSTEM AS subSystem
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
......
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