Quellcode durchsuchen

Merge remote-tracking branch 'origin/feature/dev' into feature/dev

wangxx vor 2 Tagen
Ursprung
Commit
043a60f9c8
25 geänderte Dateien mit 1583 neuen und 1 gelöschten Zeilen
  1. 132 0
      airport-admin/src/main/java/com/sundot/airport/web/controller/blocked/BlockedBootPersonnelTenureController.java
  2. 66 0
      airport-admin/src/main/java/com/sundot/airport/web/controller/blocked/BlockedRateScreenController.java
  3. 171 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/domain/BlockedBootPersonnelTenure.java
  4. 41 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenBrigadeDto.java
  5. 36 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenT1Dto.java
  6. 36 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenT2Dto.java
  7. 62 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/mapper/BlockedBootPersonnelTenureMapper.java
  8. 11 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/mapper/BlockedRateScreenMapper.java
  9. 71 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/service/IBlockedBootPersonnelTenureService.java
  10. 50 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/service/IBlockedRateScreenService.java
  11. 193 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/service/impl/BlockedBootPersonnelTenureServiceImpl.java
  12. 249 0
      airport-blocked/src/main/java/com/sundot/airport/blocked/service/impl/BlockedRateScreenServiceImpl.java
  13. 143 0
      airport-blocked/src/main/resources/mapper/blocked/BlockedBootPersonnelTenureMapper.xml
  14. 7 0
      airport-blocked/src/main/resources/mapper/blocked/BlockedRateScreenMapper.xml
  15. 41 0
      airport-common/src/main/java/com/sundot/airport/common/core/domain/BaseScreenQueryParamDto.java
  16. 23 0
      airport-common/src/main/java/com/sundot/airport/common/core/domain/BlockedRateQueryParamDto.java
  17. 81 0
      airport-common/src/main/java/com/sundot/airport/common/utils/BlockedDateUtils.java
  18. 2 0
      airport-item/src/main/java/com/sundot/airport/item/mapper/SeizureReportMapper.java
  19. 50 0
      airport-item/src/main/java/com/sundot/airport/item/service/SeizureDistributionService.java
  20. 55 1
      airport-item/src/main/java/com/sundot/airport/item/service/impl/ItemLargeScreenServiceImpl.java
  21. 17 0
      airport-item/src/main/resources/mapper/item/SeizureReportMapper.xml
  22. 8 0
      airport-system/src/main/java/com/sundot/airport/system/mapper/SysUserMapper.java
  23. 8 0
      airport-system/src/main/java/com/sundot/airport/system/service/ISysUserService.java
  24. 5 0
      airport-system/src/main/java/com/sundot/airport/system/service/impl/SysUserServiceImpl.java
  25. 25 0
      airport-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 132 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/blocked/BlockedBootPersonnelTenureController.java

@@ -0,0 +1,132 @@
1
+package com.sundot.airport.web.controller.blocked;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+
6
+import org.springframework.security.access.prepost.PreAuthorize;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.web.bind.annotation.GetMapping;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.DeleteMapping;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import com.sundot.airport.common.annotation.Log;
16
+import com.sundot.airport.common.core.controller.BaseController;
17
+import com.sundot.airport.common.core.domain.AjaxResult;
18
+import com.sundot.airport.common.enums.BusinessType;
19
+import com.sundot.airport.blocked.domain.BlockedBootPersonnelTenure;
20
+import com.sundot.airport.blocked.service.IBlockedBootPersonnelTenureService;
21
+import com.sundot.airport.common.utils.poi.ExcelUtil;
22
+import com.sundot.airport.common.core.page.TableDataInfo;
23
+import org.springframework.web.multipart.MultipartFile;
24
+
25
+/**
26
+ * 开机人员年限分布Controller
27
+ *
28
+ * @author ruoyi
29
+ * @date 2026-04-16
30
+ */
31
+@RestController
32
+@RequestMapping("/blocked/tenure")
33
+public class BlockedBootPersonnelTenureController extends BaseController {
34
+    @Autowired
35
+    private IBlockedBootPersonnelTenureService blockedBootPersonnelTenureService;
36
+
37
+    /**
38
+     * 查询开机人员年限分布列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:list')")
41
+    @GetMapping("/list")
42
+    public TableDataInfo list(BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
43
+        startPage();
44
+        List<BlockedBootPersonnelTenure> list = blockedBootPersonnelTenureService.selectBlockedBootPersonnelTenureList(blockedBootPersonnelTenure);
45
+        return getDataTable(list);
46
+    }
47
+
48
+    /**
49
+     * 导出开机人员年限分布列表
50
+     */
51
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:export')")
52
+    @Log(title = "导出开机人员年限分布列表", businessType = BusinessType.EXPORT)
53
+    @PostMapping("/export")
54
+    public void export(HttpServletResponse response, BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
55
+        List<BlockedBootPersonnelTenure> list = blockedBootPersonnelTenureService.selectBlockedBootPersonnelTenureList(blockedBootPersonnelTenure);
56
+        ExcelUtil<BlockedBootPersonnelTenure> util = new ExcelUtil<BlockedBootPersonnelTenure>(BlockedBootPersonnelTenure.class);
57
+        util.exportExcel(response, list, "开机人员年限分布数据");
58
+    }
59
+
60
+    /**
61
+     * 导入开机人员年限分布列表
62
+     */
63
+    @PreAuthorize("@ss.hasPermi('blocked:rate:import')")
64
+    @Log(title = "导入开机人员年限分布列表", businessType = BusinessType.IMPORT)
65
+    @PostMapping("/importData")
66
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
67
+        ExcelUtil<BlockedBootPersonnelTenure> util = new ExcelUtil<>(BlockedBootPersonnelTenure.class);
68
+        List<BlockedBootPersonnelTenure> list = util.importExcel(file.getInputStream());
69
+        String message = blockedBootPersonnelTenureService.importData(list, updateSupport);
70
+        return success(message);
71
+    }
72
+
73
+    /**
74
+     * 获取导入模板
75
+     */
76
+    @PostMapping("/importTemplate")
77
+    public void importTemplate(HttpServletResponse response) {
78
+        ExcelUtil<BlockedBootPersonnelTenure> util = new ExcelUtil<>(BlockedBootPersonnelTenure.class);
79
+        util.importTemplateExcel(response, "开机人员年限分布数据导入模板");
80
+    }
81
+
82
+    /**
83
+     * 获取开机人员年限分布详细信息
84
+     */
85
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:query')")
86
+    @GetMapping(value = "/{id}")
87
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
88
+        return success(blockedBootPersonnelTenureService.selectBlockedBootPersonnelTenureById(id));
89
+    }
90
+
91
+    /**
92
+     * 新增开机人员年限分布
93
+     */
94
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:add')")
95
+    @Log(title = "开机人员年限分布", businessType = BusinessType.INSERT)
96
+    @PostMapping("/add")
97
+    public AjaxResult add(@RequestBody BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
98
+        blockedBootPersonnelTenure.setCreateBy(getUsername());
99
+        return toAjax(blockedBootPersonnelTenureService.insertBlockedBootPersonnelTenure(blockedBootPersonnelTenure));
100
+    }
101
+
102
+    /**
103
+     * 修改开机人员年限分布
104
+     */
105
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:edit')")
106
+    @Log(title = "开机人员年限分布", businessType = BusinessType.UPDATE)
107
+    @PostMapping("/edit")
108
+    public AjaxResult edit(@RequestBody BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
109
+        blockedBootPersonnelTenure.setUpdateBy(getUsername());
110
+        return toAjax(blockedBootPersonnelTenureService.updateBlockedBootPersonnelTenure(blockedBootPersonnelTenure));
111
+    }
112
+
113
+    /**
114
+     * 删除开机人员年限分布
115
+     */
116
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:remove')")
117
+    @Log(title = "开机人员年限分布", businessType = BusinessType.DELETE)
118
+    @DeleteMapping("/{ids}")
119
+    public AjaxResult remove(@PathVariable Long[] ids) {
120
+        return toAjax(blockedBootPersonnelTenureService.deleteBlockedBootPersonnelTenureByIds(ids));
121
+    }
122
+
123
+    /**
124
+     * 查询开机人员年限分布列表全量
125
+     */
126
+    @PreAuthorize("@ss.hasPermi('blocked:tenure:list')")
127
+    @GetMapping("/listAll")
128
+    public AjaxResult listAll(BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
129
+        List<BlockedBootPersonnelTenure> list = blockedBootPersonnelTenureService.selectBlockedBootPersonnelTenureList(blockedBootPersonnelTenure);
130
+        return success(list);
131
+    }
132
+}

+ 66 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/blocked/BlockedRateScreenController.java

