| | |
| | | import com.dsh.course.entity.dto.*; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | | import com.dsh.course.feignclient.account.model.Student; |
| | | import com.dsh.course.mapper.CoursePackageSchedulingMapper; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.model.dto.ToClassDto; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.ALiSendSms; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import com.dsh.course.util.UUIDUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | private TCoursePackageService coursePackageService; |
| | | @Resource |
| | | private CoursePackageStudentMapper cpsMapper; |
| | | |
| | | //获取退费记录 |
| | | @RequestMapping("/getRefund") |
| | | @ResponseBody |
| | |
| | | // 查询已通过申请的退费记录 |
| | | return counsumService.getRefund(); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingService; |
| | | |
| | | |
| | | @RequestMapping("/getStudentTotal") |
| | | @ResponseBody |
| | | public List<Map<String, Object>> get(@RequestBody StudentQeryDto studentQeryDto) { |
| | | System.out.println("-====studentQeryDto=========" + studentQeryDto); |
| | | List<Map<String, Object>> pays = paymentService.getStudentTotal(studentQeryDto); |
| | | System.out.println("=========pays======" + pays); |
| | | |
| | | return pays; |
| | | |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/bypac") |
| | | @ResponseBody |
| | | public List<Map<String, Object>> bypac(@RequestBody PacQueryDto pacQueryDto) { |
| | | System.out.println("-====studentQeryDto=========" + pacQueryDto); |
| | | if (pacQueryDto.getStoreIds() != null && pacQueryDto.getStoreIds().size() != 0) { |
| | | // 根据门店id 查询课包ids |
| | | List<Integer> coursePackageIds = coursePackageService.list(new QueryWrapper<TCoursePackage>() |
| | | .in("storeId", pacQueryDto.getStoreIds())).stream() |
| | | .map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | pacQueryDto.setStoreIds(coursePackageIds); |
| | | } |
| | | List<Map<String, Object>> pays = paymentService.bypac(pacQueryDto); |
| | | |
| | | System.out.println("=========pays======" + pays); |
| | | |
| | | return pays; |
| | | |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | |
| | | List<MoneyBack> ids = moneyBackService.list(new QueryWrapper<MoneyBack>().eq("ids", insertBackDto.getIds())); |
| | | |
| | | if (ids!=null){ |
| | | if (!ids.isEmpty()){ |
| | | return 1 ; |
| | | } |
| | | |
| | |
| | | for (CoursePackageOrderStudent o : pays) { |
| | | o.setStatus(4); |
| | | o.setAppUserId(null); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.selectList(new QueryWrapper<CoursePackageScheduling>().eq("studentId", o.getStudentId()).eq("coursePackageId", o.getCoursePackageId()).ge("classDate", new Date())); |
| | | List<Long> scs = new ArrayList<>(); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | scs.add(coursePackageScheduling.getId()); |
| | | } |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().in("coursePackageSchedulingId",scs)); |
| | | coursePackageSchedulingService.deleteBatchIds(scs); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | orderStudentService.updateBatchById(pays); |
| | | return 0; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/noStatus") |
| | | @ResponseBody |
| | | public void noStatus(@RequestParam("id") Integer id) { |
| | |
| | | for (CoursePackageOrderStudent o : pays) { |
| | | o.setStatus(1); |
| | | o.setAppUserId(null); |
| | | schedulingService.addNewCoursePackageScheduling(o.getId(),o.getLaveClassHours()); |
| | | } |
| | | orderStudentService.updateBatchById(pays); |
| | | |
| | |
| | | @RequestMapping("/backStausClass") |
| | | @ResponseBody |
| | | public void backStausClass(@RequestParam("id") Integer id) { |
| | | MoneyBack byId = moneyBackService.getById(id); |
| | | String[] split = byId.getIds().split(","); |
| | | System.out.println("========split===>" + split); |
| | | List<TCoursePackagePayment> id1 = paymentService.list(new QueryWrapper<TCoursePackagePayment>().in("id", split)); |
| | | for (TCoursePackagePayment o : id1) { |
| | | o.setStatus(1); |
| | | o.setAppUserId(null); |
| | | } |
| | | paymentService.updateBatchById(id1); |
| | | // MoneyBack byId = moneyBackService.getById(id); |
| | | // String[] split = byId.getIds().split(","); |
| | | // System.out.println("========split===>" + split); |
| | | // List<CoursePackageOrderStudent> id1 = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().in("id", split)); |
| | | // for (CoursePackageOrderStudent o : id1) { |
| | | // o.setStatus(1); |
| | | // o.setAppUserId(null); |
| | | // } |
| | | // coursePackageOrderStudentService.updateBatchById(id1); |
| | | } |
| | | |
| | | @RequestMapping("/cancel") |
| | |
| | | coursePackageOrderStudent.setAppUserId(null); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours()-toHoliDto.getClassNum()); |
| | | orderStudentService.updateById(coursePackageOrderStudent); |
| | | Integer laveClassHours = coursePackageOrderStudent.getLaveClassHours(); |
| | | if(3 >= laveClassHours){ |
| | | AppUser appUser = appUserClient.queryAppUser(coursePackageOrderStudent.getAppUserId()); |
| | | //发送短信提醒 |
| | | aLiSendSms.sendSms(appUser.getPhone(), "SMS_463646317", ""); |
| | | } |
| | | |
| | | //上课星期 |
| | | String classWeeks = coursePackage1.getClassWeeks(); |