From 3fc4e643ae86f3b6ddc28963107f060abc84edb5 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 30 Aug 2024 13:24:10 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8C=BA=E5=8E=BF=E7=94=A8=E6=88=B7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java | 6 +++++- .../api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java | 2 +- .../main/java/com/hz/pm/api/user/convert/UserInfoConvertor.java | 1 + .../src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java | 2 +- .../java/com/hz/pm/api/user/security/model/UserFullInfoDTO.java | 4 ++++ .../java/com/hz/pm/api/user/security/model/UserInfoDetails.java | 9 +++++---- 6 files changed, 17 insertions(+), 7 deletions(-) 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); - } - }