feat: add recruitment fair participant export
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-23 18:35:18 +08:00
parent 4ae042dd76
commit 5faf09c467
6 changed files with 385 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile';
import type { RecruitmentFairExportParams } from './recruitmentFairExport';
const BASE_URL = '/api/cms/publicJobFair';
@@ -227,6 +228,10 @@ export async function getJobFairCompanies(jobFairId: string) {
}
/** 导出招聘会 */
export async function exportPublicJobFair(params?: API.PublicJobFair.ListParams) {
return downLoadXlsx(`${BASE_URL}/export`, { params }, `job_fair_${new Date().getTime()}.xlsx`);
export async function exportPublicJobFair(params: RecruitmentFairExportParams) {
return downLoadXlsx(
`${BASE_URL}/export`,
{ params },
`online_fair_participants_${new Date().getTime()}.xlsx`,
);
}

View File

@@ -0,0 +1,37 @@
import { downLoadXlsx } from '@/utils/downloadfile';
export type RecruitmentFairExportType = 'companies' | 'jobs' | 'companyJobs';
export interface RecruitmentFairExportParams {
exportType: RecruitmentFairExportType;
title?: string;
hostUnit?: string;
fairType?: string;
region?: string;
venueId?: number;
venueName?: string;
address?: string;
startTime?: string;
endTime?: string;
applyStartTime?: string;
applyEndTime?: string;
createStartTime?: string;
createEndTime?: string;
fairStatus?: 'NOT_STARTED' | 'ONGOING' | 'ENDED';
isCrossDomain?: string;
onlineApply?: boolean;
reviewStatus?: '0' | '1' | '2';
}
export type RecruitmentFairExportChannel = 'online' | 'outdoor';
/** 下载线上/户外招聘会参会数据 Excel。 */
export function exportRecruitmentFair(
channel: RecruitmentFairExportChannel,
params: RecruitmentFairExportParams,
) {
const endpoint =
channel === 'online' ? '/api/cms/publicJobFair/export' : '/api/cms/outdoor-fair/export';
const filePrefix = channel === 'online' ? 'online_fair' : 'outdoor_fair';
return downLoadXlsx(endpoint, { params }, `${filePrefix}_participants_${Date.now()}.xlsx`);
}

View File

@@ -1,5 +1,7 @@
import { request } from '@umijs/max';
import type { VenueBoothItem } from './venueInfo';
import { downLoadXlsx } from '@/utils/downloadfile';
import type { RecruitmentFairExportParams } from '@/services/jobfair/recruitmentFairExport';
/** 户外招聘会列表项 */
export interface OutdoorFairItem {
@@ -24,11 +26,11 @@ export interface OutdoorFairItem {
reservedBoothCount?: number;
/** 举办时间 */
holdTime: string;
/** 截止时间 */
/** 招聘会结束时间 */
endTime: string;
/** 开放申请 */
/** 报名开始时间 */
applyStartTime: string;
/** 截止申请 */
/** 报名截止时间 */
applyEndTime: string;
/** 是否开启线上申请 */
onlineApply: boolean;
@@ -188,6 +190,15 @@ export async function getOutdoorFairList(params?: OutdoorFairListParams) {
});
}
/** 导出户外招聘会参会企业/岗位。 */
export async function exportOutdoorFair(params: RecruitmentFairExportParams) {
return downLoadXlsx(
`${CMS_OUTDOOR_FAIR_BASE}/export`,
{ params },
`outdoor_fair_participants_${new Date().getTime()}.xlsx`,
);
}
/**
* 获取户外招聘会详情
* GET /api/cms/outdoor-fair/{id}