From eee53d706bc20edd58b26807e1e41ff8aa05fbc7 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Thu, 26 Feb 2026 09:01:05 +0000
Subject: [PATCH] 新增合同邮寄相关(补充)

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
index c4c7147..a3330e2 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
@@ -241,7 +241,8 @@
                 }
 
                 Boolean isHoliday = false;
-                if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
+                // 因存在周六日是工作日的情况,所以不能单纯用周六日作为判断条件
+                if (attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
                     isHoliday = true;
                 }
                 // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(返回结果为空数组的情况下)
@@ -389,7 +390,8 @@
                 }
 
                 Boolean isHoliday = false;
-                if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
+                // 因存在周六日是工作日的情况,所以不能单纯用周六日作为判断条件
+                if (attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
                     isHoliday = true;
                 }
                 // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(oapiDingTalkRecordResultList为空的情况下)
@@ -816,16 +818,16 @@
             } else {
                 // 上午
                 if (day) {
-                    // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
-                    if (duration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+                    // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+                    if (duration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                         attendance.setStartClockResults(type);
                         attendance.setStartLocationResults(null);
                     } else {
                         attendance.setStartClockResults(Constant.ATTENDANCE_STATE_LACK_OF_TIME);
                     }
                 } else {
-                    // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
-                    if (duration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+                    // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+                    if (duration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                         attendance.setEndClockResults(type);
                         attendance.setEndLocationResults(null);
                     } else {
@@ -847,16 +849,16 @@
             } else {
                 //打卡的情况,修改考勤状态
                 if (day) {
-                    // TODO:20250805修改 排除休息日情况
-                    if ((duration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+                    // TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+                    if ((duration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                         attendance.setStartClockResults(type);
                         attendance.setStartLocationResults(null);
                     } else {
                         attendance.setStartClockResults(Constant.ATTENDANCE_STATE_LACK_OF_TIME);
                     }
                 } else {
-                    // TODO:20250805修改 排除休息日情况
-                    if ((duration + noonResult1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+                    // TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+                    if ((duration + noonResult1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                         attendance.setEndClockResults(type);
                         attendance.setEndLocationResults(null);
                     } else {
@@ -975,8 +977,8 @@
      */
     public void setAttendance(Double sDuration, Double eDuration, Double result, Double noonResult, Attendance attendance, String type) {
         if (ObjectUtils.isEmpty(eDuration) && ObjectUtils.isEmpty(noonResult)) {
-            // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
-            if (sDuration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+            // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+            if (sDuration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                 attendance.setStartClockResults(type);
                 attendance.setStartLocationResults(null);
             } else {
@@ -984,8 +986,8 @@
             }
         }
         if (ObjectUtils.isEmpty(sDuration) && ObjectUtils.isEmpty(result)) {
-            // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
-            if (eDuration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+            // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+            if (eDuration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                 attendance.setEndClockResults(type);
                 attendance.setEndLocationResults(null);
             } else {
@@ -1006,8 +1008,8 @@
      */
     public void setAttendanceStart(Double sDuration, Double eDuration, Double result1, Double result, Double noonResult, Attendance attendance, String type) {
         if (ObjectUtils.isEmpty(eDuration) && sDuration > 0) {
-            // TODO:20250805修改 排除休息日情况
-            if ((sDuration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+            // TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+            if ((sDuration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                 attendance.setStartClockResults(type);
                 attendance.setStartLocationResults(null);
             } else {
@@ -1015,8 +1017,8 @@
             }
         }
         if (ObjectUtils.isEmpty(sDuration) && eDuration > 0) {
-            // TODO:20250805修改 排除休息日情况
-            if ((eDuration + result1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
+            // TODO:20250805修改 排除休息日情况(如果打卡了,考勤时间需要闭环)
+            if ((eDuration + result1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST) || ((attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND) || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) && ((attendance.getActualWorkStartTime() == null) == (attendance.getActualWorkEndTime() == null)))) {
                 attendance.setEndClockResults(type);
                 attendance.setEndLocationResults(null);
             } else {

--
Gitblit v1.9.3