Commit a51498bd authored by tangwei's avatar tangwei

解决冲突

parents eae12f78 a72da86b
...@@ -501,33 +501,19 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -501,33 +501,19 @@ public class BigScreenAnalyseController extends BaseController {
@RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException { @RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException {
subSystem = java.net.URLDecoder.decode(subSystem,"UTF-8"); subSystem = java.net.URLDecoder.decode(subSystem,"UTF-8");
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId()); // List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getWarningInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> t.get("warningName").toString()));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem); List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem);
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
if (100.0 == equipmentHealthScore) { item.put("warningName", warningName);
item.put("warningName", "安全");
} else {
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备");
query.eq(IdxBizFanHealthLevel::getStatus, item.get("station"));
query.lt(IdxBizFanHealthLevel::getGroupLowerLimit, equipmentHealthScore);
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit, equipmentHealthScore);
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
item.put("warningName", idxBizFanHealthLevel.getHealthLevel());
}
item.put("healthIndex", equipmentHealthScore);
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
mapPage.setSize(pointNameList.size()); mapPage.setSize(pointNameList.size());
mapPage.setTotal(pointNameList.size()); mapPage.setTotal(pointNameList.size());
mapPage.setCurrent(1); mapPage.setCurrent(1);
mapPage.setRecords(pointNameList); mapPage.setRecords(pointNameList);
return ResponseHelper.buildResponse(mapPage); return ResponseHelper.buildResponse(mapPage);
} }
...@@ -606,33 +592,19 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -606,33 +592,19 @@ public class BigScreenAnalyseController extends BaseController {
@RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException { @RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException {
equipmentName = java.net.URLDecoder.decode(equipmentName,"UTF-8"); equipmentName = java.net.URLDecoder.decode(equipmentName,"UTF-8");
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId()); // List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvWarningInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> t.get("warningName").toString()));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName);
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); String equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
if (100.0 == equipmentHealthScore) { item.put("warningName", equipmentHealthScore);
item.put("warningName", "安全");
} else {
LambdaQueryWrapper<IdxBizPvHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizPvHealthLevel::getAnalysisObjType, "设备");
query.eq(IdxBizPvHealthLevel::getStatus, item.get("station").toString());
query.lt(IdxBizPvHealthLevel::getGroupLowerLimit, equipmentHealthScore);
query.ge(IdxBizPvHealthLevel::getGroupUpperLimit, equipmentHealthScore);
IdxBizPvHealthLevel idxBizPvHealthLevel = idxBizPvHealthLevelMapper.selectOne(query);
item.put("warningName", idxBizPvHealthLevel.getHealthLevel());
}
item.put("healthIndex", equipmentHealthScore);
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
mapPage.setSize(pointNameList.size()); mapPage.setSize(pointNameList.size());
mapPage.setTotal(pointNameList.size()); mapPage.setTotal(pointNameList.size());
mapPage.setCurrent(1); mapPage.setCurrent(1);
mapPage.setRecords(pointNameList); mapPage.setRecords(pointNameList);
return ResponseHelper.buildResponse(mapPage); return ResponseHelper.buildResponse(mapPage);
} }
......
...@@ -134,6 +134,25 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -134,6 +134,25 @@ public class IdxBizFanHealthIndexController extends BaseController {
return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListNum(STATION, HEALTHLEVEL, EQUIPMENTNAME)); return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListNum(STATION, HEALTHLEVEL, EQUIPMENTNAME));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftByPointList")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableByPointList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,,@RequestParam(required = false)String POINTNAME,Integer current,Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>();
page.setCurrent(current);
page.setSize(size);
int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointCount(STATION, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME);
page.setTotal(Long.valueOf(total));
page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,(current-1)*size,size));
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层仪表盘", notes = "预警监测风机层仪表盘")
@GetMapping(value = "/queryForLeftTableListByPointNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByPointNum(@RequestParam(required = false)String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false)String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME) {
return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "测点运行趋势图", notes = "测点运行趋势图") @ApiOperation(httpMethod = "GET",value = "测点运行趋势图", notes = "测点运行趋势图")
......
...@@ -56,6 +56,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -56,6 +56,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId); List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getWarningInfoBySubSystem(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId);
...@@ -75,6 +76,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -75,6 +76,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getPvHealthInfoBySubSystem(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId); List<Map<String, Object>> getPvHealthInfoBySubSystem(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvWarningInfoBySubSystem(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvPointNameListBySumSystem(@Param("gatewayId") String gatewayId, @Param("equipmentName") String equipmentName); List<Map<String, Object>> getPvPointNameListBySumSystem(@Param("gatewayId") String gatewayId, @Param("equipmentName") String equipmentName);
...@@ -104,4 +106,11 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -104,4 +106,11 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
int queryForLeftTableListCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME); int queryForLeftTableListCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME);
Map<String,Object> queryForLeftTableListNum(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME); Map<String,Object> queryForLeftTableListNum(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME);
List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size);
int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME);
Map<String,Object> queryForLeftTableListByPointNum(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME);
} }
...@@ -132,5 +132,18 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -132,5 +132,18 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
public List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME, String POINTNAME,Integer current, Integer size){
return this.getBaseMapper().queryForLeftTableListByPoint(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,current,size);
}
public int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){
return this.getBaseMapper().queryForLeftTableListByPointCount(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME);
}
public Map<String,Object> queryForLeftTableListByPointNum(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){
return this.getBaseMapper().queryForLeftTableListByPointNum(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME);
}
} }
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
b.HEALTH_INDEX as value, b.HEALTH_INDEX as value,
b.HEALTH_LEVEL, b.HEALTH_LEVEL,
CONCAT( '子阵 ', b.SUBARRAY ) AS 子阵, CONCAT( '子阵 ', b.SUBARRAY ) AS 子阵,
( CASE b.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status, ( CASE b.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
b.REC_DATE, b.REC_DATE,
b.SUBARRAY b.SUBARRAY
FROM FROM
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
HEALTH_INDEX, HEALTH_INDEX,
HEALTH_INDEX as value, HEALTH_INDEX as value,
HEALTH_LEVEL, HEALTH_LEVEL,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
SUBARRAY, SUBARRAY,
REC_DATE, REC_DATE,
EQUIPMENT_NAME, EQUIPMENT_NAME,
......
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