Selaa lähdekoodia

设备定/自检

wangxx 1 kuukausi sitten
vanhempi
commit
1803f63abe

+ 56 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/equipment/EquipmentSelfInspectionRecordController.java

@@ -0,0 +1,56 @@
1
+package com.sundot.airport.web.controller.equipment;
2
+
3
+import java.util.List;
4
+
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.security.access.prepost.PreAuthorize;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.RequestMapping;
9
+import org.springframework.web.bind.annotation.RestController;
10
+import com.sundot.airport.common.core.controller.BaseController;
11
+import com.sundot.airport.common.core.domain.AjaxResult;
12
+import com.sundot.airport.equipment.domain.EquipmentLedger;
13
+import com.sundot.airport.equipment.service.IEquipmentLedgerService;
14
+
15
+/**
16
+ * 设备定/自检
17
+ *
18
+ * @author wangxx
19
+ * @date 2026-05-12
20
+ */
21
+@RestController
22
+@RequestMapping("/equipment/self")
23
+public class EquipmentSelfInspectionRecordController extends BaseController {
24
+    @Autowired
25
+    private IEquipmentLedgerService equipmentLedgerService;
26
+
27
+    /**
28
+     * 查询定/自检到期日期已过期的设备列表
29
+     */
30
+    @PreAuthorize("@ss.hasPermi('equipment:self:list')")
31
+    @GetMapping("/expired/list")
32
+    public AjaxResult getExpiredInspectionList() {
33
+        List<EquipmentLedger> list = equipmentLedgerService.selectExpiredInspectionList();
34
+        return success(list);
35
+    }
36
+
37
+    /**
38
+     * 查询一月内定/自检到期的设备列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('equipment:self:list')")
41
+    @GetMapping("/upcoming/list")
42
+    public AjaxResult getUpcomingInspectionList() {
43
+        List<EquipmentLedger> list = equipmentLedgerService.selectUpcomingInspectionList();
44
+        return success(list);
45
+    }
46
+
47
+    /**
48
+     * 查询两周内定/自检到期的设备列表
49
+     */
50
+    @PreAuthorize("@ss.hasPermi('equipment:self:list')")
51
+    @GetMapping("/two-weeks-upcoming/list")
52
+    public AjaxResult getTwoWeeksUpcomingInspectionList() {
53
+        List<EquipmentLedger> list = equipmentLedgerService.selectTwoWeeksUpcomingInspectionList();
54
+        return success(list);
55
+    }
56
+}

+ 21 - 0
airport-equipment/src/main/java/com/sundot/airport/equipment/mapper/EquipmentLedgerMapper.java

@@ -59,4 +59,25 @@ public interface EquipmentLedgerMapper extends BaseMapper<EquipmentLedger> {
59 59
      * @return 结果
60 60
      */
61 61
     public int deleteEquipmentLedgerByIds(Long[] ids);
62
+
63
+    /**
64
+     * 查询定/自检到期日期已过期的设备列表
65
+     *
66
+     * @return 设备台账集合
67
+     */
68
+    public List<EquipmentLedger> selectExpiredInspectionList();
69
+
70
+    /**
71
+     * 查询一月内定/自检到期的设备列表
72
+     *
73
+     * @return 设备台账集合
74
+     */
75
+    public List<EquipmentLedger> selectUpcomingInspectionList();
76
+
77
+    /**
78
+     * 查询两周内定/自检到期的设备列表
79
+     *
80
+     * @return 设备台账集合
81
+     */
82
+    public List<EquipmentLedger> selectTwoWeeksUpcomingInspectionList();
62 83
 }

+ 21 - 0
airport-equipment/src/main/java/com/sundot/airport/equipment/service/IEquipmentLedgerService.java

@@ -59,4 +59,25 @@ public interface IEquipmentLedgerService extends IService<EquipmentLedger> {
59 59
      * @return 结果
60 60
      */
61 61
     public int deleteEquipmentLedgerById(Long id);
62
+
63
+    /**
64
+     * 查询定/自检到期日期已过期的设备列表
65
+     *
66
+     * @return 设备台账集合
67
+     */
68
+    public List<EquipmentLedger> selectExpiredInspectionList();
69
+
70
+    /**
71
+     * 查询一月内定/自检到期的设备列表
72
+     *
73
+     * @return 设备台账集合
74
+     */
75
+    public List<EquipmentLedger> selectUpcomingInspectionList();
76
+
77
+    /**
78
+     * 查询两周内定/自检到期的设备列表
79
+     *
80
+     * @return 设备台账集合
81
+     */
82
+    public List<EquipmentLedger> selectTwoWeeksUpcomingInspectionList();
62 83
 }

+ 30 - 0
airport-equipment/src/main/java/com/sundot/airport/equipment/service/impl/EquipmentLedgerServiceImpl.java

@@ -214,4 +214,34 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
214 214
         }
215 215
         return result;
216 216
     }
217
+
218
+    /**
219
+     * 查询定/自检到期日期已过期的设备列表
220
+     *
221
+     * @return 设备台账集合
222
+     */
223
+    @Override
224
+    public List<EquipmentLedger> selectExpiredInspectionList() {
225
+        return equipmentLedgerMapper.selectExpiredInspectionList();
226
+    }
227
+
228
+    /**
229
+     * 查询一月内定/自检到期的设备列表
230
+     *
231
+     * @return 设备台账集合
232
+     */
233
+    @Override
234
+    public List<EquipmentLedger> selectUpcomingInspectionList() {
235
+        return equipmentLedgerMapper.selectUpcomingInspectionList();
236
+    }
237
+
238
+    /**
239
+     * 查询两周内定/自检到期的设备列表
240
+     *
241
+     * @return 设备台账集合
242
+     */
243
+    @Override
244
+    public List<EquipmentLedger> selectTwoWeeksUpcomingInspectionList() {
245
+        return equipmentLedgerMapper.selectTwoWeeksUpcomingInspectionList();
246
+    }
217 247
 }

+ 23 - 0
airport-equipment/src/main/resources/mapper/equipment/EquipmentLedgerMapper.xml

@@ -266,4 +266,27 @@
266 266
             #{id}
267 267
         </foreach>
268 268
     </delete>
269
+
270
+    <select id="selectExpiredInspectionList" resultMap="EquipmentLedgerResult">
271
+        <include refid="selectEquipmentLedgerVo"/>
272
+        where next_inspection_due_date &lt; NOW()
273
+        and next_inspection_due_date is not null
274
+        order by next_inspection_due_date asc
275
+    </select>
276
+
277
+    <select id="selectUpcomingInspectionList" resultMap="EquipmentLedgerResult">
278
+        <include refid="selectEquipmentLedgerVo"/>
279
+        where next_inspection_due_date &gt;= NOW()
280
+        and next_inspection_due_date &lt;= DATE_ADD(NOW(), INTERVAL 30 DAY)
281
+        and next_inspection_due_date is not null
282
+        order by next_inspection_due_date asc
283
+    </select>
284
+
285
+    <select id="selectTwoWeeksUpcomingInspectionList" resultMap="EquipmentLedgerResult">
286
+        <include refid="selectEquipmentLedgerVo"/>
287
+        where next_inspection_due_date &gt;= NOW()
288
+        and next_inspection_due_date &lt;= DATE_ADD(NOW(), INTERVAL 14 DAY)
289
+        and next_inspection_due_date is not null
290
+        order by next_inspection_due_date asc
291
+    </select>
269 292
 </mapper>