|
|
|
@@ -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);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|