diff --git a/mh-admin/src/main/java/com/mh/web/controller/monitor/HeatingPumpMonitorController.java b/mh-admin/src/main/java/com/mh/web/controller/monitor/HeatingPumpMonitorController.java new file mode 100644 index 0000000..bb85d28 --- /dev/null +++ b/mh-admin/src/main/java/com/mh/web/controller/monitor/HeatingPumpMonitorController.java @@ -0,0 +1,70 @@ +package com.mh.web.controller.monitor; + +import com.mh.common.core.controller.BaseController; +import com.mh.common.core.domain.dto.DeviceMonitorDTO; +import com.mh.common.core.domain.entity.CollectionParamsManage; +import com.mh.common.core.page.TableDataInfo; +import com.mh.system.service.device.ICollectionParamsManageService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author LJF + * @version 1.0 + * @project EEMCS + * @description 三台采暖泵的监测 + * @date 2025-09-12 09:36:33 + */ +@RestController +@RequestMapping("/device") +public class HeatingPumpMonitorController extends BaseController { + + private final ICollectionParamsManageService collectionParamsManageService; + + public HeatingPumpMonitorController(ICollectionParamsManageService collectionParamsManageService) { + this.collectionParamsManageService = collectionParamsManageService; + } + + /** + * 获取 alarmList 列表 + * @param systemType 3 + * @param type 0:代表查询报警 + * @return + */ + @RequestMapping("/heatPump/alarmList") + public TableDataInfo list(@RequestParam(name = "systemType") String systemType, + @RequestParam(name = "type", required = false, defaultValue = "0") String type) { + List list = collectionParamsManageService.selectHeatPumpAlarmListByParams(systemType, type, "14", "5"); + return getDataTable(list); + } + + /** + * 获取 运行热泵统计 列表 + * @param systemType 3 + * @param type 0:代表查询报警 + * @return + */ + @RequestMapping("/heatPump/online") + public TableDataInfo online(@RequestParam(name = "systemType") String systemType, + @RequestParam(name = "type", required = false, defaultValue = "0") String type) { + List list = collectionParamsManageService.selectHeatPumpOnlineByParams(systemType, type); + return getDataTable(list); + } + + /** + * 获取 采暖泵 列表 + * @param systemType 3 + * @param type 0:代表查询动画界面数据 + * @return + */ + @RequestMapping("/heatPump/list") + public TableDataInfo heatPumpList(@RequestParam(name = "systemType") String systemType, + @RequestParam(name = "type", required = false, defaultValue = "0") String type) { + List list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "14"); + return getDataTable(list); + } + +} diff --git a/mh-admin/src/main/java/com/mh/web/controller/monitor/SteamBoilerMonitorController.java b/mh-admin/src/main/java/com/mh/web/controller/monitor/SteamBoilerMonitorController.java index 921d32a..d783ca2 100644 --- a/mh-admin/src/main/java/com/mh/web/controller/monitor/SteamBoilerMonitorController.java +++ b/mh-admin/src/main/java/com/mh/web/controller/monitor/SteamBoilerMonitorController.java @@ -50,7 +50,7 @@ public class SteamBoilerMonitorController extends BaseController { @RequestMapping("/hotWaterBoiler/list") public TableDataInfo hotWaterBoilerList(@RequestParam(name = "systemType") String systemType, @RequestParam(name = "type", required = false, defaultValue = "0") String type) { - List list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type); + List list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "13"); return getDataTable(list); } diff --git a/mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java b/mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java index 0c07af9..e197566 100644 --- a/mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java +++ b/mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java @@ -84,7 +84,11 @@ public interface ICollectionParamsManageService { List selectSteamBoilerListByParams(String systemType, String type); - List selectHotWaterBoilerListByParams(String systemType, String type); + List selectHotWaterBoilerListByParams(String systemType, String type, String mtType); List selectCollectionParamsManageListByIds(String[] cpmIds); + + List selectHeatPumpAlarmListByParams(String systemType, String type, String mtType, String sysParamType); + + List selectHeatPumpOnlineByParams(String systemType, String type); } diff --git a/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java b/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java index d971415..f4c2075 100644 --- a/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java +++ b/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java @@ -97,6 +97,36 @@ public class CollectionParamsManageServiceImpl implements ICollectionParamsManag "DB611596"// 锅炉1-用户温度设定值 ); + @Override + public List selectHeatPumpOnlineByParams(String systemType, String type) { + if (StringUtils.isEmpty(systemType)) { + return List.of(); + } + // 获取运行情况 + List collectionParamsManages = collectionParamsManageMapper.selectList(new QueryWrapper() + .eq("system_type", systemType).eq("mt_type", "14").eq("param_type", "1")); + // quality为0的参数,就是正常采集 + List runningParams = collectionParamsManages.stream().filter(collectionParamsManage -> collectionParamsManage.getQuality().equals("0")).toList(); + Map map = new HashMap<>(); + map.put("online", runningParams.size()); + map.put("total", collectionParamsManages.size()); + map.put("offLine", collectionParamsManages.size() - runningParams.size()); + return List.of(map); + } + + @Override + public List selectHeatPumpAlarmListByParams(String systemType, String type, String mtType, String sysParamType) { + if (StringUtils.isEmpty(systemType)) { + return List.of(); + } + return collectionParamsManageMapper.selectList(new QueryWrapper() + .eq("system_type", systemType) + .eq("mt_type", mtType) + .eq("param_type", sysParamType) + .eq("cur_value", 1) + .orderByDesc("cur_time")); + } + @Override public List selectCollectionParamsManageListByIds(String[] cpmIds) { if (cpmIds.length == 0) return List.of(); @@ -111,14 +141,14 @@ public class CollectionParamsManageServiceImpl implements ICollectionParamsManag } @Override - public List selectHotWaterBoilerListByParams(String systemType, String type) { + public List selectHotWaterBoilerListByParams(String systemType, String type, String mtType) { if (StringUtils.isEmpty(systemType)) { return List.of(); } HashMap map = new HashMap<>(); map.put("systemType", systemType); // 13热水锅炉 - map.put("mtType", "13"); + map.put("mtType", mtType); List collectionParamsManages = selectListByParams(map); // 根据deviceLedgerId查询设备名称进行分组 Map> groupedByDeviceLedgerId = collectionParamsManages.stream()