9 changed files with 286 additions and 22 deletions
@ -0,0 +1,72 @@ |
|||||||
|
package com.mh.web.controller.device; |
||||||
|
|
||||||
|
import com.mh.common.core.controller.BaseController; |
||||||
|
import com.mh.common.core.domain.AjaxResult; |
||||||
|
import com.mh.common.core.domain.entity.CollectionParamsManage; |
||||||
|
import com.mh.common.core.domain.entity.CommunicationParams; |
||||||
|
import com.mh.common.core.domain.vo.EnergyConsumptionVO; |
||||||
|
import com.mh.common.core.domain.vo.EnergyQueryVO; |
||||||
|
import com.mh.common.core.page.TableDataInfo; |
||||||
|
import com.mh.common.utils.DateUtils; |
||||||
|
import com.mh.system.service.device.ICollectionParamsManageService; |
||||||
|
import com.mh.system.service.device.ICommunicationParamsService; |
||||||
|
import com.mh.system.service.energy.IEnergyService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project EEMCS |
||||||
|
* @description 主机参数以及各个设备折线图数据 |
||||||
|
* @date 2025-04-29 09:21:17 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/chillers") |
||||||
|
public class ChillersParamsController extends BaseController { |
||||||
|
|
||||||
|
private final ICollectionParamsManageService iCollectionParamsManageService; |
||||||
|
|
||||||
|
private final IEnergyService energyService; |
||||||
|
|
||||||
|
public ChillersParamsController(ICollectionParamsManageService iCollectionParamsManageService, IEnergyService energyService) { |
||||||
|
this.iCollectionParamsManageService = iCollectionParamsManageService; |
||||||
|
this.energyService = energyService; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取注解全部参数内容数据 |
||||||
|
* @param collectionParamsManage |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping("/list") |
||||||
|
public TableDataInfo list(CollectionParamsManage collectionParamsManage) |
||||||
|
{ |
||||||
|
List<CollectionParamsManage> list = iCollectionParamsManageService.selectCollectionParamsManageList(collectionParamsManage); |
||||||
|
// 再根据mtType进行分组
|
||||||
|
Map<String, List<CollectionParamsManage>> collect = list.stream().collect(Collectors.groupingBy(CollectionParamsManage::getMtType)); |
||||||
|
// map转list
|
||||||
|
List<Map<String, Object>> result = collect.entrySet().stream().map(entry -> { |
||||||
|
Map<String, Object> map = new HashMap<>(); |
||||||
|
map.put("mtType", entry.getKey()); |
||||||
|
map.put("list", entry.getValue()); |
||||||
|
return map; |
||||||
|
}).collect(Collectors.toList()); |
||||||
|
return getDataTable(result); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取折线图数据:冷冻水进出水温度和冷却水进出水温度 |
||||||
|
* @param vo |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@PostMapping("/lineList") |
||||||
|
public AjaxResult lineList(@RequestBody EnergyQueryVO vo) { |
||||||
|
return energyService.chillerLine(vo); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue