| | |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<ClientMeditationVO> meditationListByCateId = getMeditationListByCateId(cate.getId()); |
| | | if (loginUser!=null){ |
| | | List<Order> data1 = remoteOrderService.getMeditationIsBuyAll(loginUser.getUserid()).getData(); |
| | | for (ClientMeditationVO clientMeditationVO : meditationListByCateId) { |
| | | Integer data = remoteOrderService.getMeditationIsBuy(loginUser.getUserid(),clientMeditationVO.getId() ).getData(); |
| | | clientMeditationVO.setIsBuy(data); |
| | | Order order = data1.stream().filter(e -> e.getBusinessId().equals(clientMeditationVO.getId())).findFirst().orElse(null); |
| | | if (order==null){ |
| | | clientMeditationVO.setIsBuy(2); |
| | | }else{ |
| | | clientMeditationVO.setIsBuy(1); |
| | | } |
| | | clientMeditationVO.setRealLearnedNum(clientMeditationVO.getVirtualLearnedNum()+clientMeditationVO.getRealLearnedNum()); |
| | | } |
| | | }else{ |
| | | List<Order> data1 = remoteOrderService.getMeditationIsBuyAll(loginUser.getUserid()).getData(); |
| | | for (ClientMeditationVO clientMeditationVO : meditationListByCateId) { |
| | | clientMeditationVO.setIsBuy(2); |
| | | clientMeditationVO.setRealLearnedNum(clientMeditationVO.getVirtualLearnedNum()+clientMeditationVO.getRealLearnedNum()); |
| | | if (tokenService.getLoginUser()!=null){ |
| | | Integer data2 = remoteOrderService.getMeditationIsBuy(tokenService.getLoginUser().getUserid() |
| | | ,clientMeditationVO.getId() ).getData(); |
| | | clientMeditationVO.setIsBuy(data2); |
| | | Order order = data1.stream().filter(e -> e.getBusinessId().equals(clientMeditationVO.getId())).findFirst().orElse(null); |
| | | if (order==null){ |
| | | clientMeditationVO.setIsBuy(2); |
| | | }else{ |
| | | clientMeditationVO.setIsBuy(1); |
| | | } |
| | | }else{ |
| | | clientMeditationVO.setIsBuy(2); |
| | | } |
| | |
| | | if (page.getRecords().isEmpty()) { |
| | | return pageDTO; |
| | | } |
| | | List<Order> data1 = new ArrayList<Order>(); |
| | | |
| | | if (tokenService.getLoginUser()!=null){ |
| | | data1 = remoteOrderService.getMeditationIsBuyAll(tokenService.getLoginUser().getUserid()).getData(); |
| | | } |
| | | for (Meditation record : page.getRecords()) { |
| | | Long data = remoteAppUserService.getMeditationHistoryCount(record.getId()).getData(); |
| | | record.setRealLearnedNum(Integer.valueOf(data+"")); |
| | | record.setRealLearnedNum(record.getVirtualLearnedNum()+record.getRealLearnedNum()); |
| | | if (tokenService.getLoginUser()!=null){ |
| | | Integer data2 = remoteOrderService.getMeditationIsBuy(tokenService.getLoginUser().getUserid() |
| | | ,record.getId() ).getData(); |
| | | record.setIsBuy(data2); |
| | | Order order = data1.stream().filter(e -> e.getBusinessId().equals(record.getId())).findFirst().orElse(null); |
| | | if (order==null){ |
| | | record.setIsBuy(2); |
| | | }else{ |
| | | record.setIsBuy(1); |
| | | } |
| | | }else{ |
| | | record.setIsBuy(2); |
| | | } |