From a04f3c69b36b29b65526260fa238effd5aaa9b76 Mon Sep 17 00:00:00 2001 From: Tankaikai Date: Thu, 10 Apr 2025 18:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=BA=97=E9=93=BA=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20=E2=88=9A=20=E4=B8=8B=E5=8D=95=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BC=9A=E5=91=98=20=E2=88=9A=20=E6=B3=A8=E5=86=8C=E4=BC=9A?= =?UTF-8?q?=E5=91=98=20=E2=88=9A=20=E5=AE=8C=E5=96=84=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=20=E2=88=9A=20=E4=BC=9A=E5=91=98=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=90=8C=E6=AD=A5=20=E2=88=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/ProductController.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java b/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java index 94cc6220..4ec8e214 100644 --- a/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java +++ b/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java @@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert; import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; +import com.czg.account.service.ShopConfigService; import com.czg.annotation.SaStaffCheckPermission; import com.czg.config.RabbitPublisher; import com.czg.exception.CzgException; @@ -48,6 +49,8 @@ public class ProductController { private final RabbitPublisher rabbitPublisher; @Resource private ShopSyncService shopSyncService; + @Resource + private ShopConfigService shopConfigService; /** * 商品-分页 @@ -291,6 +294,24 @@ public class ProductController { return CzgResult.success(data); } + /** + * 商品-报损 + */ + @PostMapping("sync") + @OperationLog("商品-同步主店商品信息") + //@SaAdminCheckPermission("product:sync") + public CzgResult sync() { + long shopId = StpKit.USER.getShopId(0L); + long sysUserId = StpKit.USER.getLoginIdAsLong(); + Long headShopId = StpKit.USER.getHeadShopId(); + ThreadUtil.execAsync(() -> { + shopSyncService.sync(headShopId, shopId, sysUserId); + }); + CzgResult ret = CzgResult.success(); + ret.setMsg("操作成功,数据正在后台同步中..."); + return ret; + } + private void asyncToBranchShop(Long id) { long shopId = StpKit.USER.getShopId(0L); long sysUserId = StpKit.USER.getLoginIdAsLong();