ソースを参照

格式化代码

chenshudong 4 ヶ月 前
コミット
febbc503a6
共有34 個のファイルを変更した658 個の追加482 個の削除を含む
  1. 4 2
      airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceAreaController.java
  2. 43 47
      airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendancePostRecordController.java
  3. 3 3
      airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceRecordController.java
  4. 16 23
      airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceTeamUserRecordController.java
  5. 1 1
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendanceArea.java
  6. 0 1
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendancePostRecord.java
  7. 29 13
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendanceTeamUserRecord.java
  8. 6 6
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/StationDeptWorkStats.java
  9. 7 3
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/WorkDateStats.java
  10. 7 3
      airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/WorkHoursStats.java
  11. 1 1
      airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordCountDetailDTO.java
  12. 1 1
      airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordCountRegionDTO.java
  13. 0 3
      airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordTerminlCountDetailDTO.java
  14. 1 1
      airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendanceAreaMapper.java
  15. 17 13
      airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendancePostRecordMapper.java
  16. 13 12
      airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendanceTeamUserRecordMapper.java
  17. 12 6
      airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/AttendanceModuleIndicatorResult.java
  18. 9 9
      airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/AttendanceModuleIndicatorService.java
  19. 12 10
      airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/StationWorkStatsService.java
  20. 3 3
      airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/WorkingDateIndicator.java
  21. 3 3
      airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/WorkingHoursIndicator.java
  22. 1 2
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/AttendanceAreaService.java
  23. 15 9
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendancePostRecordService.java
  24. 5 4
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendanceRecordService.java
  25. 12 10
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendanceTeamUserRecordService.java
  26. 2 0
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceAreaServiceImpl.java
  27. 17 15
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendancePostRecordServiceImpl.java
  28. 12 21
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceRecordServiceImpl.java
  29. 27 32
      airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceTeamUserRecordServiceImpl.java
  30. 25 12
      airport-attendance/src/main/resources/mapper/attendance/AttendanceAreaMapper.xml
  31. 52 31
      airport-attendance/src/main/resources/mapper/attendance/AttendanceCheckRecordMapper.xml
  32. 144 87
      airport-attendance/src/main/resources/mapper/attendance/AttendancePostRecordMapper.xml
  33. 85 53
      airport-attendance/src/main/resources/mapper/attendance/AttendanceRecordMapper.xml
  34. 73 42
      airport-attendance/src/main/resources/mapper/attendance/AttendanceTeamUserRecordMapper.xml

+ 4 - 2
airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceAreaController.java

