修改考勤规则记录所在时间

This commit is contained in:
fl 2025-02-13 16:49:21 +08:00
parent bd059632ce
commit 830e77d4bf
3 changed files with 12 additions and 25 deletions

View File

@ -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) @Scheduled(initialDelay = 6000 * 2,fixedDelay = 60000 * 30)
@Async @Async
public void getAttSettingHistoryTask(){ public void getAttSettingHistoryTask(){
@ -169,10 +169,10 @@ public class MsgTasks {
// 解析 startDate 字符串到 LocalDate 对象 // 解析 startDate 字符串到 LocalDate 对象
LocalDate date = LocalDate.parse(startDate, DateTimeFormatter.ISO_LOCAL_DATE); LocalDate date = LocalDate.parse(startDate, DateTimeFormatter.ISO_LOCAL_DATE);
// 向前推30天 // 向前推30天
LocalDate newDate = date.minusDays(30); LocalDate newDate = date.minusDays(60);
// 如果需要将结果格式化为特定格式的字符串可以使用以下代码 // 如果需要将结果格式化为特定格式的字符串可以使用以下代码
String formattedNewDate = newDate.format(DateTimeFormatter.ISO_LOCAL_DATE); String formattedNewDate = newDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
//向前推2个月的时间检索缺少哪一天推送哪一天 //向前推1个月的时间检索缺少哪一天推送哪一天
List<String> dateListOne = noticeService.getAttSettingDate(startDate); List<String> dateListOne = noticeService.getAttSettingDate(startDate);
List<String> dateList = getStrDateListBetween(formattedNewDate, startDate); List<String> dateList = getStrDateListBetween(formattedNewDate, startDate);
// dateList 中移除所有在 dateListOne 中存在的元素 // dateList 中移除所有在 dateListOne 中存在的元素

View File

@ -77,6 +77,7 @@
END END
where user_id = #{params.userId} and org_id = #{params.orgId} where user_id = #{params.userId} and org_id = #{params.orgId}
AND att_current_day = #{params.attCurrentDay} and att_type = #{params.attType}; AND att_current_day = #{params.attCurrentDay} and att_type = #{params.attType};
update att_data_update set att_current_time = #{params.attCurrentTime}, update att_data_update set att_current_time = #{params.attCurrentTime},
att_address = #{params.attAddress}, att_lon = #{params.attLon}, att_lat = #{params.attLat}, att_address = #{params.attAddress}, att_lon = #{params.attLon}, att_lat = #{params.attLat},
data_source = #{params.dataSource}, data_source = #{params.dataSource},
@ -93,17 +94,16 @@
</update> </update>
<update id="updateAttData"> <update id="updateAttData">
update att_data set att_status = #{v.attStatus} update att_data set att_status = #{v.attStatus},org_id = #{v.orgId}
where user_id = #{v.userId} and org_id = #{v.orgId} where user_id = #{v.userId} and att_current_day = #{v.attCurrentDay} and att_type = #{v.attType}
and att_current_day = #{v.attCurrentDay} and att_type = #{v.attType}
<if test='type == "1"'> <if test='type == "1"'>
and att_status = 0 and att_status = 0
</if> </if>
</update> </update>
<update id="updateAttUpdateData"> <update id="updateAttUpdateData">
update att_data_update set att_status = #{v.attStatus} update att_data_update set att_status = #{v.attStatus},org_id = #{v.orgId}
where is_update = 0 and user_id = #{v.userId} and 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_current_day = #{v.attCurrentDay} and att_type = #{v.attType}
<if test='type == "1"'> <if test='type == "1"'>
and att_status = 0 and att_status = 0
@ -278,13 +278,7 @@
left join sys_user su on su.id_number = asd.id_number 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_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 left join att_group g on g.id = ag.group_id
where att_current_day where att_current_day = #{pushDate}
<if test=' pushType == "1" '>
>= #{pushDate}
</if>
<if test=' pushType == "2" '>
= #{pushDate}
</if>
and g.id is not null and asd.data_source = 1 and g.id is not null and asd.data_source = 1
union union
select asd.*, select asd.*,
@ -296,13 +290,7 @@
left join sys_user su on su.user_name = asd.name 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_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 left join att_group g on g.id = ag.group_id
where att_current_day where att_current_day = #{pushDate}
<if test=' pushType == "1" '>
>= #{pushDate}
</if>
<if test=' pushType == "2" '>
= #{pushDate}
</if>
and g.id is not null and g.id is not null
and asd.data_source in (2,3) and asd.data_source in (2,3)
and (asd.att_type = 1 and (asd.att_type = 1

View File

@ -29,9 +29,9 @@
</foreach> </foreach>
</insert> </insert>
<insert id="insertAttSettingHistoryData"> <insert id="insertAttSettingHistoryData">
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
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.userId},#{item.groupId},#{item.orgId},#{item.currentDay}) (#{item.userId},#{item.groupId},#{item.currentDay})
</foreach> </foreach>
</insert> </insert>
<update id="updateStatus"> <update id="updateStatus">
@ -123,7 +123,6 @@
FROM FROM
( (
SELECT SELECT
org_id,
group_id, group_id,
user_id, user_id,
#{currentDay} as currentDay #{currentDay} as currentDay