mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 19:09:19 +08:00
wip: 数据导入
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import type { BatchImportResultVO, OrderDTO, OrderVO } from './types';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 订单管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取订单列表
|
||||
*/
|
||||
export async function getOrderPageApi(params: PageQueryDTO<OrderDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<OrderVO.Info>>(
|
||||
'/ec/order/page',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
export async function createOrderApi(data: OrderDTO.Create) {
|
||||
return requestClient.post<OrderVO.Info>('/ec/order/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单
|
||||
*/
|
||||
export async function updateOrderApi(id: number, data: OrderDTO.Update) {
|
||||
return requestClient.put<OrderVO.Info>(`/ec/order/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function deleteOrderApi(id: number) {
|
||||
return requestClient.delete(`/ec/order/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
*/
|
||||
export async function getOrderByIdApi(id: number) {
|
||||
return requestClient.get<OrderVO.Info>(`/ec/order/detail/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入订单
|
||||
*/
|
||||
export async function batchImportOrdersApi(data: OrderDTO.BatchImport) {
|
||||
return requestClient.post<BatchImportResultVO.Info>(
|
||||
'/ec/order/batch-import',
|
||||
data,
|
||||
);
|
||||
}
|
||||
@@ -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,89 @@
|
||||
/**
|
||||
* 订单相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderDTO {
|
||||
/** 创建订单参数 */
|
||||
export interface Create {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
/** 销售单价 */
|
||||
unitPrice: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice: number;
|
||||
/** 成本小计 */
|
||||
costTotal: number;
|
||||
}
|
||||
|
||||
/** 更新订单参数 */
|
||||
export interface Update {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId?: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName?: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity?: number;
|
||||
/** 销售单价 */
|
||||
unitPrice?: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice?: number;
|
||||
/** 成本小计 */
|
||||
costTotal?: number;
|
||||
}
|
||||
|
||||
/** 订单过滤条件 */
|
||||
export interface Filters {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId?: number;
|
||||
/** 订单编号(模糊查询) */
|
||||
orderNumber?: string;
|
||||
/** 商品名称(模糊查询) */
|
||||
productName?: string;
|
||||
}
|
||||
|
||||
/** 批量导入订单参数 */
|
||||
export interface BatchImport {
|
||||
/** 订单列表 */
|
||||
orders: Create[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* 订单相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderVO {
|
||||
/** 订单信息 */
|
||||
export interface Info {
|
||||
/** 订单ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 订单状态名称 */
|
||||
statusName: string;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
/** 销售单价 */
|
||||
unitPrice: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice: number;
|
||||
/** 成本小计 */
|
||||
costTotal: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入结果相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace BatchImportResultVO {
|
||||
/** 批量导入结果 */
|
||||
export interface Info {
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 成功数量 */
|
||||
successCount: number;
|
||||
/** 失败数量 */
|
||||
failureCount: number;
|
||||
/** 失败详情 */
|
||||
failureDetails: string[];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user