| | |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackagePaymentController { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger("business-log"); |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService packagePaymentService; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | |
| | | @Resource |
| | | private CoursePackageStudentService cspsService; |
| | | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Resource |
| | | private AppUserClient auClitn; |
| | | |
| | | @Resource |
| | | private StoreClient sreClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | @Autowired |
| | | private CouponClient couponClient; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingMapper; |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService coursePackageOrderStudentService; |
| | | |
| | | |
| | | /** |
| | | * 查询学员入学时间 根据第一次购买课包的时间 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/getTime") |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 添加购课记录-后台 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/add") |
| | |
| | | coursePackageStudent.setCoursePackagePaymentId(packagePayment.getId()); |
| | | return coursePackageStudentService.save(coursePackageStudent); |
| | | } |
| | | |
| | | /** |
| | | * 手动支付 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/changeState") |
| | |
| | | |
| | | return packagePaymentService.changeState(dto); |
| | | } |
| | | |
| | | @GetMapping("/coursePackagePayment/courseStore/{appUserId}/{coursePackageId}") |
| | | public List<TCoursePackagePayment> getByUserIdAndCoursePackageId(@PathVariable("appUserId") Integer appUserId,@PathVariable("coursePackageId") Integer coursePackageId){ |
| | | List<TCoursePackagePayment> list = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | .eq("coursePackageId", coursePackageId)); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取购课记录 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取 没有学员信息的图片配置 |
| | | * |
| | | * @param stuId 学员id |
| | | * @return 课包列表 |
| | | */ |
| | |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | Student student = studentClient.queryStudentById(stuId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | List<CoursePackageOrderStudent> byUserId = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId",student.getAppUserId()) |
| | | .eq("studentId",stuId).eq("payStatus",2)); |
| | | .eq("studentId", stuId)); |
| | | |
| | | Date date = new Date(); |
| | | |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | for (CoursePackageOrderStudent tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null) { |
| | |
| | | resp.setResidueNums(tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setDeductionNums(tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setCourseType(tCoursePackage.getType()); |
| | | if (tCoursePackage.getType()!=1||tCoursePackage.getState()==2||tCoursePackagePayment.getPayStatus()==1){ |
| | | if (tCoursePackage.getType() != 1 || tCoursePackage.getState() == 2) { |
| | | resp.setIsAble(0); |
| | | }else { |
| | | resp.setIsAble(1); |
| | | } |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null){ |
| | | // String afterDayDate = DateUtil.getAfterDayDate2(tCoursePackage.getInsertTime(),tCoursePackage.getValidDays() + ""); |
| | | // resp.setPeriodOfValidity(afterDayDate); |
| | | |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String str = sdf.format(tCoursePackagePayment.getUseTime()); |
| | | resp.setPeriodOfValidity(str); |
| | | } |
| | | |
| | | |
| | | |
| | | resps.add(resp); |
| | | } |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String str = sdf.format(date); |
| | | |
| | | for (StuCourseResp resp : resps) { |
| | | |
| | | |
| | | resp.setPeriodOfValidity(str); |
| | | } |
| | | |
| | | |
| | | return resps; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 获取发布的 课包列表 |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * 课程名称列表 |
| | | */ |
| | | @PostMapping("/base/coursePack/sessionNames") |
| | |
| | | detVo.setRemainingNums(vo.getLaveClassHours()); |
| | | |
| | | detailsVos.add(detVo); |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | QueryWrapper<CourseCounsum> in = new QueryWrapper<CourseCounsum>().in("paymentId", ids).in("changeType", changes); |
| | | |
| | | if (recordTimeRequest.getType()!=null){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/stuOfCourses") |
| | | public StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody GetStuOfCoursesDetails getStuOfCoursesDetails){ |
| | | StuWithCoursesListVo lisco = new StuWithCoursesListVo(); |
| | |
| | | } |
| | | return lisco; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/continuingCourse") |
| | |
| | | return ResultUtil.success(coursePackageSchedulings1); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(packagePaymentService.queryRegisteredCourseList(courseTypeId,appUserId)); |
| | | return ResultUtil.success(coursePackageOrderService.queryRegisteredCourseList(courseTypeId, appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | |
| | | /** |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage()); |
| | | // return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取学员剩余课时 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取学员剩余课时 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | private TCoursePackageService packageService; |
| | | @Autowired |
| | | CoursePackageStudentService studentService ; |
| | | |
| | | /** |
| | | * 课程用于支付进行扣减 |
| | | * |
| | | * @param paymentDeductionClassHour |
| | | */ |
| | | @ResponseBody |
| | |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", coursePackagePayment.getStudentId()).eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id",collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", paymentDeductionClassHour.getId()).eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(coursePackagePayment.getCoursePackageId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 2.0 少于3课时 推送 |
| | |
| | | } |
| | | return integers; |
| | | } |
| | | |
| | | /** |
| | | * 取消赛事回退支付课时 |
| | | * |
| | | * @param paymentDeductionClassHour |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 找出符合门店的课包 |
| | | * |
| | | * @param s |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 课包续费玩湃币支付 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/coursePackagePayment/courseRenewPlayPaiPay") |
| | |
| | | public boolean delPaymentCoursePackage(@RequestBody Integer payId){ |
| | | return packagePaymentService.removeById(payId); |
| | | } |
| | | |
| | | @PostMapping("/base/coursePack/updatePaymentCoursePackage") |
| | | public boolean updatePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment){ |
| | | boolean id = packagePaymentService.update(packagePayment, new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | String[] split = orderDto.getStuIds().split(","); |
| | | for (String s : split) { |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s).eq("coursePackageId",orderDto.getClassId())); |
| | | |
| | | |
| | | |
| | | if (coursePackagePaymentServiceOne==null) { |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId) throws ParseException { |
| | | // 课包 |
| | | TCoursePackage tCoursePackage = coursePackageService.getById(courseId); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/getCoursePackagePaymentOfCode") |
| | | public List<TCoursePackagePayment> getCoursePackagePaymentOfCode(@RequestBody String code){ |
| | | return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id",collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", byId.getStudentId()).eq("coursePackageId", byId.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(byId.getCoursePackageId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(b){ |
| | | return 1; |
| | | }else { |
| | |
| | | |
| | | /** |
| | | * 查询课时 |
| | | * |
| | | * @param courseConfigId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课包报名信息列表 |
| | | * |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackagePayment |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackagePayment |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/getConsumes") |
| | | List<CourseCounsum> getConsumes(@RequestBody BillingDataRequestVo requestVo) { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/weeksOfCourseDetailsList") |
| | | HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq){ |
| | | public HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | ArrayList<DetailsListVo> objects = new ArrayList<>(); |
| | | // try { |
| | | String time = courseDetailReq.getTime(); |
| | | Date parse = null; |
| | | try { |
| | |
| | | map.put("lon",lon); |
| | | map.put("lat",lat); |
| | | |
| | | String time1 = courseDetailReq.getTime(); |
| | | |
| | | // 找出门店的所有课程 排出体验 |
| | | List<TCoursePackage> list = tcpService.list(new LambdaQueryWrapper<TCoursePackage>().eq(TCoursePackage::getStoreId, courseDetailReq.getStoreId()).ne(TCoursePackage::getType, 3).eq(TCoursePackage::getState,1).like(TCoursePackage::getClassWeeks,week)); |
| | |
| | | collect.add(-1); |
| | | } |
| | | // 找出购买的课包 |
| | | List<TCoursePackagePayment> list1 = packagePaymentService.list(new LambdaQueryWrapper<TCoursePackagePayment>().eq(TCoursePackagePayment::getAppUserId, courseDetailReq.getAppUserId()).eq(TCoursePackagePayment::getStudentId, courseDetailReq.getStuId()).in(TCoursePackagePayment::getCoursePackageId, collect)); |
| | | List<Integer> collect1 = list1.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<Long> ids = list1.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | List<CoursePackageOrderStudent> list1 = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId", courseDetailReq.getAppUserId()) |
| | | .eq("studentId", courseDetailReq.getStuId()) |
| | | .in("coursePackageId", collect) |
| | | .eq("status", 1) |
| | | .eq("state", 1) |
| | | ); |
| | | |
| | | List<Integer> collect1 = list1.stream().map(CoursePackageOrderStudent::getCoursePackageId).collect(Collectors.toList()); |
| | | List<Long> ids = list1.stream().map(CoursePackageOrderStudent::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | for (TCoursePackage tCoursePackage : list) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }else { |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | |
| | | objects.add(detailsListVo); |
| | | |
| | | } |
| | | // objects.add(detailsListVo); |
| | | } |
| | | map.put("data",objects); |
| | | |
| | | return map; |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return map; |
| | | } |
| | | |
| | | private String week(int i){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/coursePt") |
| | | HashMap<String, Object> coursePt(@RequestBody List<Integer> userPt){ |
| | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/courseYys") |
| | | HashMap<String, Object> courseYys(@RequestBody List<Integer> userPt){ |
| | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/courseStore") |
| | | HashMap<String, Object> courseStore(@RequestBody List<Integer> userPt){ |
| | |
| | | } |
| | | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |