| | |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.RealNameUtil; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.model.dos.*; |
| | | import com.panzhihua.service_user.model.dtos.DataKanbanDTO; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | |
| | | private SysRoleMenuDAO sysRoleMenuDAO; |
| | | @Resource |
| | | private SysMenuDAO sysMenuDAO; |
| | | @Resource |
| | | private SysUserInputDAO sysUserInputDAO; |
| | | |
| | | |
| | | /** |
| | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setPhone(purePhoneNumber); |
| | | sysUserDO.setUserId(userId); |
| | | userDao.updateMemberRole(purePhoneNumber, purePhoneNumber); |
| | | userDao.updateServiceTeam(purePhoneNumber, purePhoneNumber); |
| | | int i = userDao.updateById(sysUserDO); |
| | | if (i > 0) { |
| | | return R.ok(); |
| | |
| | | */ |
| | | @Override |
| | | public R detailUser(Long userId) { |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | | if (ObjectUtils.isEmpty(sysUserDO)) { |
| | | return R.fail("人员不存在"); |
| | | } |
| | | LoginUserInfoVO loginUserInfoVO=new LoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO,loginUserInfoVO); |
| | | List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO.selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId)); |
| | | if (!ObjectUtils.isEmpty(comMngFamilyInfoDOS)) { |
| | | List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>(); |
| | | comMngFamilyInfoDOS.forEach(comMngFamilyInfoDO -> { |
| | | ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO(); |
| | | BeanUtils.copyProperties(comMngFamilyInfoDO,comMngFamilyInfoVO); |
| | | comMngFamilyInfoVOS.add(comMngFamilyInfoVO); |
| | | }); |
| | | loginUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | if(userId<100000000l){ |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | | if (ObjectUtils.isEmpty(sysUserDO)) { |
| | | return R.fail("人员不存在"); |
| | | } |
| | | BeanUtils.copyProperties(sysUserDO,loginUserInfoVO); |
| | | List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO.selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId)); |
| | | if (!ObjectUtils.isEmpty(comMngFamilyInfoDOS)) { |
| | | List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>(); |
| | | comMngFamilyInfoDOS.forEach(comMngFamilyInfoDO -> { |
| | | ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO(); |
| | | BeanUtils.copyProperties(comMngFamilyInfoDO,comMngFamilyInfoVO); |
| | | comMngFamilyInfoVOS.add(comMngFamilyInfoVO); |
| | | }); |
| | | loginUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | |
| | | }else{ |
| | | //导入社区人员 |
| | | SysUserInputDO sysUserInputDO = sysUserInputDAO.selectById(userId - 100000000); |
| | | if (ObjectUtils.isEmpty(sysUserInputDO)) { |
| | | return R.fail("人员不存在"); |
| | | } |
| | | String name1 = sysUserInputDO.getName(); |
| | | BeanUtils.copyProperties(sysUserInputDO,loginUserInfoVO); |
| | | String doorNumber = sysUserInputDO.getDoorNumber(); |
| | | Long areaId = sysUserInputDO.getAreaId(); |
| | | List<SysUserInputDO> sysUserInputDOS = sysUserInputDAO.selectList(new QueryWrapper<SysUserInputDO>().lambda().eq(SysUserInputDO::getDoorNumber, doorNumber).eq(SysUserInputDO::getAreaId, areaId)); |
| | | if (!ObjectUtils.isEmpty(sysUserInputDOS)) { |
| | | List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>(); |
| | | sysUserInputDOS.forEach(sysUserInputDO1 -> { |
| | | String name = sysUserInputDO1.getName(); |
| | | if (name1.equals(name)) { |
| | | return; |
| | | } |
| | | Integer isRent = sysUserInputDO1.getIsRent(); |
| | | ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO(); |
| | | comMngFamilyInfoVO.setIdCard(sysUserInputDO1.getIdCard()); |
| | | comMngFamilyInfoVO.setName(name); |
| | | comMngFamilyInfoVO.setPhone(sysUserInputDO1.getPhone()); |
| | | if (isRent.intValue()==0) { |
| | | comMngFamilyInfoVO.setRelationship("家人"); |
| | | }else{ |
| | | comMngFamilyInfoVO.setRelationship("合租"); |
| | | } |
| | | comMngFamilyInfoVO.setAge(IdCard.IdNOToAge(sysUserInputDO1.getIdCard())); |
| | | comMngFamilyInfoVOS.add(comMngFamilyInfoVO); |
| | | }); |
| | | loginUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | |
| | | } |
| | | ComActVO comActVO=userDao.selectCommunity(loginUserInfoVO.getCommunityId()); |
| | | if (!ObjectUtils.isEmpty(comActVO)) { |
| | |
| | | SysUserDO sysUserDO=new SysUserDO(); |
| | | sysUserDO.setUserId(userPhoneVO.getUserId()); |
| | | sysUserDO.setPhone(newPhone); |
| | | userDao.updateMemberRole(newPhone, oldPhone); |
| | | userDao.updateServiceTeam(newPhone, oldPhone); |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (update>0) { |
| | | |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | public R addFeedback(SysUserFeedbackDTO sysUserFeedbackDTO) { |
| | | SysUserFeedbackDO sysUserFeedbackDO=new SysUserFeedbackDO(); |
| | | BeanUtils.copyProperties(sysUserFeedbackDTO,sysUserFeedbackDO); |
| | | sysUserFeedbackDO.setPhotoPath(sysUserFeedbackDTO.getPhotoPah()); |
| | | int insert = sysUserFeedbackDAO.insert(sysUserFeedbackDO); |
| | | if (insert>0) { |
| | | return R.ok(); |
| | |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 校验小区是否存在 |
| | | * |
| | | * @param areaName 小区名字 |
| | | * @return 校验结果 |
| | | */ |
| | | @Override |
| | | public R checkAereaName(String areaName) { |
| | | Integer num=userDao.selectCountArea(areaName); |
| | | if (num>0) { |
| | | Integer integer = userDao.selectCountHouse(areaName); |
| | | if (integer>0) { |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("小区房屋信息未创建,请先在社区平台添加房屋信息"); |
| | | } |
| | | }else{ |
| | | return R.fail("小区不存在,请先在社区平台添加小区"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 社区人员详情包括导入人员 |
| | | * |
| | | * @param userId 人员id |
| | | * @return CommunityUserInfoVO |
| | | */ |
| | | @Override |
| | | public CommunityUserInfoVO detailUserComunity(Long userId) { |
| | | CommunityUserInfoVO communityUserInfoVO=new CommunityUserInfoVO(); |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | | if (!ObjectUtils.isEmpty(sysUserDO)) { |
| | | String idCard = sysUserDO.getIdCard(); |
| | | if (!ObjectUtils.isEmpty(idCard)) { |
| | | communityUserInfoVO.setAge(IdCard.IdNOToAge(idCard)); |
| | | communityUserInfoVO.setBirthday(IdCard.birthDay(idCard)); |
| | | communityUserInfoVO.setIdCard(idCard); |
| | | } |
| | | communityUserInfoVO.setCreateAt(sysUserDO.getCreateAt()); |
| | | communityUserInfoVO.setName(sysUserDO.getName()); |
| | | String phone = sysUserDO.getPhone(); |
| | | communityUserInfoVO.setPhone(phone); |
| | | communityUserInfoVO.setSex(sysUserDO.getSex()); |
| | | communityUserInfoVO.setTags(sysUserDO.getTags()); |
| | | communityUserInfoVO.setUserId(userId); |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO = userDao.selectVolunteerMngByPhone(phone); |
| | | if (!ObjectUtils.isEmpty(comMngVolunteerMngVO)) { |
| | | communityUserInfoVO.setVolunteerCreateAt(comMngVolunteerMngVO.getCreateAt()); |
| | | } |
| | | Integer isPartymember = sysUserDO.getIsPartymember(); |
| | | if (isPartymember.intValue()==1) { |
| | | communityUserInfoVO.setPoliticalOutlook(1); |
| | | }else{ |
| | | communityUserInfoVO.setPoliticalOutlook(3); |
| | | } |
| | | communityUserInfoVO.setIsVolunteer(sysUserDO.getIsVolunteer()); |
| | | List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO.selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId)); |
| | | if (!ObjectUtils.isEmpty(comMngFamilyInfoDOS)) { |
| | | List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>(); |
| | | comMngFamilyInfoDOS.forEach(comMngFamilyInfoDO -> { |
| | | ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO(); |
| | | BeanUtils.copyProperties(comMngFamilyInfoDO,comMngFamilyInfoVO); |
| | | comMngFamilyInfoVOS.add(comMngFamilyInfoVO); |
| | | }); |
| | | communityUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | } |
| | | return communityUserInfoVO; |
| | | } |
| | | |
| | | /** |
| | | * 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | * |
| | | * @param exportUserDTO 用户搜索内容 |
| | | * @return List<EexcelUserDTO> excel内容 |
| | | */ |
| | | @Override |
| | | public R export(ExportUserDTO exportUserDTO) { |
| | | List<EexcelUserDTO> eexcelUserDTOS=userDao.selectExport(exportUserDTO); |
| | | return R.ok(eexcelUserDTOS); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // String encode = new BCryptPasswordEncoder().encode("lbsq123456"); |
| | | // System.out.println(encode); |