cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -78,6 +78,20 @@ } } @ResponseBody @PostMapping("/student/queryListByIds") public List<TStudent> queryListByIds(@RequestBody List<Integer> collect){ try { List<TStudent> list = studentService.list(new QueryWrapper<TStudent>().in("id",collect).eq("state", 1)); return list; }catch (Exception e){ e.printStackTrace(); return new ArrayList<>(); } } @ResponseBody @PostMapping("/student/queryStudentCom") public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id){ cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
@@ -284,12 +284,12 @@ @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), }) public ResultUtil<List<Goods>> pointsMallList(MallRequest request){ try { // try { System.out.println("======request========"+request); return ResultUtil.success(tauService.queryAppUserIntegral(request)); }catch (Exception e){ return ResultUtil.runErr(); } // }catch (Exception e){ // return ResultUtil.runErr(); // } } cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -481,13 +481,18 @@ ProductDetailsVo detailsVo = new ProductDetailsVo(); PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId()); detailsVo.setCardType(merchandise.getCardType()); if (merchandise!=null) { detailsVo.setCardType(merchandise.getCardType()); } switch (detailRequest.getGoodsType()){ case 2: // 课包 CoursePackage coursePackage = cpClient.queryCoursePackageById(merchandise.getCoursePackageId()); detailsVo.setGoodId(coursePackage.getId()); // detailsVo.setGoodId(coursePackage.getId()); detailsVo.setGoodId(merchandise.getId()); List<String> list1 = new ArrayList<>(); list1.add(coursePackage.getCoverDrawing()); list1.addAll(Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ","))); @@ -621,10 +626,10 @@ }); detailsVo.setGoodName(coupon.getName()); detailsVo.setBelongsScope(coupon.getUserPopulation()); int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() .eq("pointsMerchandiseId",merchandise.getId() )); detailsVo.setRedeemedNum(couponNums); detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0)); // int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() // .eq("pointsMerchandiseId",merchandise.getId() )); detailsVo.setRedeemedNum(coupon.getPickUpQuantity()); detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - coupon.getPickUpQuantity(), 0)); detailsVo.setPerLimit(coupon.getPickUpQuantity()); detailsVo.setExchangeType(coupon.getRedemptionMethod()); if (coupon.getRedemptionMethod() == 1){ cloud-server-activity/src/main/java/com/dsh/activity/service/impl/BenefitsVideosServiceImpl.java
@@ -80,27 +80,31 @@ List<BenefitsVideoClassificationListVo> listVos = new ArrayList<>(); for (BenefitsVideoClassification benefitsVideoClassification : list) { BenefitsVideoClassificationListVo benefitsVideoClassificationListVo = new BenefitsVideoClassificationListVo(); benefitsVideoClassificationListVo.setId(benefitsVideoClassification.getId()); benefitsVideoClassificationListVo.setName(benefitsVideoClassification.getName()); QueryWrapper<BenefitsVideos> benefitsVideosQueryWrapper = new QueryWrapper<BenefitsVideos>().eq("state", 1).eq("benefitsVideoClassificationId",benefitsVideoClassification.getId()); if(collect.size() > 0){ benefitsVideosQueryWrapper.notIn("id", collect); if (benefitsVideoClassification.getState() == 1) { BenefitsVideoClassificationListVo benefitsVideoClassificationListVo = new BenefitsVideoClassificationListVo(); benefitsVideoClassificationListVo.setId(benefitsVideoClassification.getId()); benefitsVideoClassificationListVo.setName(benefitsVideoClassification.getName()); QueryWrapper<BenefitsVideos> benefitsVideosQueryWrapper = new QueryWrapper<BenefitsVideos>().eq("state", 1).eq("benefitsVideoClassificationId", benefitsVideoClassification.getId()); if (collect.size() > 0) { benefitsVideosQueryWrapper.notIn("id", collect); } List<BenefitsVideos> list1 = this.list(benefitsVideosQueryWrapper.orderByDesc("insertTime").last(" limit 0, 4")); List<BenefitsVideosListVo> lists = new ArrayList<>(); for (BenefitsVideos benefitsVideos : list1) { if (benefitsVideos.getState()==1) { Integer courseId = benefitsVideos.getCourseId(); Course course = courseClient.queryCourseById(courseId); BenefitsVideosListVo benefitsVideosListVo = new BenefitsVideosListVo(); benefitsVideosListVo.setId(benefitsVideos.getId()); benefitsVideosListVo.setName(course.getName()); benefitsVideosListVo.setCover(course.getCoverDrawing()); benefitsVideosListVo.setIntroduce(course.getIntroduce()); lists.add(benefitsVideosListVo); } } benefitsVideoClassificationListVo.setList(lists); listVos.add(benefitsVideoClassificationListVo); } List<BenefitsVideos> list1 = this.list(benefitsVideosQueryWrapper.orderByDesc("insertTime").last(" limit 0, 4")); List<BenefitsVideosListVo> lists = new ArrayList<>(); for (BenefitsVideos benefitsVideos : list1) { Integer courseId = benefitsVideos.getCourseId(); Course course = courseClient.queryCourseById(courseId); BenefitsVideosListVo benefitsVideosListVo = new BenefitsVideosListVo(); benefitsVideosListVo.setId(benefitsVideos.getId()); benefitsVideosListVo.setName(course.getName()); benefitsVideosListVo.setCover(course.getCoverDrawing()); benefitsVideosListVo.setIntroduce(course.getIntroduce()); lists.add(benefitsVideosListVo); } benefitsVideoClassificationListVo.setList(lists); listVos.add(benefitsVideoClassificationListVo); } return listVos; } @@ -146,10 +150,12 @@ public List<BenefitsVideosListVo> queryBenefitsVideosList(Integer uid, Integer classificationId, String search, Integer pageSize, Integer pageNo) throws Exception { pageSize = (pageSize - 1) * pageNo; List<Integer> ids = null; if(ToolUtil.isNotEmpty(search)){ List<Course> courses = courseClient.queryCourseByName(search); ids = courses.stream().map(Course::getId).collect(Collectors.toList()); } List<Map<String, Object>> benefitsVideos = this.baseMapper.queryBenefitsVideosList(uid, classificationId, ids, pageSize, pageNo); List<BenefitsVideosListVo> lists = new ArrayList<>(); for (Map<String, Object> benefitsVideo : benefitsVideos) { cloud-server-activity/src/main/resources/mapper/BenefitsVideosMapper.xml
@@ -3,13 +3,12 @@ <mapper namespace="com.dsh.activity.mapper.BenefitsVideosMapper"> <select id="queryBenefitsVideosList" resultType="map"> select * from ( <select id="queryBenefitsVideosList" resultType="java.util.Map"> (select id, courseId, integral, 0 as study "0" as study from t_benefits_videos where state = 1 and id not in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) <if test="null != classificationId"> and benefitsVideoClassificationId = #{classificationId} @@ -28,7 +27,7 @@ id, courseId, integral, 1 as study "1" as study from t_benefits_videos where state = 1 and id in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) <if test="null != classificationId"> and benefitsVideoClassificationId = #{classificationId} @@ -40,7 +39,6 @@ </foreach> </if> order by insertTime desc) ) as a limit #{pageSize}, #{pageNo} </select> <select id="getBenefitVideoById" resultType="com.dsh.activity.entity.BenefitsVideos"> select * from t_benefits_videos where cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java
@@ -11,6 +11,7 @@ import com.dsh.competition.entity.UserCompetition; import com.dsh.competition.feignclient.account.AppUserClient; import com.dsh.competition.feignclient.account.model.AppUser; import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; import com.dsh.competition.feignclient.model.*; import com.dsh.competition.model.*; import com.dsh.competition.service.CompetitionService; @@ -25,9 +26,11 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.Synchronized; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; @@ -254,6 +257,9 @@ @Autowired private CompetitionService competitionService; @Resource private CoursePackagePaymentClient coursePackagePaymentClient; @ResponseBody @PostMapping("/api/competition/paymentCompetition") @@ -262,23 +268,18 @@ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ public synchronized ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ try { Competition byId = competitionService.getById(paymentCompetitionVo.getId()); Date date = byId.getEndTime(); // Assuming you have a Date object // Check if the date is past the current time boolean isPast = date.after(new Date()); if (!isPast) { return new ResultUtil(0,"已超过截至报名时间"); } Integer uid = tokenUtil.getUserIdFormRedis(); if(null == uid){ return ResultUtil.tokenErr(); @@ -286,6 +287,33 @@ if (byId.getRegisterCondition()==3){ Integer counts = coursePackagePaymentClient.isHave(uid); if (counts==0){ return new ResultUtil(0,"当前赛事仅限已购课学员报名"); } } if (byId.getRegisterCondition()==2){ AppUser appUser = appUserClient.queryAppUser(uid); if (appUser.getIsVip()==0){ return new ResultUtil(0,"当前赛事仅限年度会员报名"); }else { Date vipEndTime = appUser.getVipEndTime(); Date currentTime = new Date(); // Current time if (vipEndTime.before(currentTime)) { return new ResultUtil(0,"您的年度会员已过期,请续费"); } } } return cttService.paymentCompetition(uid, paymentCompetitionVo); }catch (Exception e){ e.printStackTrace(); cloud-server-competition/src/main/java/com/dsh/competition/entity/Participant.java
@@ -18,7 +18,7 @@ /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) @TableId(value = "id") private Integer id; /** * 用户id cloud-server-competition/src/main/java/com/dsh/competition/feignclient/course/CoursePackagePaymentClient.java
@@ -46,5 +46,7 @@ @PostMapping("/coursePackagePayment/paymentCompetitionCourseList") List<PayCourseRes> paymentCompetitionCourseList(String s); @PostMapping("/coursePackagePayment/isHave") Integer isHave(Integer uid); } cloud-server-competition/src/main/java/com/dsh/competition/util/CodeGenerateUtils.java
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackageSchedulingController.java
@@ -59,4 +59,14 @@ coursePackageScheduling.setCoursePackageId(null); coursePackageSchedulingService.updateById(coursePackageScheduling); } /** * 新增数据 * @param coursePackageScheduling */ @ResponseBody @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") public void addCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){ coursePackageSchedulingService.save(coursePackageScheduling); } } cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java
@@ -488,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<>(); @@ -555,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); } @@ -592,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()); @@ -642,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); } } } @@ -699,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<>(); @@ -769,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); } @@ -806,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()); @@ -856,10 +807,35 @@ 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); } } } cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java
@@ -1174,13 +1174,11 @@ } private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId){ private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId) throws ParseException { // 课包 TCoursePackage tCoursePackage = this.baseMapper.selectById(courseId); String classWeeks = tCoursePackage.getClassWeeks(); List<Integer> week = week(classWeeks); String[] split = tCoursePackage.getClassStartTime().split(","); @@ -1200,27 +1198,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.save(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(userId); student1.setStudentId(sId); student1.setCoursePackageId(tCoursePackage.getId()); student1.setCoursePackagePaymentId(paymentId); student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); student1.setSignInOrNot(1); student1.setReservationStatus(1); student1.setInsertTime(new Date()); cpsMapper.insert(student1); } catch (ParseException e) { e.printStackTrace(); } CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(userId); student1.setStudentId(sId); student1.setCoursePackageId(tCoursePackage.getId()); student1.setCoursePackagePaymentId(paymentId); student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); student1.setSignInOrNot(1); student1.setReservationStatus(1); student1.setInsertTime(new Date()); cpsMapper.insert(student1); } @@ -1237,45 +1231,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.save(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(userId); student1.setStudentId(sId); student1.setCoursePackageId(tCoursePackage.getId()); student1.setCoursePackagePaymentId(paymentId); student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); student1.setSignInOrNot(1); student1.setReservationStatus(1); student1.setInsertTime(new Date()); cpsMapper.insert(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.save(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(userId); @@ -1287,9 +1248,34 @@ student1.setReservationStatus(1); student1.setInsertTime(new Date()); cpsMapper.insert(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.save(coursePackageScheduling); CoursePackageStudent student1 = new CoursePackageStudent(); student1.setAppUserId(userId); student1.setStudentId(sId); student1.setCoursePackageId(tCoursePackage.getId()); student1.setCoursePackagePaymentId(paymentId); student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); student1.setSignInOrNot(1); student1.setReservationStatus(1); student1.setInsertTime(new Date()); cpsMapper.insert(student1); } } } @@ -1412,7 +1398,7 @@ Calendar e = Calendar.getInstance(); e.setTime(date); e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); long timeInMillis = e.getTimeInMillis(); while (true) { @@ -1439,7 +1425,7 @@ coursePackageSchedulingService.save(coursePackageScheduling); } s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); if (s.getTimeInMillis() > timeInMillis) { if (s.getTimeInMillis() >= timeInMillis) { break; } } @@ -1473,6 +1459,7 @@ coursePackageSchedulingService.remove(coursePackageSchedulingQueryWrapper); this.baseMapper.updateById(coursePackage); //生成排课数据 Date date = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -1499,7 +1486,7 @@ int d = Long.valueOf(14L - ((s.getTimeInMillis() - time) / 86400000L)).intValue(); e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + d); }else{ e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); } long timeInMillis = e.getTimeInMillis(); cloud-server-course/src/main/java/com/dsh/course/util/TaskUtil.java
@@ -93,7 +93,7 @@ /** * 零时任务 */ @Scheduled(cron = "0 0 0 * * *") // @Scheduled(cron = "0 0 0 * * *") public void zeroTask(){ //定时添加排课数据 coursePackageSchedulingService.taskAddData(); cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackageSchedulingClient.java
@@ -40,4 +40,8 @@ */ @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") void editCoursePackageScheduling(CoursePackageScheduling coursePackageScheduling); @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") void save(CoursePackageScheduling coursePackageScheduling); } cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html
@@ -120,9 +120,7 @@ ajax.start(); } var pageElement = document.getElementById('page'); var event = new Event('change'); pageElement.dispatchEvent(event); } cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html
@@ -92,8 +92,7 @@ function updateType(e) { let name = $("#name").val() console.log(name ) console.log(name) if(name =='不跳转'){ $("#t1").hide() $("#t2").hide() @@ -120,9 +119,7 @@ ajax.start(); } var pageElement = document.getElementById('page'); var event = new Event('change'); pageElement.dispatchEvent(event); } cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html
@@ -124,9 +124,7 @@ ajax.start(); } var pageElement = document.getElementById('page'); var event = new Event('change'); pageElement.dispatchEvent(event); } cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html
@@ -117,9 +117,7 @@ ajax.start(); } var pageElement = document.getElementById('page'); var event = new Event('change'); pageElement.dispatchEvent(event); }