Browse Source

1、采暖泵接口编写

dev_mz
25604 2 weeks ago
parent
commit
a4739b576f
  1. 70
      mh-admin/src/main/java/com/mh/web/controller/monitor/HeatingPumpMonitorController.java
  2. 2
      mh-admin/src/main/java/com/mh/web/controller/monitor/SteamBoilerMonitorController.java
  3. 6
      mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java
  4. 34
      mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java

70
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<DeviceMonitorDTO> list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "14");
return getDataTable(list);
}
}

2
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<DeviceMonitorDTO> list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type);
List<DeviceMonitorDTO> list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "13");
return getDataTable(list);
}

6
mh-system/src/main/java/com/mh/system/service/device/ICollectionParamsManageService.java

@ -84,7 +84,11 @@ public interface ICollectionParamsManageService {
List<CollectionParamsManage> selectSteamBoilerListByParams(String systemType, String type);
List<DeviceMonitorDTO> selectHotWaterBoilerListByParams(String systemType, String type);
List<DeviceMonitorDTO> 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);
}

34
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<CollectionParamsManage> collectionParamsManages = collectionParamsManageMapper.selectList(new QueryWrapper<CollectionParamsManage>()
.eq("system_type", systemType).eq("mt_type", "14").eq("param_type", "1"));
// quality为0的参数,就是正常采集
List<CollectionParamsManage> runningParams = collectionParamsManages.stream().filter(collectionParamsManage -> collectionParamsManage.getQuality().equals("0")).toList();
Map<String, Integer> 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<CollectionParamsManage>()
.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<DeviceMonitorDTO> selectHotWaterBoilerListByParams(String systemType, String type) {
public List<DeviceMonitorDTO> selectHotWaterBoilerListByParams(String systemType, String type, String mtType) {
if (StringUtils.isEmpty(systemType)) {
return List.of();
}
HashMap<String, Object> map = new HashMap<>();
map.put("systemType", systemType);
// 13热水锅炉
map.put("mtType", "13");
map.put("mtType", mtType);
List<CollectionParamsManage> collectionParamsManages = selectListByParams(map);
// 根据deviceLedgerId查询设备名称进行分组
Map<String, List<CollectionParamsManage>> groupedByDeviceLedgerId = collectionParamsManages.stream()

Loading…
Cancel
Save