| | |
| | | startDate?: string |
| | | endDate?: string |
| | | } |
| | | export function getMerchantSettlement(kind: 'onboardings' | 'bank-cards' | 'withdrawals', params: MerchantSettlementQuery = {}) { return http.get<PageResult<any>, PageResult<any>>(`/api/admin/management/merchant-settlement/${kind}`, { params }) } |
| | | export function getMerchantSettlement(kind: 'onboardings' | 'bank-cards', params: MerchantSettlementQuery = {}) { return http.get<PageResult<any>, PageResult<any>>(`/api/admin/management/merchant-settlement/${kind}`, { params }) } |
| | | /** 商家类型筛选项:取自后端目录,避免前端另抄一份而与库里的取值失配。拉不到就先留空,不打扰用户。 */ |
| | | export function getMerchantSettlementMerchantTypes() { return http.get<string[], string[]>('/api/admin/management/merchant-settlement/merchant-types', { silent: true }) } |
| | | /** 结算记录直接来自斗拱:按结算日期区间返回真实结算流水,用于监控每天自动结算了多少到银行卡。 */ |
| | | export function getMerchantSettlements(params: { beginDate?: string; endDate?: string; size?: number; merchantName?: string; contactMobile?: string; merchantType?: string; status?: string } = {}) { |
| | | return http.get<{ records: Record<string, any>[]; total: number; failures: string[] }, { records: Record<string, any>[]; total: number; failures: string[] }>('/api/admin/management/merchant-settlement/settlements', { params }) |
| | | } |
| | | export function getMerchantOnboardingDetail(id: number | string) { return http.get<Record<string, any>, Record<string, any>>(`/api/admin/management/merchant-settlement/onboardings/${id}`) } |
| | | export function reviewMerchantSettlement(kind: 'onboardings' | 'bank-cards' | 'withdrawals', id: number | string, status: string, reason = '', providerValue = '') { const body: Record<string, string> = { status, reason }; if (kind === 'onboardings') body.huifuId = providerValue; if (kind === 'bank-cards') body.tokenNo = providerValue; return http.patch<any, any>(`/api/admin/management/merchant-settlement/${kind}/${id}`, body) } |
| | | export function refreshMerchantOnboarding(id: number | string, retry = false) { return http.post<Record<string, any>, Record<string, any>>(`/api/admin/management/merchant-settlement/onboardings/${id}/progress/refresh`, null, { params: { retry } }) } |
| | | // 微信实名认证:平台运营代为发起。未决申请不会重复提交,retry 只对通道已明确驳回时有意义。 |
| | | export function submitMerchantRealname(id: number | string, retry = false) { return http.post<Record<string, any>, Record<string, any>>(`/api/admin/management/merchant-settlement/onboardings/${id}/realname`, null, { params: { retry } }) } |
| | | |
| | | export interface ManagedOnboardingPayload { |
| | | merchantId: number | string |
| | | providerHuifuId: string |
| | | providerApplyNo?: string |
| | | confirmed?: boolean |
| | | } |
| | | /** |
| | | * 纳管前置核验:用我们自己的签名身份只读查一次该商户,把运营要人工核对的商户注册名称、商户简称、 |
| | | * 主体类型与结算卡取回来。通道查不到会明确报错(该商户不在我们渠道商的管辖范围内)。 |
| | | */ |
| | | export function previewManagedOnboarding(payload: ManagedOnboardingPayload) { |
| | | return http.post<Record<string, any>, Record<string, any>>('/api/admin/management/merchant-settlement/onboardings/managed/preview', payload) |
| | | } |
| | | /** |
| | | * 纳管:把已在汇付侧完成进件的外部商户接到我方某个商家上。confirmed 是运营肉眼核对通道名称后的 |
| | | * 显式确认,后端要求它为真才受理——名称不做字符串判定,那个确认框就是防绑错的人工闸门。 |
| | | */ |
| | | export function adoptManagedOnboarding(payload: ManagedOnboardingPayload & { providerApplyNo: string; confirmed: boolean }) { |
| | | return http.post<Record<string, any>, Record<string, any>>('/api/admin/management/merchant-settlement/onboardings/managed', payload) |
| | | } |
| | | /** |
| | | * 解绑:只解除我方绑定,清理这条纳管产生的进件与结算卡记录,**不回退通道侧的任何改动**。 |
| | | * 该商户号上还有在途订单或待结算资金时后端会拒绝并给出原因。 |
| | | */ |
| | | export function unbindManagedOnboarding(id: number | string) { |
| | | return http.post<Record<string, any>, Record<string, any>>(`/api/admin/management/merchant-settlement/onboardings/${id}/unbind`) |
| | | } |
| | | |
| | | export function getAdminNews(params: NewsArticleQuery = {}) { |
| | | return http.get<PageResult<NewsArticle>, PageResult<NewsArticle>>('/api/admin/business/news', { params }) |
| | |
| | | |
| | | export function updateTalentLevel(id: number | string, talentLevel: string) { |
| | | return http.patch<Talent, Talent>(`/api/talents/${id}/card-level`, { talentLevel }) |
| | | } |
| | | |
| | | /** 游客(无人才卡)补录信息并升级为持卡人:补认证信息 + 选等级 + 发卡。 */ |
| | | export function upgradeTalent( |
| | | id: number | string, |
| | | payload: Pick<TalentPayload, 'name' | 'idCardNo' | 'gender' | 'workUnit' | 'talentLevel' | 'talentCardNo' | 'sourceAreaType' | 'workAddress' | 'contactAddress'>, |
| | | ) { |
| | | return http.post<Talent, Talent>(`/api/talents/${id}/upgrade`, payload) |
| | | } |
| | | |
| | | export function getTalentAdvisors() { |
| | |
| | | |
| | | export function getAdminProducts(params: ProductQuery = {}) { |
| | | return http.get<PageResult<Product>, PageResult<Product>>('/api/admin/business/products', { params }) |
| | | } |
| | | |
| | | // 商家编辑页面的团单列表按商品维度返回(一条团单一行),修改团单不会多出一行待审核记录。 |
| | | export function getAdminMerchantProducts(merchantId: number | string, params: ProductQuery = {}) { |
| | | return http.get<PageResult<Product>, PageResult<Product>>(`/api/admin/business/merchants/${merchantId}/products`, { params }) |
| | | } |
| | | |
| | | export function getAdminProductDetail(id: number | string) { |
| | |
| | | |
| | | export function getRefundRecords(params: RefundQuery = {}) { |
| | | return http.get<PageResult<RefundRecord>, PageResult<RefundRecord>>('/api/orders/refunds', { params }) |
| | | } |
| | | |
| | | // 刷新一笔退款的状态:退款通知和支付通知一样可能到不了,线上排查时不必干等定时任务或手写 SQL。 |
| | | export function refreshRefundStatus(refundNo: string) { |
| | | return http.post<RefundRecord, RefundRecord>(`/api/orders/refunds/${refundNo}/query`) |
| | | } |
| | | |
| | | // 查询通道状态:重新读一次斗拱侧的收款能力快照。进件通过后新增的结算卡也靠这条路径收敛为已批准。 |
| | | export function refreshMerchantPaymentCapability(id: number | string) { |
| | | return http.post<Record<string, any>, Record<string, any>>( |
| | | `/api/admin/management/merchant-settlement/onboardings/${id}/payment-capability/refresh`, |
| | | ) |
| | | } |
| | | |
| | | // 立即对账:人工触发一次**真实**的对账(待支付流水向通道确认 + 在途退款收敛)。 |
| | | // 给收不到回调的环境用:它走的是与定时任务完全相同的逻辑,不是「跳过真实通道」的捷径。 |
| | | export function runPaymentReconciliation(pendingAfterMinutes = 5) { |
| | | return http.post<Record<string, any>, Record<string, any>>('/api/admin/management/payment-reconciliation/run', null, { |
| | | params: { pendingAfterMinutes }, |
| | | }) |
| | | } |
| | | |
| | | export function getVerificationRecords(params: VerificationQuery = {}) { |
| | |
| | | return http.get<AnyRecord, AnyRecord>(`/api/admin/ticket-packages/${packageId}`) |
| | | } |
| | | |
| | | // 票包表单的「适用商家」下拉:走票包自己的只读接口,避免要求「商家查询」权限。 |
| | | export function getTicketPackageMerchantOptions(params: AnyRecord = {}) { |
| | | return http.get<AnyRecord[], AnyRecord[]>('/api/admin/ticket-packages/merchant-options', { params }) |
| | | } |
| | | |
| | | export function createTicketPackage(payload: AnyRecord) { |
| | | return http.post<AnyRecord, AnyRecord>('/api/admin/ticket-packages', payload) |
| | | } |
| | |
| | | return http.get<PageResult<AnyRecord>, PageResult<AnyRecord>>('/api/admin/ticket-packages/claims', { params }) |
| | | } |
| | | |
| | | export function getTicketPackageVerifications(params: AnyRecord = {}) { |
| | | return http.get<PageResult<AnyRecord>, PageResult<AnyRecord>>('/api/admin/ticket-packages/verifications', { params }) |
| | | } |
| | | |
| | | export function supplementTicketPackageClaim(payload: AnyRecord) { |
| | | return http.post<AnyRecord, AnyRecord>('/api/admin/ticket-packages/claims/supplement', payload) |
| | | } |