| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | } |
| | | this.saveOrUpdate(order); |
| | | // 订单金额大于0时进行分账 |
| | | if (order.getOnlinePayMoney().compareTo(BigDecimal.ZERO)>0) { |
| | | OrderPayment orderPayment = orderPaymentService.getOne(new QueryWrapper<OrderPayment>() |
| | | .eq("order_id", order.getOrderId()).eq("pay_status", 2) |
| | | .eq("del_flag", 0)); |
| | | BigDecimal bigDecimal = orderPayment.getPayMoney().subtract(orderPayment.getFeeAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | if (bigDecimal.compareTo(BigDecimal.ZERO)>0) { |
| | | // TODO: 2023/10/17 更换分账渠道(汇付天下) |
| | | // submitProfitSharing(orderId, order.getOrderNo(), order.getShopId(), order.getOnlinePayMoney(),order.getOrderFrom()); |
| | | submitProfitSharing1(orderId, order.getOrderNo(), order.getShopId(), order.getOnlinePayMoney(),order.getOrderFrom()); |
| | | submitProfitSharing1(orderId, order.getOrderNo(), order.getShopId(), bigDecimal, order.getOrderFrom()); |
| | | } |
| | | //创建支付记录 |
| | | if(merVerifyOrderDto.getRelPayMoney().compareTo(BigDecimal.ZERO)>0){ |
| | |
| | | @Override |
| | | @Transactional |
| | | @GlobalTransactional(rollbackFor = Exception.class) |
| | | public void payBack(PartnerTransactionsResult transaction) { |
| | | public void payBack(PartnerTransactionsResult transaction, BigDecimal feeAmount) { |
| | | log.info("订单支付回调---"+transaction.toString()); |
| | | // Order order = this.getById(orderId); |
| | | // 更新订单状态 outTradeNo |
| | |
| | | profitsSharingService.applyProfitSharing(request);*/ |
| | | } |
| | | //修改支付记录生成支付记录 |
| | | orderPaymentService.updatePaySuccess(transaction.getOutTradeNo(), transaction.getTransactionId()); |
| | | orderPaymentService.updatePaySuccess(transaction.getOutTradeNo(), feeAmount, transaction.getTransactionId()); |
| | | PayRecord payRecord = new PayRecord(); |
| | | payRecord.setDelFlag(0); |
| | | payRecord.setOrderId(orderId); |