From d2eb98e8b7b761c432fe18ee5574a0df2c243d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Thu, 30 Oct 2025 14:48:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=94=80=E8=AE=A2=E5=8D=95=E9=80=80?= =?UTF-8?q?=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/czg/task/DistributionTask.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cash-api/market-server/src/main/java/com/czg/task/DistributionTask.java b/cash-api/market-server/src/main/java/com/czg/task/DistributionTask.java index 3dc1cee76..b43917d25 100644 --- a/cash-api/market-server/src/main/java/com/czg/task/DistributionTask.java +++ b/cash-api/market-server/src/main/java/com/czg/task/DistributionTask.java @@ -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); });