@@ -0,0 +1,66 @@
1
+package com.sundot.airport.web.controller.blocked;
2
+
3
+import com.sundot.airport.blocked.dto.BlockedRateScreenBrigadeDto;
4
+import com.sundot.airport.blocked.dto.BlockedRateScreenT1Dto;
5
+import com.sundot.airport.blocked.dto.BlockedRateScreenT2Dto;
6
+import com.sundot.airport.blocked.service.IBlockedRateScreenService;
7
+import com.sundot.airport.common.core.controller.BaseController;
8
+import com.sundot.airport.common.core.domain.AjaxResult;
9
+import com.sundot.airport.common.core.domain.BlockedRateQueryParamDto;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.GetMapping;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RestController;
14
+
15
+import java.util.List;
16
+
17
+/**
18
+ * 速率大屏Controller
19
+ *
20
+ * @author ruoyi
21
+ * @date 2026-04-15
22
+ */
23
+@RestController
24
+@RequestMapping("/blocked/rate/screen")
25
+public class BlockedRateScreenController extends BaseController {
26
+
27
+    @Autowired
28
+    private IBlockedRateScreenService blockedRateScreenService;
29
+
30
+    /**
31
+     * T1速率统计数据
32
+     */
33
+    @GetMapping("/t1")
34
+    public AjaxResult t1(BlockedRateQueryParamDto dto) {
35
+        List<BlockedRateScreenT1Dto> result = blockedRateScreenService.t1(dto);
36
+        return success(result);
37
+    }
38
+
39
+    /**
40
+     * T2速率统计数据
41
+     */
42
+    @GetMapping("/t2")
43
+    public AjaxResult t2(BlockedRateQueryParamDto dto) {
44
+        List<BlockedRateScreenT2Dto> result = blockedRateScreenService.t2(dto);
45
+        return success(result);
46
+    }
47
+
48
+    /**
49
+     * 国内速率统计数据
50
+     */
51
+    @GetMapping("/domestic")
52
+    public AjaxResult domestic(BlockedRateQueryParamDto dto) {
53
+        List<BlockedRateScreenBrigadeDto> result = blockedRateScreenService.domestic(dto);
54
+        return success(result);
55
+    }
56
+
57
+    /**
58
+     * 国际速率统计数据
59
+     */
60
+    @GetMapping("/international")
61
+    public AjaxResult international(BlockedRateQueryParamDto dto) {
62
+        List<BlockedRateScreenBrigadeDto> result = blockedRateScreenService.international(dto);
63
+        return success(result);
64
+    }
65
+
66
+}

+ 171 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/domain/BlockedBootPersonnelTenure.java

@@ -0,0 +1,171 @@
1
+package com.sundot.airport.blocked.domain;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import org.apache.commons.lang3.builder.ToStringBuilder;
7
+import org.apache.commons.lang3.builder.ToStringStyle;
8
+import com.sundot.airport.common.annotation.Excel;
9
+import com.sundot.airport.common.core.domain.BaseEntity;
10
+
11
+/**
12
+ * 开机人员年限分布对象 blocked_boot_personnel_tenure
13
+ *
14
+ * @author ruoyi
15
+ * @date 2026-04-16
16
+ */
17
+@TableName("blocked_boot_personnel_tenure")
18
+public class BlockedBootPersonnelTenure extends BaseEntity {
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    /** 租户号 */
22
+    private String tenantId;
23
+
24
+    /** 乐观锁 */
25
+    private Long revision;
26
+
27
+    /** 主键 */
28
+    @TableId(type = IdType.AUTO)
29
+    private Long id;
30
+
31
+    /** 业务大队id */
32
+    private Long brigadeId;
33
+
34
+    /** 业务大队名称 */
35
+    @Excel(name = "业务大队")
36
+    private String brigadeName;
37
+
38
+    /** 5年及5年以上人员数 */
39
+    @Excel(name = "5年及5年以上人员数")
40
+    private Integer cntGe5Year;
41
+
42
+    /** 4年人员数 */
43
+    @Excel(name = "4年人员数")
44
+    private Integer cnt4Years;
45
+
46
+    /** 3年人员数 */
47
+    @Excel(name = "3年人员数")
48
+    private Integer cnt3Years;
49
+
50
+    /** 2年人员数 */
51
+    @Excel(name = "2年人员数")
52
+    private Integer cnt2Years;
53
+
54
+    /** 1年人员数 */
55
+    @Excel(name = "1年人员数")
56
+    private Integer cnt1Years;
57
+
58
+    /** 不足1年人员数 */
59
+    @Excel(name = "不足1年人员数")
60
+    private Integer cntLt1Year;
61
+
62
+    public void setTenantId(String tenantId) {
63
+        this.tenantId = tenantId;
64
+    }
65
+
66
+    public String getTenantId() {
67
+        return tenantId;
68
+    }
69
+
70
+    public void setRevision(Long revision) {
71
+        this.revision = revision;
72
+    }
73
+
74
+    public Long getRevision() {
75
+        return revision;
76
+    }
77
+
78
+    public void setId(Long id) {
79
+        this.id = id;
80
+    }
81
+
82
+    public Long getId() {
83
+        return id;
84
+    }
85
+
86
+    public void setBrigadeId(Long brigadeId) {
87
+        this.brigadeId = brigadeId;
88
+    }
89
+
90
+    public Long getBrigadeId() {
91
+        return brigadeId;
92
+    }
93
+
94
+    public void setBrigadeName(String brigadeName) {
95
+        this.brigadeName = brigadeName;
96
+    }
97
+
98
+    public String getBrigadeName() {
99
+        return brigadeName;
100
+    }
101
+
102
+    public void setCntGe5Year(Integer cntGe5Year) {
103
+        this.cntGe5Year = cntGe5Year;
104
+    }
105
+
106
+    public Integer getCntGe5Year() {
107
+        return cntGe5Year;
108
+    }
109
+
110
+    public void setCnt4Years(Integer cnt4Years) {
111
+        this.cnt4Years = cnt4Years;
112
+    }
113
+
114
+    public Integer getCnt4Years() {
115
+        return cnt4Years;
116
+    }
117
+
118
+    public void setCnt3Years(Integer cnt3Years) {
119
+        this.cnt3Years = cnt3Years;
120
+    }
121
+
122
+    public Integer getCnt3Years() {
123
+        return cnt3Years;
124
+    }
125
+
126
+    public void setCnt2Years(Integer cnt2Years) {
127
+        this.cnt2Years = cnt2Years;
128
+    }
129
+
130
+    public Integer getCnt2Years() {
131
+        return cnt2Years;
132
+    }
133
+
134
+    public void setCnt1Years(Integer cnt1Years) {
135
+        this.cnt1Years = cnt1Years;
136
+    }
137
+
138
+    public Integer getCnt1Years() {
139
+        return cnt1Years;
140
+    }
141
+
142
+    public void setCntLt1Year(Integer cntLt1Year) {
143
+        this.cntLt1Year = cntLt1Year;
144
+    }
145
+
146
+    public Integer getCntLt1Year() {
147
+        return cntLt1Year;
148
+    }
149
+
150
+    @Override
151
+    public String toString() {
152
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
153
+                .append("tenantId", getTenantId())
154
+                .append("revision", getRevision())
155
+                .append("createBy", getCreateBy())
156
+                .append("createTime", getCreateTime())
157
+                .append("updateBy", getUpdateBy())
158
+                .append("updateTime", getUpdateTime())
159
+                .append("remark", getRemark())
160
+                .append("id", getId())
161
+                .append("brigadeId", getBrigadeId())
162
+                .append("brigadeName", getBrigadeName())
163
+                .append("cntGe5Year", getCntGe5Year())
164
+                .append("cnt4Years", getCnt4Years())
165
+                .append("cnt3Years", getCnt3Years())
166
+                .append("cnt2Years", getCnt2Years())
167
+                .append("cnt1Years", getCnt1Years())
168
+                .append("cntLt1Year", getCntLt1Year())
169
+                .toString();
170
+    }
171
+}

+ 41 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenBrigadeDto.java

@@ -0,0 +1,41 @@
1
+package com.sundot.airport.blocked.dto;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import lombok.Data;
5
+import org.springframework.format.annotation.DateTimeFormat;
6
+
7
+import java.math.BigDecimal;
8
+import java.util.Date;
9
+
10
+/**
11
+ * 速率-国内/国际统计数据
12
+ *
13
+ * @author ruoyi
14
+ * @date 2026-04-15
15
+ */
16
+@Data
17
+public class BlockedRateScreenBrigadeDto {
18
+
19
+    /**
20
+     * 日期(格式:yyyy-MM-dd)
21
+     */
22
+    @JsonFormat(pattern = "yyyy-MM-dd")
23
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
24
+    private Date statDate;
25
+
26
+    /**
27
+     * 当班大队ID
28
+     */
29
+    private Long dutyBrigadeId;
30
+
31
+    /**
32
+     * 当班大队名称
33
+     */
34
+    private String dutyBrigadeName;
35
+
36
+    /**
37
+     * 平均速率
38
+     */
39
+    private BigDecimal avgRatePeak;
40
+
41
+}

+ 36 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenT1Dto.java

@@ -0,0 +1,36 @@
1
+package com.sundot.airport.blocked.dto;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import lombok.Data;
5
+import org.springframework.format.annotation.DateTimeFormat;
6
+
7
+import java.math.BigDecimal;
8
+import java.util.Date;
9
+
10
+/**
11
+ * 速率-T1统计数据
12
+ *
13
+ * @author ruoyi
14
+ * @date 2026-04-15
15
+ */
16
+@Data
17
+public class BlockedRateScreenT1Dto {
18
+
19
+    /**
20
+     * 日期(格式:yyyy-MM-dd)
21
+     */
22
+    @JsonFormat(pattern = "yyyy-MM-dd")
23
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
24
+    private Date statDate;
25
+
26
+    /**
27
+     * T1-A区速率(高峰期时段)
28
+     */
29
+    private BigDecimal t1AAreaRatePeak;
30
+
31
+    /**
32
+     * T1-B区速率(高峰期时段)
33
+     */
34
+    private BigDecimal t1BAreaRatePeak;
35
+
36
+}

+ 36 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/dto/BlockedRateScreenT2Dto.java

