From 6da28ea4f40d34b26dc6984ccd4c4ebbb0c107c6 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Thu, 06 Nov 2025 06:10:49 +0000
Subject: [PATCH] 跨0点外出提交异常问题修改;对应换休修改;

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
index 4d6ad3d..abfdd41 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
@@ -174,25 +174,34 @@
             LocalTime startTime = resources.getOutStartTime().toLocalDateTime().toLocalTime();
             LocalTime endTime = resources.getOutEndTime().toLocalDateTime().toLocalTime();
             long distance = ChronoUnit.DAYS.between(startDate, endDate);
+            List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList());
             Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(localDate -> {
 //                SysConfigHolidayDto sysConfigHolidayDto = sysConfigHolidayService.queryByHolidayDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
 //                Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
 //                if ((sysConfigHolidayDto == null && !isWeekend) ||
 //                        sysConfigHolidayDto != null && Constant.DATE_TYPE_WEEKDAY.equals(sysConfigHolidayDto.getDateType())) {
                 AttendanceGoOut attendanceGoOut = new AttendanceGoOut();
-                //resUserId为null说明是添加,反之
+                // resUserId为null说明是添加,反之
                 if (resources.getUserId() == null) {
                     resources.setUserId(user.getId());
                 }
-                resources.setOutStartTime(Timestamp.valueOf(localDate.atTime(startTime)));
-                resources.setOutEndTime(Timestamp.valueOf(localDate.atTime(endTime)));
+
+                LocalDateTime goOutStartTime = localDate.atStartOfDay();
+                LocalDateTime goOutEndTime = localDate.atTime(LocalTime.MAX);
+                if (localDate.equals(endDate)) {
+                    goOutEndTime = localDate.atTime(endTime);
+                }
+                if (localDate.equals(startDate)) {
+                    goOutStartTime = localDate.atTime(startTime);
+                }
+                resources.setOutStartTime(Timestamp.valueOf(goOutStartTime));
+                resources.setOutEndTime(Timestamp.valueOf(goOutEndTime));
 
                 Double result = getRemainingTime(resources);
                 resources.setOutDuration(result);
                 resources.setApprovalStatus(Constant.GOOUT_APPROVE_STATUS_REVIEWED);
 
                 // 判断是否提交企微审批
-                List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList());
                 if (siteTypes.size() > 0) {
                     // 添加企微申请参数
                     resources.setWecomType(dictDetailRepository.findByDictNameAndValue("go_out_type", resources.getOutOfOfficeType()).getLabel());

--
Gitblit v1.9.3