| | |
| | | private final IComActService comActService; |
| | | private final RedisUtils redisUtils; |
| | | private final ISystemUserLevelService systemUserLevelService; |
| | | private final IdentityInformationService identityInformationService; |
| | | /** |
| | | * 党员分页查询列表 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public Page<PartyMember> pageList(PartyMemberQuery query, SystemUserVo loginUserInfo) { |
| | | SystemUser user = systemUserService.getById(loginUserInfo.getId()); |
| | | if (Objects.isNull(user)){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | loginUserInfo.setAccountLevel(user.getAccountLevel()); |
| | | loginUserInfo.setDistrictsCode(user.getDistrictsCode()); |
| | | loginUserInfo.setStreetId(user.getStreetId()); |
| | | loginUserInfo.setCommunityId(user.getCommunityId()); |
| | | return baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()),query,loginUserInfo); |
| | | // 判断当前登录用户是否有权限查看这个社区的党员 |
| | | // if(loginUserInfo.getAccountLevel()==1){ |
| | |
| | | */ |
| | | @Override |
| | | public void export(PartyMemberQuery query, SystemUserVo loginUserInfo) throws IOException { |
| | | List<PartyMember> list = baseMapper.queryList(query,loginUserInfo); |
| | | SystemUser user = systemUserService.getById(loginUserInfo.getId()); |
| | | if (Objects.isNull(user)){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | loginUserInfo.setAccountLevel(user.getAccountLevel()); |
| | | loginUserInfo.setDistrictsCode(user.getDistrictsCode()); |
| | | loginUserInfo.setStreetId(user.getStreetId()); |
| | | loginUserInfo.setCommunityId(user.getCommunityId()); |
| | | List<PartyMember> list = baseMapper.queryList(query,loginUserInfo); |
| | | List<PartyMemberExcel> partyMemberExcels = BeanUtil.copyToList(list, PartyMemberExcel.class); |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | if (adminUser == null){ |
| | | throw new ServiceException("无权审核"); |
| | | } |
| | | |
| | | Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfo.getPhone()); |
| | | if(identity != null && identity != 2){ |
| | | IdentityInformation identityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo); |
| | | if(identityInformation.getIdentity().equals(1)){ |
| | | throw new ServiceException("请切换至管理员身份"); |
| | | } |
| | | |
| | | int accountLevel = adminUser.getAccountLevel(); |
| | | SystemUserLevel systemUserLevel = identityInformation.getSystemUserLevel(); |
| | | int accountLevel = systemUserLevel.getLevel(); |
| | | Long communityId = null; |
| | | String streetId = null; |
| | | String districtsCode = null; |
| | | if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) { |
| | | communityId = adminUser.getCommunityId(); |
| | | communityId = systemUserLevel.getCommunityId(); |
| | | } else if (accountLevel == ReportTypeEnum.STREET.getCode()) { |
| | | streetId = adminUser.getStreetId(); |
| | | streetId = systemUserLevel.getStreetId(); |
| | | } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) { |
| | | districtsCode = adminUser.getDistrictsCode(); |
| | | districtsCode = systemUserLevel.getDistrictsCode(); |
| | | } else if(accountLevel != ReportTypeEnum.CITY.getCode()){ |
| | | throw new ServiceException("无权审核:未知等级"); |
| | | } |