From eb88e1b9c634496b7840dca48898510f36357d46 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期四, 02 十一月 2023 08:52:11 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java | 235 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 127 insertions(+), 108 deletions(-) diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java index aba1585..ae124df 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java +++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java @@ -3,6 +3,7 @@ import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.dsh.course.entity.*; @@ -53,6 +54,50 @@ @Resource private CoursePackageSchedulingMapper coursePackageSchedulingService; + + + + + @RequestMapping("/getStudentTotal") + @ResponseBody + public List<Map<String, Object>> get(@RequestBody StudentQeryDto studentQeryDto) { + System.out.println("-====studentQeryDto========="+studentQeryDto); + List<Map<String, Object>> pays = paymentService.getStudentTotal(studentQeryDto); + System.out.println("=========pays======"+pays); + + return pays; + + } + + + @RequestMapping("/bypac") + @ResponseBody + public List<Map<String, Object>> bypac(@RequestBody PacQueryDto pacQueryDto) { + + + + + + System.out.println("-====studentQeryDto========="+pacQueryDto); + List<Map<String, Object>> pays = paymentService.bypac(pacQueryDto); + System.out.println("=========pays======"+pays); + + return pays; + + } + + @ResponseBody + @PostMapping("/queryIdsByStore") + public List<Integer> queryIdsByStore(@RequestBody Integer objectId){ + List<TCoursePackage> list = packageService.list(new LambdaQueryWrapper<TCoursePackage>().eq(TCoursePackage::getStoreId, objectId)); + List<Integer> collect = list.stream().map(TCoursePackage::getId).collect(Collectors.toList()); + if(collect.size()==0){ + collect.add(-1); + } + return collect; + } + + //获取学员课时数信息 @RequestMapping("/getInfo") @ResponseBody @@ -443,7 +488,7 @@ private StudentClient studentClient; @RequestMapping(value = "/toHoli",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") @ResponseBody - public String toHoli(@RequestBody ToHoliDto toHoliDto){ + public String toHoli(@RequestBody ToHoliDto toHoliDto) throws ParseException { String [] ids = toHoliDto.getIds(); List<String> strings = new ArrayList<>(); @@ -510,27 +555,23 @@ CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse = format1.parse(format.format(time) + " " + split[i1]); Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); coursePackageScheduling.setClassDate(parse); coursePackageScheduling.setEndDate(parse1); coursePackageScheduling.setStatus(1); coursePackageSchedulingService.insert(coursePackageScheduling); - CoursePackageStudent student1 = new CoursePackageStudent(); - student1.setAppUserId(student.getAppUserId()); - student1.setStudentId(student.getId()); - student1.setCoursePackageId(tCoursePackage.getId()); - student1.setCoursePackagePaymentId(holi.getId()); - student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); - student1.setSignInOrNot(1); - student1.setReservationStatus(1); - student1.setInsertTime(new Date()); - studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); - } + CoursePackageStudent student1 = new CoursePackageStudent(); + student1.setAppUserId(student.getAppUserId()); + student1.setStudentId(student.getId()); + student1.setCoursePackageId(tCoursePackage.getId()); + student1.setCoursePackagePaymentId(holi.getId()); + student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); + student1.setSignInOrNot(1); + student1.setReservationStatus(1); + student1.setInsertTime(new Date()); + studentService.save(student1); } @@ -547,45 +588,12 @@ for (int i1 = 0; i1 < split.length; i1++) { CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse = format1.parse(format.format(time) + " " + split[i1]); Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); coursePackageScheduling.setClassDate(parse); coursePackageScheduling.setEndDate(parse1); coursePackageScheduling.setStatus(1); coursePackageSchedulingService.insert(coursePackageScheduling); - - CoursePackageStudent student1 = new CoursePackageStudent(); - student1.setAppUserId(student.getAppUserId()); - student1.setStudentId(student.getId()); - student1.setCoursePackageId(tCoursePackage.getId()); - student1.setCoursePackagePaymentId(holi.getId()); - student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); - student1.setSignInOrNot(1); - student1.setReservationStatus(1); - student1.setInsertTime(new Date()); - studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); - } - } - } - - }else { - Calendar instance = Calendar.getInstance(); - instance.add(Calendar.DATE,7); - Date time = instance.getTime(); - - for (int i1 = 0; i1 < split.length; i1++) { - CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); - coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); - Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); - coursePackageScheduling.setClassDate(parse); - coursePackageScheduling.setEndDate(parse1); - coursePackageScheduling.setStatus(1); - coursePackageSchedulingService.insert(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(student.getAppUserId()); @@ -597,9 +605,34 @@ student1.setReservationStatus(1); student1.setInsertTime(new Date()); studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); } + } + + }else { + Calendar instance = Calendar.getInstance(); + instance.add(Calendar.DATE,7); + Date time = instance.getTime(); + + for (int i1 = 0; i1 < split.length; i1++) { + CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); + coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); + Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); + coursePackageScheduling.setClassDate(parse); + coursePackageScheduling.setEndDate(parse1); + coursePackageScheduling.setStatus(1); + coursePackageSchedulingService.insert(coursePackageScheduling); + + CoursePackageStudent student1 = new CoursePackageStudent(); + student1.setAppUserId(student.getAppUserId()); + student1.setStudentId(student.getId()); + student1.setCoursePackageId(tCoursePackage.getId()); + student1.setCoursePackagePaymentId(holi.getId()); + student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); + student1.setSignInOrNot(1); + student1.setReservationStatus(1); + student1.setInsertTime(new Date()); + studentService.save(student1); } } } @@ -654,7 +687,7 @@ @RequestMapping(value = "/toTrans",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") @ResponseBody - public String toTrans(@RequestBody ToHoliDto toHoliDto){ + public String toTrans(@RequestBody ToHoliDto toHoliDto) throws ParseException { String [] ids = toHoliDto.getIds(); List<String> strings = new ArrayList<>(); @@ -701,6 +734,8 @@ System.out.println("保存成功=============》="+holi); + + TCoursePackage tCoursePackage = packageService.getById(toHoliDto.getClassId()); String classWeeks = tCoursePackage.getClassWeeks(); List<Integer> week = week(classWeeks); @@ -722,27 +757,23 @@ CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse = format1.parse(format.format(time) + " " + split[i1]); Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); coursePackageScheduling.setClassDate(parse); coursePackageScheduling.setEndDate(parse1); coursePackageScheduling.setStatus(1); coursePackageSchedulingService.insert(coursePackageScheduling); - CoursePackageStudent student1 = new CoursePackageStudent(); - student1.setAppUserId(student.getAppUserId()); - student1.setStudentId(student.getId()); - student1.setCoursePackageId(tCoursePackage.getId()); - student1.setCoursePackagePaymentId(holi.getId()); - student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); - student1.setSignInOrNot(1); - student1.setReservationStatus(1); - student1.setInsertTime(new Date()); - studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); - } + CoursePackageStudent student1 = new CoursePackageStudent(); + student1.setAppUserId(student.getAppUserId()); + student1.setStudentId(student.getId()); + student1.setCoursePackageId(tCoursePackage.getId()); + student1.setCoursePackagePaymentId(holi.getId()); + student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); + student1.setSignInOrNot(1); + student1.setReservationStatus(1); + student1.setInsertTime(new Date()); + studentService.save(student1); } @@ -759,45 +790,12 @@ for (int i1 = 0; i1 < split.length; i1++) { CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse = format1.parse(format.format(time) + " " + split[i1]); Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); coursePackageScheduling.setClassDate(parse); coursePackageScheduling.setEndDate(parse1); coursePackageScheduling.setStatus(1); coursePackageSchedulingService.insert(coursePackageScheduling); - - CoursePackageStudent student1 = new CoursePackageStudent(); - student1.setAppUserId(student.getAppUserId()); - student1.setStudentId(student.getId()); - student1.setCoursePackageId(tCoursePackage.getId()); - student1.setCoursePackagePaymentId(holi.getId()); - student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); - student1.setSignInOrNot(1); - student1.setReservationStatus(1); - student1.setInsertTime(new Date()); - studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); - } - } - } - - }else { - Calendar instance = Calendar.getInstance(); - instance.add(Calendar.DATE,7); - Date time = instance.getTime(); - - for (int i1 = 0; i1 < split.length; i1++) { - CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); - coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); - try { - Date parse = format1.parse(format.format(time) + " " + split[i1]); - Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); - coursePackageScheduling.setClassDate(parse); - coursePackageScheduling.setEndDate(parse1); - coursePackageScheduling.setStatus(1); - coursePackageSchedulingService.insert(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(student.getAppUserId()); @@ -809,9 +807,34 @@ student1.setReservationStatus(1); student1.setInsertTime(new Date()); studentService.save(student1); - } catch (ParseException e) { - e.printStackTrace(); } + } + + }else { + Calendar instance = Calendar.getInstance(); + instance.add(Calendar.DATE,7); + Date time = instance.getTime(); + + for (int i1 = 0; i1 < split.length; i1++) { + CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); + coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); + Date parse = format1.parse(format.format(time) + " " + split[i1]); + Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); + coursePackageScheduling.setClassDate(parse); + coursePackageScheduling.setEndDate(parse1); + coursePackageScheduling.setStatus(1); + coursePackageSchedulingService.insert(coursePackageScheduling); + + CoursePackageStudent student1 = new CoursePackageStudent(); + student1.setAppUserId(student.getAppUserId()); + student1.setStudentId(student.getId()); + student1.setCoursePackageId(tCoursePackage.getId()); + student1.setCoursePackagePaymentId(holi.getId()); + student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); + student1.setSignInOrNot(1); + student1.setReservationStatus(1); + student1.setInsertTime(new Date()); + studentService.save(student1); } } } @@ -825,10 +848,6 @@ String join = StringUtils.join(stringArray, ","); System.out.println("==========join========"+join); return "转课成功"; - - - - } -- Gitblit v1.7.1