puzhibing
2023-08-04 7e312fda9048ef171ff146acf6c8c679d123d357
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
@@ -207,13 +207,13 @@
    }
    @PostMapping("/base/coursePack/paymentCourse")
    public List<PurchaseRecordVo> queryCourseDetails(@RequestParam("startTime") Date startTime, @RequestParam("endTime") Date  endTime,@RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId) {
    public List<PurchaseRecordVo> queryCourseDetails(@RequestBody GetStuSessionList sessionList) {
        List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>();
        List<TCoursePackagePayment> coursePackage = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>()
                .between("insertTime", startTime,endTime)
                .eq("appUserId",appUserId)
                .eq("studentId",stuId));
                .between("insertTime", sessionList.getStartTime(),sessionList.getEndTime())
                .eq("appUserId",sessionList.getAppUserId())
                .eq("studentId",sessionList.getStuId()));
        if (coursePackage.size() > 0 ){
            coursePackage.forEach( cspackage -> {
                PurchaseRecordVo recordVo = new PurchaseRecordVo();
@@ -389,7 +389,7 @@
                baseVo.setName(coursePackage.getName());
                list.add(baseVo);
            });
            return ResultUtil.success();
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -414,9 +414,12 @@
                return ResultUtil.tokenErr();
            }
            List<Integer> courseIds = new ArrayList<>();
            List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>()
                    .eq("coursePackageId",search.getCourseTypeId())
                    .eq("appUserId",appUserId));
            QueryWrapper<TCoursePackagePayment> queryWrapper = new QueryWrapper<TCoursePackagePayment>().eq("appUserId", appUserId)
                    .groupBy("coursePackageId");
            if (ToolUtil.isNotEmpty(search.getCourseTypeId())){
                queryWrapper.eq("coursePackageId",search.getCourseTypeId());
            }
            List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.list(queryWrapper);
            if (tCoursePackagePayments.size() > 0 ){
                courseIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList());
            }
@@ -526,7 +529,7 @@
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
            @ApiImplicitParam(name = "coursePayId" ,value = "课包记录id",dataType = "long"),
    })
    public ResultUtil<CourseDetailsResponse> getRegisteredData( Integer coursePayId){
    public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
@@ -763,10 +766,9 @@
    @PostMapping("/base/coursePack/obtainStudentClassDetails")
    public List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody Integer stuId){
    public List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody WeeksOfCourseRest stuId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            return packagePaymentService.obtainStuClassDetails(stuId,appUserId);
            return packagePaymentService.obtainStuClassDetails(stuId.getStuId(),stuId.getAppUserId());
        }catch (Exception e){
            e.printStackTrace();
            throw new RuntimeException();