@@ -21,6 +21,7 @@ public class AttendanceAreaController extends BaseController {
21 21
 
22 22
     /**
23 23
      * 查询是否在考勤范围
24
+     *
24 25
      * @param lng 经度
25 26
      * @param lat 纬度
26 27
      * @return
@@ -28,7 +29,7 @@ public class AttendanceAreaController extends BaseController {
28 29
     @PostMapping("/check-in")
29 30
     public AjaxResult checkUserInValidArea(@RequestParam BigDecimal lng,
30 31
                                            @RequestParam BigDecimal lat) {
31
-        List<AttendanceArea> validAreas =  attendanceService.checkUserInValidArea(lng, lat);
32
+        List<AttendanceArea> validAreas = attendanceService.checkUserInValidArea(lng, lat);
32 33
         if (CollectionUtil.isEmpty(validAreas)) {
33 34
             return AjaxResult.error("不在任何考勤范围内");
34 35
         }
@@ -37,11 +38,12 @@ public class AttendanceAreaController extends BaseController {
37 38
 
38 39
     /**
39 40
      * 考勤打卡列表
41
+     *
40 42
      * @return
41 43
      */
42 44
     @PostMapping("/list")
43 45
     public AjaxResult areaList() {
44
-        List<AttendanceArea> validAreas =  attendanceService.areaList();
46
+        List<AttendanceArea> validAreas = attendanceService.areaList();
45 47
         if (CollectionUtil.isEmpty(validAreas)) {
46 48
             return AjaxResult.error("没有考勤范围");
47 49
         }

+ 43 - 47
airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendancePostRecordController.java

@@ -80,9 +80,6 @@ public class AttendancePostRecordController extends BaseController {
80 80
     private ISysConfigService configService;
81 81
 
82 82
 
83
-
84
-
85
-
86 83
     /**
87 84
      * 查询上岗记录列表
88 85
      */
@@ -135,11 +132,11 @@ public class AttendancePostRecordController extends BaseController {
135 132
 
136 133
         // 获取当前用户的所有班次代码
137 134
         List<String> shiftCodes = userRecords.stream()
138
-            .map(AttendancePostRecord::getShiftCode)
139
-            .filter(Objects::nonNull)
140
-            .filter(code -> !code.isEmpty())
141
-            .distinct()
142
-            .collect(Collectors.toList());
135
+                .map(AttendancePostRecord::getShiftCode)
136
+                .filter(Objects::nonNull)
137
+                .filter(code -> !code.isEmpty())
138
+                .distinct()
139
+                .collect(Collectors.toList());
143 140
 
144 141
         // 如果没有班次信息,返回空结果
145 142
         if (shiftCodes.isEmpty()) {
@@ -151,8 +148,8 @@ public class AttendancePostRecordController extends BaseController {
151 148
 
152 149
         // 按 shift_code 分组,并转换为数组格式
153 150
         Map<String, List<AttendancePostRecord>> groupedByShift = allShiftRecords.stream()
154
-            .filter(record -> record.getShiftCode() != null && !record.getShiftCode().isEmpty())
155
-            .collect(Collectors.groupingBy(AttendancePostRecord::getShiftCode));
151
+                .filter(record -> record.getShiftCode() != null && !record.getShiftCode().isEmpty())
152
+                .collect(Collectors.groupingBy(AttendancePostRecord::getShiftCode));
156 153
 
157 154
         // 转换为数组格式
158 155
         List<Map<String, Object>> result = new ArrayList<>();
@@ -162,10 +159,10 @@ public class AttendancePostRecordController extends BaseController {
162 159
             shiftGroup.put("records", records);
163 160
             // 获取该班次中最早的签到时间用于排序
164 161
             Date earliestCheckInTime = records.stream()
165
-                .map(AttendancePostRecord::getCheckInTime)
166
-                .filter(Objects::nonNull)
167
-                .min(Date::compareTo)
168
-                .orElse(new Date());
162
+                    .map(AttendancePostRecord::getCheckInTime)
163
+                    .filter(Objects::nonNull)
164
+                    .min(Date::compareTo)
165
+                    .orElse(new Date());
169 166
             shiftGroup.put("earliestCheckInTime", earliestCheckInTime);
170 167
             result.add(shiftGroup);
171 168
         });
@@ -191,30 +188,30 @@ public class AttendancePostRecordController extends BaseController {
191 188
     public AjaxResult getLocationsByTime(@RequestBody Map<String, String> requestBody) {
192 189
         try {
193 190
             Long currentUserId = SecurityUtils.getUserId();
194
-            
191
+
195 192
             // 从请求体中获取时间参数
196 193
             String searchTime = requestBody.get("searchtime");
197 194
             if (StringUtils.isEmpty(searchTime)) {
198 195
                 return AjaxResult.error("请提供 searchtime 参数");
199 196
             }
200
-            
197
+
201 198
             // 解析时间参数
202 199
             Date queryTime = DateUtil.parse(searchTime, "yyyy-MM-dd HH:mm:ss");
203
-            
200
+
204 201
             // 打印调试信息
205 202
             System.out.println("=== 调试信息 ===");
206 203
             System.out.println("当前用户ID: " + currentUserId);
207 204
             System.out.println("查询时间参数: " + searchTime);
208 205
             System.out.println("解析后的时间: " + queryTime);
209 206
             System.out.println("时间戳: " + queryTime.getTime());
210
-            
207
+
211 208
             List<AttendancePostRecord> locations = attendancePostRecordService.selectLocationsByTime(currentUserId, queryTime);
212
-            
209
+
213 210
             System.out.println("查询结果数量: " + locations.size());
214 211
             System.out.println("===============");
215
-            
212
+
216 213
             return AjaxResult.success(locations);
217
-            
214
+
218 215
         } catch (Exception e) {
219 216
             System.out.println("接口异常: " + e.getMessage());
220 217
             return AjaxResult.error("时间格式错误,请使用 yyyy-MM-dd HH:mm:ss 格式");
@@ -369,7 +366,7 @@ public class AttendancePostRecordController extends BaseController {
369 366
             count.addAndGet(attendancePostRecordService.insertAttendancePostRecord(record));
370 367
         });
371 368
 
372
-        
369
+
373 370
         return toAjax(count.get());
374 371
     }
375 372
 
@@ -392,13 +389,13 @@ public class AttendancePostRecordController extends BaseController {
392 389
             extracted(postRecord);
393 390
             // 判断是否已签退
394 391
             LocalDateTime baseDateTime = LocalDateTime.of(2000, 1, 1, 0, 0, 0);
395
-            if(postRecord.getCheckOutTime().after(Date.from(baseDateTime.atZone(ZoneId.systemDefault()).toInstant()))){
392
+            if (postRecord.getCheckOutTime().after(Date.from(baseDateTime.atZone(ZoneId.systemDefault()).toInstant()))) {
396 393
                 postRecord.setLocked(false);
397 394
             }
398
-            count+=attendancePostRecordService.updateAttendancePostRecord(postRecord);
395
+            count += attendancePostRecordService.updateAttendancePostRecord(postRecord);
399 396
         }
400 397
 
401
-        
398
+
402 399
         return toAjax(count);
403 400
     }
404 401
 
@@ -657,7 +654,7 @@ public class AttendancePostRecordController extends BaseController {
657 654
     @PostMapping("/count")
658 655
     public AttendanceRecordCountDTO attendanceRecordCount(String regionalStatus) {
659 656
         AttendanceRecordCountDTO dto = new AttendanceRecordCountDTO();
660
-        List<String> regionalCodes =new ArrayList<>();
657
+        List<String> regionalCodes = new ArrayList<>();
661 658
         //判断是不是科长和获取用户关联的区域编码
662 659
         boolean kezhang = isKezhang(regionalStatus, regionalCodes);
663 660
         if (kezhang && CollectionUtil.isEmpty(regionalCodes)) {
@@ -696,10 +693,11 @@ public class AttendancePostRecordController extends BaseController {
696 693
 
697 694
         return dto;
698 695
     }
696
+
699 697
     /**
700 698
      * 查询是否是科长
701 699
      */
702
-    private boolean isKezhang(String regionalStatus,List<String> regionalCodes) {
700
+    private boolean isKezhang(String regionalStatus, List<String> regionalCodes) {
703 701
 
704 702
         if (!StringUtils.equals(regionalStatus, "1")) {
705 703
             return false;
@@ -718,15 +716,15 @@ public class AttendancePostRecordController extends BaseController {
718 716
         List<String> roleKeyList = roles.stream()
719 717
                 .map(SysRole::getRoleKey)
720 718
                 .collect(Collectors.toList());
721
-        if(roleKeyList.contains(RoleTypeEnum.kezhang.getCode())){
719
+        if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
722 720
             Map<String, Date> shiftTime = attendancePostRecordService.getShiftTime();
723 721
             Date shiftStartTime = shiftTime.get("start");
724 722
             Date shiftEndTime = shiftTime.get("end");
725 723
             List<AttendancePostRecord> regionalList = attendancePostRecordService
726
-                    .selectKezhangRecordCount(user.getUserId(),shiftStartTime,shiftEndTime);
727
-            regionalCodes .addAll(regionalList.stream()
724
+                    .selectKezhangRecordCount(user.getUserId(), shiftStartTime, shiftEndTime);
725
+            regionalCodes.addAll(regionalList.stream()
728 726
                     .map(AttendancePostRecord::getRegionalCode)
729
-                    .collect(Collectors.toList())) ;
727
+                    .collect(Collectors.toList()));
730 728
             return true;
731 729
         }
732 730
         return false;
@@ -744,7 +742,7 @@ public class AttendancePostRecordController extends BaseController {
744 742
         Date shiftStartTime = shiftTime.get("start");
745 743
         Date shiftEndTime = shiftTime.get("end");
746 744
         return attendancePostRecordService
747
-                .selectLocationsByTimeAndChannelName(channelCodeList, DateUtils.getNowDate(),shiftStartTime, shiftEndTime);
745
+                .selectLocationsByTimeAndChannelName(channelCodeList, DateUtils.getNowDate(), shiftStartTime, shiftEndTime);
748 746
     }
749 747
 
750 748
     /**
@@ -766,10 +764,11 @@ public class AttendancePostRecordController extends BaseController {
766 764
 
767 765
     /**
768 766
      * 构建航站楼详细统计信息
769
-     * @param terminalCode 航站楼编码
770
-     * @param channelList 通道列表
767
+     *
768
+     * @param terminalCode  航站楼编码
769
+     * @param channelList   通道列表
771 770
      * @param onDutyRecords 在岗记录
772
-     * @param maintainList 维护人员记录
771
+     * @param maintainList  维护人员记录
773 772
      * @return 航站楼详细统计信息
774 773
      */
775 774
     private AttendanceRecordTerminlCountDetailDTO buildTerminalDetail(
@@ -843,6 +842,7 @@ public class AttendancePostRecordController extends BaseController {
843 842
 
844 843
     /**
845 844
      * 构建区域详情列表
845
+     *
846 846
      * @param terminalOnDutyRecords 航站楼下的在岗记录
847 847
      */
848 848
     private List<AttendanceRecordCountRegionDTO> buildRegionDetails(
@@ -892,7 +892,7 @@ public class AttendancePostRecordController extends BaseController {
892 892
                 regionDTO.setTerminlCode(firstDetail.getTerminlCode());
893 893
                 regionDTO.setTerminlName(firstDetail.getTerminlName());
894 894
                 regionDTO.setOpenChannelCount(detailList.size());
895
-            }else {
895
+            } else {
896 896
                 regionDTO.setOpenChannelCount(0);
897 897
             }
898 898
 
@@ -994,25 +994,26 @@ public class AttendancePostRecordController extends BaseController {
994 994
 
995 995
     /**
996 996
      * 查询科长最后一次上岗记录
997
-     * @param userId   用户ID
997
+     *
998
+     * @param userId 用户ID
998 999
      */
999 1000
     @PreAuthorize("@ss.hasPermi('attendance:postRecord:query:last:time')")
1000 1001
     @GetMapping("/query-last-time")
1001
-    public AjaxResult queryLastTime( @RequestParam("userId") Long userId){
1002
+    public AjaxResult queryLastTime(@RequestParam("userId") Long userId) {
1002 1003
         return AjaxResult.success(attendancePostRecordService.queryLastTime(userId));
1003 1004
     }
1004 1005
 
1005 1006
     /**
1006 1007
      * 查询当前班次下所有科长上岗记录
1008
+     *
1007 1009
      * @return
1008 1010
      */
1009 1011
     @GetMapping("/queryKeIds")
1010
-    public AjaxResult queryKeIds( ){
1012
+    public AjaxResult queryKeIds() {
1011 1013
         return AjaxResult.success(attendancePostRecordService.queryKeIds());
1012 1014
     }
1013 1015
 
1014 1016
 
1015
-
1016 1017
     /**
1017 1018
      * 根据当前时间确定所属班次日期
1018 1019
      * 班次周期:每日9:00到次日10:00
@@ -1054,9 +1055,9 @@ public class AttendancePostRecordController extends BaseController {
1054 1055
     }
1055 1056
 
1056 1057
 
1057
-
1058 1058
     /**
1059 1059
      * 判断用户记录是否已锁定
1060
+     *
1060 1061
      * @param userId 用户ID
1061 1062
      * @return 是否已锁定
1062 1063
      */
@@ -1077,6 +1078,7 @@ public class AttendancePostRecordController extends BaseController {
1077 1078
 
1078 1079
     /**
1079 1080
      * 判断当前时间是否在班次周期内(当日9:00 - 次日9:00)
1081
+     *
1080 1082
      * @param lockTime 锁定时间
1081 1083
      * @return 是否在班次周期内
1082 1084
      */
@@ -1097,10 +1099,4 @@ public class AttendancePostRecordController extends BaseController {
1097 1099
     }
1098 1100
 
1099 1101
 
1100
-
1101
-
1102
-
1103
-
1104
-
1105
-
1106 1102
 }

+ 3 - 3
airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceRecordController.java

@@ -45,7 +45,7 @@ public class AttendanceRecordController extends BaseController {
45 45
 
46 46
     @Autowired
47 47
     private UserCache userCache;
48
-    
48
+
49 49
     @Autowired
50 50
     private ISysDeptService sysDeptService;
51 51
 
@@ -75,7 +75,7 @@ public class AttendanceRecordController extends BaseController {
75 75
                 // 不设置过滤条件,查看所有数据
76 76
                 break;
77 77
         }
78
-        
78
+
79 79
         startPage();
80 80
         List<AttendanceRecord> list = attendanceRecordService.selectAttendanceRecordList(attendanceRecord);
81 81
         return getDataTable(list);
@@ -108,7 +108,7 @@ public class AttendanceRecordController extends BaseController {
108 108
                 // 不设置过滤条件,查看所有数据
109 109
                 break;
110 110
         }
111
-        
111
+
112 112
         List<AttendanceRecord> list = attendanceRecordService.selectAttendanceRecordList(attendanceRecord);
113 113
         ExcelUtil<AttendanceRecord> util = new ExcelUtil<AttendanceRecord>(AttendanceRecord.class);
114 114
         util.exportExcel(response, list, "考勤记录数据");

+ 16 - 23
airport-admin/src/main/java/com/sundot/airport/web/controller/attendance/AttendanceTeamUserRecordController.java

@@ -3,6 +3,7 @@ package com.sundot.airport.web.controller.attendance;
3 3
 import java.util.Date;
4 4
 import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6
+
6 7
 import org.springframework.security.access.prepost.PreAuthorize;
7 8
 import org.springframework.beans.factory.annotation.Autowired;
8 9
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,26 +25,25 @@ import com.sundot.airport.common.core.page.TableDataInfo;
24 25
 
25 26
 /**
26 27
  * 考勤班组成员Controller
27
- * 
28
+ *
28 29
  * @author ruoyi
29 30
  * @date 2025-09-06
30 31
  */
31 32
 @RestController
32 33
 @RequestMapping("/attendance/record")
33
-public class AttendanceTeamUserRecordController extends BaseController
34
-{
34
+public class AttendanceTeamUserRecordController extends BaseController {
35 35
     @Autowired
36 36
     private IAttendanceTeamUserRecordService attendanceTeamUserRecordService;
37 37
 
38 38
     /**
39 39
      * 查询考勤班组成员列表
40
+     *
40 41
      * @param attendanceTeamUserRecord
41 42
      * @return
42 43
      */
43 44
     @PreAuthorize("@ss.hasPermi('attendance:record:list')")
44 45
     @GetMapping("/pageList")
45
-    public TableDataInfo pageList(AttendanceTeamUserRecord attendanceTeamUserRecord)
46
-    {
46
+    public TableDataInfo pageList(AttendanceTeamUserRecord attendanceTeamUserRecord) {
47 47
         startPage();
48 48
         List<AttendanceTeamUserRecord> list = attendanceTeamUserRecordService.selectAttendanceTeamUserRecordPageList(attendanceTeamUserRecord);
49 49
         return getDataTable(list);
@@ -54,8 +54,7 @@ public class AttendanceTeamUserRecordController extends BaseController
54 54
      */
55 55
     @PreAuthorize("@ss.hasPermi('attendance:record:list')")
56 56
     @GetMapping("/list")
57
-    public TableDataInfo list(AttendanceTeamUserRecord attendanceTeamUserRecord)
58
-    {
57
+    public TableDataInfo list(AttendanceTeamUserRecord attendanceTeamUserRecord) {
59 58
         startPage();
60 59
         List<AttendanceTeamUserRecord> list = attendanceTeamUserRecordService.selectAttendanceTeamUserRecordList(attendanceTeamUserRecord);
61 60
         return getDataTable(list);
@@ -67,8 +66,7 @@ public class AttendanceTeamUserRecordController extends BaseController
67 66
     @PreAuthorize("@ss.hasPermi('attendance:record:export')")
68 67
     @Log(title = "考勤班组成员", businessType = BusinessType.EXPORT)
69 68
     @PostMapping("/export")
70
-    public void export(HttpServletResponse response, AttendanceTeamUserRecord attendanceTeamUserRecord)
71
-    {
69
+    public void export(HttpServletResponse response, AttendanceTeamUserRecord attendanceTeamUserRecord) {
72 70
         List<AttendanceTeamUserRecord> list = attendanceTeamUserRecordService.selectAttendanceTeamUserRecordList(attendanceTeamUserRecord);
73 71
         ExcelUtil<AttendanceTeamUserRecord> util = new ExcelUtil<AttendanceTeamUserRecord>(AttendanceTeamUserRecord.class);
74 72
         util.exportExcel(response, list, "考勤班组成员数据");
@@ -79,8 +77,7 @@ public class AttendanceTeamUserRecordController extends BaseController
79 77
      */
80 78
     @PreAuthorize("@ss.hasPermi('attendance:record:query')")
81 79
     @GetMapping(value = "/{userId}")
82
-    public AjaxResult getInfo(@PathVariable("userId") Long userId, @PathVariable("attendanceDate") Date attendanceDate)
83
-    {
80
+    public AjaxResult getInfo(@PathVariable("userId") Long userId, @PathVariable("attendanceDate") Date attendanceDate) {
84 81
         return success(attendanceTeamUserRecordService.selectAttendanceTeamUserRecordByUserId(userId, attendanceDate));
85 82
     }
86 83
 
@@ -90,8 +87,7 @@ public class AttendanceTeamUserRecordController extends BaseController
90 87
     @PreAuthorize("@ss.hasPermi('attendance:record:add')")
91 88
     @Log(title = "考勤班组成员", businessType = BusinessType.INSERT)
92 89
     @PostMapping
93
-    public AjaxResult add(@RequestBody AttendanceTeamUserRecord attendanceTeamUserRecord)
94
-    {
90
+    public AjaxResult add(@RequestBody AttendanceTeamUserRecord attendanceTeamUserRecord) {
95 91
         return toAjax(attendanceTeamUserRecordService.insertAttendanceTeamUserRecord(attendanceTeamUserRecord));
96 92
     }
97 93
 
@@ -101,8 +97,7 @@ public class AttendanceTeamUserRecordController extends BaseController
101 97
     @PreAuthorize("@ss.hasPermi('attendance:record:edit')")
102 98
     @Log(title = "考勤班组成员", businessType = BusinessType.UPDATE)
103 99
     @PutMapping
104
-    public AjaxResult edit(@RequestBody AttendanceTeamUserRecord attendanceTeamUserRecord)
105
-    {
100
+    public AjaxResult edit(@RequestBody AttendanceTeamUserRecord attendanceTeamUserRecord) {
106 101
         return toAjax(attendanceTeamUserRecordService.updateAttendanceTeamUserRecord(attendanceTeamUserRecord));
107 102
     }
108 103
 
@@ -111,22 +106,21 @@ public class AttendanceTeamUserRecordController extends BaseController
111 106
      */
112 107
     @PreAuthorize("@ss.hasPermi('attendance:record:remove')")
113 108
     @Log(title = "考勤班组成员", businessType = BusinessType.DELETE)
114
-	@DeleteMapping("/{userIds}")
115
-    public AjaxResult remove(@PathVariable Long[] userIds)
116
-    {
109
+    @DeleteMapping("/{userIds}")
110
+    public AjaxResult remove(@PathVariable Long[] userIds) {
117 111
         return toAjax(attendanceTeamUserRecordService.deleteAttendanceTeamUserRecordByUserIds(userIds));
118 112
     }
119 113
 
120 114
     /**
121
-     *  批量新增考勤班组成员
115
+     * 批量新增考勤班组成员
116
+     *
122 117
      * @param attendanceTeamUserRecord
123 118
      * @return
124 119
      */
125 120
     @PreAuthorize("@ss.hasPermi('attendance:record:add:list')")
126 121
     @Log(title = "考勤班组成员", businessType = BusinessType.INSERT)
127 122
     @PostMapping(value = "/add/list")
128
-    public AjaxResult addList(@RequestBody List<AttendanceTeamUserRecord> attendanceTeamUserRecord)
129
-    {
123
+    public AjaxResult addList(@RequestBody List<AttendanceTeamUserRecord> attendanceTeamUserRecord) {
130 124
         return toAjax(attendanceTeamUserRecordService.insertAttendanceTeamUserRecordList(attendanceTeamUserRecord));
131 125
     }
132 126
 
@@ -134,8 +128,7 @@ public class AttendanceTeamUserRecordController extends BaseController
134 128
      * 获取考勤班组成员列表
135 129
      */
136 130
     @GetMapping("/list/teamLeader")
137
-    public AjaxResult listTeamLeader()
138
-    {
131
+    public AjaxResult listTeamLeader() {
139 132
         return success(attendanceTeamUserRecordService.selectAttendanceTeamLeaderId());
140 133
     }
141 134
 

+ 1 - 1
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendanceArea.java

@@ -11,7 +11,7 @@ import java.math.BigDecimal;
11 11
  * 打卡范围
12 12
  */
13 13
 @Data
14
-@ApiModel(value = "AttendanceArea对象",description = "打卡范围")
14
+@ApiModel(value = "AttendanceArea对象", description = "打卡范围")
15 15
 public class AttendanceArea extends BaseEntity {
16 16
     /**
17 17
      * 主键id

+ 0 - 1
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendancePostRecord.java

@@ -245,5 +245,4 @@ public class AttendancePostRecord extends BaseEntity {
245 245
     private Date endTime;
246 246
 
247 247
 
248
-
249 248
 }

+ 29 - 13
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/AttendanceTeamUserRecord.java

@@ -1,6 +1,7 @@
1 1
 package com.sundot.airport.attendance.domain;
2 2
 
3 3
 import java.util.Date;
4
+
4 5
 import com.fasterxml.jackson.annotation.JsonFormat;
5 6
 import io.swagger.annotations.ApiModelProperty;
6 7
 import lombok.Data;
@@ -12,60 +13,75 @@ import com.sundot.airport.common.core.domain.BaseEntity;
12 13
 
13 14
 /**
14 15
  * 考勤班组成员对象 attendance_team_user_record
15
- * 
16
+ *
16 17
  * @author ruoyi
17 18
  * @date 2025-09-06
18 19
  */
19 20
 @EqualsAndHashCode(callSuper = true)
20 21
 @Data
21
-public class AttendanceTeamUserRecord extends BaseEntity
22
-{
22
+public class AttendanceTeamUserRecord extends BaseEntity {
23 23
     private static final long serialVersionUID = 1L;
24 24
 
25
-    /** 用户ID */
25
+    /**
26
+     * 用户ID
27
+     */
26 28
     @Excel(name = "用户ID")
27 29
     @ApiModelProperty("用户ID")
28 30
     private Long userId;
29 31
 
30
-    /** 用户code */
32
+    /**
33
+     * 用户code
34
+     */
31 35
     @Excel(name = "用户code")
32 36
     @ApiModelProperty("用户code")
33 37
     private String userCode;
34 38
 
35
-    /** 用户名称 */
39
+    /**
40
+     * 用户名称
41
+     */
36 42
     @Excel(name = "用户名称")
37 43
     @ApiModelProperty("用户名称")
38 44
     private String userName;
39 45
 
40
-    /** 航站楼编码 */
46
+    /**
47
+     * 航站楼编码
48
+     */
41 49
     @Excel(name = "航站楼编码")
42 50
     @ApiModelProperty("航站楼编码")
43 51
     private String terminlCode;
44 52
 
45
-    /** 航站楼名称 */
53
+    /**
54
+     * 航站楼名称
55
+     */
46 56
     @Excel(name = "航站楼名称")
47 57
     @ApiModelProperty("航站楼名称")
48 58
     private String terminlName;
49 59
 
50
-    /** 考勤日期 */
60
+    /**
61
+     * 考勤日期
62
+     */
51 63
     @JsonFormat(pattern = "yyyy-MM-dd")
52 64
     @Excel(name = "考勤日期", width = 30, dateFormat = "yyyy-MM-dd")
53 65
     @ApiModelProperty("考勤日期")
54 66
     private Date attendanceDate;
55 67
 
56
-    /** 考勤班组ID */
68
+    /**
69
+     * 考勤班组ID
70
+     */
57 71
     @Excel(name = "考勤班组ID")
58 72
     @ApiModelProperty("考勤班组ID")
59 73
     private Long attendanceTeamId;
60 74
 
61
-    /** 考勤班组名称 */
75
+    /**
76
+     * 考勤班组名称
77
+     */
62 78
     @Excel(name = "考勤班组名称")
63 79
     @ApiModelProperty("考勤班组名称")
64 80
     private String attendanceTeamName;
65 81
 
66
-    private  Date attendanceDateStart;
82
+    private Date attendanceDateStart;
67 83
 
68
-    private  Date attendanceDateEnd;
84
+    private Date attendanceDateEnd;
69 85
 
70 86
 
71 87
 }

+ 6 - 6
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/StationDeptWorkStats.java

@@ -14,33 +14,33 @@ public class StationDeptWorkStats {
14 14
      * 统计维度(站和科)
15 15
      */
16 16
     private String dimension;
17
-    
17
+
18 18
     /**
19 19
      * 部门ID
20 20
      */
21 21
     private Long deptId;
22
-    
22
+
23 23
     /**
24 24
      * 部门名称
25 25
      */
26 26
     private String deptName;
27
-    
27
+
28 28
     /**
29 29
      * 人均出勤天数
30 30
      */
31 31
     private BigDecimal avgWorkingDays;
32
-    
32
+
33 33
     /**
34 34
      * 人均上岗时长
35 35
      * 单位:小时
36 36
      */
37 37
     private BigDecimal avgWorkingHours;
38
-    
38
+
39 39
     // 添加setter方法
40 40
     public void setDeptId(Long deptId) {
41 41
         this.deptId = deptId;
42 42
     }
43
-    
43
+
44 44
     public void setDeptName(String deptName) {
45 45
         this.deptName = deptName;
46 46
     }

+ 7 - 3
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/WorkDateStats.java

@@ -10,9 +10,13 @@ import java.math.BigDecimal;
10 10
  */
11 11
 @Data
12 12
 public class WorkDateStats {
13
-    /** 总出勤天数 */
13
+    /**
14
+     * 总出勤天数
15
+     */
14 16
     private Integer totalWorkingDays;
15
-    
16
-    /** 平均人数 */
17
+
18
+    /**
19
+     * 平均人数
20
+     */
17 21
     private BigDecimal averagePersonnel;
18 22
 }

+ 7 - 3
airport-attendance/src/main/java/com/sundot/airport/attendance/domain/portrait/WorkHoursStats.java

@@ -10,9 +10,13 @@ import java.math.BigDecimal;
10 10
  */
11 11
 @Data
12 12
 public class WorkHoursStats {
13
-    /** 总上岗时长(小时) */
13
+    /**
14
+     * 总上岗时长(小时)
15
+     */
14 16
     private Long totalWorkingHours;
15
-    
16
-    /** 平均上岗时长 */
17
+
18
+    /**
19
+     * 平均上岗时长
20
+     */
17 21
     private BigDecimal averagePersonnel;
18 22
 }

+ 1 - 1
airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordCountDetailDTO.java

@@ -40,7 +40,7 @@ public class AttendanceRecordCountDetailDTO {
40 40
     private Integer onDutyCount;
41 41
 
42 42
     @ApiModelProperty("在岗班组")
43
-     private String onDutyTeamName;
43
+    private String onDutyTeamName;
44 44
 
45 45
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
46 46
     @ApiModelProperty("上岗时间")

+ 1 - 1
airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordCountRegionDTO.java

@@ -20,7 +20,7 @@ public class AttendanceRecordCountRegionDTO {
20 20
     private String regionalName;
21 21
 
22 22
     @ApiModelProperty("开放人数量")
23
-    private Integer  openUserCount;
23
+    private Integer openUserCount;
24 24
 
25 25
     @ApiModelProperty("开放通道数")
26 26
     private Integer openChannelCount;

+ 0 - 3
airport-attendance/src/main/java/com/sundot/airport/attendance/dto/AttendanceRecordTerminlCountDetailDTO.java

@@ -36,7 +36,4 @@ public class AttendanceRecordTerminlCountDetailDTO {
36 36
     private List<AttendanceRecordCountWaitDTO> waitList;
37 37
 
38 38
 
39
-
40
-
41
-
42 39
 }

+ 1 - 1
airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendanceAreaMapper.java

@@ -9,7 +9,6 @@ import java.util.List;
9 9
 public interface AttendanceAreaMapper {
10 10
 
11 11
     /**
12
-     *
13 12
      * @param lng 用户经度
14 13
      * @param lat 用户纬度
15 14
      * @return 符合条件的考勤区域列表
@@ -20,6 +19,7 @@ public interface AttendanceAreaMapper {
20 19
 
21 20
     /**
22 21
      * 查询考勤列表
22
+     *
23 23
      * @return
24 24
      */
25 25
     List<AttendanceArea> areaList();

+ 17 - 13
airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendancePostRecordMapper.java

@@ -65,7 +65,7 @@ public interface AttendancePostRecordMapper {
65 65
      * 查询指定用户当天的上岗记录
66 66
      *
67 67
      * @param userId 用户ID
68
-     * @param today 当天日期
68
+     * @param today  当天日期
69 69
      * @return 上岗记录集合
70 70
      */
71 71
     public List<AttendancePostRecord> selectTodayRecordsByUserId(@Param("userId") Long userId, @Param("today") Date today);
@@ -73,7 +73,7 @@ public interface AttendancePostRecordMapper {
73 73
     /**
74 74
      * 查询指定班次代码当天的上岗记录
75 75
      *
76
-     * @param today 当天日期
76
+     * @param today      当天日期
77 77
      * @param shiftCodes 班次代码列表
78 78
      * @return 上岗记录集合
79 79
      */
@@ -82,22 +82,24 @@ public interface AttendancePostRecordMapper {
82 82
     /**
83 83
      * 根据指定时间获取用户的在岗位置信息
84 84
      *
85
-     * @param userId 用户ID
85
+     * @param userId    用户ID
86 86
      * @param queryTime 查询时间
87 87
      * @return 上岗记录集合
88 88
      */
89 89
     public List<AttendancePostRecord> selectLocationsByTime(@Param("userId") Long userId, @Param("queryTime") Date queryTime);
90 90
 
91 91
     /**
92
-     *  根据通道名称和指定时间获取通道的在岗位置信息
92
+     * 根据通道名称和指定时间获取通道的在岗位置信息
93
+     *
93 94
      * @param channelCodeList 通道code
94
-     * @param queryTime 查询时间
95
+     * @param queryTime       查询时间
95 96
      * @return 上岗记录集合
96 97
      */
97 98
     List<AttendancePostRecord> selectLocationsByTimeAndChannelName(@Param("channelCodeList") List<String> channelCodeList, @Param("queryTime") Date queryTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
98 99
 
99 100
     /**
100
-     *  查询指定班次代码的下班时间
101
+     * 查询指定班次代码的下班时间
102
+     *
101 103
      * @param today
102 104
      * @param shiftCodes
103 105
      * @return
@@ -105,31 +107,33 @@ public interface AttendancePostRecordMapper {
105 107
     List<AttendancePostRecord> selectCheckOutTimeByShiftCodes(@Param("today") Date today, @Param("shiftCodes") List<String> shiftCodes);
106 108
 
107 109
     /**
108
-     *
109 110
      * @return
110 111
      */
111 112
     List<AttendancePostRecord> selectKezhangRecordCount(@Param("userId") Long userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
112 113
 
113 114
     /**
114 115
      * 查询指定用户指定时间最后的记录
116
+     *
115 117
      * @param userId 用户ID
116 118
      * @return 上岗记录集合
117 119
      */
118 120
     List<AttendancePostRecord> queryLastTime(@Param("userId") Long userId);
119 121
 
120 122
     /**
121
-     *  查询指定时间段内所有考勤记录的ke_id
122
-     * @param startTime  开始时间
123
-     * @param endTime 结束时间
123
+     * 查询指定时间段内所有考勤记录的ke_id
124
+     *
125
+     * @param startTime 开始时间
126
+     * @param endTime   结束时间
124 127
      * @return
125 128
      */
126
-    List<Long> queryKeIds(@Param("startTime")Date startTime, @Param("endTime") Date endTime);
129
+    List<Long> queryKeIds(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
127 130
 
128 131
     /**
129
-     *  查询指定时间段内班组内所有考勤记录
132
+     * 查询指定时间段内班组内所有考勤记录
133
+     *
130 134
      * @param date
131 135
      * @param attendanceTeamId
132 136
      * @return
133 137
      */
134
-    List<AttendancePostRecord> selectTeamOnList( @Param("date") Date date,@Param("attendanceTeamId") Long attendanceTeamId);
138
+    List<AttendancePostRecord> selectTeamOnList(@Param("date") Date date, @Param("attendanceTeamId") Long attendanceTeamId);
135 139
 }

+ 13 - 12
airport-attendance/src/main/java/com/sundot/airport/attendance/mapper/AttendanceTeamUserRecordMapper.java

@@ -2,28 +2,28 @@ package com.sundot.airport.attendance.mapper;
2 2
 
3 3
 import java.util.Date;
4 4
 import java.util.List;
5
+
5 6
 import com.sundot.airport.attendance.domain.AttendanceTeamUserRecord;
6 7
 import org.apache.ibatis.annotations.Param;
7 8
 
8 9
 /**
9 10
  * 考勤班组成员Mapper接口
10
- * 
11
+ *
11 12
  * @author ruoyi
12 13
  * @date 2025-09-06
13 14
  */
14
-public interface AttendanceTeamUserRecordMapper 
15
-{
15
+public interface AttendanceTeamUserRecordMapper {
16 16
     /**
17 17
      * 查询考勤班组成员
18
-     * 
18
+     *
19 19
      * @param userId 考勤班组成员主键
20 20
      * @return 考勤班组成员
21 21
      */
22
-    public AttendanceTeamUserRecord selectAttendanceTeamUserRecordByUserId(@Param("userId")  Long userId, @Param("attendanceDate") Date attendanceDate);
22
+    public AttendanceTeamUserRecord selectAttendanceTeamUserRecordByUserId(@Param("userId") Long userId, @Param("attendanceDate") Date attendanceDate);
23 23
 
24 24
     /**
25 25
      * 查询考勤班组成员列表
26
-     * 
26
+     *
27 27
      * @param attendanceTeamUserRecord 考勤班组成员
28 28
      * @return 考勤班组成员集合
29 29
      */
@@ -31,7 +31,7 @@ public interface AttendanceTeamUserRecordMapper
31 31
 
32 32
     /**
33 33
      * 新增考勤班组成员
34
-     * 
34
+     *
35 35
      * @param attendanceTeamUserRecord 考勤班组成员
36 36
      * @return 结果
37 37
      */
@@ -39,7 +39,7 @@ public interface AttendanceTeamUserRecordMapper
39 39
 
40 40
     /**
41 41
      * 修改考勤班组成员
42
-     * 
42
+     *
43 43
      * @param attendanceTeamUserRecord 考勤班组成员
44 44
      * @return 结果
45 45
      */
@@ -47,7 +47,7 @@ public interface AttendanceTeamUserRecordMapper
47 47
 
48 48
     /**
49 49
      * 删除考勤班组成员
50
-     * 
50
+     *
51 51
      * @param userId 考勤班组成员主键
52 52
      * @return 结果
53 53
      */
@@ -55,19 +55,20 @@ public interface AttendanceTeamUserRecordMapper
55 55
 
56 56
     /**
57 57
      * 批量删除考勤班组成员
58
-     * 
58
+     *
59 59
      * @param userIds 需要删除的数据主键集合
60 60
      * @return 结果
61 61
      */
62 62
     public int deleteAttendanceTeamUserRecordByUserIds(Long[] userIds);
63 63
 
64 64
     int insertAttendanceTeamUserRecordList(List<AttendanceTeamUserRecord> attendanceTeamUserRecord);
65
+
65 66
     /**
66 67
      * 根据用户ID和时间范围查询考勤班组成员
67 68
      *
68
-     * @param userId 用户ID
69
+     * @param userId    用户ID
69 70
      * @param startDate 开始日期
70
-     * @param endDate 结束日期
71
+     * @param endDate   结束日期
71 72
      * @return 考勤班组成员列表
72 73
      */
73 74
     List<AttendanceTeamUserRecord> selectAttendanceTeamUserRecordByUserIdAndDateRange(Long userId, Date startDate, Date endDate);

+ 12 - 6
airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/AttendanceModuleIndicatorResult.java

@@ -13,19 +13,25 @@ import java.util.List;
13 13
  */
14 14
 @Data
15 15
 public class AttendanceModuleIndicatorResult extends BaseModuleIndicatorResult {
16
-    
17
-    /** 出勤天数 */
16
+
17
+    /**
18
+     * 出勤天数
19
+     */
18 20
     @ApiModelProperty(value = "出勤天数")
19 21
     private Object workingDate;
20
-    
21
-    /** 上岗时长 */
22
+
23
+    /**
24
+     * 上岗时长
25
+     */
22 26
     @ApiModelProperty(value = "出勤天数")
23 27
     private Object workingHours;
24 28
 
25
-    /** 站的统计列表 */
29
+    /**
30
+     * 站的统计列表
31
+     */
26 32
     @ApiModelProperty(value = "出勤天数")
27 33
     private List<StationDeptWorkStats> stationDeptWorkStats;
28
-    
34
+
29 35
     public AttendanceModuleIndicatorResult() {
30 36
         setModuleName("attendance");
31 37
     }

+ 9 - 9
airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/AttendanceModuleIndicatorService.java

@@ -30,10 +30,10 @@ import javax.annotation.PostConstruct;
30 30
  */
31 31
 @Service
32 32
 public class AttendanceModuleIndicatorService extends AbstractModuleIndicatorService<AttendanceModuleIndicatorResult> {
33
-    
33
+
34 34
     @Autowired
35 35
     private Set<Indicator<?>> indicators;
36
-    
36
+
37 37
     @Autowired
38 38
     private AttendanceRecordMapper attendanceRecordMapper;
39 39
 
@@ -42,14 +42,14 @@ public class AttendanceModuleIndicatorService extends AbstractModuleIndicatorSer
42 42
 
43 43
     @Autowired
44 44
     private ISysDeptService sysDeptService;
45
-    
45
+
46 46
     private Set<IndicatorType> supportedIndicatorTypes = new HashSet<>();
47
-    
47
+
48 48
     @Override
49 49
     public String getModuleName() {
50 50
         return "attendance";
51 51
     }
52
-    
52
+
53 53
     @PostConstruct
54 54
     public void initSupportedIndicatorTypes() {
55 55
         // 初始化支持的指标类型
@@ -62,22 +62,22 @@ public class AttendanceModuleIndicatorService extends AbstractModuleIndicatorSer
62 62
             }
63 63
         }
64 64
     }
65
-    
65
+
66 66
     @Override
67 67
     protected AttendanceModuleIndicatorResult createResult() {
68 68
         return new AttendanceModuleIndicatorResult();
69 69
     }
70
-    
70
+
71 71
     @Override
72 72
     protected Set<IndicatorType> getSupportedIndicatorTypes() {
73 73
         return supportedIndicatorTypes;
74 74
     }
75
-    
75
+
76 76
     @Override
77 77
     protected Set<Indicator<?>> getIndicators() {
78 78
         return indicators;
79 79
     }
80
-    
80
+
81 81
     @Override
82 82
     protected void setIndicatorResult(Indicator<?> indicator, AttendanceModuleIndicatorResult result) {
83 83
         // 直接调用指标的setResult方法,将值设置到结果对象中

+ 12 - 10
airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/StationWorkStatsService.java

@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
31 31
 @Service
32 32
 public class StationWorkStatsService {
33 33
 
34
-    
34
+
35 35
     @Autowired
36 36
     private ISysDeptService sysDeptService;
37 37
 
@@ -40,9 +40,10 @@ public class StationWorkStatsService {
40 40
 
41 41
     @Autowired
42 42
     private ISysUserService iSysUserService;
43
-    
43
+
44 44
     /**
45 45
      * 计算站级部门及其下属部门的工作统计数据
46
+     *
46 47
      * @param params 指定部门
47 48
      * @return 工作统计数据列表
48 49
      */
@@ -57,14 +58,14 @@ public class StationWorkStatsService {
57 58
         queryDept.setDeptId(stationId);
58 59
         queryDept.setDeptType(DeptTypeEnum.DEPARTMENT.getCode());
59 60
         List<SysDept> sysDeptList = sysDeptService.selectDeptInfo(queryDept);
60
-        
61
+
61 62
         if (CollectionUtil.isEmpty(sysDeptList)) {
62 63
             return null;
63 64
         }
64 65
         IndicatorCalculateParams indicatorCalculateParams = this.appendParams(params);
65 66
         // 为每个部门生成统计信息
66 67
         return sysDeptList.stream()
67
-                .map(dept -> getStationDeptWorkStats( dept,indicatorCalculateParams))
68
+                .map(dept -> getStationDeptWorkStats(dept, indicatorCalculateParams))
68 69
                 .filter(java.util.Objects::nonNull)
69 70
                 .collect(Collectors.toList());
70 71
     }
@@ -81,9 +82,10 @@ public class StationWorkStatsService {
81 82
         params.setEndTime(endTime);
82 83
         return params;
83 84
     }
84
-    
85
+
85 86
     /**
86 87
      * 为特定部门生成工作统计信息
88
+     *
87 89
      * @param dept 部门信息
88 90
      * @return 部门工作统计信息
89 91
      */
@@ -91,7 +93,7 @@ public class StationWorkStatsService {
91 93
         if (dept == null) {
92 94
             return null;
93 95
         }
94
-        
96
+
95 97
         StationDeptWorkStats stationStats = new StationDeptWorkStats();
96 98
         stationStats.setDimension(dept.getDeptName());
97 99
         stationStats.setDeptId(dept.getDeptId());
@@ -114,9 +116,9 @@ public class StationWorkStatsService {
114 116
     }
115 117
 
116 118
 
117
-    private BigDecimal  avgWorkingDays(IndicatorCalculateParams params) {
119
+    private BigDecimal avgWorkingDays(IndicatorCalculateParams params) {
118 120
         BigDecimal avgWorkingDays = BigDecimal.ZERO;
119
-                ModularIndicatorResult indicators = userPortraitService.getIndicators(params, Arrays.asList("attendance"));
121
+        ModularIndicatorResult indicators = userPortraitService.getIndicators(params, Arrays.asList("attendance"));
120 122
         if (indicators == null) {
121 123
             return avgWorkingDays;
122 124
         }
@@ -129,7 +131,7 @@ public class StationWorkStatsService {
129 131
         Object workingDate = attendanceResult.getWorkingDate();
130 132
         if (workingDate instanceof WorkDateStats) {
131 133
             WorkDateStats workDateStats = (WorkDateStats) workingDate;
132
-             avgWorkingDays =    workDateStats.getAveragePersonnel() != null ?
134
+            avgWorkingDays = workDateStats.getAveragePersonnel() != null ?
133 135
                     workDateStats.getAveragePersonnel() : BigDecimal.ZERO;
134 136
         }
135 137
         return avgWorkingDays;
@@ -150,7 +152,7 @@ public class StationWorkStatsService {
150 152
         Object workingHours = attendanceResult.getWorkingHours();
151 153
         if (workingHours instanceof WorkHoursStats) {
152 154
             WorkHoursStats workHoursStats = (WorkHoursStats) workingHours;
153
-            avgWorkingHours=workHoursStats.getAveragePersonnel() != null ?
155
+            avgWorkingHours = workHoursStats.getAveragePersonnel() != null ?
154 156
                     workHoursStats.getAveragePersonnel() : BigDecimal.ZERO;
155 157
         }
156 158
 

+ 3 - 3
airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/WorkingDateIndicator.java

@@ -22,12 +22,12 @@ import java.util.List;
22 22
  */
23 23
 @Component
24 24
 public class WorkingDateIndicator implements Indicator<Object> {
25
-    
25
+
26 26
     @Autowired
27 27
     private AttendanceRecordMapper attendanceRecordMapper;
28
-    
28
+
29 29
     private Object value;
30
-    
30
+
31 31
     @Override
32 32
     public String getName() {
33 33
         return IndicatorType.WORKING_DATE.getCode();

+ 3 - 3
airport-attendance/src/main/java/com/sundot/airport/attendance/portrait/WorkingHoursIndicator.java

@@ -89,13 +89,13 @@ public class WorkingHoursIndicator implements Indicator<Object> {
89 89
                     .filter(workDuration -> workDuration > 0)
90 90
                     .sum();
91 91
             totalWorkingHours = totalWorkingHours > 0 ? totalWorkingHours / 60 : 0;
92
-            
92
+
93 93
             stats.setTotalWorkingHours(totalWorkingHours);
94
-            stats.setAveragePersonnel(CollectionUtil.isNotEmpty(params.getUserIds())? new BigDecimal(totalWorkingHours).divide(new BigDecimal(params.getUserIds().size()), 2, BigDecimal.ROUND_HALF_UP) : BigDecimal.ZERO);
94
+            stats.setAveragePersonnel(CollectionUtil.isNotEmpty(params.getUserIds()) ? new BigDecimal(totalWorkingHours).divide(new BigDecimal(params.getUserIds().size()), 2, BigDecimal.ROUND_HALF_UP) : BigDecimal.ZERO);
95 95
             this.value = stats;
96 96
         }
97 97
     }
98
-    
98
+
99 99
     @Override
100 100
     public void setResult(BaseModuleIndicatorResult result) {
101 101
         if (result instanceof AttendanceModuleIndicatorResult) {

+ 1 - 2
airport-attendance/src/main/java/com/sundot/airport/attendance/service/AttendanceAreaService.java

@@ -7,8 +7,8 @@ import java.util.List;
7 7
 
8 8
 public interface AttendanceAreaService {
9 9
     /**
10
-     *
11 10
      * 查询是否在考勤范围
11
+     *
12 12
      * @param lng 经度
13 13
      * @param lat 纬度
14 14
      * @return
@@ -16,7 +16,6 @@ public interface AttendanceAreaService {
16 16
     List<AttendanceArea> checkUserInValidArea(BigDecimal lng, BigDecimal lat);
17 17
 
18 18
     /**
19
-     *
20 19
      * @return
21 20
      */
22 21
     List<AttendanceArea> areaList();

+ 15 - 9
airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendancePostRecordService.java

@@ -66,7 +66,7 @@ public interface IAttendancePostRecordService {
66 66
      * 查询指定用户当天的上岗记录
67 67
      *
68 68
      * @param userId 用户ID
69
-     * @param today 当天日期
69
+     * @param today  当天日期
70 70
      * @return 上岗记录集合
71 71
      */
72 72
     public List<AttendancePostRecord> selectTodayRecordsByUserId(Long userId, Date today);
@@ -74,7 +74,7 @@ public interface IAttendancePostRecordService {
74 74
     /**
75 75
      * 查询指定班次代码当天的上岗记录
76 76
      *
77
-     * @param today 当天日期
77
+     * @param today      当天日期
78 78
      * @param shiftCodes 班次代码列表
79 79
      * @return 上岗记录集合
80 80
      */
@@ -83,7 +83,7 @@ public interface IAttendancePostRecordService {
83 83
     /**
84 84
      * 根据指定时间获取用户的在岗位置信息
85 85
      *
86
-     * @param userId 用户ID
86
+     * @param userId    用户ID
87 87
      * @param queryTime 查询时间
88 88
      * @return 上岗记录集合
89 89
      */
@@ -95,10 +95,11 @@ public interface IAttendancePostRecordService {
95 95
      * @param channelCodeList 通道code
96 96
      * @return 上岗记录集合
97 97
      */
98
-    List<AttendancePostRecord> selectLocationsByTimeAndChannelName(List<String> channelCodeList, Date nowDate,Date startTime,Date endTime);
98
+    List<AttendancePostRecord> selectLocationsByTimeAndChannelName(List<String> channelCodeList, Date nowDate, Date startTime, Date endTime);
99 99
 
100 100
     /**
101 101
      * 查询指定班次代码当天的下岗记录
102
+     *
102 103
      * @param today
103 104
      * @param shiftCodes
104 105
      * @return
@@ -106,31 +107,36 @@ public interface IAttendancePostRecordService {
106 107
     public List<AttendancePostRecord> selectCheckOutTimeByShiftCodes(Date today, List<String> shiftCodes);
107 108
 
108 109
     /**
109
-     *  获取当前时间下科长的在岗区域
110
+     * 获取当前时间下科长的在岗区域
111
+     *
110 112
      * @return 区域集合
111 113
      */
112
-    List<AttendancePostRecord> selectKezhangRecordCount(Long userId,Date startTime,Date endTime);
114
+    List<AttendancePostRecord> selectKezhangRecordCount(Long userId, Date startTime, Date endTime);
113 115
 
114 116
     /**
115 117
      * 获取当前时间下指定用户最后的在岗时间
118
+     *
116 119
      * @param userId 用户ID
117 120
      * @return 最后的在岗时间
118 121
      */
119
-    List<AttendancePostRecord>  queryLastTime(Long userId);
122
+    List<AttendancePostRecord> queryLastTime(Long userId);
120 123
 
121 124
     /**
122 125
      * 获取当前班次下科长上岗的id
126
+     *
123 127
      * @return
124 128
      */
125 129
     List<Long> queryKeIds();
130
+
126 131
     /**
127 132
      * 查询当前班组下所有在岗记录
128 133
      */
129
-    List<AttendancePostRecord>  selectTeamOnList(Date date, Long attendanceTeamId);
134
+    List<AttendancePostRecord> selectTeamOnList(Date date, Long attendanceTeamId);
130 135
 
131 136
     /**
132 137
      * 获取当前班次时间
133
-     * @return  时间
138
+     *
139
+     * @return 时间
134 140
      */
135 141
     Map<String, Date> getShiftTime();
136 142
 }

+ 5 - 4
airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendanceRecordService.java

@@ -84,11 +84,12 @@ public interface IAttendanceRecordService {
84 84
 
85 85
     /**
86 86
      * 计算考勤日期
87
-     * @param checkInTime 实际打卡时间,即员工实际进行打卡操作的时间点
87
+     *
88
+     * @param checkInTime    实际打卡时间,即员工实际进行打卡操作的时间点
88 89
      * @param shiftStartTime 班次开始时间,格式为 "HH:mm",如 "21:00" 表示晚上9点
89
-     * @param shiftEndTime 班次结束时间,格式为 "HH:mm",如 "21:00" 表示晚上9点
90
-     * @param checkInType  1-上班打卡,2-下班打卡
90
+     * @param shiftEndTime   班次结束时间,格式为 "HH:mm",如 "21:00" 表示晚上9点
91
+     * @param checkInType    1-上班打卡,2-下班打卡
91 92
      * @return 计算出的考勤日期,表示该次打卡记录应归属的考勤周期日期
92 93
      */
93
-    Date calculateAttendanceDate(Date checkInTime, String shiftStartTime, String shiftEndTime,String checkInType);
94
+    Date calculateAttendanceDate(Date checkInTime, String shiftStartTime, String shiftEndTime, String checkInType);
94 95
 }

+ 12 - 10
airport-attendance/src/main/java/com/sundot/airport/attendance/service/IAttendanceTeamUserRecordService.java

@@ -2,19 +2,19 @@ package com.sundot.airport.attendance.service;
2 2
 
3 3
 import java.util.Date;
4 4
 import java.util.List;
5
+
5 6
 import com.sundot.airport.attendance.domain.AttendanceTeamUserRecord;
6 7
 
7 8
 /**
8 9
  * 考勤班组成员Service接口
9
- * 
10
+ *
10 11
  * @author ruoyi
11 12
  * @date 2025-09-06
12 13
  */
13
-public interface IAttendanceTeamUserRecordService 
14
-{
14
+public interface IAttendanceTeamUserRecordService {
15 15
     /**
16 16
      * 查询考勤班组成员
17
-     * 
17
+     *
18 18
      * @param userId 考勤班组成员主键
19 19
      * @return 考勤班组成员
20 20
      */
@@ -22,6 +22,7 @@ public interface IAttendanceTeamUserRecordService
22 22
 
23 23
     /**
24 24
      * 查询考勤班组成员列表
25
+     *
25 26
      * @param attendanceTeamUserRecord
26 27
      * @return
27 28
      */
@@ -30,7 +31,7 @@ public interface IAttendanceTeamUserRecordService
30 31
 
31 32
     /**
32 33
      * 上岗记录中查询考勤班组成员列表
33
-     * 
34
+     *
34 35
      * @param attendanceTeamUserRecord 考勤班组成员
35 36
      * @return 考勤班组成员集合
36 37
      */
@@ -38,7 +39,7 @@ public interface IAttendanceTeamUserRecordService
38 39
 
39 40
     /**
40 41
      * 新增考勤班组成员
41
-     * 
42
+     *
42 43
      * @param attendanceTeamUserRecord 考勤班组成员
43 44
      * @return 结果
44 45
      */
@@ -46,7 +47,7 @@ public interface IAttendanceTeamUserRecordService
46 47
 
47 48
     /**
48 49
      * 修改考勤班组成员
49
-     * 
50
+     *
50 51
      * @param attendanceTeamUserRecord 考勤班组成员
51 52
      * @return 结果
52 53
      */
@@ -54,7 +55,7 @@ public interface IAttendanceTeamUserRecordService
54 55
 
55 56
     /**
56 57
      * 批量删除考勤班组成员
57
-     * 
58
+     *
58 59
      * @param userIds 需要删除的考勤班组成员主键集合
59 60
      * @return 结果
60 61
      */
@@ -62,14 +63,15 @@ public interface IAttendanceTeamUserRecordService
62 63
 
63 64
     /**
64 65
      * 删除考勤班组成员信息
65
-     * 
66
+     *
66 67
      * @param userId 考勤班组成员主键
67 68
      * @return 结果
68 69
      */
69 70
     public int deleteAttendanceTeamUserRecordByUserId(Long userId);
70 71
 
71 72
     /**
72
-     *  批量新增考勤班组成员
73
+     * 批量新增考勤班组成员
74
+     *
73 75
      * @param attendanceTeamUserRecord
74 76
      * @return
75 77
      */

+ 2 - 0
airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceAreaServiceImpl.java

@@ -17,6 +17,7 @@ public class AttendanceAreaServiceImpl implements AttendanceAreaService {
17 17
 
18 18
     /**
19 19
      * 查询是否在考勤范围
20
+     *
20 21
      * @param lng 经度
21 22
      * @param lat 纬度
22 23
      * @return
@@ -43,6 +44,7 @@ public class AttendanceAreaServiceImpl implements AttendanceAreaService {
43 44
 
44 45
     /**
45 46
      * 查询所有的考勤范围点
47
+     *
46 48
      * @return
47 49
      */
48 50
     @Override

+ 17 - 15
airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendancePostRecordServiceImpl.java

@@ -52,10 +52,10 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
52 52
         }
53 53
         records = records.stream().map(record -> {
54 54
             //下通道时间是2001年1月1日00:00:00,所以这里要设置为null
55
-            if(record.getCheckOutTime() != null && record.getCheckOutTime().getTime() == 978352000000L){
55
+            if (record.getCheckOutTime() != null && record.getCheckOutTime().getTime() == 978352000000L) {
56 56
                 record.setCheckOutTime(null);
57 57
             }
58
-            if(record.getWorkDuration() !=null && record.getWorkDuration() < 0){
58
+            if (record.getWorkDuration() != null && record.getWorkDuration() < 0) {
59 59
                 record.setWorkDuration(0L);
60 60
             }
61 61
             return record;
@@ -113,7 +113,7 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
113 113
      * 查询指定用户当天的上岗记录
114 114
      *
115 115
      * @param userId 用户ID
116
-     * @param today 当天日期
116
+     * @param today  当天日期
117 117
      * @return 上岗记录集合
118 118
      */
119 119
     @Override
@@ -124,7 +124,7 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
124 124
     /**
125 125
      * 查询指定班次代码当天的上岗记录
126 126
      *
127
-     * @param today 当天日期
127
+     * @param today      当天日期
128 128
      * @param shiftCodes 班次代码列表
129 129
      * @return 上岗记录集合
130 130
      */
@@ -136,7 +136,7 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
136 136
     /**
137 137
      * 根据指定时间获取用户的在岗位置信息
138 138
      *
139
-     * @param userId 用户ID
139
+     * @param userId    用户ID
140 140
      * @param queryTime 查询时间
141 141
      * @return 上岗记录集合
142 142
      */
@@ -149,16 +149,17 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
149 149
      * 根据指定时间获取指定通道的在岗位置信息
150 150
      *
151 151
      * @param channelCodeList 通道code
152
-     * @param nowDate 查询时间
152
+     * @param nowDate         查询时间
153 153
      * @return 上岗记录集合
154 154
      */
155 155
     @Override
156
-    public List<AttendancePostRecord> selectLocationsByTimeAndChannelName(List<String> channelCodeList, Date nowDate,Date startTime,Date endTime) {
157
-        return attendancePostRecordMapper.selectLocationsByTimeAndChannelName(channelCodeList, nowDate,startTime,endTime);
156
+    public List<AttendancePostRecord> selectLocationsByTimeAndChannelName(List<String> channelCodeList, Date nowDate, Date startTime, Date endTime) {
157
+        return attendancePostRecordMapper.selectLocationsByTimeAndChannelName(channelCodeList, nowDate, startTime, endTime);
158 158
     }
159 159
 
160 160
     /**
161
-     *  查询指定班次代码当天的下岗时间
161
+     * 查询指定班次代码当天的下岗时间
162
+     *
162 163
      * @param today
163 164
      * @param shiftCodes
164 165
      * @return
@@ -170,10 +171,11 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
170 171
 
171 172
     /**
172 173
      * 获取当前登录时间下科长的在岗区域
174
+     *
173 175
      * @return
174 176
      */
175 177
     @Override
176
-    public List<AttendancePostRecord> selectKezhangRecordCount(Long userId,Date startTime,Date endTime) {
178
+    public List<AttendancePostRecord> selectKezhangRecordCount(Long userId, Date startTime, Date endTime) {
177 179
         return attendancePostRecordMapper.selectKezhangRecordCount(userId, startTime, endTime);
178 180
     }
179 181
 
@@ -205,7 +207,7 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
205 207
     public List<Long> queryKeIds() {
206 208
         Map<String, Date> shiftTime = getShiftTime();
207 209
         List<Long> longs = attendancePostRecordMapper.queryKeIds(shiftTime.get("start"), shiftTime.get("end"));
208
-        if(CollectionUtil.isNotEmpty(longs)){
210
+        if (CollectionUtil.isNotEmpty(longs)) {
209 211
             return longs.stream().distinct().collect(Collectors.toList());
210 212
         }
211 213
         return new ArrayList<>();
@@ -213,12 +215,13 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
213 215
 
214 216
     @Override
215 217
     public List<AttendancePostRecord> selectTeamOnList(Date date, Long attendanceTeamId) {
216
-        return attendancePostRecordMapper.selectTeamOnList( date,  attendanceTeamId);
218
+        return attendancePostRecordMapper.selectTeamOnList(date, attendanceTeamId);
217 219
     }
218 220
 
219 221
     /**
220
-     *  获取当前班次周期的开始和结束时间
221
-     * @return  map  startTime:开始时间  endTime:结束时间
222
+     * 获取当前班次周期的开始和结束时间
223
+     *
224
+     * @return map  startTime:开始时间  endTime:结束时间
222 225
      */
223 226
     @Override
224 227
     public Map<String, Date> getShiftTime() {
@@ -265,5 +268,4 @@ public class AttendancePostRecordServiceImpl implements IAttendancePostRecordSer
265 268
     }
266 269
 
267 270
 
268
-
269 271
 }

+ 12 - 21
airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceRecordServiceImpl.java

@@ -135,19 +135,19 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
135 135
     @Override
136 136
     public List<AttendanceCheckRecord> record(AttendanceRecordDTO dto, UserInfo userInfo) {
137 137
         //确定打卡时间
138
-        if(ObjectUtil.isNotEmpty(dto.getCheckInDate())){
138
+        if (ObjectUtil.isNotEmpty(dto.getCheckInDate())) {
139 139
             String startTime = configService.selectConfigByKey("attendance.record.start.time");
140 140
             String endTime = configService.selectConfigByKey("attendance.record.end.time");
141 141
             Date checkInTime = this.calculateAttendanceDate(new Date(), startTime, endTime, dto.getCheckInType());
142 142
             dto.setCheckInDate(checkInTime);
143 143
         }
144 144
         //如果下班卡,直接取最近一条上班打卡记录
145
-        if(StrUtil.equals("2", dto.getCheckInType())){
146
-            AttendanceRecordReq dtoReq=new AttendanceRecordReq();
145
+        if (StrUtil.equals("2", dto.getCheckInType())) {
146
+            AttendanceRecordReq dtoReq = new AttendanceRecordReq();
147 147
             dtoReq.setUserId(userInfo.getUserId());
148 148
             dtoReq.setCheckInDate(dto.getCheckInDate());
149 149
             List<AttendanceRecord> attendanceRecords = queryRecordList(dtoReq);
150
-            if(CollectionUtil.isNotEmpty(attendanceRecords)){
150
+            if (CollectionUtil.isNotEmpty(attendanceRecords)) {
151 151
                 AttendanceRecord lastRecord = attendanceRecords.get(0);
152 152
                 dto.setCheckInDate(lastRecord.getAttendanceDate());
153 153
             }
@@ -176,9 +176,9 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
176 176
         if (StrUtil.equals("1", dto.getCheckInType())) {
177 177
             try {
178 178
                 ClockInEvent event = new ClockInEvent(
179
-                    this,
180
-                    userInfo.getUserId(),
181
-                    userInfo.getDepartmentId()
179
+                        this,
180
+                        userInfo.getUserId(),
181
+                        userInfo.getDepartmentId()
182 182
                 );
183 183
                 eventPublisher.publishEvent(event);
184 184
             } catch (Exception e) {
@@ -302,10 +302,10 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
302 302
     /**
303 303
      * 根据实际打卡时间和班次时间计算所属考勤日期
304 304
      *
305
-     * @param checkInTime 实际打卡时间,即员工实际进行打卡操作的时间点
305
+     * @param checkInTime    实际打卡时间,即员工实际进行打卡操作的时间点
306 306
      * @param shiftStartTime 班次开始时间,格式为 "HH:mm"
307
-     * @param shiftEndTime 班次结束时间,格式为 "HH:mm"
308
-     * @param checkInType 打卡类型:1-上班打卡,2-下班打卡
307
+     * @param shiftEndTime   班次结束时间,格式为 "HH:mm"
308
+     * @param checkInType    打卡类型:1-上班打卡,2-下班打卡
309 309
      * @return 计算出的考勤日期,该次打卡记录应归属的考勤周期日期
310 310
      */
311 311
     public Date calculateAttendanceDate(Date checkInTime, String shiftStartTime, String shiftEndTime, String checkInType) {
@@ -358,12 +358,11 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
358 358
     }
359 359
 
360 360
 
361
-
362 361
     /**
363 362
      * 处理梭班
364 363
      *
365 364
      * @param checkRecord 打卡记录
366
-     * @param userInfo 用户信息
365
+     * @param userInfo    用户信息
367 366
      */
368 367
     private void processShuttleShiftLogic(AttendanceCheckRecord checkRecord, UserInfo userInfo) {
369 368
         // 获取用户最近一次打卡记录
@@ -385,11 +384,10 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
385 384
     }
386 385
 
387 386
 
388
-
389 387
     /**
390 388
      * 判断是否为梭班场景
391 389
      *
392
-     * @param lastRecord 最近打卡记录
390
+     * @param lastRecord    最近打卡记录
393 391
      * @param currentRecord 当前打卡记录
394 392
      * @return 是否为梭班场景
395 393
      */
@@ -412,7 +410,6 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
412 410
     }
413 411
 
414 412
 
415
-
416 413
     /**
417 414
      * 获取用户最近一次打卡记录
418 415
      *
@@ -435,7 +432,6 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
435 432
     }
436 433
 
437 434
 
438
-
439 435
     /**
440 436
      * 计算梭班场景下的次日考勤日期(基于上次考勤日期)
441 437
      *
@@ -481,9 +477,4 @@ public class AttendanceRecordServiceImpl implements IAttendanceRecordService {
481 477
     }
482 478
 
483 479
 
484
-
485
-
486
-
487
-
488
-
489 480
 }

+ 27 - 32
airport-attendance/src/main/java/com/sundot/airport/attendance/service/impl/AttendanceTeamUserRecordServiceImpl.java

@@ -24,13 +24,12 @@ import static com.sundot.airport.common.utils.SecurityUtils.getUsername;
24 24
 
25 25
 /**
26 26
  * 考勤班组成员Service业务层处理
27
- * 
27
+ *
28 28
  * @author ruoyi
29 29
  * @date 2025-09-06
30 30
  */
31 31
 @Service
32
-public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserRecordService 
33
-{
32
+public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserRecordService {
34 33
     @Autowired
35 34
     private AttendanceTeamUserRecordMapper attendanceTeamUserRecordMapper;
36 35
 
@@ -42,13 +41,12 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
42 41
 
43 42
     /**
44 43
      * 查询考勤班组成员
45
-     * 
44
+     *
46 45
      * @param userId 考勤班组成员主键
47 46
      * @return 考勤班组成员
48 47
      */
49 48
     @Override
50
-    public AttendanceTeamUserRecord selectAttendanceTeamUserRecordByUserId(Long userId, Date attendanceDate)
51
-    {
49
+    public AttendanceTeamUserRecord selectAttendanceTeamUserRecordByUserId(Long userId, Date attendanceDate) {
52 50
         return attendanceTeamUserRecordMapper.selectAttendanceTeamUserRecordByUserId(userId, attendanceDate);
53 51
     }
54 52
 
@@ -59,13 +57,12 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
59 57
 
60 58
     /**
61 59
      * 上岗记录中查询考勤班组成员列表
62
-     * 
60
+     *
63 61
      * @param attendanceTeamUserRecord 考勤班组成员
64 62
      * @return 考勤班组成员
65 63
      */
66 64
     @Override
67
-    public List<AttendanceTeamUserRecord> selectAttendanceTeamUserRecordList(AttendanceTeamUserRecord attendanceTeamUserRecord)
68
-    {
65
+    public List<AttendanceTeamUserRecord> selectAttendanceTeamUserRecordList(AttendanceTeamUserRecord attendanceTeamUserRecord) {
69 66
         // 如果指定了考勤日期,则调整查询时间范围
70 67
         if (attendanceTeamUserRecord.getAttendanceDate() != null) {
71 68
             try {
@@ -94,56 +91,53 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
94 91
 
95 92
     /**
96 93
      * 新增考勤班组成员
97
-     * 
94
+     *
98 95
      * @param attendanceTeamUserRecord 考勤班组成员
99 96
      * @return 结果
100 97
      */
101 98
     @Override
102
-    public int insertAttendanceTeamUserRecord(AttendanceTeamUserRecord attendanceTeamUserRecord)
103
-    {
99
+    public int insertAttendanceTeamUserRecord(AttendanceTeamUserRecord attendanceTeamUserRecord) {
104 100
         attendanceTeamUserRecord.setCreateTime(DateUtils.getNowDate());
105 101
         return attendanceTeamUserRecordMapper.insertAttendanceTeamUserRecord(attendanceTeamUserRecord);
106 102
     }
107 103
 
108 104
     /**
109 105
      * 修改考勤班组成员
110
-     * 
106
+     *
111 107
      * @param attendanceTeamUserRecord 考勤班组成员
112 108
      * @return 结果
113 109
      */
114 110
     @Override
115
-    public int updateAttendanceTeamUserRecord(AttendanceTeamUserRecord attendanceTeamUserRecord)
116
-    {
111
+    public int updateAttendanceTeamUserRecord(AttendanceTeamUserRecord attendanceTeamUserRecord) {
117 112
         attendanceTeamUserRecord.setUpdateTime(DateUtils.getNowDate());
118 113
         return attendanceTeamUserRecordMapper.updateAttendanceTeamUserRecord(attendanceTeamUserRecord);
119 114
     }
120 115
 
121 116
     /**
122 117
      * 批量删除考勤班组成员
123
-     * 
118
+     *
124 119
      * @param userIds 需要删除的考勤班组成员主键
125 120
      * @return 结果
126 121
      */
127 122
     @Override
128
-    public int deleteAttendanceTeamUserRecordByUserIds(Long[] userIds)
129
-    {
123
+    public int deleteAttendanceTeamUserRecordByUserIds(Long[] userIds) {
130 124
         return attendanceTeamUserRecordMapper.deleteAttendanceTeamUserRecordByUserIds(userIds);
131 125
     }
132 126
 
133 127
     /**
134 128
      * 删除考勤班组成员信息
135
-     * 
129
+     *
136 130
      * @param userId 考勤班组成员主键
137 131
      * @return 结果
138 132
      */
139 133
     @Override
140
-    public int deleteAttendanceTeamUserRecordByUserId(Long userId)
141
-    {
134
+    public int deleteAttendanceTeamUserRecordByUserId(Long userId) {
142 135
         return attendanceTeamUserRecordMapper.deleteAttendanceTeamUserRecordByUserId(userId);
143 136
     }
144 137
 
145 138
     /**
146
-     *  批量插入考勤班组成员
139
+     * 批量插入考勤班组成员
140
+     *
147 141
      * @param attendanceTeamUserRecord
148 142
      * @return
149 143
      */
@@ -153,10 +147,10 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
153 147
         attendanceTeamUserRecord.forEach(record -> {
154 148
             record.setCreateTime(DateUtils.getNowDate());
155 149
             record.setCreateBy(getUsername());
156
-            if(Objects.isNull(record.getAttendanceDate())){
150
+            if (Objects.isNull(record.getAttendanceDate())) {
157 151
                 record.setAttendanceDate(DateUtils.getNowDate());
158 152
             }
159
-            if(Objects.isNull(record.getUserId())){
153
+            if (Objects.isNull(record.getUserId())) {
160 154
                 throw new ServiceException("用户id不能为空");
161 155
             }
162 156
 
@@ -186,7 +180,7 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
186 180
                 }
187 181
             }
188 182
         });
189
-        if(userName.size()>0){
183
+        if (userName.size() > 0) {
190 184
             throw new ServiceException(StrUtil.format("用户{}在当前班次周期内已维护", JSONArray.toJSONString(userName)));
191 185
         }
192 186
         return attendanceTeamUserRecordMapper.insertAttendanceTeamUserRecordList(attendanceTeamUserRecord);
@@ -198,21 +192,21 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
198 192
         attendanceTeamUserRecord.setAttendanceDate(DateUtils.getNowDate());
199 193
         List<AttendanceTeamUserRecord> attendanceTeamUserRecords = selectAttendanceTeamUserRecordList(attendanceTeamUserRecord);
200 194
         List<Long> collect = attendanceTeamUserRecords.stream().map(AttendanceTeamUserRecord::getAttendanceTeamId).collect(Collectors.toList());
201
-        if(CollectionUtil.isEmpty( collect)){
202
-            return new ArrayList<>() ;
195
+        if (CollectionUtil.isEmpty(collect)) {
196
+            return new ArrayList<>();
203 197
         }
204 198
         List<Long> longs = userMapper.selectAttendanceTeamLeaderId(collect);
205
-        if(CollectionUtil.isEmpty(longs)){
199
+        if (CollectionUtil.isEmpty(longs)) {
206 200
             return new ArrayList<>();
207 201
         }
208 202
         return longs.stream().distinct().collect(Collectors.toList());
209 203
     }
210 204
 
211 205
 
212
-
213 206
     /**
214 207
      * 判断是否存在班次周期内的记录
215
-     * @param records 查询到的记录列表
208
+     *
209
+     * @param records    查询到的记录列表
216 210
      * @param targetDate 目标日期
217 211
      * @return 是否存在班次周期内的记录
218 212
      */
@@ -222,6 +216,7 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
222 216
 
223 217
     /**
224 218
      * 判断指定日期是否在目标日期的班次周期内(当日7:00 - 次日7:00)
219
+     *
225 220
      * @param recordDate 记录日期
226 221
      * @param targetDate 目标日期
227 222
      * @return 是否在班次周期内
@@ -261,8 +256,8 @@ public class AttendanceTeamUserRecordServiceImpl implements IAttendanceTeamUserR
261 256
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
262 257
         try {
263 258
             //判断targetDate是否在7点之前
264
-            if (targetDate.before(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(sdf.format(targetDate) +" "+ time))) {
265
-                targetDate=DateUtils.addDays(targetDate, -1);
259
+            if (targetDate.before(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(sdf.format(targetDate) + " " + time))) {
260
+                targetDate = DateUtils.addDays(targetDate, -1);
266 261
             }
267 262
             return targetDate;
268 263
         } catch (ParseException e) {

+ 25 - 12
airport-attendance/src/main/resources/mapper/attendance/AttendanceAreaMapper.xml

@@ -24,21 +24,34 @@
24 24
     </resultMap>
25 25
 
26 26
     <sql id="selectAttendanceCheckRecordVo">
27
-        select id, area_name, address, longitude, latitude, radius, status, create_time, update_time from attendance_area
27
+        select id,
28
+               area_name,
29
+               address,
30
+               longitude,
31
+               latitude,
32
+               radius,
33
+               status,
34
+               create_time,
35
+               update_time
36
+        from attendance_area
28 37
     </sql>
29 38
 
30 39
     <select id="findValidAreasEfficiently" resultMap="DistanceResultMap">
31
-        SELECT
32
-            id, area_name, address,
33
-            longitude, latitude, radius, status,
34
-            create_time, update_time,
35
-            ST_Distance_Sphere(
36
-                    POINT(longitude, latitude),
37
-                    POINT(#{lng}, #{lat})
38
-            ) AS distance
40
+        SELECT id,
41
+               area_name,
42
+               address,
43
+               longitude,
44
+               latitude,
45
+               radius,
46
+               status,
47
+               create_time,
48
+               update_time,
49
+               ST_Distance_Sphere(
50
+                       POINT(longitude, latitude),
51
+                       POINT(#{lng}, #{lat})
52
+               ) AS distance
39 53
         FROM attendance_area
40
-        WHERE
41
-            status = 1
54
+        WHERE status = 1
42 55
           AND longitude IS NOT NULL
43 56
           AND latitude IS NOT NULL
44 57
           AND longitude BETWEEN -180 AND 180
@@ -49,7 +62,7 @@
49 62
               ) BETWEEN 0 AND radius
50 63
     </select>
51 64
 
52
-    <select id="areaList"  resultMap="DistanceResultMap">
65
+    <select id="areaList" resultMap="DistanceResultMap">
53 66
         <include refid="selectAttendanceCheckRecordVo"/>
54 67
         WHERE
55 68
         status = 1

+ 52 - 31
airport-attendance/src/main/resources/mapper/attendance/AttendanceCheckRecordMapper.xml

@@ -5,48 +5,66 @@
5 5
 <mapper namespace="com.sundot.airport.attendance.mapper.AttendanceCheckRecordMapper">
6 6
 
7 7
     <resultMap type="AttendanceCheckRecord" id="AttendanceCheckRecordResult">
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="id"    column="id"    />
15
-        <result property="userId"    column="user_id"    />
16
-        <result property="checkInType"    column="check_in_type"    />
17
-        <result property="checkInTime"    column="check_in_time"    />
18
-        <result property="userName"    column="user_name"    />
19
-        <result property="remark"    column="remark"    />
20
-        <result property="checkInTypeDesc"    column="check_in_type_desc"    />
21
-        <result property="checkInPosition"    column="check_in_position"    />
22
-        <result property="checkInDate"    column="check_in_date"    />
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="id" column="id"/>
15
+        <result property="userId" column="user_id"/>
16
+        <result property="checkInType" column="check_in_type"/>
17
+        <result property="checkInTime" column="check_in_time"/>
18
+        <result property="userName" column="user_name"/>
19
+        <result property="remark" column="remark"/>
20
+        <result property="checkInTypeDesc" column="check_in_type_desc"/>
21
+        <result property="checkInPosition" column="check_in_position"/>
22
+        <result property="checkInDate" column="check_in_date"/>
23 23
     </resultMap>
24 24
 
25 25
     <sql id="selectAttendanceCheckRecordVo">
26
-        select tenant_id, revision, create_by, create_time, update_by, update_time, id, user_id, check_in_type, check_in_time, user_name, remark, check_in_type_desc, check_in_position, check_in_date from attendance_check_record
26
+        select tenant_id,
27
+               revision,
28
+               create_by,
29
+               create_time,
30
+               update_by,
31
+               update_time,
32
+               id,
33
+               user_id,
34
+               check_in_type,
35
+               check_in_time,
36
+               user_name,
37
+               remark,
38
+               check_in_type_desc,
39
+               check_in_position,
40
+               check_in_date
41
+        from attendance_check_record
27 42
     </sql>
28 43
 
29
-    <select id="selectAttendanceCheckRecordList" parameterType="AttendanceCheckRecord" resultMap="AttendanceCheckRecordResult">
44
+    <select id="selectAttendanceCheckRecordList" parameterType="AttendanceCheckRecord"
45
+            resultMap="AttendanceCheckRecordResult">
30 46
         <include refid="selectAttendanceCheckRecordVo"/>
31 47
         <where>
32
-            <if test="tenantId != null  and tenantId != ''"> and tenant_id = #{tenantId}</if>
33
-            <if test="revision != null "> and revision = #{revision}</if>
34
-            <if test="userId != null "> and user_id = #{userId}</if>
35
-            <if test="checkInType != null  and checkInType != ''"> and check_in_type = #{checkInType}</if>
36
-            <if test="checkInTime != null "> and check_in_time = #{checkInTime}</if>
37
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
38
-            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
39
-            <if test="checkInTypeDesc != null  and checkInTypeDesc != ''"> and check_in_type_desc = #{checkInTypeDesc}</if>
40
-            <if test="checkInPosition != null  and checkInPosition != ''"> and check_in_position = #{checkInPosition}</if>
41
-            <if test="checkInDate != null "> and check_in_date = #{checkInDate}</if>
48
+            <if test="tenantId != null  and tenantId != ''">and tenant_id = #{tenantId}</if>
49
+            <if test="revision != null ">and revision = #{revision}</if>
50
+            <if test="userId != null ">and user_id = #{userId}</if>
51
+            <if test="checkInType != null  and checkInType != ''">and check_in_type = #{checkInType}</if>
52
+            <if test="checkInTime != null ">and check_in_time = #{checkInTime}</if>
53
+            <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
54
+            <if test="remark != null  and remark != ''">and remark = #{remark}</if>
55
+            <if test="checkInTypeDesc != null  and checkInTypeDesc != ''">and check_in_type_desc = #{checkInTypeDesc}
56
+            </if>
57
+            <if test="checkInPosition != null  and checkInPosition != ''">and check_in_position = #{checkInPosition}
58
+            </if>
59
+            <if test="checkInDate != null ">and check_in_date = #{checkInDate}</if>
42 60
             <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
43 61
                 and date_format(check_in_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
44 62
             </if>
45 63
             <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
46 64
                 and date_format(check_in_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
47 65
             </if>
48
-            <if test="checkInDateStart != null "> and check_in_date &gt;= concat(#{checkInDateStart}, ' 00:00:00')</if>
49
-            <if test="checkInDateEnd != null "> and check_in_date &lt;= concat(#{checkInDateEnd}, ' 23:59:59')</if>
66
+            <if test="checkInDateStart != null ">and check_in_date &gt;= concat(#{checkInDateStart}, ' 00:00:00')</if>
67
+            <if test="checkInDateEnd != null ">and check_in_date &lt;= concat(#{checkInDateEnd}, ' 23:59:59')</if>
50 68
         </where>
51 69
         order by create_time desc
52 70
     </select>
@@ -56,7 +74,8 @@
56 74
         where id = #{id}
57 75
     </select>
58 76
 
59
-    <insert id="insertAttendanceCheckRecord" parameterType="AttendanceCheckRecord" useGeneratedKeys="true" keyProperty="id">
77
+    <insert id="insertAttendanceCheckRecord" parameterType="AttendanceCheckRecord" useGeneratedKeys="true"
78
+            keyProperty="id">
60 79
         insert into attendance_check_record
61 80
         <trim prefix="(" suffix=")" suffixOverrides=",">
62 81
             <if test="tenantId != null">tenant_id,</if>
@@ -114,7 +133,9 @@
114 133
     </update>
115 134
 
116 135
     <delete id="deleteAttendanceCheckRecordById" parameterType="Long">
117
-        delete from attendance_check_record where id = #{id}
136
+        delete
137
+        from attendance_check_record
138
+        where id = #{id}
118 139
     </delete>
119 140
 
120 141
     <delete id="deleteAttendanceCheckRecordByIds" parameterType="String">

File diff suppressed because it is too large
+ 144 - 87
airport-attendance/src/main/resources/mapper/attendance/AttendancePostRecordMapper.xml


+ 85 - 53
airport-attendance/src/main/resources/mapper/attendance/AttendanceRecordMapper.xml

@@ -1,67 +1,97 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.sundot.airport.attendance.mapper.AttendanceRecordMapper">
6
-    
6
+
7 7
     <resultMap type="AttendanceRecord" id="AttendanceRecordResult">
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="id"    column="id"    />
15
-        <result property="userId"    column="user_id"    />
16
-        <result property="checkInTime"    column="check_in_time"    />
17
-        <result property="checkOutTime"    column="check_out_time"    />
18
-        <result property="workDuration"    column="work_duration"    />
19
-        <result property="status"    column="status"    />
20
-        <result property="teamCode"    column="team_code"    />
21
-        <result property="teamName"    column="team_name"    />
22
-        <result property="departmentCode"    column="department_code"    />
23
-        <result property="departmentName"    column="department_name"    />
24
-        <result property="stationCode"    column="station_code"    />
25
-        <result property="stationName"    column="station_name"    />
26
-        <result property="userName"    column="user_name"    />
27
-        <result property="remark"    column="remark"    />
28
-        <result property="attendanceDate"    column="attendance_date"    />
29
-        <result property="overDuration"    column="over_duration"    />
30
-        <result property="statusDesc"    column="status_desc"    />
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="id" column="id"/>
15
+        <result property="userId" column="user_id"/>
16
+        <result property="checkInTime" column="check_in_time"/>
17
+        <result property="checkOutTime" column="check_out_time"/>
18
+        <result property="workDuration" column="work_duration"/>
19
+        <result property="status" column="status"/>
20
+        <result property="teamCode" column="team_code"/>
21
+        <result property="teamName" column="team_name"/>
22
+        <result property="departmentCode" column="department_code"/>
23
+        <result property="departmentName" column="department_name"/>
24
+        <result property="stationCode" column="station_code"/>
25
+        <result property="stationName" column="station_name"/>
26
+        <result property="userName" column="user_name"/>
27
+        <result property="remark" column="remark"/>
28
+        <result property="attendanceDate" column="attendance_date"/>
29
+        <result property="overDuration" column="over_duration"/>
30
+        <result property="statusDesc" column="status_desc"/>
31 31
     </resultMap>
32 32
 
33 33
     <sql id="selectAttendanceRecordVo">
34
-        select tenant_id, revision, create_by, create_time, update_by, update_time, id, user_id, check_in_time, check_out_time, work_duration, status, team_code, team_name, department_code, department_name, station_code, station_name, user_name, remark, attendance_date, over_duration, status_desc from attendance_record
34
+        select tenant_id,
35
+               revision,
36
+               create_by,
37
+               create_time,
38
+               update_by,
39
+               update_time,
40
+               id,
41
+               user_id,
42
+               check_in_time,
43
+               check_out_time,
44
+               work_duration,
45
+               status,
46
+               team_code,
47
+               team_name,
48
+               department_code,
49
+               department_name,
50
+               station_code,
51
+               station_name,
52
+               user_name,
53
+               remark,
54
+               attendance_date,
55
+               over_duration,
56
+               status_desc
57
+        from attendance_record
35 58
     </sql>
36 59
 
37 60
     <select id="selectAttendanceRecordList" parameterType="AttendanceRecord" resultMap="AttendanceRecordResult">
38 61
         <include refid="selectAttendanceRecordVo"/>
39
-        <where>  
40
-            <if test="tenantId != null  and tenantId != ''"> and tenant_id = #{tenantId}</if>
41
-            <if test="revision != null "> and revision = #{revision}</if>
42
-            <if test="userId != null "> and user_id = #{userId}</if>
43
-            <if test="checkInTime != null "> and check_in_time = #{checkInTime}</if>
44
-            <if test="checkOutTime != null "> and check_out_time = #{checkOutTime}</if>
45
-            <if test="workDuration != null "> and work_duration = #{workDuration}</if>
46
-            <if test="status != null  and status != ''"> and status = #{status}</if>
47
-            <if test="teamCode != null  and teamCode != ''"> and team_code = #{teamCode}</if>
48
-            <if test="teamName != null  and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
49
-            <if test="departmentCode != null  and departmentCode != ''"> and department_code = #{departmentCode}</if>
50
-            <if test="departmentName != null  and departmentName != ''"> and department_name like concat('%', #{departmentName}, '%')</if>
51
-            <if test="stationCode != null  and stationCode != ''"> and station_code = #{stationCode}</if>
52
-            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
53
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
54
-            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
55
-            <if test="attendanceDate != null "> and attendance_date = #{attendanceDate}</if>
56
-            <if test="overDuration != null "> and over_duration = #{overDuration}</if>
57
-            <if test="statusDesc != null  and statusDesc != ''"> and status_desc = #{statusDesc}</if>
62
+        <where>
63
+            <if test="tenantId != null  and tenantId != ''">and tenant_id = #{tenantId}</if>
64
+            <if test="revision != null ">and revision = #{revision}</if>
65
+            <if test="userId != null ">and user_id = #{userId}</if>
66
+            <if test="checkInTime != null ">and check_in_time = #{checkInTime}</if>
67
+            <if test="checkOutTime != null ">and check_out_time = #{checkOutTime}</if>
68
+            <if test="workDuration != null ">and work_duration = #{workDuration}</if>
69
+            <if test="status != null  and status != ''">and status = #{status}</if>
70
+            <if test="teamCode != null  and teamCode != ''">and team_code = #{teamCode}</if>
71
+            <if test="teamName != null  and teamName != ''">and team_name like concat('%', #{teamName}, '%')</if>
72
+            <if test="departmentCode != null  and departmentCode != ''">and department_code = #{departmentCode}</if>
73
+            <if test="departmentName != null  and departmentName != ''">and department_name like concat('%',
74
+                #{departmentName}, '%')
75
+            </if>
76
+            <if test="stationCode != null  and stationCode != ''">and station_code = #{stationCode}</if>
77
+            <if test="stationName != null  and stationName != ''">and station_name like concat('%', #{stationName},
78
+                '%')
79
+            </if>
80
+            <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
81
+            <if test="remark != null  and remark != ''">and remark = #{remark}</if>
82
+            <if test="attendanceDate != null ">and attendance_date = #{attendanceDate}</if>
83
+            <if test="overDuration != null ">and over_duration = #{overDuration}</if>
84
+            <if test="statusDesc != null  and statusDesc != ''">and status_desc = #{statusDesc}</if>
58 85
 
59
-            <if test="attendanceDateStart != null "> and attendance_date &gt;= concat(#{attendanceDateStart}, ' 00:00:00')</if>
60
-            <if test="attendanceDateEnd != null "> and attendance_date &lt;= concat(#{attendanceDateEnd}, ' 23:59:59')</if>
86
+            <if test="attendanceDateStart != null ">and attendance_date &gt;= concat(#{attendanceDateStart}, '
87
+                00:00:00')
88
+            </if>
89
+            <if test="attendanceDateEnd != null ">and attendance_date &lt;= concat(#{attendanceDateEnd}, ' 23:59:59')
90
+            </if>
61 91
         </where>
62 92
         order by create_time desc
63 93
     </select>
64
-    
94
+
65 95
     <select id="selectAttendanceRecordById" parameterType="Long" resultMap="AttendanceRecordResult">
66 96
         <include refid="selectAttendanceRecordVo"/>
67 97
         where id = #{id}
@@ -92,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
92 122
             <if test="attendanceDate != null">attendance_date,</if>
93 123
             <if test="overDuration != null">over_duration,</if>
94 124
             <if test="statusDesc != null and statusDesc != ''">status_desc,</if>
95
-         </trim>
125
+        </trim>
96 126
         <trim prefix="values (" suffix=")" suffixOverrides=",">
97 127
             <if test="tenantId != null">#{tenantId},</if>
98 128
             <if test="revision != null">#{revision},</if>
@@ -116,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
116 146
             <if test="attendanceDate != null">#{attendanceDate},</if>
117 147
             <if test="overDuration != null">#{overDuration},</if>
118 148
             <if test="statusDesc != null and statusDesc != ''">#{statusDesc},</if>
119
-         </trim>
149
+        </trim>
120 150
     </insert>
121 151
 
122 152
     <update id="updateAttendanceRecord" parameterType="AttendanceRecord">
@@ -149,11 +179,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
149 179
     </update>
150 180
 
151 181
     <delete id="deleteAttendanceRecordById" parameterType="Long">
152
-        delete from attendance_record where id = #{id}
182
+        delete
183
+        from attendance_record
184
+        where id = #{id}
153 185
     </delete>
154 186
 
155 187
     <delete id="deleteAttendanceRecordByIds" parameterType="String">
156
-        delete from attendance_record where id in 
188
+        delete from attendance_record where id in
157 189
         <foreach item="id" collection="array" open="(" separator="," close=")">
158 190
             #{id}
159 191
         </foreach>

+ 73 - 42
airport-attendance/src/main/resources/mapper/attendance/AttendanceTeamUserRecordMapper.xml

@@ -1,51 +1,69 @@
1 1
 <?xml version="1.0" encoding="UTF-8" ?>
2 2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.sundot.airport.attendance.mapper.AttendanceTeamUserRecordMapper">
6
-    
6
+
7 7
     <resultMap type="AttendanceTeamUserRecord" id="AttendanceTeamUserRecordResult">
8
-        <result property="userId"    column="user_id"    />
9
-        <result property="userCode"    column="user_code"    />
10
-        <result property="userName"    column="user_name"    />
11
-        <result property="terminlCode"    column="terminl_code"    />
12
-        <result property="terminlName"    column="terminl_name"    />
13
-        <result property="attendanceDate"    column="attendance_date"    />
14
-        <result property="attendanceTeamId"    column="attendance_team_id"    />
15
-        <result property="attendanceTeamName"    column="attendance_team_name"    />
16
-        <result property="createBy"    column="create_by"    />
17
-        <result property="createTime"    column="create_time"    />
18
-        <result property="updateBy"    column="update_by"    />
19
-        <result property="updateTime"    column="update_time"    />
20
-        <result property="remark"    column="remark"    />
8
+        <result property="userId" column="user_id"/>
9
+        <result property="userCode" column="user_code"/>
10
+        <result property="userName" column="user_name"/>
11
+        <result property="terminlCode" column="terminl_code"/>
12
+        <result property="terminlName" column="terminl_name"/>
13
+        <result property="attendanceDate" column="attendance_date"/>
14
+        <result property="attendanceTeamId" column="attendance_team_id"/>
15
+        <result property="attendanceTeamName" column="attendance_team_name"/>
16
+        <result property="createBy" column="create_by"/>
17
+        <result property="createTime" column="create_time"/>
18
+        <result property="updateBy" column="update_by"/>
19
+        <result property="updateTime" column="update_time"/>
20
+        <result property="remark" column="remark"/>
21 21
     </resultMap>
22 22
 
23 23
     <sql id="selectAttendanceTeamUserRecordVo">
24
-        select user_id, user_code, user_name, terminl_code, terminl_name, attendance_date, attendance_team_id, attendance_team_name, create_by, create_time, update_by, update_time, remark from attendance_team_user_record
24
+        select user_id,
25
+               user_code,
26
+               user_name,
27
+               terminl_code,
28
+               terminl_name,
29
+               attendance_date,
30
+               attendance_team_id,
31
+               attendance_team_name,
32
+               create_by,
33
+               create_time,
34
+               update_by,
35
+               update_time,
36
+               remark
37
+        from attendance_team_user_record
25 38
     </sql>
26 39
 
27
-    <select id="selectAttendanceTeamUserRecordList" parameterType="AttendanceTeamUserRecord" resultMap="AttendanceTeamUserRecordResult">
40
+    <select id="selectAttendanceTeamUserRecordList" parameterType="AttendanceTeamUserRecord"
41
+            resultMap="AttendanceTeamUserRecordResult">
28 42
         <include refid="selectAttendanceTeamUserRecordVo"/>
29
-        <where>  
30
-            <if test="userId != null "> and user_id = #{userId}</if>
31
-            <if test="userCode != null  and userCode != ''"> and user_code = #{userCode}</if>
32
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
33
-            <if test="terminlCode != null  and terminlCode != ''"> and terminl_code = #{terminlCode}</if>
34
-            <if test="terminlName != null  and terminlName != ''"> and terminl_name like concat('%', #{terminlName}, '%')</if>
35
-            <if test="attendanceDate != null "> and attendance_date = #{attendanceDate}</if>
43
+        <where>
44
+            <if test="userId != null ">and user_id = #{userId}</if>
45
+            <if test="userCode != null  and userCode != ''">and user_code = #{userCode}</if>
46
+            <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
47
+            <if test="terminlCode != null  and terminlCode != ''">and terminl_code = #{terminlCode}</if>
48
+            <if test="terminlName != null  and terminlName != ''">and terminl_name like concat('%', #{terminlName},
49
+                '%')
50
+            </if>
51
+            <if test="attendanceDate != null ">and attendance_date = #{attendanceDate}</if>
36 52
             <!-- 添加时间范围查询支持 -->
37
-            <if test="attendanceDateStart != null "> and create_time >= #{attendanceDateStart}</if>
38
-            <if test="attendanceDateEnd != null "> and create_time &lt;= #{attendanceDateEnd}</if>
39
-            <if test="attendanceTeamId != null "> and attendance_team_id = #{attendanceTeamId}</if>
40
-            <if test="attendanceTeamName != null  and attendanceTeamName != ''"> and attendance_team_name like concat('%', #{attendanceTeamName}, '%')</if>
53
+            <if test="attendanceDateStart != null ">and create_time >= #{attendanceDateStart}</if>
54
+            <if test="attendanceDateEnd != null ">and create_time &lt;= #{attendanceDateEnd}</if>
55
+            <if test="attendanceTeamId != null ">and attendance_team_id = #{attendanceTeamId}</if>
56
+            <if test="attendanceTeamName != null  and attendanceTeamName != ''">and attendance_team_name like
57
+                concat('%', #{attendanceTeamName}, '%')
58
+            </if>
41 59
         </where>
42 60
         order by create_time desc
43 61
     </select>
44
-    
45
-    <select id="selectAttendanceTeamUserRecordByUserId"  resultMap="AttendanceTeamUserRecordResult">
62
+
63
+    <select id="selectAttendanceTeamUserRecordByUserId" resultMap="AttendanceTeamUserRecordResult">
46 64
         <include refid="selectAttendanceTeamUserRecordVo"/>
47 65
         where user_id = #{userId}
48
-         and DATE(attendance_date) = DATE(#{attendanceDate})
66
+        and DATE(attendance_date) = DATE(#{attendanceDate})
49 67
     </select>
50 68
 
51 69
     <insert id="insertAttendanceTeamUserRecord" parameterType="AttendanceTeamUserRecord">
@@ -64,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
64 82
             <if test="updateBy != null">update_by,</if>
65 83
             <if test="updateTime != null">update_time,</if>
66 84
             <if test="remark != null">remark,</if>
67
-         </trim>
85
+        </trim>
68 86
         <trim prefix="values (" suffix=")" suffixOverrides=",">
69 87
             <if test="userId != null">#{userId},</if>
70 88
             <if test="userCode != null and userCode != ''">#{userCode},</if>
@@ -79,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
79 97
             <if test="updateBy != null">#{updateBy},</if>
80 98
             <if test="updateTime != null">#{updateTime},</if>
81 99
             <if test="remark != null">#{remark},</if>
82
-         </trim>
100
+        </trim>
83 101
     </insert>
84 102
 
85 103
     <update id="updateAttendanceTeamUserRecord" parameterType="AttendanceTeamUserRecord">
@@ -102,11 +120,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
102 120
     </update>
103 121
 
104 122
     <delete id="deleteAttendanceTeamUserRecordByUserId" parameterType="Long">
105
-        delete from attendance_team_user_record where user_id = #{userId}
123
+        delete
124
+        from attendance_team_user_record
125
+        where user_id = #{userId}
106 126
     </delete>
107 127
 
108 128
     <delete id="deleteAttendanceTeamUserRecordByUserIds" parameterType="String">
109
-        delete from attendance_team_user_record where user_id in 
129
+        delete from attendance_team_user_record where user_id in
110 130
         <foreach item="userId" collection="array" open="(" separator="," close=")">
111 131
             #{userId}
112 132
         </foreach>
@@ -125,14 +145,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
125 145
     </insert>
126 146
 
127 147
     <select id="selectAttendanceTeamUserRecordByUserIdAndDateRange" resultMap="AttendanceTeamUserRecordResult">
128
-        SELECT
129
-        tenant_id, revision, create_by, create_time, update_by, update_time,
130
-        user_id, user_name, user_code, terminl_code, terminl_name,
131
-        attendance_date, attendance_team_id, attendance_team_name, remark
148
+        SELECT tenant_id,
149
+               revision,
150
+               create_by,
151
+               create_time,
152
+               update_by,
153
+               update_time,
154
+               user_id,
155
+               user_name,
156
+               user_code,
157
+               terminl_code,
158
+               terminl_name,
159
+               attendance_date,
160
+               attendance_team_id,
161
+               attendance_team_name,
162
+               remark
132 163
         FROM attendance_team_user_record
133 164
         WHERE user_id = #{userId}
134
-        AND attendance_date >= #{startDate}
135
-        AND attendance_date &lt;= #{endDate}
165
+          AND attendance_date >= #{startDate}
166
+          AND attendance_date &lt;= #{endDate}
136 167
     </select>
137 168
 
138 169