| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.account.dto.BindDto; |
| | | import com.dsh.account.dto.IntroduceUserQuery; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UpdateInfoDto; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TCourseInfoRecord; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.entity.*; |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | | import com.dsh.account.model.vo.QueryAppUserVO; |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TCourseInfoRecordService; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | import com.dsh.account.service.*; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private TCourseInfoRecordService courseInfoRecordService; |
| | | |
| | | @Autowired |
| | | private TAppGiftService appGiftService; |
| | | /** |
| | | * 根据介绍有礼id查询当前活动参与次数 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/getActivityPeoples") |
| | | public Integer getActivityPeoples(@RequestBody Integer activityId){ |
| | | int activityId1 = appGiftService.list(new QueryWrapper<TAppGift>().eq("activityId", activityId)) |
| | | .size(); |
| | | return activityId1; |
| | | } |
| | | /** |
| | | * 介绍有礼 -- 参与用户列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/queryIntroduceAll") |
| | | public List<IntroduceUser> queryIntroduceAll(@RequestBody IntroduceUserQuery query){ |
| | | return appGiftService.queryIntroduceAll(query); |
| | | } |
| | | /** |
| | | * 获取所有用户 |
| | | */ |
| | |
| | | @RequestMapping("/base/appUser/listAll") |
| | | public List<QueryAppUserVO> listAll(@RequestBody QueryAppUser query){ |
| | | List<QueryAppUserVO> queryAppUserVOS = appUserService.listAll(query); |
| | | ArrayList<QueryAppUserVO> res = new ArrayList<>(); |
| | | |
| | | if (query.getUserIds()!=null && query.getUserIds().size()!=0){ |
| | | List<QueryAppUserVO> queryAppUserVOS1 = appUserService.listAll1(query); |
| | | queryAppUserVOS.addAll(queryAppUserVOS1); |
| | | } |
| | | return queryAppUserVOS.stream().distinct().collect(Collectors.toList()); |
| | | List<QueryAppUserVO> collect = queryAppUserVOS.stream().distinct().collect(Collectors.toList()); |
| | | for (QueryAppUserVO vo : collect) { |
| | | // 会员到期时间小于当前时间或者会员到期时间为null 则会员过期 |
| | | if (vo.getVipEndTime()!=null && vo.getVipEndTime().after(new Date())){ |
| | | vo.setIsVip(1); |
| | | }else{ |
| | | vo.setIsVip(0); |
| | | } |
| | | if (query.getIsVip() != null && (!query.getIsVip().equals("")) ){ |
| | | if (vo.getIsVip() == query.getIsVip()){ |
| | | res.add(vo); |
| | | } |
| | | }else{ |
| | | res.add(vo); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | |
| | | return appUser; |
| | | } |
| | | |
| | | // todo 短信验证码 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/getSMSCode") |
| | | @ApiOperation(value = "获取短信验证码", tags = {"APP-登录注册"}) |
| | |
| | | try { |
| | | ResultUtil smsCode = appUserService.getSMSCode(type, phone); |
| | | return smsCode; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TStudentService studentService; |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/logOff") |
| | | @ApiOperation(value = "注销", tags = {"注销"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "账号id", name = "appId", dataType = "int", required = true) |
| | | }) |
| | | public ResultUtil<String> logOff(Integer appId){ |
| | | try { |
| | | |
| | | appUserService.removeById(appId); |
| | | studentService.remove(new QueryWrapper<TStudent>().eq("appUserId",appId)); |
| | | |
| | | return ResultUtil.success("注销成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @PostMapping("/base/appUser/addVipPaymentAliCallback") |
| | | public void addVipPaymentAliCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | System.err.println("==============购买优惠卷回调========="); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |