| | |
| | | .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; |
| | | } |
| | | |
| | |
| | | List<Integer> collect = byUserId.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<TCoursePackage> list = tcpService.list(new QueryWrapper<TCoursePackage>() |
| | | .in("id", collect)); |
| | | list.forEach(vo -> { |
| | | |
| | | byUserId.forEach(vo -> { |
| | | |
| | | StuSessionDetailsVo detVo = new StuSessionDetailsVo(); |
| | | if (vo.getType()!=2) { |
| | | detVo.setSessionid(vo.getId()); |
| | | detVo.setSessionName(vo.getName()); |
| | | String afterDayDate = DateUtil.getAfterDayDate2(vo.getInsertTime(), vo.getValidDays() + ""); |
| | | detVo.setPeriodOfValidity(afterDayDate); |
| | | detVo.setSessionid(vo.getCoursePackageId()); |
| | | TCoursePackage byId = coursePackageService.getById(vo.getCoursePackageId()); |
| | | detVo.setSessionName(byId.getName()); |
| | | // String afterDayDate = DateUtil.getAfterDayDate2(vo.getInsertTime(), vo.getValidDays() + ""); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format1 = simpleDateFormat.format(vo.getUseTime()); |
| | | detVo.setPeriodOfValidity(format1); |
| | | |
| | | detVo.setTotalNums(vo.getTotalClassHours()); |
| | | detVo.setDeductedNums(vo.getTotalClassHours()-vo.getLaveClassHours()); |
| | | detVo.setRemainingNums(vo.getLaveClassHours()); |
| | | |
| | | detailsVos.add(detVo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | | |
| | | // list.forEach(vo -> { |
| | | // StuSessionDetailsVo detVo = new StuSessionDetailsVo(); |
| | | // if (vo.getType()!=2) { |
| | | // detVo.setSessionid(vo.getId()); |
| | | // detVo.setSessionName(vo.getName()); |
| | | // String afterDayDate = DateUtil.getAfterDayDate2(vo.getInsertTime(), vo.getValidDays() + ""); |
| | | // detVo.setPeriodOfValidity(afterDayDate); |
| | | // |
| | | // detVo.setTotalNums(ToolUtil.isEmpty(tCoursePackagePayment.getTotalCourseNums()) ? 0 : tCoursePackagePayment.getTotalCourseNums()); |
| | | // detVo.setDeductedNums(ToolUtil.isEmpty(tCoursePackagePayment.getDeductionNums()) ? 0 : tCoursePackagePayment.getDeductionNums()); |
| | | // detVo.setRemainingNums(ToolUtil.isEmpty(tCoursePackagePayment.getResidueNums())? 0 : tCoursePackagePayment.getResidueNums()); |
| | | // |
| | | // detailsVos.add(detVo); |
| | | // } |
| | | // }); |
| | | } |
| | | return detailsVos; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | |
| | | /** |
| | | * 已报名课程详情 |
| | |
| | | @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){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(packagePaymentService.queryRegisteredCourseDetails(coursePayId,appUserId)); |
| | | CourseDetailsResponse courseDetailsResponse = packagePaymentService.queryRegisteredCourseDetails(coursePayId, appUserId,lon,lat); |
| | | |
| | | |
| | | if (orderId!=null){ |
| | | TOrder byId = orderService.getById(orderId); |
| | | courseDetailsResponse.setAmount(byId.getPrice()); |
| | | } |
| | | return ResultUtil.success(courseDetailsResponse); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage()); |
| | |
| | | .eq(CoursePackageScheduling::getCoursePackageId, tCoursePackage.getId()) |
| | | .like(CoursePackageScheduling::getClassDate, courseDetailReq.getTime()) |
| | | ); |
| | | if(list3.size()==0){ |
| | | if(list3.isEmpty()){ |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | | continue; |
| | | } |
| | | //排课的ids |
| | | List<Long> collect2 = list3.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList()); |
| | | if(collect2.size()==0){ |
| | | if(collect2.isEmpty()){ |
| | | collect2.add(-1l); |
| | | } |
| | | |