From c24bd91b480d8d87844e795ce11c759ea1e6be98 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期二, 22 二月 2022 16:53:14 +0800 Subject: [PATCH] 三社功能提交 --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 130 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 104 insertions(+), 26 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java index ef8a8b3..b31c903 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java @@ -14,11 +14,6 @@ import javax.annotation.Resource; -import cn.hutool.core.util.IdcardUtil; -import com.panzhihua.common.model.dtos.DataKanBansDto; -import com.panzhihua.common.model.vos.community.*; -import com.panzhihua.service_user.dao.*; -import com.panzhihua.service_user.model.dos.*; import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateUtils; import org.springframework.beans.BeanUtils; @@ -37,6 +32,7 @@ import com.panzhihua.common.constants.Constants; import com.panzhihua.common.constants.UserConstants; import com.panzhihua.common.exceptions.ServiceException; +import com.panzhihua.common.model.dtos.DataKanBansDto; import com.panzhihua.common.model.dtos.PageDTO; import com.panzhihua.common.model.dtos.community.ExportUserDTO; import com.panzhihua.common.model.dtos.community.NoticeReadDTO; @@ -59,6 +55,11 @@ import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.SystemmanagementConfigVO; +import com.panzhihua.common.model.vos.community.ComActVO; +import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; +import com.panzhihua.common.model.vos.community.IndexUserCommunityVo; +import com.panzhihua.common.model.vos.community.IndexUserStatisticsVo; +import com.panzhihua.common.model.vos.community.IndexUserStreetVo; import com.panzhihua.common.model.vos.grid.GridMemberVO; import com.panzhihua.common.model.vos.grid.admin.GridMemberBuildingVO; import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; @@ -84,10 +85,41 @@ import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.common.utlis.WxUtil; import com.panzhihua.common.utlis.WxXCXTempSend; +import com.panzhihua.service_user.dao.ComActFourMemberDao; +import com.panzhihua.service_user.dao.ComMngFamilyInfoDAO; +import com.panzhihua.service_user.dao.ComMngUserTagDAO; +import com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper; +import com.panzhihua.service_user.dao.LcCompareMemberCodeMapper; +import com.panzhihua.service_user.dao.RoleDAO; +import com.panzhihua.service_user.dao.SysMenuDAO; +import com.panzhihua.service_user.dao.SysOperLogDAO; +import com.panzhihua.service_user.dao.SysRoleMenuDAO; +import com.panzhihua.service_user.dao.SysUserAgreementDAO; +import com.panzhihua.service_user.dao.SysUserFeedbackDAO; +import com.panzhihua.service_user.dao.SysUserInputDAO; +import com.panzhihua.service_user.dao.SysUserNoticeDAO; +import com.panzhihua.service_user.dao.SysUserRoleDAO; +import com.panzhihua.service_user.dao.UserDao; +import com.panzhihua.service_user.model.dos.ComActFourMember; +import com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO; +import com.panzhihua.service_user.model.dos.ComMngUserTagDO; +import com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO; +import com.panzhihua.service_user.model.dos.LcCompareCodeMemberDO; +import com.panzhihua.service_user.model.dos.SysMenuDO; +import com.panzhihua.service_user.model.dos.SysOperLogDO; +import com.panzhihua.service_user.model.dos.SysRoleDO; +import com.panzhihua.service_user.model.dos.SysRoleMenuDO; +import com.panzhihua.service_user.model.dos.SysUserAgreementDO; +import com.panzhihua.service_user.model.dos.SysUserDO; +import com.panzhihua.service_user.model.dos.SysUserFeedbackDO; +import com.panzhihua.service_user.model.dos.SysUserInputDO; +import com.panzhihua.service_user.model.dos.SysUserNoticeDO; +import com.panzhihua.service_user.model.dos.SysUserRoleDO; import com.panzhihua.service_user.model.dtos.DataKanbanDTO; import com.panzhihua.service_user.service.EventGridMemberBuildingRelationService; import com.panzhihua.service_user.service.UserService; +import cn.hutool.core.util.IdcardUtil; import lombok.extern.slf4j.Slf4j; // import com.panzhihua.common.service.grid.GridService; @@ -325,6 +357,8 @@ loginUserInfoVO.setIsmemberrole(2); loginUserInfoVO.setIsFourMember(2); loginUserInfoVO.setIsCommunityWorker(2); + loginUserInfoVO.setIsPropertyWorker(2); + loginUserInfoVO.setIsSocialWorker(2); // 志愿者状态 String phone = sysUserDO.getPhone(); Long userCommunityId = sysUserDO.getCommunityId(); @@ -347,6 +381,11 @@ if(countFourMember>0){ loginUserInfoVO.setIsFourMember(1); } + //是否是社区物业人员 + int countPropertyWorker = userDao.countPropertyWorker(Long.parseLong(userId), userCommunityId); + if (countPropertyWorker > 0) { + loginUserInfoVO.setIsPropertyWorker(1); + } // 是否是"管理员"或者 本社区 "社区团队"、"党委成员" Integer countTeam = userDao.selectCountTeam(phone, userCommunityId); Integer selectCountMemberRole = userDao.selectCountMemberRole(phone, userCommunityId); @@ -358,6 +397,10 @@ loginUserInfoVO.setIsmemberrole(1); } else if (isSysUser != null && isSysUser > 0) { loginUserInfoVO.setIsmemberrole(1); + } + Integer countSocialWorker = userDao.countSocialWorker(phone,userCommunityId); + if(countSocialWorker>0){ + loginUserInfoVO.setIsSocialWorker(1); } } loginUserInfoVO.setIsRealNamed(sysUserDO.getIdCard() != null); @@ -584,6 +627,7 @@ if (ObjectUtils.isEmpty(sysUserDO)) { return R.fail("人员不存在"); } + BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO .selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId)); @@ -637,8 +681,24 @@ if (!ObjectUtils.isEmpty(comActVO)) { loginUserInfoVO.setCommunityName(comActVO.getName()); } + //是否是社区物业人员 + int countPropertyWorker = userDao.countPropertyWorker(userId, loginUserInfoVO.getCommunityId()); + loginUserInfoVO.setIsPropertyWorker(countPropertyWorker > 0 ? 1 : 0); loginUserInfoVO.setIdCard(SensitiveUtil.desensitizedIdNumber(loginUserInfoVO.getIdCard())); loginUserInfoVO.setPhone(SensitiveUtil.desensitizedPhoneNumber(loginUserInfoVO.getPhone())); + //判断账号类型 + int countSocialOrg=userDao.countSocialOrg(userId); + if(countSocialOrg>0){ + loginUserInfoVO.setUserType(3); + } + else { + if(loginUserInfoVO.getStreetId()!=null){ + loginUserInfoVO.setUserType(1); + } + else { + loginUserInfoVO.setUserType(2); + } + } return R.ok(loginUserInfoVO); } @@ -1147,25 +1207,23 @@ List<Long> menu=new ArrayList<>(); if(administratorsUserVO.getSocialType()==1){ sysRoleDO.setRoleKey(Constants.STREET_ROLE_KEY + administratorsUserVO.getStreetId()); - menu.add(233L); - menu.add(234L); - menu.add(235L); - menu.add(236L); - menu.add(237L); + menu.add(300L); + menu.add(301L); + menu.add(302L); + menu.add(303L); + menu.add(304L); } else if(administratorsUserVO.getSocialType()==2){ sysRoleDO.setRoleKey("social_org" + administratorsUserVO.getStreetId()); - menu.add(233L); - menu.add(76L); - menu.add(234L); - menu.add(236L); - menu.add(237L); - menu.add(238L); + menu.add(300L); + menu.add(301L); + menu.add(302L); + menu.add(303L); } else if(administratorsUserVO.getSocialType()==3){ sysRoleDO.setRoleKey("social_org_member" + administratorsUserVO.getStreetId()); - menu.add(233L); - menu.add(237L); + menu.add(300L); + menu.add(303L); } sysRoleDO.setRoleSort(0); @@ -1180,7 +1238,7 @@ // 新街道管理员角色设置固定三社权限 MenuRoleVO menuRoleVO = new MenuRoleVO(); menuRoleVO.setMenuIds(menu); - menuRoleVO.setRoleId(roleId); + menuRoleVO.setRoleId(sysRoleDO.getRoleId()); this.putMenuRole(menuRoleVO); } } @@ -1367,7 +1425,7 @@ } Long communityId = sysUserDO.getCommunityId(); Long communityId1 = administratorsUserVO.getCommunityId(); - if (communityId1.intValue() != communityId.intValue()) { + if (communityId1!=null&&communityId1.intValue() != communityId.intValue()) { return R.fail("用户不属于当前平台"); } // 删除用户 @@ -2150,7 +2208,7 @@ @Override public R editSysUser(ShopStoreVO storeVO) { SysUserDO sysUserDO1 = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda() - .eq(SysUserDO::getPhone, storeVO.getPhone()).eq(SysUserDO::getType, 5)); + .eq(SysUserDO::getPhone, storeVO.getStoreAccount()).eq(SysUserDO::getType, 5)); if (sysUserDO1 == null) { return R.fail("未查询到后台管理用户!"); } @@ -2676,10 +2734,6 @@ if (nonNull(sysUserDO)) { return R.fail("账户已经存在"); } - sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, convenientMerchantDTO.getPhone())); - if (nonNull(sysUserDO)) { - return R.fail("手机号已经存在"); - } // sys_user 表 sysUserDO = new SysUserDO(); String encode = new BCryptPasswordEncoder().encode(convenientMerchantDTO.getPassword()); @@ -2688,7 +2742,7 @@ sysUserDO.setType(10); sysUserDO.setAreaId(null); sysUserDO.setStatus(1); - sysUserDO.setPhone(convenientMerchantDTO.getPhone()); + sysUserDO.setPhone(null); sysUserDO.setName(convenientMerchantDTO.getContacts()); sysUserDO.setPassword(encode); try { @@ -2832,4 +2886,28 @@ public R communityStatisticsExport(){ return R.ok(userDao.getUserCommunityExcelExport()); } + + /** + * 通过UnionId获取用户信息 + * @param unionId + * @return + */ + @Override + public R getUserInfoByUnionId(String unionId) { + SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getUnionid, unionId)); + if (isNull(sysUserDO)) { + return R.fail("用户不存在"); + } + LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); + BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); + return R.ok(loginUserInfoVO); + } + + @Override + public R updateStreetId(AdministratorsUserVO administratorsUserVO) { + SysUserDO sysUserDO=new SysUserDO(); + BeanUtils.copyProperties(administratorsUserVO,sysUserDO); + userDao.updateById(sysUserDO); + return R.ok(); + } } -- Gitblit v1.7.1