月报表导出问题修改

人员考勤组时间生成修改
This commit is contained in:
fl 2025-02-12 09:37:48 +08:00
parent 9bf8a8b7c8
commit 9117c69c1b
10 changed files with 62 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package com.bonus.system.att.dao;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthReportBean;
@ -7,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* 考勤明细-数据访问层
@ -93,4 +95,6 @@ public interface AttendanceDetailsDao {
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
List<AttDataDetailsBean> getOrgUserOutCountList(@Param("bean") AttDataDetailsBean bean);
List<MapVo> getAttStatusList();
}

View File

@ -1,12 +1,14 @@
package com.bonus.system.att.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthReportBean;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 考勤明细-业务层
@ -107,4 +109,6 @@ public interface AttendanceDetailsService {
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
List<AttDataDetailsBean> getOrgUserOutCountList(AttDataDetailsBean bean);
List<MapVo> getAttStatusList();
}

View File

@ -235,6 +235,11 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
return attendanceDetailsDao.getOrgUserOutCountList(bean);
}
@Override
public List<MapVo> getAttStatusList() {
return attendanceDetailsDao.getAttStatusList();
}
public List<AttDayReportBean> getAttDayReportListAll(List<AttDayReportBean> list) {
List<AttDayReportBean> allList = new ArrayList<>();
Map<String, AttDayReportBean> map = list.stream()

View File

@ -26,6 +26,8 @@ import java.lang.reflect.InvocationTargetException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -164,15 +166,23 @@ public class MsgTasks {
public void getAttSettingHistoryTask(){
log.info("--------考勤设置历史时间消息推送定时器开启------");
String startDate = DateUtil.today();
// String endDate = "2025-01-19";
String endDate = DateUtil.today();
List<String> dateList = getStrDateListBetween(startDate, endDate);
// 解析 startDate 字符串到 LocalDate 对象
LocalDate date = LocalDate.parse(startDate, DateTimeFormatter.ISO_LOCAL_DATE);
// 向前推30天
LocalDate newDate = date.minusDays(30);
// 如果需要将结果格式化为特定格式的字符串可以使用以下代码
String formattedNewDate = newDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
//向前推2个月的时间检索缺少哪一天推送哪一天
List<String> dateListOne = noticeService.getAttSettingDate(startDate);
List<String> dateList = getStrDateListBetween(formattedNewDate, startDate);
// dateList 中移除所有在 dateListOne 中存在的元素
dateListOne.removeIf(startDate::contains);
dateList.removeIf(dateListOne::contains);
for (String s : dateList) {
List<AttGroupBean> attList = noticeService.getAttSettingHistoryDate(s);
if(!attList.isEmpty()){
noticeService.insertAttSettingHistoryData(attList);
}
}
log.info("--------考勤设置历史时间消息推送定时器开启------");
}

View File

@ -70,4 +70,6 @@ public interface SysNoticeMapper
List<AttGroupBean> getAttSettingHistoryDate(String currentDay);
void insertAttSettingHistoryData(List<AttGroupBean> attList);
List<String> getAttSettingDate(String startDate);
}

View File

@ -66,4 +66,6 @@ public interface SysNoticeService {
List<AttGroupBean> getAttSettingHistoryDate(String s);
void insertAttSettingHistoryData(List<AttGroupBean> attList);
List<String> getAttSettingDate(String startDate);
}

View File

@ -113,4 +113,9 @@ public class SysNoticeServiceImpl implements SysNoticeService
public void insertAttSettingHistoryData(List<AttGroupBean> attList) {
noticeMapper.insertAttSettingHistoryData(attList);
}
@Override
public List<String> getAttSettingDate(String startDate) {
return noticeMapper.getAttSettingDate(startDate);
}
}

View File

@ -177,6 +177,9 @@
<if test="userId != null ">
and vat.user_id = #{userId}
</if>
<if test="name != null ">
and locate(#{name},su.user_name) > 0
</if>
<if test='attStatis != null and attStatis == "6"'>
and (vat.toWorkAttStatus in (SELECT dict_value
FROM sys_dict_data

View File

@ -450,6 +450,9 @@
<if test="bean.attCurrentMonth != null and bean.attCurrentMonth != ''">
and locate(#{bean.attCurrentMonth},awa.att_current_day)
</if>
<if test="bean.userName != null and bean.userName != ''">
and locate(#{bean.userName},awa.user_name)
</if>
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and so.id in (
<foreach collection="bean.orgList" item="item" separator=",">
@ -461,6 +464,17 @@
ORDER BY
awa.att_current_day DESC
</select>
<select id="getAttStatusList" resultType="com.bonus.system.api.domain.MapVo">
SELECT
dict_sort as id,
dict_label as name
FROM
sys_dict_data
WHERE
dict_type = 'att_status'
ORDER BY
dict_sort ASC
</select>
<update id="updateAttDetailsData">
<foreach collection="list" item="params" separator=";">

View File

@ -140,4 +140,13 @@
GROUP BY
user_id
</select>
<select id="getAttSettingDate" resultType="java.lang.String">
SELECT DISTINCT
current_day
FROM
`att_setting_history` WHERE current_day > DATE_ADD(#{startDate}, INTERVAL -30 DAY)
ORDER BY current_day DESC
</select>
</mapper>