This commit is contained in:
ah--desktop
2025-12-11 08:04:56 +08:00
parent a3b8797955
commit 5129657f7f
69 changed files with 1695 additions and 545 deletions
@@ -50,21 +50,29 @@ export async function uploadShopLogoApi(file: File) {
}
/**
* 精准查询API - 用于数据导入
* 获取店铺当月统计信息
*/
/**
* 根据名称精准查询店铺
*/
export async function getShopByNameApi(name: string) {
return requestClient.get<ShopVO.Info>(
`/ec/shop/find-by-name/${encodeURIComponent(name)}`,
export async function getShopCurrentMonthStatisticsApi(id: number) {
return requestClient.get<ShopVO.Statistics>(
`/ec/shop/statistics/current-month/${id}`,
);
}
/**
* 批量根据名称查询店铺
* 获取店铺统计信息
*/
export async function getShopsByNamesApi(names: string[]) {
return requestClient.post<ShopVO.Info[]>('/ec/shop/find-by-names', names);
export async function getShopStatisticsApi(params: ShopDTO.StatisticsQuery) {
return requestClient.post<ShopVO.Statistics>('/ec/shop/statistics', params);
}
/**
* 分页获取店铺商品详细信息
*/
export async function getShopProductPageApi(
params: PageQueryDTO<ShopDTO.ProductFilters>,
) {
return requestClient.post<PageResultVO<ShopVO.ProductDetail>>(
'/ec/shop/products/page',
params,
);
}
@@ -30,4 +30,26 @@ export namespace ShopDTO {
/** 平台 */
platform?: string;
}
/** 店铺统计查询参数 */
export interface StatisticsQuery {
/** 店铺ID */
shopId: number;
/** 开始日期 */
startDate: string;
/** 结束日期 */
endDate: string;
}
/** 店铺商品过滤条件 */
export interface ProductFilters {
/** 店铺ID */
shopId: number;
/** 商品名称(模糊查询) */
productName?: string;
/** 商品编码(模糊查询) */
productCode?: string;
/** 统计日期(不传默认为当日) */
statDate?: string;
}
}
@@ -26,4 +26,48 @@ export namespace ShopVO {
/** 更新人ID */
updateBy?: number;
}
/** 店铺统计信息 */
export interface Statistics {
/** 销售额(商家实收金额总和) */
salesAmount: number;
/** 订单数 */
orderCount: number;
/** 客单价(销售额/订单数) */
averageOrderValue: number;
/** 成本(成本价*数量总和) */
costAmount: number;
/** 退款金额(已退款订单的实收金额总和) */
refundAmount: number;
/** 推广费 */
promotionFee: number;
/** 费比(推广费/销售额) */
feeRatio: number;
}
/** 店铺商品详细信息 */
export interface ProductDetail {
/** 商品ID */
productId: number;
/** 商品名称 */
productName: string;
/** 商品编码 */
productCode?: string;
/** 主图URL */
mainImage?: string;
/** 关联ID */
relationId: number;
/** 排序 */
sortOrder: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 销售额(商家实收金额总和) */
salesAmount: number;
/** 订单数 */
orderCount: number;
/** 客单价(销售额/订单数) */
averageOrderValue: number;
}
}