feat(pl): 三方粘贴识别批量提交接口

新增 paste-recognize/commit,事务内处理车/人冲突策略与关联写入。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-25 12:52:09 +08:00
1 parent b1e788e856
commit c60ebfc082
4 files changed
+438

No files matched your search

+44
View File
@@ -205,6 +205,50 @@ export const personnelCertOcrApi = {
request.post<PersonnelCertOcrResult>('/transport/ocr/recognize-cert', data)
}
export type PasteConflictAction = 'reuse' | 'overwrite' | 'cancel'
export type PasteRecognizeMode = 'vehicle_bundle' | 'personnel_first'
export interface PasteConflictItem {
key: 'vehicle' | 'driver' | 'escort'
existingId: string
action: PasteConflictAction
}
export interface PastePersonnelPayload {
personnelName: string
phoneNo?: string
idCardNo?: string
personnelType: 'driver' | 'escort'
}
export interface PasteVehiclePayload {
licensePlate: string
trailerNo?: string
loadCapacity?: number | null
carrierId: string
carrierName?: string
}
export interface PasteCommitBody {
mode: PasteRecognizeMode
createVehicle?: boolean
vehicle?: PasteVehiclePayload | null
driver?: PastePersonnelPayload | null
escort?: PastePersonnelPayload | null
conflicts?: PasteConflictItem[]
}
export interface PasteCommitResult {
vehicleId?: string | null
driverId?: string | null
escortId?: string | null
}
export const pasteRecognizeApi = {
commit: (data: PasteCommitBody) =>
request.post<PasteCommitResult>('/transport/paste-recognize/commit', data)
}
// 运输通用地址库
export interface TransportAddress {
id: string