| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.vos.community.ComAreaTownCommunityVO; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.service_user.dao.*; |
| | |
| | | loginUserInfoVO.setCommunityId(sysUserDO.getCommunityId()); |
| | | if(comActVO!=null){ |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | String areaName=userDao.selectAreaCodeByStreetId(comActVO.getStreetId()); |
| | | if(StringUtils.isNotEmpty(areaName)){ |
| | | loginUserInfoVO.setAreaName(areaName); |
| | | } |
| | | SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode())); |
| | | if(sysAppConfig!=null){ |
| | | loginUserInfoVO.setAppId(sysAppConfig.getAppId()); |
| | |
| | | loginUserInfoVO.setIsPropertyWorker(2); |
| | | loginUserInfoVO.setIsSocialWorker(2); |
| | | loginUserInfoVO.setIsFmsMember(2); |
| | | loginUserInfoVO.setIsAcidMember(2); |
| | | loginUserInfoVO.setIsAcidMember(0); |
| | | // 志愿者状态 |
| | | String phone = sysUserDO.getPhone(); |
| | | Long userCommunityId = sysUserDO.getCommunityId(); |
| | |
| | | //是否是防疫工作人员 |
| | | ComActAcidMemberVO acidMember = userDao.selectAcidMemberByPhone(phone); |
| | | if (nonNull(acidMember)) { |
| | | loginUserInfoVO.setIsAcidMember(1); |
| | | if(acidMember.getRelationName().equals("panzhihua")||acidMember.getRelationName().equals("西区")||acidMember.getRelationName().equals("东区")||acidMember.getRelationName().equals("仁和区")||acidMember.getRelationName().equals("米易县")||acidMember.getRelationName().equals("盐边县")){ |
| | | loginUserInfoVO.setIsAcidMember(1); |
| | | } |
| | | else { |
| | | loginUserInfoVO.setIsAcidMember(2); |
| | | } |
| | | loginUserInfoVO.setRelationName(acidMember.getRelationName()); |
| | | } |
| | | Integer count=userDao.selectOrgAdmin(phone); |
| | | if(count>0){ |
| | | loginUserInfoVO.setIsCheckUnitAdmin(1); |
| | | } |
| | | else { |
| | | loginUserInfoVO.setIsCheckUnitAdmin(0); |
| | | } |
| | | //是否网格员 |
| | | int easyPhotoMember = userDao.countEasyPhotoMember(phone, userCommunityId); |
| | |
| | | } |
| | | ComActVO comActVO = userDao.selectCommunity(loginUserInfoVO.getCommunityId()); |
| | | if (!ObjectUtils.isEmpty(comActVO)) { |
| | | String areaName=userDao.selectAreaCodeByStreetId(comActVO.getStreetId()); |
| | | if(StringUtils.isNotEmpty(areaName)){ |
| | | loginUserInfoVO.setAreaName(areaName); |
| | | } |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | loginUserInfoVO.setCommunityName(comActVO.getName()); |
| | | loginUserInfoVO.setAreaCode(comActVO.getAreaCode()); |
| | |
| | | int countFmsMember = userDao.countFmsMember(loginUserInfoVO.getPhone(), loginUserInfoVO.getCommunityId()); |
| | | loginUserInfoVO.setIsFmsMember(countFmsMember > 0 ? 1 : 0); |
| | | //是否是防疫工作人员 |
| | | loginUserInfoVO.setIsAcidMember(2); |
| | | loginUserInfoVO.setIsAcidMember(0); |
| | | ComActAcidMemberVO acidMember = userDao.selectAcidMemberByPhone(loginUserInfoVO.getPhone()); |
| | | if (nonNull(acidMember)) { |
| | | loginUserInfoVO.setIsAcidMember(1); |
| | | if(acidMember.getRelationName().equals("panzhihua")||acidMember.getRelationName().equals("西区")||acidMember.getRelationName().equals("东区")||acidMember.getRelationName().equals("仁和区")||acidMember.getRelationName().equals("米易县")||acidMember.getRelationName().equals("盐边县")){ |
| | | loginUserInfoVO.setIsAcidMember(1); |
| | | } |
| | | else { |
| | | loginUserInfoVO.setIsAcidMember(2); |
| | | } |
| | | loginUserInfoVO.setRelationName(acidMember.getRelationName()); |
| | | } |
| | | loginUserInfoVO.setIdCard(SensitiveUtil.desensitizedIdNumber(loginUserInfoVO.getIdCard())); |
| | |
| | | // 实名认证成功推送订阅消息给用户 |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | String accessToken = util.getAccessToken(); |
| | | SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, loginUserInfoVO.getComActVO()).eq(SysTemplateConfig::getType,5)); |
| | | // 用户实名认证推送消息 |
| | | WxUtil.sendSubscribeRZSH(user.getOpenid(), accessToken, "实名认证", |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addUserBackstage(AdministratorsUserVO administratorsUserVO) { |
| | | ComActVO comActVO = userDao.selectCommunity(administratorsUserVO.getCommunityId()); |
| | | if (nonNull(comActVO)) { |
| | | List<ComAreaTownCommunityVO> areaTownList = userDao.selectAreaTownCommunity(comActVO.getName()); |
| | | if (!areaTownList.isEmpty()) { |
| | | administratorsUserVO.setRelationName(comActVO.getName()); |
| | | String address = comActVO.getAddress(); |
| | | if (areaTownList.size() > 1 && isNotBlank(address)) { |
| | | ComAreaTownCommunityVO townCommunityVO = areaTownList.stream() |
| | | .filter(e -> address.contains(e.getArea()) && address.contains(e.getTown())).findFirst().orElse(null); |
| | | if (nonNull(townCommunityVO)) { |
| | | administratorsUserVO.setRelationName(String.join(",", townCommunityVO.getArea(), townCommunityVO.getTown(), townCommunityVO.getCommunity())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | Long roleId = administratorsUserVO.getRoleId(); |
| | | if (roleId.intValue() == 999999999 || roleId.intValue() == 888888888) { |
| | |
| | | throw new ServiceException("手机号已存在"); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (insert > 0 && sysUserDO.getType() == 3 &&sysUserDO.getStreetId()==null) {// 添加的用户是社区账号时 |
| | | // 添加网格综合治理管理后台用户 |
| | | SysUserDO sysUserDOWangGe = new SysUserDO(); |
| | | BeanUtils.copyProperties(sysUserDO, sysUserDOWangGe); |
| | | sysUserDOWangGe.setUserId(null); |
| | | sysUserDOWangGe.setType(7);// 网格综治后台 |
| | | try { |
| | | int addWange = userDao.insert(sysUserDOWangGe); |
| | | if (addWange != 1) { |
| | | throw new ServiceException("新增网格综合治理管理后台用户失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("网格综合治理管理后台用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | throw new ServiceException("手机号已经存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | throw new ServiceException("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | throw new ServiceException("手机号已存在"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (insert > 0) { |
| | | SysUserDO sysUserDO1 = userDao |
| | |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deleteUserBackstage(AdministratorsUserVO administratorsUserVO) { |
| | | Long userId = administratorsUserVO.getUserId(); |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | |
| | | @Override |
| | | public R dataKanban(String areaCode) { |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(areaCode); |
| | | List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(areaCode); |
| | | List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(new Page(1L, 9999L), areaCode).getRecords(); |
| | | |
| | | List<String> communityUserX = new ArrayList<>(); |
| | | List<Integer> communityUserY = new ArrayList<>(); |
| | |
| | | List<Integer> communityActiveUserZ = new ArrayList<>(); |
| | | |
| | | List<DataKanbanDTO> dataKanbanDTOS = null; |
| | | Page page = new Page<>(); |
| | | if (nonNull(dataKanBansDto.getPageNum()) && nonNull(dataKanBansDto.getPageSize())) { |
| | | page.setCurrent(dataKanBansDto.getPageNum()); |
| | | page.setSize(dataKanBansDto.getPageSize()); |
| | | } else { |
| | | page.setCurrent(1L); |
| | | page.setSize(20L); |
| | | } |
| | | if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(dataKanBansDto.getAreaCode()); |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(page, dataKanBansDto.getAreaCode()).getRecords(); |
| | | }else{ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(dataKanBansDto.getAreaCode()); |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(page, dataKanBansDto.getAreaCode()).getRecords(); |
| | | } |
| | | if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { |
| | | dataKanbanDTOS.forEach(dataKanbanDTO -> { |