| | |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/add") |
| | | public Object addCoursePackagePayment(@RequestBody TCoursePackagePayment packagePayment){ |
| | | |
| | | packagePayment.setInsertTime(new Date()); |
| | | packagePayment.setInsertTime(new Date()); |
| | | Integer studentId = packagePayment.getStudentId(); |
| | |
| | | coursePackageStudent.setAppUserId(packagePayment.getAppUserId()); |
| | | packagePaymentService.save(packagePayment); |
| | | coursePackageStudent.setCoursePackagePaymentId(packagePayment.getId()); |
| | | |
| | | return coursePackageStudentService.save(coursePackageStudent); |
| | | } |
| | | /** |
| | |
| | | .eq("appUserId",student.getAppUserId()) |
| | | .eq("studentId",stuId).eq("payStatus",2)); |
| | | |
| | | Date date = new Date(); |
| | | |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null) { |
| | | if (tCoursePackagePayment.getUseTime().after(date)) { |
| | | date = tCoursePackagePayment.getUseTime(); |
| | | } |
| | | } |
| | | if (tCoursePackage.getType()==3){ |
| | | continue; |
| | | } |
| | |
| | | }else { |
| | | resp.setIsAble(1); |
| | | } |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null){ |
| | | // String afterDayDate = DateUtil.getAfterDayDate2(tCoursePackage.getInsertTime(),tCoursePackage.getValidDays() + ""); |
| | | // resp.setPeriodOfValidity(afterDayDate); |
| | |
| | | resps.add(resp); |
| | | } |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String str = sdf.format(date); |
| | | |
| | | for (StuCourseResp resp : resps) { |
| | | |
| | | |
| | | resp.setPeriodOfValidity(str); |
| | | } |
| | | |
| | | |
| | | return resps; |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(value = "经度", name = "lon", dataType = "string", required = false), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", dataType = "string", required = false), |
| | | @ApiImplicitParam(name = "coursePayId" ,value = "课包记录id",dataType = "long"), |
| | | @ApiImplicitParam(name = "orderId" ,value = "订单id",dataType = "int") |
| | | |
| | | }) |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId, String lon, String lat){ |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId, String lon, String lat,Integer orderId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | |
| | | for (TCoursePackagePayment tCoursePackagePayment : list1) { |
| | | for (TCoursePackage tCoursePackage : list2) { |
| | | if(tCoursePackagePayment.getCoursePackageId().equals(tCoursePackage.getId())){ |
| | | tCoursePackagePayment.setType(tCoursePackage.getType()); |
| | | tCoursePackagePayment.setType(tCoursePackage.getCoursePackageTypeId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.listOne(userPt); |
| | | int sum = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getTotalClassHours).sum(); |
| | | int sum1 = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getLaveClassHours).sum(); |
| | | // 查询介绍有礼课时数量 |
| | | map.put("allCourse",sum-sum1); |
| | | |
| | | //所有课包 |