考勤规则添加范围和中午休息时间

考勤明细出入次数查询修改
This commit is contained in:
fl 2025-01-08 15:07:26 +08:00
parent 8267ed338b
commit e4b0c3ad72
4 changed files with 31 additions and 6 deletions

View File

@ -49,6 +49,12 @@ public class AttGroupBean {
*/
private String breakEndTime;
/**
* 考勤范围
*/
private int attRange;
/**
* 每天打卡
*/

View File

@ -353,7 +353,7 @@ public class AttTasks {
if (groupList.isEmpty()) {
return new ArrayList<>();
}
//查询前三天是否有节假日或补班
//查询当月否有节假日或补班
List<Holiday> holidays = attSourceDataDao.selectHolidayByMonth(pushDate, pushType);
groupList.forEach(c -> {
//应考勤天
@ -396,7 +396,14 @@ public class AttTasks {
// 判断 pushDate 是否在今天之前
boolean isPastDate = isBeforeToday(pushDate);
if (isPastDate) {
v.setAttStatus("3");
//不存在且在今天之前
//之前处理过节假日的数据只有是默认数据才能将旷工状态写入
if (v.getAttStatus().equals("0")) {
v.setAttStatus("3");
}
}else{
//不存在就在今天
//逻辑跟修改相同第一次就不去麻烦根据时间判断状态了
}
attSourceDataDao.insertAttData(v);
} else {
@ -414,7 +421,10 @@ public class AttTasks {
// 判断 pushDate 是否在今天之前
boolean isPastDate = isBeforeToday(pushDate);
if (isPastDate) {
v.setAttStatus("3");
//之前处理过节假日的数据只有是默认数据才能将旷工状态写入
if (v.getAttStatus().equals("0")) {
v.setAttStatus("3");
}
}
attSourceDataDao.insertAttUpdateData(v);
} else {

View File

@ -123,6 +123,9 @@
insert into att_group_setting(group_id, att_day
<if test="toWorkTime != null and toWorkTime != ''">,to_work_time</if>
<if test="offWorkTime != null and offWorkTime != ''">,off_work_time</if>
<if test="breakStartTime != null and breakStartTime != ''">,break_start_time</if>
<if test="breakEndTime != null and breakEndTime != ''">,break_end_time</if>
<if test="attRange != null and attRange != ''">,att_range</if>
<if test="lateMinute != null ">,late_minute</if>
<if test="leaveMinute != null ">,leave_minute</if>
<if test="absenteeismLateMinute != null ">,absenteeism_late_minute</if>
@ -133,6 +136,9 @@
)values( #{groupId}, #{attDay}
<if test="toWorkTime != null and toWorkTime != ''">,#{toWorkTime}</if>
<if test="offWorkTime != null and offWorkTime != ''">,#{offWorkTime}</if>
<if test="breakStartTime != null and breakStartTime != ''">,#{breakStartTime}</if>
<if test="breakEndTime != null and breakEndTime != ''">,#{breakEndTime}</if>
<if test="attRange != null and attRange != ''">,#{attRange}</if>
<if test="lateMinute != null ">,#{lateMinute}</if>
<if test="leaveMinute != null ">,#{leaveMinute}</if>
<if test="absenteeismLateMinute != null ">,#{absenteeismLateMinute}</if>
@ -163,6 +169,9 @@
update att_group_setting set att_day = #{attDay}
<if test="toWorkTime != null and toWorkTime != ''">,to_work_time = #{toWorkTime}</if>
<if test="offWorkTime != null and offWorkTime != ''">,off_work_time = #{offWorkTime}</if>
<if test="breakStartTime != null and breakStartTime != ''">,break_start_time = #{breakStartTime}</if>
<if test="breakEndTime != null and breakEndTime != ''">,break_end_time = #{breakEndTime}</if>
<if test="attRange != null and attRange != ''">,att_range = #{attRange}</if>
<if test="lateMinute != null ">,late_minute = #{lateMinute}</if>
<if test="leaveMinute != null ">,leave_minute = #{leaveMinute}</if>
<if test="absenteeismLateMinute != null ">,absenteeism_late_minute =

View File

@ -5,12 +5,12 @@
<mapper namespace="com.bonus.system.att.dao.AttendanceDetailsDao">
<select id="selectAttDetailsList" resultType="com.bonus.system.att.entity.AttDataDetailsBean">
select su.user_name, so.org_name,COUNT( DISTINCT awa.user_id ) as outCount,
select su.user_name, so.org_name,IF(awa.outCount is null,0,awa.outCount) as outCount,
COUNT(DISTINCT asd.att_current_time ) AS attCount,
v.* from v_att_update_data v
left join sys_user su on su.user_id = v.user_id
left join sys_organization so on so.id = v.org_id
LEFT JOIN att_work_abnormal awa ON v.user_id = awa.user_id
LEFT JOIN (SELECT user_id,att_current_day,count(user_id) as outCount FROM att_work_abnormal GROUP BY att_current_day,user_id) awa ON v.user_id = awa.user_id
AND v.att_current_day = awa.att_current_day
LEFT JOIN att_source_data asd ON su.user_name = asd.`name` and asd.att_current_day = v.att_current_day
where v.att_current_day BETWEEN #{bean.startDate} AND #{bean.endDate}
@ -31,7 +31,7 @@
<if test='bean.attStatus == "1"'>
and ( toWorkAttStatus = #{bean.attStatus} and offWorkAttStatus = #{bean.attStatus} )
</if>
<if test='attStatus != "1"'>
<if test='bean.attStatus != "1"'>
and ( toWorkAttStatus = #{bean.attStatus} or offWorkAttStatus = #{bean.attStatus} )
</if>
</if>