diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/AttendanceUserGroupVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/AttendanceUserGroupVo.java index 9ccab8ee..bb60b40e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/AttendanceUserGroupVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/AttendanceUserGroupVo.java @@ -89,5 +89,7 @@ public class AttendanceUserGroupVo implements Serializable { private RemoteUserVo remoteUserVo; + private String deptName; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceArrangementServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceArrangementServiceImpl.java index dcd8438e..059972c5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceArrangementServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceArrangementServiceImpl.java @@ -80,11 +80,14 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS List userGroupList = userGroupMapper.selectVoList(Wrappers.lambdaQuery().eq(AttendanceUserGroup::getScheduleId, id)); //查询所有的用户信息 userGroupList.forEach(userGroup -> { -// SysUserVo sysUserVo = sysUserService.selectUserById(userGroup.getEmployeeId()); -// userGroup.setSysUser(sysUserVo); - RemoteUserVo userInfoById = remoteUserService.getUserInfoById(userGroup.getEmployeeId()); userGroup.setRemoteUserVo(userInfoById); + + //获取deptId + Long deptId = userGroup.getDeptId(); + //根据deptId查询出部门名称 + String deptName = remoteUserService.selectDeptNamesByIds(Arrays.asList(deptId)).get(deptId); + userGroup.setDeptName(deptName); }); //将排班人员信息添加到排班信息中 vo.setUserGroupList(userGroupList); @@ -128,6 +131,11 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS RemoteUserVo userInfoById = remoteUserService.getUserInfoById(userGroup.getEmployeeId()); userGroup.setRemoteUserVo(userInfoById); + //获取deptId + Long deptId = userGroup.getDeptId(); + //根据deptId查询出部门名称 + String deptName = remoteUserService.selectDeptNamesByIds(Arrays.asList(deptId)).get(deptId); + userGroup.setDeptName(deptName); } ); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceUserGroupServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceUserGroupServiceImpl.java index 271551ae..9c03f36c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceUserGroupServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AttendanceUserGroupServiceImpl.java @@ -15,16 +15,14 @@ import org.dromara.property.domain.constant.StatusConstant; import org.dromara.property.domain.vo.AttendanceUserGroupVo; import org.dromara.property.mapper.*; import org.dromara.property.service.IAttendanceUserGroupService; +import org.dromara.system.api.RemoteDeptService; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; import org.springframework.stereotype.Service; import java.time.LocalDate; import java.time.temporal.ChronoUnit; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -53,6 +51,9 @@ public class AttendanceUserGroupServiceImpl implements IAttendanceUserGroupServi @DubboReference private RemoteUserService remoteUserService; + @DubboReference + private RemoteDeptService remoteDeptService; + /** * 查询排班明细 @@ -177,10 +178,20 @@ public class AttendanceUserGroupServiceImpl implements IAttendanceUserGroupServi Long scheduleId = vo.getScheduleId(); //根据employeeId查询出用户的详细信息 -// SysUserVo sysUserVo = sysUserService.selectUserById(vo.getEmployeeId()); RemoteUserVo userInfoById = remoteUserService.getUserInfoById(vo.getEmployeeId()); vo.setRemoteUserVo(userInfoById); + + Long deptId = vo.getDeptId(); + String deptName = remoteUserService.selectDeptNamesByIds(Arrays.asList(deptId)).get(deptId); + vo.setDeptName(deptName); + + +// //通过employeeId查询出用户的部门信息 +// String deptInfo = remoteDeptService.selectDeptNameByIds(String.valueOf(vo.getDeptId())); +// vo.setDeptName(deptInfo); + + //根据scheduleId查询出排班的详细信息 AttendanceArrangement attendanceArrangement = arrangementMapper.selectOne(Wrappers.lambdaQuery().eq(AttendanceArrangement::getId, scheduleId)); // 假设每个vo只有一个scheduleId