nickchange
2023-11-24 18b58aaf9bd99cadd0e7f80fe5d80586f2f4831a
cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java
@@ -265,12 +265,7 @@
            queryWrapper.like("reason", consumeQuery.getReason());
        }
        List<CourseCounsum> list = counsumService.list(queryWrapper);
//        List<CourseCounsum> list = counsumService.list(new QueryWrapper<CourseCounsum>().eq("paymentId", consumeQuery.getPayId()).eq("changeType", consumeQuery.getChangeType()).between("insertTime", consumeQuery.getStart(), consumeQuery.getEnd()).like("reason", consumeQuery.getReason()));
        return list;
    }
@@ -417,20 +412,22 @@
    @ResponseBody
    public void toClass(@RequestBody ToClassDto toClassDto) throws ParseException {
        System.out.println("===========到达getSelect======="+toClassDto);
        TCoursePackagePayment orinPay = paymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("id", toClassDto.getId()));
        TCoursePackagePayment studentPay = paymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId",orinPay.getCoursePackageId()));
        TCoursePackagePayment orinPay =
                paymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("id", toClassDto.getId()));
        TCoursePackagePayment studentPay = paymentService.getOne
                (new QueryWrapper<TCoursePackagePayment>()
                        .eq("studentId", toClassDto.getToStudentId())
                        .eq("coursePackageId",orinPay.getCoursePackageId()));
        if (studentPay!=null) {
            System.out.println("======orinPay=====>" + orinPay);
            System.out.println("======studentPay=====>" + studentPay);
            Integer laveClassHours = orinPay.getLaveClassHours();
            Integer totalClassHours = orinPay.getTotalClassHours();
            orinPay.setTotalClassHours(0);
            orinPay.setLaveClassHours(0);
            orinPay.setStatus(1);
            orinPay.setAppUserId(null);
            paymentService.updateById(orinPay);
            //删除orin的排课记录
            List<CoursePackageStudent> studentCourse1 = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", orinPay.getStudentId()).eq("coursePackageId", orinPay.getCoursePackageId()));
            List<Long> collect1 = studentCourse1.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList());
@@ -442,8 +439,8 @@
            CourseCounsum courseCounsum = new CourseCounsum();
            courseCounsum.setInsertTime(new Date());
            if (orinPay.getAppUserId()!=studentPay.getAppUserId()){
                courseCounsum.setReason("赠课");
            }else {            courseCounsum.setReason("转课");
                courseCounsum.setReason("课时转移");
            }else {            courseCounsum.setReason("课时转移");
            }
            courseCounsum.setNum(laveClassHours);
            courseCounsum.setChangeType(0);
@@ -463,8 +460,8 @@
            CourseCounsum courseCounsum1 = new CourseCounsum();
            courseCounsum1.setInsertTime(new Date());
            if (orinPay.getAppUserId()!=studentPay.getAppUserId()){
                courseCounsum1.setReason("赠课");
            }else {            courseCounsum1.setReason("转课");
                courseCounsum1.setReason("课时转移");
            }else {            courseCounsum1.setReason("课时转移");
            }
            courseCounsum1.setNum(laveClassHours);
            courseCounsum1.setChangeType(1);
@@ -582,7 +579,7 @@
            CourseCounsum courseCounsum = new CourseCounsum();
            courseCounsum.setInsertTime(new Date());
            courseCounsum.setReason("赠课");
            courseCounsum.setReason("课时转移");
            courseCounsum.setNum(orinPay.getLaveClassHours());
            courseCounsum.setChangeType(0);
            courseCounsum.setPaymentId(orinPay.getId());
@@ -594,7 +591,7 @@
            CourseCounsum courseCounsum1 = new CourseCounsum();
            courseCounsum1.setInsertTime(new Date());
            courseCounsum1.setReason("赠课");
            courseCounsum1.setReason("课时转移");
            courseCounsum1.setNum(orinPay.getLaveClassHours());
            courseCounsum1.setChangeType(1);
            courseCounsum1.setPaymentId(to.getId());