This commit is contained in:
parent
b303ab6faa
commit
28143d17e7
@ -42,7 +42,7 @@ public class AttendanceScheduleCycle extends TenantEntity {
|
||||
*/
|
||||
private Long isRest;
|
||||
|
||||
private Long scheduleId;
|
||||
private Long shiftId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ public class AttendanceGroupBo extends BaseEntity {
|
||||
|
||||
|
||||
List<AttendanceScheduleCycle> numList;
|
||||
|
||||
List<AttendanceWeekSet> weekSetList;
|
||||
|
||||
|
||||
|
@ -61,5 +61,9 @@ public class AttendanceGroupVo implements Serializable {
|
||||
|
||||
List<AttendanceClockDate> clockDateList;
|
||||
|
||||
List<AttendanceScheduleCycle> scheduleCycleList;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -174,7 +174,12 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
@Override
|
||||
public List<AttendanceArrangementVo> queryList(AttendanceArrangementBo bo) {
|
||||
|
||||
//查看日历开始时间、结束时间和开始时间、结束时间的交集
|
||||
Date startDate = bo.getStartDate();
|
||||
Date endDate = bo.getEndDate();
|
||||
Date calendarStartDate = bo.getCalendarStartDate();
|
||||
Date calendarEndTimeDate = bo.getCalendarEndTimeDate();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -78,18 +78,38 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
|
||||
vo.setWeekList(weekSets);
|
||||
} else if (Objects.equals(attendanceType, SHIFTSCHEDULE)) {
|
||||
//2.排班制
|
||||
//2.1根据id参数查询考勤周期表
|
||||
List<AttendanceWeekSet> weekSets = weekSetMapper.selectList(Wrappers.<AttendanceWeekSet>lambdaQuery().eq(AttendanceWeekSet::getGroupId, id));
|
||||
//2.1根据id参数查询考勤天数表
|
||||
List<AttendanceScheduleCycle> scheduleCycles = attendanceScheduleCycleMapper.selectList(Wrappers.<AttendanceScheduleCycle>lambdaQuery().eq(AttendanceScheduleCycle::getGroupId, id));
|
||||
//2.2根据id参数取出所有考勤天数id
|
||||
List<Long> weekSetIds = weekSets.stream().map(AttendanceWeekSet::getId).toList();
|
||||
//2.3根据天数id查询出中间表
|
||||
List<AttendanceScheduleCycle> scheduleCycles = attendanceScheduleCycleMapper.selectList(Wrappers.<AttendanceScheduleCycle>lambdaQuery().in(AttendanceScheduleCycle::getGroupId, weekSetIds));
|
||||
//2.4根据中间表的班次id查询出班次表id
|
||||
List<Long> scheduleCycleIds = scheduleCycles.stream().map(AttendanceScheduleCycle::getId).toList();
|
||||
//2.5根据班次id查询出班次表
|
||||
List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, scheduleCycleIds));
|
||||
//2.3根据天数id查询出中间表
|
||||
List<AttendanceWeeksetShift> weeksetShifts = attendanceWeeksetShiftMapper.selectList(Wrappers.<AttendanceWeeksetShift>lambdaQuery().in(AttendanceWeeksetShift::getWeekSetId, scheduleCycleIds));
|
||||
//2.4根据中间表的班次id查询出班次表id
|
||||
List<Long> weeksetShiftIds = weeksetShifts.stream().map(AttendanceWeeksetShift::getId).toList();
|
||||
//根据id查询出shiftId
|
||||
List<Long> shiftIds = weeksetShifts.stream().map(AttendanceWeeksetShift::getShiftId).toList();
|
||||
//2.5根据shiftId查询出班次表
|
||||
List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, shiftIds));
|
||||
|
||||
|
||||
// //2.5根据班次id查询出班次表
|
||||
// List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, weeksetShiftIds));
|
||||
//2.6将查询后的数据封装到attendanceGroupVo中
|
||||
vo.setAttendanceList(shifts);
|
||||
vo.setScheduleCycleList(scheduleCycles);
|
||||
|
||||
|
||||
// List<AttendanceWeekSet> weekSets = weekSetMapper.selectList(Wrappers.<AttendanceWeekSet>lambdaQuery().eq(AttendanceWeekSet::getGroupId, id));
|
||||
// //2.2根据id参数取出所有考勤天数id
|
||||
// List<Long> weekSetIds = weekSets.stream().map(AttendanceWeekSet::getId).toList();
|
||||
// //2.3根据天数id查询出中间表
|
||||
// List<AttendanceScheduleCycle> scheduleCycles = attendanceScheduleCycleMapper.selectList(Wrappers.<AttendanceScheduleCycle>lambdaQuery().in(AttendanceScheduleCycle::getGroupId, weekSetIds));
|
||||
// //2.4根据中间表的班次id查询出班次表id
|
||||
// List<Long> scheduleCycleIds = scheduleCycles.stream().map(AttendanceScheduleCycle::getId).toList();
|
||||
// //2.5根据班次id查询出班次表
|
||||
// List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, scheduleCycleIds));
|
||||
// //2.6将查询后的数据封装到attendanceGroupVo中
|
||||
// vo.setAttendanceList(shifts);
|
||||
}
|
||||
|
||||
//根据id查询attendance_clock_date表
|
||||
@ -216,7 +236,7 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
|
||||
//向中间表插入周期的id
|
||||
AttendanceWeeksetShift attendanceWeeksetShift = new AttendanceWeeksetShift();
|
||||
attendanceWeeksetShift.setWeekSetId(scheduleId);
|
||||
attendanceWeeksetShift.setShiftId(num.getScheduleId());
|
||||
attendanceWeeksetShift.setShiftId(num.getShiftId());
|
||||
attendanceWeeksetShiftMapper.insert(attendanceWeeksetShift);
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user