From 9006b9705a222cce51daf973fa1bb989cbd2a873 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 26 十二月 2024 13:54:10 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
index 24eda68..1dffb31 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -71,6 +71,7 @@
         if (!shopService.cheUserByPhone(phone)) {
             return R.fail("该手机号未注册");
         }
+        AppUser appUser = appUserClient.getAppUserByPhone1(phone).getData();
         shop.setShopAllPoint(0);
         shop.setShopPoint(0);
         shop.setSharePoint(0);
@@ -85,18 +86,15 @@
         shop.setOrderNumber(0);
         shop.setServerOrderNumber(0);
         shop.setCustomOrderNumber(0);
+        shop.setAppUserId(appUser.getId());
         shopService.save(shop);
 
-        LoginUser loginUserApplet = tokenService.getLoginUser();
+
         AppUserShop appUserShop = new AppUserShop();
-        appUserShop.setAppUserId(loginUserApplet.getUserid());
+        appUserShop.setAppUserId(appUser.getId());
         appUserShop.setShopId(shop.getId());
         R<Void> r = appUserClient.addAppUserShop(appUserShop);
         if (R.isError(r)){
-            throw new RuntimeException("添加失败");
-        }
-        AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid());
-        if (appUser == null){
             throw new RuntimeException("添加失败");
         }
         appUser.setUserType(2);

--
Gitblit v1.7.1