无关风月
2025-01-14 6ccd0f9e28c083e5f62d7d5074a85584a77af6bb
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -114,6 +114,9 @@
        shop.setCustomOrderNumber(0);
        shop.setAppUserId(appUser.getId());
        String city = TencentMapUtil.inverseGeographicalAnalysis(shop.getLongitude(), shop.getLatitude(), false);
        if(!StringUtils.hasLength(city)){
            city = "510100";
        }
        shop.setProvinceCode(city.substring(0, 2) + "0000");
        shop.setCityCode(city.substring(0, 4) + "00");
        shop.setDistrictCode(city);
@@ -211,7 +214,15 @@
        }
        Shop shop = shopService.getById(id);
        shop.setDelFlag(1);
        shopService.updateById(shop);
        // 查询有没有门店绑定这个被删除的门店
        List<Shop> shops = shopService.lambdaQuery().eq(Shop::getPid, shop.getId()).list();
        for (Shop shop1 : shops) {
            LambdaUpdateWrapper<Shop> set = new LambdaUpdateWrapper<Shop>().set(Shop::getPid, null)
                    .eq(Shop::getId,shop1.getId());
            shopService.update(set);
        }
        appUserClient.clearBindShop(shop.getId());
        UserShop userShop = new UserShop();
        userShop.setShopId(shop.getId());