From fd1f9aff977209dc17e5e8fbcd598b6771a71d8b Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Tue, 8 Apr 2025 11:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=A5=E9=A9=BB=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BD=AC=E5=BA=97=E9=93=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShopStoreBaseServiceImpl.java | 74 +++++++++++++++---- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java index 2bcf03ca..c9cdc799 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java @@ -2994,7 +2994,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl merchEntryInfo2StoreInfo(String mchMobile) { - if (StrUtil.isBlank(mchMobile)) { logger.error("生成店铺:商家手机号不能为空"); return Pair.of(0, "商家手机号不能为空"); @@ -3021,13 +3020,12 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl resp = wxQrCodeService.genUnlimitedWxQrCode("pagesub/index/store", "store_id=" + storeId); + if (StrUtil.isNotBlank(resp.getFirst())) { + updateStoreBaseQrCode(storeId, resp.getFirst()); + } + } + + // 初始化时添加一条店铺分析信息 + ShopStoreAnalytics store_analytics_column = new ShopStoreAnalytics(); + store_analytics_column.setStore_id(storeId); + if (!shopStoreAnalyticsService.saveOrUpdate(store_analytics_column)) { + throw new ApiException(ResultCode.FAILED); + } + + // 初始化店铺商品标签 + QueryWrapper tagQueryWrapper = new QueryWrapper<>(); + tagQueryWrapper.orderByAsc("product_tag_id"); + Page base_product_tag_row = shopBaseProductTagService.lists(tagQueryWrapper, 1, 5); + + List store_product_tag_row = new ArrayList<>(); + for (ShopBaseProductTag teg : base_product_tag_row.getRecords()) { + ShopStoreProductTag shopStoreProductTag = new ShopStoreProductTag(); + store_product_tag_row.add(shopStoreProductTag); + shopStoreProductTag.setProduct_tag_id(teg.getProduct_tag_id()); + shopStoreProductTag.setStore_id(storeId); + shopStoreProductTag.setProduct_tag_time(today); + shopStoreProductTag.setStore_product_tag_buildin(1); + } + + if (CollUtil.isNotEmpty(store_product_tag_row)) { + if (!shopStoreProductTagService.saveOrUpdate(store_product_tag_row)) { + throw new ApiException(ResultCode.FAILED); + } + } + + //初始化默认店铺仓库 + InvoicingWarehouseBase invoicingWarehouseBase = new InvoicingWarehouseBase(); + invoicingWarehouseBase.setWarehouse_name(I18nUtil._("默认")); + invoicingWarehouseBase.setStore_id(storeId); + invoicingWarehouseBase.setWarehouse_address(""); + invoicingWarehouseBase.setWarehouse_number(""); + invoicingWarehouseBase.setWarehouse_contact(""); + + if (!invoicingWarehouseBaseService.saveOrUpdate(invoicingWarehouseBase)) { + throw new ApiException(ResultCode.FAILED); + } + // 注意:关联店铺到用户,给用户增加店铺管理员权限 initShopKeeperRightsGroup(userId, storeId); @@ -3290,11 +3335,10 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl sc_order_process = Arrays.asList(StateCode.ORDER_PROCESS_PAY, - //支付 + List sc_order_process = Arrays.asList( + StateCode.ORDER_PROCESS_PAY,//支付 StateCode.ORDER_PROCESS_OUT, //出库审核 - StateCode.ORDER_PROCESS_SHIPPED, - //发货确认 + StateCode.ORDER_PROCESS_SHIPPED,//发货确认 StateCode.ORDER_PROCESS_RECEIVED); String str_sc_order_process = CollUtil.join(sc_order_process, ",");