重命名 PaymentPayTypeEnum

This commit is contained in:
gong
2025-12-18 20:22:23 +08:00
parent 0b9ebaaa96
commit dcb2a5a5f1
10 changed files with 67 additions and 82 deletions

View File

@@ -1,7 +1,6 @@
package com.czg.service.order.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.account.entity.ShopUser;
import com.czg.account.entity.UserInfo;
import com.czg.account.service.ShopInfoService;
@@ -14,7 +13,7 @@ import com.czg.market.service.MkDistributionConfigService;
import com.czg.market.vo.MkDistributionConfigVO;
import com.czg.order.dto.MkDistributionPayDTO;
import com.czg.order.entity.OrderPayment;
import com.czg.order.enums.PaymentPayTypeEnum;
import com.czg.constants.PayTypeConstants;
import com.czg.order.service.OrderPaymentService;
import com.czg.resp.CzgResult;
import com.czg.service.market.service.impl.WxServiceImpl;
@@ -71,8 +70,8 @@ public class DistributionPayServiceImpl implements DistributionPayService {
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : shopUserInfo.getId())
.setSourceType(isRecharge ? PaymentPayTypeEnum.SourceType.DISTRIBUTION_RECHARGE : PaymentPayTypeEnum.SourceType.DISTRIBUTION )
.setPayType(PaymentPayTypeEnum.PayType.PAY)
.setSourceType(isRecharge ? PayTypeConstants.SourceType.DISTRIBUTION_RECHARGE : PayTypeConstants.SourceType.DISTRIBUTION )
.setPayType(PayTypeConstants.PayType.PAY)
.setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId())
.setAmount(isRecharge ? payParam.getAmount() : detail.getPayAmount());
orderPaymentService.save(orderPayment);

View File

@@ -20,7 +20,7 @@ import com.czg.order.dto.GbOrderQueryParam;
import com.czg.order.dto.GroupJoinDTO;
import com.czg.order.entity.GbOrder;
import com.czg.order.entity.GbOrderDetail;
import com.czg.order.enums.PaymentPayTypeEnum;
import com.czg.constants.PayTypeConstants;
import com.czg.order.service.GbOrderDetailService;
import com.czg.order.service.GbOrderService;
import com.czg.order.vo.*;
@@ -209,7 +209,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
detailService.save(record);
param.setRecordId(record.getId());
CzgResult<Map<String, Object>> result = CzgResult.success();
CzgResult<Map<String, Object>> mapCzgResult = payService.ltPayOther(param, PaymentPayTypeEnum.SourceType.WARE, "拼团商品购买");
CzgResult<Map<String, Object>> mapCzgResult = payService.ltPayOther(param, PayTypeConstants.SourceType.WARE, "拼团商品购买");
if (200 != mapCzgResult.getCode()) {
return mapCzgResult;
}

View File

