| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | |
| | | public class TCoursePackagePaymentServiceImpl extends ServiceImpl<TCoursePackagePaymentMapper, TCoursePackagePayment> implements TCoursePackagePaymentService { |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private BenefitVideoClient bfvoClient; |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private UserVideoDetailsMapper uvdmapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private PostCourseVideoMapper pcvMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private TCoursePackageMapper tcpmapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private StoreClient stoClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private CoachClient coachClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private CoursePackageStudentMapper cpsMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private CancelledClassesMapper cacMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private TCoursePackageDiscountMapper tcpdMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime , Integer coursePackId, Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(startTime,endTime,coursePackId,stuId,appUserId); |
| | | } |
| | | |
| | | /** |
| | | * 获取课包购买人数 |
| | |
| | | @Override |
| | | public List<AppUserVideoResponse> queryAfterVideo(CourseOfAfterRequest search,List<Integer> courseIds) { |
| | | List<AppUserVideoResponse> responses = new ArrayList<>(); |
| | | List<PostCourseVideo> videoList = pcvMapper.queryPostCourseVideolist(courseIds); |
| | | List<PostCourseVideo> videoList = pcvMapper.selectList(new QueryWrapper<PostCourseVideo>() |
| | | .eq("coursePackageId", courseIds)); |
| | | |
| | | if (videoList.size() > 0){ |
| | | List<Integer> videoIds = videoList.stream().map(PostCourseVideo::getCourseId).collect(Collectors.toList()); |
| | | List<UserVideoDetails> userVideoDetails = uvdmapper.queryAppUserWatchVideo(videoIds); |
| | | List<UserVideoDetails> userVideoDetails = uvdmapper.selectList(new QueryWrapper<UserVideoDetails>() |
| | | .in("courseId", videoIds)); |
| | | if (userVideoDetails.size() > 0){ |
| | | for (UserVideoDetails userVideoDetail : userVideoDetails) { |
| | | AppUserVideoResponse response = new AppUserVideoResponse(); |
| | |
| | | @Override |
| | | public List<RegisterCourseVo> queryRegisteredCourseList(CourseOfAfterRequest courseTypeId, Integer appUserId) { |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.queryAllCoursePackage(null,null,null,null,appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId )); |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | registerCourseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | Coach coach = coachClient.queryCoachById(coursePackage.getCoachId()); |
| | | registerCourseVo.setCourseTeacher(coach.getName()); |
| | | List<CoursePackageStudent> coursePackageStudents = |
| | | cpsMapper.queryStuDeduClassHourNums(coursePackage.getId(),null,appUserId); |
| | | List<CoursePackageStudent> coursePackageStudents = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId",coursePackage.getId()) |
| | | .eq("studentId",appUserId )); |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | courseVos.add(registerCourseVo); |
| | |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Integer coursePackageId, Integer appUserId) { |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.queryAllCoursePackage(null,null,coursePackageId,null,appUserId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("coursePackageId",coursePackageId ) |
| | | .eq("appUserId",appUserId)); |
| | | |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | TCoursePackagePayment tCoursePackagePayment = tCoursePackagePayments.get(0); |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |