| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.GetStuSessionList; |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取课包对应的消费记录 |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @param sessionList |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestParam("startTime") Date startTime, @RequestParam("endTime") Date endTime, @RequestParam("stuId") Integer stuId, @RequestParam("appUserId") Integer appUserId){ |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody GetStuSessionList sessionList){ |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .between("insertTime", sessionList.getStartTime(),sessionList.getEndTime()) |
| | | .eq("appUserId",sessionList.getAppUserId()) |
| | | .eq("studentId",sessionList.getStuId())); |
| | | List<Long> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | List<CancelledClasses> list = caceService.list(new QueryWrapper<CancelledClasses>() |
| | | .in("coursePackageId", coursePackageIds) |
| | | .between("insertTime",startTime,endTime)); |
| | | .between("insertTime",sessionList.getStartTime(),sessionList.getEndTime())); |
| | | if (list.size() > 0){ |
| | | list.forEach( canse -> { |
| | | PurchaseRecordVo purchaseRecordVo = new PurchaseRecordVo(); |