feat(shipping-notice): 新增通用解析能力,优化性能并清理遗留废弃代码
This commit is contained in:
1 parent
935bf26fa6
commit
7cfd5d167e
230 files changed
+9337
-10989
No files matched your search
@@ -12,14 +12,18 @@
|
||||
<style>
|
||||
:root { --canvas:#f8fafc; --surface:#fff; --surface-soft:#f5f8fc; --line:#e5eaf1; --ink:#182230; --text:#4d5d73; --muted:#8491a5; --brand:#1677d2; --brand-50:#edf6ff; --good:#18854d; --good-50:#ecf9f0; --warn:#b7730d; --warn-50:#fff7e7; --bad:#c63d53; --bad-50:#fff0f2; --shadow:0 10px 28px rgba(21,39,66,.07); }
|
||||
*{box-sizing:border-box} html,body,#app{width:100%;height:100%;margin:0} #app{display:flex;min-width:0;overflow:hidden} body{font:14px/1.5 "Microsoft YaHei","PingFang SC",Arial,sans-serif;color:var(--text);background:var(--canvas)} button,input,select{font:inherit} button{cursor:pointer} button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(22,119,210,.22);outline-offset:2px}
|
||||
.shell{display:flex;width:100%;height:100%;min-width:0;overflow:hidden}.side{display:flex;flex:0 0 244px;width:244px;min-width:244px;max-width:244px;flex-direction:column;overflow:hidden;background:var(--surface);border-right:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;height:64px;padding:0 18px;border-bottom:1px solid var(--line)}.brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,#208add,#2368c9);color:#fff;font-size:12px;font-weight:800}.brand b{display:block;color:var(--ink);font-size:15px}.brand span{display:block;color:var(--muted);font-size:11px}.new-chat{margin:14px;border:1px solid #bfdbf6;border-radius:9px;padding:9px 12px;text-align:left;color:#1265af;background:var(--brand-50);font-weight:700}.nav-label{padding:9px 17px 5px;color:#96a2b3;font-size:10px;font-weight:800;letter-spacing:.08em}.history{min-height:0;padding:0 9px;overflow:auto}.history button{position:relative;width:100%;border:0;border-radius:8px;padding:9px 10px;background:transparent;color:var(--text);text-align:left}.history button:hover{background:var(--surface-soft)}.history button.active{color:#1469b4;background:var(--brand-50)}.history b,.history span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history b{font-size:12px}.history span{margin-top:2px;color:var(--muted);font-size:10px}.dot{position:absolute;top:11px;right:10px;width:7px;height:7px;border-radius:50%;background:#ed9a2c}.dot.bad{background:#d64d61}.user{display:flex;gap:8px;align-items:center;margin-top:auto;padding:14px 17px;border-top:1px solid var(--line)}.avatar{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;color:#1269b3;background:#dff1ff;font-size:11px;font-weight:800}.user b,.user span{display:block}.user b{color:var(--ink);font-size:11px}.user span{color:var(--muted);font-size:10px}
|
||||
.shell{display:flex;width:100%;height:100%;min-width:0;overflow:hidden}.side{display:flex;flex:0 0 244px;width:244px;min-width:244px;max-width:244px;flex-direction:column;overflow:hidden;background:var(--surface);border-right:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;height:64px;padding:0 18px;border-bottom:1px solid var(--line)}.brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,#208add,#2368c9);color:#fff;font-size:12px;font-weight:800}.brand b{display:block;color:var(--ink);font-size:15px}.brand span{display:block;color:var(--muted);font-size:11px}.new-chat{margin:14px;border:1px solid #bfdbf6;border-radius:9px;padding:9px 12px;text-align:left;color:#1265af;background:var(--brand-50);font-weight:700}.nav-label{padding:9px 17px 5px;color:#96a2b3;font-size:10px;font-weight:800;letter-spacing:.08em}.history{min-height:0;padding:0 9px;overflow:auto}.history button{position:relative;width:100%;border:0;border-radius:8px;padding:9px 10px;background:transparent;color:var(--text);text-align:left}.history button:hover{background:var(--surface-soft)}.history button.active{color:#1469b4;background:var(--brand-50)}.history b,.history span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history b{font-size:12px}.history span{margin-top:2px;color:var(--muted);font-size:10px}.history-divider{height:1px;margin:8px 8px 4px;background:var(--line)}.history-label{padding:5px 10px 3px;color:#96a2b3;font-size:10px;font-weight:800;letter-spacing:.05em}.history button.walkthrough b{font-weight:600}.history button.walkthrough span{color:#8797ab}.dot{position:absolute;top:11px;right:10px;width:7px;height:7px;border-radius:50%;background:#ed9a2c}.dot.bad{background:#d64d61}.user{display:flex;gap:8px;align-items:center;margin-top:auto;padding:14px 17px;border-top:1px solid var(--line)}.avatar{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;color:#1269b3;background:#dff1ff;font-size:11px;font-weight:800}.user b,.user span{display:block}.user b{color:var(--ink);font-size:11px}.user span{color:var(--muted);font-size:10px}
|
||||
.main{display:flex;min-width:0;min-height:0;flex:1 1 auto;flex-direction:column;overflow:hidden}.topbar{height:64px;display:flex;align-items:center;gap:10px;padding:0 28px;background:var(--surface);border-bottom:1px solid var(--line)}.agent-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;color:var(--brand);background:var(--brand-50);font-weight:800}.title b{display:block;color:var(--ink);font-size:14px}.title span{display:block;margin-top:1px;color:var(--muted);font-size:11px}.crumb{margin-left:auto;color:var(--muted);font-size:12px}.layout{min-height:0;flex:1;overflow:auto}.page{width:min(1160px,100%);margin:0 auto;padding:28px}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.page-head h1{margin:0;color:var(--ink);font-size:22px}.page-head p{max-width:720px;margin:5px 0 0;color:var(--muted);font-size:13px}.back{border:0;background:transparent;color:#176fba;font-weight:700}.card{border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid var(--line)}.card-h h2{margin:0;color:var(--ink);font-size:15px}.card-h p{margin:3px 0 0;color:var(--muted);font-size:11px}.card-b{padding:18px}.grid{display:grid;gap:16px}.grid.two{grid-template-columns:1.55fr 1fr}.summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.metric{padding:13px;border:1px solid var(--line);border-radius:10px;background:#fff}.metric b{display:block;color:var(--ink);font-size:20px}.metric span{display:block;margin-top:3px;color:var(--muted);font-size:11px}.metric button{border:0;padding:0;background:transparent;color:inherit;text-align:left}.metric.action{border-color:#cfe5f9;background:var(--brand-50)}.metric.action b{color:#1268b2}.notice{display:flex;gap:9px;margin-top:14px;border-radius:8px;padding:10px 12px;color:#596b82;background:var(--surface-soft);font-size:12px}.notice i{font-style:normal;font-weight:800}.notice.good{color:#167642;background:var(--good-50)}.notice.warn{color:#97620c;background:var(--warn-50)}.notice.bad{color:#ae3146;background:var(--bad-50)}.btn{border:1px solid #d1dbe7;border-radius:8px;padding:8px 12px;color:#43536a;background:#fff;font-size:12px;font-weight:700}.btn:hover{background:var(--surface-soft)}.btn.primary{border-color:var(--brand);color:#fff;background:var(--brand)}.btn.danger{border-color:#efb9c2;color:#b43449;background:var(--bad-50)}.btn[disabled]{cursor:not-allowed;opacity:.48}.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.chip{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:700}.chip.good{color:#147340;background:var(--good-50)}.chip.warn{color:#9a640c;background:var(--warn-50)}.chip.bad{color:#ad3145;background:var(--bad-50)}.chip.gray{color:#68788e;background:#eff3f7}.chat-panel{min-height:370px;display:flex;flex-direction:column}.chat-messages{flex:1;padding:18px}.bubble{max-width:88%;margin-bottom:13px;border:1px solid var(--line);border-radius:4px 12px 12px;padding:10px 12px;color:var(--text);background:#fff;font-size:13px}.bubble.user-msg{margin-left:auto;border-color:var(--brand);border-radius:12px 4px 12px 12px;color:#fff;background:var(--brand)}.composer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line)}.composer input{min-width:0;flex:1;border:1px solid #d4dee9;border-radius:8px;padding:9px 11px}.quick{display:grid;gap:8px}.quick button{border:1px solid var(--line);border-radius:8px;padding:10px;color:#53637a;background:#fff;text-align:left;font-size:12px}.quick button:hover{border-color:#bfdcf7;color:#1267b1;background:var(--brand-50)}
|
||||
.scope{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:14px;border:1px solid #d7e9fa;border-radius:10px;background:#f5faff}.scope b{display:block;color:#145f9f}.scope span{display:block;margin-top:2px;color:#60748c;font-size:12px}.source-toolbar{display:flex;gap:10px;align-items:center;margin-bottom:13px}.source-toolbar input{width:280px;border:1px solid #d4dee9;border-radius:8px;padding:8px 10px}.source-toolbar .count{margin-left:auto;color:var(--muted);font-size:12px}.source-group{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-top:10px}.source-group-head{display:flex;align-items:center;gap:10px;padding:12px 13px;background:#fbfcfe}.source-group-head b{color:var(--ink)}.source-group-head span{color:var(--muted);font-size:11px}.source-group-head button{margin-left:auto;border:0;color:#176fba;background:transparent;font-size:12px}.source-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line)}.source-item{display:flex;align-items:center;gap:9px;min-height:54px;padding:10px 13px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.source-item:nth-child(even){border-right:0}.source-item:last-child{border-bottom:0}.source-item b{display:block;color:var(--ink);font-size:12px}.source-item span{display:block;color:var(--muted);font-size:11px}.sticky-actions{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;margin:18px -18px -18px;padding:13px 18px;border-top:1px solid var(--line);background:rgba(255,255,255,.96)}
|
||||
.stage-list{display:grid;gap:10px}.stage{display:grid;grid-template-columns:14px 1fr auto;gap:10px;align-items:start;padding:12px;border:1px solid var(--line);border-radius:9px}.stage .mark{width:10px;height:10px;margin-top:4px;border-radius:50%;background:#a8b3c1}.stage.good .mark{background:var(--good)}.stage.warn .mark{background:#e1a238}.stage.bad .mark{background:var(--bad)}.stage b{display:block;color:var(--ink);font-size:12px}.stage span{display:block;margin-top:2px;color:var(--muted);font-size:11px}.facts{display:grid;grid-template-columns:repeat(3,1fr);gap:0;border:1px solid var(--line);border-radius:9px;overflow:hidden}.fact{padding:10px 12px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.fact:nth-child(3n){border-right:0}.fact:nth-last-child(-n+3){border-bottom:0}.fact span{display:block;color:var(--muted);font-size:10px}.fact b{display:block;margin-top:3px;color:var(--ink);font-size:12px}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;font-size:12px}.table th,.table td{padding:11px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}.table th{color:#7d8ba0;background:#fafbfd;font-size:11px;font-weight:700}.table td b{color:var(--ink)}.table tr.disabled{color:#8693a4;background:#fbfcfe}.link{border:0;padding:0;color:#146fba;background:transparent;font-weight:700}.confirm-band{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:13px;border:1px solid #d3e8f9;border-radius:9px;padding:12px;background:#f5faff}.confirm-band b{color:#155f9f}.route-org{margin-top:12px;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}.route-org>summary,.route-item>summary{display:flex;align-items:center;gap:12px;list-style:none;cursor:pointer}.route-org>summary::-webkit-details-marker,.route-item>summary::-webkit-details-marker{display:none}.route-org>summary{padding:14px 16px;background:#fbfcfe}.route-org>summary::before,.route-item>summary::before{content:'›';width:16px;color:#6d7d91;font-size:20px;line-height:1;transition:transform .15s}.route-org[open]>summary::before,.route-item[open]>summary::before{transform:rotate(90deg)}.route-org-title{min-width:0;flex:1}.route-org-title b{display:block;color:var(--ink);font-size:14px}.route-org-title span{display:block;margin-top:2px;color:var(--muted);font-size:11px}.route-org-metrics{display:flex;gap:14px;color:#52637a;font-size:12px}.route-org-metrics b{color:var(--ink)}.route-table{border-top:1px solid var(--line)}.route-item{border-bottom:1px solid var(--line)}.route-item:last-child{border-bottom:0}.route-item>summary{padding:11px 16px}.route-item>summary:hover{background:var(--surface-soft)}.route-item-main{min-width:0;flex:1}.route-item-main b{color:var(--ink)}.route-item-main span{margin-left:8px;color:var(--muted);font-size:11px}.route-item-metrics{display:flex;gap:18px;color:#52637a;font-size:12px}.route-item-metrics strong{color:var(--ink)}.route-invoices{padding:0 16px 14px 44px;background:#fcfdff}.tabs{display:flex;gap:5px;border-bottom:1px solid var(--line);margin-bottom:14px}.tab{border:0;border-bottom:2px solid transparent;padding:9px 11px;color:#718097;background:transparent;font-size:12px;font-weight:700}.tab.active{border-color:var(--brand);color:#146bb4}.filters{display:flex;gap:8px;margin-bottom:12px}.filters select{border:1px solid #d5dfe9;border-radius:7px;padding:7px 9px;color:var(--text);background:#fff}.progress{height:7px;border-radius:999px;background:#eaf0f6;overflow:hidden}.progress i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
|
||||
.toast{position:fixed;right:24px;bottom:24px;z-index:20;max-width:380px;border-radius:9px;padding:11px 14px;color:#fff;background:#253c57;box-shadow:0 12px 30px rgba(20,37,60,.23);font-size:12px;opacity:0;transform:translateY(12px);pointer-events:none;transition:.18s}.toast.show{opacity:1;transform:translateY(0)}.overlay{position:fixed;inset:0;z-index:10;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(19,32,49,.38)}.overlay.show{display:flex}.modal{width:min(480px,100%);border-radius:12px;background:#fff;box-shadow:0 24px 60px rgba(20,37,60,.28)}.modal h2{margin:0;padding:17px 18px 10px;color:var(--ink);font-size:16px}.modal p{margin:0;padding:0 18px;color:var(--muted);font-size:12px}.modal .body{padding:16px 18px}.modal input{width:100%;border:1px solid #d4dee9;border-radius:8px;padding:9px 10px}.modal .footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px;border-top:1px solid var(--line)}
|
||||
/* Chat 首页复用 HXOPS 真实 Chat 壳层:无业务顶栏、消息列居中、输入容器贴近底部。 */
|
||||
.chat-mode .topbar{display:none}.chat-mode .main{background:var(--surface)}.chat-mode .layout{overflow:hidden}.chat-mode .side{flex-basis:320px;width:320px;max-width:320px}.chat-mode .page{width:100%;height:100%;max-width:none;margin:0;padding:0 24px}.chat-home{display:flex;height:100%;min-height:0;flex-direction:column;align-items:center}.chat-home-head{width:100%;max-width:780px;padding:38px 0 12px;text-align:center}.chat-home-head .welcome-mark{display:grid;place-items:center;width:46px;height:46px;margin:0 auto 14px;border-radius:50%;color:#fff;background:linear-gradient(135deg,#2f80d1,#1f65b0);font-weight:800;box-shadow:0 8px 22px rgba(47,128,209,.22)}.chat-home-head h1{margin:0;color:#0f172a;font-size:28px;line-height:1.25}.chat-home-head h1 span{color:#2f80d1}.chat-home-head p{margin:9px auto 0;max-width:650px;color:#64748b;font-size:13px}.chat-scenarios{display:flex;width:100%;max-width:860px;gap:8px;overflow-x:auto;padding:6px 0 14px;scrollbar-width:none}.chat-scenarios::-webkit-scrollbar{display:none}.chat-scenarios .tab{flex:0 0 auto;border:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;border-radius:999px;padding:8px 13px;color:#475569;background:#fff;font-size:12px;font-weight:600;white-space:nowrap}.chat-scenarios .tab.active{border-color:#9cc7f2;color:#1f5f99;background:#eef6ff}.chat-thread{width:100%;max-width:780px;min-height:0;flex:1;overflow:auto;padding:12px 0 150px}.chat-thread .bubble{max-width:82%;border-radius:14px;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.04)}.chat-thread .bubble.user-msg{border:0;border-radius:14px 5px 14px 14px;background:#2f80d1;box-shadow:none}.chat-thread .scope{border-color:#cfe5f9;border-radius:14px;background:#f8fbff}.chat-thread .notice{border-radius:12px}.chat-action{display:flex;justify-content:flex-end;margin-top:10px}.chat-input-wrap{position:fixed;right:0;bottom:0;left:320px;z-index:4;padding:12px 24px 18px;background:linear-gradient(transparent,rgba(255,255,255,.96) 22%)}.chat-input{display:flex;align-items:flex-end;gap:8px;width:min(780px,100%);margin:0 auto;border:1px solid #d8e0ec;border-radius:16px;padding:9px 10px;background:#fff;box-shadow:0 8px 28px rgba(15,23,42,.10)}.chat-input input{min-width:0;flex:1;border:0;outline:0;padding:9px 8px;color:#0f172a;background:transparent;font-size:15px}.chat-input button{display:grid;place-items:center;width:38px;height:38px;border:0;border-radius:50%;color:#fff;background:#2f80d1;font-weight:700}.chat-input-hint{width:min(780px,100%);margin:7px auto 0;text-align:center;color:#94a3b8;font-size:10px}
|
||||
@media(max-width:800px){body{font-size:13px}#app{display:block;height:auto;min-height:100%;overflow:auto}.shell{display:block;overflow:auto}.side{display:none}.main{min-height:100%;overflow:visible}.topbar{padding:0 16px}.crumb{display:none}.page{padding:17px}.grid.two{grid-template-columns:1fr}.summary{grid-template-columns:repeat(2,1fr)}.page-head{display:block}.page-head .back{margin-bottom:8px}.source-toolbar{flex-wrap:wrap}.source-toolbar input{width:100%}.source-toolbar .count{margin-left:0}.source-list{grid-template-columns:1fr}.source-item{border-right:0}.facts{grid-template-columns:1fr}.fact{border-right:0}.fact:nth-last-child(-n+3){border-bottom:1px solid var(--line)}.fact:last-child{border-bottom:0}.confirm-band{display:block}.confirm-band .actions{margin-top:10px}.table{min-width:650px}.chat-mode .page{padding:0 14px}.chat-home-head{padding-top:25px}.chat-home-head h1{font-size:23px}.chat-input-wrap{left:0;padding:10px 12px 14px}.chat-thread{padding-bottom:140px}.chat-thread .bubble{max-width:92%}}
|
||||
/* Chat 首页对齐当前 HXOPS Chat:深色画布、56px 顶栏、抽屉式历史记录与底部双行输入区。 */
|
||||
.chat-mode{background:#020617;color:#cbd5e1}.chat-mode #app{background:#020617}.chat-mode .main{background:#020617}.chat-mode .topbar{display:flex;height:56px;gap:9px;padding:0 16px;border-color:#1e293b;background:#020617}.chat-mode .agent-icon{width:28px;height:28px;border-radius:8px;color:#e0f2fe;background:#2582ca;font-size:11px}.chat-mode .title{display:flex;align-items:center;gap:10px}.chat-mode .title b{color:#f8fafc;font-size:14px}.chat-mode .title span{display:none}.chat-mode .crumb{margin-left:0;border:1px solid #7dd3fc;border-radius:8px;padding:5px 10px;color:#0369a1;background:#e0f2fe;font-size:12px;font-weight:700}.chat-mode .chat-nav-actions{display:flex;align-items:center;gap:8px;margin-left:auto}.chat-mode .chat-nav-actions button{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:8px;color:#94a3b8;background:transparent;font-size:18px}.chat-mode .chat-nav-actions button:hover{color:#e2e8f0;background:#0f172a}.chat-mode .layout{overflow:hidden}.chat-mode .page{width:100%;height:100%;max-width:none;margin:0;padding:0}.chat-mode .side{position:fixed;top:0;bottom:0;left:0;z-index:30;display:flex;flex:0 0 296px;width:296px;min-width:296px;max-width:296px;transform:translateX(-100%);border-color:#1e293b;background:#0f172a;box-shadow:18px 0 44px rgba(0,0,0,.38);transition:transform .2s ease}.chat-mode.history-open .side{transform:translateX(0)}.chat-mode .brand{height:56px;border-color:#1e293b;padding:0 16px}.chat-mode .brand-mark{width:28px;height:28px;border-radius:8px;background:#2582ca;font-size:11px}.chat-mode .brand b{color:#f8fafc;font-size:14px}.chat-mode .brand span{color:#64748b}.chat-mode .new-chat{margin:12px;border-color:#1d4f78;border-radius:8px;color:#bae6fd;background:#082f49}.chat-mode .nav-label,.chat-mode .history-label{color:#64748b}.chat-mode .history-divider{background:#1e293b}.chat-mode .history button{color:#cbd5e1}.chat-mode .history button:hover{background:#172554}.chat-mode .history button.active{color:#e0f2fe;background:#0c4a6e}.chat-mode .history span{color:#64748b}.chat-mode .user{border-color:#1e293b}.chat-mode .user b{color:#e2e8f0}.chat-mode .user span{color:#64748b}.chat-mode .avatar{color:#bae6fd;background:#164e63}.chat-home{display:flex;height:100%;min-height:0;flex-direction:column;align-items:center}.chat-home-head{width:100%;max-width:920px;padding:67px 20px 17px;text-align:center}.chat-home-head .welcome-mark{display:none}.chat-home-head h1{margin:0;color:#f8fafc;font-size:29px;line-height:1.3}.chat-home-head h1 span{margin-left:6px;color:#7dd3fc}.chat-home-head p{display:none}.chat-todo-section{width:100%;max-width:760px;padding:0 16px 12px}.chat-todo-label{margin:0 0 8px;color:#94a3b8;font-size:12px;font-weight:700}.chat-today{display:flex;justify-content:center}.today-item{display:flex;align-items:center;gap:9px;width:auto;max-width:100%;border:1px solid #334155;border-radius:999px;padding:9px 14px;color:#cbd5e1;background:#0f172a;text-align:left}.today-item:hover{border-color:#7dd3fc;color:#e0f2fe;background:#172554}.today-item .today-icon{display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px;border-radius:50%;color:#0c4a6e;background:#7dd3fc;font-size:15px;line-height:1}.today-item b{display:inline;color:inherit;font-size:13px}.today-item span{display:inline;margin:0;color:#94a3b8;font-size:12px}.today-item span span{display:none}.today-item .today-go{display:none}.chat-pending{display:flex;justify-content:center;gap:8px}.pending-item{display:flex;align-items:center;gap:6px;min-width:0;width:auto;border:1px solid #334155;border-radius:999px;padding:8px 12px;color:#cbd5e1;background:#0f172a;text-align:left}.pending-item:hover{border-color:#64748b;background:#172554}.pending-item.primary{border-color:#2c5572;background:#082f49}.pending-item b{display:inline;color:inherit;font-size:12px}.pending-item.primary b{color:#bae6fd}.pending-item span{display:none}.pending-item .pending-count{display:inline;margin:0;color:#7dd3fc;font-size:12px}.pending-item.warning .pending-count{color:#fbbf24}.pending-item.muted .pending-count{color:#94a3b8}.chat-thread{width:100%;max-width:760px;min-height:0;flex:1;overflow:auto;padding:36px 16px 154px}.chat-thread .bubble{max-width:82%;border:1px solid #1e293b;border-radius:6px 14px 14px;padding:11px 13px;color:#cbd5e1;background:#0f172a;box-shadow:none}.chat-thread .bubble.user-msg{margin-left:auto;border:0;border-radius:14px 5px 14px 14px;color:#eff6ff;background:#075985}.chat-thread .scope{border-color:#1e3a5f;border-radius:10px;color:#cbd5e1;background:#0b1327}.chat-thread .scope b{color:#bae6fd}.chat-thread .scope span{color:#94a3b8}.chat-thread .notice{border-radius:10px;color:#fcd34d;background:#2a1d05}.chat-action .btn{border-color:#0369a1;color:#e0f2fe;background:#075985}.chat-input-wrap{position:fixed;right:0;bottom:0;left:0;z-index:4;padding:0 14px 8px;background:#020617}.chat-input{display:block;width:min(760px,100%);margin:0 auto;border:0;border-radius:0;padding:0;backLine truncated
|
||||
/* 当前浏览器的浅色 Chat 基线:常驻会话栏、无业务顶栏、居中欢迎区和底部输入容器。 */
|
||||
.chat-mode{color:#334155;background:#fff}.chat-mode #app{background:#fff}.chat-mode .main{background:#fff}.chat-mode .topbar{display:none}.chat-mode .layout{overflow:hidden}.chat-mode .page{width:100%;height:100%;max-width:none;margin:0;padding:0}.chat-mode .side{position:static;z-index:auto;display:flex;flex:0 0 300px;width:300px;min-width:300px;max-width:300px;transform:none;border-color:#dbe7ef;background:#fff;box-shadow:none;transition:none}.chat-mode.history-open .side{transform:none}.chat-mode .brand{height:72px;border:0;padding:16px}.chat-mode .brand-mark{width:34px;height:34px;border-radius:10px;background:#3187cf;font-size:12px}.chat-mode .brand b{color:#0f172a;font-size:15px}.chat-mode .brand span{color:#94a3b8}.chat-mode .new-chat{margin:10px 16px 18px;border-color:#e2e8f0;border-radius:10px;padding:11px 12px;color:#334155;background:#f8fafc;box-shadow:0 2px 8px rgba(15,23,42,.04)}.chat-mode .nav-label,.chat-mode .history-label{padding-left:16px;color:#64748b;font-size:12px;letter-spacing:0}.chat-mode .history-divider{margin:10px 16px 6px;background:#e2e8f0}.chat-mode .history{padding:0 9px}.chat-mode .history button{padding:9px 10px;color:#475569}.chat-mode .history button:hover{background:#f1f5f9}.chat-mode .history button.active{color:#0f5e9c;background:#eaf5ff}.chat-mode .history span{color:#94a3b8}.chat-mode .user{margin:0;padding:14px 16px;border-color:#edf2f7}.chat-mode .user b{color:#334155}.chat-mode .user span{color:#94a3b8}.chat-mode .avatar{color:#1d70b7;background:#e0f2fe}.chat-home-head{max-width:960px;padding:49px 20px 24px}.chat-home-head .welcome-mark{display:none}.chat-home-head h1{color:#0f172a;font-size:30px;font-weight:800}.chat-home-head h1 span{margin-left:6px;color:#2582ca}.chat-home-head p{display:none}.chat-todo-section{max-width:760px;padding:0 16px 14px}.chat-todo-label{margin-bottom:9px;color:#64748b}.chat-today{display:flex;justify-content:center}.today-item{gap:8px;width:auto;border-color:#d9e3eb;border-radius:999px;padding:9px 14px;color:#334155;background:#fff;box-shadow:0 2px 7px rgba(15,23,42,.035)}.today-item:hover{border-color:#7dc0ed;color:#1267a7;background:#f6fbff}.today-item .today-icon{width:18px;height:18px;flex-basis:18px;border-radius:50%;color:#0f5e9c;background:#dff1ff;font-size:15px;line-height:1}.today-item b{display:inline;color:inherit;font-size:13px}.today-item span{display:inline;margin:0;color:#64748b;font-size:12px}.today-item span span{display:none}.today-item .today-go{display:none}.chat-pending{display:flex;justify-content:center;gap:8px}.pending-item{display:flex;align-items:center;gap:6px;width:auto;border-color:#e2e8f0;border-radius:999px;padding:8px 12px;color:#475569;background:#fff;box-shadow:0 2px 7px rgba(15,23,42,.03)}.pending-item:hover{border-color:#b9d9ef;background:#f8fbff}.pending-item.primary{border-color:#c5e2f4;background:#f4faff}.pending-item b{display:inline;color:inherit;font-size:12px}.pending-item.primary b{color:#1f5f99}.pending-item span{display:none}.pending-item .pending-count{display:inline;margin:0;color:#2582ca;font-size:12px}.pending-item.warning .pending-count{color:#b7791f}.pending-item.muted .pending-count{color:#64748b}.chat-thread{max-width:760px;padding:34px 16px 154px}.chat-thread .bubble{border-color:#e2e8f0;border-radius:6px 14px 14px;padding:11px 13px;color:#475569;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.04)}.chat-thread .bubble.user-msg{border:0;border-radius:14px 5px 14px 14px;color:#fff;background:#2582ca}.chat-thread .scope{border-color:#d8ecfa;border-radius:10px;color:#475569;background:#f6fbff}.chat-thread .scope b{color:#1f5f99}.chat-thread .scope span{color:#64748b}.chat-thread .notice{border-radius:10px;color:#9a640c;background:#fff7e7}.chat-action .btn{border-color:#2582ca;color:#fff;background:#2582ca}.chat-input-wrap{left:300px;padding:0 14px 8px;background:linear-gradient(transparent,rgba(255,255,255,.96) 28%)}.chat-input{width:min(760px,100%);border:1px solid #edf1f5;border-radius:17px;padding:8px 10px;background:#fff;box-shadow:0 8px 26px rgba(15,23,42,.08)}.chat-input textarea{min-height:42px;padding:8px 10px;color:#0f172a}.chat-input textarea::placeholder{color:#94a3b8}.chat-input-tools{min-height:35px;padding:0 4px}.chat-input-tools button{width:30px;height:30px;color:#64748b}.chat-input-tools button:hover{color:#2582ca;background:#f1f5f9}.chat-input-tools .kb-pill{border-color:#e2e8f0;border-radius:7px;color:#94a3b8;background:#fff}.chat-input-tools .send{border-color:#edf1f5;color:#cbd5e1;background:#f8fafc}.chat-input-hint{margin-top:8px;color:#94a3b8}
|
||||
/* 待办是业务工作入口,保留卡片、计数和辅助说明,不压缩为聊天快捷问题。 */
|
||||
.chat-mode .chat-todo-section{width:100%;max-width:780px;padding:0 0 14px}.chat-mode .chat-todo-label{margin:0 0 8px;color:#506e8b;font-size:14px;font-weight:800}.chat-mode .chat-today{display:grid;grid-template-columns:1fr;gap:10px}.chat-mode .today-item{display:flex;align-items:center;gap:12px;width:100%;border:1px solid #9cc7f2;border-radius:12px;padding:13px;color:#1f5f99;background:#eef6ff;text-align:left;box-shadow:none}.chat-mode .today-item:hover{background:#e3f1ff}.chat-mode .today-item .today-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:10px;color:#fff;background:#2f80d1;font-size:18px;font-weight:800}.chat-mode .today-item b,.chat-mode .today-item span{display:block}.chat-mode .today-item b{color:#1f5f99;font-size:13px}.chat-mode .today-item span{margin-top:2px;color:#54718f;font-size:11px}.chat-mode .today-item span span{display:block}.chat-mode .today-item .today-go{display:block;margin-left:auto;color:#2f80d1;font-size:19px}.chat-mode .chat-pending{display:grid;width:100%;grid-template-columns:1.3fr 1fr 1fr;gap:10px}.chat-mode .pending-item{display:block;min-width:0;width:100%;border:1px solid #e2e8f0;border-radius:12px;padding:12px 13px;color:#475569;background:#fff;text-align:left;box-shadow:none}.chat-mode .pending-item:hover{border-color:#9cc7f2;background:#f8fbff}.chat-mode .pending-item.primary{border-color:#9cc7f2;background:#eef6ff}.chat-mode .pending-item b,.chat-mode .pending-item span{display:block}.chat-mode .pending-item b{color:#0f172a;font-size:13px}.chat-mode .pending-item.primary b{color:#1f5f99}.chat-mode .pending-item span{margin-top:3px;color:#64748b;font-size:11px}.chat-mode .pending-item .pending-count{display:inline-block;margin:0 0 4px;color:#2f80d1;font-size:22px;line-height:1;font-weight:800}.chat-mode .pending-item.warning .pending-count{color:#b7730d}.chat-mode .pending-item.muted .pending-count{color:#64748b}
|
||||
@media(max-width:800px){body{font-size:13px}#app{display:block;height:auto;min-height:100%;overflow:auto}.shell{display:block;overflow:auto}.side{display:none}.main{min-height:100%;overflow:visible}.topbar{padding:0 16px}.crumb{display:none}.page{padding:17px}.grid.two{grid-template-columns:1fr}.summary{grid-template-columns:repeat(2,1fr)}.page-head{display:block}.page-head .back{margin-bottom:8px}.source-toolbar{flex-wrap:wrap}.source-toolbar input{width:100%}.source-toolbar .count{margin-left:0}.source-list{grid-template-columns:1fr}.source-item{border-right:0}.facts{grid-template-columns:1fr}.fact{border-right:0}.fact:nth-last-child(-n+3){border-bottom:1px solid var(--line)}.fact:last-child{border-bottom:0}.confirm-band{display:block}.confirm-band .actions{margin-top:10px}.table{min-width:650px}.chat-mode .page{padding:0 14px}.chat-home-head{padding-top:25px}.chat-home-head h1{font-size:23px}.chat-pending{grid-template-columns:1fr;padding-bottom:10px}.chat-input-wrap{left:0;padding:10px 12px 14px}.chat-thread{padding-bottom:140px}.chat-thread .bubble{max-width:92%}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -33,11 +37,18 @@
|
||||
<button data-action="go-precheck"><b>DBS 昨日收料预检</b><span>PRE-20260818-001</span></button>
|
||||
<button data-action="go-run"><b>自动调拨结果</b><span>AUTO-20260818-0900</span><i class="dot"></i></button>
|
||||
<button data-action="go-backlog"><b>待处理调拨</b><span>6 笔可恢复异常</span><i class="dot bad"></i></button>
|
||||
<div class="history-divider"></div>
|
||||
<div class="history-label">评审对话走查(演示)</div>
|
||||
<button class="walkthrough" data-action="chat-scene-intent"><b>处理昨天 DBS-AWSBI 的收料</b><span>发起调拨意图</span></button>
|
||||
<button class="walkthrough" data-action="chat-scene-status"><b>还有哪些待处理调拨?</b><span>历史待办状态</span></button>
|
||||
<button class="walkthrough" data-action="chat-scene-mismatch"><b>INV-031 为什么不可调拨?</b><span>数量不一致说明</span></button>
|
||||
<button class="walkthrough" data-action="chat-scene-recovery"><b>我已在 ERP 处理好库存,如何复查?</b><span>异常 ERP 复查</span></button>
|
||||
<button class="walkthrough" data-action="chat-scene-schedule"><b>最近自动调拨执行结果?</b><span>自动 Run 汇总</span></button>
|
||||
</div>
|
||||
<div class="user"><div class="avatar">仓</div><div><b>仓库管理人员</b><span>在途仓调拨 Agent</span></div></div>
|
||||
</aside>
|
||||
<main class="main">
|
||||
<header class="topbar"><div class="agent-icon">AI</div><div class="title"><b>在途仓自动调拨</b><span id="sub-title">Chat 首页 · 仅展示摘要与入口</span></div><div class="crumb" id="crumb">/chat/:agentId</div></header>
|
||||
<header class="topbar"><div class="agent-icon">AI</div><div class="title"><b>在途仓自动调拨</b><span id="sub-title">Chat 首页 · 仅展示摘要与入口</span></div><div class="crumb" id="crumb">调拨中心</div><div class="chat-nav-actions"><button type="button" aria-label="打开历史记录" title="历史记录" data-action="toggle-history">↶</button><button type="button" aria-label="更多功能" title="更多功能">▦</button></div></header>
|
||||
<div class="layout" id="page"></div>
|
||||
</main>
|
||||
</div>
|
||||
@@ -45,7 +56,7 @@
|
||||
<div class="overlay" id="modal-mask"><div class="modal"><h2 id="modal-title"></h2><p id="modal-desc"></p><div class="body"><input id="reason" placeholder="请输入原因(必填)" /></div><div class="footer"><button class="btn" data-action="modal-cancel">取消</button><button class="btn primary" data-action="modal-confirm">确认</button></div></div></div>
|
||||
<script>
|
||||
const $ = id => document.getElementById(id);
|
||||
const S = { selected:new Set(['DBS-AWSBI']), collapsed:new Set(), businessDate:'2026-08-18', backlogTab:'recoverable', modal:null, toastTimer:null, precheckRequery:'initial', routeOrgs:new Set() };
|
||||
const S = { selected:new Set(['DBS-AWSBI']), collapsed:new Set(), businessDate:'2026-08-18', backlogTab:'recoverable', modal:null, toastTimer:null, precheckRequery:'initial', routeOrgs:new Set(), historyOpen:false };
|
||||
const sources = [
|
||||
{ platform:'DBS', code:'DBS-AWSBI', name:'AWSBI 在途仓', warehouse:'AWSBI-TRANSIT', enabled:true },
|
||||
{ platform:'DBS', code:'DBS-AWSSG', name:'AWSSG 在途仓', warehouse:'AWSSG-TRANSIT', enabled:true },
|
||||
@@ -73,12 +84,13 @@
|
||||
safety:{ label:'结果未知说明', user:'为什么不能重试结果未知?', reply:'ERP 调用未返回可确认的成功或失败时,系统无法证明没有产生单据。再次提交存在重复写入风险,所以该状态只读,必须由 ERP 管理员线下核实。', evidence:'禁止:重试、关闭、恢复、重新执行;允许:查看已知事实与审计。', action:'go-unknown', actionLabel:'查看结果未知事项' },
|
||||
schedule:{ label:'自动调拨结果', user:'最近一次自动调拨执行得怎么样?', reply:'自动排程按来源实例独立处理:每个实例使用其任务开始前的最新有效文件,分别预检、写入和汇总通知。一个实例失败不会阻断其他实例。', evidence:'演示 Run:DBS-AWSBI 成功 18 项;CRANE-SZ 文件获取超时并保留异常证据。', action:'go-run', actionLabel:'查看最近自动 Run' }
|
||||
};
|
||||
const chatScenario = () => new URL(location.href).searchParams.get('scene') || 'welcome';
|
||||
const chatScenario = () => new URL(location.href).searchParams.get('scene');
|
||||
function chatPage(){
|
||||
setHeader('Chat 首页 · 对话解释与业务入口','/chat/:agentId');
|
||||
const key=chatScenario(), scene=chatScenarios[key] || chatScenarios.welcome;
|
||||
const scenarioTabs=Object.entries(chatScenarios).map(([id,item])=>`<button class="tab ${id===key?'active':''}" data-action="chat-scene-${id}">${item.label}</button>`).join('');
|
||||
return `<section class="page"><div class="chat-home"><div class="chat-home-head"><div class="welcome-mark">AI</div><h1>你好,欢迎使用<span>在途仓自动调拨 Agent</span></h1><p>我会解释规则、展示收料文件与 ERP 查询进度;需要改变业务数据时,请在对应页面点击按钮确认。</p></div><div class="chat-scenarios" aria-label="对话场景">${scenarioTabs}</div><div class="chat-thread"><div class="bubble user-msg">${scene.user}</div><div class="bubble">${scene.reply}</div><div class="scope"><div><b>系统状态 / 可核验依据</b><span>${scene.evidence}</span></div></div><div class="chat-action">${button(scene.actionLabel,scene.action,'primary')}</div><div class="notice warn"><i>!</i><span>对话不会绕过业务按钮直接发起 ERP 写入;当天收料不会进入 ERP 查询或调拨。</span></div></div><div class="chat-input-wrap"><div class="chat-input"><input id="chat-input" aria-label="对话输入" placeholder="例如:为什么今天不能调拨?" /><button aria-label="发送" data-action="chat-send">↑</button></div><div class="chat-input-hint">AI 可能会犯错,请核实重要信息。 · 原型数据仅用于业务走查</div></div></div></section>`;
|
||||
const key=chatScenario(), scene=key && chatScenarios[key];
|
||||
const welcome=`<div class="chat-home-head"><div class="welcome-mark">AI</div><h1>你好,您已进入<span>在途仓自动调拨 Agent</span></h1><p>我会解释规则、展示收料文件与 ERP 查询进度;需要改变业务数据时,请在对应页面点击按钮确认。</p></div><section class="chat-todo-section" aria-label="今日待办"><p class="chat-todo-label">今日待办</p><div class="chat-today"><button class="today-item" data-action="go-source"><i class="today-icon">+</i><span><b>发起今日调拨预检</b><span>选择来源实例后,系统默认以昨天为业务日期处理可成熟收料。</span></span><i class="today-go">›</i></button></div></section><section class="chat-todo-section" aria-label="历史待办"><p class="chat-todo-label">历史待办</p><div class="chat-pending"><button class="pending-item primary" data-action="go-backlog-recoverable"><span class="pending-count">6</span><b>可恢复异常</b><span>可重新查询 ERP 库存后继续处理</span></button><button class="pending-item muted" data-action="go-backlog-closed"><span class="pending-count">2</span><b>已人工关闭</b><span>可查看原因并恢复处理</span></button><button class="pending-item warning" data-action="go-unknown"><span class="pending-count">1</span><b>结果未知</b><span>只读,需线下核实 ERP 事实</span></button></div></section>`;
|
||||
const thread=scene?`<div class="chat-thread"><div class="bubble user-msg">${scene.user}</div><div class="bubble">${scene.reply}</div><div class="scope"><div><b>系统状态 / 可核验依据</b><span>${scene.evidence}</span></div></div><div class="chat-action">${button(scene.actionLabel,scene.action,'primary')}</div><div class="notice warn"><i>!</i><span>对话不会绕过业务按钮直接发起 ERP 写入;当天收料不会进入 ERP 查询或调拨。</span></div></div>`:welcome;
|
||||
return `<section class="page"><div class="chat-home">${thread}<div class="chat-input-wrap"><div class="chat-input"><textarea id="chat-input" aria-label="对话输入" rows="1" placeholder="问我任何事..."></textarea><div class="chat-input-tools"><button type="button" aria-label="语音功能" title="语音功能">♩</button><button type="button" class="kb-pill" aria-label="企业知识库" disabled>▤ 企业知识库⌄</button><button type="button" class="send" aria-label="发送" title="发送" data-action="chat-send">➤</button></div></div><div class="chat-input-hint">AI 可能会犯错,请核实重要信息。</div></div></div></section>`;
|
||||
}
|
||||
function sourcePage(){
|
||||
setHeader('来源实例选择 · 本次调拨范围','/chat/:agentId?mode=transfer-source-selection');
|
||||
@@ -150,12 +162,13 @@
|
||||
function recoverable(){return `<div class="filters"><select><option>来源:全部</option><option>DBS</option><option>Crane</option></select><select><option>日期:全部</option><option>最近 3 天</option></select></div><div class="table-wrap"><table class="table"><thead><tr><th></th><th>来源实例 / 日期</th><th>Invoice</th><th>当前事实</th><th>最近查询</th><th></th></tr></thead><tbody><tr><td><input type="checkbox" checked /></td><td>DBS-AWSBI<br><small>2026-08-16</small></td><td><b>INV-031</b></td><td>收料 300 / ERP 280</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" checked /></td><td>CRANE-SZ<br><small>2026-08-15</small></td><td><b>INV-042</b></td><td>收料 800 / ERP 0</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" /></td><td>DBS-AWSSG<br><small>2026-08-14</small></td><td><b>INV-073</b></td><td>明确技术失败</td><td>08:50</td><td><button class="link" data-action="show-audit">证据</button></td></tr></tbody></table></div><div class="notice"><i>i</i><span>多选后每个 Invoice 都会重新查询 ERP 库存;满足严格等量的项目才进入新的确认页。</span></div><div class="actions">${button('重新查询 ERP 库存(2)','requery','primary')}${button('标记无需继续处理','close-item','danger')}</div>`}
|
||||
function closed(){return `<div class="table-wrap"><table class="table"><thead><tr><th>Invoice</th><th>关闭原因</th><th>关闭人 / 时间</th><th></th></tr></thead><tbody><tr><td>INV-061</td><td>货代确认无需调拨</td><td>仓库管理人员 · 08-17 15:00</td><td><button class="link" data-action="restore-item">恢复处理</button></td></tr><tr><td>INV-068</td><td>业务已线下完成</td><td>仓库管理人员 · 08-17 16:20</td><td><button class="link" data-action="restore-item">恢复处理</button></td></tr></tbody></table></div><div class="notice"><i>i</i><span>恢复后回到“可恢复异常”池;原关闭原因、操作者和快照永久保留。</span></div>`}
|
||||
function unknown(){return `<div class="notice bad"><i>!</i><span>ERP 未返回确定成功或失败。系统只展示已知事实,不提供重查、关闭、恢复或执行按钮。</span></div><div class="table-wrap"><table class="table"><thead><tr><th>Invoice</th><th>所属 Run</th><th>调用时间</th><th>Operation ID</th><th></th></tr></thead><tbody><tr><td><b>INV-052</b></td><td>AUTO-20260818-0900</td><td>09:17:21</td><td>OP-20260818-8891</td><td><button class="link" data-action="show-unknown">查看事实与 SOP</button></td></tr></tbody></table></div>`}
|
||||
function render(){ const page=pageName(); document.body.classList.toggle('chat-mode',page==='chat'); const renderer={chat:chatPage,source:sourcePage,precheck:precheckPage,confirm:confirmPage,run:runPage,backlog:backlogPage,unknown:backlogPage}[page]||chatPage; $('page').innerHTML=renderer(); bind(); if(page==='source') filterSources(); }
|
||||
function render(){ const page=pageName(); document.body.classList.toggle('chat-mode',page==='chat'); document.body.classList.toggle('history-open',page==='chat'&&S.historyOpen); const renderer={chat:chatPage,source:sourcePage,precheck:precheckPage,confirm:confirmPage,run:runPage,backlog:backlogPage,unknown:backlogPage}[page]||chatPage; $('page').innerHTML=renderer(); bind(); if(page==='source') filterSources(); }
|
||||
function filterSources(){ const input=$('source-search'); if(!input)return; const apply=()=>{const q=input.value.trim().toLowerCase(); document.querySelectorAll('[data-source-row]').forEach(row=>row.hidden=!row.textContent.toLowerCase().includes(q));}; input.addEventListener('input',apply); $('source-count').textContent=`已选 ${S.selected.size} 个来源实例`; }
|
||||
function openModal(type){S.modal=type; const data={close:['标记“无需继续处理”','该 Invoice 将变为 manually_closed,自动排程不再处理;历史与审计永久保留。'],restore:['恢复处理','恢复后回到可恢复异常池,可重新查询 ERP 库存。']}[type]; $('modal-title').textContent=data[0];$('modal-desc').textContent=data[1];$('reason').value='';$('modal-mask').classList.add('show');}
|
||||
function action(a){
|
||||
if(a.startsWith('chat-scene-'))return goto('chat',{scene:a.slice(11)});
|
||||
if(a==='go-chat')return goto('chat'); if(a==='go-source')return goto('source'); if(a==='go-precheck')return goto('precheck'); if(a==='go-confirm')return goto('confirm'); if(a==='go-run')return goto('run'); if(a==='go-backlog')return goto('backlog'); if(a==='go-unknown'){S.backlogTab='unknown';return goto('backlog')}
|
||||
if(a==='toggle-history'){S.historyOpen=!S.historyOpen;render();return}
|
||||
if(a.startsWith('chat-scene-')){S.historyOpen=false;return goto('chat',{scene:a.slice(11)});}
|
||||
if(a==='go-chat')return goto('chat'); if(a==='go-source')return goto('source'); if(a==='go-precheck')return goto('precheck'); if(a==='go-confirm')return goto('confirm'); if(a==='go-run')return goto('run'); if(a==='go-backlog')return goto('backlog'); if(a==='go-backlog-recoverable'){S.backlogTab='recoverable';return goto('backlog')} if(a==='go-backlog-closed'){S.backlogTab='closed';return goto('backlog')} if(a==='go-unknown'){S.backlogTab='unknown';return goto('backlog')}
|
||||
if(a==='select-enabled'){sources.filter(x=>x.enabled).forEach(x=>S.selected.add(x.code));render();return} if(a==='clear-sources'){S.selected.clear();render();return} if(a.startsWith('toggle-org-')){const org=a.slice(11);S.routeOrgs.has(org)?S.routeOrgs.delete(org):S.routeOrgs.add(org);return} if(a.startsWith('toggle-')){const p=a.slice(7);S.collapsed.has(p)?S.collapsed.delete(p):S.collapsed.add(p);render();return}
|
||||
if(a==='start-precheck'){if(!S.selected.size){toast('请至少选择一个已启用来源实例。');return} toast('原型:正在使用任务创建前可用的最新有效文件。');setTimeout(()=>goto('precheck'),450);return}
|
||||
if(a==='execute'){toast('原型:已提交 Worker 执行。关闭页面不会取消后台任务。');setTimeout(()=>goto('run'),650);return} if(a==='requery'){toast('原型:仅重新查询所选异常的 ERP 库存;文件版本不变,未写入 ERP。');setTimeout(()=>goto('confirm'),500);return} if(a==='requery-precheck'){S.precheckRequery='loading';render();toast('原型:正在重新查询 INV-031 的 ERP 库存;未抓取 RPA 文件。');setTimeout(()=>{S.precheckRequery='matched';render();toast('原型:INV-031 已匹配并加入本次确认范围。');},900);return}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
### 3.1 一期实现
|
||||
|
||||
- 对话查询今天可调拨数量。
|
||||
- 按 DBS、Crane 或指定 Invoice 查询。
|
||||
- 按来源实例分组、路由或指定 Invoice 查询;DBS、Crane 仅为当前已配置的来源分组示例。
|
||||
- 检查当前业务日期的最新 `ready` 收料文件。
|
||||
- 文件缺失时实时触发 RPA,并在对话中持续展示进度。
|
||||
- 按 HUB 仓收料日期执行 D+1 成熟规则。
|
||||
@@ -73,8 +73,8 @@
|
||||
- 每日收料文件抓取排程,默认 08:00。
|
||||
- 每日自动调拨排程,默认 09:00。
|
||||
- 自动复核历史未成功且未人工关闭的 Invoice。
|
||||
- 安全恢复、手工重试、请求停止、人工关闭。
|
||||
- 一次自动调拨排程发送一条企业微信汇总通知并附异常 Excel。
|
||||
- 安全恢复、拆分的人工重试(重新抓取 RPA / 重新查询 ERP)、请求停止、人工关闭。
|
||||
- 一次自动调拨排程发送一条企业微信汇总通知;存在异常时附异常 Excel,空数据也发送通知但不附 Excel。
|
||||
- 全节点审计和 MinIO 归档。
|
||||
|
||||
### 3.2 一期不实现
|
||||
@@ -87,7 +87,6 @@
|
||||
- ERP 写操作自动技术重试。
|
||||
- `result_unknown` 自动重试。
|
||||
- 通知自动重试。
|
||||
- 空数据通知。
|
||||
- 业务删除和历史兼容层。
|
||||
|
||||
---
|
||||
@@ -171,7 +170,8 @@ source_code + business_date + file_purpose(receipt)
|
||||
| 选择 Invoice、确认执行 | 允许 |
|
||||
| 查看所有有权限用户发起的 Run | 允许 |
|
||||
| 请求停止剩余任务 | 允许,原因必填 |
|
||||
| 手工重试可重试项 | 允许 |
|
||||
| 重新抓取 RPA | 仅在任务创建前允许;创建 Run 后禁止更新文件 |
|
||||
| 重新查询 ERP | 任务创建后允许基于冻结文件执行;不触发 RPA、不写 ERP |
|
||||
| `manually_closed` | 允许,原因必填 |
|
||||
| 修改数量、仓库、ERP 组织 | 禁止 |
|
||||
| 删除业务或审计记录 | 禁止 |
|
||||
@@ -208,9 +208,11 @@ flowchart TD
|
||||
S --> T[Worker写入前重新预检]
|
||||
T --> U[逐项ERP原子调拨]
|
||||
U --> V[生成结果和异常Excel]
|
||||
V --> W{自动排程且非空数据}
|
||||
W -->|是| X[发送一条企微汇总通知和附件]
|
||||
W -->|否| Y[只保留Run和审计]
|
||||
V --> W{自动排程}
|
||||
W --> X[发送一条企微汇总通知]
|
||||
X --> Y{存在异常}
|
||||
Y -->|是| Z[附异常Excel]
|
||||
Y -->|否| AA[不附Excel]
|
||||
```
|
||||
|
||||
### 6.1 文件准备进度阶段
|
||||
@@ -225,7 +227,7 @@ flowchart TD
|
||||
8. 查询 ERP 库存。
|
||||
9. 匹配可调拨结果。
|
||||
|
||||
每阶段使用 `pending | running | success | failed | skipped`,并分别展示 DBS、Crane 状态,不伪造总体百分比。
|
||||
每阶段使用 `pending | running | success | failed | skipped`,并按来源实例/路由分别展示状态,不伪造总体百分比。
|
||||
|
||||
### 6.2 确认失效
|
||||
|
||||
@@ -314,7 +316,7 @@ pending
|
||||
→ success | partial_failed | failed
|
||||
```
|
||||
|
||||
DBS、Crane 独立执行、独立锁、独立审计,互不阻断。
|
||||
各来源实例独立执行、独立锁、独立审计,互不阻断;来源分组仅用于页面聚合,不是业务隔离键。
|
||||
|
||||
### 8.3 Invoice Item
|
||||
|
||||
@@ -365,7 +367,8 @@ pending
|
||||
| GET | `/api/in-transit-transfer/runs/{runNo}` | Run进度和结果 |
|
||||
| GET | `/api/in-transit-transfer/runs/{runNo}/items` | Invoice分页明细 |
|
||||
| POST | `/api/in-transit-transfer/runs/{runNo}/cancel` | 请求停止剩余任务 |
|
||||
| POST | `/api/in-transit-transfer/items/{id}/retry` | 原Run创建新Attempt |
|
||||
| POST | `/api/in-transit-transfer/items/{id}/retry-rpa` | 任务创建前重新抓取 RPA 并创建新文件 Attempt |
|
||||
| POST | `/api/in-transit-transfer/items/{id}/retry-erp` | 基于已冻结文件仅重新查询 ERP 并创建新预检 Attempt |
|
||||
| POST | `/api/in-transit-transfer/items/{id}/manual-close` | 人工关闭 |
|
||||
| GET | `/api/in-transit-transfer/runs/{runNo}/exceptions.xlsx` | 下载异常Excel |
|
||||
| GET | `/api/in-transit-transfer/items/{id}/audit` | 查询Invoice审计时间线 |
|
||||
@@ -486,7 +489,8 @@ ERP地址和凭据只允许通过环境变量或Secret注入。
|
||||
| 确认执行 | 用户 | 确认Hash、有效期、预计写入 |
|
||||
| ERP调拨 | worker | 状态前后、单号、错误码、脱敏报文Hash |
|
||||
| 请求停止 | 用户 | 原因和Run/Item前后状态 |
|
||||
| 手工重试 | 用户 | 原因、新Attempt和重新预检证据 |
|
||||
| 重新抓取 RPA | 用户 | 原因、新文件 Attempt、文件版本和重新预检证据;仅允许在任务创建前 |
|
||||
| 重新查询 ERP | 用户 | 原因、新 ERP 查询 Attempt 和重新预检证据;任务创建后不得更新文件 |
|
||||
| 自动历史复核 | 排程 | 每次保存摘要;相同结果引用前次完整快照 |
|
||||
| 人工关闭 | 用户 | 原因、数量、文件版本、状态前后 |
|
||||
| 查看详情/审计 | 用户 | 对象、时间、来源页面 |
|
||||
@@ -505,7 +509,7 @@ ERP地址和凭据只允许通过环境变量或Secret注入。
|
||||
|
||||
## 12. 企业微信与Excel
|
||||
|
||||
每次非空自动调拨排程发送一条汇总通知,DBS、Crane合并展示。接收人是任务所有者和来源配置通知人的去重合集。
|
||||
每次自动调拨排程(包括空数据)发送一条汇总通知,按来源实例/路由聚合展示。接收人是任务所有者和来源配置通知人的去重合集。
|
||||
|
||||
通知包含:
|
||||
|
||||
@@ -513,7 +517,7 @@ ERP地址和凭据只允许通过环境变量或Secret注入。
|
||||
- 历史异常恢复成功数量。
|
||||
- 当前待处理、`result_unknown`、3天以上积压数量。
|
||||
- 调拨总数量和ERP单据数。
|
||||
- 一份本次排程异常Excel。
|
||||
- 存在异常时附一份本次排程异常Excel;空数据不附Excel。
|
||||
|
||||
Excel Sheet:
|
||||
|
||||
@@ -525,7 +529,7 @@ Excel Sheet:
|
||||
6. 通知失败
|
||||
7. 原始文件追溯
|
||||
|
||||
空数据Run:`success + no_data`,不调用ERP、不通知。
|
||||
空数据Run:`success + no_data`,不调用ERP,但仍发送一条“无可调拨数据”企业微信汇总通知,不附异常 Excel。
|
||||
|
||||
---
|
||||
|
||||
@@ -540,7 +544,7 @@ Excel Sheet:
|
||||
│ │ 今日待处理 │
|
||||
│ 历史会话 │ 历史待处理 5 已恢复 2 结果未知 1 超期 2 │
|
||||
│ 今日自动调拨 │ │
|
||||
│ DBS数量异常 │ [查询今天可调拨数据] │
|
||||
│ 来源实例数量异常 │ [查询今天可调拨数据] │
|
||||
│ INV-001处理结果 │ [执行今天全部可调拨项] │
|
||||
│ │ [查看待处理异常] │
|
||||
│ │ │
|
||||
@@ -559,14 +563,14 @@ Excel Sheet:
|
||||
```text
|
||||
用户:查询今天有多少可以调拨
|
||||
|
||||
AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取。
|
||||
AI:正在检查已选来源实例的收料文件;缺失来源会实时抓取。
|
||||
|
||||
┌─ 正在准备可调拨数据 ──────────────────────────────┐
|
||||
│ 可处理收料日期 截至 2026-08-05 │
|
||||
│ 当前阶段 准备收料Excel │
|
||||
│ │
|
||||
│ DBS ✓ 复用今日08:00 ready文件 │
|
||||
│ Crane ◉ 未找到今日文件,RPA已领取,等待Callback │
|
||||
│ DBS-AWSBI ✓ 复用今日08:00 ready文件 │
|
||||
│ AWS-SG ◉ 未找到今日文件,RPA已领取,等待Callback│
|
||||
│ │
|
||||
│ 后续:校验 → 过滤未成熟 → 汇总 → ERP查询 → 匹配 │
|
||||
│ [刷新进度] │
|
||||
@@ -596,10 +600,10 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
```text
|
||||
┌─ 执行前确认 ──────────────────────────────────────┐
|
||||
│ 搜索Invoice [_______________________________] │
|
||||
│ [✓] INV-001 DBS 1,200 = 1,200 可执行 │
|
||||
│ [✓] INV-002 DBS 800 = 800 可执行 │
|
||||
│ [ ] INV-003 DBS 1,200 ≠ 1,000 已阻断 │
|
||||
│ [✓] INV-004 Crane 600 = 600 可执行 │
|
||||
│ [✓] INV-001 DBS-AWSBI 1,200 = 1,200 可执行 │
|
||||
│ [✓] INV-002 DBS-AWSBI 800 = 800 可执行 │
|
||||
│ [ ] INV-003 AWS-SG 1,200 ≠ 1,000 已阻断 │
|
||||
│ [✓] INV-004 Crane-EU 600 = 600 可执行 │
|
||||
│ │
|
||||
│ 已选择 3张 总数量 2,600 PCS ERP写入 3张 │
|
||||
│ 确认有效期 10分钟 │
|
||||
@@ -638,7 +642,7 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
|
||||
```text
|
||||
┌─ INV-260806-019 ──────────────────────────────────┐
|
||||
│ 来源 DBS 状态 数量不一致 │
|
||||
│ 来源实例 DBS-AWSBI 状态 数量不一致 │
|
||||
│ 文件 receipt-v20.xlsx Sheet Receipt │
|
||||
│ 原始行 128、129 收料 1,200 / ERP 1,000 │
|
||||
│ │
|
||||
@@ -647,10 +651,12 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
│ 09:02 ERP查询完成 │
|
||||
│ 09:02 数量门禁阻断 │
|
||||
│ │
|
||||
│ [下载证据] [手工重试] [无需再处理] │
|
||||
│ [重新查询ERP] [重新抓取RPA] [无需再处理] │
|
||||
└────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
`重新抓取RPA` 仅在尚未创建调拨 Run 的文件准备阶段可用;Run 创建后按钮禁用,异常项只能使用“重新查询 ERP”。
|
||||
|
||||
### 13.8 人工关闭
|
||||
|
||||
```text
|
||||
@@ -671,7 +677,7 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
┌─ HXOPS管理后台 ───────────────────────────────────────────────────┐
|
||||
│ 调拨配置 │
|
||||
│ ● 数据来源 ┌─ 收料文件来源 ──────────────────────────────┐ │
|
||||
│ 调拨策略 │ DBS收料汇总 Crane收料汇总 │ │
|
||||
│ 调拨策略 │ DBS-AWSBI收料 AWS-SG收料 │ │
|
||||
│ 仓库与组织 │ 用途 receipt 用途 receipt │ │
|
||||
│ 自动排程 │ RPA Profile HTTP Callback │ │
|
||||
│ 通知设置 │ 解析方案 V3 解析方案 V3 │ │
|
||||
@@ -708,13 +714,13 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
|
||||
```text
|
||||
┌─ 自动排程 ──────────────────────────────────────────────────────┐
|
||||
│ 每日收料文件抓取 08:00 DBS、Crane并发2 [编辑][停用] │
|
||||
│ 每日收料文件抓取 08:00 已启用来源实例并发2 [编辑][停用] │
|
||||
│ 每日自动调拨 09:00 查询并发2 / 写并发1 [编辑][停用] │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
┌─ 通知设置 ──────────────────────────────────────────────────────┐
|
||||
│ 任务所有者 李仓储 额外通知人 王仓管、陈主管 │
|
||||
│ 非空Run一条汇总通知 一份七Sheet异常Excel │
|
||||
│ 空数据不通知 notification_failed不改变业务结果 │
|
||||
│ 每个Run一条汇总通知 有异常时附七Sheet Excel │
|
||||
│ 空数据发送通知(不附Excel) notification_failed不改变业务结果 │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
┌─ 发布门禁与审计 ────────────────────────────────────────────────┐
|
||||
│ 来源 ✓ 映射 ✓ 环境变量 ✓ 通知人 ! 配置验证 ✓ │
|
||||
@@ -744,7 +750,7 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
| `frontend/src/features/admin/modules/shipping-inventory/ShippingInventoryPage.vue` | 复用现有页面增加收料来源字段,不新增管理页 |
|
||||
| `frontend/src/features/admin/modules/shipping-inventory/shippingInventorySourceForm.ts` | 表单归一化、校验和脏状态比较 |
|
||||
| `frontend/src/features/admin/api/admin.api.ts` | 扩展来源DTO |
|
||||
| `docs/platform/in-transit-transfer-source-instance-mvp.html` | Chat 摘要发起、来源实例选择、文件冻结预检、异常 ERP 重查、组织→路由→Invoice 聚合确认与 Run/待处理跳转 |
|
||||
| `docs/features/in-transit-transfer/in-transit-transfer-source-instance-mvp.html` | Chat 摘要发起、来源实例选择、文件冻结预检、异常 ERP 重查、组织→路由→Invoice 聚合确认与 Run/待处理跳转 |
|
||||
| `docs/demand.md`、`docs/tec.md`、`docs/funclist.md` | 同步需求、架构和功能清单 |
|
||||
|
||||
#### 新增文件
|
||||
@@ -800,7 +806,7 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
| `frontend/src/features/chat/components/TransferInvoiceDetailDrawer.vue` | Invoice明细 |
|
||||
| 对应前后端测试 | 文件幂等、日期、解析、汇总、ERP查询、历史恢复 |
|
||||
|
||||
验收:缺文件时5秒内返回进度卡;并发请求只触发一次RPA;当天收料100%不查ERP;多行汇总准确率100%;DBS失败不影响Crane;历史会话可恢复进度;同一查询Run在历史侧栏中始终只有一条会话记录。
|
||||
验收:缺文件时5秒内返回进度卡;并发请求只触发一次RPA;当天收料100%不查ERP;多行汇总准确率100%;任一来源实例失败不影响其他来源实例;历史会话可恢复进度;同一查询Run在历史侧栏中始终只有一条会话记录。
|
||||
|
||||
### Phase 2:确认和ERP调拨
|
||||
|
||||
@@ -858,7 +864,7 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
| `backend/app/services/schedule/in_transit_transfer_job.py` | 09:00自动调拨排程 |
|
||||
| `backend/app/services/in_transit_transfer/backlog_service.py` | 历史待处理池和老化 |
|
||||
| `backend/app/services/in_transit_transfer/recovery_service.py` | 自动复核和新Attempt |
|
||||
| `backend/app/services/in_transit_transfer/retry_service.py` | 手工重试 |
|
||||
| `backend/app/services/in_transit_transfer/retry_service.py` | 校验人工重试状态门禁,并分派至重新抓取 RPA 或重新查询 ERP |
|
||||
| `backend/app/services/in_transit_transfer/manual_close_service.py` | 人工关闭 |
|
||||
| `backend/app/services/in_transit_transfer/excel_export.py` | 七Sheet Excel |
|
||||
| `backend/app/services/in_transit_transfer/notification.py` | 一次排程一条企微通知 |
|
||||
@@ -956,8 +962,8 @@ AI:正在检查今天的DBS和Crane收料文件;缺失来源会实时抓取
|
||||
5. 未确认、过期确认、变化预检的ERP写入数量均为0。
|
||||
6. `result_unknown`自动重试数量为0。
|
||||
7. 历史可恢复项能自动进入新Attempt,旧Attempt不变。
|
||||
8. DBS和Crane故障互不影响。
|
||||
9. 非空自动排程仅发送一条汇总通知和一份Excel。
|
||||
8. 任一来源实例故障不影响其他来源实例。
|
||||
9. 每个自动排程Run恰好发送一条汇总通知;有异常时附一份Excel,空数据不附Excel。
|
||||
10. 前端构建、四语言、专项测试、E2E、迁移和真实ERP沙箱验收全部通过。
|
||||
11. 查询、文件准备、ERP预检在一次对话中原位投影,历史侧栏不产生重复阶段记录。
|
||||
12. 后台配置必须经过草稿、校验、发布流程;ERP与RPA凭据明文展示数量为0。
|
||||
@@ -3,7 +3,7 @@
|
||||
> 评审状态:**开发部门内部评审稿**。
|
||||
> 适用读者:产品、前端、后端、测试、架构/运维;仓储业务与 ERP 团队可按需参阅。
|
||||
> 本文目标:用于内部确认 MVP 的实现范围、用户操作、页面跳转、前后端职责和高风险边界;不是开发任务拆分或测试用例替代品。
|
||||
> 唯一原型基线:[来源实例路由化 MVP 可点击原型](../../platform/in-transit-transfer-source-instance-mvp.html)。
|
||||
> 唯一原型基线:[来源实例路由化 MVP 可点击原型](./in-transit-transfer-source-instance-mvp.html)。
|
||||
> 业务全量规格参考:[一期最小化实现规格](./minimum-implementation-spec.md)。
|
||||
|
||||
---
|
||||
@@ -27,7 +27,7 @@
|
||||
| 材料 | 本次用途 | 评审时的使用原则 |
|
||||
| --- | --- | --- |
|
||||
| 本文 | 议程、范围、场景、评审结论记录 | **本次会议主材料** |
|
||||
| [可点击原型](../../platform/in-transit-transfer-source-instance-mvp.html) | 页面布局、跳转与操作反馈演示 | **唯一 UI/UX 基线** |
|
||||
| [可点击原型](./in-transit-transfer-source-instance-mvp.html) | 页面布局、跳转与操作反馈演示 | **唯一 UI/UX 基线** |
|
||||
| [一期最小化实现规格](./minimum-implementation-spec.md) | 后端、审计、文件、排程、验收的完整约束 | 业务规则的完整参考 |
|
||||
| [PRD](./prd.md) | 业务价值、问题背景、角色与范围 | 背景参考;其中旧原型链接不作为本次 UI 基线 |
|
||||
| [路线图](./roadmap.md) | 分阶段投入、依赖和上线门禁 | 排期与资源讨论参考 |
|
||||
@@ -80,7 +80,7 @@
|
||||
| R10 | 路由是确认与审计边界 | 路由键:`来源实例 + ERP 组织 + 来源仓 + 目标仓`;不同路由不能被汇总为一个统一 HUB 仓 |
|
||||
| R11 | `result_unknown` 只读 | 不允许重查、关闭、恢复、再次执行或猜测其 ERP 业务结果 |
|
||||
| R12 | 异常可关闭也可恢复 | `manually_closed` 必须填写原因;恢复也必须记录原因;不删除历史 |
|
||||
| R13 | 自动任务隔离 | 一个来源实例失败不能阻断其他来源实例;每个自动 Run 只发一条汇总企业微信通知 |
|
||||
| R13 | 自动任务隔离 | 一个来源实例失败不能阻断其他来源实例;每个自动 Run(包括空数据)只发一条汇总企业微信通知,有异常时附 Excel |
|
||||
|
||||
## 5. MVP 用户、权限与职责
|
||||
|
||||
@@ -344,7 +344,7 @@ stateDiagram-v2
|
||||
| 执行恢复 | 页面关闭或 SSE 断开不取消后台 Run;重新进入可恢复固定结果 |
|
||||
| 异常 | `result_unknown` 下重查/关闭/恢复/再次执行次数均为 0;关闭/恢复原因必填 |
|
||||
| 审计 | 关键业务操作与证据读取/下载的审计字段完整率 100% |
|
||||
| 自动任务 | 单个来源实例失败不阻断其他实例;每个非空自动 Run 企业微信汇总通知为 1 条 |
|
||||
| 自动任务 | 单个来源实例失败不阻断其他实例;每个自动 Run(包括空数据)企业微信汇总通知为 1 条,有异常时附 Excel |
|
||||
|
||||
## 15. 90 分钟开发部门内部评审议程与决策记录
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
- [完整规格说明书](./minimum-implementation-spec.md)
|
||||
- [TDD实施与验证规范](./in-transit-transfer-tdd.md)
|
||||
- [开发部门需求与原型评审包](./mvp-requirements-and-prototype-review-pack.md)
|
||||
- [来源实例路由化 MVP 原型](../../platform/in-transit-transfer-source-instance-mvp.html)
|
||||
- [来源实例路由化 MVP 原型](./in-transit-transfer-source-instance-mvp.html)
|
||||
|
||||
---
|
||||
|
||||
@@ -64,7 +64,7 @@ M2不是一期最终完成,只是为了尽早验证真实业务价值的受控
|
||||
- **业务真相确定性:** Dify只理解意图和组织对话,不判断最终库存、不持有ERP写权限。
|
||||
- **读取与写入分离:** 查询、预检、确认、执行为不同状态;没有有效确认不得写ERP。
|
||||
- **按Invoice隔离:** 自动Run采用逐项结果,只执行可执行项;单项失败不阻断其他Invoice。
|
||||
- **来源隔离:** DBS与Crane只是不同调拨源,各自准备文件和报告状态,互不影响。
|
||||
- **来源隔离:** 来源实例各自准备文件和报告状态,互不影响;来源分组只用于聚合展示。
|
||||
- **失败不遗忘:** 未成功且未`manually_closed`的可恢复项进入待处理池;下一排程重新预检并创建新Attempt。
|
||||
- **结果未知隔离:** `result_unknown`禁止自动重试,必须执行人工核实SOP。
|
||||
- **全链路审计:** 所有读取、下载、确认、执行、重试、关闭、配置和发布节点均可追溯。
|
||||
@@ -74,13 +74,13 @@ M2不是一期最终完成,只是为了尽早验证真实业务价值的受控
|
||||
|
||||
- 现有Chat中的专用自动调拨Agent。
|
||||
- 对话查询、文件准备进度、预检、选择、确认、执行、结果、异常和审计。
|
||||
- DBS RPA和Crane HTTP Callback收料来源。
|
||||
- 已配置来源实例的 RPA / HTTP Callback 收料来源。
|
||||
- 当前业务日期最新Ready累计全量文件。
|
||||
- D+1成熟规则、Invoice多行收料数量汇总、精确数量匹配。
|
||||
- ERP账面库存查询及单接口原子新建、审核、过账。
|
||||
- Invoice幂等、重复成功识别、结果未知隔离。
|
||||
- 08:00文件获取、09:00自动调拨、历史失败恢复、3/5/7天老化机制。
|
||||
- 每个非空自动Run一条企业微信汇总通知和一份七Sheet异常Excel。
|
||||
- 每个自动Run一条企业微信汇总通知;有异常时附七Sheet异常Excel,空数据不附Excel。
|
||||
- 人工重试、请求停止、人工关闭及完整审计。
|
||||
- 来源、策略、映射、排程、通知、校验和发布配置。
|
||||
- 四语言、基础移动端适配、MinIO证据和归档。
|
||||
@@ -107,7 +107,7 @@ M2不是一期最终完成,只是为了尽早验证真实业务价值的受控
|
||||
| Phase 0 契约与测试底座 | 团队对业务真相和外部接口形成一致理解 | ERP/文件契约、状态机、DTO、审计模型、Fake、迁移草案 | 核心L0测试从Red到Green;ERP沙箱契约可执行 |
|
||||
| Phase 1 文件与只读预检 | 仓储用户能查到“哪些可调拨、为什么” | 文件准备、D+1、汇总、ERP查询、Chat进度与预检 | 当天收料ERP调用0;缺文件5秒内反馈;来源互不阻断 |
|
||||
| Phase 2 确认与ERP写入 | 对话发起的一次确认调拨闭环 | 确认Hash、写前复检、Worker、ERP原子写、结果卡 | 未确认/过期/变化写入0;重复建单0;单号可追溯 |
|
||||
| Phase 3 排程与异常闭环 | 系统每日自动处理且不会遗忘失败项 | 排程、待办池、新Attempt、老化、Excel、企微、配置发布 | 可恢复项100%重新预检;非空Run恰好1条通知 |
|
||||
| Phase 3 排程与异常闭环 | 系统每日自动处理且不会遗忘失败项 | 排程、待办池、新Attempt、老化、Excel、企微、配置发布 | 可恢复项100%重新预检;每个Run恰好1条通知 |
|
||||
| Phase 4 生产硬化与上线 | 满足生产安全、稳定和运维要求 | 性能、故障注入、安全、归档、指标、UAT、上线方案 | P0/P1为0;全量门禁通过;业务和ERP签字 |
|
||||
| Phase 5 优化与平台演进 | 降低新增来源/ERP Operation接入成本 | 薄集成内核、Operation元数据、连接器治理、SLO | 新Operation无需改核心编排;迁移演练成功 |
|
||||
|
||||
@@ -211,7 +211,7 @@ ERP契约和结果未知SOP未关闭时,可以完成纯领域和前端Mock工
|
||||
### 5.2 用户能力
|
||||
|
||||
- 查询今天、指定日期、指定来源或指定Invoice的可调拨情况。
|
||||
- 查看DBS和Crane独立的文件准备状态。
|
||||
- 查看各来源实例独立的文件准备状态。
|
||||
- 查看未成熟、可执行、数量不一致、ERP无库存和文件异常。
|
||||
- 查看可调拨总数量和预计ERP单据数。
|
||||
- 下载只读预检明细和查看原始行追溯。
|
||||
@@ -251,7 +251,7 @@ ERP契约和结果未知SOP未关闭时,可以完成纯领域和前端Mock工
|
||||
|
||||
- 对话首次进度反馈不晚于5秒。
|
||||
- 不显示无法解释的单一Spinner;必须显示当前来源、阶段和最近更新时间。
|
||||
- DBS失败时Crane继续,反之亦然。
|
||||
- 任一来源实例失败时其他来源实例继续。
|
||||
- 当天收料显示`not_matured`,不显示为ERP异常。
|
||||
- 查询和文件准备不会显示“执行成功”等写入语义。
|
||||
- 刷新、切换会话或SSE断开后从Run投影恢复。
|
||||
@@ -261,7 +261,7 @@ ERP契约和结果未知SOP未关闭时,可以完成纯领域和前端Mock工
|
||||
- [ ] 有当日Ready文件时正确复用最新有效版本。
|
||||
- [ ] 无Ready文件时,同来源并发请求只创建一个活动Source Job。
|
||||
- [ ] 缺文件后5秒内返回来源级进度。
|
||||
- [ ] DBS和Crane故障互不影响。
|
||||
- [ ] 任一来源实例故障不影响其他来源实例。
|
||||
- [ ] 相同Invoice多行汇总准确率100%,原始行追溯完整率100%。
|
||||
- [ ] 当天收料ERP查询和写入均为0。
|
||||
- [ ] 数量只有完全相等时为`executable`。
|
||||
@@ -356,10 +356,10 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
|
||||
- 默认08:00执行收料文件获取,09:00执行自动调拨。
|
||||
- 自动调拨始终调用统一文件准备服务,不假设08:00一定成功。
|
||||
- 单个自动调拨排程可来源级多线程处理DBS和Crane;ERP写并发仍默认1。
|
||||
- 单个自动调拨排程可按来源实例并发处理;ERP写并发仍默认1。
|
||||
- 当前来源失败不阻断其他来源。
|
||||
- 每个非空自动Run只发送一条企业微信汇总通知和一份异常Excel。
|
||||
- 空数据为`success + no_data`,不通知。
|
||||
- 每个自动Run只发送一条企业微信汇总通知;有异常时附一份异常Excel,空数据不附Excel。
|
||||
- 空数据为`success + no_data`,仍发送一条“无可调拨数据”通知,不附Excel。
|
||||
- 通知失败记录`notification_failed`,不改变ERP业务结果且不自动重试。
|
||||
|
||||
### 7.3 历史失败恢复矩阵
|
||||
@@ -386,7 +386,7 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
| 计划新增 | `backend/app/services/schedule/in_transit_transfer_job.py` | 09:00自动调拨任务 |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/backlog_service.py` | 待处理池、3/5/7天老化和责任人 |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/recovery_service.py` | 最新快照重新预检和新Attempt |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/retry_service.py` | 合法状态人工重试 |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/retry_service.py` | 合法状态人工重试,并区分重新抓取 RPA 与重新查询 ERP |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/manual_close_service.py` | 原因必填、永久关闭和审计 |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/excel_export.py` | 七Sheet异常Excel、Hash和原始行追溯 |
|
||||
| 计划新增 | `backend/app/services/in_transit_transfer/notification.py` | 企业微信汇总、人员去重和独立失败状态 |
|
||||
@@ -413,7 +413,7 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
3. `Failed_Items`:明确业务失败和技术失败。
|
||||
4. `Result_Unknown`:结果未知、Operation ID和人工核实提示。
|
||||
5. `Backlog_Aging`:待处理年龄、3/5/7天等级和责任人。
|
||||
6. `Source_Status`:DBS/Crane文件、checksum、准备结果和错误。
|
||||
6. `Source_Status`:来源实例文件、checksum、准备结果和错误。
|
||||
7. `Raw_Line_Trace`:Invoice对应Sheet、行号、原始数量和文件版本。
|
||||
|
||||
### 7.7 阶段验收
|
||||
@@ -424,8 +424,8 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
- [ ] 每次恢复创建新Attempt,旧Attempt不变。
|
||||
- [ ] `result_unknown`和`manually_closed`自动ERP写入均为0。
|
||||
- [ ] 3/5/7天老化等级和通知对象准确率100%。
|
||||
- [ ] 每个非空自动Run企业微信汇总通知恰好1条。
|
||||
- [ ] 空数据Run通知0条。
|
||||
- [ ] 每个自动Run(包括空数据)企业微信汇总通知恰好1条。
|
||||
- [ ] 空数据通知不附异常Excel,且ERP调用数为0。
|
||||
- [ ] 七Sheet名称、字段、行数和Hash验证全部通过。
|
||||
- [ ] 通知失败不改变ERP业务状态。
|
||||
- [ ] 配置草稿、校验、Diff、发布和回滚均有完整审计。
|
||||
@@ -482,8 +482,8 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
|
||||
### 8.5 UAT场景
|
||||
|
||||
- DBS Ready复用和实时RPA获取。
|
||||
- Crane Callback正常、延迟、重复和来源不匹配。
|
||||
- 来源实例 Ready复用和实时RPA获取。
|
||||
- HTTP Callback正常、延迟、重复和来源不匹配。
|
||||
- 当天收料不进入ERP。
|
||||
- Invoice多行汇总后数量精确匹配。
|
||||
- 用户取消部分可执行项并确认执行。
|
||||
@@ -491,7 +491,7 @@ Phase 2完成后可以在ERP测试组织进行端到端试点。若申请小范
|
||||
- 页面关闭后Run继续,重新登录恢复。
|
||||
- 自动排程处理新增项和历史可恢复项。
|
||||
- `result_unknown`人工核实、人工关闭和审计。
|
||||
- 非空Run一条通知和七Sheet Excel;空数据不通知。
|
||||
- 每个Run一条通知;有异常时附七Sheet Excel,空数据不附Excel。
|
||||
- ERP测试组织创建、审核、过账并作废真实测试单。
|
||||
|
||||
### 8.6 上线策略
|
||||
@@ -658,7 +658,7 @@ ERP SOAP / HTTP / 未来其他系统
|
||||
| --- | --- | --- | --- |
|
||||
| Q1 | ERP正式WSDL、字段、错误码、超时和可留存脱敏字段是什么? | Phase 0退出前 | 禁止进入真实ERP写入开发 |
|
||||
| Q2 | ERP写超时后的人工核实SOP、责任人和完成时限是什么? | Phase 0退出前 | `result_unknown`无法安全运营 |
|
||||
| Q3 | DBS/Crane正式收料样例、Sheet、表头和结构漂移规则是否齐全? | Phase 1开始前 | 文件解析和汇总验收不可执行 |
|
||||
| Q3 | 各启用来源实例正式收料样例、Sheet、表头和结构漂移规则是否齐全? | Phase 1开始前 | 文件解析和汇总验收不可执行 |
|
||||
| Q4 | 企业微信附件上限是否满足最大七Sheet Excel? | Phase 3开始前 | 需要切换为受控下载链接方案 |
|
||||
| Q5 | 自动调拨完成率正式目标和人工处理基线是多少? | Phase 4上线前 | 无法证明业务收益 |
|
||||
| Q6 | 所有Agent授权用户查看同权限Run的范围是否通过安全评审? | Phase 2上线前 | 可能产生跨用户数据暴露 |
|
||||
@@ -720,7 +720,7 @@ ERP SOAP / HTTP / 未来其他系统
|
||||
### 13.3 技术与体验指标
|
||||
|
||||
- 文件准备、解析、ERP查询、匹配、写入和通知各阶段P50/P95耗时。
|
||||
- DBS/Crane来源成功率和超时率。
|
||||
- 各来源实例成功率和超时率。
|
||||
- ERP业务失败、技术失败、重复成功和结果未知占比。
|
||||
- Chat首次进度反馈和Run恢复成功率。
|
||||
- 企业微信通知和附件发送成功率。
|
||||
@@ -790,5 +790,5 @@ ERP SOAP / HTTP / 未来其他系统
|
||||
|
||||
### 16.4 推荐下一步
|
||||
|
||||
召开一次Phase 0启动评审,只关闭四项:ERP WSDL及错误语义、结果未知人工SOP、DBS/Crane正式样例、权限范围。评审通过后,严格从TDD文档的L0失败测试和Fake ERP开始开发,不先写完整业务实现。
|
||||
召开一次Phase 0启动评审,只关闭四项:ERP WSDL及错误语义、结果未知人工SOP、各启用来源实例正式样例、权限范围。评审通过后,严格从TDD文档的L0失败测试和Fake ERP开始开发,不先写完整业务实现。
|
||||
|
||||
@@ -213,6 +213,9 @@ WYC26071501
|
||||
- 建单后工作台会持久展示订单解析结果;若新订单与旧任务同 PO 但字段冲突,系统会标出冲突并停住后续库存步骤,需您选择保留旧值、采用新值或手工修正后再继续。
|
||||
- **要求交期、供应商料号、币种** 按**明细行**解析与导出;若 PDF 仅有一个文档级交期或币种,系统会回填到各行。
|
||||
- **单价、金额、币种** 主要用于展示与导出,**不参与**「够不够货」的自动比对。
|
||||
- 邮件正文补充字段与 PDF 的差异会明确展示字段、PDF/邮件双方取值和证据位置;单价等金额字段会先按数值语义比较,`1731.6`、`1731.60`、`1,731.60` 不属于冲突。同一 PO 的不同料号不会互相比较单价。
|
||||
- 旧订单若只留下“补充来源字段冲突”而没有可展示的双方证据,系统不会静默放行;会显示“历史证据不足,建议重新识别此 PDF”。管理员重评估后,格式差异会解除,真实差异仍要求复核。
|
||||
- 点击「保存并校验」后,如已满足自动建单资格,页面会显示“已自动入队建单并推进”;该提示表示后台 Worker 已接手,实际进度仍以任务处理状态为准。
|
||||
- 若库存文件缺少发布方案要求的 Reservation ID、内部料号或数量栏位,系统会拒绝本次文件并提示管理员检查库存文件解析方案。
|
||||
|
||||
**订单行示例**(便于理解系统解析目标):
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
# 订单复核工作台文件切换性能优化与验收(2026-08-21)
|
||||
|
||||
## 1. 目标与边界
|
||||
|
||||
本次只优化订单复核工作台左侧文件队列的读取编排,不改变订单事实、草稿、确认建单、权限、访问审计或 Dify 业务边界。用户切换文件时,系统必须以最新选择为准;已过期的浏览器读取不得继续消耗不必要的服务端投影资源,更不得覆盖最新 Case。
|
||||
|
||||
不把单次浏览器网络截图直接等同于数据库慢查询结论。生产慢点须以本次增加的响应分段指标和真实 PostgreSQL 证据继续确认。
|
||||
|
||||
## 2. 根因证据
|
||||
|
||||
2026-08-21 的浏览器 Network 截图显示:
|
||||
|
||||
- `GET .../review` 约 89 ms 与 478 ms;
|
||||
- `GET .../evidence` 约 71 ms;
|
||||
- Case 快照约 656 ms;
|
||||
- 相同 `SNER-20260821-5A563840` Run 读取出现两次,约 3.38 s 与 7.85 s,是当次最长请求。
|
||||
|
||||
代码链路确认:左侧 Case 切换由 `useShippingOrderReview.selectCase()` 并发读取 Case 快照和证据;聊天 Run 状态轮询也读取同一完整 Run DTO。`serialize_workspace_run()` 会读取 Unit、进度事件、Candidate、Review Case 与处理项;最小 SQLite 采样已有 9 条 SQL,且其中包含重复的进度事件、Candidate、Review Case 读取。该采样只能说明投影并非轻量接口,不能外推生产耗时。
|
||||
|
||||
因此已确认的根因是“重型 Run 投影被并发/重叠读取”和“快速切换仅丢弃旧结果、未取消旧 Case/evidence 请求”。截图缺少 HAR Initiator 与 PostgreSQL 执行计划,不能断言两条 SNER 都由单次切换直接发起,也不能在没有 `EXPLAIN (ANALYZE, BUFFERS)` 前猜测索引。
|
||||
|
||||
## 3. 已实施方案
|
||||
|
||||
### 3.1 同一 Run 的在途请求合并
|
||||
|
||||
`getWorkspaceShippingOrderExtractionRun()` 按 `run_no` 保存仅在途的 Promise。多个组件同时读取同一 Run 时复用一条 HTTP 请求;完成、失败或 10 秒超时后立即移除,不缓存已完成业务数据。调用方已取消只影响其发起前的调用,不取消其他消费者共享的读取。
|
||||
|
||||
这是“request coalescing / single-flight”模式,用于消除同一资源在客户端组件间的重复昂贵读取,同时不引入可能过期的客户端业务缓存。
|
||||
|
||||
### 3.2 latest-wins 的 Case 切换
|
||||
|
||||
Case 快照与 evidence API 接受可选 `AbortSignal`。每次 `selectCase()` 新建一个联合取消控制器,并先取消上一次 Case/evidence 读取;组件卸载、重新加载 Run 时同样取消。既有 `caseLoadGeneration` 与 `requestedCaseNo` 双校验继续保留,防止已到达但过期的响应写回 UI。
|
||||
|
||||
这符合交互型浏览器读取的 latest-wins 模式:取消只终止当前 HTTP 读取,绝不取消后台 Run、草稿保存、确认建单或审计语义。
|
||||
|
||||
### 3.3 服务端可观测性
|
||||
|
||||
`GET /api/workspace/shipping-notice/order-extraction-runs/{run_no}` 返回:
|
||||
|
||||
```text
|
||||
Server-Timing: run_lookup;dur=<ms>, workspace_projection;dur=<ms>
|
||||
```
|
||||
|
||||
它只包含耗时,不包含订单字段、PDF/EML 正文、对象存储定位、Prompt、凭据或其他敏感内容。浏览器 HAR 可据此区分 Run 查询与工作台投影,作为下一轮优化是否需要 PostgreSQL 计划分析或轻量 DTO 的依据。
|
||||
|
||||
## 4. 验收与回归证据
|
||||
|
||||
- 前端 TDD:新增同 Run 并发读取用例先验证 RED(两次调用会发出两条请求),实现后通过。
|
||||
- 前端 TDD:新增快速切换时必须 abort 旧 Case 快照用例先验证 RED,实施后通过。
|
||||
- 后端 TDD:新增 `Server-Timing` Header 断言先验证 RED,实施后通过。
|
||||
- 前端定向回归:`npm run test:unit -- --run src/features/chat/api/shipping.api.request-dedupe.spec.ts src/features/chat/shipping/useShippingOrderExtractionRuns.spec.ts src/features/chat/shipping-review/useShippingOrderReview.spec.ts`,58 passed。
|
||||
- 后端定向回归:`backend\\.venv\\Scripts\\python.exe -m pytest tests/test_shipping_order_extraction_runs.py -k "partial_success_isolated_per_pdf" -q`,1 passed。
|
||||
- `git diff --check` 通过;工作区中存在与本次无关的既有 CRLF 提示和未提交改动,未改写。
|
||||
|
||||
完整后端整模块测试已启动并跑完,但当前终端执行器截断了最终汇总,不能将其作为通过证据;需在 CI 或本地保留完整日志后再登记。
|
||||
|
||||
本机运行态只读探测(2026-08-21):前端 Vite 服务 `127.0.0.1:3080` 与后端服务 `127.0.0.1:5052` 均可连接;未携带凭据读取目标 Run API 返回 `401`,符合用户态读取鉴权边界。因此不能在无已登录业务会话、也不读取或构造凭据的前提下,取得真实 Run 的 `Server-Timing` 或模拟左侧文件切换。
|
||||
|
||||
## 5. 上线后的真实 HAR 验收
|
||||
|
||||
1. 在生产同版本数据下打开 Network,勾选 Preserve log,并连续快速切换至少三个不同文件。
|
||||
2. 确认同一时刻同一 `SNER` 只保留一条在途完整 Run GET;被跳过的 Case/evidence 请求应显示为 cancelled 或不再继续占用网络。
|
||||
3. 打开其中一条 Run GET 的 Response Headers,记录 `Server-Timing` 两段耗时、总耗时、响应大小与 Initiator。
|
||||
4. 若 `workspace_projection` 持续为主耗时,使用真实 PostgreSQL 对对应查询执行 `EXPLAIN (ANALYZE, BUFFERS)`,再决定是否批量预取、消除重复查询或拆分只读轻量 DTO。
|
||||
5. 若 `run_lookup` 或连接等待为主耗时,检查连接池、慢 SQL、锁等待和网络路径;不得直接凭截图新增索引。
|
||||
|
||||
建议门槛:同一 Run 的重复重型 GET 为 0;非目标 Case 不得回写 UI;保留基线与优化后 p50/p95、取消数、`Server-Timing` 分段的对比。达到门槛后才可以宣称生产切换性能验收完成。
|
||||
|
||||
## 6. Dify 手工配置说明
|
||||
|
||||
本性能改动不要求修改 Dify:不新增画布、变量、Prompt、Tool、Provider 或密钥。订单抽取、Review Case、草稿、确认建单和本次读取治理均由 HXOPS 负责。
|
||||
|
||||
若环境已启用 `order-review-llm.v1` 字段建议分支,管理员仅做非破坏性核验:该分支不得调用业务写 Tool、自动确认、冻结或建单;Provider 不可用时人工复核仍可继续。不得在 Dify 中填写或复制任何 `Server-Timing`、请求 ID、订单正文、凭据或对象存储地址。
|
||||
|
||||
## 7. 后续决策
|
||||
|
||||
当前不新增“轻量 Run API”,因为尚无真实 `Server-Timing` 与 PostgreSQL 执行计划证明现有 DTO 的哪一段是主耗时。该接口只能在上述 HAR 验收显示投影持续主导、且字段消费边界清晰时,以独立契约、权限审查、审计与回归测试方式引入。
|
||||
|
||||
## 8. 最终阶段验收合规报告
|
||||
|
||||
| 阶段 | 目标与关键节点 | Review 结论 | 证据与状态 |
|
||||
| --- | --- | --- | --- |
|
||||
| 0:根因与基线 | 区分 Case/evidence 与完整 Run 请求;不把截图误判为 SQL 根因 | 截图、调用链和最小 SQL 采样相互印证;生产数据库结论未越界 | 通过(根因范围已确认) |
|
||||
| 1:Run 读取治理 | 合并同 `run_no` 的并发重型读取;保留调用方取消语义;增加可观测性 | 用例覆盖合并与单消费者取消;DTO、鉴权、审计未改变;Header 不含敏感数据 | 通过(前端 2 个定向用例、后端 Header 用例) |
|
||||
| 2:Case 切换治理 | 新选择取消旧 Case 与 evidence;旧响应不可覆盖新 Case | 联合 AbortSignal 和 generation / Case 编号双校验均在代码与测试中核对 | 通过(复核 composable 38 个用例) |
|
||||
| 3:回归与范围 | 前后端行为、构建、格式;不引入 Dify 或业务状态改动 | 前端定向 58 passed;后端定向 1 passed;`git diff --check` 通过;前端 build 通过 | 通过(代码级) |
|
||||
| 4:真实运行验收 | 真实业务数据 HAR、Server-Timing、p50/p95 和必要时 PostgreSQL 计划 | 无可复用已登录浏览器页面;本机只读 API 探测返回 401;Playwright 依赖 WSL `/bin/bash` 不可用 | 待业务环境人工验收,未计为生产通过 |
|
||||
|
||||
**整体结论**:本次前后端实现、自动化回归、正式技术说明和 Dify 手工说明已完成,且不存在已知未解决的代码级问题。生产级“切换耗时已达标”尚未被真实 HAR / PostgreSQL 证据证明,必须按第 5 节由具备业务登录态的人员完成后,才可关闭该外部验收项;在此之前不得对外宣称生产性能目标已验收通过。
|
||||
|
||||
## 9. 批次进度中心空白的根因与修复(2026-08-21)
|
||||
|
||||
### 已证实根因
|
||||
|
||||
真实会话 `29268344573b4fad8eb57532e9068fb3` 含 18 封 EML Intake、18 个邮件正文和 30 个业务 PDF。直接调用会话投影能正确返回 `total_files=30`、`waiting_human_files=30` 与 18 个待人工 EML 容器;因此“18 个文件”不是业务数据缺失,而是超时后的旧聊天快照回退值。
|
||||
|
||||
浏览器证据显示会话投影 GET 在约 10 秒被客户端取消。前端共享请求设置为 10 秒 Abort;修复前,服务端在同一会话内对每个 EML 再查询附件集合,并在 Intake 摘要重复统计附件,形成 N+1。真实会话测得 1091 条 SQL、约 7.79 秒(另一采样约 14.3 秒);超时后 `processing=null`,右侧原先渲染为 0,左侧回退到仅包含 18 个 EML 的历史快照。
|
||||
|
||||
### 实施内容
|
||||
|
||||
- `shipping_processing_projection.py` 在一次会话投影中批量读取全部非 `email_body` Document,并通过请求内只读上下文复用给 Intake 摘要及 EML 附件叶子;独立单条投影仍保留原查询语义。
|
||||
- 同一上下文提前装载 Gate 的 latest Attempt,避免序列化 Process Gate 时按 Gate 再做主键查询。
|
||||
- 批次重解析资格拆分为读写两条路径:会话/工作台 GET 使用无锁只读选取,且会话投影只计算一次并在请求内复用;实际 `POST reparse_batch` 仍使用 `FOR UPDATE` 锁定参与决策的 Case。禁止读投影调用写命令选择器。
|
||||
- 右侧批次进度中心在投影尚未返回时显示骨架,在读取失败时显示可手动刷新的错误态;不再把“暂无投影”伪装为 `0` 个文件。
|
||||
- 会话投影共享请求的超时由 10 秒调整为 30 秒。该值覆盖已测得的合法大批次读取,防止服务端仍在返回正确投影时被客户端提前取消;它不是对剩余 Gate/Job 投影 N+1 的替代方案。
|
||||
|
||||
### 回归与当前测量
|
||||
|
||||
- 新增/运行回归 `test_conversation_projection_prefetches_eml_attachments_once`:两封 EML / 两个附件的 Document SELECT 从失败基线 6 次收敛为 1 次,测试通过。
|
||||
- 新增/运行回归 `test_conversation_projection_reparseability_read_path_does_not_lock`:会话投影不进入带锁写选择器,捕获 SQL 不含 `FOR UPDATE`;批次谱系写命令回归仍通过。
|
||||
- 真实会话修复后仍准确返回:30 个业务文件、30 个待人工文件、18 个 EML 容器,状态顶层为 `waiting_human → EML → PDF`。
|
||||
- 真实会话总 SQL 从 1091 降至 920;Gate、Job、Review Case、Run/Plan/Unit 仍存在其它既有逐行投影读取,后续需单列性能工作继续批量化,不能把本次附件查询修复误称为全部数据库 N+1 已清除。
|
||||
|
||||
## 10. 复核队列单次投影 N+1 治理(2026-08-22)
|
||||
|
||||
### 根因与边界
|
||||
|
||||
真实开发会话的 `GET /order-review-queue/{run_no}` 不慢在单 Case `review` DTO,而慢在会话级队列投影。28 个当前 Case 在逐项序列化时重复读取 Candidate、Intake、Draft、STP Job,以及 Process Gate 的最新 Attempt;同一次请求实测为 187 条 SQL、约 4.62 秒,浏览器侧还会叠加跨 Run 的重复读取。
|
||||
|
||||
批量预取后继续进行函数级采样,确认单次仍可能达到约 4 秒的第二根因:`psycopg2.fetchall` 内的 JSON 解码占约 2.96 秒,而 SQL 执行本身仅约 1.12 秒。队列授权路径将会话中的全部 Run 以完整 ORM 实体读取,队列联表又重复装配带有审计/执行大 JSON 的 Run;这些字段不属于队列摘要 DTO,却在传输后被逐个反序列化。
|
||||
|
||||
### 实施与等价性
|
||||
|
||||
- `serialize_review_queue()` 在读取当前 Stream 后一次性预取以上领域对象,建立并在 `finally` 恢复 `shipping_conversation_projection_read_cache`。
|
||||
- STP 同时按精确幂等键与文件前缀缓存全部历史版本 Job,保持自动建单失败、运行中和重试裁决与原查询语义一致。
|
||||
- Process Execution、Gate 与 latest Attempt 也按当前 Case 批量加载;生命周期、PO、权限、`available_actions`、阶段入口和前端 DTO 字段均未删除或改由前端推导。
|
||||
- 队列可见性与联表投影改为只加载摘要必需的标量、冻结文档快照和 Case 处置字段;已批量读取的 Draft 显式传给摘要函数,避免关系延迟加载。完整 Run 读取 API 仍保持原 DTO/审计语义。
|
||||
- 跨 Run 选择只修改深链,由既有路由 watcher 唯一执行 `load()`,避免 `router.replace()` 后第二次完整加载。
|
||||
|
||||
### 复测结果与 Dify
|
||||
|
||||
对同一真实 28 文件会话复测,最终两次队列读取为 27 条 SQL、0.899 秒与 0.718 秒,且 Review Case 的逐项延迟加载为 0。该数据为开发环境单次只读采样,不能替代生产 HAR 的 p95 验收。Dify 未新增或修改任何配置;本优化不涉及 Prompt、Provider、Tool、变量或凭据。
|
||||
|
||||
## 11. 最终阶段验收合规报告(2026-08-22)
|
||||
|
||||
| 阶段 | 目标与关键节点 | Review 结论 | 验收证据 |
|
||||
| --- | --- | --- | --- |
|
||||
| 1:根因确认 | 区分跨 Run 重复加载与单请求慢;以真实会话采样确认 SQL 与 JSON 解码占比 | 已确认前者由路由重复触发,后者由摘要路径装载大 JSON;未将开发采样外推为生产 p95 | 28 文件会话:187 SQL / 4.62 秒;函数级采样:JSON 解码约 2.96 秒 |
|
||||
| 2:服务端读模型治理 | 批量预取 Case 依赖;仅加载摘要字段;保持历史 STP / Gate 裁决 | 无逐 Case 延迟加载;缓存仅限当前请求并在 finally 恢复;确认、冻结、权限与审计写路径不变 | 同会话复测:27 SQL、0.899 秒和 0.718 秒;逐项 Case lazy load 为 0 |
|
||||
| 3:客户端切换治理 | 跨 Run 路由变更只触发一次 load | 路由 watcher 是唯一加载所有者;未删除任一文件选择、阶段或工作台入口 | `ShippingOrderReviewView.spec.ts` 跨 Run 单次加载用例通过 |
|
||||
| 4:契约回归 | 冻结 Schema、客户确认事实、Gate action 和波次建单保持 fail-closed | 修复过期测试夹具,未放宽生产校验;客户确认必须由来源 Extraction 事实继承 | 后端完整:58 passed |
|
||||
| 5:前端回归与构建 | 工作台生命周期、文件导航、成功上传证据和解析处置边界 | i18n mock 缺键和文本代理断言已改为可验证真实行为;生产翻译资源未改 | Spec 完整:69 passed;`vue-tsc -b`、`vite build` 通过 |
|
||||
| 6:Dify 边界 | 说明人工配置职责,确认本次不触碰 Dify | 无 Dify 配置变更;若启用字段建议分支,仅按第 6 节进行非破坏性人工核验 | 第 6 节与第 10 节 Dify 说明 |
|
||||
|
||||
**总体结论**:代码级性能、行为和回归验收均达标。本次不含生产登录态 HAR / PostgreSQL 执行计划,因此生产 p50/p95 仍必须按第 5 节的人工运行验收补证;在取得该证据前,不得将开发库采样表述为生产 SLA。
|
||||
@@ -23,7 +23,41 @@
|
||||
|
||||
本次五阶段工作面调整**无需修改 Dify**。Dify 不能创建/推进 Gate,不能确认客户、裁决订单、匹配库存、生成 Excel、上传货代或登记回执;这些写入只由 HXOPS 服务端 Gate 校验后的工作台动作执行。若管理员维护现有 `shipping_notice` Chatflow,仍只能保留只读 `get_task_status` Tool,并原样传递 HXOPS 注入的短效能力令牌;发现任何写 Tool 或由 Dify 推断“已完成”时,应停止发布并移除。
|
||||
|
||||
## 2026-07-31 订单解析增强最终实施方案(待实施)
|
||||
## 2026-08-21 PDF 订单解析证据链收口(已验收)
|
||||
|
||||
本节是当前 PDF 订单解析的实现与验收基线,优先于下方保留的历史“待实施”方案。此次不发布新版本、不修改既有 Profile 业务定义、不按文件名/订单号/客户/坐标变体写特例,也不新增独立 Evidence Package。
|
||||
|
||||
### 运行时事实与路由
|
||||
|
||||
- 原 PDF 是不可变源事实。`ensure_on_demand_coordinate_evidence()` 是唯一坐标补全入口:当前 Layout -> Run 快照补缺 -> 原生 PDF -> OCR;返回合并后的当前 Layout。任一关键坐标无法取得时固定输出 `coordinate_evidence_unavailable` 并进入 `review_required`。
|
||||
- `matching_features.v1` 在压缩 `page_glyphs` 前持久化页面结构、主表框、表头及顺序、列数/中心/宽度和静态字段关系。它是稳定匹配输入,不升级命名;缺少关键特征不得从评分分母剔除后形成 `hard_match`。
|
||||
- Profile 只识别版式身份;Schema 是唯一业务字段契约。订单头由 `page_glyphs + Profile field layout + Schema` 取值,订单行由 `table_glyphs + Profile table layout + Schema` 重建;两者共享同一个 Profile、Layout、Schema 和 `CoordinateTransform`。
|
||||
- `CoordinateTransform` 统一处理归一化坐标及受限平移、缩放、小角度旋转。锚点不足、残差超限、越界、共线、非法矩阵或局部非线性失真必须 fail-closed,禁止强行命中。
|
||||
- 普通 PDF、OCR、XFA datasets 和 AcroForm Widget 都输出相同 Observation 语义:`value_source`、`evidence_ref`、`transform_ref`、置信度和校验状态。XFA datasets 是正式值源;datasets 回退到 PDF/OCR 时保留 `fallback_from=xfa_dataset` 并固定 Review,不得自动建单。
|
||||
- 路由固定为:唯一 Profile 命中走确定性模板解析;明确不存在特殊模板特征才走受限通用解析;`layout_drift`、`ambiguous`、证据不足、XFA/OCR 冲突全部 Review。所有候选最终必须通过统一 Candidate Qualification,Dify 不参与事实生成或 Gate。
|
||||
|
||||
### 通用解析与模板治理
|
||||
|
||||
- 自动标注只生成 Draft 的 `layout_schema_candidates`/建议,不能直接作为生产规则、不能自动接受、更不能自动发布。生产通用解析必须有冻结 `generic_parse_plan`,绑定 Schema、Layout、候选 checksum、映射决定及字段 `cell_id/evidence_ref`;Plan 缺失、漂移或证据缺失即 Review。
|
||||
- **模板样本就绪门禁(2026-08-21)**:上传成功只表示 PDF/EML 已物化为 `ShippingOrderDocument`,不表示可自动标注。Draft annotation sample 必须由同一 `refresh_profile_sample_readiness()` 在当前 ready Layout 上验证视觉主表、内容 hash、canonical payload checksum、parser provenance,并冻结 `layout_version_id + layout_payload_checksum` 后,才返回 `automark_ready=true`。保存草稿、样本状态轮询和 `/pdf-automark` 入队共用此服务;一旦主表缺失/歧义、Layout 尚未完成或身份不一致,返回稳定原因码并禁止入队,绝不降级成“配置无效”或猜测。Worker 执行期仍复验 Job 的冻结身份。状态按 `profile_id + annotation sample` 隔离,同一文档被其他 Draft 引用不会影响当前模板。该回填仅更新现有 Draft sample 字段和追加式审计,不新建 Profile 版本、不修改已发布版本。
|
||||
- Profile 仅允许 `draft -> published`;发布前必须满足 Schema/字段绑定校验、训练样本、独立盲测、双人批准、冻结样本证据及发布检查。已发布/退役版本只读;演进只能克隆为新 Draft,旧发布版本退役。管理端不提供自动接受、自动批准或自动发布路径。
|
||||
|
||||
### Dify 手工配置说明
|
||||
|
||||
此项由管理员手工完成,HXOPS 不调用 Dify 管理 API。保留 `shipping_notice` Chatflow 的只读任务状态与可选 Review 建议能力即可:Review 建议只能消费 HXOPS 下发的最小脱敏证据,并由人工确认后再由 HXOPS 校验写入草稿。必须删除或禁用所有订单抽取、附件遍历、模板匹配、Profile/Schema 写入、候选创建、Gate 推进、自动建单、库存/Excel/RPA 写入及“模型判断已完成”的 Tool、节点和连线。Dify 不可用不得影响 PDF/XFA/OCR 主解析、模板治理、Review 或 Candidate Qualification。
|
||||
|
||||
### 阶段验收报告
|
||||
|
||||
| 阶段 | 验收结论 | 关键证据 |
|
||||
| --- | --- | --- |
|
||||
| 1. 证据恢复与稳定特征 | 通过 | 当前 Layout 优先、快照补缺、原 PDF/OCR 恢复及不可恢复 Review 回归通过。 |
|
||||
| 2. 几何归一化 | 通过 | Matcher、订单头和订单行共用受限变换;异常变换 fail-closed 回归通过。 |
|
||||
| 3. PDF/OCR/XFA Observation 与 Gate | 通过 | 值源与证据引用统一;XFA fallback 固定 Review;Candidate Gate 无绕过路径。 |
|
||||
| 4. 冻结 Parse Plan | 通过 | Plan 绑定 checksum 和字段证据;候选漂移、缺失或未限定均阻断至 Review。 |
|
||||
| 5. 模板治理与管理端 | 通过 | 后端治理/发布/版本回归 114 项通过;前端无自动接受、批准或发布路径。 |
|
||||
| 6. 最终工程校验 | 通过 | 解析主链定向回归、Python 编译、前端 `npm run build`、`git diff --check` 均通过。 |
|
||||
|
||||
## 2026-07-31 订单解析增强最终实施方案(历史待实施)
|
||||
|
||||
> **适用范围**:本节冻结“异型模板优先、通用确定性解析补位、Dify 仅辅助人工复核”的目标方案,作为后续开发、Review 与验收依据。现有模板库、复核工作台、任务中心和审计中心继续复用并增强,不新建第二套平行模块。本文不要求兼容旧 Dify 订单解析运行路径;历史业务订单、冻结 Snapshot 和审计事实仍永久只读保留。
|
||||
|
||||
@@ -941,6 +975,8 @@ MinerU 服务地址、无认证方式和 OpenAPI 已确认,并已取得脱敏
|
||||
|
||||
**坐标模板修复闭环 Review(2026-07-23)**:对于表头混入首条明细的 PDF,模板页显示“自动识别行版式”和“重建表格候选”。系统先建议从 `0` 到 `1` 严格递增的相对列边界,管理员按示例确认字段并可高级校准;系统仅使用同一 `ShippingDocumentLayoutVersion` 中表格 bbox 内的 PDF 原生字符重建网格。候选固定 `needs_review`,界面必须显式勾选审核确认后才可创建草稿。确认的边界随 Profile 定义冻结,Run 输入快照同时冻结对应的坐标证据;运行和盲测无法取得证据时阻断,不回读资产、不回退错误 MinerU 网格、不调用 Dify。坐标、页面图像、完整 PDF 正文和 MinerU 原始响应不返回浏览器或 Dify。
|
||||
|
||||
**表格边界校正(2026-08-21)**:当 MinerU 候选仅覆盖表头、表格 bbox 内没有明细起行,但同页完整 PDF/OCR 坐标存在唯一连续明细时,重建器仅沿原候选的纵向边界派生表格候选,并在明确 `Total`/终止行前收口。原始 MinerU bbox 保留为不可变事实,派生候选标记 `table_bbox_source=page_coordinate_derived`;无起行锚点、存在多义边界或来源冲突时保持 `needs_review`,禁止扩大框后猜测。普通表格候选通过完整性校验时继续使用原路径。
|
||||
|
||||
**模板页样本上传 Review(2026-07-23,2026-08-04 解耦修订)**:管理员可直接在“订单文档模板”页上传 PDF 或 EML。文件先写入用户私有 `FileAsset`,再创建 purpose=`order_document_profile_sample` 的独立 Intake;上传成功只要求 PDF Document 建立或 EML 完成 MIME 拆分并物化可用 Document。布局 Job 继续作为后台预热,但 queued/failed/unsupported 均不得阻断上传或把已物化文件显示为失败。盲测复核分三态:queued/running 为 `preparing` 且不可复核;failed/unsupported 为 `diagnostic`,可从原 PDF 临时恢复坐标帮助定位兼容性但禁止确认;仅 ready Layout 的真实 `table_id` 为 `formal_review`。正式预览返回 `layout_version_id + payload_checksum + parser` 身份,确认时重新校验并冻结到 TestSample,后续盲测执行读取该冻结 LayoutVersion,不读取 Document 当前最新布局。该 Intake 不绑定 Chat 会话,禁止创建 Candidate、业务指纹、重复决策、Task 或 Dify 调用。EML 正文与附件分别作为候选,附件不得自动合并;页面状态接口只返回文件物化状态和安全 Document 身份,不返回正文、HTML 或 bbox。PDF/EML 以外的文件由前后端双重拒绝。
|
||||
|
||||
MinerU 生产捕获固定使用 `pipeline`,通过 `/tasks` 异步提交、状态轮询和 `/result` 取回结果,不使用同步 `/file_parse` 长连接。Intake 不再内联调用 MinerU:它在持久化 Document/派生 FileAsset 后,同事务创建独立布局版本和 `shipping_document_layout` Job;布局 Worker 再读取对象存储并调用 Provider。`SHIPPING_NOTICE_LAYOUT_MINERU_ENABLED=false` 时不创建布局 Job;启用后只保存 `shipping_document_table_snapshot.v1` 的页/整表 bbox、HTML 表格与能力摘要,不保存 task 原响应、model output、content list 或非表格文本块。默认每个 Intake 最多 4 个支持文档;超量建立 `unsupported` 审计版本。所有 HTML/bbox 在 Dify Manifest 编译前剥离,仅 Profile 映射后的 `field_id/value/quote` 紧凑候选可进入 Dify。
|
||||
@@ -2638,6 +2674,14 @@ primary_pdf_parsed_value
|
||||
|
||||
**核心原则**:当前裁决值优先 PDF ≠ 所有 PDF 冲突都允许自动建单。
|
||||
|
||||
#### 2.1 邮件补充字段冲突、历史重评估与校验后恢复(2026-08-21)
|
||||
|
||||
- 新产生的邮件正文补充冲突必须是可解释的 Finding:包含稳定 `conflict_key`、`field`、`scope`、`line_index`、`severity=blocking`、`resolution_status=unresolved`、规则版本,以及 PDF/邮件双方的 `raw_value`、规范化值、`document_id` 与 `evidence_ref`。Case 投影直接消费该 Finding 的双方来源;禁止再以空的旧 Observation 投影作为阻断依据。
|
||||
- 比较必须服从冻结 Schema 的字段类型和行关联。金额按 decimal 规范化后比较,故 `1731.6`、`1731.60` 与 `1,731.60` 等价;同 PO 的明细只能按精确 `PO + MPN` 关联,禁止把另一料号行的 `unit_price` 误判为冲突。值确有语义差异时仍保持阻断,不能因 PDF 优先采值而静默放行。
|
||||
- 历史 `reason=supplement_field_conflict` 没有双方原值/证据时不得仅因 Case 面板为空而放行。管理员可调用 `POST /api/admin/shipping-notice/legacy-supplement-conflicts/reassess`,按 `candidate_no` 或 `run_no` 重跑冻结 Run 输入、冻结订单和冻结 Schema:格式等价则清除旧假冲突,真实差异则重建当前完整 Finding;全量处理必须显式传入 `include_all=true` 和确认串 `REASSESS_LEGACY_SUPPLEMENT_CONFLICTS`。
|
||||
- 冻结证据已不可恢复时,服务端将旧记录升级为 `supplement_conflict_evidence_insufficient`(仍为 blocking),并提供 `recovery_action=reparse_current_pdf`;前端必须展示“证据不足、建议重新识别此 PDF”,不得出现“没有显示冲突却不能推进”。每次重评估均重算 Candidate Qualification 并写统一审计;实际生产历史数据重评估须由管理员在批准环境执行。
|
||||
- “保存并校验”由 `resume_after_review_change(..., allow_auto_create=True)` 统一执行资格、Gate 和幂等入队。前端只消费 API 的 `resume_outcome`:`auto_create_enqueued`、`already_queued`、`already_running` 均提示已入队等待 Worker;不得以本地字段完整度猜测下一步。此处只证明已入队,后续状态以 `ShippingProcessingProjection` 为准。
|
||||
|
||||
#### 3. 统一 ShippingProcessingProjection
|
||||
|
||||
推荐 API(阶段 4 接线):
|
||||
@@ -2748,6 +2792,8 @@ pytest tests/test_shipping_notice_state_machine.py tests/test_shipping_notice_ui
|
||||
- 附件选择、深度解析、扩批、预算、完整性门禁和自动冻结均由 HXOPS Worker/服务执行;字段复核建议只预填人工草稿且必须由 HXOPS 再验证。
|
||||
- 完整手工节点顺序、代码、Prompt、Fail Branch 和验收用例以 [order-extraction-workflow-dify-guide.md](order-extraction-workflow-dify-guide.md) 为准。
|
||||
|
||||
**本次手工配置确认(2026-08-21)**:不要求新增或修改 Dify 节点、变量、Tool、Prompt 或自动化。若已启用 `order-review-llm.v1`,它只可返回单字段候选建议、原文 quote 和 document ID,且必须经过人工确认及 HXOPS 后端校验;不得裁决补充字段冲突、写正式事实、确认/建单或推进 Gate。Provider 不可用不得阻断人工复核、历史冲突重评估或自动建单队列。
|
||||
|
||||
### STP 阶段 0:字段契约冻结(2026-07-30,项次派生 Phase 0 纠偏)
|
||||
|
||||
- 标准资产 **58** 项;`shipping_order_fields` 唯一键为 `(field_code, scope)`,允许 Header/Line 同名 `reservation_id`。
|
||||
@@ -3251,6 +3297,8 @@ Case 状态:`unreviewed`、`draft`、`ready`、`confirming`、`confirmed`、`n
|
||||
|
||||
工作台切换 PDF 时仅更新 `case` query,必须保留 `mode`、`run_no` 与原会话 query,防止主区误退回聊天欢迎页;切换后保持当前 `ReviewWorkbenchMode` 与字段区滚动位置。
|
||||
|
||||
**左侧文件切换读取治理(2026-08-21)**:完整 Run DTO 可能同时被聊天状态卡和复核工作台读取,前端按 `run_no` 合并仅在途的请求,完成、失败或超时后不缓存业务数据;单个消费者取消只结束其自身等待,不中止共享读取。Case 切换对 Case 快照和证据摘要采用同一个 `AbortController` 的 latest-wins 策略,新选择、重新加载或卸载立即取消旧读取,同时保留 generation / Case 编号双校验,禁止迟到数据回写。Run GET 返回不含敏感业务内容的 `Server-Timing: run_lookup;dur=<ms>, workspace_projection;dur=<ms>`,用于与真实 HAR 对齐;若投影持续为慢点,必须先取得 PostgreSQL `EXPLAIN (ANALYZE, BUFFERS)` 再决定查询或 DTO 演进。根因、测试证据、Dify 手工核验和上线验收门槛见 [review-workbench-file-switch-performance.md](./review-workbench-file-switch-performance.md)。
|
||||
|
||||
**本目标态 Dify 配置**:订单抽取、Review Case 状态、草稿保存、确认建单和聊天入口仍由 HXOPS 实现;唯一 Chatflow 需要增加按 `order-review-llm.v1` 硬路由的字段建议分支。该分支不得新增业务写 Tool、自动确认或冻结逻辑,Provider 不可用也不得阻断人工复核。
|
||||
|
||||
阶段 1 的只读接口为 `GET /api/workspace/shipping-notice/order-extraction-runs/{run_no}/review` 和 `GET /api/workspace/shipping-notice/order-review-cases/{case_no}`。DTO 只包含按冻结 Schema 安全投影的字段、行、状态、问题、动作和证据摘要;它不返回 PDF 正文、MinIO 地址/对象键、原始模型响应、Prompt 或未授权 Document。后续写接口由 Case 和冻结 Schema 决定可编辑字段,不能由浏览器传入任意 Schema、Document 或 evidence identity。
|
||||
|
||||
Reference in new issue
Block a user