From 0df5505f512752a96553fceafea6bc206d28ca74 Mon Sep 17 00:00:00 2001 From: luofl <1442745593@qq.com> Date: 星期二, 18 三月 2025 14:44:47 +0800 Subject: [PATCH] bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java index ff15303..60e8b34 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java @@ -22,6 +22,7 @@ private final ISystemUserService systemUserService; private final IPartyMemberService partyMemberService; private final RedisUtils redisUtils; + @Override public IdentityInformation getIdentityInformation(LoginUserInfoVO loginUserInfo) { // 获取党员信息 @@ -40,7 +41,7 @@ // 获取提示内容是否确认 Integer isConfirm = (Integer) redisUtils.get("confirmContent:" + loginUserInfo.getPhone()); - identityInformationVO.setIsConfirmContent(isConfirm !=null && isConfirm == 1); + identityInformationVO.setIsConfirmContent(isConfirm != null && isConfirm == 1); if (partyMember != null) { identityInformationVO.setIsFrozen(partyMember.getFreezeStatus() == 1); @@ -52,21 +53,20 @@ if (identity == null && systemUser != null) { identityInformationVO.setIdentity(2); redisUtils.set("identity:" + loginUserInfo.getPhone(), 2); - }else if (identity == null && partyMember != null){ + } else if (identity == null && partyMember != null) { identityInformationVO.setIdentity(1); redisUtils.set("identity:" + loginUserInfo.getPhone(), 1); - } - else { + } else { identityInformationVO.setIdentity(identity); } - if (identityInformationVO.getIdentity() != null){ - if (identityInformationVO.getIdentity() == 1){ - identityInformationVO.setIsFrozen(partyMember !=null && partyMember.getFreezeStatus() == 1); - }else if (identityInformationVO.getIdentity() == 2){ - identityInformationVO.setIsFrozen(systemUser != null &&systemUser.getStatus() == 2); + if (identityInformationVO.getIdentity() != null) { + if (identityInformationVO.getIdentity() == 1) { + identityInformationVO.setIsFrozen(partyMember != null && partyMember.getFreezeStatus() == 1); + } else if (identityInformationVO.getIdentity() == 2) { + identityInformationVO.setIsFrozen(systemUser != null && systemUser.getStatus() == 2); } - }else { + } else { identityInformationVO.setIsFrozen(false); } @@ -74,13 +74,7 @@ identityInformationVO.setIsPartymember(partyMember != null && partyMember.getAuditStatus().equals(1)); identityInformationVO.setIsConfirm(partyMember != null && partyMember.getIsConfirm() == 1); identityInformationVO.setAuditStatus(partyMember == null ? null : partyMember.getAuditStatus()); - if (partyMember != null) { - PermissionsVO partyMemberPermissions = new PermissionsVO(); - partyMemberPermissions.setIdentity(1); - partyMemberPermissions.setName(String.format("%s%s", partyMember.getCommunity(), "党员")); - partyMemberPermissions.setIsFrozen(partyMember.getFreezeStatus() == 1); - permissions.add(partyMemberPermissions); - } + if (systemUser != null) { Integer accountLevel = systemUser.getAccountLevel(); String districts = systemUser.getDistricts(); @@ -91,18 +85,25 @@ adminPermissions.setIsFrozen(systemUser.getStatus() == 2); if (accountLevel == 1) { adminPermissions.setName(String.format("%s%s", "攀枝花市", "管理员")); - } - if (accountLevel == 2) { + } else if (accountLevel == 2) { adminPermissions.setName(String.format("%s%s", districts, "管理员")); } else if (accountLevel == 3) { - adminPermissions.setIdentity(2); adminPermissions.setName(String.format("%s%s%s", districts, street, "管理员")); } else if (accountLevel == 4) { adminPermissions.setName(String.format("%s%s%s%s", districts, street, community, "管理员")); - adminPermissions.setIdentity(2); + } else { + adminPermissions.setName("未知"); } permissions.add(adminPermissions); } + + if (partyMember != null) { + PermissionsVO partyMemberPermissions = new PermissionsVO(); + partyMemberPermissions.setIdentity(1); + partyMemberPermissions.setName(String.format("%s%s", partyMember.getCommunity(), "党员")); + partyMemberPermissions.setIsFrozen(partyMember.getFreezeStatus() == 1); + permissions.add(partyMemberPermissions); + } identityInformationVO.setPermissions(permissions); return identityInformationVO; } -- Gitblit v1.7.1