锁定缴费校验失败时整单回滚,避免样本半成功落库;前端禁止删除锁定缴费样本,改码走更正编码。同步落地样本更正、采集微信通知、OA提及未读、细胞产品套餐与相关迁移文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
export type SampleCodeCorrectionSource = 'cell_storage' | 'research_donation'
|
|
|
|
export interface SampleCodeCorrectionImpact {
|
|
table: string
|
|
label: string
|
|
count: number
|
|
}
|
|
|
|
export interface SampleCodeCorrectionPreview {
|
|
ok: boolean
|
|
blockers: string[]
|
|
receptionSource: SampleCodeCorrectionSource
|
|
oldSampleCode: string
|
|
newSampleCode: string
|
|
sampleId?: string | null
|
|
impacts: SampleCodeCorrectionImpact[]
|
|
totalAffectedRows: number
|
|
hints?: {
|
|
sameProductCodeAsOld?: number
|
|
sameProductCodeAsNew?: number
|
|
labStorageCodeUnchanged?: boolean
|
|
cellProductCodeNotAutoUpdated?: boolean
|
|
}
|
|
}
|
|
|
|
export interface SampleCodeCorrectionApplyResult {
|
|
ok: boolean
|
|
logId: string
|
|
receptionSource: SampleCodeCorrectionSource
|
|
oldSampleCode: string
|
|
newSampleCode: string
|
|
impactCounts: Record<string, number>
|
|
totalAffectedRows: number
|
|
hints?: SampleCodeCorrectionPreview['hints']
|
|
}
|
|
|
|
export function fetchPreviewSampleCodeCorrection(data: {
|
|
receptionSource: SampleCodeCorrectionSource
|
|
oldSampleCode: string
|
|
newSampleCode: string
|
|
newSampleCodeId?: string | null
|
|
reason?: string
|
|
}) {
|
|
return request.post<SampleCodeCorrectionPreview>({
|
|
url: '/web/admin/sample-code-corrections/preview',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchApplySampleCodeCorrection(data: {
|
|
receptionSource: SampleCodeCorrectionSource
|
|
oldSampleCode: string
|
|
newSampleCode: string
|
|
newSampleCodeId?: string | null
|
|
reason?: string
|
|
}) {
|
|
return request.post<SampleCodeCorrectionApplyResult>({
|
|
url: '/web/admin/sample-code-corrections/apply',
|
|
data
|
|
})
|
|
}
|