This commit is contained in:
ah--desktop
2026-01-07 08:30:05 +08:00
parent 914a9345db
commit e1f39c1815
19 changed files with 1306 additions and 224 deletions
@@ -4,3 +4,4 @@
export * from './types.dto';
export * from './types.vo';
export * from './types.enum';
@@ -1,3 +1,5 @@
import type { ImportMappingType } from './types.enum';
/**
* 导入映射模块DTO类型定义
*/
@@ -5,8 +7,8 @@
export namespace ImportMappingDTO {
/** 创建导入映射参数 */
export interface CreateImportMappingDTO {
/** 导入类型(product-商品 order-订单) */
type: string;
/** 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态) */
type: ImportMappingType;
/** 映射名称 */
name: string;
/** 字段映射(JSON格式) */
@@ -23,8 +25,8 @@ export namespace ImportMappingDTO {
/** 导入映射过滤条件 */
export interface ImportMappingFilterDTO {
/** 导入类型(product-商品 order-订单) */
type?: string;
/** 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态) */
type?: ImportMappingType;
/** 映射名称(模糊查询) */
name?: string;
}
@@ -0,0 +1,29 @@
/**
* 导入映射类型枚举
*/
export enum ImportMappingType {
/** 商品 */
PRODUCT = 'PRODUCT',
/** 订单 */
ORDER = 'ORDER',
/** 订单状态 */
ORDER_STATUS = 'ORDER_STATUS',
}
/**
* 导入映射类型选项配置
*/
export const IMPORT_MAPPING_TYPE_OPTIONS = [
{ label: '商品', value: ImportMappingType.PRODUCT },
{ label: '订单', value: ImportMappingType.ORDER },
{ label: '订单状态', value: ImportMappingType.ORDER_STATUS },
];
/**
* 根据导入映射类型枚举值获取中文名称
*/
export function getImportMappingTypeName(type: ImportMappingType): string {
const option = IMPORT_MAPPING_TYPE_OPTIONS.find((opt) => opt.value === type);
return option?.label || '未知类型';
}
@@ -1,3 +1,5 @@
import type { ImportMappingType } from './types.enum';
/**
* 导入映射模块VO类型定义
*/
@@ -9,8 +11,8 @@ export namespace ImportMappingVO {
id: number;
/** 所属公司ID */
companyId?: number;
/** 导入类型(product-商品 order-订单) */
type: string;
/** 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态) */
type: ImportMappingType;
/** 映射名称 */
name: string;
/** 字段映射(JSON格式) */
@@ -10,40 +10,42 @@ import { requestClient } from '#/api/request';
* 创建订单状态
*/
export async function createOrderStatusApi(data: OrderStatusDTO.Create) {
return requestClient.post<number>('/ec/order-status', data);
return requestClient.post<OrderStatusVO.Info>(
'/ec/order-status/create',
data,
);
}
/**
* 更新订单状态
*/
export async function updateOrderStatusApi(data: OrderStatusDTO.Update) {
return requestClient.put('/ec/order-status', data);
export async function updateOrderStatusApi(
id: number,
data: OrderStatusDTO.Update,
) {
return requestClient.put<OrderStatusVO.Info>(
`/ec/order-status/update/${id}`,
data,
);
}
/**
* 删除订单状态
*/
export async function deleteOrderStatusApi(id: number) {
return requestClient.delete(`/ec/order-status/${id}`);
}
/**
* 获取订单状态详情
*/
export async function getOrderStatusByIdApi(id: number) {
return requestClient.get<OrderStatusVO.Info>(`/ec/order-status/${id}`);
}
/**
* 获取启用的订单状态列表
*/
export async function getActiveOrderStatusListApi() {
return requestClient.get<OrderStatusVO.Info[]>('/ec/order-status/active');
return requestClient.delete(`/ec/order-status/delete/${id}`);
}
/**
* 获取所有订单状态列表
*/
export async function getAllOrderStatusListApi() {
return requestClient.get<OrderStatusVO.Info[]>('/ec/order-status/all');
return requestClient.get<OrderStatusVO.Info[]>('/ec/order-status/list');
}
/**
* 获取订单状态详情
*/
export async function getOrderStatusByIdApi(id: number) {
return requestClient.get<OrderStatusVO.Info>(`/ec/order-status/detail/${id}`);
}
@@ -5,27 +5,25 @@
export namespace OrderStatusDTO {
/** 创建订单状态参数 */
export interface Create {
/** 状态名称 */
/** 状态名称(中文) */
statusName: string;
/** 状态描述 */
description?: string;
/** 排序 */
sortOrder?: number;
/** 是否启用 0禁用 1启用 */
isActive?: number;
/** 是否默认参与统计 0不参与 1参与 */
isDefaultStat: number;
}
/** 更新订单状态参数 */
export interface Update {
/** 状态ID */
id: number;
/** 状态名称 */
/** 状态名称(中文) */
statusName: string;
/** 状态描述 */
description?: string;
/** 排序 */
sortOrder?: number;
/** 是否启用 0禁用 1启用 */
isActive?: number;
/** 是否默认参与统计 0不参与 1参与 */
isDefaultStat: number;
}
}
@@ -5,20 +5,18 @@
export namespace OrderStatusVO {
/** 订单状态信息 */
export interface Info {
/** 状态ID */
/** 订单状态ID */
id: number;
/** 公司ID */
companyId: number;
/** 状态码 */
statusCode: number;
/** 状态名称 */
companyId?: number;
/** 状态名称(中文) */
statusName: string;
/** 状态描述 */
description?: string;
/** 排序 */
sortOrder?: number;
/** 是否启用 0禁用 1启用 */
isActive: number;
/** 是否默认参与统计 0不参与 1参与 */
isDefaultStat: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
@@ -4,3 +4,4 @@
export * from './types.dto';
export * from './types.vo';
export * from './types.enum';
@@ -14,15 +14,15 @@ export namespace OrderDTO {
/** 商家实收金额 */
receivedAmount: number;
/** 下单时间 */
orderDate: string;
orderTime: string;
/** 商品ID */
productId: number;
/** 商品规格ID */
productSpecId?: number;
/** 商品名称(冗余存储) */
productName: string;
/** 规格名称(冗余存储) */
specName?: string;
/** 链接商品名称(冗余存储) */
linkProductName: string;
/** 链接规格名称(冗余存储) */
linkSpecName?: string;
/** 数量 */
quantity: number;
/** 销售单价 */
@@ -42,15 +42,15 @@ export namespace OrderDTO {
/** 商家实收金额 */
receivedAmount: number;
/** 下单时间 */
orderDate: string;
orderTime: string;
/** 商品ID */
productId?: number;
/** 商品规格ID */
productSpecId?: number;
/** 商品名称(冗余存储) */
productName?: string;
/** 规格名称(冗余存储) */
specName?: string;
/** 链接商品名称(冗余存储) */
linkProductName?: string;
/** 链接规格名称(冗余存储) */
linkSpecName?: string;
/** 数量 */
quantity?: number;
/** 销售单价 */
@@ -72,9 +72,9 @@ export namespace OrderDTO {
/** 实收金额范围-最大值 */
maxReceivedAmount?: number;
/** 下单时间范围-开始时间 */
startOrderDate?: string;
startOrderTime?: string;
/** 下单时间范围-结束时间 */
endOrderDate?: string;
endOrderTime?: string;
}
/** 批量导入订单参数 */
@@ -0,0 +1,41 @@
/**
* 订单状态枚举
*/
export enum OrderStatus {
/** 未知状态 */
UNKNOWN = 'UNKNOWN',
/** 待发货 */
PENDING_SHIPMENT = 'PENDING_SHIPMENT',
/** 已发货 */
SHIPPED = 'SHIPPED',
/** 已完成 */
COMPLETED = 'COMPLETED',
/** 已取消 */
CANCELLED = 'CANCELLED',
/** 退款中 */
REFUNDING = 'REFUNDING',
/** 已退款 */
REFUNDED = 'REFUNDED',
}
/**
* 订单状态选项配置
*/
export const ORDER_STATUS_OPTIONS = [
{ label: '未知状态', value: OrderStatus.UNKNOWN },
{ label: '待发货', value: OrderStatus.PENDING_SHIPMENT },
{ label: '已发货', value: OrderStatus.SHIPPED },
{ label: '已完成', value: OrderStatus.COMPLETED },
{ label: '已取消', value: OrderStatus.CANCELLED },
{ label: '退款中', value: OrderStatus.REFUNDING },
{ label: '已退款', value: OrderStatus.REFUNDED },
];
/**
* 根据订单状态枚举值获取中文名称
*/
export function getOrderStatusName(status: OrderStatus): string {
const option = ORDER_STATUS_OPTIONS.find((opt) => opt.value === status);
return option?.label || '未知状态';
}
@@ -17,12 +17,12 @@ export namespace OrderVO {
platformOrderNo: string;
/** 订单状态ID */
statusId: number;
/** 订单状态名称 */
/** 订单状态名称(中文) */
statusName: string;
/** 商家实收金额 */
receivedAmount: number;
/** 下单时间 */
orderDate: string;
orderTime: string;
/** 创建时间 */
createTime: string;
/** 更新时间 */
@@ -35,10 +35,10 @@ export namespace OrderVO {
productId: number;
/** 商品规格ID */
productSpecId?: number;
/** 商品名称(冗余存储) */
productName: string;
/** 规格名称(冗余存储) */
specName?: string;
/** 链接商品名称(冗余存储) */
linkProductName: string;
/** 链接规格名称(冗余存储) */
linkSpecName?: string;
/** 数量 */
quantity: number;
/** 销售单价 */