排班区域

This commit is contained in:
dy
2025-08-14 15:41:00 +08:00
parent 2cc45acc37
commit 9abb69888b
6 changed files with 100 additions and 68 deletions

View File

@@ -41,6 +41,11 @@ public class AttendanceArrangement extends TenantEntity {
*/
private Long groupId;
/**
* 区域id
*/
private Long areaId;
/**
* 排班类型1-固定班制2-排班制
*/

View File

@@ -45,6 +45,11 @@ public class AttendanceArrangementBo extends BaseEntity {
*/
private Long groupId;
/**
* 区域id
*/
private Long areaId;
/**
* 排班类型1-固定班制2-排班制
*/
@@ -99,4 +104,5 @@ public class AttendanceArrangementBo extends BaseEntity {
private List<AttendanceScheduleCycle> scheduleCycleList;
}

View File

@@ -45,6 +45,12 @@ public class AttendanceArrangementVo implements Serializable {
@ExcelProperty(value = "考勤组ID")
private Long groupId;
@ExcelProperty(value = "区域Id")
/**
* 区域id
*/
private Long areaId;
/**
* 排班类型1-固定班制2-排班制
*/
@@ -90,5 +96,7 @@ public class AttendanceArrangementVo implements Serializable {
//排班制
private AttendanceScheduleCycle scheduleCycle;
private AttendanceArea attendanceArea;
}

View File

@@ -91,5 +91,7 @@ public class AttendanceUserGroupVo implements Serializable {
private String deptName;
private AttendanceArea attendanceArea;
}

View File

@@ -1,15 +1,11 @@
package org.dromara.property.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
@@ -26,10 +22,8 @@ import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.WeekFields;
import java.util.*;
import java.util.stream.Collectors;
@@ -59,6 +53,8 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
private final AttendanceAreaMapper attendanceAreaMapper;
@DubboReference
private RemoteUserService remoteUserService;
/**
@@ -149,7 +145,13 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
//将考勤组的信息存到vo中
vo.setAttendanceGroup(attendanceGroup);
//3.查询班制信息
//3.根据id查询区域信息
Long areaId = vo.getAreaId();
//根据区域id查询出区域的详细信息
AttendanceArea attendanceArea = attendanceAreaMapper.selectById(areaId);
vo.setAttendanceArea(attendanceArea);
//4.查询班制信息
//判断当前考勤组的班制是固定班制还是排班制
if (Objects.equals(attendanceGroup.getAttendanceType(), StatusConstant.FIXEDSCHEDULE)) {
//3.1固定班制
@@ -205,7 +207,7 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
}
//根据cycleDay查询出当前日期的班次信息
//5.根据cycleDay查询出当前日期的班次信息
AttendanceScheduleCycle cycle = scheduleCycleMapper.selectOne(Wrappers.<AttendanceScheduleCycle>lambdaQuery().eq(AttendanceScheduleCycle::getGroupId, groupId).eq(AttendanceScheduleCycle::getDayNumber, cycleDay));
//将cycle存到vo中
vo.setScheduleCycle(cycle);

View File

@@ -48,6 +48,8 @@ public class AttendanceUserGroupServiceImpl implements IAttendanceUserGroupServi
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
private final AttendanceAreaMapper attendanceAreaMapper;
@DubboReference
private RemoteUserService remoteUserService;
@@ -205,6 +207,13 @@ public class AttendanceUserGroupServiceImpl implements IAttendanceUserGroupServi
AttendanceGroup attendanceGroup = groupMapper.selectById(groupId);
vo.setAttendanceGroup(attendanceGroup);
//3.根据id查询区域信息
Long areaId = arrangement.getAreaId();
//根据区域id查询出区域的详细信息
AttendanceArea attendanceArea = attendanceAreaMapper.selectById(areaId);
vo.setAttendanceArea(attendanceArea);
// 判断当前考勤组的班制是固定班制还是排班制
if (Objects.equals(attendanceGroup.getAttendanceType(), StatusConstant.FIXEDSCHEDULE)) {
// 固定班制