初始版本提交
This commit is contained in:
@@ -7,10 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
|
||||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.utils.HttpResultUtil;
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
@@ -90,6 +87,15 @@ public class LargeScreenCountController extends BaseController {
|
|||||||
List<EventDetailVO> result = largeScreenCountService.noDealEventList(largeScreenCountParam);
|
List<EventDetailVO> result = largeScreenCountService.noDealEventList(largeScreenCountParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/mapCount")
|
||||||
|
@ApiOperation("地图统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<MapCountVO>> mapCount(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("mapCount");
|
||||||
|
List<MapCountVO> result = largeScreenCountService.mapCount(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(operateType= OperateType.UPDATE)
|
@OperateInfo(operateType= OperateType.UPDATE)
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/26 上午 8:50【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MapCountVO {
|
||||||
|
private String deptsIndex;
|
||||||
|
private String deptsName;
|
||||||
|
private Integer lineCount;
|
||||||
|
private Integer eventCount;
|
||||||
|
private Integer noticeCount;
|
||||||
|
}
|
||||||
@@ -3,10 +3,7 @@ package com.njcn.gather.event.transientes.service;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -30,4 +27,6 @@ public interface LargeScreenCountService {
|
|||||||
|
|
||||||
|
|
||||||
boolean lookEvent(List<String> ids);
|
boolean lookEvent(List<String> ids);
|
||||||
|
|
||||||
|
List<MapCountVO> mapCount(LargeScreenCountParam largeScreenCountParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
|||||||
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
|
||||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
|
||||||
import com.njcn.gather.event.devcie.service.*;
|
import com.njcn.gather.event.devcie.service.*;
|
||||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||||
import com.njcn.gather.event.transientes.service.PqsDeptsService;
|
import com.njcn.gather.event.transientes.service.PqsDeptsService;
|
||||||
@@ -309,5 +307,44 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MapCountVO> mapCount(LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
List<MapCountVO> result = new ArrayList<>();
|
||||||
|
//起始时间
|
||||||
|
LocalDateTime startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER),DatePattern.NORM_DATETIME_FORMATTER);
|
||||||
|
//结束时间
|
||||||
|
LocalDateTime endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER),DatePattern.NORM_DATETIME_FORMATTER);
|
||||||
|
//根据用户获取当前部门及子部门id
|
||||||
|
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren( largeScreenCountParam.getDeptId());
|
||||||
|
//获取对应监测点id
|
||||||
|
List<PqsDeptsline> deptslines = pqsDeptslineService.lambdaQuery().in(PqsDeptsline::getDeptsIndex, deptAndChildren).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||||
|
if(CollectionUtils.isEmpty(deptslines)){
|
||||||
|
throw new BusinessException("部门下暂无监测点");
|
||||||
|
|
||||||
|
}
|
||||||
|
List<PqsDepts> list = pqsDeptsService.lambdaQuery().list();
|
||||||
|
Map<String, PqsDepts> stringPqsDeptsMap = list.stream().collect(Collectors.toMap(PqsDepts::getDeptsIndex, Function.identity(), (key1, key2) -> key2));
|
||||||
|
Map<String, List<PqsDeptsline>> collect = deptslines.stream().collect(Collectors.groupingBy(PqsDeptsline::getDeptsIndex));
|
||||||
|
collect.forEach((k,v)->{
|
||||||
|
MapCountVO mapCountVO = new MapCountVO() ;
|
||||||
|
mapCountVO.setDeptsIndex(k);
|
||||||
|
mapCountVO.setDeptsName(stringPqsDeptsMap.get(k).getDeptsname());
|
||||||
|
mapCountVO.setLineCount(v.size());
|
||||||
|
|
||||||
|
List<Integer> deptslineIds = v.stream().map(PqsDeptsline::getLineIndex).collect(Collectors.toList());
|
||||||
|
List<PqsEventdetail> eventdetails = pqsEventdetailService.lambdaQuery()
|
||||||
|
.between(PqsEventdetail::getTimeid, startTime,endTime)
|
||||||
|
.in(PqsEventdetail::getLineid,deptslineIds).list();
|
||||||
|
mapCountVO.setEventCount(eventdetails.size());
|
||||||
|
List<PqsEventdetail> noticeEvent = eventdetails.stream().filter(temp ->Objects.equals(temp.getNoticeFlag(),1)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
mapCountVO.setNoticeCount(noticeEvent.size());
|
||||||
|
|
||||||
|
result.add(mapCountVO);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user