分销订单退款
This commit is contained in:
@@ -24,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销定时任务
|
* 分销定时任务
|
||||||
*
|
*
|
||||||
@@ -44,6 +46,8 @@ public class DistributionTask {
|
|||||||
private OrderInfoService orderInfoService;
|
private OrderInfoService orderInfoService;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ShopInfoService shopInfoService;
|
private ShopInfoService shopInfoService;
|
||||||
|
@DubboReference
|
||||||
|
private ShopUserService shopUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生日有礼奖励发放
|
* 生日有礼奖励发放
|
||||||
@@ -66,7 +70,10 @@ public class DistributionTask {
|
|||||||
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
||||||
}else {
|
}else {
|
||||||
item.setStatus(TableValueConstant.DistributionFlow.Status.SUCCESS.getCode());
|
item.setStatus(TableValueConstant.DistributionFlow.Status.SUCCESS.getCode());
|
||||||
distributionUserService.updateShopInfoAmount(orderInfo.getShopId(), item.getRewardAmount(), orderInfo.getId());
|
ShopUser shopUser = shopUserService.getById(item.getDistributionUserId());
|
||||||
|
distributionUserService.updateIncome(item.getRewardAmount().negate(), item.getRewardAmount(), BigDecimal.ZERO,
|
||||||
|
item.getDistributionUserId(), shopUser.getUserId(), item.getShopId(), item.getLevel());
|
||||||
|
distributionUserService.updateShopInfoAmount(orderInfo.getShopId(), item.getRewardAmount().negate(), orderInfo.getId(), TableValueConstant.DistributionAmountFlow.Type.SUB, "分销扣减");
|
||||||
}
|
}
|
||||||
distributionFlowService.updateById(item);
|
distributionFlowService.updateById(item);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user