| | |
| | | order.setRealPayAmount(data1.getIosPrice()); |
| | | break; |
| | | } |
| | | |
| | | |
| | | break; |
| | | case 2: |
| | | Course data = remoteCourseService.getCourseById(targetId).getData(); |
| | |
| | | break; |
| | | } |
| | | |
| | | // 删除原有非余额支付详细记录 |
| | | OrderPaymentRecord two = orderPaymentRecordService.lambdaQuery().eq(OrderPaymentRecord::getOrderId, order.getId()) |
| | | .ne(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | if (two!=null){ |
| | | orderPaymentRecordService.removeById(two.getId()); |
| | | } |
| | | OrderPaymentRecord one = orderPaymentRecordService.lambdaQuery().eq(OrderPaymentRecord::getOrderId, order.getId()) |
| | | .eq(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | if (one!=null){ |
| | |
| | | ClientPlaceOrderVO clientPlaceOrderVO = new ClientPlaceOrderVO(); |
| | | clientPlaceOrderVO.setId(order.getId()); |
| | | clientPlaceOrderVO.setOrderNo(order.getBizOrderNo()); |
| | | order.setRealPayAmount(new BigDecimal("0")); |
| | | order.setPayType(4); |
| | | orderService.updateById(order); |
| | | return R.ok(clientPlaceOrderVO); |
| | | } |
| | | |
| | |
| | | AppUser data = remoteAppUserService.getAppUserById(one.getAppUserId() + "").getData(); |
| | | if (one.getGiveUserId()!=null){ |
| | | remoteAppUserService.addNotice(one.getGiveUserId() + "", one.getBusinessId() + "", |
| | | one.getAppUserId() + "", one.getTotalAmount() + ""); |
| | | one.getAppUserId() + "", realPayAmount + ""); |
| | | } |
| | | |
| | | if (data.getInviteUserId()!=null) { |
| | | |
| | | if (one.getOrderFrom() == 1 || one.getOrderFrom() == 2 || one.getOrderFrom() == 3) { |
| | | // 查询实际支付价格 不包含余额抵扣价格 |
| | | OrderPaymentRecord one1 = orderPaymentRecordService.lambdaQuery().eq(OrderPaymentRecord::getOrderId, one.getId()) |
| | |
| | | CommissionRule data1 = sysUserClient.getCommission().getData(); |
| | | if (data1 != null) { |
| | | if (data1.getProportion() != null) { |
| | | |
| | | BigDecimal bigDecimal = one1.getPayAmount().multiply(data1.getProportion()).divide(new BigDecimal("100")) |
| | | BigDecimal bigDecimal = one1.getPayAmount().add(one.getChangePrice()!=null?one.getChangePrice():new BigDecimal("0")).multiply(data1.getProportion()).divide(new BigDecimal("100")) |
| | | .setScale(2, BigDecimal.ROUND_DOWN); |
| | | // 上级获取的分佣金额 |
| | | AppUser appUserById = remoteAppUserService.getAppUserById(data.getInviteUserId() + "").getData(); |
| | |
| | | // appUserById.getBalance().add(bigDecimal)) |
| | | // .build(), SecurityConstants.INNER); |
| | | // 新增分佣流水明细 |
| | | AppUserWalletRecord appUserWalletRecord = new AppUserWalletRecord(); |
| | | appUserWalletRecord.setAppUserId(data.getInviteUserId()); |
| | | appUserWalletRecord.setChangeType(1); |
| | | appUserWalletRecord.setReason("分佣收益"); |
| | | appUserWalletRecord.setAmount(bigDecimal); |
| | | appUserWalletRecord.setChildAppUserId(one.getAppUserId()); |
| | | appUserWalletRecord.setOrderId(one.getId()); |
| | | remoteAppUserService.addBalanceRecord(appUserWalletRecord); |
| | | one.setCommissionAmount(bigDecimal); |
| | | one.setCommissionId(data.getInviteUserId()); |
| | | if (bigDecimal.compareTo(new BigDecimal("0"))>0){ |
| | | AppUserWalletRecord appUserWalletRecord = new AppUserWalletRecord(); |
| | | appUserWalletRecord.setAppUserId(data.getInviteUserId()); |
| | | appUserWalletRecord.setChangeType(1); |
| | | appUserWalletRecord.setReason("分佣收益"); |
| | | appUserWalletRecord.setAmount(bigDecimal); |
| | | appUserWalletRecord.setChildAppUserId(one.getAppUserId()); |
| | | appUserWalletRecord.setOrderId(one.getId()); |
| | | remoteAppUserService.addBalanceRecord(appUserWalletRecord); |
| | | one.setCommissionAmount(bigDecimal); |
| | | one.setCommissionId(data.getInviteUserId()); |
| | | } |
| | | orderService.updateById(one); |
| | | } |
| | | } |
| | |
| | | Meditation data1 = remoteMeditationService.getMeditationById(one.getBusinessId()).getData(); |
| | | appUserWalletRecord.setChangeType(2); |
| | | reason = "购买疗愈【"+data1.getMeditationTitle()+"】"; |
| | | |
| | | break; |
| | | case 2: |
| | | Course data2 = remoteCourseService.getCourseById(one.getBusinessId()).getData(); |