| | |
| | | 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; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | |
| | | @RequestMapping("/base/course/changeState") |
| | | @ResponseBody |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | |
| | | return courseService.changeState(dto); |
| | | } |
| | | |
| | |
| | | @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"); |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //分账 |
| | | public void moneyOut(){ |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/course/addCourse") |
| | | public void addCourse(@RequestBody TCourse course){ |
| | | course.setState(1); |
| | | course.setInsertTime(new Date()); |
| | | courseService.save(course); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @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()); |
| | |
| | | |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService packagePaymentConfigService; |
| | | @PostMapping("/course/times") |
| | | public List<SelectDto> times(@RequestBody Integer oneId){ |
| | | List<CoursePackagePaymentConfig> list = packagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId",oneId)); |
| | | List<SelectDto> integerList = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list) { |
| | | // integerList.add(coursePackagePaymentConfig.getClassHours()); |
| | | SelectDto selectDto = new SelectDto(); |
| | | selectDto.setId(coursePackagePaymentConfig.getId()); |
| | | selectDto.setValue(String.valueOf(coursePackagePaymentConfig.getClassHours())); |
| | | integerList.add(selectDto); |
| | | } |
| | | |
| | | |
| | | return integerList; |
| | | } |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |