| | |
| | | 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.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * |
| | | * @param userId 志愿者用户ID |
| | | * @param type |
| | | */ |
| | | @Override |
| | | public R putUserIsVolunteerById(Long userId, int type) { |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setIsVolunteer(type); |
| | | sysUserDO.setUserId(userId); |
| | | |
| | | SysUserDO userInDB = userDao.selectById(userId); |
| | | if(userInDB!=null) { |
| | | boolean isVol = userInDB.getIsVolunteer()==1; |
| | | if(isVol){ |
| | | return R.fail("用户已是志愿者"); |
| | | } |
| | | if(userInDB.getType()!=1){ |
| | | return R.fail("用户不是小程序用户"); |
| | | } |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail(); |
| | | } |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * |
| | |
| | | //接入第三方实名认证 |
| | | String idCard = loginUserInfoVO.getIdCard(); |
| | | String name = loginUserInfoVO.getName(); |
| | | log.info("用户实名认证发送请求,姓名:" + name + "身份证号码:" + idCard); |
| | | boolean b = RealNameUtil.authentication(idCard, name); |
| | | if (!b) { |
| | | return R.fail("身份认证失败:公安系统认证错误"); |
| | |
| | | return R.ok(sysUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增SysUser |
| | | * @param storeVO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addSysUser(ShopStoreVO storeVO){ |
| | | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | |
| | | return R.fail("角色不存在"); |
| | | } |
| | | String encode = new BCryptPasswordEncoder().encode(storeVO.getStorePassword()); |
| | | storeVO.setStorePassword(encode); |
| | | BeanUtils.copyProperties(storeVO, sysUserDO); |
| | | sysUserDO.setAccount(storeVO.getStoreAccount()); |
| | | sysUserDO.setType(5); |
| | |
| | | sysUserDO.setStatus(1); |
| | | sysUserDO.setPhone(storeVO.getPhone()); |
| | | sysUserDO.setName(storeVO.getContacts()); |
| | | sysUserDO.setPassword(encode); |
| | | int insert = 0; |
| | | try { |
| | | insert = userDao.insert(sysUserDO); |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 修改SysUser用户信息 |
| | | * @param storeVO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R editSysUser(ShopStoreVO storeVO){ |
| | | SysUserDO sysUserDO1 = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone,storeVO.getPhone()) |
| | | .eq(SysUserDO::getType,5)); |
| | | if(sysUserDO1 == null){ |
| | | return R.fail("未查询到后台管理用户!"); |
| | | } |
| | | String encode = new BCryptPasswordEncoder().encode(storeVO.getStorePassword()); |
| | | sysUserDO1.setPassword(encode); |
| | | if (userDao.updateById(sysUserDO1) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("密码修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户小程序首页活动提示 |
| | | * @param userEditTipsDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | public R editUserTips(SysUserEditTipsDTO userEditTipsDTO){ |
| | | //查询用户信息 |
| | | SysUserDO userDO = userDao.selectById(userEditTipsDTO.getUserId()); |
| | | if(userDO == null){ |
| | | return R.fail("未查询到用户信息"); |
| | | } |
| | | //修改用户信息 |
| | | userDO.setIsTips(userEditTipsDTO.getIsTips()); |
| | | userDao.updateById(userDO); |
| | | if(userDao.updateById(userDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |