liujie
2023-09-28 f0f6bd6f7499d1fa737f705091337befb98f5112
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;
@@ -1204,9 +1205,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);
@@ -1235,7 +1240,7 @@
        return packagePaymentService.save(packagePayment);
    }
    @ResponseBody
    @PostMapping("/base/coursePack/obtainStudentClassDetails")
    public List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody WeeksOfCourseRest stuId){
        try {
@@ -1324,7 +1329,7 @@
     */
    @ResponseBody
    @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById")
    public TCoursePackagePayment queryCoursePackagePaymentById(@RequestBody Long id){
    public TCoursePackagePayment queryCoursePackagePaymentById(@RequestParam("id")Long id){
        return packagePaymentService.getById(id);
    }
@@ -1346,7 +1351,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);
    }
@@ -1378,8 +1398,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)
@@ -1397,6 +1423,7 @@
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
@@ -1443,10 +1470,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) {
@@ -1460,6 +1490,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);
@@ -1471,12 +1504,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 {