puzhibing
2024-12-26 8c83fad498da51773d4aa6a4aa6af13f8e39e27d
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);
@@ -301,6 +299,15 @@
        ShopStatistics shopStatistics = shopMapper.getShopStatistics(shopName);
        return R.ok(shopStatistics);
    }
    /**
     * 编辑门店
     * @param shop
     */
    @PostMapping("/updateShop")
    public void updateShop(@RequestBody Shop shop){
        shopService.updateById(shop);
    }
}