| | |
| | | private Long orderId; |
| | | @ApiModelProperty(value = "封面图") |
| | | private String coverUrl; |
| | | @ApiModelProperty(value = "赠送用户手机号") |
| | | private String phone; |
| | | |
| | | } |
| | |
| | | public RemoteAppUserService create(Throwable cause) { |
| | | return new RemoteAppUserService() { |
| | | @Override |
| | | public R deleteBalance(String id, String amount) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getCourseChapterHistoryState(Long id, Long chapterId) { |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | @FeignClient(contextId = "remoteAppUserService", value = ServiceNameConstants.APP_USER_SERVICE, fallbackFactory = RemoteAppUserFallbackFactory.class) |
| | | public interface RemoteAppUserService { |
| | | @GetMapping("/client/app-user/deleteBalance/{id}/{amount}") |
| | | public R deleteBalance(@PathVariable("id")String id,@PathVariable("amount")String amount); |
| | | @PostMapping("/user/app-user-viewing-history/getCourseChapterHistoryState/{id}/{chapterId}") |
| | | public R<Integer> getCourseChapterHistoryState(@PathVariable("id") Long id,@PathVariable("chapterId") Long chapterId); |
| | | @GetMapping("/client/user/notice-record/addNotice/{id}/{courseId}/{userId}/{price}") |
| | |
| | | b+=courseChapter.getVirtualLearnedNum(); |
| | | } |
| | | clientCourseVO.setCount(a+b); |
| | | clientCourseVO.setIsBuy(1); |
| | | }else if (data!=null){ |
| | | // 查询学习人数和头像列表 |
| | | clientCourseVO.setCount(data.size()); |
| | |
| | | Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); |
| | | a+=data2; |
| | | b+=courseChapter.getVirtualLearnedNum(); |
| | | courseChapter.setRealLearnedNum(a+b); |
| | | courseChapter.setVirtualLearnedNum(0); |
| | | courseChapter.setRealLearnedNum(a); |
| | | courseChapter.setVirtualLearnedNum(b); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (loginUser!=null){ |
| | | Integer data1 = remoteAppUserService.getCourseChapterHistoryState(loginUser.getUserid(), courseChapter.getId()).getData(); |
| | |
| | | if (byId==null){ |
| | | return R.fail("订单失效"); |
| | | } |
| | | if (byId.getGiveUserId()!=null){ |
| | | AppUser data1 = remoteAppUserService.getAppUserById(byId.getGiveUserId() + "").getData(); |
| | | payOrderVO.setPhone(data1.getCellPhone()); |
| | | } |
| | | |
| | | AppUser data1 = remoteAppUserService.getAppUserById(byId.getAppUserId() + "").getData(); |
| | | payOrderVO.setBalance(data1.getBalance()); |
| | | payOrderVO.setOrderId(id); |
| | | if (byId.getOrderFrom()==1){ |
| | | Meditation data = remoteMeditationService.getMeditationById(byId.getBusinessId()).getData(); |
| | |
| | | .ne(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | if (one2!=null){ |
| | | one2.setPaymentStatus(2); |
| | | // 扣除用户余额 |
| | | Object data = remoteAppUserService.deleteBalance(one.getAppUserId() + "", one2.getPayAmount() + "").getData(); |
| | | orderPaymentRecordService.updateById(one2); |
| | | } |
| | | // 实际支付金额 |
| | |
| | | private RemoteUserService remoteUserService; |
| | | @Resource |
| | | private NoticeRecordService noticeRecordService; |
| | | @GetMapping("/deleteBalance/{id}/{amount}") |
| | | public R deleteBalance(@PathVariable("id")String id,@PathVariable("amount")String amount) { |
| | | AppUser byId = appUserService.getById(id); |
| | | if (byId!=null){ |
| | | BigDecimal subtract = byId.getBalance().subtract(new BigDecimal(amount)); |
| | | if (subtract.compareTo(BigDecimal.ZERO)<0){ |
| | | byId.setBalance(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/testNotice") |
| | | @ApiOperation(value = "测试通知", tags = "测试通知") |
| | | public R testNotice() { |