Sfoglia il codice sorgente

漏检统计大屏-模块三

chenshudong 1 giorno fa
parent
commit
d70621febc

+ 46 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/blocked/BlockedMissCheckStatisticsScreenController.java

@@ -0,0 +1,46 @@
1
+package com.sundot.airport.web.controller.blocked;
2
+
3
+import com.sundot.airport.blocked.service.IBlockedMissCheckStatisticsScreenService;
4
+import com.sundot.airport.common.core.controller.BaseController;
5
+import com.sundot.airport.common.core.domain.AjaxResult;
6
+import com.sundot.airport.common.core.domain.BlockedMissCheckStatisticsQueryParamDto;
7
+import com.sundot.airport.common.dto.BaseCommonDto;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.web.bind.annotation.GetMapping;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RestController;
12
+
13
+import java.util.List;
14
+
15
+/**
16
+ * 漏检统计大屏Controller
17
+ *
18
+ * @author wangxx
19
+ * @date 2026-04-13
20
+ */
21
+@RestController
22
+@RequestMapping("/blocked/missReview/screen")
23
+public class BlockedMissCheckStatisticsScreenController extends BaseController {
24
+
25
+    @Autowired
26
+    private IBlockedMissCheckStatisticsScreenService blockedMissCheckStatisticsScreenService;
27
+
28
+    /**
29
+     * 月考成绩统计
30
+     */
31
+    @GetMapping("/monthlyAssessment")
32
+    public AjaxResult monthlyAssessment(BlockedMissCheckStatisticsQueryParamDto dto) {
33
+        List<BaseCommonDto> list = blockedMissCheckStatisticsScreenService.monthlyAssessment(dto);
34
+        return success(list);
35
+    }
36
+
37
+    /**
38
+     * 本月自测有无漏检统计
39
+     */
40
+    @GetMapping("/selfTestHasMissCheck")
41
+    public AjaxResult selfTestHasMissCheck(BlockedMissCheckStatisticsQueryParamDto dto) {
42
+        List<BaseCommonDto> list = blockedMissCheckStatisticsScreenService.selfTestHasMissCheck(dto);
43
+        return success(list);
44
+    }
45
+
46
+}

+ 32 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/IBlockedMissCheckStatisticsScreenService.java

@@ -0,0 +1,32 @@
1
+package com.sundot.airport.blocked.service;
2
+
3
+import com.sundot.airport.common.core.domain.BlockedMissCheckStatisticsQueryParamDto;
4
+import com.sundot.airport.common.dto.BaseCommonDto;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 漏检统计大屏Service接口
10
+ *
11
+ * @author wangxx
12
+ * @date 2026-04-13
13
+ */
14
+public interface IBlockedMissCheckStatisticsScreenService {
15
+
16
+    /**
17
+     * 月考成绩统计
18
+     *
19
+     * @param dto 漏检统计查询参数
20
+     * @return 月考成绩统计
21
+     */
22
+    public List<BaseCommonDto> monthlyAssessment(BlockedMissCheckStatisticsQueryParamDto dto);
23
+
24
+    /**
25
+     * 本月自测有无漏检统计
26
+     *
27
+     * @param dto 漏检统计查询参数
28
+     * @return 本月自测有无漏检统计
29
+     */
30
+    public List<BaseCommonDto> selfTestHasMissCheck(BlockedMissCheckStatisticsQueryParamDto dto);
31
+
32
+}

+ 89 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/impl/BlockedMissCheckStatisticsScreenServiceImpl.java

