diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java index db66c56..26eb4a7 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java @@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.model.constant.BizConst; +import com.hz.pm.api.common.model.constant.MhUnitConst; import com.hz.pm.api.common.util.StrUtils; import com.hz.pm.api.sys.mapper.RoleMapper; import com.hz.pm.api.sys.model.entity.Role; import com.hz.pm.api.sys.model.entity.UserRole; import com.hz.pm.api.sys.service.IUserRoleService; +import com.hz.pm.api.user.helper.MhUnitCache; import com.hz.pm.api.user.model.entity.UserInfo; import com.hz.pm.api.user.model.enumeration.RoleEnum; import com.hz.pm.api.user.model.enumeration.UserAvailableEnum; @@ -38,6 +40,7 @@ public class UserInfoHelperImpl implements UserInfoHelper { private final IUserInfoService userInfoService; private final IUserRoleService iUserRoleService; private final RoleMapper roleMapper; + private final MhUnitCache mhUnitCache; @Override public UserFullInfoDTO getUserFullInfoByMhUserIdOrOpenId(String mhUserId) { @@ -73,7 +76,8 @@ public class UserInfoHelperImpl implements UserInfoHelper { .collect(Collectors.toList()); userFullInfo.setUserRoleList(roleMapper.selectBatchIds(roleIdList)); } - + List viewUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.COUNTY_PARENT_UNIT_ID); + userFullInfo.setIsCountyUser(viewUnitIds.contains(userInfo.getMhUnitId())); // 装配返回 userFullInfo.setUserId(userInfo.getId()); userFullInfo.setMhUserId(userInfo.getMhUserId()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java index 9f8af6a..f24dabb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java @@ -69,7 +69,7 @@ public class SubmitPurchaseNoticeReq { private String purchaseMethod; @ApiModelProperty("是否发布信创云图") - public Boolean publishMhNotice; + private Boolean publishMhNotice; @ApiModelProperty("采购范围:1 公开采购、2 非公开采购") private Integer purchaseScope; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/convert/UserInfoConvertor.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/convert/UserInfoConvertor.java index c0b27bf..fb0b7fa 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/convert/UserInfoConvertor.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/convert/UserInfoConvertor.java @@ -29,6 +29,7 @@ public class UserInfoConvertor { userInfoDetails.setMhUnitName(userFullInfo.getMhUnitName()); userInfoDetails.setMobile(userFullInfo.getMobile()); userInfoDetails.setMhUserId(userFullInfo.getMhUserId()); + userInfoDetails.setIsCountyUser(userFullInfo.getIsCountyUser()); return userInfoDetails; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java index fea19e2..a747909 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java @@ -300,7 +300,7 @@ public class UserInfoManage { }).collect(Collectors.toList()); resUserDetail.setUserRoleInfoList(userRoles); } - resUserDetail.setIsCountyUser(userDetail.isCountyUser()); + resUserDetail.setIsCountyUser(userDetail.getIsCountyUser()); return resUserDetail; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserFullInfoDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserFullInfoDTO.java index 80e70ad..d76d3f7 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserFullInfoDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserFullInfoDTO.java @@ -51,6 +51,10 @@ public class UserFullInfoDTO { */ private UserAvailableEnum available; + /** + * 是否是区县用户 + */ + private Boolean isCountyUser; /** * 取最高的权限 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java index 49bbf6e..ed9b669 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/security/model/UserInfoDetails.java @@ -57,6 +57,11 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { private String mobile; + /** + * 是否是区县用户 + */ + private Boolean isCountyUser; + public String getUserIdStr() { return String.valueOf(getUserId()); } @@ -163,8 +168,4 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { return Collections.emptyList(); } - public boolean isCountyUser() { - return getMhUnitId().equals(MhUnitConst.COUNTY_PARENT_UNIT_ID); - } - }