Quellcode durchsuchen

用户编辑 及用户禁用启用 fix

master
liuxinxin vor 1 Jahr
Ursprung
Commit
34d800ba23
2 geänderte Dateien mit 21 neuen und 2 gelöschten Zeilen
  1. +20
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  2. +1
    -0
      pmapi/src/main/resources/security/auth-dev.yml

+ 20
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java Datei anzeigen

@@ -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)) {


+ 1
- 0
pmapi/src/main/resources/security/auth-dev.yml Datei anzeigen

@@ -22,6 +22,7 @@ security:
- /oa/**
- /wflow/**
- /sys/**
- /api/v1/user-info/**
ignore-csrf-urls:
- /api/v1/user/auth/**
- /v2/api-docs


Laden…
Abbrechen
Speichern