@@ -0,0 +1,89 @@
1
+package com.sundot.airport.blocked.service.impl;
2
+
3
+import com.sundot.airport.blocked.domain.BlockedMissCheckStatistics;
4
+import com.sundot.airport.blocked.mapper.BlockedMissCheckStatisticsMapper;
5
+import com.sundot.airport.blocked.service.IBlockedMissCheckStatisticsScreenService;
6
+import com.sundot.airport.common.core.domain.BlockedMissCheckStatisticsQueryParamDto;
7
+import com.sundot.airport.common.core.domain.entity.SysDictData;
8
+import com.sundot.airport.common.dto.BaseCommonDto;
9
+import com.sundot.airport.system.service.ISysDictDataService;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
12
+
13
+import java.math.BigDecimal;
14
+import java.util.ArrayList;
15
+import java.util.List;
16
+import java.util.Map;
17
+import java.util.stream.Collectors;
18
+
19
+/**
20
+ * 漏检统计大屏Service业务层处理
21
+ *
22
+ * @author wangxx
23
+ * @date 2026-04-13
24
+ */
25
+@Service
26
+public class BlockedMissCheckStatisticsScreenServiceImpl implements IBlockedMissCheckStatisticsScreenService {
27
+
28
+    @Autowired
29
+    private BlockedMissCheckStatisticsMapper blockedMissCheckStatisticsMapper;
30
+    @Autowired
31
+    private ISysDictDataService sysDictDataService;
32
+
33
+    /**
34
+     * 月考成绩统计
35
+     *
36
+     * @param dto 漏检统计查询参数
37
+     * @return 月考成绩统计
38
+     */
39
+    @Override
40
+    public List<BaseCommonDto> monthlyAssessment(BlockedMissCheckStatisticsQueryParamDto dto) {
41
+        List<BaseCommonDto> result = new ArrayList<>();
42
+        SysDictData dictData = new SysDictData();
43
+        dictData.setDictType("blocked_monthly_exam_result");
44
+        List<SysDictData> sysDictDataList = sysDictDataService.selectDictDataList(dictData);
45
+        BlockedMissCheckStatistics query = new BlockedMissCheckStatistics();
46
+        query.setReviewDate(dto.getSpecifiedDate());
47
+        query.setBrigadeId(dto.getBrigadeId());
48
+        query.setBrigadeName(dto.getBrigadeName());
49
+        List<BlockedMissCheckStatistics> blockedMissCheckStatisticsList = blockedMissCheckStatisticsMapper.selectBlockedMissCheckStatisticsList(query);
50
+        Map<String, Long> monthlyAssessmentMap = blockedMissCheckStatisticsList.stream()
51
+                .filter(blockedMissCheckStatistics -> blockedMissCheckStatistics.getMonthlyAssessment() != null)
52
+                .collect(Collectors.groupingBy(BlockedMissCheckStatistics::getMonthlyAssessment, Collectors.counting()));
53
+        sysDictDataList.forEach(sysDictData -> {
54
+            BaseCommonDto item = new BaseCommonDto();
55
+            item.setCode(sysDictData.getDictValue());
56
+            item.setName(sysDictData.getDictLabel());
57
+            item.setTotal(BigDecimal.valueOf(monthlyAssessmentMap.getOrDefault(sysDictData.getDictValue(), 0L)));
58
+            result.add(item);
59
+        });
60
+        return result;
61
+    }
62
+
63
+    /**
64
+     * 本月自测有无漏检统计
65
+     *
66
+     * @param dto 漏检统计查询参数
67
+     * @return 本月自测有无漏检统计
68
+     */
69
+    @Override
70
+    public List<BaseCommonDto> selfTestHasMissCheck(BlockedMissCheckStatisticsQueryParamDto dto) {
71
+        List<BaseCommonDto> result = new ArrayList<>();
72
+        BlockedMissCheckStatistics query = new BlockedMissCheckStatistics();
73
+        query.setReviewDate(dto.getSpecifiedDate());
74
+        query.setBrigadeId(dto.getBrigadeId());
75
+        query.setBrigadeName(dto.getBrigadeName());
76
+        List<BlockedMissCheckStatistics> blockedMissCheckStatisticsList = blockedMissCheckStatisticsMapper.selectBlockedMissCheckStatisticsList(query);
77
+        Map<Integer, Long> selfTestHasMissCheckMap = blockedMissCheckStatisticsList.stream()
78
+                .filter(blockedMissCheckStatistics -> blockedMissCheckStatistics.getSelfTestHasMissCheck() != null)
79
+                .collect(Collectors.groupingBy(BlockedMissCheckStatistics::getSelfTestHasMissCheck, Collectors.counting()));
80
+        selfTestHasMissCheckMap.forEach((key, value) -> {
81
+            BaseCommonDto item = new BaseCommonDto();
82
+            item.setName(String.valueOf(key));
83
+            item.setTotal(BigDecimal.valueOf(value));
84
+            result.add(item);
85
+        });
86
+        return result;
87
+    }
88
+
89
+}

+ 23 - 0
airport-common/src/main/java/com/sundot/airport/common/core/domain/BlockedMissCheckStatisticsQueryParamDto.java

@@ -0,0 +1,23 @@
1
+package com.sundot.airport.common.core.domain;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 漏检统计查询参数
7
+ *
8
+ * @author ruoyi
9
+ */
10
+@Data
11
+public class BlockedMissCheckStatisticsQueryParamDto extends BaseScreenQueryParamDto {
12
+
13
+    /**
14
+     * 大队ID
15
+     */
16
+    private Long brigadeId;
17
+
18
+    /**
19
+     * 大队名称
20
+     */
21
+    private String brigadeName;
22
+
23
+}