|
@@ -89,6 +89,8 @@ public class GoodsWholesalePayServiceImpl implements GoodsWholesalePayService {
|
|
|
|
|
|
|
|
private final WeChatService weChatService;
|
|
private final WeChatService weChatService;
|
|
|
|
|
|
|
|
|
|
+ private final GoodsDonMapper goodsDonMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public GoodsWholesaleOrderDon unifiedPay(GoodsWholesaleOrderPayReq payReq) throws Exception {
|
|
public GoodsWholesaleOrderDon unifiedPay(GoodsWholesaleOrderPayReq payReq) throws Exception {
|
|
|
Long userId = payReq.getUserId();
|
|
Long userId = payReq.getUserId();
|
|
@@ -212,6 +214,7 @@ public class GoodsWholesalePayServiceImpl implements GoodsWholesalePayService {
|
|
|
GoodsWholesale goodsWholesale = goodsWholesaleMapper.selectOne(Wrappers.lambdaQuery(GoodsWholesale.class)
|
|
GoodsWholesale goodsWholesale = goodsWholesaleMapper.selectOne(Wrappers.lambdaQuery(GoodsWholesale.class)
|
|
|
.eq(GoodsWholesale::getSkuId, skuId)
|
|
.eq(GoodsWholesale::getSkuId, skuId)
|
|
|
.eq(GoodsWholesale::getDeleted, 1)
|
|
.eq(GoodsWholesale::getDeleted, 1)
|
|
|
|
|
+ .eq(GoodsWholesale::getStatus, 1)
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
if (goodsWholesale != null && goodsWholesale.getIsReturn()) {
|
|
if (goodsWholesale != null && goodsWholesale.getIsReturn()) {
|
|
|
//目前购买多少个
|
|
//目前购买多少个
|
|
@@ -459,6 +462,13 @@ public class GoodsWholesalePayServiceImpl implements GoodsWholesalePayService {
|
|
|
returnDeposit(orderDon, userIdList);
|
|
returnDeposit(orderDon, userIdList);
|
|
|
//返批发余额差价
|
|
//返批发余额差价
|
|
|
returnWholesaleBalanceDiffer(orderDon, userIdList);
|
|
returnWholesaleBalanceDiffer(orderDon, userIdList);
|
|
|
|
|
+
|
|
|
|
|
+ //余额使用记录
|
|
|
|
|
+ if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ Long goodsId = orderDon.getGoodsId();
|
|
|
|
|
+ GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
|
|
|
|
|
+ userBenefitsService.recordBalanceBySource(orderDon.getUserId(), orderDon.getBalance().negate(), UserBalanceSourceRecord.Source.wholesale_order, orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.wholesale_order.getDesc());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|