根据id读取用户信息
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
@@ -37,6 +40,7 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
@DubboService(interfaceClass = SysUser.class)
|
||||||
public class AttendanceArrangementServiceImpl implements IAttendanceArrangementService {
|
public class AttendanceArrangementServiceImpl implements IAttendanceArrangementService {
|
||||||
|
|
||||||
private final AttendanceArrangementMapper baseMapper;
|
private final AttendanceArrangementMapper baseMapper;
|
||||||
@@ -54,6 +58,8 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
|
|
||||||
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
|
private final AttendanceScheduleCycleMapper scheduleCycleMapper;
|
||||||
|
|
||||||
|
private final SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询排班
|
* 查询排班
|
||||||
*
|
*
|
||||||
@@ -311,6 +317,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 +463,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user