| | |
| | | import java.security.interfaces.ECPublicKey; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | 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(); |
| | |
| | | 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){ |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | .ne(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | if (one2!=null){ |
| | | one2.setPaymentStatus(2); |
| | | // 扣除用户余额 |
| | | Object data = remoteAppUserService.deleteBalance(one.getAppUserId() + "", one2.getPayAmount() + "").getData(); |
| | | orderPaymentRecordService.updateById(one2); |
| | | } |
| | | // 实际支付金额 |
| | |
| | | } |
| | | one.setPaymentStatus(2); |
| | | one.setPaymentTime(LocalDateTime.now()); |
| | | orderService.updateById(one); |
| | | OrderPaymentRecord one2 = orderPaymentRecordService.lambdaQuery().eq(OrderPaymentRecord::getOrderId, one.getId()) |
| | | .ne(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | if (one2!=null){ |