From 830e77d4bf5f529766402f97252d57c5e29d6c1d Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Thu, 13 Feb 2025 16:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E5=8B=A4=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=B0=E5=BD=95=E6=89=80=E5=9C=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/system/att/tasks/MsgTasks.java | 6 ++--- .../mapper/att/AttSourceDataMapper.xml | 26 +++++-------------- .../mapper/basic/SysNoticeMapper.xml | 5 ++-- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/tasks/MsgTasks.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/tasks/MsgTasks.java index e5f1b92..28f8703 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/tasks/MsgTasks.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/tasks/MsgTasks.java @@ -160,7 +160,7 @@ public class MsgTasks { * 考勤设置历史时间消息推送 *每天早七晚十一 */ -// @Scheduled(cron = "0 10 0,7,10 * * ?") +// @Scheduled(cron = "0 10 0,7,22 * * ?") @Scheduled(initialDelay = 6000 * 2,fixedDelay = 60000 * 30) @Async public void getAttSettingHistoryTask(){ @@ -169,10 +169,10 @@ public class MsgTasks { // 解析 startDate 字符串到 LocalDate 对象 LocalDate date = LocalDate.parse(startDate, DateTimeFormatter.ISO_LOCAL_DATE); // 向前推30天 - LocalDate newDate = date.minusDays(30); + LocalDate newDate = date.minusDays(60); // 如果需要将结果格式化为特定格式的字符串,可以使用以下代码 String formattedNewDate = newDate.format(DateTimeFormatter.ISO_LOCAL_DATE); - //向前推2个月的时间检索,缺少哪一天推送哪一天 + //向前推1个月的时间检索,缺少哪一天推送哪一天 List dateListOne = noticeService.getAttSettingDate(startDate); List dateList = getStrDateListBetween(formattedNewDate, startDate); // 从 dateList 中移除所有在 dateListOne 中存在的元素 diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/att/AttSourceDataMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/att/AttSourceDataMapper.xml index d9cd868..7639c0b 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/att/AttSourceDataMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/att/AttSourceDataMapper.xml @@ -77,6 +77,7 @@ END where user_id = #{params.userId} and org_id = #{params.orgId} AND att_current_day = #{params.attCurrentDay} and att_type = #{params.attType}; + update att_data_update set att_current_time = #{params.attCurrentTime}, att_address = #{params.attAddress}, att_lon = #{params.attLon}, att_lat = #{params.attLat}, data_source = #{params.dataSource}, @@ -93,17 +94,16 @@ - update att_data set att_status = #{v.attStatus} - where user_id = #{v.userId} and org_id = #{v.orgId} - and att_current_day = #{v.attCurrentDay} and att_type = #{v.attType} + update att_data set att_status = #{v.attStatus},org_id = #{v.orgId} + where user_id = #{v.userId} and att_current_day = #{v.attCurrentDay} and att_type = #{v.attType} and att_status = 0 - update att_data_update set att_status = #{v.attStatus} - where is_update = 0 and user_id = #{v.userId} and org_id = #{v.orgId} + update att_data_update set att_status = #{v.attStatus},org_id = #{v.orgId} + where is_update = 0 and user_id = #{v.userId} and att_current_day = #{v.attCurrentDay} and att_type = #{v.attType} and att_status = 0 @@ -278,13 +278,7 @@ left join sys_user su on su.id_number = asd.id_number left join att_setting_history ag on ag.user_id = su.user_id and ag.current_day = #{pushDate} left join att_group g on g.id = ag.group_id - where att_current_day - - >= #{pushDate} - - - = #{pushDate} - + where att_current_day = #{pushDate} and g.id is not null and asd.data_source = 1 union select asd.*, @@ -296,13 +290,7 @@ left join sys_user su on su.user_name = asd.name left join att_setting_history ag on ag.user_id = su.user_id and ag.current_day = #{pushDate} left join att_group g on g.id = ag.group_id - where att_current_day - - >= #{pushDate} - - - = #{pushDate} - + where att_current_day = #{pushDate} and g.id is not null and asd.data_source in (2,3) and (asd.att_type = 1 diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/basic/SysNoticeMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/basic/SysNoticeMapper.xml index ba8a891..831a633 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/basic/SysNoticeMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/basic/SysNoticeMapper.xml @@ -29,9 +29,9 @@ - replace into att_setting_history(user_id, group_id, org_id,current_day) values + replace into att_setting_history(user_id, group_id, current_day) values - (#{item.userId},#{item.groupId},#{item.orgId},#{item.currentDay}) + (#{item.userId},#{item.groupId},#{item.currentDay}) @@ -123,7 +123,6 @@ FROM ( SELECT - org_id, group_id, user_id, #{currentDay} as currentDay