| | |
| | | System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); |
| | | if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ |
| | | CourseOfStoreVo storeVo = new CourseOfStoreVo(); |
| | | storeVo.setCourseId(packageStudent.getId()); |
| | | storeVo.setCourseId(tCoursePackagePayment.getId()); |
| | | storeVo.setCourseName(tCoursePackage.getName()); |
| | | storeVo.setClassStartTime(tCoursePackage.getClassStartTime()); |
| | | storeVo.setClassEndTime(tCoursePackage.getClassEndTime()); |
| | |
| | | @ApiOperation(value = "上课主页-预约操作", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "上课记录id", name = "coursePackId", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "课包id", name = "courseID", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "时间 yyyy-MM-dd", name = "time", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "学员id", name = "time", required = true, dataType = "int"), |
| | | }) |
| | |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | CoursePackageStudent coursePackageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getId,courseID) |
| | | .eq(CoursePackageStudent::getAppUserId,appUserId) |
| | | .eq(CoursePackageStudent::getStudentId,stuId)); |
| | | if (ToolUtil.isEmpty(coursePackageStudent)){ |
| | | TCoursePackagePayment packagePayment = packagePaymentService.getOne(new LambdaQueryWrapper<TCoursePackagePayment>() |
| | | .eq(TCoursePackagePayment::getId,courseID ) |
| | | .eq(TCoursePackagePayment::getAppUserId,appUserId) |
| | | .eq(TCoursePackagePayment::getStudentId,stuId) |
| | | ); |
| | | |
| | | if (ToolUtil.isEmpty(packagePayment)){ |
| | | ResultUtil.error("该用户未购买该课包"); |
| | | } |
| | | CoursePackageStudent coursePackageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getCoursePackageId,packagePayment.getCoursePackageId()) |
| | | .eq(CoursePackageStudent::getCoursePackagePaymentId,courseID) |
| | | .eq(CoursePackageStudent::getStudentId,stuId) |
| | | .eq(CoursePackageStudent::getAppUserId,appUserId) |
| | | ); |
| | | |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent) && coursePackageStudent.getReservationStatus() == 0){ |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.updateById(coursePackageStudent); |
| | | |
| | | }else { |
| | | coursePackageStudent.setAppUserId(appUserId); |
| | | coursePackageStudent.setStudentId(stuId); |
| | | coursePackageStudent.setCoursePackageId(packagePayment.getCoursePackageId()); |
| | | coursePackageStudent.setCoursePackagePaymentId(Long.parseLong(courseID)); |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.save(coursePackageStudent); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |