Commit 2d51e056 authored by zhangsen's avatar zhangsen

bug修改

parent f0f9173f
......@@ -79,17 +79,17 @@ public class BigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo")
public ResponseModel<Map<String, BigDecimal>> getHealthScoreInfo(@RequestParam(required = false) String areaCode,
@RequestParam(required = false) String stationCode,
@RequestParam (required = false) String tableName) {
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
public ResponseModel<Map<String, Integer>> getHealthScoreInfo(@RequestParam(required = false) String areaCode,
@RequestParam(required = false) String stationCode,
@RequestParam (required = false) String tableName) {
HashMap<String, Integer> stringBigDecimalHashMap = new HashMap<>();
if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfoByStation(stationCode, tableName));
stringBigDecimalHashMap.put("value", Integer.valueOf(idxBizFanHealthIndexMapper.getHealthScoreInfoByStation(stationCode, tableName).toString().replace(".0", "")));
return ResponseHelper.buildResponse(stringBigDecimalHashMap);
}
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode));
stringBigDecimalHashMap.put("value", Integer.valueOf(idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode).toString().replace(".0", "")));
return ResponseHelper.buildResponse(stringBigDecimalHashMap);
}
......@@ -110,7 +110,7 @@ public class BigScreenAnalyseController extends BaseController {
List<String> valueList = new ArrayList<>();
healthListInfo.forEach(item -> {
time.add(item.get("date").toString());
valueList.add(item.get("avgHealthIndex").toString());
valueList.add(item.get("avgHealthIndex").toString().replace(".0", ""));
});
List<Map<String, Object>> arrayList = new ArrayList<>();
HashMap<String, Object> stringStringHashMap = new HashMap<>();
......@@ -311,7 +311,7 @@ public class BigScreenAnalyseController extends BaseController {
List<Object> seriesData = new ArrayList<>();
healthListInfo.forEach(item -> {
list.add(item.get("station").toString());
seriesData.add(new BigDecimal(item.get("healthIndex").toString()));
seriesData.add(item.get("healthIndex").toString().replace(".0", ""));
});
resultMap.put("axisData", list);
resultMap.put("seriesData", seriesData);
......@@ -478,7 +478,7 @@ public class BigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, stationBasic.getFanGatewayId());
Map<Object, Integer> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Integer.valueOf(t.get("healthIndex").toString())));
Map<Object, Integer> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", ""))));
List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>();
......@@ -569,14 +569,14 @@ public class BigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray, stationBasic.getFanGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> Double.parseDouble(t.get("avgHealthIndex").toString())));
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex").toString().replace(".0", "")));
List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getPvSumSystemListByEquipment(stationBasic.getFanGatewayId(), subarray);
equipmentList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100.0);
Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100);
seriesData.add(equipmentHealthScore);
axisData.add(item.get("equipmentName"));
});
......
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