Commit ff8a3b78 authored by 姬鋆屾's avatar 姬鋆屾
parents 5b28d4dd e77ba110
......@@ -40,6 +40,8 @@ public class AttendanceSummaryQuery {
private List<Long> idList;
private Integer dayOfWeek;
public AttendanceSummaryQuery(String summaryTime) {
this.summaryTime = summaryTime;
}
......
......@@ -199,12 +199,12 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
}
} else {
//判断是否为周末
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtils.StrToDate(query.getSummaryTime()));
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
isReturn = true;
}
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(DateUtils.StrToDate(query.getSummaryTime()));
// int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
// if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
// isReturn = true;
// }
}
// Date today = DateUtils.getCurrDate();
......@@ -218,8 +218,10 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
log.info("开始汇总[" + query.getSummaryTime() + "]考勤.....");
//汇总当前删除数据,避免update耗时
Date summaryDate = DateUtils.StrToDateTime(query.getSummaryTime());
Calendar cal=Calendar.getInstance();
Calendar cal = Calendar.getInstance();
cal.setTime(summaryDate);
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
query.setDayOfWeek(dayOfWeek);
int y = cal.get(Calendar.YEAR);
int m = cal.get(Calendar.MONTH)+1;
int d = cal.get(Calendar.DATE);
......@@ -236,6 +238,7 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
//汇总当前日期假期余额
List<VacationBalanceSummaryVo> vacationBalanceSummaryVoList = attendanceSummaryDao.getVacationBalanceSummary(query);
if (CollectionUtils.isNotEmpty(vacationBalanceSummaryVoList)) {
log.info("考勤人数:"+vacationBalanceSummaryVoList.size());
List<AttendanceStatEntity> insertList = new ArrayList<>();
List<AttendanceStatEntity> updateList = new ArrayList<>();
for (VacationBalanceSummaryVo item : vacationBalanceSummaryVoList) {
......
......@@ -5,7 +5,7 @@
<!-- 汇总当前日期假期余额 -->
<select id="getVacationBalanceSummary" parameterType="com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery" resultType="com.mortals.xhx.module.attendance.model.vo.VacationBalanceSummaryVo">
SELECT
SELECT DISTINCT
s.id AS staffId,
s.`name` AS staffName,
s.phoneNumber,
......@@ -39,9 +39,19 @@
0 as transferBack,
0 as homeLeave
FROM
mortals_xhx_staff s
WHERE 1=1
<if test="staffId != null and staffId!=''"> AND s.id = #{staffId}</if>
mortals_xhx_staff s,
mortals_xhx_attendance_group_staff gs,
mortals_xhx_attendance_group_fixedwork f
WHERE
s.id = gs.staffId
AND gs.groupId = f.groupId
<if test="dayOfWeek != null and dayOfWeek == 2"> AND f.monday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 3"> AND f.tuesday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 4"> AND f.wednesday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 5"> AND f.thursday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 6"> AND f.friday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 7"> AND f.saturday = 1</if>
<if test="dayOfWeek != null and dayOfWeek == 1"> AND f.sunday = 1</if>
</select>
<!-- 汇总当前日期请假情况 -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment