feat(shipping-notice): 增强订单文档 Profile 管理功能,新增复核与草稿管理
- 添加订单复核相关模型及 API,支持复核案例的创建、更新和确认 - 实现复核草稿的管理功能,允许用户对复核内容进行编辑和保存 - 引入复核事件审计,确保复核过程的可追溯性 - 更新数据库模型以支持复核和草稿的关系管理 - 完善相关服务逻辑,确保复核与草稿的状态管理和数据一致性 - 增强文档模板的管理能力,支持更复杂的业务场景
This commit is contained in:
1 parent
61ac6403c4
commit
b7307fc573
147 files changed
+15108
-1522
No files matched your search
@@ -41,16 +41,16 @@ const ACTIVE_ORDER_EXTRACTION = new Set(['extracting']);
|
||||
* 判断服务端 Intake 是否应恢复到输入栏。
|
||||
* AI 触发时机:无;页面刷新或重新打开会话时调用。
|
||||
* 上传快览与发送授权已拆分:未发送但已快览成功的附件,刷新后也必须恢复到输入栏;
|
||||
* 已进入订单抽取终态的附件仅保留在消息气泡中,避免把旧批次误带回当前输入框。
|
||||
* 已进入订单抽取终态(包括待人工复核)的附件仅保留在消息气泡和结果卡中,
|
||||
* 避免把已发送的旧批次误带回当前输入框。
|
||||
* @param parseStatus - 服务端返回的预解析状态。
|
||||
* @param orderExtractionStatus - 服务端返回的订单抽取状态。
|
||||
* @param candidateCount - 当前仍可审核的订单 Candidate 数量。
|
||||
* @returns 是否恢复为待发送附件卡片
|
||||
*/
|
||||
export function shouldRestoreShippingNoticeIntake(
|
||||
parseStatus: string | null | undefined,
|
||||
orderExtractionStatus?: string | null,
|
||||
candidateCount = 0,
|
||||
_candidateCount = 0,
|
||||
parseSummary?: ShippingNoticePendingAttachment['parseSummary'],
|
||||
): boolean {
|
||||
const status = String(parseStatus || '').trim().toLowerCase();
|
||||
@@ -62,8 +62,7 @@ export function shouldRestoreShippingNoticeIntake(
|
||||
&& (!extractionStatus || extractionStatus === 'not_started')
|
||||
&& !isShippingNoticeAttachmentParseIncomplete(parseSummary)
|
||||
)
|
||||
|| extractionStatus === 'failed'
|
||||
|| (extractionStatus === 'partially_completed' && candidateCount > 0);
|
||||
|| extractionStatus === 'failed';
|
||||
}
|
||||
|
||||
/** 判断 Intake 是否仍需轮询上传预处理或订单抽取状态。 */
|
||||
@@ -582,19 +581,6 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
}
|
||||
};
|
||||
|
||||
/** 保存 Candidate 人工修订后的订单摘要。 */
|
||||
const updateCandidateSummary = async (candidateNo: string, businessSummary: Record<string, unknown>) => {
|
||||
const remote = await updateShippingNoticeCandidate(candidateNo, { business_summary: businessSummary });
|
||||
for (const attachment of noticeAttachments.value) {
|
||||
if (!(attachment.candidates || []).some((item) => item.candidateNo === candidateNo)) continue;
|
||||
patchAttachment(attachment.id, {
|
||||
candidates: (attachment.candidates || []).map((item) =>
|
||||
item.candidateNo === candidateNo ? mapServerCandidate(remote) : item,
|
||||
),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** 人工采纳已复核的 Dify Candidate;后端决定是否已满足履约门禁。 */
|
||||
const promoteCandidate = async (candidateNo: string) => {
|
||||
const remote = await promoteShippingNoticeCandidate(candidateNo);
|
||||
@@ -667,7 +653,6 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
resolveDuplicateAttachment,
|
||||
resolveCandidateDuplicate,
|
||||
setCandidateSelected,
|
||||
updateCandidateSummary,
|
||||
promoteCandidate,
|
||||
rejectCandidate,
|
||||
getParsedIntakeNos,
|
||||
|
||||
Reference in new issue
Block a user