@@ -0,0 +1,36 @@
1
+package com.sundot.airport.blocked.dto;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import lombok.Data;
5
+import org.springframework.format.annotation.DateTimeFormat;
6
+
7
+import java.math.BigDecimal;
8
+import java.util.Date;
9
+
10
+/**
11
+ * 速率-T2统计数据
12
+ *
13
+ * @author ruoyi
14
+ * @date 2026-04-15
15
+ */
16
+@Data
17
+public class BlockedRateScreenT2Dto {
18
+
19
+    /**
20
+     * 日期(格式:yyyy-MM-dd)
21
+     */
22
+    @JsonFormat(pattern = "yyyy-MM-dd")
23
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
24
+    private Date statDate;
25
+
26
+    /**
27
+     * T2-国内速率(高峰期时段)
28
+     */
29
+    private BigDecimal t2DomesticRatePeak;
30
+
31
+    /**
32
+     * T2-国际速率(高峰期时段)
33
+     */
34
+    private BigDecimal t2InternationalRatePeak;
35
+
36
+}

+ 62 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/mapper/BlockedBootPersonnelTenureMapper.java

@@ -0,0 +1,62 @@
1
+package com.sundot.airport.blocked.mapper;
2
+
3
+import java.util.List;
4
+
5
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
+import com.sundot.airport.blocked.domain.BlockedBootPersonnelTenure;
7
+
8
+/**
9
+ * 开机人员年限分布Mapper接口
10
+ *
11
+ * @author ruoyi
12
+ * @date 2026-04-16
13
+ */
14
+public interface BlockedBootPersonnelTenureMapper extends BaseMapper<BlockedBootPersonnelTenure> {
15
+    /**
16
+     * 查询开机人员年限分布
17
+     *
18
+     * @param id 开机人员年限分布主键
19
+     * @return 开机人员年限分布
20
+     */
21
+    public BlockedBootPersonnelTenure selectBlockedBootPersonnelTenureById(Long id);
22
+
23
+    /**
24
+     * 查询开机人员年限分布列表
25
+     *
26
+     * @param blockedBootPersonnelTenure 开机人员年限分布
27
+     * @return 开机人员年限分布集合
28
+     */
29
+    public List<BlockedBootPersonnelTenure> selectBlockedBootPersonnelTenureList(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
30
+
31
+    /**
32
+     * 新增开机人员年限分布
33
+     *
34
+     * @param blockedBootPersonnelTenure 开机人员年限分布
35
+     * @return 结果
36
+     */
37
+    public int insertBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
38
+
39
+    /**
40
+     * 修改开机人员年限分布
41
+     *
42
+     * @param blockedBootPersonnelTenure 开机人员年限分布
43
+     * @return 结果
44
+     */
45
+    public int updateBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
46
+
47
+    /**
48
+     * 删除开机人员年限分布
49
+     *
50
+     * @param id 开机人员年限分布主键
51
+     * @return 结果
52
+     */
53
+    public int deleteBlockedBootPersonnelTenureById(Long id);
54
+
55
+    /**
56
+     * 批量删除开机人员年限分布
57
+     *
58
+     * @param ids 需要删除的数据主键集合
59
+     * @return 结果
60
+     */
61
+    public int deleteBlockedBootPersonnelTenureByIds(Long[] ids);
62
+}

+ 11 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/mapper/BlockedRateScreenMapper.java

@@ -0,0 +1,11 @@
1
+package com.sundot.airport.blocked.mapper;
2
+
3
+/**
4
+ * 速率大屏Mapper接口
5
+ *
6
+ * @author ruoyi
7
+ * @date 2026-04-13
8
+ */
9
+public interface BlockedRateScreenMapper {
10
+
11
+}

+ 71 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/IBlockedBootPersonnelTenureService.java

@@ -0,0 +1,71 @@
1
+package com.sundot.airport.blocked.service;
2
+
3
+import java.util.List;
4
+
5
+import com.baomidou.mybatisplus.extension.service.IService;
6
+import com.sundot.airport.blocked.domain.BlockedBootPersonnelTenure;
7
+
8
+/**
9
+ * 开机人员年限分布Service接口
10
+ *
11
+ * @author ruoyi
12
+ * @date 2026-04-16
13
+ */
14
+public interface IBlockedBootPersonnelTenureService extends IService<BlockedBootPersonnelTenure> {
15
+    /**
16
+     * 查询开机人员年限分布
17
+     *
18
+     * @param id 开机人员年限分布主键
19
+     * @return 开机人员年限分布
20
+     */
21
+    public BlockedBootPersonnelTenure selectBlockedBootPersonnelTenureById(Long id);
22
+
23
+    /**
24
+     * 查询开机人员年限分布列表
25
+     *
26
+     * @param blockedBootPersonnelTenure 开机人员年限分布
27
+     * @return 开机人员年限分布集合
28
+     */
29
+    public List<BlockedBootPersonnelTenure> selectBlockedBootPersonnelTenureList(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
30
+
31
+    /**
32
+     * 新增开机人员年限分布
33
+     *
34
+     * @param blockedBootPersonnelTenure 开机人员年限分布
35
+     * @return 结果
36
+     */
37
+    public int insertBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
38
+
39
+    /**
40
+     * 修改开机人员年限分布
41
+     *
42
+     * @param blockedBootPersonnelTenure 开机人员年限分布
43
+     * @return 结果
44
+     */
45
+    public int updateBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure);
46
+
47
+    /**
48
+     * 批量删除开机人员年限分布
49
+     *
50
+     * @param ids 需要删除的开机人员年限分布主键集合
51
+     * @return 结果
52
+     */
53
+    public int deleteBlockedBootPersonnelTenureByIds(Long[] ids);
54
+
55
+    /**
56
+     * 删除开机人员年限分布信息
57
+     *
58
+     * @param id 开机人员年限分布主键
59
+     * @return 结果
60
+     */
61
+    public int deleteBlockedBootPersonnelTenureById(Long id);
62
+
63
+    /**
64
+     * 导入开机人员年限分布列表
65
+     *
66
+     * @param list          数据列表
67
+     * @param updateSupport 是否更新支持
68
+     * @return 导入结果信息
69
+     */
70
+    public String importData(List<BlockedBootPersonnelTenure> list, boolean updateSupport);
71
+}

+ 50 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/IBlockedRateScreenService.java

@@ -0,0 +1,50 @@
1
+package com.sundot.airport.blocked.service;
2
+
3
+import com.sundot.airport.blocked.dto.BlockedRateScreenBrigadeDto;
4
+import com.sundot.airport.blocked.dto.BlockedRateScreenT1Dto;
5
+import com.sundot.airport.blocked.dto.BlockedRateScreenT2Dto;
6
+import com.sundot.airport.common.core.domain.BlockedRateQueryParamDto;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * 速率大屏Service接口
12
+ *
13
+ * @author ruoyi
14
+ * @date 2026-04-13
15
+ */
16
+public interface IBlockedRateScreenService {
17
+
18
+    /**
19
+     * T1速率统计数据
20
+     *
21
+     * @param dto 上行参数
22
+     * @return 结果
23
+     */
24
+    public List<BlockedRateScreenT1Dto> t1(BlockedRateQueryParamDto dto);
25
+
26
+    /**
27
+     * T2速率统计数据
28
+     *
29
+     * @param dto 上行参数
30
+     * @return 结果
31
+     */
32
+    public List<BlockedRateScreenT2Dto> t2(BlockedRateQueryParamDto dto);
33
+
34
+    /**
35
+     * 国内速率统计数据
36
+     *
37
+     * @param dto 上行参数
38
+     * @return 结果
39
+     */
40
+    public List<BlockedRateScreenBrigadeDto> domestic(BlockedRateQueryParamDto dto);
41
+
42
+    /**
43
+     * 国际速率统计数据
44
+     *
45
+     * @param dto 上行参数
46
+     * @return 结果
47
+     */
48
+    public List<BlockedRateScreenBrigadeDto> international(BlockedRateQueryParamDto dto);
49
+
50
+}

+ 193 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/impl/BlockedBootPersonnelTenureServiceImpl.java

@@ -0,0 +1,193 @@
1
+package com.sundot.airport.blocked.service.impl;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+import java.util.stream.Collectors;
6
+
7
+import cn.hutool.core.collection.CollUtil;
8
+import cn.hutool.core.util.ObjUtil;
9
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
10
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11
+import com.sundot.airport.common.core.domain.entity.SysDept;
12
+import com.sundot.airport.common.exception.ServiceException;
13
+import com.sundot.airport.common.utils.DateUtils;
14
+import com.sundot.airport.system.service.ISysDeptService;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.stereotype.Service;
17
+import com.sundot.airport.blocked.mapper.BlockedBootPersonnelTenureMapper;
18
+import com.sundot.airport.blocked.domain.BlockedBootPersonnelTenure;
19
+import com.sundot.airport.blocked.service.IBlockedBootPersonnelTenureService;
20
+import org.springframework.transaction.annotation.Transactional;
21
+
22
+/**
23
+ * 开机人员年限分布Service业务层处理
24
+ *
25
+ * @author ruoyi
26
+ * @date 2026-04-16
27
+ */
28
+@Service
29
+public class BlockedBootPersonnelTenureServiceImpl extends ServiceImpl<BlockedBootPersonnelTenureMapper, BlockedBootPersonnelTenure> implements IBlockedBootPersonnelTenureService {
30
+    @Autowired
31
+    private BlockedBootPersonnelTenureMapper blockedBootPersonnelTenureMapper;
32
+    @Autowired
33
+    private ISysDeptService sysDeptService;
34
+
35
+    /**
36
+     * 查询开机人员年限分布
37
+     *
38
+     * @param id 开机人员年限分布主键
39
+     * @return 开机人员年限分布
40
+     */
41
+    @Override
42
+    public BlockedBootPersonnelTenure selectBlockedBootPersonnelTenureById(Long id) {
43
+        return blockedBootPersonnelTenureMapper.selectBlockedBootPersonnelTenureById(id);
44
+    }
45
+
46
+    /**
47
+     * 查询开机人员年限分布列表
48
+     *
49
+     * @param blockedBootPersonnelTenure 开机人员年限分布
50
+     * @return 开机人员年限分布
51
+     */
52
+    @Override
53
+    public List<BlockedBootPersonnelTenure> selectBlockedBootPersonnelTenureList(BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
54
+        return blockedBootPersonnelTenureMapper.selectBlockedBootPersonnelTenureList(blockedBootPersonnelTenure);
55
+    }
56
+
57
+    /**
58
+     * 新增开机人员年限分布
59
+     *
60
+     * @param blockedBootPersonnelTenure 开机人员年限分布
61
+     * @return 结果
62
+     */
63
+    @Override
64
+    public int insertBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
65
+        blockedBootPersonnelTenure.setCreateTime(DateUtils.getNowDate());
66
+        LambdaQueryWrapper<BlockedBootPersonnelTenure> queryWrapper = new LambdaQueryWrapper<>();
67
+        queryWrapper.eq(BlockedBootPersonnelTenure::getBrigadeId, blockedBootPersonnelTenure.getBrigadeId());
68
+        BlockedBootPersonnelTenure existingRate = blockedBootPersonnelTenureMapper.selectOne(queryWrapper);
69
+        if (ObjUtil.isNotNull(existingRate)) {
70
+            blockedBootPersonnelTenure.setId(existingRate.getId());
71
+            return blockedBootPersonnelTenureMapper.updateBlockedBootPersonnelTenure(blockedBootPersonnelTenure);
72
+        } else {
73
+            return blockedBootPersonnelTenureMapper.insertBlockedBootPersonnelTenure(blockedBootPersonnelTenure);
74
+        }
75
+    }
76
+
77
+    /**
78
+     * 修改开机人员年限分布
79
+     *
80
+     * @param blockedBootPersonnelTenure 开机人员年限分布
81
+     * @return 结果
82
+     */
83
+    @Override
84
+    public int updateBlockedBootPersonnelTenure(BlockedBootPersonnelTenure blockedBootPersonnelTenure) {
85
+        blockedBootPersonnelTenure.setUpdateTime(DateUtils.getNowDate());
86
+        return blockedBootPersonnelTenureMapper.updateBlockedBootPersonnelTenure(blockedBootPersonnelTenure);
87
+    }
88
+
89
+    /**
90
+     * 批量删除开机人员年限分布
91
+     *
92
+     * @param ids 需要删除的开机人员年限分布主键
93
+     * @return 结果
94
+     */
95
+    @Override
96
+    public int deleteBlockedBootPersonnelTenureByIds(Long[] ids) {
97
+        return blockedBootPersonnelTenureMapper.deleteBlockedBootPersonnelTenureByIds(ids);
98
+    }
99
+
100
+    /**
101
+     * 删除开机人员年限分布信息
102
+     *
103
+     * @param id 开机人员年限分布主键
104
+     * @return 结果
105
+     */
106
+    @Override
107
+    public int deleteBlockedBootPersonnelTenureById(Long id) {
108
+        return blockedBootPersonnelTenureMapper.deleteBlockedBootPersonnelTenureById(id);
109
+    }
110
+
111
+    /**
112
+     * 导入开机人员年限分布列表
113
+     *
114
+     * @param list            数据列表
115
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
116
+     * @return 结果
117
+     */
118
+    @Transactional(rollbackFor = Exception.class)
119
+    @Override
120
+    public String importData(List<BlockedBootPersonnelTenure> list, boolean isUpdateSupport) {
121
+        if (CollUtil.isEmpty(list)) {
122
+            throw new ServiceException("导入开机人员年限分布数据不能为空!");
123
+        }
124
+
125
+        List<SysDept> deptListAll = sysDeptService.selectDeptInfoAll(new SysDept());
126
+        Map<String, Long> deptMap = deptListAll.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldValue, newValue) -> newValue));
127
+
128
+        int successNum = 0;
129
+        int failureNum = 0;
130
+        StringBuilder successMsg = new StringBuilder();
131
+        StringBuilder failureMsg = new StringBuilder();
132
+
133
+        for (BlockedBootPersonnelTenure data : list) {
134
+            // 根据名称填充ID字段
135
+            fillIdsByName(data, deptMap);
136
+            try {
137
+                if (ObjUtil.isNull(data.getBrigadeId()) || ObjUtil.isNull(data.getBrigadeName())) {
138
+                    failureNum++;
139
+                    failureMsg.append("<br/>" + failureNum + "、业务大队不能为空");
140
+                    continue;
141
+                }
142
+
143
+                // 查询是否已存在(根据【日期+当班大队+班次】唯一)
144
+                BlockedBootPersonnelTenure queryParam = new BlockedBootPersonnelTenure();
145
+                queryParam.setBrigadeId(data.getBrigadeId());
146
+                List<BlockedBootPersonnelTenure> existingList = blockedBootPersonnelTenureMapper.selectBlockedBootPersonnelTenureList(queryParam);
147
+
148
+                if (CollUtil.isEmpty(existingList)) {
149
+                    // 新增
150
+                    data.setCreateTime(DateUtils.getNowDate());
151
+                    blockedBootPersonnelTenureMapper.insertBlockedBootPersonnelTenure(data);
152
+                    successNum++;
153
+                    successMsg.append("<br/>" + successNum + "、业务大队【" + data.getBrigadeName() + "】导入成功");
154
+                } else if (isUpdateSupport) {
155
+                    // 更新
156
+                    BlockedBootPersonnelTenure old = existingList.get(0);
157
+                    data.setId(old.getId());
158
+                    data.setUpdateTime(DateUtils.getNowDate());
159
+                    blockedBootPersonnelTenureMapper.updateBlockedBootPersonnelTenure(data);
160
+                    successNum++;
161
+                    successMsg.append("<br/>" + successNum + "、业务大队【" + data.getBrigadeName() + "】更新成功");
162
+                } else {
163
+                    failureNum++;
164
+                    failureMsg.append("<br/>" + failureNum + "、业务大队【" + data.getBrigadeName() + "】已存在");
165
+                }
166
+            } catch (Exception e) {
167
+                failureNum++;
168
+                String msg = "<br/>" + failureNum + "、业务大队【" + data.getBrigadeName() + "】导入失败:";
169
+                failureMsg.append(msg + e.getMessage());
170
+            }
171
+        }
172
+
173
+        if (failureNum > 0) {
174
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
175
+            throw new ServiceException(failureMsg.toString());
176
+        } else {
177
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
178
+        }
179
+        return successMsg.toString();
180
+    }
181
+
182
+    /**
183
+     * 根据名称填充ID字段
184
+     *
185
+     * @param data 速率数据
186
+     */
187
+    private void fillIdsByName(BlockedBootPersonnelTenure data, Map<String, Long> deptMap) {
188
+        // 业务大队
189
+        if (ObjUtil.isNotNull(data.getBrigadeName())) {
190
+            data.setBrigadeId(deptMap.get(data.getBrigadeName()));
191
+        }
192
+    }
193
+}

