From ec71721c97d2c976063d34f59937479e7e5184cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Fri, 14 Nov 2025 15:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=97=A5=E6=9C=89=E7=A4=BC=E5=8F=91?= =?UTF-8?q?=E5=88=B8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/czg/controller/TestController.java | 21 +++++++++++++++++-- .../czg/task/PointsProductExchangeTask.java | 11 ++++++++++ .../impl/MkBirthdayGiftServiceImpl.java | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/cash-api/account-server/src/main/java/com/czg/controller/TestController.java b/cash-api/account-server/src/main/java/com/czg/controller/TestController.java index 306e68cc1..c9a7d173c 100644 --- a/cash-api/account-server/src/main/java/com/czg/controller/TestController.java +++ b/cash-api/account-server/src/main/java/com/czg/controller/TestController.java @@ -1,5 +1,9 @@ package com.czg.controller; +import com.czg.account.entity.ShopUser; +import com.czg.account.service.ShopInfoService; +import com.czg.account.service.ShopUserFlowService; +import com.czg.account.service.ShopUserService; import com.czg.account.service.TestService; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.RequestMapping; @@ -11,12 +15,25 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/test") public class TestController { - + @Resource + private ShopUserFlowService shopUserFlowService; + @Resource + private ShopInfoService shopInfoService; + @Resource + private ShopUserService shopUserService; @Resource private TestService testService; @RequestMapping("/hello") public String hello() { - return testService.insertData(); + shopUserFlowService.list().forEach(item -> { + ShopUser shopUserInfo = shopUserService.getShopUserInfo(item.getShopId(), item.getUserId()); + if (shopUserInfo != null) { + item.setShopUserId(shopUserInfo.getId()); + shopUserFlowService.updateById(item); + } + }); +// return testService.insertData(); + return ""; } } diff --git a/cash-api/account-server/src/main/java/com/czg/task/PointsProductExchangeTask.java b/cash-api/account-server/src/main/java/com/czg/task/PointsProductExchangeTask.java index 3d0d34043..b15e21c7f 100644 --- a/cash-api/account-server/src/main/java/com/czg/task/PointsProductExchangeTask.java +++ b/cash-api/account-server/src/main/java/com/czg/task/PointsProductExchangeTask.java @@ -1,6 +1,10 @@ package com.czg.task; +import com.czg.account.entity.ShopUser; import com.czg.account.service.PointsExchangeRecordService; +import com.czg.account.service.ShopInfoService; +import com.czg.account.service.ShopUserFlowService; +import com.czg.account.service.ShopUserService; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; @@ -18,6 +22,12 @@ public class PointsProductExchangeTask { @Resource private PointsExchangeRecordService pointsExchangeRecordService; + @Resource + private ShopUserFlowService shopUserFlowService; + @Resource + private ShopInfoService shopInfoService; + @Resource + private ShopUserService shopUserService; /** * order 过期 @@ -26,4 +36,5 @@ public class PointsProductExchangeTask { public void run() { pointsExchangeRecordService.authCancel(); } + } diff --git a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkBirthdayGiftServiceImpl.java b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkBirthdayGiftServiceImpl.java index b1a14c198..cf267d84c 100644 --- a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkBirthdayGiftServiceImpl.java +++ b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkBirthdayGiftServiceImpl.java @@ -204,7 +204,7 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl couponMap = shopCouponService.list(new QueryWrapper().eq(ShopCoupon::getId, config.getCouponInfoList() + Map couponMap = shopCouponService.list(new QueryWrapper().in(ShopCoupon::getId, config.getCouponInfoList() .stream().map(CouponInfoDTO::getId).toList())).stream().collect(Collectors.toMap(ShopCoupon::getId, item -> item)); config.getCouponInfoList().forEach(couponInfo -> { ShopCoupon shopCoupon = couponMap.get(couponInfo.getId());