| | |
| | | private final RemoteAppUserService remoteAppUserService; |
| | | |
| | | /** |
| | | * 远程调用 根据章节id和用户id查询是否观看完毕 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCourseChapterHistoryState/{id}/{chapterId}") |
| | | public R<Integer> getCourseChapterHistoryState(@PathVariable("id") Long id,@PathVariable("chapterId") Long chapterId) { |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService.lambdaQuery() |
| | | .eq(AppUserViewingHistory::getChapterId, chapterId) |
| | | .eq(AppUserViewingHistory::getAppUserId, id) |
| | | .eq(AppUserViewingHistory::getViewingType, 2) |
| | | .list(); |
| | | for (AppUserViewingHistory appUserViewingHistory : list) { |
| | | if (appUserViewingHistory.getIsOver()!=null && appUserViewingHistory.getIsOver()==1){ |
| | | return R.ok(1); |
| | | } |
| | | } |
| | | return R.ok(2); |
| | | } |
| | | |
| | | /** |
| | | * 远程调用查询用户观看了哪些课程 |
| | | * @return |
| | | */ |
| | |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService.lambdaQuery() |
| | | .eq(AppUserViewingHistory::getBizId, id) |
| | | .eq(AppUserViewingHistory::getViewingType, 1) |
| | | .groupBy(AppUserViewingHistory::getAppUserId) |
| | | .list(); |
| | | return R.ok(Long.valueOf(list.size())); |
| | | } |
| | |
| | | List<AppUserViewingHistory> list = appUserViewingHistoryService.lambdaQuery() |
| | | .eq(AppUserViewingHistory::getChapterId, id) |
| | | .eq(AppUserViewingHistory::getViewingType, 2) |
| | | .groupBy(AppUserViewingHistory::getAppUserId) |
| | | .list(); |
| | | return R.ok(Long.valueOf(list.size())); |
| | | } |
| | |
| | | orderCourseVO.setIosPrice(meditation.getIosPrice()); |
| | | orderCourseVO.setCoverUrl(meditation.getCoverUrl()); |
| | | orderCourseVO.setCount(meditation.getRealLearnedNum()+meditation.getVirtualLearnedNum()); |
| | | orderCourseVO.setCoverDescription(meditation.getCoverDescription()); |
| | | orderCourseVOS.add(orderCourseVO); |
| | | } |
| | | break; |