+ 249 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/service/impl/BlockedRateScreenServiceImpl.java

@@ -0,0 +1,249 @@
1
+package com.sundot.airport.blocked.service.impl;
2
+
3
+import com.sundot.airport.blocked.domain.BlockedRate;
4
+import com.sundot.airport.blocked.dto.BlockedRateScreenBrigadeDto;
5
+import com.sundot.airport.blocked.dto.BlockedRateScreenT1Dto;
6
+import com.sundot.airport.blocked.dto.BlockedRateScreenT2Dto;
7
+import com.sundot.airport.blocked.mapper.BlockedRateMapper;
8
+import com.sundot.airport.blocked.mapper.BlockedRateScreenMapper;
9
+import com.sundot.airport.blocked.service.IBlockedRateScreenService;
10
+import com.sundot.airport.common.core.domain.BlockedRateQueryParamDto;
11
+import com.sundot.airport.common.core.domain.entity.SysDept;
12
+import com.sundot.airport.common.utils.BlockedDateUtils;
13
+import com.sundot.airport.system.service.ISysDeptService;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.stereotype.Service;
16
+
17
+import java.math.BigDecimal;
18
+import java.math.RoundingMode;
19
+import java.util.ArrayList;
20
+import java.util.Arrays;
21
+import java.util.Collections;
22
+import java.util.Date;
23
+import java.util.List;
24
+import java.util.Map;
25
+import java.util.stream.Collectors;
26
+
27
+/**
28
+ * 速率大屏Service业务层处理
29
+ *
30
+ * @author ruoyi
31
+ * @date 2026-04-13
32
+ */
33
+@Service
34
+public class BlockedRateScreenServiceImpl implements IBlockedRateScreenService {
35
+
36
+    // 默认的精度
37
+    private static final int SCALE = 2;
38
+    // 默认的舍入模式
39
+    private static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_UP;
40
+    // 目标大队名称列表
41
+    private static final List<String> BRIGADE_NAMES = Arrays.asList("安检一大队", "安检二大队", "安检三大队");
42
+
43
+    @Autowired
44
+    private BlockedRateScreenMapper blockedRateScreenMapper;
45
+    @Autowired
46
+    private BlockedRateMapper blockedRateMapper;
47
+    @Autowired
48
+    private ISysDeptService sysDeptService;
49
+
50
+    /**
51
+     * T1速率统计数据
52
+     *
53
+     * @param dto 上行参数
54
+     * @return 结果
55
+     */
56
+    @Override
57
+    public List<BlockedRateScreenT1Dto> t1(BlockedRateQueryParamDto dto) {
58
+        initDefaultDateRange(dto);
59
+        List<Date> dateList = getDateList(dto);
60
+        List<BlockedRate> blockedRateList = queryBlockedRateList(dto);
61
+        Map<Date, List<BlockedRate>> dateGroupMap = groupByDate(blockedRateList);
62
+        List<BlockedRateScreenT1Dto> result = new ArrayList<>();
63
+        dateList.forEach(date -> {
64
+            BlockedRateScreenT1Dto dtoItem = new BlockedRateScreenT1Dto();
65
+            dtoItem.setStatDate(date);
66
+            List<BlockedRate> dateData = dateGroupMap.getOrDefault(date, Collections.emptyList());
67
+            dtoItem.setT1AAreaRatePeak(calculateAvg(dateData, BlockedRate::getT1AAreaRatePeak));
68
+            dtoItem.setT1BAreaRatePeak(calculateAvg(dateData, BlockedRate::getT1BAreaRatePeak));
69
+            result.add(dtoItem);
70
+        });
71
+        return result;
72
+    }
73
+
74
+    /**
75
+     * T2速率统计数据
76
+     *
77
+     * @param dto 上行参数
78
+     * @return 结果
79
+     */
80
+    @Override
81
+    public List<BlockedRateScreenT2Dto> t2(BlockedRateQueryParamDto dto) {
82
+        initDefaultDateRange(dto);
83
+        List<Date> dateList = getDateList(dto);
84
+        List<BlockedRate> blockedRateList = queryBlockedRateList(dto);
85
+        Map<Date, List<BlockedRate>> dateGroupMap = groupByDate(blockedRateList);
86
+        List<BlockedRateScreenT2Dto> result = new ArrayList<>();
87
+        dateList.forEach(date -> {
88
+            BlockedRateScreenT2Dto dtoItem = new BlockedRateScreenT2Dto();
89
+            dtoItem.setStatDate(date);
90
+            List<BlockedRate> dateData = dateGroupMap.getOrDefault(date, Collections.emptyList());
91
+            dtoItem.setT2DomesticRatePeak(calculateAvg(dateData, BlockedRate::getT2DomesticRatePeak));
92
+            dtoItem.setT2InternationalRatePeak(calculateAvg(dateData, BlockedRate::getT2InternationalRatePeak));
93
+            result.add(dtoItem);
94
+        });
95
+        return result;
96
+    }
97
+
98
+    /**
99
+     * 国内速率统计数据
100
+     *
101
+     * @param dto 上行参数
102
+     * @return 结果
103
+     */
104
+    @Override
105
+    public List<BlockedRateScreenBrigadeDto> domestic(BlockedRateQueryParamDto dto) {
106
+        initDefaultDateRange(dto);
107
+        List<Date> dateList = getDateList(dto);
108
+        List<SysDept> targetDeptList = getTargetDeptList(dto);
109
+        List<BlockedRate> blockedRateList = queryBlockedRateList(dto);
110
+        Map<Date, List<BlockedRate>> dateGroupMap = groupByDate(blockedRateList);
111
+        List<BlockedRateScreenBrigadeDto> result = new ArrayList<>();
112
+        dateList.forEach(date -> {
113
+            List<BlockedRate> dateData = dateGroupMap.getOrDefault(date, Collections.emptyList());
114
+            targetDeptList.forEach(dept -> {
115
+                BlockedRateScreenBrigadeDto dtoItem = new BlockedRateScreenBrigadeDto();
116
+                dtoItem.setStatDate(date);
117
+                dtoItem.setDutyBrigadeId(dept.getDeptId());
118
+                dtoItem.setDutyBrigadeName(dept.getDeptName());
119
+                List<BlockedRate> deptData = dateData.stream()
120
+                        .filter(rate -> dept.getDeptId().equals(rate.getDutyBrigadeId()))
121
+                        .collect(Collectors.toList());
122
+                dtoItem.setAvgRatePeak(calculateAvg(deptData, BlockedRate::getTravelInspectionDomesticAvgRatePeak));
123
+                result.add(dtoItem);
124
+            });
125
+        });
126
+        return result;
127
+    }
128
+
129
+    /**
130
+     * 国际速率统计数据
131
+     *
132
+     * @param dto 上行参数
133
+     * @return 结果
134
+     */
135
+    @Override
136
+    public List<BlockedRateScreenBrigadeDto> international(BlockedRateQueryParamDto dto) {
137
+        initDefaultDateRange(dto);
138
+        List<Date> dateList = getDateList(dto);
139
+        List<SysDept> targetDeptList = getTargetDeptList(dto);
140
+        List<BlockedRate> blockedRateList = queryBlockedRateList(dto);
141
+        Map<Date, List<BlockedRate>> dateGroupMap = groupByDate(blockedRateList);
142
+        List<BlockedRateScreenBrigadeDto> result = new ArrayList<>();
143
+        dateList.forEach(date -> {
144
+            List<BlockedRate> dateData = dateGroupMap.getOrDefault(date, Collections.emptyList());
145
+            targetDeptList.forEach(dept -> {
146
+                BlockedRateScreenBrigadeDto dtoItem = new BlockedRateScreenBrigadeDto();
147
+                dtoItem.setStatDate(date);
148
+                dtoItem.setDutyBrigadeId(dept.getDeptId());
149
+                dtoItem.setDutyBrigadeName(dept.getDeptName());
150
+                List<BlockedRate> deptData = dateData.stream()
151
+                        .filter(rate -> dept.getDeptId().equals(rate.getDutyBrigadeId()))
152
+                        .collect(Collectors.toList());
153
+                dtoItem.setAvgRatePeak(calculateAvg(deptData, BlockedRate::getInternationalTransferAvgRatePeak));
154
+                result.add(dtoItem);
155
+            });
156
+        });
157
+        return result;
158
+    }
159
+
160
+    /**
161
+     * 初始化默认日期范围
162
+     *
163
+     * @param dto 上行参数
164
+     */
165
+    private void initDefaultDateRange(BlockedRateQueryParamDto dto) {
166
+        if (dto.getSpecifiedDate() == null && dto.getStartDate() == null && dto.getEndDate() == null) {
167
+            dto.setStartDate(BlockedDateUtils.getFirstDayOfYear());
168
+            dto.setEndDate(BlockedDateUtils.getCurrentDate());
169
+        }
170
+    }
171
+
172
+    /**
173
+     * 获取指定日期列表
174
+     *
175
+     * @param dto 上行参数
176
+     * @return 日期列表
177
+     */
178
+    private List<Date> getDateList(BlockedRateQueryParamDto dto) {
179
+        if (dto.getSpecifiedDate() != null) {
180
+            return Collections.singletonList(dto.getSpecifiedDate());
181
+        }
182
+        return BlockedDateUtils.generateDateList(dto.getStartDate(), dto.getEndDate());
183
+    }
184
+
185
+    /**
186
+     * 查询数据
187
+     *
188
+     * @param dto 上行参数
189
+     * @return 列表
190
+     */
191
+    private List<BlockedRate> queryBlockedRateList(BlockedRateQueryParamDto dto) {
192
+        BlockedRate query = new BlockedRate();
193
+        query.setStatDate(dto.getSpecifiedDate());
194
+        query.setStartDate(dto.getStartDate());
195
+        query.setEndDate(dto.getEndDate());
196
+        query.setDutyBrigadeId(dto.getBrigadeId());
197
+        query.setDutyBrigadeName(dto.getBrigadeName());
198
+        return blockedRateMapper.selectBlockedRateList(query);
199
+    }
200
+
201
+    /**
202
+     * 按日期分组
203
+     *
204
+     * @param blockedRateList 数据列表
205
+     * @return 分组结果
206
+     */
207
+    private Map<Date, List<BlockedRate>> groupByDate(List<BlockedRate> blockedRateList) {
208
+        return blockedRateList.stream()
209
+                .filter(rate -> rate.getStatDate() != null)
210
+                .collect(Collectors.groupingBy(BlockedRate::getStatDate));
211
+    }
212
+
213
+    /**
214
+     * 计算平均值
215
+     *
216
+     * @param dataList        数据列表
217
+     * @param valueExtractor  值提取器
218
+     * @return 平均值
219
+     */
220
+    private BigDecimal calculateAvg(List<BlockedRate> dataList, java.util.function.Function<BlockedRate, BigDecimal> valueExtractor) {
221
+        List<BigDecimal> values = dataList.stream()
222
+                .map(valueExtractor)
223
+                .filter(val -> val != null && val.compareTo(BigDecimal.ZERO) != 0)
224
+                .collect(Collectors.toList());
225
+        if (values.isEmpty()) {
226
+            return BigDecimal.ZERO;
227
+        }
228
+        BigDecimal sum = values.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
229
+        return sum.divide(BigDecimal.valueOf(values.size()), SCALE, ROUNDING_MODE);
230
+    }
231
+
232
+    /**
233
+     * 获取指定部门列表
234
+     *
235
+     * @param dto 上行参数
236
+     * @return 部门列表
237
+     */
238
+    private List<SysDept> getTargetDeptList(BlockedRateQueryParamDto dto) {
239
+        if (dto.getBrigadeId() == null) {
240
+            List<SysDept> deptListAll = sysDeptService.selectDeptInfoAll(new SysDept());
241
+            return deptListAll.stream()
242
+                    .filter(dept -> BRIGADE_NAMES.contains(dept.getDeptName()))
243
+                    .collect(Collectors.toList());
244
+        } else {
245
+            return sysDeptService.selectDeptByIdList(Collections.singletonList(dto.getBrigadeId()));
246
+        }
247
+    }
248
+
249
+}

+ 143 - 0
airport-blocked/src/main/resources/mapper/blocked/BlockedBootPersonnelTenureMapper.xml

@@ -0,0 +1,143 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.sundot.airport.blocked.mapper.BlockedBootPersonnelTenureMapper">
6
+
7
+    <resultMap type="BlockedBootPersonnelTenure" id="BlockedBootPersonnelTenureResult">
8
+        <result property="tenantId" column="tenant_id"/>
9
+        <result property="revision" column="revision"/>
10
+        <result property="createBy" column="create_by"/>
11
+        <result property="createTime" column="create_time"/>
12
+        <result property="updateBy" column="update_by"/>
13
+        <result property="updateTime" column="update_time"/>
14
+        <result property="remark" column="remark"/>
15
+        <result property="id" column="id"/>
16
+        <result property="brigadeId" column="brigade_id"/>
17
+        <result property="brigadeName" column="brigade_name"/>
18
+        <result property="cntGe5Year" column="cnt_ge_5_year"/>
19
+        <result property="cnt4Years" column="cnt_4_years"/>
20
+        <result property="cnt3Years" column="cnt_3_years"/>
21
+        <result property="cnt2Years" column="cnt_2_years"/>
22
+        <result property="cnt1Years" column="cnt_1_years"/>
23
+        <result property="cntLt1Year" column="cnt_lt_1_year"/>
24
+    </resultMap>
25
+
26
+    <sql id="selectBlockedBootPersonnelTenureVo">
27
+        select tenant_id,
28
+               revision,
29
+               create_by,
30
+               create_time,
31
+               update_by,
32
+               update_time,
33
+               remark,
34
+               id,
35
+               brigade_id,
36
+               brigade_name,
37
+               cnt_ge_5_year,
38
+               cnt_4_years,
39
+               cnt_3_years,
40
+               cnt_2_years,
41
+               cnt_1_years,
42
+               cnt_lt_1_year
43
+        from blocked_boot_personnel_tenure
44
+    </sql>
45
+
46
+    <select id="selectBlockedBootPersonnelTenureList" parameterType="BlockedBootPersonnelTenure"
47
+            resultMap="BlockedBootPersonnelTenureResult">
48
+        <include refid="selectBlockedBootPersonnelTenureVo"/>
49
+        <where>
50
+            <if test="tenantId != null  and tenantId != ''">and tenant_id = #{tenantId}</if>
51
+            <if test="revision != null ">and revision = #{revision}</if>
52
+            <if test="brigadeId != null ">and brigade_id = #{brigadeId}</if>
53
+            <if test="brigadeName != null  and brigadeName != ''">and brigade_name like concat('%', #{brigadeName},
54
+                '%')
55
+            </if>
56
+            <if test="cntGe5Year != null ">and cnt_ge_5_year = #{cntGe5Year}</if>
57
+            <if test="cnt4Years != null ">and cnt_4_years = #{cnt4Years}</if>
58
+            <if test="cnt3Years != null ">and cnt_3_years = #{cnt3Years}</if>
59
+            <if test="cnt2Years != null ">and cnt_2_years = #{cnt2Years}</if>
60
+            <if test="cnt1Years != null ">and cnt_1_years = #{cnt1Years}</if>
61
+            <if test="cntLt1Year != null ">and cnt_lt_1_year = #{cntLt1Year}</if>
62
+        </where>
63
+    </select>
64
+
65
+    <select id="selectBlockedBootPersonnelTenureById" parameterType="Long" resultMap="BlockedBootPersonnelTenureResult">
66
+        <include refid="selectBlockedBootPersonnelTenureVo"/>
67
+        where id = #{id}
68
+    </select>
69
+
70
+    <insert id="insertBlockedBootPersonnelTenure" parameterType="BlockedBootPersonnelTenure" useGeneratedKeys="true"
71
+            keyProperty="id">
72
+        insert into blocked_boot_personnel_tenure
73
+        <trim prefix="(" suffix=")" suffixOverrides=",">
74
+            <if test="tenantId != null">tenant_id,</if>
75
+            <if test="revision != null">revision,</if>
76
+            <if test="createBy != null">create_by,</if>
77
+            <if test="createTime != null">create_time,</if>
78
+            <if test="updateBy != null">update_by,</if>
79
+            <if test="updateTime != null">update_time,</if>
80
+            <if test="remark != null">remark,</if>
81
+            <if test="brigadeId != null">brigade_id,</if>
82
+            <if test="brigadeName != null and brigadeName != ''">brigade_name,</if>
83
+            <if test="cntGe5Year != null">cnt_ge_5_year,</if>
84
+            <if test="cnt4Years != null">cnt_4_years,</if>
85
+            <if test="cnt3Years != null">cnt_3_years,</if>
86
+            <if test="cnt2Years != null">cnt_2_years,</if>
87
+            <if test="cnt1Years != null">cnt_1_years,</if>
88
+            <if test="cntLt1Year != null">cnt_lt_1_year,</if>
89
+        </trim>
90
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
91
+            <if test="tenantId != null">#{tenantId},</if>
92
+            <if test="revision != null">#{revision},</if>
93
+            <if test="createBy != null">#{createBy},</if>
94
+            <if test="createTime != null">#{createTime},</if>
95
+            <if test="updateBy != null">#{updateBy},</if>
96
+            <if test="updateTime != null">#{updateTime},</if>
97
+            <if test="remark != null">#{remark},</if>
98
+            <if test="brigadeId != null">#{brigadeId},</if>
99
+            <if test="brigadeName != null and brigadeName != ''">#{brigadeName},</if>
100
+            <if test="cntGe5Year != null">#{cntGe5Year},</if>
101
+            <if test="cnt4Years != null">#{cnt4Years},</if>
102
+            <if test="cnt3Years != null">#{cnt3Years},</if>
103
+            <if test="cnt2Years != null">#{cnt2Years},</if>
104
+            <if test="cnt1Years != null">#{cnt1Years},</if>
105
+            <if test="cntLt1Year != null">#{cntLt1Year},</if>
106
+        </trim>
107
+    </insert>
108
+
109
+    <update id="updateBlockedBootPersonnelTenure" parameterType="BlockedBootPersonnelTenure">
110
+        update blocked_boot_personnel_tenure
111
+        <trim prefix="SET" suffixOverrides=",">
112
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
113
+            <if test="revision != null">revision = #{revision},</if>
114
+            <if test="createBy != null">create_by = #{createBy},</if>
115
+            <if test="createTime != null">create_time = #{createTime},</if>
116
+            <if test="updateBy != null">update_by = #{updateBy},</if>
117
+            <if test="updateTime != null">update_time = #{updateTime},</if>
118
+            <if test="remark != null">remark = #{remark},</if>
119
+            <if test="brigadeId != null">brigade_id = #{brigadeId},</if>
120
+            <if test="brigadeName != null and brigadeName != ''">brigade_name = #{brigadeName},</if>
121
+            <if test="cntGe5Year != null">cnt_ge_5_year = #{cntGe5Year},</if>
122
+            <if test="cnt4Years != null">cnt_4_years = #{cnt4Years},</if>
123
+            <if test="cnt3Years != null">cnt_3_years = #{cnt3Years},</if>
124
+            <if test="cnt2Years != null">cnt_2_years = #{cnt2Years},</if>
125
+            <if test="cnt1Years != null">cnt_1_years = #{cnt1Years},</if>
126
+            <if test="cntLt1Year != null">cnt_lt_1_year = #{cntLt1Year},</if>
127
+        </trim>
128
+        where id = #{id}
129
+    </update>
130
+
131
+    <delete id="deleteBlockedBootPersonnelTenureById" parameterType="Long">
132
+        delete
133
+        from blocked_boot_personnel_tenure
134
+        where id = #{id}
135
+    </delete>
136
+
137
+    <delete id="deleteBlockedBootPersonnelTenureByIds" parameterType="String">
138
+        delete from blocked_boot_personnel_tenure where id in
139
+        <foreach item="id" collection="array" open="(" separator="," close=")">
140
+            #{id}
141
+        </foreach>
142
+    </delete>
143
+</mapper>

