feat(wms/attendance): 为考勤查询新增员工ID集合筛选功能
在AttendanceCheckBo中新增userIds字段,用于接收员工ID集合查询条件。同步更新WmsAttendanceScheduleBo、Mapper接口及XML映射,在查询排班时支持按userIds进行筛选。Service层将考勤查询条件中的userIds传递至排班查询逻辑,实现考勤数据按指定员工范围过滤。
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttendanceCheckBo {
|
||||
@@ -16,4 +17,9 @@ public class AttendanceCheckBo {
|
||||
@NotNull(message = "结束日期不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 员工ID集合(为空则查全部)
|
||||
*/
|
||||
private List<Long> userIds;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -71,4 +72,8 @@ public class WmsAttendanceScheduleBo extends BaseEntity {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 员工ID集合
|
||||
*/
|
||||
private List<Long> userIds;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ public interface WmsAttendanceScheduleMapper extends BaseMapperPlus<WmsAttendanc
|
||||
@Param("workDate") java.util.Date workDate,
|
||||
@Param("shiftId") Long shiftId,
|
||||
@Param("startDate") Date startDate,
|
||||
@Param("endDate") Date endDate);
|
||||
@Param("endDate") Date endDate,
|
||||
@Param("userIds") List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 分页查询排班列表(关联员工和班次信息)
|
||||
|
||||
@@ -102,6 +102,7 @@ public class WmsAttendanceCheckServiceImpl implements IWmsAttendanceCheckService
|
||||
WmsAttendanceScheduleBo scheduleBo = new WmsAttendanceScheduleBo();
|
||||
scheduleBo.setStartDate(bo.getStartDate());
|
||||
scheduleBo.setEndDate(bo.getEndDate());
|
||||
scheduleBo.setUserIds(bo.getUserIds());
|
||||
List<WmsAttendanceScheduleVo> schedules = scheduleService.queryList(scheduleBo);
|
||||
|
||||
if (schedules.isEmpty()) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class WmsAttendanceScheduleServiceImpl implements IWmsAttendanceScheduleS
|
||||
|
||||
// 使用关联查询获取详细信息
|
||||
List<WmsAttendanceScheduleVo> list = baseMapper.selectScheduleWithDetails(
|
||||
schedule.getUserId(), schedule.getWorkDate(), schedule.getShiftId(),null, null);
|
||||
schedule.getUserId(), schedule.getWorkDate(), schedule.getShiftId(),null, null, null);
|
||||
|
||||
return list.isEmpty() ? null : list.get(0);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class WmsAttendanceScheduleServiceImpl implements IWmsAttendanceScheduleS
|
||||
@Override
|
||||
public List<WmsAttendanceScheduleVo> queryList(WmsAttendanceScheduleBo bo) {
|
||||
return baseMapper.selectScheduleWithDetails(bo.getUserId(), bo.getWorkDate(), bo.getShiftId(),
|
||||
bo.getStartDate(), bo.getEndDate());
|
||||
bo.getStartDate(), bo.getEndDate(), bo.getUserIds());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user