会员支付 会员用户Id
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 订单状态枚举类
|
||||
* @author ww
|
||||
*/
|
||||
@Getter
|
||||
public enum OrderStatusEnums {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class PayServiceImpl implements PayService {
|
||||
ShopUser shopUser = new ShopUser();
|
||||
if ("scanCode".equals(payParam.getPayType())) {
|
||||
AssertUtil.isBlank(payParam.getAuthCode(), "会员码不能为空");
|
||||
Object o = redisService.get(RedisCst.SHOP_USER_DYNAMIC_CODE + shopUser.getShopId() + ":" + payParam.getAuthCode());
|
||||
Object o = redisService.get(RedisCst.SHOP_USER_DYNAMIC_CODE + payParam.getShopId() + ":" + payParam.getAuthCode());
|
||||
AssertUtil.isNull(o, "会员码已失效");
|
||||
shopUser = shopUserService.getById(o.toString());
|
||||
} else {
|
||||
@@ -136,7 +136,9 @@ public class PayServiceImpl implements PayService {
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertUtil.isNull(shopUser, "会员不存在");
|
||||
if (shopUser == null || shopUser.getId() == null) {
|
||||
AssertUtil.isNull(shopUser, "会员不存在");
|
||||
}
|
||||
if (!shopUser.getShopId().equals(orderInfo.getShopId())) {
|
||||
return CzgResult.failure("违规操作,请确认店铺后重试");
|
||||
}
|
||||
@@ -216,7 +218,7 @@ public class PayServiceImpl implements PayService {
|
||||
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
||||
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId);
|
||||
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
||||
"点餐支付", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
||||
payParam.getPayType(), "点餐支付", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -301,7 +303,7 @@ public class PayServiceImpl implements PayService {
|
||||
String payOrderNo = payParam.getPlatformType() + IdUtil.getSnowflakeNextId();
|
||||
initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), "memberIn", payOrderNo, "", payParam.getAmount()));
|
||||
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, payParam.getAmount().multiply(MONEY_RATE).longValue(),
|
||||
"会员充值", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
||||
payParam.getPayType(), "会员充值", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -432,7 +434,6 @@ public class PayServiceImpl implements PayService {
|
||||
isPay = false;
|
||||
refPayOrderNo = "";
|
||||
}
|
||||
orderInfo.setStatus(OrderStatusEnums.PART_REFUND.getCode());
|
||||
if (CollUtil.isNotEmpty(param.getRefundDetails())) {
|
||||
for (OrderDetail refundDetail : param.getRefundDetails()) {
|
||||
AssertUtil.isNull(refundDetail.getNum(), "退单数量不能为空");
|
||||
@@ -484,8 +485,17 @@ public class PayServiceImpl implements PayService {
|
||||
}
|
||||
orderDetailService.updateById(orderDetail);
|
||||
}
|
||||
long count = orderDetailService.queryChain()
|
||||
.eq(OrderDetail::getOrderId, orderInfo.getId())
|
||||
.ne(OrderDetail::getStatus, OrderStatusEnums.REFUND.getCode()).count();
|
||||
if (count > 0) {
|
||||
orderInfo.setStatus(OrderStatusEnums.PART_REFUND.getCode());
|
||||
} else {
|
||||
orderInfo.setStatus(OrderStatusEnums.REFUND.getCode());
|
||||
}
|
||||
} else {
|
||||
refundAmountTotal = param.getRefundAmount();
|
||||
orderInfo.setStatus(OrderStatusEnums.REFUND.getCode());
|
||||
if (isPay) {
|
||||
orderDetailService.updateChain()
|
||||
.eq(OrderDetail::getOrderId, param.getOrderId())
|
||||
|
||||
Reference in New Issue
Block a user