|
|
@@ -18,10 +18,18 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.time.DayOfWeek;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
import java.util.HashMap;
|
|
|
+import java.time.temporal.TemporalAdjusters;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -138,4 +146,53 @@ public class WarningNoticeLogController extends AbstractController {
|
|
|
warningNoticeLogService.labCoatTask();
|
|
|
return ResultData.success();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/warningCollect")
|
|
|
+ @ApiOperation("数据大屏,预警通知统计")
|
|
|
+ public ResultData warningCollect() {
|
|
|
+ List<WarningNoticeLogVO> backList = new ArrayList<>();
|
|
|
+ //集合查询
|
|
|
+ List<WarningNoticeLogVO> list = warningNoticeLogService.selectWarningNoticelist();
|
|
|
+
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ //根据部门分组
|
|
|
+ Map<String,List<WarningNoticeLogVO>> gourpList = list.stream().collect(Collectors.groupingBy(WarningNoticeLogVO::getDeptName));
|
|
|
+ //数据收集
|
|
|
+ for (Map.Entry<String, List<WarningNoticeLogVO>> entry : gourpList.entrySet()) {
|
|
|
+ WarningNoticeLogVO noticeLogVO = new WarningNoticeLogVO();
|
|
|
+ String deptName = entry.getKey();
|
|
|
+ int cl = 0;
|
|
|
+ int wcl = 0;
|
|
|
+ for (WarningNoticeLogVO vo2 : list) {
|
|
|
+ if (deptName.equals(vo2.getDeptName())) {
|
|
|
+ if (vo2.getDispose().equals(0)) {
|
|
|
+ wcl = wcl + vo2.getTotalNum();
|
|
|
+ } else {
|
|
|
+ cl = cl + vo2.getTotalNum();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ noticeLogVO.setDeptName(deptName);
|
|
|
+ noticeLogVO.setTotalNum(cl + wcl);
|
|
|
+ noticeLogVO.setDisposeNum(cl);
|
|
|
+ backList.add(noticeLogVO);
|
|
|
+ }
|
|
|
+ //排序
|
|
|
+ //backList.stream().sorted(Comparator.comparing(WarningNoticeLogVO::getTotalNum).reversed()).collect(Collectors.toList());
|
|
|
+ backList.sort(Comparator.comparing(WarningNoticeLogVO::getTotalNum).reversed());
|
|
|
+ }
|
|
|
+ return ResultData.success(backList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/airCollect")
|
|
|
+ @ApiOperation("数据大屏,定位预警统计")
|
|
|
+ public ResultData airCollect() {
|
|
|
+ LambdaQueryWrapper<WarningNoticeLog> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(WarningNoticeLog::getWarningType,3);
|
|
|
+ //queryWrapper.gt(WarningNoticeLog::getCreateTime,LocalDateTime.now().minusMonths(1)).lt(WarningNoticeLog::getCreateTime,LocalDateTime.now()).orderByDesc(WarningNoticeLog::getCreateTime);
|
|
|
+ queryWrapper.between(WarningNoticeLog::getCreateTime,LocalDateTime.now().minusMonths(1),LocalDateTime.now()).orderByDesc(WarningNoticeLog::getCreateTime);
|
|
|
+ return ResultData.success(warningNoticeLogService.list(queryWrapper));
|
|
|
+ }
|
|
|
+
|
|
|
}
|