xinquan-api/xinquan-api-order/src/main/java/com/xinquan/order/api/domain/vo/PayOrderVO.java
@@ -1,5 +1,6 @@ package com.xinquan.order.api.domain.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,8 +25,11 @@ private Long id; @ApiModelProperty(value = "订单金额") private BigDecimal amount; @ApiModelProperty(value = "余额") private BigDecimal balance; @ApiModelProperty(value = "订单id") private Long orderId; @ApiModelProperty(value = "封面图") private String coverUrl; } xinquan-api/xinquan-api-user/src/main/java/com/xinquan/user/api/feign/RemoteAppUserService.java
@@ -31,7 +31,7 @@ public interface RemoteAppUserService { @PostMapping("/user/app-user-viewing-history/getCourseChapterHistoryState/{id}/{chapterId}") public R<Integer> getCourseChapterHistoryState(@PathVariable("id") Long id,@PathVariable("chapterId") Long chapterId); @GetMapping("/addNotice/{id}/{courseId}/{userId}/{price}") @GetMapping("/client/user/notice-record/addNotice/{id}/{courseId}/{userId}/{price}") public R addNotice(@PathVariable("id")String id,@PathVariable("courseId")String courseId ,@PathVariable("userId")String userId,@PathVariable("price")String price); @GetMapping("/client/app-user/getUserByPhone/{phone}") xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseController.java
@@ -1106,6 +1106,18 @@ List<Course> courses = new ArrayList<>(); courses.add(list1.get(0)); courses.add(list1.get(1)); for (Course cours : courses) { List<CourseChapter> list3 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list3) { a+= courseChapter.getVirtualLearnedNum(); Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data2; } cours.setCount(a+b); cours.setRealLearnedNum(a+b); } studyPageVO.setFreeCourseList(courses); }else if (list1.size()==1){ List<Course> courses = new ArrayList<>(); @@ -1116,6 +1128,18 @@ break; } } for (Course cours : courses) { List<CourseChapter> list3 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list3) { a+= courseChapter.getVirtualLearnedNum(); Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data2; } cours.setCount(a+b); cours.setRealLearnedNum(a+b); } studyPageVO.setFreeCourseList(courses); } studyPageVO.setCourseList(courseVOS); xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/controller/client/ClientOrderController.java
@@ -62,7 +62,7 @@ import java.security.interfaces.ECPublicKey; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; /** @@ -232,7 +232,15 @@ break; } } List<OrderCourseVO> testing = testing(res1.size(), pageCurr, pageSize, res1); List<OrderCourseVO> orderCourseVOS = new ArrayList<>(); List<Long> longs1 = new ArrayList<>(); for (OrderCourseVO orderCourseVO : res1) { if (!longs1.contains(orderCourseVO.getBusinessId())){ longs1.add(orderCourseVO.getBusinessId()); orderCourseVOS.add(orderCourseVO); } } List<OrderCourseVO> testing = testing(orderCourseVOS.size(), pageCurr, pageSize, orderCourseVOS); return R.ok(testing); } public static List<OrderCourseVO> testing(long total, long current, long size, List<OrderCourseVO> str){ @@ -437,6 +445,7 @@ case 2: if (receiverId!=null){ remoteAppUserService.addAppUserCourse(order.getBusinessId(),order.getGiveUserId(),order.getId(),1); remoteAppUserService.addNotice(receiverId+"",order.getBusinessId()+"",order.getAppUserId()+"",order.getTotalAmount()+""); }else{ // 自己购买 remoteAppUserService.addAppUserCourse(order.getBusinessId(),order.getAppUserId(),order.getId(),2); @@ -458,20 +467,6 @@ appUserWalletRecord1.setChildAppUserId(order.getAppUserId()); appUserWalletRecord1.setOrderId(order.getId()); remoteAppUserService.addBalanceRecord(appUserWalletRecord1); switch (orderFrom){ case 1: break; case 2: if (receiverId!=null){ remoteAppUserService.addAppUserCourse(order.getBusinessId(),order.getGiveUserId(),order.getId(),1); }else{ remoteAppUserService.addAppUserCourse(order.getBusinessId(),userId,order.getId(),1); } break; } // 判断订单所属用户是否有上级 是否需要做分佣处理 AppUser data = remoteAppUserService.getAppUserById(order.getAppUserId() + "").getData(); BigDecimal realPayAmount = order.getRealPayAmount(); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserCourseController.java
@@ -10,6 +10,7 @@ import com.xinquan.common.security.utils.SecurityUtils; import com.xinquan.system.api.domain.AppUser; import com.xinquan.system.api.domain.AppUserCourse; import com.xinquan.system.api.domain.NoticeRecord; import com.xinquan.system.api.domain.vo.AppUserVO; import com.xinquan.user.service.AppUserCourseService; import com.xinquan.user.service.AppUserService; @@ -51,8 +52,6 @@ ) { AppUserCourse one = appUserCourseService.lambdaQuery().eq(AppUserCourse::getCourseId, courseId) .eq(AppUserCourse::getAppUserId, appUserId).one(); if (one==null){ one = new AppUserCourse(); one.setAppUserId(appUserId); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserWalletRecordController.java
@@ -297,11 +297,11 @@ orderDetailVO.setAmount(byId.getAmount()); orderDetailVO.setRemark(one.getRemark()); if (one.getCommissionId()!=null){ AppUser appUserById = appUserService.getById(one.getCommissionId()); AppUser appUserById = appUserService.getById(one.getAppUserId()); orderDetailVO.setUserName(appUserById.getNickname()); orderDetailVO.setAvatar(appUserById.getAvatar()); } return R.ok(new OrderDetailVO()); return R.ok(orderDetailVO); } }else if (byId.getReason().equals("提现回退")){ AppUserWithdraw byId1 = appUserWithdrawService.getById(byId.getOrderId()); @@ -311,7 +311,7 @@ orderDetailVO.setAmount(byId1.getAmount()); orderDetailVO.setChangeType(byId.getChangeType()); orderDetailVO.setPaymentTime(byId1.getUpdateTime()); return R.ok(new OrderDetailVO()); return R.ok(orderDetailVO); }else if (byId.getReason().contains("课程")){ Order data = remoteOrderService.getOrderById(byId.getOrderId()).getData(); if (data!=null){ @@ -322,6 +322,8 @@ orderDetailVO.setChangeType(byId.getChangeType()); orderDetailVO.setPaymentTime(data.getPaymentTime()); } return R.ok(orderDetailVO); } else if (byId.getReason().contains("疗愈")) { Order data = remoteOrderService.getOrderById(byId.getOrderId()).getData(); if (data!=null){ @@ -332,6 +334,8 @@ orderDetailVO.setChangeType(2); orderDetailVO.setPaymentTime(data.getPaymentTime()); } return R.ok(orderDetailVO); } } return R.ok(orderDetailVO);