Jelajahi Sumber

优化考勤的异常数据处理,当有全天请假的时候,忽略考勤打卡的时间

seyason 6 bulan lalu
induk
melakukan
6cd5ee9c0e

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java

@@ -578,8 +578,9 @@ public class UserCorpwxTimeController {
                 UserCorpwxTime time = changedCorpwxTimes.get(0);
                 resultMap.put("time", time);
 
-                //如果考勤时间为0,获取当日打卡记录
-                if (time.getWorkHours() == 0) {
+                //如果没有考勤,获取当日打卡记录
+                boolean hasTimeRecord = time.getWorkHours() > 0 || time.getCardTime() >= 1.0 || time.getAskLeaveTime() > 0 || time.getOutdoorTime() > 0;
+                if (!hasTimeRecord) {
                     LocalDateTime start1 = LocalDateTime.of(localDate, LocalTime.MIN);
                     LocalDateTime end1 = LocalDateTime.of(localDate, LocalTime.MAX).withSecond(0).withNano(0);
                     wxCorpInfoService.getUserPunchRecord(user.getCompanyId(),user.getId(),start1,end1,false);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -1307,7 +1307,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             JSONArray data = spTitle.getJSONArray("data");
                             for (int m = 0; m < data.size(); m++) {
                                 String leaveText = data.getJSONObject(m).getString("text");
-                                if (leaveText.contains("假") || leaveText.contains("休")) {
+                                if (leaveText.contains("假") || leaveText.contains("休") || leaveText.contains("其他")) {
                                     //只要有请假,就重新计算
                                     needRecaculate = true;
                                     //获取对应位置的请假时间段
@@ -1590,7 +1590,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             JSONArray data = spTitle.getJSONArray("data");
                             for (int m = 0; m < data.size(); m++) {
                                 String leaveText = data.getJSONObject(m).getString("text");
-                                if (leaveText.contains("假") || leaveText.contains("休")) {
+                                if (leaveText.contains("假") || leaveText.contains("休") || leaveText.contains("其他")) {
                                     //获取对应位置的请假时间段
                                     String string = holiday.getJSONObject("sp_description").getJSONArray("data").getJSONObject(m).getString("text");
                                     String[] s = string.split(" |\\~");