| | |
| | | package com.ruoyi.order.service.impl.account; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.order.domain.pojo.account.OrderPayment; |
| | |
| | | public class OrderPaymentServiceImpl extends ServiceImpl<OrderPaymentMapper, OrderPayment> implements OrderPaymentService { |
| | | |
| | | @Override |
| | | public void saveOrderPayment(Long userId, Long shopId, String subMchId, String orderId, BigDecimal payMoney, Date endTime, |
| | | public void saveOrderPayment(Long userId, Long shopId, String subMchId, String orderId, String outTradeNo, BigDecimal payMoney, Date endTime, |
| | | String profitSharing, String openid, String goodsNames, String prepayId) { |
| | | OrderPayment payment = new OrderPayment(); |
| | | payment.setPaymentId(IdUtils.simpleUUID()); |
| | |
| | | payment.setPayMoney(payMoney); |
| | | payment.setTimeExpire(endTime); |
| | | payment.setSubMchId(subMchId); |
| | | payment.setOutTradeNo(outTradeNo); |
| | | payment.setPayStatus(1); |
| | | // 0 否 1、是 |
| | | payment.setProfitSharing("Y".equals(profitSharing) ? 1 : 0); |
| | | payment.setUserOpenId(openid); |
| | |
| | | .last(" limit 1 "); |
| | | return this.getOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updatePaySuccess(String outTradeNo, String transactionId) { |
| | | LambdaUpdateWrapper<OrderPayment> updateWrapper = Wrappers.lambdaUpdate(); |
| | | updateWrapper.eq(OrderPayment::getOutTradeNo, outTradeNo) |
| | | .set(OrderPayment::getPayStatus, 2) |
| | | .set(OrderPayment::getTransactionId, transactionId) |
| | | .set(OrderPayment::getBackTime, new Date()); |
| | | this.update(updateWrapper); |
| | | } |
| | | } |