| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.entity.dto.SelectDto; |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.model.dto.CourseChangeStateDTO; |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService coursePackagePaymentConfigService; |
| | | |
| | | /** |
| | | * 上/下架 1为上架 2为下架 3为删除 |
| | |
| | | @RequestMapping("/base/course/changeState") |
| | | @ResponseBody |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | |
| | | return courseService.changeState(dto); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "lat", dataType = "string", required = false), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<CoursePackageInfo> queryCourseInfo(Integer id, String lon, String lat){ |
| | | public ResultUtil<CoursePackageInfo> queryCourseInfo(Integer id, String lon, String lat,Long payId){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil paymentCourse(PaymentCourseVo paymentCourseVo){ |
| | | public synchronized ResultUtil paymentCourse(PaymentCourseVo paymentCourseVo){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | |
| | | @PostMapping("/base/course/aliPaymentCourseCallback") |
| | | public void aliPaymentCourseCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | System.err.println("=====支付宝回调======="); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | |
| | | TCoursePackagePayment one = list.get(0); |
| | | if(one.getPayStatus() == 1){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setPayStatus(1); |
| | | coursePackagePayment.setOrderNumber(trade_no); |
| | | coursePackagePayment.setAppUserId(null); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | } |
| | |
| | | return strings; |
| | | |
| | | } |
| | | |
| | | // 获取课包商品的价格配置 |
| | | @PostMapping("/course/getHoursByPackageId") |
| | | @ResponseBody |
| | | public List<CoursePackagePaymentConfig> getHoursByPackageId(@RequestBody Integer coursePackageId1){ |
| | | List<CoursePackagePaymentConfig> coursePackageId = coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", coursePackageId1)); |
| | | return coursePackageId; |
| | | } |
| | | @PostMapping("/course/getHours") |
| | | public String getHours(@RequestBody Integer coursePackageId1){ |
| | | public List<Integer> getHours(@RequestBody Integer coursePackageId1){ |
| | | return coursePackageService.getHours(coursePackageId1); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | public Boolean auditDiscount( @RequestBody AuditDiscount auditDiscount){ |
| | | TCoursePackageDiscount byId = discountService.getById(auditDiscount.getId()); |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, byId.getCoursePackageId())); |
| | | |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>() |
| | | .eq(TCoursePackageDiscount::getCoursePackageId, auditDiscount.getId())); |
| | | for (TCoursePackageDiscount tCoursePackageDiscount : list) { |
| | | tCoursePackageDiscount.setAuditStatus(auditDiscount.getType()); |
| | | tCoursePackageDiscount.setAuditRemark(auditDiscount.getText()); |
| | |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService packagePaymentConfigService; |
| | | @PostMapping("/course/times") |
| | | public List<Integer> times( @RequestBody Integer oneId){ |
| | | public List<SelectDto> times(@RequestBody Integer oneId){ |
| | | List<CoursePackagePaymentConfig> list = packagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId",oneId)); |
| | | List<Integer> integerList = new ArrayList<>(); |
| | | List<SelectDto> integerList = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list) { |
| | | integerList.add(coursePackagePaymentConfig.getClassHours()); |
| | | // integerList.add(coursePackagePaymentConfig.getClassHours()); |
| | | SelectDto selectDto = new SelectDto(); |
| | | selectDto.setId(coursePackagePaymentConfig.getId()); |
| | | selectDto.setValue(String.valueOf(coursePackagePaymentConfig.getClassHours())); |
| | | integerList.add(selectDto); |
| | | } |
| | | |
| | | |