|
|
@@ -10,7 +10,9 @@ import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.UserRole; |
|
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
|
import com.ningdatech.pmapi.sys.service.IUserRoleService; |
|
|
|
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; |
|
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
@@ -44,6 +46,7 @@ public class UserInfoManage { |
|
|
|
private final IDingEmployeeInfoService iDingEmployeeInfoService; |
|
|
|
private final IUserInfoService iUserInfoService; |
|
|
|
private final IUserRoleService iUserRoleService; |
|
|
|
private final IRoleService iRoleService; |
|
|
|
|
|
|
|
public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) { |
|
|
|
LambdaQueryWrapper<DingEmployeeInfo> wrapper = Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
@@ -99,7 +102,21 @@ public class UserInfoManage { |
|
|
|
resUserDetailVO.setUserId(userInfo.getId()); |
|
|
|
resUserDetailVO.setPhoneNo(userInfo.getMobile()); |
|
|
|
resUserDetailVO.setStatus(userInfo.getAvailable()); |
|
|
|
resUserDetailVO.setUserRoleInfoList(new ArrayList<>()); |
|
|
|
|
|
|
|
// 装配用户角色信息列表 |
|
|
|
List<UserRole> userRoleList = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class).eq(UserRole::getUserId, userId)); |
|
|
|
List<UserRoleVO> userRoleInfoList = new ArrayList<>(); |
|
|
|
if (CollUtil.isNotEmpty(userRoleList)) { |
|
|
|
List<Long> roleIdList = userRoleList.stream().map(UserRole::getRoleId).collect(Collectors.toList()); |
|
|
|
List<Role> roleList = iRoleService.list(Wrappers.lambdaQuery(Role.class).in(Role::getId, roleIdList)); |
|
|
|
userRoleInfoList = roleList.stream().map(r -> { |
|
|
|
UserRoleVO userRoleVO = new UserRoleVO(); |
|
|
|
userRoleVO.setId(r.getId()); |
|
|
|
userRoleVO.setName(r.getName()); |
|
|
|
return userRoleVO; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
resUserDetailVO.setUserRoleInfoList(userRoleInfoList); |
|
|
|
return resUserDetailVO; |
|
|
|
} |
|
|
|
|
|
|
@@ -129,7 +146,8 @@ public class UserInfoManage { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private Long generateUserId(String employeeCode) { |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Long generateUserId(String employeeCode) { |
|
|
|
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.eq(UserInfo::getEmployeeCode, employeeCode)); |
|
|
|
if (Objects.isNull(userInfo)) { |
|
|
|