1
This commit is contained in:
@@ -62,10 +62,16 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
*/
|
||||
@Override
|
||||
public AttendanceArrangementVo queryById(Long id) {
|
||||
AttendanceArrangementVo vo = baseMapper.selectVoById(id);
|
||||
//根据id查询出groupId
|
||||
Long groupId = baseMapper.selectById(id).getGroupId();
|
||||
//根据groupId查询出考勤组信息
|
||||
AttendanceGroup attendanceGroup = attendanceGroupMapper.selectById(groupId);
|
||||
vo.setAttendanceGroup(attendanceGroup);
|
||||
|
||||
//根据id查询排班人员信息
|
||||
List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().eq(AttendanceUserGroup::getScheduleId, id));
|
||||
//将排班人员信息添加到排班信息中
|
||||
AttendanceArrangementVo vo = baseMapper.selectVoById(id);
|
||||
vo.setUserGroupList(userGroupList);
|
||||
return vo;
|
||||
}
|
||||
@@ -497,8 +503,39 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
||||
*/
|
||||
private void validEntityBeforeSave(AttendanceArrangement entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
//新增时判断在该时间段内是否有排班
|
||||
|
||||
// //新增时判断在该时间段内是否有排班
|
||||
// //1.查询所有的排班信息
|
||||
// List<AttendanceArrangement> arrangementList = baseMapper.selectList();
|
||||
//
|
||||
// //使用between查询排班的开始时间在新增的开始时间和结束时间的排班信息
|
||||
// List<AttendanceArrangementVo> startResult = baseMapper.selectVoList(Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
// .between(AttendanceArrangement::getStartDate, entity.getStartDate(), entity.getStartDate().plusDays(1))
|
||||
// .eq(AttendanceArrangement::getGroupId, entity.getGroupId()));
|
||||
// //查询排班的结束时间在新增的开始时间和结束时间的排班信息
|
||||
// List<AttendanceArrangement> endResult = baseMapper.selectList(Wrappers.<AttendanceArrangement>lambdaQuery()
|
||||
// .between(AttendanceArrangement::getEndDate, entity.getStartDate(), entity.getStartDate().plusDays(1))
|
||||
// .eq(AttendanceArrangement::getGroupId, entity.getGroupId()));
|
||||
//
|
||||
// //将两个集合进行合并
|
||||
// List<AttendanceArrangementVo> result = new ArrayList<>(startResult.stream().distinct().toList());
|
||||
// result.addAll(endResult.stream().map(vo -> {
|
||||
// AttendanceArrangementVo newVo = MapstructUtils.convert(vo, AttendanceArrangementVo.class);
|
||||
// newVo.setStartDate(vo.getStartDate());
|
||||
// newVo.setEndDate(vo.getEndDate());
|
||||
// return newVo;
|
||||
// }).toList());
|
||||
//
|
||||
// //去重
|
||||
// result = result.stream().distinct().toList();
|
||||
//
|
||||
//
|
||||
//
|
||||
// //2.遍历排班信息,判断是否有时间冲突
|
||||
// for (AttendanceArrangement arrangement : arrangementList) {
|
||||
// //如果时间
|
||||
// if ()
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user