| | |
| | | private Integer integral; |
| | | |
| | | @ApiModelProperty(value = "用户userid",hidden = true) |
| | | @Deprecated |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "申请提交人ID",hidden = true) |
| | |
| | | @PostMapping("putuserisvolunteer") |
| | | R putUserIsVolunteer(@RequestParam("phone") String phone,@RequestParam("type")int type); |
| | | |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 用户ID |
| | | * @param type 1 支援者 0不是志愿者 |
| | | */ |
| | | @PostMapping("putuserisvolunteerbyid") |
| | | R putUserIsVolunteerById(@RequestParam("userId") Long userId,@RequestParam("type")int type); |
| | | |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * @param loginUserInfoVO 社区小区数据 |
| | |
| | | int state = comMngVolunteerMngVO.getState().intValue(); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | Date date = new Date(); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getUserId()); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setBusinessType(5); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getUserId()); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getSubmitUserId()); |
| | | sysUserNoticeVO.setBusinessTime(date); |
| | | sysUserNoticeVO.setStatus(0); |
| | | if (state==2) {//通过 |
| | | // 修改用户志愿者审核状态 |
| | | String phone = comMngVolunteerMngVO1.getPhone(); |
| | | R r3 = userService.putUserIsVolunteer(phone,1); |
| | | //String phone = comMngVolunteerMngVO1.getPhone(); |
| | | R r3 = userService.putUserIsVolunteerById(comMngVolunteerMngVO1.getSubmitUserId(),1); |
| | | if (R.isOk(r3)) { |
| | | log.info("修改手机号【{}】的支援者状态为否",phone); |
| | | log.info("修改用户【{}】的支援者状态为否", comMngVolunteerMngVO1.getSubmitUserId()); |
| | | }else{ |
| | | log.info("手机号【{}】没有小程序用户",phone); |
| | | log.info("用户【{}】没有小程序用户", comMngVolunteerMngVO1.getSubmitUserId()); |
| | | } |
| | | |
| | | sysUserNoticeVO.setTitle("志愿者申请通过审核"); |
| | |
| | | "t.state,\n" + |
| | | "t.phone,\n" + |
| | | "t.apply_reson,\n" + |
| | | "t.create_at \n" + |
| | | "t.create_at, " + |
| | | "t.submit_user_id \n" + |
| | | "FROM\n" + |
| | | "com_mng_volunteer_mng t\n" + |
| | | " RIGHT JOIN \n" + |
| | | "(select phone, MAX(create_at)create_at from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY phone ) tmp \n" + |
| | | "(select phone, MAX(create_at)create_at from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY submit_user_id ) tmp \n" + |
| | | "on t.create_at = tmp.create_at and t.phone=tmp.phone "+ |
| | | "WHERE\n" + |
| | | "state in (1,3) and community_id=#{comMngVolunteerMngVO.communityId} \n" + |
| | |
| | | } |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | BeanUtils.copyProperties(comMngVolunteerMngDO,comMngVolunteerMngVO); |
| | | String phone = comMngVolunteerMngVO.getPhone(); |
| | | comMngVolunteerMngVO.setUserId(comMngVolunteerMngDAO.selectUserIdByPhone(phone)); |
| | | //String phone = comMngVolunteerMngVO.getPhone(); |
| | | //comMngVolunteerMngVO.setUserId(comMngVolunteerMngDAO.selectUserIdByPhone(phone)); |
| | | return R.ok(comMngVolunteerMngVO); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 志愿者ID |
| | | * @param type 1是志愿者 0 不是 |
| | | */ |
| | | @PostMapping("putuserisvolunteerbyid") |
| | | R putUserIsVolunteerById(@RequestParam("userId")Long userId,@RequestParam("type")int type){ |
| | | return userService.putUserIsVolunteerById(userId, type); |
| | | } |
| | | |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * @param loginUserInfoVO 社区小区数据 |
| | | * @return 绑定结果 |
| | |
| | | */ |
| | | R putUserIsVolunteer(String phone, int type); |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 用户ID |
| | | * @param type 1是志愿者 0 不是 |
| | | */ |
| | | R putUserIsVolunteerById(Long userId, int type); |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * @param loginUserInfoVO 社区小区数据 |
| | | * @return 绑定结果 |
| | |
| | | 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(); |
| | | } |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * |