| | |
| | | coursePackageOrder.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackageOrder.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | coursePackageOrder.setCashPayment(new BigDecimal(paymentPrice)); |
| | | coursePackageOrder.setPlayPaiCoin(paymentCourseVo.getPrice().intValue()); |
| | | coursePackageOrder.setPayUserType(1); |
| | | coursePackageOrder.setPayStatus(2); |
| | | coursePackageOrder.setPayUserId(appUser.getId()); |
| | |
| | | |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= useTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= useTime.getTime()) { |
| | | break; |
| | | } |
| | | //剩余数量不足以排课 |
| | | if (laveClassHours.compareTo(codeTime) < 0) { |
| | | break; |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | |
| | |
| | | int num = 8 - day_week + 7; |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | for (int j = 0; j < split.length; j++) { |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= endTime.getTime()) { |
| | | break; |
| | | } |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= endTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setType(tCoursePackage.getType()); |
| | | coursePackageScheduling.setAppUserId(userId); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | } catch (Exception e) { |