会员购买
This commit is contained in:
@@ -520,7 +520,7 @@ public abstract class PrinterHandler {
|
||||
String balance = "0";
|
||||
|
||||
if ("deposit".equals(orderInfo.getPayType())) {
|
||||
ShopUser user = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, orderInfo.getShopId()).eq(ShopUser::getUserId, orderInfo.getUserId()));
|
||||
ShopUser user = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getSourceShopId, orderInfo.getShopId()).eq(ShopUser::getUserId, orderInfo.getUserId()));
|
||||
if (ObjectUtil.isNotEmpty(user) && ObjectUtil.isNotEmpty(user.getAmount())) {
|
||||
balance = user.getAmount().toPlainString();
|
||||
}
|
||||
|
||||
@@ -859,7 +859,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.CASH_IN);
|
||||
}
|
||||
//更新会员余额 并生成流水
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getSourceShopId(), shopUserMoneyEditDTO);
|
||||
if (payment.getRelatedId() == null) {
|
||||
return;
|
||||
}
|
||||
@@ -971,7 +971,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
}
|
||||
if (!orderInfo.getPayType().equals(PayEnums.CREDIT_PAY.getValue())) {
|
||||
//消费赠券 挂账支付不赠送
|
||||
consumerCouponService.receiveConsumerCoupon(shopUser.getShopId(), orderInfo.getId(), orderInfo.getPayAmount(), shopUser.getUserId(), shopUser.getId());
|
||||
consumerCouponService.receiveConsumerCoupon(shopUser.getSourceShopId(), orderInfo.getId(), orderInfo.getPayAmount(), shopUser.getUserId(), shopUser.getId());
|
||||
}
|
||||
String[] payTypes = {PayEnums.VIP_PAY.getValue(), PayEnums.CREDIT_PAY.getValue()};
|
||||
if ((orderInfo.getPayType() != null && !ArrayUtil.contains(payTypes, orderInfo.getPayType()))
|
||||
|
||||
@@ -226,7 +226,7 @@ public class PayServiceImpl implements PayService {
|
||||
}
|
||||
payParam.getCheckOrderPay().setUserId(shopUser.getUserId());
|
||||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||
if (!shopUser.getShopId().equals(orderInfo.getShopId())) {
|
||||
if (!shopUser.getSourceShopId().equals(orderInfo.getShopId())) {
|
||||
return CzgResult.failure("违规操作,请确认店铺后重试");
|
||||
}
|
||||
if (shopUser.getAmount().compareTo(orderInfo.getOrderAmount()) < 0) {
|
||||
@@ -239,7 +239,7 @@ public class PayServiceImpl implements PayService {
|
||||
.setBizEnum(ShopUserFlowBizEnum.ORDER_PAY)
|
||||
.setRelationId(orderInfo.getId());
|
||||
//更新会员余额 并生成流水
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getSourceShopId(), shopUserMoneyEditDTO);
|
||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||
LocalDateTime.now(), flowId, PayEnums.VIP_PAY);
|
||||
return CzgResult.success();
|
||||
@@ -370,7 +370,7 @@ public class PayServiceImpl implements PayService {
|
||||
.setRemark("现金充值")
|
||||
.setBizEnum(ShopUserFlowBizEnum.CASH_IN);
|
||||
//更新会员余额 并生成流水
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
Long flowId = shopUserService.updateMoney(shopUser.getSourceShopId(), shopUserMoneyEditDTO);
|
||||
//TODO 以前的会员活动
|
||||
//shopActivateService.giveActivate(shopUser, payParam.getAmount(), payParam.getActivateId(), flowId);
|
||||
return CzgResult.success();
|
||||
@@ -395,7 +395,7 @@ public class PayServiceImpl implements PayService {
|
||||
public CzgResult<Map<String, Object>> ltPayMember(String clientIP, VipMemberPayParamDTO payParam) {
|
||||
MemberOrder memberOrder = memberOrderService.getOne(new QueryWrapper().eq(MemberOrder::getId, payParam.getMemberOrderId()));
|
||||
AssertUtil.isNull(memberOrder, "充值会员失败 该会员订单不存在");
|
||||
ShopUser shopUser = shopUserService.getById(payParam.getShopUserId());
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getSourceShopId, payParam.getShopId()).eq(ShopUser::getId, payParam.getShopUserId()));
|
||||
AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在");
|
||||
AssertUtil.isBlank(payParam.getOpenId(), "用户小程序ID不能为空");
|
||||
AssertUtil.isBlank(payParam.getPayType(), "支付方式不能为空");
|
||||
@@ -535,7 +535,7 @@ public class PayServiceImpl implements PayService {
|
||||
.setRelationId(refPaymentId)
|
||||
.setRechargeId(inFlow.getId());
|
||||
//更新会员余额 并生成流水
|
||||
shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
shopUserService.updateMoney(shopUser.getSourceShopId(), shopUserMoneyEditDTO);
|
||||
userFlowService.updateRefund(inFlow.getId(), refPayParam.getRefAmount());
|
||||
if (giftFlow != null && (giftFlow.getAmount().subtract(giftFlow.getRefundAmount())).compareTo(BigDecimal.ZERO) > 0) {
|
||||
ShopUserMoneyEditDTO giftFlowEdit = new ShopUserMoneyEditDTO()
|
||||
@@ -547,7 +547,7 @@ public class PayServiceImpl implements PayService {
|
||||
.setRelationId(refPaymentId)
|
||||
.setRechargeId(giftFlow.getId());
|
||||
//更新会员余额 并生成流水
|
||||
shopUserService.updateMoney(shopUser.getShopId(), giftFlowEdit);
|
||||
shopUserService.updateMoney(shopUser.getSourceShopId(), giftFlowEdit);
|
||||
userFlowService.updateRefund(giftFlow.getId(), giftFlow.getAmount());
|
||||
}
|
||||
//移除优惠券
|
||||
@@ -670,7 +670,7 @@ public class PayServiceImpl implements PayService {
|
||||
.setType(1)
|
||||
.setRelationId(orderInfo.getId())
|
||||
.setBizEnum(ShopUserFlowBizEnum.ORDER_REFUND);
|
||||
shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
shopUserService.updateMoney(shopUser.getSourceShopId(), shopUserMoneyEditDTO);
|
||||
} else if (orderInfo.getPayType().equals(PayEnums.CREDIT_PAY.getValue())) {
|
||||
AssertUtil.isNull(orderInfo.getCreditBuyerId(), "挂账单退款失败,未查询到挂账人");
|
||||
buyerOrderService.partRefund(orderInfo.getCreditBuyerId().toString(), orderInfo.getId(), param.getRefundAmount());
|
||||
|
||||
Reference in New Issue
Block a user