From ff3f4ff4c8a6da4c1650611e11a4551680b10d77 Mon Sep 17 00:00:00 2001 From: luo <2855143437@qq.com> Date: 星期二, 26 九月 2023 21:26:22 +0800 Subject: [PATCH] 9.26。6 --- cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java | 54 +++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 13 deletions(-) diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java index 5cb017b..60e4adc 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java +++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dsh.course.entity.*; +import com.dsh.course.entity.TAppUser; import com.dsh.course.feignclient.account.AppUserClient; import com.dsh.course.feignclient.account.StudentClient; import com.dsh.course.feignclient.account.model.AppUser; @@ -657,7 +658,6 @@ } } - /** * 课后视频课表 */ @@ -711,7 +711,6 @@ } } - @ResponseBody @PostMapping("/api/startCource/payCourseInfo") @ApiOperation(value = "课后练习-购课详情(用于购课)", tags = {"APP-开始上课"}) @@ -725,7 +724,6 @@ return ResultUtil.runErr(); } } - @ResponseBody @PostMapping("/api/startCource/getMyCourseList") @@ -764,7 +762,6 @@ } } - /** * 更新课后视频学习状态 */ @@ -785,7 +782,6 @@ return ResultUtil.runErr(); } } - @ResponseBody @@ -829,7 +825,6 @@ }catch (Exception e){ return ResultUtil.runErr(); } - } @@ -1149,9 +1144,13 @@ @PostMapping("/base/coursePack/getCoursePackagePaymentById") - public TCoursePackagePayment getCoursePackagePaymentById(@RequestBody Integer id){ - return packagePaymentService.getById(id); + public TCoursePackagePayment getCoursePackagePaymentById(@RequestBody Long id){ + TCoursePackagePayment byId = packagePaymentService.getById(id); + System.out.println("======byId=========="+byId); + return byId; } + + @PostMapping("/base/coursePack/delPaymentCoursePackage") public boolean delPaymentCoursePackage(@RequestBody Integer payId){ return packagePaymentService.removeById(payId); @@ -1269,7 +1268,7 @@ */ @ResponseBody @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById") - public TCoursePackagePayment queryCoursePackagePaymentById(@RequestBody Long id){ + public TCoursePackagePayment queryCoursePackagePaymentById(@RequestParam("id")Long id){ return packagePaymentService.getById(id); } @@ -1291,7 +1290,22 @@ @ResponseBody @PostMapping("/coursePackagePayment/editCoursePackagePayment") public void editCoursePackagePayment(TCoursePackagePayment coursePackagePayment){ + coursePackagePayment.setAppUserId(null); packagePaymentService.updateById(coursePackagePayment); + } + + + + /** + * 修改数据 + * @param coursePackagePayment + */ + @ResponseBody + @PostMapping("/coursePackagePayment/editCoursePackagePayment1") + public void editCoursePackagePayment1(@RequestBody TCoursePackagePayment coursePackagePayment){ + System.out.println("editCoursePackagePayment1====coursePackagePayment"+coursePackagePayment); +// coursePackagePayment.setCoursePackageId(null); + packagePaymentService.updateBytime(coursePackagePayment); } @@ -1323,8 +1337,14 @@ if (ToolUtil.isEmpty(packagePayment) || packagePayment.size()==0){ return ResultUtil.error("该用户未购买该课包"); } + List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingMapper.selectList(new LambdaQueryWrapper<CoursePackageScheduling>() + .eq(CoursePackageScheduling::getCoursePackageId, Integer.valueOf(courseID)) + .like(CoursePackageScheduling::getClassDate, time) + ); + List<CoursePackageStudent> coursePackageStudent = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>() .in(CoursePackageStudent::getCoursePackagePaymentId,packagePayment.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList())) + .in(CoursePackageStudent::getCoursePackageSchedulingId,coursePackageSchedulings.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList())) .eq(CoursePackageStudent::getCoursePackageId,courseID) .eq(CoursePackageStudent::getStudentId,stuId) .eq(CoursePackageStudent::getAppUserId,appUserId) @@ -1342,6 +1362,7 @@ } return ResultUtil.success(); }catch (Exception e){ + e.printStackTrace(); return ResultUtil.runErr(); } } @@ -1388,10 +1409,13 @@ String classEndTime = tCoursePackage.getClassEndTime(); String[] split1 = classEndTime.split(","); ArrayList<String> strings = new ArrayList<>(); - for (int i1 = 0; i1 < split.length; i1++) { - String s = split[i1] + "-" + split1[i1]; - strings.add(s); + if(ToolUtil.isNotEmpty(classStartTime)){ + for (int i1 = 0; i1 < split.length; i1++) { + String s = split[i1].substring(0,5) + "-" + split1[i1].substring(0,5); + strings.add(s); + } } + detailsListVo.setTime(strings); List<CoursePackagePaymentConfig> list2 = icppcService.list(new LambdaQueryWrapper<CoursePackagePaymentConfig>().eq(CoursePackagePaymentConfig::getCoursePackageId, tCoursePackage.getId()).orderByAsc(CoursePackagePaymentConfig::getCashPayment)); if (list2.size() > 0) { @@ -1405,6 +1429,9 @@ .eq(CoursePackageScheduling::getCoursePackageId, tCoursePackage.getId()) .like(CoursePackageScheduling::getClassDate, courseDetailReq.getTime()) ); + if(list3.size()==0){ + break; + } List<Long> collect2 = list3.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList()); if(collect2.size()==0){ collect2.add(-1l); @@ -1416,12 +1443,13 @@ in(CoursePackageStudent::getCoursePackagePaymentId, ids) ); - detailsListVo.setType(1); + detailsListVo.setType(1); if(list4.size()>0){ Integer signInOrNot = list4.get(0).getSignInOrNot(); if(signInOrNot==2){ detailsListVo.setType(3); } + detailsListVo.setIsType(list4.get(0).getType()); } } else { -- Gitblit v1.7.1