添加全勤

This commit is contained in:
方亮 2025-07-31 13:35:10 +08:00
parent 127ae3f86e
commit 2f3b5a29d3
8 changed files with 77 additions and 4 deletions

View File

@ -253,4 +253,13 @@ public interface AttSourceDataDao {
* @return
*/
void rollbackAttDataByLeave(HolidayBean bean);
/**
* 查询今日是否有请假或私事外出情况
* @param today
* @return
*/
List<String> getNotFullAtt(String today);
int updateMonthReportFullAtt(@Param("list") List<String> list, @Param("month") int month);
}

View File

@ -134,6 +134,10 @@ public class AttMonthReportBean {
@Excel(name = "打卡记录", sort = 14)
private int clockingRecordNum;
/**是否全勤*/
// @Excel(name = "是否全勤", sort = 17)
private int isFullAtt;
/**
* 自己项目部所在分公司下的所有项目部id
*/

View File

@ -143,4 +143,18 @@ public interface AttCalService {
* @return
*/
void rollbackAttDataByLeave(HolidayBean o);
/**
* 查询今日是否有请假或私事外出情况
* @param today
* @return
*/
List<String> getNotFullAtt(String today);
/**
* 修改全勤
* @param list
* @param month
*/
int updateMonthReportFullAtt(List<String> list,int month);
}

View File

@ -525,6 +525,27 @@ public class AttCalServiceImpl implements AttCalService {
}
}
/**
* 查询今日是否有请假或私事外出情况
* @param today
* @return
*/
@Override
public List<String> getNotFullAtt(String today) {
return attSourceDataDao.getNotFullAtt(today);
}
/**
* 修改本月全勤状态
* @param month
* @param list
* @return
*/
@Override
public int updateMonthReportFullAtt(List<String> list,int month) {
return attSourceDataDao.updateMonthReportFullAtt(list,month);
}
/**
* 查出每一个考勤组的应出勤天数以及考勤组的规则
*

View File

@ -14,6 +14,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
/**
* @author zys
@ -180,13 +182,16 @@ public class NewAttTask {
public void getMonthReportFullAttTask() {
log.info("--------月报表--是否全勤定时器开启------");
String today = DateUtil.today();
List<AttMonthReportBean> list = attCalService.getNotFullAtt(today);
updateMonthReportData(today);
List<String> list = attCalService.getNotFullAtt(today);
if(!list.isEmpty()){
Date now = new Date(); // 当前日期时间
int month = DateUtil.month(now) + 1;
attCalService.updateMonthReportFullAtt(list,month);
}
log.info("--------月报表--是否全勤定时器完毕------");
}
/**
* 待考勤人员列表
* 在人员考勤模版数据之前生成

View File

@ -740,7 +740,7 @@ public class ExportFileController {
List<AttMonthReportBean> attDayReportList = attendanceDetailsService.getAttMonthReportList(bean);
Sheet departmentSheet1 = exporter.createSheet("月报表详情");
List<String> departmentHeaders1 = Arrays.asList("序号", "姓名", "所属部门", "考勤月","打卡记录", "应考勤天数", "正常打卡天数",
"迟到天数", "早退天数", "旷工天数", "请假天数", "打卡地异常天数", "出入异常天数", "轮休天数", "临时外出天数", "出差天数", "培训天数", "外勤天数", "考勤天数备注");
"迟到天数", "早退天数", "旷工天数", "请假天数", "打卡地异常天数", "出入异常天数", "轮休天数", "临时外出天数", "出差天数", "培训天数", "外勤天数", "考勤天数备注", "是否全勤");
exporter.addHeaderRowAndTitle(departmentSheet1, departmentHeaders1, title);
List<Map<String, Object>> departmentData1 = new ArrayList<>();
for (int i = 0; i < attDayReportList.size(); i++) {
@ -764,6 +764,7 @@ public class ExportFileController {
map.put("培训天数", attDayReportList.get(i).getTrainNum());
map.put("外勤天数", attDayReportList.get(i).getOutsideAttNum());
map.put("考勤天数备注", attDayReportList.get(i).getRequiredDayRemark());
map.put("是否全勤", attDayReportList.get(i).getIsFullAtt()==1?"":"");
departmentData1.add(map);
}
exporter.addDataRows(departmentSheet1, departmentData1, departmentHeaders1);

View File

@ -32,6 +32,8 @@ import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
/**
* 轮休临时外出请假
*

View File

@ -624,4 +624,21 @@
AND examine_status = '1'
</select>
<select id="getNotFullAtt" resultType="java.lang.String">
SELECT DISTINCT
user_id
FROM
leave_apply
WHERE
is_active = 1
AND leave_type != '年休假'
AND is_business != 1
</select>
<update id="updateMonthReportFullAtt">
update att_month_report set is_full_att = 0 where att_current_month = #{month} and user_id in
<foreach collection="list" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</update>
</mapper>