From dbf09c89d095f186d34637d9bce3373947c8086c Mon Sep 17 00:00:00 2001 From: ieaii <1069385070@qq.com> Date: Mon, 30 Dec 2024 15:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=80=E4=B8=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clockinlog/controller/ClockinLogController.java | 21 ++++++++++++++++++--- .../modules/clockinlog/mapper/ClockinLogMapper.java | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java index 9325578..9fc291a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java @@ -1,5 +1,7 @@ package org.jeecg.modules.clockinlog.controller; +import java.time.DayOfWeek; +import java.time.LocalDateTime; import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; @@ -196,7 +198,7 @@ public class ClockinLogController extends JeecgController clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId()); + Date date = DateUtils2.getDate(yearMonthDay + " 23:59:59"); + LocalDateTime localDateTime = DateUtils2.dateToDateTime(date); + Integer type = 0; + if(DayOfWeek.SATURDAY.equals(localDateTime.getDayOfWeek()) || DayOfWeek.SUNDAY.equals(localDateTime.getDayOfWeek())){ + type = 1; + } + + List clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId(),type); String clockInTime = ""; for (ClockInLogResp clockInLogResp:clockInLogExpeort) { @@ -362,8 +371,14 @@ public class ClockinLogController extends JeecgController clockInLogs = clockinLogMapper.getClockInLogExpeort( - yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId() + yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId(),type ); // 拼接打卡时间或标记“缺卡” diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java index 2e4a605..4ba6098 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java @@ -41,7 +41,7 @@ public interface ClockinLogMapper extends BaseMapper { @Select("SELECT IFNULL(count(1),0) FROM clockin_log WHERE del_flag = 0 AND user_id = #{userId} AND clock_in_time like '%${date}%' AND type in (0,1)") Integer getClockInTotal(@Param("userId") String userId,@Param("date") String date); - @Select("select clock_start_time,(select clock_in_time from clockin_log where project_item_id = a.id and del_flag = 0 and user_id = '${userId}' and clock_in_time like '%${date}%') time from clock_in_project_item a where project_id = '${projectId}'\n") - List getClockInLogExpeort(@Param("date") String date,@Param("projectId") String projectId,@Param("userId") String userId); + @Select("select clock_start_time,(select clock_in_time from clockin_log where project_item_id = a.id and del_flag = 0 and user_id = '${userId}' and clock_in_time like '%${date}%') time from clock_in_project_item a where project_id = '${projectId}' AND a.del_flag = 0 AND type = #{type}\n") + List getClockInLogExpeort(@Param("date") String date,@Param("projectId") String projectId,@Param("userId") String userId,@Param("type") Integer type); }