From 03c954ac00006a05507a0974f103abd3f1625edb Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 26 十二月 2024 17:03:57 +0800 Subject: [PATCH] 合并代码 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 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 d958544..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 @@ -63,7 +63,6 @@ - @PostMapping @ApiOperation(value = "新增门店", tags = {"管理后台-门店管理"}) @Transactional(rollbackFor = Exception.class) @@ -72,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); @@ -86,16 +86,22 @@ 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.setUserType(2); + R<Void> editAppUserR = appUserClient.editAppUserById(appUser); + if (R.isError(editAppUserR)){ + throw new RuntimeException("添加失败"); + } return R.ok(); } -- Gitblit v1.7.1