From bc91619c854cc2dbb01b20d0c47d76c4881e9ee8 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:52:21 +0800 Subject: [PATCH] Merge remote-tracking branch '喜望/dev-2.0.1' into dev-2.0.1 --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java | 60 +++++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 47 insertions(+), 13 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java index 07fdc5b..68af4ae 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java @@ -49,6 +49,7 @@ private final IComStreetService comStreetService; private final IComActService comActService; private final RedisUtils redisUtils; + private final ISystemUserLevelService systemUserLevelService; /** * 党员分页查询列表 * @@ -58,7 +59,33 @@ */ @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){ +// // 是市级权限 全查 +// return baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()),query,loginUserInfo); +// } +// if(loginUserInfo.getAccountLevel()==2){ +// // 是区县权限 +// // 判断当前登录用户是否有权限查看这个社区的党员 +// LambdaQueryWrapper<PartyMember> queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(PartyMember::getDistrictsCode,loginUserInfo.getDistrictsCode()); +// if(StrUtil.isNotBlank(query.getName())){ +// queryWrapper.like(PartyMember::getName,query.getName()); +// } +// if(StrUtil.isNotBlank(query.getIdNumber())){} +// } +// return null; + + } /** * 添加党员 @@ -90,6 +117,7 @@ partyMember.setSource(1); save(partyMember); } else { + partyMember.setIsConfirm(0); partyMember.setUpdateBy(Long.parseLong(loginUserInfo.getId().toString())); updateById(partyMember); } @@ -100,11 +128,12 @@ * @param loginUserInfo */ @Override - public void freeze(Long id, SystemUserVo loginUserInfo) { + public PartyMember freeze(Long id, SystemUserVo loginUserInfo) { PartyMember partyMember = getById(id); partyMember.setFreezeStatus(partyMember.getFreezeStatus() == 1 ? 0 : 1); partyMember.setUpdateBy(Long.parseLong(loginUserInfo.getId().toString())); updateById(partyMember); + return partyMember; } @Override @@ -125,7 +154,15 @@ */ @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"); @@ -228,11 +265,12 @@ // 验证社区是否存在且属于该街道 // 实际代码应该是调用相应的Service查询社区信息 ComAct comAct = comActService.getCommunityByNameAndStreet(communityName, comStreet.getStreetId()); - streetId = comStreet.getStreetId(); - communityId = comAct.getCommunityId(); if (Objects.isNull(comAct)) { isValid = false; errorMsg.append("社区不存在或不属于所选街道; "); + } else { + streetId = comStreet.getStreetId(); + communityId = comAct.getCommunityId(); } } } @@ -256,8 +294,8 @@ //导入党员默认审核通过 partyMember.setAuditStatus(AuditStatusEnum.APPROVED.getCode()); partyMember.setSource(1);//管理后台录入 - //默认头像 TODO 默认头像 - partyMember.setAvatar(""); + //默认头像 + partyMember.setAvatar("https://www.psciio.com//idcard/f15c91f940624ed59537ecced1059f18.jpg"); // 根据身份证号设置性别 if (StrUtil.isNotBlank(template.getIdNumber())) { partyMember.setGender(getGender(template.getIdNumber())); @@ -309,10 +347,11 @@ * @param loginUserInfo */ @Override - public void audit(PartyMemberDTO dto, SystemUserVo loginUserInfo) { + public PartyMember audit(PartyMemberDTO dto, SystemUserVo loginUserInfo) { PartyMember partyMember = BeanUtil.copyProperties(dto, PartyMember.class); partyMember.setUpdateBy(Long.parseLong(loginUserInfo.getId().toString())); updateById(partyMember); + return this.getById(dto.getId()); } @Override @@ -325,11 +364,6 @@ .ne(SystemUser::getAccountLevel, 5) .last("LIMIT 1")); - // 获取党员信息 - PartyMember partyMember = getOne(new LambdaQueryWrapper<PartyMember>() - .eq(PartyMember::getPhone, loginUserInfo.getPhone()) - .eq(PartyMember::getDelFlag, 0)); - if (adminUser == null){ @@ -337,7 +371,7 @@ } Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfo.getPhone()); - if(identity == null || identity == 2){ + if(identity != null && identity != 2){ throw new ServiceException("请切换至管理员身份"); } -- Gitblit v1.7.1