wip: 数据导入

This commit is contained in:
ah--desktop
2025-11-04 23:16:24 +08:00
parent b0a4547e28
commit 5e0a085648
52 changed files with 1233 additions and 67 deletions
@@ -0,0 +1,33 @@
import type { ImportTaskDTO, ImportTaskVO } from './types';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
/**
* 导入任务管理API
*/
/**
* 创建导入任务
*/
export async function createImportTaskApi(
data: ImportTaskDTO.CreateImportTaskDTO,
) {
return requestClient.post<ImportTaskVO.ImportTaskInfoVO>(
'/ec/import-task/create',
data,
);
}
/**
* 分页获取导入任务列表
*/
export async function getImportTaskPageApi(
params: PageQueryDTO<ImportTaskDTO.ImportTaskFilterDTO>,
) {
return requestClient.post<PageResultVO<ImportTaskVO.ImportTaskInfoVO>>(
'/ec/import-task/page',
params,
);
}
@@ -0,0 +1,6 @@
/**
* 导入任务模块API导出
*/
export * from './apis';
export * from './types';
@@ -0,0 +1,6 @@
/**
* 导入任务模块类型定义导出
*/
export * from './types.dto';
export * from './types.vo';
@@ -0,0 +1,27 @@
/**
* 导入任务模块DTO类型定义
*/
export namespace ImportTaskDTO {
/** 创建导入任务参数 */
export interface CreateImportTaskDTO {
/** 导入类型(product-商品 order-订单) */
type: string;
/** 原始文件名 */
fileName: string;
/** 存储路径 */
filePath: string;
/** 字段映射记录(JSON字符串) */
mapping?: string;
}
/** 导入任务过滤条件 */
export interface ImportTaskFilterDTO {
/** 导入类型(product-商品 order-订单) */
type?: string;
/** 任务状态 */
status?: string;
/** 文件名(模糊查询) */
fileName?: string;
}
}
@@ -0,0 +1,39 @@
/**
* 导入任务模块VO类型定义
*/
export namespace ImportTaskVO {
/** 导入任务信息 */
export interface ImportTaskInfoVO {
/** 主键ID */
id: number;
/** 所属公司ID */
companyId?: number;
/** 导入类型(product-商品 order-订单) */
type: string;
/** 原始文件名 */
fileName: string;
/** 存储路径 */
filePath: string;
/** 任务状态 */
status: string;
/** 总行数 */
totalCount?: number;
/** 成功行数 */
successCount?: number;
/** 失败行数 */
failCount?: number;
/** 字段映射记录(JSON字符串) */
mapping?: string;
/** 错误信息或备注 */
message?: string;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 创建人ID */
createBy?: number;
/** 更新人ID */
updateBy?: number;
}
}