Compare commits
2 Commits
d1473886f6
...
a7db0253e8
Author | SHA1 | Date | |
---|---|---|---|
a7db0253e8 | |||
4861c89c57 |
@@ -120,6 +120,12 @@
|
|||||||
<artifactId>sis-api</artifactId>
|
<artifactId>sis-api</artifactId>
|
||||||
<version>2.4.0</version>
|
<version>2.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-system</artifactId>
|
||||||
|
<version>2.4.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -4,10 +4,12 @@ import org.dromara.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.system.domain.SysUser;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排班明细对象 attendance_user_group
|
* 排班明细对象 attendance_user_group
|
||||||
@@ -39,20 +41,20 @@ public class AttendanceUserGroup extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long employeeId;
|
private Long employeeId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 员工姓名
|
// * 员工姓名
|
||||||
*/
|
// */
|
||||||
private String employeeName;
|
// private String employeeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 部门名称
|
// * 部门名称
|
||||||
*/
|
// */
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始日期
|
* 开始日期
|
||||||
@@ -64,5 +66,7 @@ public class AttendanceUserGroup extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private LocalDate endDate;
|
private LocalDate endDate;
|
||||||
|
|
||||||
|
private SysUser sysUser;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -84,6 +84,10 @@ public class AttendanceArrangementBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long status;
|
private Long status;
|
||||||
|
|
||||||
|
private List<Long> employeeId;
|
||||||
|
|
||||||
|
private List<Long> deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 排班用户组
|
* 排班用户组
|
||||||
|
@@ -39,20 +39,20 @@ public class AttendanceUserGroupBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long employeeId;
|
private Long employeeId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 员工姓名
|
// * 员工姓名
|
||||||
*/
|
// */
|
||||||
private String employeeName;
|
// private String employeeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 部门名称
|
// * 部门名称
|
||||||
*/
|
// */
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始日期
|
* 开始日期
|
||||||
|
@@ -48,11 +48,11 @@ public class AttendanceUserGroupVo implements Serializable {
|
|||||||
@ExcelProperty(value = "员工ID")
|
@ExcelProperty(value = "员工ID")
|
||||||
private Long employeeId;
|
private Long employeeId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 员工姓名
|
// * 员工姓名
|
||||||
*/
|
// */
|
||||||
@ExcelProperty(value = "员工姓名")
|
// @ExcelProperty(value = "员工姓名")
|
||||||
private String employeeName;
|
// private String employeeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
@@ -60,11 +60,11 @@ public class AttendanceUserGroupVo implements Serializable {
|
|||||||
@ExcelProperty(value = "部门ID")
|
@ExcelProperty(value = "部门ID")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 部门名称
|
// * 部门名称
|
||||||
*/
|
// */
|
||||||
@ExcelProperty(value = "部门名称")
|
// @ExcelProperty(value = "部门名称")
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始日期
|
* 开始日期
|
||||||
|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
@@ -18,6 +19,8 @@ import org.dromara.property.domain.constant.StatusConstant;
|
|||||||
import org.dromara.property.domain.vo.AttendanceArrangementVo;
|
import org.dromara.property.domain.vo.AttendanceArrangementVo;
|
||||||
import org.dromara.property.mapper.*;
|
import org.dromara.property.mapper.*;
|
||||||
import org.dromara.property.service.IAttendanceArrangementService;
|
import org.dromara.property.service.IAttendanceArrangementService;
|
||||||
|
import org.dromara.system.domain.SysUser;
|
||||||
|
import org.dromara.system.mapper.SysUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -54,6 +57,8 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
|
|
||||||
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
|
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
|
||||||
|
|
||||||
|
private final SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询排班
|
* 查询排班
|
||||||
*
|
*
|
||||||
@@ -311,6 +316,15 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
for (AttendanceArrangementVo vo : result) {
|
for (AttendanceArrangementVo vo : result) {
|
||||||
// 根据排班查询出人员组的详细信息
|
// 根据排班查询出人员组的详细信息
|
||||||
List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().eq(AttendanceUserGroup::getScheduleId, vo.getId()));
|
List<AttendanceUserGroup> userGroupList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().eq(AttendanceUserGroup::getScheduleId, vo.getId()));
|
||||||
|
|
||||||
|
//通过userGroupList查询出人员的详细信息
|
||||||
|
|
||||||
|
//将userList存到userGroupList中
|
||||||
|
userGroupList.forEach(userGroup -> {
|
||||||
|
SysUser sysUser = sysUserMapper.selectById(userGroup.getEmployeeId());
|
||||||
|
userGroup.setSysUser(sysUser);
|
||||||
|
}
|
||||||
|
);
|
||||||
// 将排班人员信息添加到排班信息中
|
// 将排班人员信息添加到排班信息中
|
||||||
vo.setUserGroupList(userGroupList);
|
vo.setUserGroupList(userGroupList);
|
||||||
|
|
||||||
@@ -448,6 +462,8 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
List<AttendanceUserGroup> userGroupList = bo.getUserGroupList();
|
List<AttendanceUserGroup> userGroupList = bo.getUserGroupList();
|
||||||
for (AttendanceUserGroup userGroup : userGroupList) {
|
for (AttendanceUserGroup userGroup : userGroupList) {
|
||||||
userGroup.setScheduleId(ArrangementId);
|
userGroup.setScheduleId(ArrangementId);
|
||||||
|
userGroup.setStartDate(bo.getStartDate());
|
||||||
|
userGroup.setEndDate(bo.getEndDate());
|
||||||
userGroupMapper.insert(userGroup);
|
userGroupMapper.insert(userGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,6 +502,13 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
|
|
||||||
// judgeDate(bo, update);
|
// judgeDate(bo, update);
|
||||||
|
|
||||||
|
//根据排班id获取人员id
|
||||||
|
//根据人员id删除人员信息
|
||||||
|
//新增人员信息
|
||||||
|
//根据排班id获取部门id
|
||||||
|
//根据部门id删除部门信息
|
||||||
|
//新增部门信息
|
||||||
|
|
||||||
//取出当前排班的id
|
//取出当前排班的id
|
||||||
assert update != null;
|
assert update != null;
|
||||||
Long ArrangementId = update.getId();
|
Long ArrangementId = update.getId();
|
||||||
@@ -496,6 +519,13 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
userGroupMapper.delete(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getEmployeeId, employeeIdList)
|
userGroupMapper.delete(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getEmployeeId, employeeIdList)
|
||||||
.eq(AttendanceUserGroup::getScheduleId, ArrangementId));
|
.eq(AttendanceUserGroup::getScheduleId, ArrangementId));
|
||||||
|
|
||||||
|
//根据排班id获取部门id
|
||||||
|
List<Long> deptIdList = userGroupMapper.selectList(Wrappers.<AttendanceUserGroup>lambdaQuery().eq(AttendanceUserGroup::getScheduleId, ArrangementId))
|
||||||
|
.stream().map(AttendanceUserGroup::getDeptId).toList();
|
||||||
|
//根据deptId和ArrangementId删除attendanceDeptGroup表中的数据
|
||||||
|
userGroupMapper.delete(Wrappers.<AttendanceUserGroup>lambdaQuery().in(AttendanceUserGroup::getDeptId, deptIdList)
|
||||||
|
.eq(AttendanceUserGroup::getScheduleId, ArrangementId));
|
||||||
|
|
||||||
|
|
||||||
//用获取到的排班id向attendanceUserGroup表中批量插入数据
|
//用获取到的排班id向attendanceUserGroup表中批量插入数据
|
||||||
List<AttendanceUserGroup> userGroupList = bo.getUserGroupList();
|
List<AttendanceUserGroup> userGroupList = bo.getUserGroupList();
|
||||||
|
@@ -91,9 +91,9 @@ public class AttendanceUserGroupServiceImpl implements IAttendanceUserGroupServi
|
|||||||
lqw.orderByAsc(AttendanceUserGroup::getId);
|
lqw.orderByAsc(AttendanceUserGroup::getId);
|
||||||
lqw.eq(bo.getScheduleId() != null, AttendanceUserGroup::getScheduleId, bo.getScheduleId());
|
lqw.eq(bo.getScheduleId() != null, AttendanceUserGroup::getScheduleId, bo.getScheduleId());
|
||||||
lqw.eq(bo.getEmployeeId() != null, AttendanceUserGroup::getEmployeeId, bo.getEmployeeId());
|
lqw.eq(bo.getEmployeeId() != null, AttendanceUserGroup::getEmployeeId, bo.getEmployeeId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getEmployeeName()), AttendanceUserGroup::getEmployeeName, bo.getEmployeeName());
|
// lqw.like(StringUtils.isNotBlank(bo.getEmployeeName()), AttendanceUserGroup::getEmployeeName, bo.getEmployeeName());
|
||||||
lqw.eq(bo.getDeptId() != null, AttendanceUserGroup::getDeptId, bo.getDeptId());
|
lqw.eq(bo.getDeptId() != null, AttendanceUserGroup::getDeptId, bo.getDeptId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), AttendanceUserGroup::getDeptName, bo.getDeptName());
|
// lqw.like(StringUtils.isNotBlank(bo.getDeptName()), AttendanceUserGroup::getDeptName, bo.getDeptName());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user