+ 7 - 0
airport-blocked/src/main/resources/mapper/blocked/BlockedRateScreenMapper.xml

@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.sundot.airport.blocked.mapper.BlockedRateScreenMapper">
6
+
7
+</mapper>

+ 41 - 0
airport-common/src/main/java/com/sundot/airport/common/core/domain/BaseScreenQueryParamDto.java

@@ -0,0 +1,41 @@
1
+package com.sundot.airport.common.core.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import lombok.Data;
5
+import org.springframework.format.annotation.DateTimeFormat;
6
+
7
+import java.io.Serializable;
8
+import java.util.Date;
9
+
10
+/**
11
+ * 大屏查询基础参数
12
+ *
13
+ * @author ruoyi
14
+ */
15
+@Data
16
+public class BaseScreenQueryParamDto implements Serializable {
17
+
18
+    private static final long serialVersionUID = 1L;
19
+
20
+    /**
21
+     * 指定日期
22
+     */
23
+    @JsonFormat(pattern = "yyyy-MM-dd")
24
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
25
+    private Date specifiedDate;
26
+
27
+    /**
28
+     * 开始日期
29
+     */
30
+    @JsonFormat(pattern = "yyyy-MM-dd")
31
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
32
+    private Date startDate;
33
+
34
+    /**
35
+     * 结束日期
36
+     */
37
+    @JsonFormat(pattern = "yyyy-MM-dd")
38
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
39
+    private Date endDate;
40
+
41
+}

