feat(shipping-notice): 增强发货通知候选管理功能,支持候选选择、重复检测与业务摘要修订
This commit is contained in:
1 parent
70f684b94a
commit
b595e157e9
83 files changed
+5857
-200
No files matched your search
@@ -120,6 +120,7 @@ export interface ShippingUploadHandlerContext {
|
||||
msg: { warning: (text: string) => void };
|
||||
t: (key: string, params?: Record<string, unknown>) => string;
|
||||
getParsedIntakeNos?: () => string[];
|
||||
getSelectedCandidateNos?: () => string[];
|
||||
clearConsumedNoticeAttachments?: () => void;
|
||||
}
|
||||
|
||||
@@ -310,14 +311,14 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
|
||||
return ok;
|
||||
};
|
||||
|
||||
const runNoticeBatchFromIntakes = async (intakeNos: string[]) => {
|
||||
const runNoticeBatchFromIntakes = async (intakeNos: string[], candidateNos: string[]) => {
|
||||
if (noticeBatchSubmitting) {
|
||||
return true;
|
||||
}
|
||||
noticeBatchSubmitting = true;
|
||||
try {
|
||||
const conversationKey = normalizeConversationId(ctx.conversationId.value);
|
||||
const intakeFingerprint = computeNoticeIntakeNosFingerprint(intakeNos);
|
||||
const intakeFingerprint = computeNoticeIntakeNosFingerprint([...intakeNos, ...candidateNos]);
|
||||
if (pendingNoticeBatchRetry) {
|
||||
reconcilePendingNoticeBatchConversation(pendingNoticeBatchRetry, conversationKey);
|
||||
}
|
||||
@@ -337,7 +338,12 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
|
||||
pendingNoticeBatchRetry.fileFingerprint = intakeFingerprint;
|
||||
}
|
||||
const idempotencyKey = pendingNoticeBatchRetry.idempotencyKey;
|
||||
const turn = buildShippingCreateBatchFromIntakesTurn(intakeNos, ctx.conversationId.value, idempotencyKey);
|
||||
const turn = buildShippingCreateBatchFromIntakesTurn(
|
||||
intakeNos,
|
||||
ctx.conversationId.value,
|
||||
idempotencyKey,
|
||||
candidateNos,
|
||||
);
|
||||
const ok = await ctx.startChatTurn({
|
||||
agentId: ctx.currentAgentId.value,
|
||||
inputType: 'upload_followup',
|
||||
@@ -402,8 +408,9 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
|
||||
const handleShippingAutoUploadNoticeBatch = async (files: File[]) => {
|
||||
const noticeFiles = files.filter(Boolean);
|
||||
const intakeNos = ctx.getParsedIntakeNos?.() || [];
|
||||
const candidateNos = ctx.getSelectedCandidateNos?.() || [];
|
||||
if (!noticeFiles.length && intakeNos.length) {
|
||||
await runNoticeBatchFromIntakes(intakeNos);
|
||||
await runNoticeBatchFromIntakes(intakeNos, candidateNos);
|
||||
return;
|
||||
}
|
||||
if (!noticeFiles.length) return;
|
||||
|
||||
Reference in new issue
Block a user