Merge remote-tracking branch 'origin/master'

This commit is contained in:
Tankaikai
2025-03-05 16:34:45 +08:00
11 changed files with 135 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ public class OrderPayParamDTO {
// @NotNull(message = "店铺不能为空")
private Long shopId;
private Long shopUserId;
private Long creditBuyerId;
private String buyerRemark;
private String returnUrl;
private String payType;

View File

@@ -20,6 +20,7 @@ import com.czg.order.entity.OrderDetail;
import com.czg.order.entity.OrderInfo;
import com.czg.order.entity.OrderPayment;
import com.czg.order.enums.PayEnums;
import com.czg.order.service.CreditBuyerOrderService;
import com.czg.order.service.OrderDetailService;
import com.czg.order.service.OrderInfoService;
import com.czg.order.service.OrderPaymentService;
@@ -84,6 +85,8 @@ public class PayServiceImpl implements PayService {
@Resource
private OrderPaymentService paymentService;
@Resource
private CreditBuyerOrderService buyerOrderService;
@Resource
private RedisService redisService;
@Resource
private RabbitPublisher rabbitPublisher;
@@ -131,11 +134,14 @@ public class PayServiceImpl implements PayService {
@Override
@Transactional
public CzgResult<Object> creditPayOrder(OrderPayParamDTO payParam) {
AssertUtil.isNull(payParam.getCreditBuyerId(), "挂账人不可为空");
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
orderInfo.setCreditBuyerId(payParam.getCreditBuyerId());
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
LocalDateTime.now(), null, PayEnums.CREDIT_PAY);
//挂账后续逻辑
buyerOrderService.save(payParam.getCreditBuyerId().toString(), orderInfo.getId());
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
//TODO 挂账后续逻辑
return CzgResult.success();
}