1.暂降次数微调

2.报表接口调整
This commit is contained in:
2024-11-26 09:15:15 +08:00
parent 92ffdb1931
commit 35f1b21474
5 changed files with 947 additions and 865 deletions

View File

@@ -139,7 +139,7 @@ public class RmpEventDetailController extends BaseController {
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getImMonitorEvents")
@ApiOperation("暂降事件记录")
@ApiOperation("查询重要监测点指定时间发生的暂降次数")
public HttpResult<List<Map<String,Object>>> getImMonitorEvents(@RequestBody EventBaseParam param) {
String methodDescribe = getMethodDescribe("getImMonitorEvents");
List<Map<String,Object>> result = rmpEventDetailService.getImMonitorEvents(param);

View File

@@ -399,6 +399,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
@Override
public List<Map<String, Object>> getImMonitorEvents(EventBaseParam param) {
List<Map<String,Object>> mapList = new ArrayList<>();
DictData eventDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.VOLTAGE_DIP.getCode(),DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.MOST_IMPORMENT.getCode(),DicDataTypeEnum.DEV_GRADE.getCode()).getData();
@@ -408,6 +409,9 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
queryWrapper.eq("measurement_point_id",param.getSearchValue());
}else {
List<String> lineIds = lineFeignClient.getLevelMonitorIdByDept(dictData.getId(),param.getDeptId()).getData();
if(CollUtil.isEmpty(lineIds)){
return mapList;
}
queryWrapper.in("measurement_point_id",lineIds);
}
@@ -415,13 +419,17 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
queryWrapper.select("measurement_point_id as lineId","count(event_id) as eventCount").between("start_time",param.getSearchBeginTime(),param.getSearchEndTime())
.eq("event_type",eventDic.getId())
.groupBy("measurement_point_id");
List<Map<String,Object>> mapList = this.baseMapper.selectMaps(queryWrapper);
mapList = this.baseMapper.selectMaps(queryWrapper);
if(CollUtil.isEmpty(mapList)){
return mapList;
}
List<String> ids = mapList.stream().map(it->it.get("lineId").toString()).distinct().collect(Collectors.toList());
List<Line> lineList = lineFeignClient.getBaseLineList(ids).getData();
Map<String,Line> lineMap = lineList.stream().collect(Collectors.toMap(Line::getId,Function.identity()));
List<AreaLineInfoVO> lineList = lineFeignClient.getBaseLineAreaInfo(ids).getData();
Map<String,AreaLineInfoVO> lineMap = lineList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId,Function.identity()));
mapList.forEach(item->{
item.put("lineName",lineMap.get(item.get("lineId")).getName());
AreaLineInfoVO tem = lineMap.get(item.get("lineId").toString());
item.put("lineName",tem.getVoltageName()+"_"+tem.getLineName());
});
return mapList;