+ 23 - 0
airport-common/src/main/java/com/sundot/airport/common/core/domain/BlockedRateQueryParamDto.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 BlockedRateQueryParamDto extends BaseScreenQueryParamDto {
12
+
13
+    /**
14
+     * 大队ID
15
+     */
16
+    private Long brigadeId;
17
+
18
+    /**
19
+     * 大队名称
20
+     */
21
+    private String brigadeName;
22
+
23
+}

+ 81 - 0
airport-common/src/main/java/com/sundot/airport/common/utils/BlockedDateUtils.java

@@ -0,0 +1,81 @@
1
+package com.sundot.airport.common.utils;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Calendar;
5
+import java.util.Date;
6
+import java.util.List;
7
+
8
+/**
9
+ * 日期工具类
10
+ */
11
+public class BlockedDateUtils {
12
+
13
+    /**
14
+     * 生成从开始日期到结束日期(含)的所有日期列表(时间部分为00:00:00)
15
+     * @param startDate 开始日期
16
+     * @param endDate 结束日期
17
+     * @return 日期列表(按升序排列)
18
+     */
19
+    public static List<Date> generateDateList(Date startDate, Date endDate) {
20
+        List<Date> dateList = new ArrayList<>();
21
+        if (startDate == null || endDate == null || startDate.after(endDate)) {
22
+            return dateList; // 无效输入返回空列表
23
+        }
24
+
25
+        // 创建Calendar实例并标准化时间
26
+        Calendar startCal = Calendar.getInstance();
27
+        startCal.setTime(startDate);
28
+        setTimeToMidnight(startCal);
29
+
30
+        Calendar endCal = Calendar.getInstance();
31
+        endCal.setTime(endDate);
32
+        setTimeToMidnight(endCal);
33
+
34
+        // 遍历日期范围
35
+        while (!startCal.after(endCal)) {
36
+            dateList.add(startCal.getTime()); // 添加当前日期
37
+            startCal.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
38
+        }
39
+        return dateList;
40
+    }
41
+
42
+    /**
43
+     * 将Calendar的时间部分设置为00:00:00.000
44
+     */
45
+    private static void setTimeToMidnight(Calendar calendar) {
46
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
47
+        calendar.set(Calendar.MINUTE, 0);
48
+        calendar.set(Calendar.SECOND, 0);
49
+        calendar.set(Calendar.MILLISECOND, 0);
50
+    }
51
+
52
+    /**
53
+     *  当前日期(时间部分为 00:00:00)
54
+     */
55
+    public static Date getCurrentDate() {
56
+        Calendar cal = Calendar.getInstance();
57
+        resetTimeFields(cal);
58
+        return cal.getTime();
59
+    }
60
+
61
+    /**
62
+     *  本年度 1 月 1 日(时间部分为 00:00:00)
63
+     */
64
+    public static Date getFirstDayOfYear() {
65
+        Calendar cal = Calendar.getInstance();
66
+        cal.set(Calendar.DAY_OF_YEAR, 1);  // 设置为当年第一天
67
+        resetTimeFields(cal);
68
+        return cal.getTime();
69
+    }
70
+
71
+    /**
72
+     * 重置Calendar的时间字段(秒毫秒)
73
+     */
74
+    private static void resetTimeFields(Calendar cal) {
75
+        cal.set(Calendar.HOUR_OF_DAY, 0);
76
+        cal.set(Calendar.MINUTE, 0);
77
+        cal.set(Calendar.SECOND, 0);
78
+        cal.set(Calendar.MILLISECOND, 0);
79
+    }
80
+
81
+}

+ 2 - 0
airport-item/src/main/java/com/sundot/airport/item/mapper/SeizureReportMapper.java

@@ -441,4 +441,6 @@ public interface SeizureReportMapper {
441 441
     public List<ItemLargeScreenHomePageSeizureReportSqlDto> homePageSeizureReport(BaseLargeScreenQueryParamDto dto);
442 442
 
443 443
     List<ItemLargeScreenHomePageSeizureReportSqlDto> homePageSeizureReportBrigadeId(BaseLargeScreenQueryParamDto dto);
444
+
445
+    List<ItemLargeScreenHomePageSeizureReportSqlDto> homePageSeizureReportDepartmentId(BaseLargeScreenQueryParamDto dto);
444 446
 }

+ 50 - 0
airport-item/src/main/java/com/sundot/airport/item/service/SeizureDistributionService.java

@@ -256,11 +256,14 @@ public class SeizureDistributionService {
256 256
 
257 257
         // 获取该站点下的所有大队
258 258
         List<SysDept> brigades = getBrigadesByStation(dto.getInspectStationId());
259
+        // 获取该站点下的所有科室
260
+        List<SysDept> departments = getDepartmentsByStation(dto.getInspectStationId());
259 261
 
260 262
         // 构建所有分组:先添加站级,再添加大队级
261 263
         List<SysDept> allGroups = new ArrayList<>();
262 264
         allGroups.add(stationDept); // 添加站级
263 265
         allGroups.addAll(brigades); // 添加大队级
266
+        allGroups.addAll(departments); // 添加科室级
264 267
 
265 268
         // 获取查获数量数据
266 269
         List<SeizureLargeScreenHomePageItemDto> seizureReportList = getSeizureDataForStation(dto.getDeptId(), dto.getStartDate(), dto.getEndDate());
@@ -288,6 +291,13 @@ public class SeizureDistributionService {
288 291
             groupedQuantities.put(dept.getDeptName(), deptQuantities);
289 292
         }
290 293
 
294
+        // 然后处理科室级数据
295
+        for (SysDept dept : departments) {
296
+            List<SeizureLargeScreenHomePageItemDto> departmentSeizureReportList = getSeizureDataForDepartment(dept.getDeptId(), dto.getStartDate(), dto.getEndDate());
297
+            List<BigDecimal> deptQuantities = departmentSeizureReportList.stream().map(SeizureLargeScreenHomePageItemDto::getQuantity).filter(Objects::nonNull).collect(Collectors.toList());
298
+            groupedQuantities.put(dept.getDeptName(), deptQuantities);
299
+        }
300
+
291 301
         // 为每个分组计算箱线图数据
292 302
         List<GroupedBoxPlotDataDto> result = new ArrayList<>();
293 303
 
@@ -420,4 +430,44 @@ public class SeizureDistributionService {
420 430
             return lowerValue.add(upperValue.subtract(lowerValue).multiply(BigDecimal.valueOf(fraction)));
421 431
         }
422 432
     }
433
+
434
+    /**
435
+     * 获取指定站点下的所有科室
436
+     *
437
+     * @param stationDeptId 站点部门ID
438
+     * @return 大队列表
439
+     */
440
+    private List<SysDept> getDepartmentsByStation(Long stationDeptId) {
441
+        if (stationDeptId == null) {
442
+            return Collections.emptyList();
443
+        }
444
+
445
+        // 查询站点下的所有子部门
446
+        List<SysDept> childrenDepts = sysDeptService.selectChildrenDeptById(stationDeptId);
447
+
448
+        // 过滤出大队级别的部门
449
+        return childrenDepts.stream()
450
+                .filter(dept -> DeptTypeEnum.MANAGER.getCode().equals(dept.getDeptType()))
451
+                .collect(Collectors.toList());
452
+    }
453
+
454
+    /**
455
+     * 获取指定科室的查获数据(科室级别)
456
+     *
457
+     * @param departmentId 科室ID
458
+     * @param startDate 开始日期
459
+     * @param endDate   结束日期
460
+     * @return 科室级别查获数据列表
461
+     */
462
+    private List<SeizureLargeScreenHomePageItemDto> getSeizureDataForDepartment(Long departmentId, Date startDate, Date endDate) {
463
+        if (departmentId == null) {
464
+            return Collections.emptyList();
465
+        }
466
+        // 创建查询参数
467
+        BaseLargeScreenQueryParamDto dto = new BaseLargeScreenQueryParamDto();
468
+        dto.setInspectDepartmentId(departmentId);
469
+        dto.setStartDate(startDate);
470
+        dto.setEndDate(DateUtils.addDays(endDate, 1));
471
+        return seizureReportService.getSeizureLargeScreenHomePinspectBrigadeIdList(dto);
472
+    }
423 473
 }

+ 55 - 1
airport-item/src/main/java/com/sundot/airport/item/service/impl/ItemLargeScreenServiceImpl.java

@@ -663,6 +663,25 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
663 663
                     upperBound = boxPlotData.getUpperBound();
664 664
                 }
665 665
             }
