Commit a7b1033a authored by zhangsen's avatar zhangsen

分析 - 右下角折线图

parent 10adf34f
...@@ -500,39 +500,39 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -500,39 +500,39 @@ public class BigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) // @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表") // @ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表")
@GetMapping("/getSubSystemPointInfo") // @GetMapping("/getSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(@RequestParam(value = "subSystem", required = false) String subSystem, // public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(@RequestParam(value = "subSystem", required = false) String subSystem,
@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()); // List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getWarningInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> t.get("warningName").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 -> {
String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全"); // String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
int sort = 4; // int sort = 4;
item.put("warningName", warningName); // item.put("warningName", warningName);
item.put("status", warningName); // item.put("status", warningName);
if ("注意".equals(warningName)) { // if ("注意".equals(warningName)) {
sort = 3; // sort = 3;
} else if ("警告".equals(warningName)) { // } else if ("警告".equals(warningName)) {
sort = 2; // sort = 2;
} else if ("危险".equals(warningName)) { // } else if ("危险".equals(warningName)) {
sort = 1; // sort = 1;
} // }
item.put("sort", sort); // item.put("sort", sort);
}); // });
pointNameList.sort(Comparator.comparing(o -> o.get("sort").toString())); // pointNameList.sort(Comparator.comparing(o -> o.get("sort").toString()));
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);
} // }
......
...@@ -591,16 +591,18 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -591,16 +591,18 @@ public class TDBigScreenAnalyseController extends BaseController {
@GetMapping("/getSubSystemPointInfo") @GetMapping("/getSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo( public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(
@RequestParam(value = "subSystem", required = false) String subSystem, @RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException { @RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "equipmentName", required = false) String equipmentName) 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);
equipmentName = StrUtil.isNotEmpty(equipmentName) ? "%" + equipmentName + "风机%" : equipmentName;
// 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 = fanHealthIndexMapper.getWarningInfoBySubSystemTd(subSystem, List<Map<String, Object>> healthListInfo = fanHealthIndexMapper.getWarningInfoBySubSystemTd(subSystem,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(), equipmentName);
Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream() Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("pointname"), t -> t.get("warningname").toString())); .collect(Collectors.toMap(t -> t.get("pointname"), t -> t.get("warningname").toString()));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem); .getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName);
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全"); String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
int sort = 4; int sort = 4;
......
...@@ -68,7 +68,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -68,7 +68,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
@Param("equipmentName") String equipmentName); @Param("equipmentName") String equipmentName);
List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId, List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId,
@Param("subSystem") String subSystem); @Param("subSystem") String subSystem,
@Param("equipmentName") String equipmentName);
List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem, List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId);
......
...@@ -93,7 +93,9 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> { ...@@ -93,7 +93,9 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
List<Map<String, Object>> getPvWarningInfoBySubSystemTd(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId); List<Map<String, Object>> getPvWarningInfoBySubSystemTd(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getWarningInfoBySubSystemTd(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId); List<Map<String, Object>> getWarningInfoBySubSystemTd(@Param("subSystem") String subSystem,
@Param("gatewayId") String gatewayId,
@Param("equipmentName") String equipmentName);
List<Map<String,Object>> getInfoByDate(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("list") List<String> list); List<Map<String,Object>> getInfoByDate(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode, @Param("list") List<String> list);
......
...@@ -518,6 +518,9 @@ ...@@ -518,6 +518,9 @@
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND GATEWAY_ID = #{gatewayId}
</if> </if>
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like #{equipmentName}
</if>
</where> </where>
GROUP BY GROUP BY
POINT_NAME POINT_NAME
......
...@@ -281,6 +281,9 @@ ...@@ -281,6 +281,9 @@
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND gateway_id = #{gatewayId} AND gateway_id = #{gatewayId}
</if> </if>
<if test="equipmentName != null and equipmentName != ''">
AND equipment_name like #{equipmentName}
</if>
</where> </where>
group by point_name group by point_name
</select> </select>
......
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