weaver-work-cli 0.1.47 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-EDJDU3V4.js} +454 -5
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
- package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
- package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
- package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
- package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
- package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
- package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
- package/dist/core/refs.js +19 -2
- package/dist/index.js +14 -14
- package/dist/shortcuts/archive-oa/constants.js +42 -0
- package/dist/shortcuts/archive-oa/host.js +2 -2
- package/dist/shortcuts/archive-oa/index.js +38 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
- package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
- package/dist/shortcuts/contract/index.js +9 -1
- package/dist/shortcuts/contract/manifest.js +14 -2
- package/dist/shortcuts/contract/operations/card.js +231 -0
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/review.js +16 -5
- package/dist/shortcuts/contract/operations/summary.js +25 -17
- package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/invoice/host.js +0 -3
- package/dist/shortcuts/invoice/manifest.js +0 -1
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
- package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
- package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +19 -0
- package/dist/shortcuts/reception/manifest.js +53 -1
- package/dist/shortcuts/reception/operations/ask.js +18 -0
- package/dist/shortcuts/reception/operations/compose.js +113 -3
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +36 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +251 -0
- package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
- package/dist/shortcuts/reception/operations/schedule.js +7 -1
- package/dist/shortcuts/reception/upload.js +22 -6
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/recruit-stage/shared.js +42 -14
- package/docs/archive-oa.md +4 -2
- package/package.json +1 -1
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/master-skill-template.md +1 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +33 -6
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +22 -0
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
- package/skills/weaver-e10-cowork/SKILL.md +9 -6
- package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
- package/skills/weaver-e10-jucailin/SKILL.md +7 -4
- package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
- package/skills/weaver-e10-mail/SKILL.md +17 -4
- package/skills/weaver-e10-meeting/SKILL.md +94 -409
- package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
- package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
- package/skills/weaver-e10-reception-flow/SKILL.md +62 -18
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
- package/skills/weaver-e10-reception-flow/scripts/render.py +81 -2
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -8
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +127 -0
- package/skills/weaver-e10-shijingran/SKILL.md +6 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-I5ZIX4WO.js} +3 -3
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 小餐厅预定明细:只在客户**明确提到**小餐厅/包厢时填,其余情况整段不出。
|
|
3
|
+
*
|
|
4
|
+
* 包厢号不是编的——必须来自建模表单「小食堂包厢」的实查结果,CLI 只负责从候选里挑一个。
|
|
5
|
+
* 触发只看「用户说过没有」:光有检索候选不算,否则没提小餐厅也会被填进去。
|
|
6
|
+
*
|
|
7
|
+
* 移植自 `@weaver/reception-cli@0.7.15` 的 `lib/restaurant.js`,判定口径保持一致。
|
|
8
|
+
*/
|
|
9
|
+
import { hhmmPlus } from './schedule.js';
|
|
10
|
+
/** 与 data/fields-snapshot.json 的 restaurant 段保持一致;快照缺失时用它兜底。 */
|
|
11
|
+
export const RESTAURANT_DETAIL = {
|
|
12
|
+
name: '小餐厅预定明细',
|
|
13
|
+
subFormId: '1328260727015997527',
|
|
14
|
+
dataKey: 'formtable__xctydmx',
|
|
15
|
+
fields: {
|
|
16
|
+
roomNo: '1329411121197875201',
|
|
17
|
+
headcount: '1328336675122282515',
|
|
18
|
+
startDate: '1328336675122282518',
|
|
19
|
+
startTime: '1328337576855699719',
|
|
20
|
+
endDate: '1328336675122282519',
|
|
21
|
+
endTime: '1328337576855699720',
|
|
22
|
+
},
|
|
23
|
+
defaultDurationMinutes: 90,
|
|
24
|
+
};
|
|
25
|
+
/** 触发词:提到小餐厅/包厢/包间才算有预定需求。 */
|
|
26
|
+
const TRIGGER = /小餐厅|包厢|包间|小食堂|内部餐厅/;
|
|
27
|
+
/** 「小食堂包厢」建模表单的字段 id(与快照 restaurant.roomSource 一致),用于吃下 ds 原始行。 */
|
|
28
|
+
const ROOM_FIELDS = {
|
|
29
|
+
roomNo: 'field_840360795890851870',
|
|
30
|
+
title: 'field_840360795890851873',
|
|
31
|
+
region: 'field_841962208930570241',
|
|
32
|
+
desc: 'field_840360795890851871',
|
|
33
|
+
};
|
|
34
|
+
const pickStr = (value) => (value === null || value === undefined ? '' : String(value)).trim();
|
|
35
|
+
/** 从「描述」「包厢号」里抠容量:可容纳 16 人 / (16人包厢)/ 16人桌。 */
|
|
36
|
+
function capacityFromText(text) {
|
|
37
|
+
const s = pickStr(text);
|
|
38
|
+
const matched = /可容纳\s*(\d{1,3})\s*人/.exec(s)
|
|
39
|
+
|| /[((]\s*(\d{1,3})\s*人/.exec(s)
|
|
40
|
+
|| /(\d{1,3})\s*人/.exec(s);
|
|
41
|
+
const n = matched ? Number(matched[1]) : 0;
|
|
42
|
+
return Number.isFinite(n) && n > 0 && n < 500 ? n : 0;
|
|
43
|
+
}
|
|
44
|
+
/** 区域字段可能是 '上海' / ['上海'] / [{name:'上海'}],统一成文本。 */
|
|
45
|
+
function regionText(value) {
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
return value
|
|
48
|
+
.map((item) => pickStr(item && typeof item === 'object' ? (item.name || item.label) : item))
|
|
49
|
+
.filter(Boolean)
|
|
50
|
+
.join('/');
|
|
51
|
+
}
|
|
52
|
+
if (value && typeof value === 'object') {
|
|
53
|
+
const node = value;
|
|
54
|
+
return pickStr(node.name || node.label || node.text);
|
|
55
|
+
}
|
|
56
|
+
return pickStr(value);
|
|
57
|
+
}
|
|
58
|
+
/** ds list 的返回可能是裸数组,也可能裹在 rooms/items/list/records/rows/data 里。 */
|
|
59
|
+
export function unwrapRoomRows(input) {
|
|
60
|
+
if (Array.isArray(input))
|
|
61
|
+
return input;
|
|
62
|
+
if (!input || typeof input !== 'object')
|
|
63
|
+
return [];
|
|
64
|
+
const node = input;
|
|
65
|
+
const candidate = node.rooms || node.items || node.list || node.records || node.rows
|
|
66
|
+
|| (node.data && (node.data.list || node.data.records || node.data.rows || node.data.items))
|
|
67
|
+
|| (Array.isArray(node.data) ? node.data : null);
|
|
68
|
+
return Array.isArray(candidate) ? candidate : [];
|
|
69
|
+
}
|
|
70
|
+
/** 把 ds list 的原始行(field_xxx 键)或友好的 {name,capacity} 统一成候选包厢。 */
|
|
71
|
+
export function normalizeRoomCandidates(input) {
|
|
72
|
+
const list = unwrapRoomRows(input);
|
|
73
|
+
const out = [];
|
|
74
|
+
for (const row of list) {
|
|
75
|
+
if (!row)
|
|
76
|
+
continue;
|
|
77
|
+
const item = typeof row === 'string' ? { name: row } : row;
|
|
78
|
+
const name = pickStr(item.name || item.roomNo || item.title || item.label
|
|
79
|
+
|| item[ROOM_FIELDS.roomNo] || item[ROOM_FIELDS.title]);
|
|
80
|
+
if (!name)
|
|
81
|
+
continue;
|
|
82
|
+
const desc = pickStr(item.desc || item.description || item.remark || item[ROOM_FIELDS.desc]);
|
|
83
|
+
const region = regionText(item.region || item.area || item.location || item[ROOM_FIELDS.region]);
|
|
84
|
+
// 参观动线在总部,只留上海;没标区域的按可用处理
|
|
85
|
+
if (region && !/上海/.test(region))
|
|
86
|
+
continue;
|
|
87
|
+
out.push({
|
|
88
|
+
name,
|
|
89
|
+
capacity: Number(item.capacity || item.seats || item.maxPeople || item.size || 0)
|
|
90
|
+
|| capacityFromText(`${desc} ${name}`),
|
|
91
|
+
where: region,
|
|
92
|
+
type: pickStr(item.type || item.kind),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
/** 文本里出现的小时:分钟,按出现顺序返回。 */
|
|
98
|
+
function timesIn(text) {
|
|
99
|
+
const out = [];
|
|
100
|
+
const re = /(\d{1,2})\s*[::]\s*(\d{2})/g;
|
|
101
|
+
let matched;
|
|
102
|
+
const source = String(text || '');
|
|
103
|
+
while ((matched = re.exec(source)) !== null) {
|
|
104
|
+
const hour = Number(matched[1]);
|
|
105
|
+
const minute = Number(matched[2]);
|
|
106
|
+
if (hour <= 23 && minute <= 59) {
|
|
107
|
+
out.push(`${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
function nextDay(date) {
|
|
113
|
+
const matched = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(date || ''));
|
|
114
|
+
if (!matched)
|
|
115
|
+
return date || '';
|
|
116
|
+
const d = new Date(Date.UTC(Number(matched[1]), Number(matched[2]) - 1, Number(matched[3]) + 1));
|
|
117
|
+
return d.toISOString().slice(0, 10);
|
|
118
|
+
}
|
|
119
|
+
/** 「小食堂包厢」的房间规格:同容量时包厢优先,卡拉OK/烧烤只做兜底。 */
|
|
120
|
+
const RANK = { private: 0, combo: 1, tea: 2, entertainment: 3 };
|
|
121
|
+
const KIND_LABEL = {
|
|
122
|
+
private: '包厢', combo: '通包', tea: '茶室', entertainment: '娱乐场地',
|
|
123
|
+
};
|
|
124
|
+
function kindOf(room) {
|
|
125
|
+
const explicit = pickStr(room.type);
|
|
126
|
+
if (explicit && RANK[explicit] !== undefined)
|
|
127
|
+
return explicit;
|
|
128
|
+
const name = pickStr(room.name);
|
|
129
|
+
if (/卡拉|KTV|ktv|烧烤|娱乐|棋牌/.test(name))
|
|
130
|
+
return 'entertainment';
|
|
131
|
+
if (/茶室|茶座/.test(name))
|
|
132
|
+
return 'tea';
|
|
133
|
+
if (/通包|联通/.test(name))
|
|
134
|
+
return 'combo';
|
|
135
|
+
return 'private';
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 从候选里挑一个合适的包厢:装得下的最小间;都装不下取最大间。
|
|
139
|
+
* 容量优先、同容量再按规格(包厢 > 通包 > 茶室)。
|
|
140
|
+
*/
|
|
141
|
+
export function pickRestaurantRoom(rooms = [], headcount = 0) {
|
|
142
|
+
const list = normalizeRoomCandidates(rooms);
|
|
143
|
+
if (!list.length)
|
|
144
|
+
return null;
|
|
145
|
+
const count = Number(headcount) || 0;
|
|
146
|
+
const rank = (room) => RANK[kindOf(room)] ?? RANK.private;
|
|
147
|
+
const fitSort = (a, b) => (a.capacity - b.capacity) || (rank(a) - rank(b));
|
|
148
|
+
const overSort = (a, b) => (b.capacity - a.capacity) || (rank(a) - rank(b));
|
|
149
|
+
const playable = list.filter((room) => kindOf(room) !== 'entertainment');
|
|
150
|
+
const label = (room) => KIND_LABEL[kindOf(room)] || '包厢';
|
|
151
|
+
if (count) {
|
|
152
|
+
for (const group of [playable, list]) {
|
|
153
|
+
const fit = group.filter((room) => room.capacity && room.capacity >= count).sort(fitSort);
|
|
154
|
+
if (fit.length) {
|
|
155
|
+
return { ...fit[0], reason: `${count} 人,${fit[0].capacity} 人${label(fit[0])}可容纳` };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// 人数未知或超出所有房间容量:按最大间预留
|
|
160
|
+
const pool = playable.filter((room) => room.capacity).length
|
|
161
|
+
? playable.filter((room) => room.capacity)
|
|
162
|
+
: list.filter((room) => room.capacity);
|
|
163
|
+
if (pool.length) {
|
|
164
|
+
const top = pool.sort(overSort)[0];
|
|
165
|
+
return {
|
|
166
|
+
...top,
|
|
167
|
+
reason: count
|
|
168
|
+
? `${count} 人超出可用${label(top)}上限(${top.capacity} 人),按最大间预留`
|
|
169
|
+
: `未给人数,按最大 ${top.capacity} 人预留`,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return { ...list[0], reason: '检索结果未标容量,取第一条' };
|
|
173
|
+
}
|
|
174
|
+
/** 候选输入里到底给了几条原始行(用于区分「没给」和「给了但解析不出」)。 */
|
|
175
|
+
function rawCandidateCount(input) {
|
|
176
|
+
return unwrapRoomRows(input).length;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 归一小餐厅预定信息。
|
|
180
|
+
* 返回 `null` 表示「没提这件事」——调用方据此整段不填。
|
|
181
|
+
*/
|
|
182
|
+
export function normalizeRestaurant(options = {}) {
|
|
183
|
+
const data = options.data || {};
|
|
184
|
+
const explicit = (options.explicit && typeof options.explicit === 'object') ? options.explicit : {};
|
|
185
|
+
const rooms = options.rooms ?? null;
|
|
186
|
+
const hay = [data.restaurantRaw, data.logisticsRaw, data.meal, explicit.raw, explicit.note]
|
|
187
|
+
.filter(Boolean).join(' ');
|
|
188
|
+
// 触发只看「用户说过没有」:光有检索候选不算,否则没提小餐厅也会被填进去
|
|
189
|
+
const mentioned = Boolean(data.restaurant)
|
|
190
|
+
|| data.restaurantIntent === true
|
|
191
|
+
|| Object.keys(explicit).length > 0
|
|
192
|
+
|| TRIGGER.test(hay);
|
|
193
|
+
if (!mentioned)
|
|
194
|
+
return null;
|
|
195
|
+
// 人数:用户明确给 > 来访人数(区间取上界)> 客户+陪同 > 10。提及即必填,不再整段丢。
|
|
196
|
+
const companionCount = Array.isArray(data.companions) ? data.companions.length : 0;
|
|
197
|
+
const visit = Number(data.headcountMax || data.headcount || 0) || 0;
|
|
198
|
+
const headcount = Number(explicit.headcount || data.restaurantHeadcount || visit || (visit + companionCount) || 10) || 10;
|
|
199
|
+
const baseDate = pickStr(explicit.startDate || data.visitDate || '');
|
|
200
|
+
// 时段:说了具体时间就用它;否则按「中午/晚上」落档,都没提按晚上
|
|
201
|
+
const noon = /中午|午餐|午宴|午饭/.test(hay);
|
|
202
|
+
const evening = /晚上|晚宴|晚餐|夜里|今晚/.test(hay);
|
|
203
|
+
const inText = timesIn(hay);
|
|
204
|
+
const textTime = pickStr(inText[0]);
|
|
205
|
+
const explicitStart = pickStr(explicit.startTime);
|
|
206
|
+
const duration = Number(explicit.durationMinutes || RESTAURANT_DETAIL.defaultDurationMinutes) || 90;
|
|
207
|
+
const startTime = explicitStart || textTime || (noon ? '11:30' : '18:00');
|
|
208
|
+
const endTime = pickStr(explicit.endTime)
|
|
209
|
+
|| ((explicitStart || textTime) ? hhmmPlus(startTime, duration) : (noon ? '13:30' : '21:00'));
|
|
210
|
+
const mealPeriod = noon ? '中午' : (evening ? '晚上' : '晚上');
|
|
211
|
+
let endDate = pickStr(explicit.endDate) || baseDate;
|
|
212
|
+
// 跨零点:结束时间不晚于开始时间,日期顺延一天
|
|
213
|
+
if (!pickStr(explicit.endDate) && endTime <= startTime && endDate)
|
|
214
|
+
endDate = nextDay(endDate);
|
|
215
|
+
const explicitRoom = pickStr(explicit.roomNo || explicit.room || explicit.roomName);
|
|
216
|
+
const candidates = normalizeRoomCandidates(rooms || []);
|
|
217
|
+
const prev = (data.restaurant && typeof data.restaurant === 'object') ? data.restaurant : null;
|
|
218
|
+
const picked = explicitRoom
|
|
219
|
+
? { name: explicitRoom, capacity: 0, reason: '按指定包厢' }
|
|
220
|
+
// 重跑 render 时没再给候选(比如只传了新的 answers),沿用上一轮已定好的包厢
|
|
221
|
+
: (pickRestaurantRoom(candidates, headcount)
|
|
222
|
+
|| (prev && prev.roomNo
|
|
223
|
+
? { name: prev.roomNo, capacity: prev.roomCapacity || 0, reason: prev.roomReason || '沿用上一轮结果' }
|
|
224
|
+
: null));
|
|
225
|
+
// 三种状态分开报,用户才知道是系统问题还是业务问题
|
|
226
|
+
const rawCount = rawCandidateCount(rooms);
|
|
227
|
+
const roomState = picked
|
|
228
|
+
? ((picked.capacity && headcount > picked.capacity) ? 'overflow' : 'ok')
|
|
229
|
+
: (rawCount ? 'candidates-unparsed' : 'no-candidates');
|
|
230
|
+
return {
|
|
231
|
+
booked: true,
|
|
232
|
+
roomNo: picked ? picked.name : '',
|
|
233
|
+
roomState,
|
|
234
|
+
roomCapacity: picked && picked.capacity ? picked.capacity : 0,
|
|
235
|
+
roomReason: picked
|
|
236
|
+
? picked.reason
|
|
237
|
+
: (rawCount ? `给了 ${rawCount} 条候选但认不出包厢名/容量(检查字段映射)` : '缺包厢号:没拿到可用包厢清单'),
|
|
238
|
+
headcount,
|
|
239
|
+
startDate: baseDate,
|
|
240
|
+
startTime,
|
|
241
|
+
endDate,
|
|
242
|
+
endTime,
|
|
243
|
+
mealPeriod,
|
|
244
|
+
// 候选清单只留名字与容量,用于「订不上时把可选项告诉用户」
|
|
245
|
+
candidates: (candidates.length
|
|
246
|
+
? candidates
|
|
247
|
+
: ((prev && Array.isArray(prev.candidates)) ? prev.candidates : []))
|
|
248
|
+
.slice(0, 20).map((room) => ({ name: room.name, capacity: room.capacity })),
|
|
249
|
+
raw: pickStr(hay).slice(0, 200),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { writeFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* reception.restaurantRooms —— 只读查「小食堂包厢」,产出可直接喂给
|
|
5
|
+
* `doc-render --restaurant-rooms-file` 的候选清单。
|
|
6
|
+
*
|
|
7
|
+
* 为什么单独一条命令:包厢是建模表单业务数据,模型自己拼 ds 命令容易错参数;
|
|
8
|
+
* 固化成命令后,SKILL.md 里只写「跑这一条」,不写接口细节。
|
|
9
|
+
*/
|
|
10
|
+
export async function restaurantRooms(input, ctx) {
|
|
11
|
+
const startedAt = Date.now();
|
|
12
|
+
// 走 host:鉴权与数据集权限上下文由它在内部处理,业务层拿不到凭据
|
|
13
|
+
const result = await ctx.host.fetchRestaurantRooms({
|
|
14
|
+
pageSize: Number(input.pageSize) || undefined,
|
|
15
|
+
timeoutMs: Number(input.timeoutMs) || undefined,
|
|
16
|
+
});
|
|
17
|
+
// --out 直接落盘:模型再读一次文件等于多付一次工具往返
|
|
18
|
+
let file = '';
|
|
19
|
+
if (input.out) {
|
|
20
|
+
const target = resolve(String(input.out));
|
|
21
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
22
|
+
writeFileSync(target, JSON.stringify({ rooms: result.rooms, source: 'e10-ds', fetchedAt: new Date().toISOString() }, null, 2), 'utf8');
|
|
23
|
+
file = target.replace(/\\/gu, '/');
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
state: 'rooms',
|
|
27
|
+
ok: true,
|
|
28
|
+
data: {
|
|
29
|
+
rooms: result.rooms,
|
|
30
|
+
total: result.total,
|
|
31
|
+
rawCount: result.rawCount,
|
|
32
|
+
file,
|
|
33
|
+
/** 超出所有包厢容量时,提示行政区另找场地 */
|
|
34
|
+
maxCapacity: result.rooms.reduce((max, room) => Math.max(max, room.capacity || 0), 0),
|
|
35
|
+
timings: { totalMs: Date.now() - startedAt },
|
|
36
|
+
},
|
|
37
|
+
warnings: result.rooms.length ? [] : ['「小食堂包厢」未返回可用房间:检查数据集权限或上海区域数据'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export const restaurantRoomsOperation = {
|
|
41
|
+
execute: (input, ctx) => restaurantRooms(input, ctx),
|
|
42
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeMeeting, normalizeMeetingRoom } from './leads.js';
|
|
1
2
|
import { nameList } from './shared.js';
|
|
2
3
|
/**
|
|
3
4
|
* 日程明细口径:四种来源(scheduleRows / schedule / agenda / 标准议程兜底)+ 7 列按字段 ID 映射。
|
|
@@ -82,7 +83,12 @@ export function normalizeScheduleRows(data = {}) {
|
|
|
82
83
|
if (!rows.length) {
|
|
83
84
|
const date = data.visitDate || data.arrivalDate || '';
|
|
84
85
|
const start = /^\d{1,2}:\d{2}$/.test(String(data.agendaStart || '')) ? String(data.agendaStart) : '09:30';
|
|
85
|
-
|
|
86
|
+
// 地点列只写一个确定的场地:没开会就写总部,绝不再写「三选一」——
|
|
87
|
+
// 方案里出现「按人数择一」会让人以为还没定场地。
|
|
88
|
+
const venue = String(data.venue || '泛微上海总部');
|
|
89
|
+
const room = normalizeMeeting(data.meeting) === '是'
|
|
90
|
+
? (normalizeMeetingRoom(data.meetingRoom) || venue)
|
|
91
|
+
: venue;
|
|
86
92
|
for (const item of STANDARD_AGENDA) {
|
|
87
93
|
push(pick7({
|
|
88
94
|
date,
|
|
@@ -16,18 +16,23 @@
|
|
|
16
16
|
import { createHash } from 'node:crypto';
|
|
17
17
|
import { readFile, stat } from 'node:fs/promises';
|
|
18
18
|
import { basename } from 'node:path';
|
|
19
|
-
/** 上传协议层错误:`subtype` 直接进 CLI 的 error.subtype,便于按码排障。 */
|
|
20
19
|
export class UploadProtocolError extends Error {
|
|
21
20
|
subtype;
|
|
22
21
|
httpStatus;
|
|
23
22
|
detail;
|
|
24
23
|
contentType;
|
|
25
|
-
|
|
24
|
+
failedAt;
|
|
25
|
+
request;
|
|
26
|
+
constructor(subtype, message, httpStatus, detail, contentType,
|
|
27
|
+
/** 失败发生在哪一阶段:teamsCheck / preUploadCheck / moduleUpload */
|
|
28
|
+
failedAt, request) {
|
|
26
29
|
super(message);
|
|
27
30
|
this.subtype = subtype;
|
|
28
31
|
this.httpStatus = httpStatus;
|
|
29
32
|
this.detail = detail;
|
|
30
33
|
this.contentType = contentType;
|
|
34
|
+
this.failedAt = failedAt;
|
|
35
|
+
this.request = request;
|
|
31
36
|
this.name = 'UploadProtocolError';
|
|
32
37
|
}
|
|
33
38
|
}
|
|
@@ -127,14 +132,25 @@ function terminal(data, expectedSize) {
|
|
|
127
132
|
return record.id;
|
|
128
133
|
}
|
|
129
134
|
/** 发一次 multipart 并判定成功,返回 data 节点。 */
|
|
130
|
-
async function send(transport, path, fields, file
|
|
135
|
+
async function send(transport, path, fields, file,
|
|
136
|
+
/** 失败时回填到错误里,便于定位是哪一阶段挂的 */
|
|
137
|
+
stage) {
|
|
131
138
|
const form = new FormData();
|
|
132
139
|
for (const [key, value] of Object.entries(fields))
|
|
133
140
|
form.append(key, value);
|
|
134
141
|
if (file) {
|
|
135
142
|
form.append('file', new Blob([new Uint8Array(file.buffer.subarray(file.start, file.start + file.size))]), `e10upload.${file.ext}`);
|
|
136
143
|
}
|
|
137
|
-
|
|
144
|
+
try {
|
|
145
|
+
return checkedData(await transport.post(path, form));
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error instanceof UploadProtocolError) {
|
|
149
|
+
// 只补「哪一步、打到哪」,请求头与凭据状态由 host 层填(它才知道实际注入了什么)
|
|
150
|
+
throw new UploadProtocolError(error.subtype, error.message, error.httpStatus, error.detail, error.contentType, stage, { method: 'POST', path, headers: [], auth: {} });
|
|
151
|
+
}
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
138
154
|
}
|
|
139
155
|
/**
|
|
140
156
|
* 走完三阶段上传,返回 fileid。
|
|
@@ -186,7 +202,7 @@ export async function uploadToFileService(input) {
|
|
|
186
202
|
if (type === 'common') {
|
|
187
203
|
const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', uploadFields, {
|
|
188
204
|
name, ext, buffer, start: 0, size: buffer.length,
|
|
189
|
-
});
|
|
205
|
+
}, 'moduleUpload');
|
|
190
206
|
return { fileid: terminal(data, buffer.length), name, size: buffer.length, kind: ext };
|
|
191
207
|
}
|
|
192
208
|
// 5) 分片:按服务端给的 MiB 大小切片,逐片上报
|
|
@@ -203,7 +219,7 @@ export async function uploadToFileService(input) {
|
|
|
203
219
|
for (let index = 0; index < count; index += 1) {
|
|
204
220
|
const start = index * chunkSize;
|
|
205
221
|
const size = Math.min(chunkSize, buffer.length - start);
|
|
206
|
-
const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', { ...uploadFields, chunk: String(index), chunks: String(count), uploadShardSize: String(size) }, { name, ext, buffer, start, size });
|
|
222
|
+
const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', { ...uploadFields, chunk: String(index), chunks: String(count), uploadShardSize: String(size) }, { name, ext, buffer, start, size }, 'moduleUpload');
|
|
207
223
|
if (index === count - 1) {
|
|
208
224
|
fileid = terminal(data, buffer.length);
|
|
209
225
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { randomUUID } from 'node:crypto';
|
|
23
23
|
import { rsSuccess, schemaOf } from './types.js';
|
|
24
24
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
25
|
-
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, findMenuNode, resolveCurrentUser, buildCardUrl, buildListUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
25
|
+
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl, buildListUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
26
26
|
// 面试计划表单字段 dataKey(缓存 fields 里取)。
|
|
27
27
|
// 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
|
|
28
28
|
// 放进来会让未部署数字人的环境连非 AI 面试都建不了(单独按需校验)。
|
|
@@ -266,9 +266,14 @@ async function buildPlan(opts) {
|
|
|
266
266
|
getDsOptions(host, objId, fid('interview_type')),
|
|
267
267
|
getDsOptions(host, objId, fid('interview_session')),
|
|
268
268
|
]);
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
const typeFull = await getDsOptionsFull(host, objId, fid('interview_type'));
|
|
270
|
+
const typeId = typeFull.map[type];
|
|
271
|
+
if (!typeId) {
|
|
272
|
+
if (typeFull.disabled.some(function (d) { return d.name === type; })) {
|
|
273
|
+
throw rsFail('面试方式「' + type + '」已禁用(该枚举项 archive=1),请改用其它面试方式');
|
|
274
|
+
}
|
|
275
|
+
throw rsFail('面试方式「' + type + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
|
|
276
|
+
}
|
|
272
277
|
const sessionId = sessionMap[session];
|
|
273
278
|
if (!sessionId)
|
|
274
279
|
throw rsFail('面试轮次「' + session + '」不在枚举中(' + Object.keys(sessionMap).join('/') + ')');
|
|
@@ -786,10 +791,14 @@ async function prefill(args, env) {
|
|
|
786
791
|
const typeFid = fields.interview_type;
|
|
787
792
|
if (!typeFid)
|
|
788
793
|
throw rsFail('面试计划缺少字段 interview_type(ds/fields 解析不到)');
|
|
789
|
-
const
|
|
790
|
-
const typeId =
|
|
791
|
-
if (!typeId)
|
|
792
|
-
|
|
794
|
+
const typeFull = await getDsOptionsFull(ctx.host, objId, typeFid);
|
|
795
|
+
const typeId = typeFull.map[typeKey];
|
|
796
|
+
if (!typeId) {
|
|
797
|
+
if (typeFull.disabled.some(function (d) { return d.name === typeKey; })) {
|
|
798
|
+
throw rsFail('面试方式「' + typeKey + '」已禁用(该枚举项 archive=1),请改用其它面试方式');
|
|
799
|
+
}
|
|
800
|
+
throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
|
|
801
|
+
}
|
|
793
802
|
const cardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
794
803
|
const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
|
|
795
804
|
const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}');`
|
|
@@ -421,6 +421,12 @@ function ambiguousPerson(keyword, rows) {
|
|
|
421
421
|
* prepare 可通过 dsOptionsSnapshot() 把结果放进 continuation,apply 用 restoreDsOptions() 复用,避免重复请求。
|
|
422
422
|
*/
|
|
423
423
|
const dsOptionsMemo = new Map();
|
|
424
|
+
/**
|
|
425
|
+
* getDsOptionsFull 独立 memo:它返回 {map, disabled},结构与 dsOptionsMemo 的 Record 不同。
|
|
426
|
+
* 混用会让 dsOptionsSnapshot() 把 full 结构写进 continuation,apply 复用时报类型错误,
|
|
427
|
+
* 所以两者分开缓存;full 的结果不进快照,apply 时按需回源。
|
|
428
|
+
*/
|
|
429
|
+
const dsOptionsFullMemo = new Map();
|
|
424
430
|
export function restoreDsOptions(snapshot) {
|
|
425
431
|
for (const [key, value] of Object.entries(snapshot || {})) {
|
|
426
432
|
if (value && typeof value === 'object' && Object.keys(value).length) {
|
|
@@ -508,6 +514,7 @@ export async function verifySubmitted(opts) {
|
|
|
508
514
|
/** 回查/校验失败时清空进程内枚举 memo,并标记磁盘环境缓存失效(下次自动重建)。 */
|
|
509
515
|
export function invalidateEnvCache(baseUrl, appId) {
|
|
510
516
|
dsOptionsMemo.clear();
|
|
517
|
+
dsOptionsFullMemo.clear();
|
|
511
518
|
if (!baseUrl || !appId)
|
|
512
519
|
return;
|
|
513
520
|
try {
|
|
@@ -518,27 +525,48 @@ export function invalidateEnvCache(baseUrl, appId) {
|
|
|
518
525
|
}
|
|
519
526
|
catch { /* 缓存文件不存在/只读盘:不影响主流程 */ }
|
|
520
527
|
}
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
528
|
+
async function fetchDsOptionsRaw(host, objId, fieldId, groupId) {
|
|
529
|
+
const r = await host.request({
|
|
530
|
+
path: '/api/ebuilder/common/ds/options?fieldName=' + fieldId + '&objId=' + objId + '&sourceType=FORM'
|
|
531
|
+
+ (groupId ? '&groupId=' + groupId : ''),
|
|
532
|
+
method: 'GET',
|
|
533
|
+
});
|
|
534
|
+
return r?.data || [];
|
|
535
|
+
}
|
|
536
|
+
/** 全量版:map 排除 archive=1 的禁用项,disabled 单独列出供「已禁用」精确报错。 */
|
|
537
|
+
export async function getDsOptionsFull(host, objId, fieldId, groupId = '') {
|
|
538
|
+
const key = objId + ':' + fieldId + (groupId ? ':' + groupId : '') + ':full';
|
|
539
|
+
const hit = dsOptionsFullMemo.get(key);
|
|
524
540
|
if (hit)
|
|
525
541
|
return hit;
|
|
526
542
|
const task = (async () => {
|
|
527
|
-
const
|
|
528
|
-
path: '/api/ebuilder/common/ds/options?fieldName=' + fieldId + '&objId=' + objId + '&sourceType=FORM'
|
|
529
|
-
+ (groupId ? '&groupId=' + groupId : ''),
|
|
530
|
-
method: 'GET',
|
|
531
|
-
});
|
|
532
|
-
const list = r?.data || [];
|
|
543
|
+
const list = await fetchDsOptionsRaw(host, objId, fieldId, groupId);
|
|
533
544
|
const map = {};
|
|
534
|
-
|
|
535
|
-
|
|
545
|
+
const disabled = [];
|
|
546
|
+
for (const x of list) {
|
|
547
|
+
if (!x?.name || !x?.id)
|
|
548
|
+
continue;
|
|
549
|
+
if (String(x.archive) === '1')
|
|
550
|
+
disabled.push({ name: String(x.name), id: String(x.id) });
|
|
551
|
+
else
|
|
536
552
|
map[String(x.name)] = String(x.id);
|
|
553
|
+
}
|
|
537
554
|
// 空结果不缓存:字典引用类字段可能临时返回空,下次应能重新回源
|
|
538
|
-
if (!Object.keys(map).length)
|
|
539
|
-
|
|
540
|
-
return map;
|
|
555
|
+
if (!Object.keys(map).length && !disabled.length)
|
|
556
|
+
dsOptionsFullMemo.delete(key);
|
|
557
|
+
return { map, disabled };
|
|
541
558
|
})();
|
|
559
|
+
dsOptionsFullMemo.set(key, task);
|
|
560
|
+
task.catch(() => { dsOptionsFullMemo.delete(key); });
|
|
561
|
+
return task;
|
|
562
|
+
}
|
|
563
|
+
export async function getDsOptions(host, objId, fieldId, groupId = '') {
|
|
564
|
+
// key 沿用旧口径(不含 groupId),保证 dsOptionsSnapshot() 的键与 apply 复用一致
|
|
565
|
+
const key = objId + ':' + fieldId;
|
|
566
|
+
const hit = dsOptionsMemo.get(key);
|
|
567
|
+
if (hit)
|
|
568
|
+
return hit;
|
|
569
|
+
const task = getDsOptionsFull(host, objId, fieldId, groupId).then((r) => r.map);
|
|
542
570
|
dsOptionsMemo.set(key, task);
|
|
543
571
|
task.catch(() => { dsOptionsMemo.delete(key); });
|
|
544
572
|
return task;
|
package/docs/archive-oa.md
CHANGED
|
@@ -48,10 +48,11 @@ weaver-work-cli --json archive-oa run archive-oa.contract.list --input-json '{"p
|
|
|
48
48
|
| 分组 | operation |
|
|
49
49
|
| --- | --- |
|
|
50
50
|
| 档案定位 | `archive-oa.archive.locate` |
|
|
51
|
+
| 我借阅的合同档案 | `archive-oa.my-borrow.list` |
|
|
51
52
|
| 泛微合同 | `archive-oa.contract.list`、`archive-oa.contract.fields` |
|
|
52
|
-
| 泛微借阅车 | `archive-oa.borrow-car.list`、`archive-oa.borrow-car.add.prepare`、`archive-oa.borrow-car.add.apply` |
|
|
53
|
+
| 泛微借阅车 | `archive-oa.borrow-car.list`、`archive-oa.borrow-car.add.prepare`、`archive-oa.borrow-car.add.apply`、`archive-oa.borrow-car.remove.prepare`、`archive-oa.borrow-car.remove.apply` |
|
|
53
54
|
| 契约锁合同 | `archive-oa.qys.contract.list` |
|
|
54
|
-
| 契约锁借阅车 | `archive-oa.qys.borrow-car.list`、`archive-oa.qys.borrow-car.add.prepare`、`archive-oa.qys.borrow-car.add.apply` |
|
|
55
|
+
| 契约锁借阅车 | `archive-oa.qys.borrow-car.list`、`archive-oa.qys.borrow-car.add.prepare`、`archive-oa.qys.borrow-car.add.apply`、`archive-oa.qys.borrow-car.remove.prepare`、`archive-oa.qys.borrow-car.remove.apply` |
|
|
55
56
|
|
|
56
57
|
| 发起借阅(生成流程页 URL) | `archive-oa.borrow.start.url`、`archive-oa.qys.borrow.start.url` |
|
|
57
58
|
|
|
@@ -64,6 +65,7 @@ weaver-work-cli --json archive-oa run archive-oa.contract.list --input-json '{"p
|
|
|
64
65
|
| 合同查询 `passid` / `listId` | `850741972510941185` / `850741985437786120` | `850742853046345728` / `1190611964371984450` |
|
|
65
66
|
| 借阅车 `listId` | `882393480417296390` | `883819516961857839` |
|
|
66
67
|
| 加入借阅车 `esbActionIds` | `882395911377174530` | `892706856573648911` |
|
|
68
|
+
| 移出借阅车 `esbActionIds` / `objId` | `882413705640943619` / `882393476189437952` | `882413705640943619` / `882393476189437952` |
|
|
67
69
|
|
|
68
70
|
## 写操作确认协议
|
|
69
71
|
|
package/package.json
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
- `archive-locate.md`:按合同号定位档案(`htbh` 必须放 body 顶层)。
|
|
4
4
|
- `contract-search.md`:泛微商务合同查询与可搜索字段配置(`commonSearchFields` 构造规则)。
|
|
5
5
|
- `qys-contract-search.md`:契约锁协作采纳(案例)合同查询(默认只查已归档)。
|
|
6
|
-
- `borrow-car.md`:借阅车列表;加入借阅车是临时铺垫操作,`prepare -> apply`
|
|
6
|
+
- `borrow-car.md`:借阅车列表;加入借阅车是临时铺垫操作,`prepare -> apply` **免用户确认、直接执行**;移出借阅车(删除)走 `remove.prepare -> remove.apply`,属破坏性写操作,**必须先经用户确认**。
|
|
7
7
|
- `borrow-flow.md`:发起借阅的职责边界(用户在浏览器登录后自己操作)与给用户的指引。
|
|
8
|
+
- `my-borrow-contract.md`:我借阅的合同档案台账(eBuilder 列表),默认只查未过期,含电子档案链接判定。
|
|
8
9
|
- `disabled-capabilities.md`:接口未收录与必须由用户在界面完成的操作边界。
|
|
9
10
|
|
|
10
11
|
Agent 调优重点:
|