666
+        } else if (dto.getInspectDepartmentId() != null) {
667
+            // 根据 id 获取部门信息
668
+            SysDept dept = sysDeptService.selectDeptById(dto.getInspectDepartmentId());
669
+            if (Objects.isNull(dept)) {
670
+                return Collections.emptyList();
671
+            }
672
+
673
+            // 查找匹配的分组数据
674
+            Optional<GroupedBoxPlotDataDto> matchedGroup = boxPlotDataList.stream()
675
+                    .filter(grouped -> Objects.equals(grouped.getGroupName(), dept.getDeptName()))
676
+                    .findFirst();
677
+
678
+            if (matchedGroup.isPresent()) {
679
+                BoxPlotDataDto boxPlotData = matchedGroup.get().getBoxPlotData();
680
+                if (Objects.nonNull(boxPlotData)) {
681
+                    lowerBound = boxPlotData.getLowerBound();
682
+                    upperBound = boxPlotData.getUpperBound();
683
+                }
684
+            }
666 685
         } else {
667 686
             GroupedBoxPlotDataDto firstGroup = boxPlotDataList.get(0);
668 687
             if (Objects.nonNull(firstGroup) && Objects.nonNull(firstGroup.getBoxPlotData())) {
@@ -681,6 +700,10 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
681 700
             // 有大队 ID,查询大队数据
682 701
             seizureReportList = seizureReportMapper.homePageSeizureReportBrigadeId(dto);
683 702
             userInfoList = sysUserService.homePageUserInfoByBrigadeId(dto.getInspectBrigadeId());
703
+        } else if (dto.getInspectDepartmentId() != null) {
704
+            // 有科室 ID,查询科室数据
705
+            seizureReportList = seizureReportMapper.homePageSeizureReportDepartmentId(dto);
706
+            userInfoList = sysUserService.homePageUserInfoByDepartmentId(dto.getInspectDepartmentId());
684 707
         } else {
685 708
             // 无大队 ID,查询全站数据
686 709
             seizureReportList = seizureReportMapper.homePageSeizureReport(dto);
@@ -704,6 +727,10 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
704 727
         for (LargeScreenHomePageUserInfoSqlDto userInfo : userInfoList) {
705 728
             BigDecimal totalQuantity = userSeizureMap.getOrDefault(userInfo.getUserId(), BigDecimal.ZERO);
706 729
 
730
+            if (lowerBound == null || upperBound == null) {
731
+                continue;
732
+            }
733
+
707 734
             // 判断是否为异常值
708 735
             if (totalQuantity.compareTo(lowerBound) < 0 || totalQuantity.compareTo(upperBound) > 0) {
709 736
                 ItemAbnormalSeizureDto abnormalDto = new ItemAbnormalSeizureDto();
@@ -759,6 +786,25 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
759 786
                     upperBound = boxPlotData.getUpperBound();
760 787
                 }
761 788
             }
789
+        } else if (dto.getInspectDepartmentId() != null) {
790
+            // 根据 id 获取部门信息
791
+            SysDept dept = sysDeptService.selectDeptById(dto.getInspectDepartmentId());
792
+            if (Objects.isNull(dept)) {
793
+                return result;
794
+            }
795
+
796
+            // 查找匹配的分组数据
797
+            Optional<GroupedBoxPlotDataDto> matchedGroup = boxPlotDataList.stream()
798
+                    .filter(grouped -> Objects.equals(grouped.getGroupName(), dept.getDeptName()))
799
+                    .findFirst();
800
+
801
+            if (matchedGroup.isPresent()) {
802
+                BoxPlotDataDto boxPlotData = matchedGroup.get().getBoxPlotData();
803
+                if (Objects.nonNull(boxPlotData)) {
804
+                    lowerBound = boxPlotData.getLowerBound();
805
+                    upperBound = boxPlotData.getUpperBound();
806
+                }
807
+            }
762 808
         } else {
763 809
             GroupedBoxPlotDataDto firstGroup = boxPlotDataList.get(0);
764 810
             if (Objects.nonNull(firstGroup) && Objects.nonNull(firstGroup.getBoxPlotData())) {
@@ -772,10 +818,14 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
772 818
         List<ItemLargeScreenHomePageSeizureReportSqlDto> seizureReportList;
773 819
         List<LargeScreenHomePageUserInfoSqlDto> userInfoList;
774 820
 
775
-        if (dto.getInspectDepartmentId() != null) {
821
+        if (dto.getInspectBrigadeId() != null) {
776 822
             // 有大队 ID,查询大队数据
777 823
             seizureReportList = seizureReportMapper.homePageSeizureReportBrigadeId(dto);
778 824
             userInfoList = sysUserService.homePageUserInfoByBrigadeId(dto.getInspectBrigadeId());
825
+        } else if (dto.getInspectDepartmentId() != null) {
826
+            // 有科室 ID,查询科室数据
827
+            seizureReportList = seizureReportMapper.homePageSeizureReportDepartmentId(dto);
828
+            userInfoList = sysUserService.homePageUserInfoByDepartmentId(dto.getInspectDepartmentId());
779 829
         } else {
780 830
             // 无大队 ID,查询全站数据
781 831
             seizureReportList = seizureReportMapper.homePageSeizureReport(dto);
@@ -800,6 +850,10 @@ public class ItemLargeScreenServiceImpl implements ItemLargeScreenService {
800 850
         for (LargeScreenHomePageUserInfoSqlDto userInfo : userInfoList) {
801 851
             BigDecimal totalQuantity = userSeizureMap.getOrDefault(userInfo.getUserId(), BigDecimal.ZERO);
802 852
 
853
+            if (lowerBound == null || upperBound == null) {
854
+                continue;
855
+            }
856
+
803 857
             // 判断是否为异常值
804 858
             if (totalQuantity.compareTo(upperBound) > 0) {
805 859
                 // 显著高于

+ 17 - 0
airport-item/src/main/resources/mapper/item/SeizureReportMapper.xml

@@ -790,4 +790,21 @@
790 790
             and isr.inspect_brigade_id = #{inspectBrigadeId}
791 791
         </if>
792 792
     </select>
793
+
794
+    <select id="homePageSeizureReportDepartmentId"
795
+            resultType="com.sundot.airport.item.domain.ItemLargeScreenHomePageSeizureReportSqlDto">
796
+        select isr.inspect_user_id userId,
797
+        isr.inspect_user_name userName,
798
+        isi.quantity quantity
799
+        from item_seizure_record isr
800
+        left join item_seizure_items isi on isr.id = isi.record_id
801
+        where 1 = 1
802
+        and isr.process_status = 3
803
+        <if test="startDate != null and endDate != null">
804
+            AND isr.create_time BETWEEN #{startDate} AND #{endDate}
805
+        </if>
806
+        <if test="inspectDepartmentId != null">
807
+            and isr.inspect_department_id = #{inspectDepartmentId}
808
+        </if>
809
+    </select>
793 810
 </mapper>

+ 8 - 0
airport-system/src/main/java/com/sundot/airport/system/mapper/SysUserMapper.java

@@ -246,4 +246,12 @@ public interface SysUserMapper {
246 246
      * @return 用户信息列表
247 247
      */
248 248
     public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByBrigadeId(@Param("brigadeId") Long brigadeId);
249
+
250
+    /**
251
+     * 首页 - 用户信息(按科室 ID 筛选)
252
+     *
253
+     * @param departmentId 科室 ID
254
+     * @return 用户信息列表
255
+     */
256
+    public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByDepartmentId(@Param("departmentId") Long departmentId);
249 257
 }

+ 8 - 0
airport-system/src/main/java/com/sundot/airport/system/service/ISysUserService.java

@@ -336,4 +336,12 @@ public interface ISysUserService {
336 336
      * @return 用户信息列表
337 337
      */
338 338
     public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByBrigadeId(Long brigadeId);
339
+
340
+    /**
341
+     * 首页 - 用户信息(按科室 ID 筛选)
342
+     *
343
+     * @param departmentId 科室 ID
344
+     * @return 用户信息列表
345
+     */
346
+    public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByDepartmentId(Long departmentId);
339 347
 }

+ 5 - 0
airport-system/src/main/java/com/sundot/airport/system/service/impl/SysUserServiceImpl.java

@@ -1244,4 +1244,9 @@ public class SysUserServiceImpl implements ISysUserService {
1244 1244
     public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByBrigadeId(Long brigadeId) {
1245 1245
         return userMapper.homePageUserInfoByBrigadeId(brigadeId);
1246 1246
     }
1247
+
1248
+    @Override
1249
+    public List<LargeScreenHomePageUserInfoSqlDto> homePageUserInfoByDepartmentId(Long departmentId) {
1250
+        return userMapper.homePageUserInfoByDepartmentId(departmentId);
1251
+    }
1247 1252
 }

+ 25 - 0
airport-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -1158,4 +1158,29 @@
1158 1158
           and sr.role_key in ('banzuzhang', 'SecurityCheck')
1159 1159
           and sd_dd.dept_id = #{brigadeId}
1160 1160
     </select>
1161
+
1162
+    <select id="homePageUserInfoByDepartmentId"
1163
+            resultType="com.sundot.airport.common.core.domain.LargeScreenHomePageUserInfoSqlDto">
1164
+        select su.user_id      userId,
1165
+               su.user_name    userName,
1166
+               su.nick_name    nickName,
1167
+               sd_bz.dept_id   teamId,
1168
+               sd_bz.dept_name teamName,
1169
+               sd_ks.dept_id   departmentId,
1170
+               sd_ks.dept_name departmentName,
1171
+               sd_dd.dept_id   brigadeId,
1172
+               sd_dd.dept_name brigadeName,
1173
+               sd_zj.dept_id   stationId,
1174
+               sd_zj.dept_name stationName
1175
+        from sys_user su
1176
+                 inner join sys_user_role sur on sur.user_id = su.user_id
1177
+                 inner join sys_role sr on sr.role_id = sur.role_id
1178
+                 inner join sys_dept sd_bz on sd_bz.dept_id = su.dept_id
1179
+                 inner join sys_dept sd_ks on sd_ks.dept_id = sd_bz.parent_id
1180
+                 inner join sys_dept sd_dd on sd_dd.dept_id = sd_ks.parent_id
1181
+                 inner join sys_dept sd_zj on sd_zj.dept_id = sd_dd.parent_id
1182
+        where 1 = 1
1183
+          and sr.role_key in ('banzuzhang', 'SecurityCheck')
1184
+          and sd_ks.dept_id = #{departmentId}
1185
+    </select>
1161 1186
 </mapper>