소스 검색

modify:

1. 增加是否是区县用户判断;
tags/24083001
WendyYang 2 달 전
부모
커밋
b8207853d5
4개의 변경된 파일15개의 추가작업 그리고 3개의 파일을 삭제
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/MhUnitConst.java
  2. +5
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java
  3. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/user/model/vo/ResUserDetailVO.java
  4. +5
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/MhUnitConst.java 파일 보기

@@ -16,6 +16,8 @@ public class MhUnitConst {
private MhUnitConst() {
}

public static final long COUNTY_PARENT_UNIT_ID = 1084;

public static final long ROOT_UNIT_ID = 1;

public static final String UNIT_XCB = "信创办";


+ 5
- 3
hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java 파일 보기

@@ -26,6 +26,7 @@ import com.hz.pm.api.user.model.vo.ResUserDetailVO;
import com.hz.pm.api.user.model.vo.UserInfoListVO;
import com.hz.pm.api.user.model.vo.UserRoleVO;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.service.IUserInfoService;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
@@ -267,8 +268,8 @@ public class UserInfoManage {


public ResUserDetailVO currentUserInfo() {
Long userId = LoginUserUtil.getUserId();
UserInfo userInfo = userInfoService.getById(userId);
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
UserInfo userInfo = userInfoService.getById(userDetail.getUserId());
if (Objects.isNull(userInfo)) {
return null;
}
@@ -286,7 +287,7 @@ public class UserInfoManage {
resUserDetail.setMhUnitName(userInfo.getMhUnitName());

// 装配用户角色信息列表
List<UserRole> userRoleList = userRoleService.listByUserId(userId);
List<UserRole> userRoleList = userRoleService.listByUserId(userDetail.getUserId());
if (CollUtil.isNotEmpty(userRoleList)) {
List<Long> roleIdList = CollUtils.fieldList(userRoleList, UserRole::getRoleId);
List<Role> roleList = roleService.listByIds(roleIdList);
@@ -299,6 +300,7 @@ public class UserInfoManage {
}).collect(Collectors.toList());
resUserDetail.setUserRoleInfoList(userRoles);
}
resUserDetail.setIsCountyUser(userDetail.isCountyUser());
return resUserDetail;
}



+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/user/model/vo/ResUserDetailVO.java 파일 보기

@@ -51,4 +51,7 @@ public class ResUserDetailVO {
@ApiModelProperty("头像")
private String avatar;

@ApiModelProperty("是否是区县用户")
private Boolean isCountyUser;

}

+ 5
- 0
hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java 파일 보기

@@ -2,6 +2,7 @@ package com.hz.pm.api.user.security.model;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.hz.pm.api.common.model.constant.MhUnitConst;
import com.hz.pm.api.sys.model.entity.Role;
import com.hz.pm.api.user.model.enumeration.RoleEnum;
import com.ningdatech.basic.auth.AbstractLoginUser;
@@ -162,4 +163,8 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails {
return Collections.emptyList();
}

public boolean isCountyUser() {
return getMhUnitId().equals(MhUnitConst.COUNTY_PARENT_UNIT_ID);
}

}

불러오는 중...
취소
저장