@@ -19,7 +19,7 @@ import com.czg.constant.MarketConstants;
import com.czg.constant.TableValueConstant;
import com.czg.entity.notify.CzgPayNotifyDTO;
import com.czg.entity.notify.CzgRefundNotifyDTO;
import com.czg.order.enums.PaymentPayTypeEnum;
import com.czg.constants.PayTypeConstants;
import com.czg.enums.ShopTableStatusEnum;
import com.czg.enums.ShopUserFlowBizEnum;
import com.czg.exception.CzgException;
@@ -1045,10 +1045,10 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
}
payment.setTradeNumber(czgCallBackDto.getPayOrderId());
payment.setRespJson(resultJson.toString());
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
payment.setPayStatus(PayTypeConstants.PayStatus.FAIL);
if ("TRADE_SUCCESS".equals(czgCallBackDto.getState())) {
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
if (PaymentPayTypeEnum.SourceType.ORDER.equals(payment.getSourceType())) {
payment.setPayStatus(PayTypeConstants.PayStatus.SUCCESS);
if (PayTypeConstants.SourceType.ORDER.equals(payment.getSourceType())) {
OrderInfo orderInfo = orderInfoService.getById(payment.getSourceId());
if (orderInfo == null) {
log.error("订单支付回调失败,订单不存在,支付记录Id,{}", payment.getId());
@@ -1061,8 +1061,8 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
// 分销奖励
distributionUserService.distribute(orderInfo.getId(), orderInfo.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), orderInfo.getShopId(), "order");
}
else if (PaymentPayTypeEnum.SourceType.MEMBER_IN.equals(payment.getSourceType()) || PaymentPayTypeEnum.SourceType.FREE.equals(payment.getSourceType())) {
boolean isFree = PaymentPayTypeEnum.SourceType.FREE.equals(payment.getSourceType());
else if (PayTypeConstants.SourceType.MEMBER_IN.equals(payment.getSourceType()) || PayTypeConstants.SourceType.FREE.equals(payment.getSourceType())) {
boolean isFree = PayTypeConstants.SourceType.FREE.equals(payment.getSourceType());
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
OrderInfo orderInfo = null;
if (shopUser == null) {
@@ -1163,7 +1163,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
// distributionUserService.distribute(payment.getId(), payment.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), payment.getShopId(), "recharge");
// }
}
else if (PaymentPayTypeEnum.SourceType.MEMBER_PAY.equals(payment.getSourceType())) {
else if (PayTypeConstants.SourceType.MEMBER_PAY.equals(payment.getSourceType())) {
//购买会员
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
@@ -1172,16 +1172,16 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
// 分销员开通
}
else if (PaymentPayTypeEnum.SourceType.DISTRIBUTION.equals(payment.getSourceType())) {
else if (PayTypeConstants.SourceType.DISTRIBUTION.equals(payment.getSourceType())) {
distributionUserService.open(payment.getSourceId(), payment.getAmount(), payment.getShopId(), payment.getId());
}
else if (PaymentPayTypeEnum.SourceType.POINT.equals(payment.getSourceType())) {
else if (PayTypeConstants.SourceType.POINT.equals(payment.getSourceType())) {
goodPayService.payCallBack(payment.getSourceId(), payment.getId());
}
else if (PaymentPayTypeEnum.SourceType.WARE.equals(payment.getSourceType())) {
else if (PayTypeConstants.SourceType.WARE.equals(payment.getSourceType())) {
gbOrderService.payCallBack(payment.getSourceId(), payment.getId());
}
else if (PaymentPayTypeEnum.SourceType.PP.equals(payment.getSourceType())) {
else if (PayTypeConstants.SourceType.PP.equals(payment.getSourceType())) {
ppPackageOrderService.paySuccess(payment.getSourceId(), payment.getId());
}
}
@@ -1196,9 +1196,9 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
log.info("订单处理过payment id{}", payment.getId());
return;
}
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
payment.setPayStatus(PayTypeConstants.PayStatus.SUCCESS);
if (!"SUCCESS".equals(czgCallBackDto.getState())) {
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
payment.setPayStatus(PayTypeConstants.PayStatus.FAIL);
if ("refund".equals(payment.getPayType())) {
//TODO 订单退款失败 暂不考虑回滚 填充退款原因
orderInfoService.updateById(new OrderInfo()

View File

@@ -32,7 +32,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.enums.PaymentPayTypeEnum;
import com.czg.constants.PayTypeConstants;
import com.czg.order.service.CreditBuyerOrderService;
import com.czg.order.service.OrderDetailService;
import com.czg.order.service.OrderInfoCustomService;
@@ -282,7 +282,7 @@ public class PayServiceImpl implements PayService {
return CzgResult.failure("支付失败 充值金额必须大雨订单金额");
}
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), PaymentPayTypeEnum.SourceType.MEMBER_IN, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), PayTypeConstants.SourceType.MEMBER_IN, PayTypeConstants.PayType.PAY, payOrderNo,
"", rechargeDetail.getAmount(), rechargeDetail.getId()));
upOrderPayInfo(orderInfo.getId(), PayEnums.VIP_PAY, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
@@ -296,7 +296,7 @@ public class PayServiceImpl implements PayService {
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
upOrderPayInfo(orderInfo.getId(), PayEnums.H5_PAY, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
return h5Pay(payParam.getShopId(), new CzgH5PayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
@@ -312,7 +312,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isBlank(payParam.getOpenId(), "用户小程序ID不能为空");
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
return jsPay(payParam.getShopId(), payParam.getPayType(), new CzgJsPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
@@ -336,7 +336,7 @@ public class PayServiceImpl implements PayService {
}
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
return jsPay(payParam.getShopId(), payParam.getPayType(), new CzgJsPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
@@ -351,7 +351,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isBlank(payParam.getOpenId(), "用户小程序ID不能为空");
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
@@ -374,7 +374,7 @@ public class PayServiceImpl implements PayService {
payParam.setAmount(amount);
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, "", orderInfo.getOrderAmount()));
upOrderPayInfo(orderInfo.getId(), PayEnums.MAIN_SCAN, paymentId,
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
return scanPay(payParam.getShopId(), new CzgScanPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
@@ -401,7 +401,7 @@ public class PayServiceImpl implements PayService {
String payOrderNo = orderInfo.getPlatformType() + CzgRandomUtils.snowflake();
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.PAY, payOrderNo, payParam.getAuthCode(), orderInfo.getOrderAmount()));
PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.PAY, payOrderNo, payParam.getAuthCode(), orderInfo.getOrderAmount()));
CzgResult<Map<String, Object>> mapCzgResult = microPay(payParam.getShopId(), new CzgMicroPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
"点餐支付", payParam.getAuthCode(), payParam.getBuyerRemark(), ""));
if (mapCzgResult.getCode() == 200) {
@@ -449,8 +449,8 @@ public class PayServiceImpl implements PayService {
AssertUtil.isBlank(payParam.getOpenId(), "用户小程序ID不能为空");
AssertUtil.isBlank(payParam.getPayType(), "支付方式不能为空");
String payOrderNo = payParam.getPlatformType() + CzgRandomUtils.snowflake();
String payType = isFree ? PaymentPayTypeEnum.SourceType.FREE : PaymentPayTypeEnum.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
String payType = isFree ? PayTypeConstants.SourceType.FREE : PayTypeConstants.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
"", payParam.getAmount(), isFree ? payParam.getOrderId() : payParam.getActivateId()));
return jsPay(payParam.getShopId(), payParam.getPayType(), new CzgJsPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
"会员充值", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
@@ -470,7 +470,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isBlank(payParam.getOpenId(), "用户小程序ID不能为空");
AssertUtil.isBlank(payParam.getPayType(), "支付方式不能为空");
String payOrderNo = payParam.getPlatformType() + CzgRandomUtils.snowflake();
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), PaymentPayTypeEnum.SourceType.MEMBER_PAY, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), PayTypeConstants.SourceType.MEMBER_PAY, PayTypeConstants.PayType.PAY, payOrderNo,
"", memberOrder.getAmount(), memberOrder.getId()));
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, memberOrder.getAmount().multiply(MONEY_RATE).longValue(),
payParam.getPayType(), "会员充值", "wechatPay".equals(payParam.getPayType()) ? userInfo.getWechatOpenId() : userInfo.getAlipayOpenId(), clientIP, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
@@ -497,8 +497,8 @@ public class PayServiceImpl implements PayService {
}
String payOrderNo = payParam.getPlatformType() + CzgRandomUtils.snowflake();
String payType = isFree ? PaymentPayTypeEnum.SourceType.FREE : PaymentPayTypeEnum.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
String payType = isFree ? PayTypeConstants.SourceType.FREE : PayTypeConstants.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
"", payParam.getAmount(), isFree ? payParam.getOrderId() : payParam.getActivateId()));
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
payParam.getPayType(), "会员充值", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
@@ -520,8 +520,8 @@ public class PayServiceImpl implements PayService {
BigDecimal amount = shopRechargeService.checkRecharge(mainShopId, rechargeDTO.getShopId(), shopUser.getUserId(), rechargeDTO.getRechargeDetailId(), rechargeDTO.getAmount());
String payOrderNo = rechargeDTO.getPlatformType() + CzgRandomUtils.snowflake();
String payType = isFree ? PaymentPayTypeEnum.SourceType.FREE : PaymentPayTypeEnum.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(rechargeDTO.getShopId(), shopUser.getId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
String payType = isFree ? PayTypeConstants.SourceType.FREE : PayTypeConstants.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(rechargeDTO.getShopId(), shopUser.getId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
"", amount, isFree ? rechargeDTO.getOrderId() : rechargeDTO.getRechargeDetailId()));
return ltPay(rechargeDTO.getShopId(), rechargeDTO.getPayType(), new CzgLtPayReq(payOrderNo, amount.multiply(MONEY_RATE).longValue(),
rechargeDTO.getPayType(), "会员充值", "wechatPay".equals(rechargeDTO.getPayType()) ? userInfo.getWechatOpenId() : userInfo.getAlipayOpenId(),
@@ -535,8 +535,8 @@ public class PayServiceImpl implements PayService {
ShopUser shopUser = shopUserService.getById(payParam.getShopUserId());
AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在");
String payOrderNo = payParam.getPlatformType() + CzgRandomUtils.snowflake();
String payType = isFree ? PaymentPayTypeEnum.SourceType.FREE : PaymentPayTypeEnum.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
String payType = isFree ? PayTypeConstants.SourceType.FREE : PayTypeConstants.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
"", payParam.getAmount(), isFree ? payParam.getOrderId() : payParam.getActivateId()));
return scanPay(payParam.getShopId(), new CzgScanPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
"会员充值", clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
@@ -550,8 +550,8 @@ public class PayServiceImpl implements PayService {
ShopUser shopUser = shopUserService.getById(payParam.getShopUserId());
AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在");
String payOrderNo = payParam.getPlatformType() + CzgRandomUtils.snowflake();
String payType = isFree ? PaymentPayTypeEnum.SourceType.FREE : PaymentPayTypeEnum.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
String payType = isFree ? PayTypeConstants.SourceType.FREE : PayTypeConstants.SourceType.MEMBER_IN;
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
payParam.getAuthCode(), payParam.getAmount(), isFree ? payParam.getOrderId() : payParam.getActivateId()));
CzgResult<Map<String, Object>> mapCzgResult = microPay(payParam.getShopId(), new CzgMicroPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
"会员充值", payParam.getAuthCode(), payParam.getBuyerRemark(), ""));
@@ -566,7 +566,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isBlank(param.getOpenId(), "用户小程序ID不能为空");
AssertUtil.isBlank(param.getPayType(), "支付方式不能为空");
String payOrderNo = "DH" + IdUtil.getSnowflakeNextId();
initOrderPayment(new OrderPayment(param.getShopId(), param.getRecordId(), payType, PaymentPayTypeEnum.PayType.PAY, payOrderNo,
initOrderPayment(new OrderPayment(param.getShopId(), param.getRecordId(), payType, PayTypeConstants.PayType.PAY, payOrderNo,
"", param.getPrice(), null));
return ltPay(param.getShopId(), param.getPayType(), new CzgLtPayReq(payOrderNo, param.getPrice().multiply(MONEY_RATE).longValue(),
param.getPayType(), detail, param.getOpenId(), param.getIp(), "", "", ""));
@@ -634,7 +634,7 @@ public class PayServiceImpl implements PayService {
}
String refPayOrderNo = "REFVIP" + IdUtil.getSnowflakeNextId();
refPaymentId = initOrderPayment(new OrderPayment(refPayParam.getShopId(), shopUser.getId(),
PaymentPayTypeEnum.SourceType.MEMBER_IN, PaymentPayTypeEnum.PayType.REFUND, refPayOrderNo, null, refPayParam.getRefAmount()));
PayTypeConstants.SourceType.MEMBER_IN, PayTypeConstants.PayType.REFUND, refPayOrderNo, null, refPayParam.getRefAmount()));
CzgResult<CzgRefundResp> refund = refund(refPayParam.getShopId(), new CzgRefundReq(refPayOrderNo, refPayParam.getRemark(),
refPayParam.getRefAmount().multiply(MONEY_RATE).longValue(), payment.getOrderNo(), ""));
if (refund.getCode() != 200 || refund.getData() == null || !"SUCCESS".equals(refund.getData().getState())) {
@@ -644,7 +644,7 @@ public class PayServiceImpl implements PayService {
.eq(OrderPayment::getId, refPaymentId)
.set(OrderPayment::getPayTime, refund.getData().getRefundTime())
.set(OrderPayment::getTradeNumber, refund.getData().getRefundOrderId())
.set(OrderPayment::getPayStatus, PaymentPayTypeEnum.PayStatus.SUCCESS)
.set(OrderPayment::getPayStatus, PayTypeConstants.PayStatus.SUCCESS)
.set(OrderPayment::getRespJson, JSONObject.toJSONString(refund.getData()))
.update();
}
@@ -829,7 +829,7 @@ public class PayServiceImpl implements PayService {
@NonNull String refundReason, @NonNull BigDecimal refundAmount) {
OrderPayment payment = paymentService.getById(payOrderId);
AssertUtil.isNull(payment, "退款失败支付记录不存在");
Long refundId = initOrderPayment(new OrderPayment(shopId, orderId, PaymentPayTypeEnum.SourceType.ORDER, PaymentPayTypeEnum.PayType.REFUND, refPayOrderNo, null, refundAmount, payment.getId()));
Long refundId = initOrderPayment(new OrderPayment(shopId, orderId, PayTypeConstants.SourceType.ORDER, PayTypeConstants.PayType.REFUND, refPayOrderNo, null, refundAmount, payment.getId()));
CzgResult<CzgRefundResp> refund = refund(shopId, new CzgRefundReq(refPayOrderNo, refundReason, refundAmount.multiply(MONEY_RATE).longValue(),
payment.getOrderNo(), ""));
if (refund.getCode() != 200 || refund.getData() == null || !"SUCCESS".equals(refund.getData().getState())) {
@@ -853,16 +853,16 @@ public class PayServiceImpl implements PayService {
@NonNull String refundReason, @NonNull BigDecimal refundAmount) {
OrderPayment payment = paymentService.getById(payOrderId);
AssertUtil.isNull(payment, "退款失败,支付记录不存在");
Long refundId = initOrderPayment(new OrderPayment(shopId, sourceId, payment.getSourceType(), PaymentPayTypeEnum.PayType.REFUND, refPayOrderNo, null, refundAmount, payment.getId()));
Long refundId = initOrderPayment(new OrderPayment(shopId, sourceId, payment.getSourceType(), PayTypeConstants.PayType.REFUND, refPayOrderNo, null, refundAmount, payment.getId()));
CzgResult<CzgRefundResp> refund = refund(shopId, new CzgRefundReq(refPayOrderNo, refundReason, refundAmount.multiply(MONEY_RATE).longValue(),
payment.getOrderNo(), ""));
OrderPayment uOrderPayment = new OrderPayment();
uOrderPayment.setTradeNumber(refund.getData().getRefundOrderId());
uOrderPayment.setRespJson(JSONObject.toJSONString(refund.getData()));
if (refund.getCode() != 200 || refund.getData() == null || !"SUCCESS".equals(refund.getData().getState())) {
uOrderPayment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
uOrderPayment.setPayStatus(PayTypeConstants.PayStatus.FAIL);
} else {
uOrderPayment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
uOrderPayment.setPayStatus(PayTypeConstants.PayStatus.SUCCESS);
uOrderPayment.setPayTime(LocalDateTimeUtil.parse(refund.getData().getRefundTime(), "yyyy-MM-dd HH:mm:ss"));
}
paymentService.update(uOrderPayment, QueryWrapper.create().eq(OrderPayment::getId, refundId));
@@ -874,7 +874,7 @@ public class PayServiceImpl implements PayService {
//支付的 订单
OrderPayment payment = paymentService.getById(refundPayment.getRelatedId());
AssertUtil.isNull(payment, "退款失败,支付记录不存在");
Long refundCompensate = initOrderPayment(new OrderPayment(refundPayment.getShopId(), refundPayment.getSourceId(), payment.getSourceType(), PaymentPayTypeEnum.PayType.REFUND_COMPENSATE,
Long refundCompensate = initOrderPayment(new OrderPayment(refundPayment.getShopId(), refundPayment.getSourceId(), payment.getSourceType(), PayTypeConstants.PayType.REFUND_COMPENSATE,
refPayOrderNo, null, refundPayment.getAmount(), refundPayment.getId()));
CzgResult<CzgRefundResp> refund = refund(payment.getShopId(), new CzgRefundReq(refPayOrderNo, "退款补偿", refundPayment.getAmount().multiply(MONEY_RATE).longValue(),
payment.getOrderNo(), ""));
@@ -882,9 +882,9 @@ public class PayServiceImpl implements PayService {
uOrderPayment.setTradeNumber(refund.getData().getRefundOrderId());
uOrderPayment.setRespJson(JSONObject.toJSONString(refund.getData()));
if (refund.getCode() != 200 || refund.getData() == null || !"SUCCESS".equals(refund.getData().getState())) {
uOrderPayment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
uOrderPayment.setPayStatus(PayTypeConstants.PayStatus.FAIL);
} else {
uOrderPayment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
uOrderPayment.setPayStatus(PayTypeConstants.PayStatus.SUCCESS);
uOrderPayment.setPayTime(LocalDateTimeUtil.parse(refund.getData().getRefundTime(), "yyyy-MM-dd HH:mm:ss"));
}
paymentService.update(uOrderPayment, QueryWrapper.create().eq(OrderPayment::getId, refundPayment.getId()));

View File

@@ -16,7 +16,7 @@ import com.czg.market.enums.PointsConstant;
import com.czg.market.service.*;
import com.czg.order.dto.CommonRefundDTO;
import com.czg.order.dto.LtPayOtherDTO;
import com.czg.order.enums.PaymentPayTypeEnum;
import com.czg.constants.PayTypeConstants;
import com.czg.order.service.PointsGoodPayService;
import com.czg.resp.CzgResult;
import com.czg.service.order.service.PayService;
@@ -109,7 +109,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
goodsRecordService.save(record);
param.setRecordId(record.getId());
CzgResult<Map<String, Object>> result = CzgResult.success();
CzgResult<Map<String, Object>> mapCzgResult = payService.ltPayOther(param, PaymentPayTypeEnum.SourceType.POINT, "积分商品购买");
CzgResult<Map<String, Object>> mapCzgResult = payService.ltPayOther(param, PayTypeConstants.SourceType.POINT, "积分商品购买");
if (200 != mapCzgResult.getCode()) {
return mapCzgResult;
}