diff --git a/ecom-dmb-backend/sql/design/ec/ec_shop_design.sql b/ecom-dmb-backend/sql/design/ec/ec_shop_design.sql index 3bf6eefd..6021767a 100644 --- a/ecom-dmb-backend/sql/design/ec/ec_shop_design.sql +++ b/ecom-dmb-backend/sql/design/ec/ec_shop_design.sql @@ -12,6 +12,7 @@ CREATE TABLE `ec_shop` ( `company_id` bigint UNSIGNED NOT NULL COMMENT '所属公司ID', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '店铺名称', `logo_image_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT 'logo图片ID', + `logo_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'logo外链URL(渠道授权等;查询时有 logo_image_id 则覆盖)', `platform_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '平台代码(软约定枚举,无平台表)', `external_shop_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '外部店铺ID(如拼多多 mall_id;与 platform_code 组合关联平台店铺)', `order_inc_sync_enabled` tinyint NOT NULL DEFAULT 0 COMMENT '订单增量同步开关:0关 1开(产品配置,与渠道运行态分离)', diff --git a/ecom-dmb-backend/sql/migration/V20260819__ec_shop_logo_url.sql b/ecom-dmb-backend/sql/migration/V20260819__ec_shop_logo_url.sql new file mode 100644 index 00000000..19a14c99 --- /dev/null +++ b/ecom-dmb-backend/sql/migration/V20260819__ec_shop_logo_url.sql @@ -0,0 +1,3 @@ +-- 店铺 logo 外链:系统上传仍用 logo_image_id;查询时有 id 则覆盖 url;授权无内部图时回填 +ALTER TABLE `ec_shop` + ADD COLUMN `logo_url` varchar(512) NULL DEFAULT NULL COMMENT 'logo外链URL(渠道授权等;查询时有 logo_image_id 则覆盖)' AFTER `logo_image_id`; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/service/impl/PddAuthServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/service/impl/PddAuthServiceImpl.java index e1d66193..0136f59b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/service/impl/PddAuthServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/service/impl/PddAuthServiceImpl.java @@ -181,7 +181,7 @@ public class PddAuthServiceImpl implements PddAuthService { } upsertPddShop(companyId, auth.getId(), mallId, mallInfo, tokenResponse.getOwnerName()); - bindInternalShop(companyId, userId, shopId, mallId, mallInfo, tokenResponse.getOwnerName()); + bindInternalShop(companyId, userId, shopId, mallId, mallInfo); String shopName = firstNonBlank( mallInfo != null ? mallInfo.getMallName() : null, @@ -332,8 +332,7 @@ public class PddAuthServiceImpl implements PddAuthService { Long userId, Long shopId, Long mallId, - PddMallApiSnapshot mallInfo, - String ownerName) { + PddMallApiSnapshot mallInfo) { ShopPO shop = shopMapper.selectById(shopId); if (shop == null || !companyId.equals(shop.getCompanyId())) { throw new BusinessException("授权关联的内部店铺不存在或不属于当前公司"); @@ -361,11 +360,12 @@ public class PddAuthServiceImpl implements PddAuthService { } shop.setExternalShopId(externalShopId); - String mallName = firstNonBlank( - mallInfo != null ? mallInfo.getMallName() : null, - ownerName); - if (StringUtils.hasText(mallName)) { - shop.setName(mallName); + // 无系统内部 logo 时,用授权店铺 logo 填充外链(与商品渠道图口径一致) + if (shop.getLogoImageId() == null + && !StringUtils.hasText(shop.getLogoUrl()) + && mallInfo != null + && StringUtils.hasText(mallInfo.getLogo())) { + shop.setLogoUrl(mallInfo.getLogo().trim()); } shop.setUpdateBy(userId); shopMapper.updateById(shop); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/po/ShopPO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/po/ShopPO.java index 673dac74..9313977b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/po/ShopPO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/po/ShopPO.java @@ -38,6 +38,12 @@ public class ShopPO { @TableField("logo_image_id") private Long logoImageId; + /** + * logo 外链 URL(渠道授权等;查询时有 logo_image_id 则覆盖) + */ + @TableField("logo_url") + private String logoUrl; + /** * 平台代码(软约定,见 PlatformCode) */ diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java index 1f32e113..78ce6932 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java @@ -32,9 +32,9 @@ public class ShopVO { private String name; /** - * logo URL + * logo URL(有 logo_image_id 时为系统文件访问地址,否则为 logo_url 外链) */ - @Schema(description = "logo URL", example = "https://example.com/logo.jpg") + @Schema(description = "logo URL(有系统文件 id 时覆盖外链)", example = "https://example.com/logo.jpg") private String logo; /** diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/service/impl/ShopServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/service/impl/ShopServiceImpl.java index 5f9d343c..d4e2a16b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/service/impl/ShopServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/service/impl/ShopServiceImpl.java @@ -238,8 +238,15 @@ public class ShopServiceImpl extends ServiceImpl implements ShopVO shopVO = new ShopVO(); BeanCopyUtils.copyProperties(shop, shopVO); + // 有系统文件 id 则覆盖;否则用渠道外链 logo_url(与商品 mainImage 口径一致) if (shop.getLogoImageId() != null) { - shopVO.setLogo(sysFileService.getFileAccessUrl(shop.getLogoImageId())); + String accessUrl = sysFileService.getFileAccessUrl(shop.getLogoImageId()); + if (accessUrl != null && !accessUrl.isBlank()) { + shopVO.setLogo(accessUrl); + } + } + if (shopVO.getLogo() == null || shopVO.getLogo().isBlank()) { + shopVO.setLogo(shop.getLogoUrl()); } if (shop.getPlatformCode() != null && !shop.getPlatformCode().isBlank()) { shopVO.setPlatformName(PlatformCode.labelOf(shop.getPlatformCode())); diff --git a/ecom-dmb-frontend/apps/web-antd/src/preferences.ts b/ecom-dmb-frontend/apps/web-antd/src/preferences.ts index b1daae6d..9e815647 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/preferences.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/preferences.ts @@ -20,10 +20,10 @@ export const overridesPreferences = defineOverridesPreferences({ mode: 'light', }, transition: { - enable: false, - name: 'fade', + loading: false, + progress: false, }, logo: { source: '/cd-logo.png', }, -}); +}); \ No newline at end of file diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/list/components/PddOrderSyncDrawer.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/list/components/PddOrderSyncDrawer.vue index 7abd9991..f356a450 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/list/components/PddOrderSyncDrawer.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/list/components/PddOrderSyncDrawer.vue @@ -6,17 +6,22 @@ import type { Dayjs } from 'dayjs'; import { computed, onBeforeUnmount, ref } from 'vue'; import { + Alert, Button, + Card, DatePicker, + Descriptions, Drawer, Empty, Form, + List, Modal, Progress, Radio, Space, Switch, Tag, + Typography, message, } from 'ant-design-vue'; import dayjs from 'dayjs'; @@ -414,53 +419,61 @@ defineExpose({ open, close: handleClose }); :mask-closable="!hasActiveFullTask" @close="handleClose" > -
- -
-
- 增量同步 - {{ incHealthLabel }} -
-
- - 开启后定时 Job 拉取增量并转换 - -
-
-
游标:{{ formatTime(incremental?.lastCursorAt) }}
-
上次成功:{{ formatTime(incremental?.lastSuccessTime) }}
-
-

- {{ incremental.lastError }} -

-

- 手动增量按订单更新时间拉取自上次游标以来的变更,用于发货/售后等状态同步。 -

-
+ + + + + + + + 开启后定时 Job 拉取增量并转换 + + + - -
-
- 全量同步任务 + + + {{ formatTime(incremental?.lastCursorAt) }} + + + {{ formatTime(incremental?.lastSuccessTime) }} + + + + + + + + + + -
-
-
-
- #{{ task.id }} - - {{ statusTag(task.status).text }} - - - {{ task.doneDays }}/{{ task.totalDays }} 天 - - -
- + +