| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | 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; |
| | |
| | | private LcCompareMemberCodeMapper lcCompareMemberCodeMapper; |
| | | @Resource |
| | | private ComActFourMemberDao comActFourMemberDao; |
| | | @Resource |
| | | private SysAppConfigDao sysAppConfigDao; |
| | | @Resource |
| | | private SysTemplateConfigDao sysTemplateConfigDao; |
| | | // @Resource |
| | | // private GridService gridService; |
| | | |
| | |
| | | loginUserInfoVO.setType(sysUserDO.getType()); |
| | | loginUserInfoVO.setIsRealNamed(sysUserDO.getIdCard() != null);// 暂时 身份证判断实名制 |
| | | if(sysUserDO.getCommunityId()!=null){ |
| | | ComActVO comActVO = userDao.selectCommunity(sysUserDO.getCommunityId()); |
| | | loginUserInfoVO.setCommunityId(sysUserDO.getCommunityId()); |
| | | if(comActVO!=null){ |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode())); |
| | | if(sysAppConfig!=null){ |
| | | loginUserInfoVO.setAppId(sysAppConfig.getAppId()); |
| | | loginUserInfoVO.setAppSecret(sysAppConfig.getSecret()); |
| | | } |
| | | } |
| | | } |
| | | List<SysRoleDO> roleDOList = roleDAO.selectByUserId(sysUserDO.getUserId()); |
| | | Set<String> set = new HashSet<>(); |
| | |
| | | ComActVO comActVO = userDao.selectCommunity(userCommunityId); |
| | | if (comActVO != null) { |
| | | loginUserInfoVO.setCommunityName(comActVO.getName()); |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | loginUserInfoVO.setAreaCode(comActVO.getAreaCode()); |
| | | SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode())); |
| | | if(sysAppConfig!=null){ |
| | | loginUserInfoVO.setAppId(sysAppConfig.getAppId()); |
| | | loginUserInfoVO.setAppSecret(sysAppConfig.getSecret()); |
| | | } |
| | | } |
| | | } |
| | | if (!ObjectUtils.isEmpty(phone)) { |
| | |
| | | * @return 人员详情 |
| | | */ |
| | | @Override |
| | | public R detailUser(Long userId) { |
| | | public R<LoginUserInfoVO> detailUser(Long userId) { |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | if (userId < 100000000l) { |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | |
| | | ComActVO comActVO = userDao.selectCommunity(loginUserInfoVO.getCommunityId()); |
| | | if (!ObjectUtils.isEmpty(comActVO)) { |
| | | loginUserInfoVO.setCommunityName(comActVO.getName()); |
| | | loginUserInfoVO.setAreaCode(comActVO.getAreaCode()); |
| | | } |
| | | else{ |
| | | loginUserInfoVO.setAreaCode("510423"); |
| | | } |
| | | //是否是社区物业人员 |
| | | int countPropertyWorker = userDao.countPropertyWorker(userId, loginUserInfoVO.getCommunityId()); |
| | |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, loginUserInfoVO.getComActVO()).eq(SysTemplateConfig::getType,5)); |
| | | // 用户实名认证推送消息 |
| | | WxUtil.sendSubscribeRZSH(user.getOpenid(), accessToken, "实名认证", |
| | | com.panzhihua.common.utlis.DateUtils.getCurrentDateStr(), "认证成功"); |
| | | com.panzhihua.common.utlis.DateUtils.getCurrentDateStr(), "认证成功",sysTemplateConfig.getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送用户订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | |
| | | // 获取所有权限id |
| | | List<SysMenuDO> menuDOList = sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda() |
| | | .eq(SysMenuDO::getCommunityId, 2L).orderByAsc(SysMenuDO::getOrderNum)); |
| | | .eq(SysMenuDO::getCommunityId, 2L).eq(SysMenuDO::getVisible,0).orderByAsc(SysMenuDO::getOrderNum)); |
| | | if (!menuDOList.isEmpty()) { |
| | | menuIds = menuDOList.stream().map(sysMenuDO -> sysMenuDO.getMenuId()).collect(Collectors.toList()); |
| | | |
| | |
| | | * @return 展示数据 |
| | | */ |
| | | @Override |
| | | public R dataKanban() { |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(); |
| | | List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(); |
| | | public R dataKanban(String areaCode) { |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(areaCode); |
| | | List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(areaCode); |
| | | |
| | | List<String> communityUserX = new ArrayList<>(); |
| | | List<Integer> communityUserY = new ArrayList<>(); |
| | |
| | | */ |
| | | @Override |
| | | public R dataKanBans(DataKanBansDto dataKanBansDto){ |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(); |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(dataKanBansDto.getAreaCode()); |
| | | List<String> communityUserX = new ArrayList<>(); |
| | | List<Integer> communityUserY = new ArrayList<>(); |
| | | |
| | |
| | | |
| | | List<DataKanbanDTO> dataKanbanDTOS = null; |
| | | if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(); |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(dataKanBansDto.getAreaCode()); |
| | | }else{ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(); |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(dataKanBansDto.getAreaCode()); |
| | | } |
| | | if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { |
| | | dataKanbanDTOS.forEach(dataKanbanDTO -> { |
| | |
| | | List<Date> serverndays = com.panzhihua.common.utlis.DateUtils.getOldDays(); |
| | | serverndays.forEach(date -> { |
| | | // 查询社区活动数量 |
| | | DataKanbanDTO dataKanbanDTO = userDao.selectCommunityAddUserOrder(date); |
| | | DataKanbanDTO dataKanbanDTO = userDao.selectCommunityAddUserOrder(dataKanBansDto.getAreaCode(),date); |
| | | communityActiveUserX.add(DateFormatUtils.format(date, "MM-dd")); |
| | | communityActiveUserY.add(dataKanbanDTO.getNum()); |
| | | communityActiveUserZ.add(dataKanbanDTO.getDayNum()); |
| | |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | @Override |
| | | public R communityStatistics(){ |
| | | public R communityStatistics(String areaCode){ |
| | | //返回结果数据 |
| | | IndexUserStatisticsVo userStatisticsVo = new IndexUserStatisticsVo(); |
| | | //查询所有街道 |
| | | List<IndexUserStreetVo> streetList = userDao.getUserStreetList(); |
| | | List<IndexUserStreetVo> streetList = userDao.getUserStreetList(areaCode); |
| | | streetList.forEach(street -> { |
| | | List<IndexUserCommunityVo> communityList = userDao.getUserCommunityList(street.getStreetId()); |
| | | street.setCommunityList(communityList); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R communityStatisticsExport(){ |
| | | return R.ok(userDao.getUserCommunityExcelExport()); |
| | | public R communityStatisticsExport(String areaCode){ |
| | | return R.ok(userDao.getUserCommunityExcelExport(areaCode)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R addMcsMerchantUser(McsMerchantDTO mcsMerchantDTO) { |
| | | SysUserDO sysUserDO; |
| | | sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda() |
| | | .eq(SysUserDO::getAccount, mcsMerchantDTO.getAccount()).eq(SysUserDO::getType, 11)); |
| | | .eq(SysUserDO::getPhone, mcsMerchantDTO.getPhone()).eq(SysUserDO::getType, 11)); |
| | | String encode = new BCryptPasswordEncoder().encode(mcsMerchantDTO.getPassword()); |
| | | if (nonNull(sysUserDO)) { |
| | | return R.fail("账户已经存在"); |
| | | sysUserDO.setAccount(mcsMerchantDTO.getAccount()); |
| | | sysUserDO.setStatus(mcsMerchantDTO.getAccountStatus()); |
| | | sysUserDO.setPhone(mcsMerchantDTO.getPhone()); |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword()); |
| | | sysUserDO.setImageUrl(mcsMerchantDTO.getLogo()); |
| | | sysUserDO.setName(mcsMerchantDTO.getName()); |
| | | userDao.updateById(sysUserDO); |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | // sys_user 表 |
| | | sysUserDO = new SysUserDO(); |
| | | String encode = new BCryptPasswordEncoder().encode(mcsMerchantDTO.getPassword()); |
| | | BeanUtils.copyProperties(mcsMerchantDTO, sysUserDO); |
| | | sysUserDO.setAccount(mcsMerchantDTO.getAccount()); |
| | | sysUserDO.setType(11); |
| | |
| | | sysUserDO.setPhone(mcsMerchantDTO.getPhone()); |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword()); |
| | | sysUserDO.setImageUrl(mcsMerchantDTO.getLogo()); |
| | | try { |
| | | userDao.insert(sysUserDO); |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("修改数字商业街商家用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | return R.fail("手机号已存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | if (e.getMessage().contains("union_account_type") || e.getMessage().contains("23000")) { |
| | | return R.fail("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | return R.fail("手机号已存在"); |
| | | } else { |
| | | return R.fail("账户或手机号已存在,请重新填写尝试"); |
| | | } |
| | |
| | | String account = mcsMerchantDTO.getAccount(); |
| | | String phone = mcsMerchantDTO.getPhone(); |
| | | Integer accountStatus = mcsMerchantDTO.getAccountStatus(); |
| | | String name = mcsMerchantDTO.getName(); |
| | | if (isNotBlank(account)) { |
| | | sysUserDO.setAccount(account); |
| | | } |
| | |
| | | } |
| | | if (nonNull(accountStatus)) { |
| | | sysUserDO.setStatus(accountStatus); |
| | | } |
| | | if (isNotBlank(name)) { |
| | | sysUserDO.setName(name); |
| | | } |
| | | try { |
| | | userDao.updateById(sysUserDO); |
| | |
| | | public R getMcsUserByOpenId(String openid) { |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getOpenid, openid).eq(SysUserDO::getType, 11)); |
| | | McsLoginUserInfoVO loginUserInfoVO = null; |
| | | if (nonNull(sysUserDO)) { |
| | | if (nonNull(sysUserDO) && isNotBlank(sysUserDO.getOpenid())) { |
| | | loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | } |