分销订单退款

This commit is contained in:
张松
2025-10-30 14:48:01 +08:00
parent 74ae88c7fe
commit d2eb98e8b7

View File

@@ -24,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
/**
* 分销定时任务
*
@@ -44,6 +46,8 @@ public class DistributionTask {
private OrderInfoService orderInfoService;
@DubboReference
private ShopInfoService shopInfoService;
@DubboReference
private ShopUserService shopUserService;
/**
* 生日有礼奖励发放
@@ -66,7 +70,10 @@ public class DistributionTask {
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
}else {
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);
});