mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:59:19 +08:00
feat: 导入任务列表接口返回店铺名称,下拉项显示店铺信息
后端: - ImportTaskVO 新增 shopName 字段 - ImportTaskServiceImpl.convertToVO() 查询店铺名称填充 前端: - ImportTaskVO 类型定义补充 shopName - ImportTaskDropdown 任务项显示店铺名称
This commit is contained in:
+6
@@ -30,6 +30,12 @@ public class ImportTaskVO {
|
||||
@Schema(description = "所属店铺ID", example = "1")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 所属店铺名称
|
||||
*/
|
||||
@Schema(description = "所属店铺名称", example = "旗舰店")
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 导入类型(product-商品 order-订单)
|
||||
*/
|
||||
|
||||
+13
-1
@@ -18,6 +18,8 @@ import top.xyquan.ecomdmbbackend.modules.ecom.importtask.model.po.ImportTaskPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.importtask.model.vo.ImportTaskVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.importtask.service.ImportTaskQueueService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.importtask.service.ImportTaskService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.shop.model.po.ShopPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.shop.service.ShopService;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -31,15 +33,19 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class ImportTaskServiceImpl extends ServiceImpl<ImportTaskMapper, ImportTaskPO> implements ImportTaskService {
|
||||
|
||||
private final ShopService shopService;
|
||||
|
||||
|
||||
|
||||
private final CurrentUserContext currentUserContext;
|
||||
private final ImportTaskQueueService importTaskQueueService;
|
||||
|
||||
public ImportTaskServiceImpl(CurrentUserContext currentUserContext,
|
||||
ImportTaskQueueService importTaskQueueService) {
|
||||
ImportTaskQueueService importTaskQueueService,
|
||||
ShopService shopService) {
|
||||
this.currentUserContext = currentUserContext;
|
||||
this.importTaskQueueService = importTaskQueueService;
|
||||
this.shopService = shopService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,6 +140,12 @@ public class ImportTaskServiceImpl extends ServiceImpl<ImportTaskMapper, ImportT
|
||||
private ImportTaskVO convertToVO(ImportTaskPO importTaskPO) {
|
||||
ImportTaskVO importTaskVO = new ImportTaskVO();
|
||||
BeanUtils.copyProperties(importTaskPO, importTaskVO);
|
||||
if (importTaskPO.getShopId() != null) {
|
||||
ShopPO shop = shopService.getById(importTaskPO.getShopId());
|
||||
if (shop != null) {
|
||||
importTaskVO.setShopName(shop.getName());
|
||||
}
|
||||
}
|
||||
return importTaskVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ export namespace ImportTaskVO {
|
||||
companyId?: number;
|
||||
/** 所属店铺ID */
|
||||
shopId?: number;
|
||||
/** 所属店铺名称 */
|
||||
shopName?: string;
|
||||
/** 导入类型(product-商品 order-订单) */
|
||||
type: string;
|
||||
/** 原始文件名 */
|
||||
|
||||
@@ -218,9 +218,10 @@ onUnmounted(() => {
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<!-- 任务类型 -->
|
||||
<div class="text-xs text-gray-400">
|
||||
类型: {{ item.type === 'order' ? '订单导入' : '商品导入' }}
|
||||
<!-- 任务类型和店铺 -->
|
||||
<div class="flex items-center gap-3 text-xs text-gray-400">
|
||||
<span>类型: {{ item.type === 'order' ? '订单导入' : '商品导入' }}</span>
|
||||
<span v-if="item.shopName">店铺: {{ item.shopName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</List.Item>
|
||||
|
||||
Reference in New Issue
Block a user