Merge remote-tracking branch 'origin/master'
| | |
| | | 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" + |
| | | "on t.create_at = tmp.create_at and t.phone=tmp.phone "+ |
| | | "(select submit_user_id, 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.submit_user_id=tmp.submit_user_id "+ |
| | | "WHERE\n" + |
| | | "state in (1,3) and community_id=#{comMngVolunteerMngVO.communityId} \n" + |
| | | "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != ""'>" + |
| | |
| | | } |
| | | 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); |
| | | } |
| | | |
| | |
| | | if(shopOrders.isEmpty()){//未查询到用户上一笔订单 |
| | | //查询用户收货地址中的默认地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("delete_status", 2) |
| | | .eq("user_id",orderPreviewDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes)); |
| | | if(userAddressDO != null){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | |
| | | }else{//查询到用户上一笔订单 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrders.get(0).getReceiverId()); |
| | | if(userAddressDO != null){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO,userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | if(userAddressDO.getDeleteStatus() == 2) { |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO, userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(orderPreviewVO); |
| | |
| | | ComShopOrderVO shopOrderVO = new ComShopOrderVO(); |
| | | //查询用户收货地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(orderCreateDTO.getReceiverId()); |
| | | if(userAddressDO == null){ |
| | | if(userAddressDO == null||userAddressDO.getDeleteStatus()!=2){ |
| | | return R.fail("收货地址不存在"); |
| | | } |
| | | //用户id |
| | |
| | | R<LoginUserInfoVO> loginUserInfoVOR = userService.getUserInfo(account+"_5"); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class); |
| | | |
| | | if(loginUserInfoVO==null){ |
| | | return R.fail(500, "该账号不存在"); |
| | | } |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, loginUserInfoVO.getUserId())); |
| | | if (comShopStoreDO == null) { |
| | | R.fail(500, "商铺不存在"); |
| | | return R.fail(500, "该账号不存在"); |
| | | } |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @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(); |
| | | } |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * |