weaver-work-cli 0.1.48 → 0.1.50
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-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-EJYIOJPH.js} +3 -3
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-3NCFFHB2.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-6T53BSWZ.js} +158 -44
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-7AYQJSFY.js} +2 -2
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-7ECB22G3.js} +221 -30
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-BFKLQLBK.js} +8 -8
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-HARQF5IP.js} +28 -28
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-NK74RE5F.js → chunk-K67FODVC.js} +3 -3
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-MCZG6HPM.js} +3 -3
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-RYFRGTUV.js} +5 -5
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-WNJUGI2F.js} +1 -1
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-YB3AJYPY.js} +4 -4
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-C4UDHCWV.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-VUC6JOPG.js} +464 -9
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-6OG2LYBD.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-B6GKA2J3.js → env-WP57TF2S.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-VUXI7N5C.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-UQRGXILK.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-E7GOITEU.js} +1 -1
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-4BBLVAWM.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-QGPNTGHG.js} +526 -175
- package/dist/chunks/{recruit-stage-ERZD3ZNB.js → recruit-stage-FKWS5UQF.js} +66 -13
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-22O6UG4I.js → registry-5CRCN2TV.js} +10 -10
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-V4CHRQDI.js} +1 -1
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-AYR3UG7R.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-JZEFIXUS.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-3ZAF2J5E.js} +4 -4
- package/dist/index.js +16 -11
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/registry.js +4 -1
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +53 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +283 -1
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/manifest.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +13 -6
- package/dist/shortcuts/reception/index.js +3 -1
- package/dist/shortcuts/reception/manifest.js +3 -2
- package/dist/shortcuts/reception/operations/ask.js +20 -2
- package/dist/shortcuts/reception/operations/compose.js +11 -0
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +31 -7
- package/dist/shortcuts/reception/operations/panels.js +86 -22
- package/dist/shortcuts/reception/operations/render.js +40 -0
- package/dist/shortcuts/reception/operations/restaurant.js +17 -4
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/workflow/operations/read.js +58 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +2 -1
- package/docs/_catalog.md +4 -1
- package/docs/data.md +149 -0
- package/docs/fna.md +11 -4
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +29 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/domains/qiyecheng.md +4 -2
- package/skills/weaver-e10-archive-oa/SKILL.md +7 -6
- package/skills/weaver-e10-archive-oa/references/contract-search.md +83 -14
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +35 -11
- package/skills/weaver-e10-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +219 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +50 -30
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +24 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +43 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +265 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +83 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +21 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +104 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +17 -3
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +136 -30
- package/skills/weaver-e10-reception-flow/SKILL.md +70 -19
- package/skills/weaver-e10-reception-flow/references/guide.md +5 -4
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +1 -1
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +6 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +6 -45
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +4 -37
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +22 -35
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
2
|
-
import { buildPanels } from './panels.js';
|
|
2
|
+
import { buildPanels, normalizeDemand, parseLogistics, setCompanionMobile } from './panels.js';
|
|
3
3
|
import { newRunId, saveRun } from './runs.js';
|
|
4
4
|
import { normalizeMeeting } from './leads.js';
|
|
5
5
|
import { nameList } from './shared.js';
|
|
@@ -17,9 +17,25 @@ export async function ask(input, ctx) {
|
|
|
17
17
|
// 房间只能由 CLI 按人数选,known 里带的房间/后勤一律不采信
|
|
18
18
|
delete data.meetingRoom;
|
|
19
19
|
delete data.meetingRoomMeta;
|
|
20
|
+
// known.logistics 是「接待细节原文」,先拆成 6 个子项再丢原文:
|
|
21
|
+
// 不拆的话面板 prefilled 是空的,用户会被要求把已经说过的话重填一遍。
|
|
22
|
+
if (typeof data.logistics === 'string' && data.logistics.trim()) {
|
|
23
|
+
const parsed = parseLogistics(data.logistics);
|
|
24
|
+
const mobile = parsed.mobile;
|
|
25
|
+
delete parsed.mobile;
|
|
26
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
27
|
+
if (!data[key])
|
|
28
|
+
data[key] = value;
|
|
29
|
+
}
|
|
30
|
+
if (mobile)
|
|
31
|
+
setCompanionMobile(data, mobile);
|
|
32
|
+
}
|
|
20
33
|
delete data.logistics;
|
|
21
34
|
delete data.customer_need;
|
|
22
|
-
//
|
|
35
|
+
// 客户需求来源归一:SKILL 让模型写 `customerNeed`,而面板与缺口判定只认 `demand`,
|
|
36
|
+
// 两处不统一就会出现「原话已明确需求、面板仍追问」。这里只保留 demand 一个来源。
|
|
37
|
+
normalizeDemand(data);
|
|
38
|
+
// 会议表态必须带 meetingExplicit,否则视为「没说过」:清掉推断值,留给会议屏去问。
|
|
23
39
|
// 值本身也要归一(需要/要/安排 → 是),否则 compose 里的 `=== '是'` 会静默漏填。
|
|
24
40
|
if (data.meetingExplicit === true) {
|
|
25
41
|
const meeting = normalizeMeeting(data.meeting);
|
|
@@ -70,6 +86,8 @@ export async function ask(input, ctx) {
|
|
|
70
86
|
customer: data.customer || '',
|
|
71
87
|
visitDate: data.visitDate || '',
|
|
72
88
|
visitType: data.visitType || '',
|
|
89
|
+
demand: data.demand || '',
|
|
90
|
+
meeting: data.meeting || '',
|
|
73
91
|
companions: data.companions || [],
|
|
74
92
|
// 兜底由 render 阶段补:ask 不读会话,这里恒为空
|
|
75
93
|
contactFallback: '',
|
|
@@ -218,6 +218,12 @@ export function composeInitialValues(options) {
|
|
|
218
218
|
putRest(restaurant.fields.endTime, data.restaurant.endTime || '');
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
+
else if (data.restaurant) {
|
|
222
|
+
// 有餐厅入参却没归一成 booking(缺 booked):不能静默跳过。
|
|
223
|
+
// 「文档里写了包厢、页面上没有」这种矛盾,只能靠人工比对才发现,代价太高。
|
|
224
|
+
warnings.push('小餐厅明细未写入:入参未归一(缺少 booked),请确认包厢与用餐时间后手工补填');
|
|
225
|
+
todos.push('小餐厅预定明细待补填(包厢、人数、时间)');
|
|
226
|
+
}
|
|
221
227
|
const built = buildCustomParams(items);
|
|
222
228
|
params.values = built.values;
|
|
223
229
|
params.keys = built.keys;
|
|
@@ -227,6 +233,11 @@ export function composeInitialValues(options) {
|
|
|
227
233
|
todos.push('陪同人员未填');
|
|
228
234
|
if (!data.demand)
|
|
229
235
|
todos.push('客户需求未填');
|
|
236
|
+
// 会议没表态时不造数据,但也不能让它悄悄漏掉:接待细节里没写就进待办,
|
|
237
|
+
// 由行政在页面上确认,避免「会议室整段空着还没人发现」。
|
|
238
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
239
|
+
todos.push('是否需要会议未表态:会议室未预留,提交前请行政确认');
|
|
240
|
+
}
|
|
230
241
|
return {
|
|
231
242
|
values: params.values,
|
|
232
243
|
keys: params.keys,
|
|
@@ -2,7 +2,9 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { basename, join } from 'node:path';
|
|
3
3
|
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
4
4
|
import { receptionValidationError } from '../errors.js';
|
|
5
|
+
import { applyMeetingPolicy, normalizeMeeting } from './leads.js';
|
|
5
6
|
import { mergeAnswers } from './panels.js';
|
|
7
|
+
import { normalizeRestaurant } from './restaurant.js';
|
|
6
8
|
import { requirePython, renderBoth, resolveRenderPy } from './render-assets.js';
|
|
7
9
|
import { newRunId, saveRun, tryLoadRun } from './runs.js';
|
|
8
10
|
import { canonical, ensureDir, parseJsonText, sha256, writeJson } from './shared.js';
|
|
@@ -50,6 +52,35 @@ function applyCases(data, casesFile) {
|
|
|
50
52
|
data.expertsQuery = String(expertsQuery);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* 读「小食堂包厢」候选文件。
|
|
57
|
+
*
|
|
58
|
+
* 允许直接丢 `e10-data ds list` 的原始输出(裸数组 / 裹在 data.list 里 / field_xxx 键),
|
|
59
|
+
* 归一交给 normalizeRoomCandidates;这里只负责把 JSON 读进来并给出可定位的报错。
|
|
60
|
+
*/
|
|
61
|
+
function readRoomsFile(path) {
|
|
62
|
+
let raw;
|
|
63
|
+
try {
|
|
64
|
+
raw = readFileSync(path, 'utf8');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
throw receptionValidationError('RESTAURANT_ROOMS_UNREADABLE', `读不到 --restaurant-rooms-file:${path}`, {
|
|
68
|
+
path,
|
|
69
|
+
detail: error.message,
|
|
70
|
+
hint: '传「小食堂包厢」ds list 的原始输出,或 [{name,capacity}] 数组',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const parsed = parseJsonText(raw);
|
|
74
|
+
if (!parsed.ok) {
|
|
75
|
+
throw receptionValidationError('RESTAURANT_ROOMS_INVALID', `--restaurant-rooms-file 不是合法 JSON:${parsed.error}`, {
|
|
76
|
+
path,
|
|
77
|
+
preview: parsed.preview,
|
|
78
|
+
hasBom: parsed.hasBom,
|
|
79
|
+
hint: '常见原因:UTF-8 BOM、中文引号、尾随逗号;修 JSON 本身,不要换传参方式',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return parsed.value;
|
|
83
|
+
}
|
|
53
84
|
export async function doc(input, ctx) {
|
|
54
85
|
const startedAt = Date.now();
|
|
55
86
|
const runIdArg = String(input.runId || '').trim();
|
|
@@ -83,6 +114,34 @@ export async function doc(input, ctx) {
|
|
|
83
114
|
const data = mergeAnswers(run, answers);
|
|
84
115
|
if (input.casesFile)
|
|
85
116
|
applyCases(data, input.casesFile);
|
|
117
|
+
// 定房必须发生在出件之前:md/docx 在 doc 阶段一次成文,
|
|
118
|
+
// 若只在 render 里跑 applyMeetingPolicy,参考文档里永远写「场地待定」,
|
|
119
|
+
// 而填单页却有房间——两份产物互相打脸。
|
|
120
|
+
applyMeetingPolicy(data);
|
|
121
|
+
// 小餐厅:只有用户明确提到才归一(内部按触发词判定),候选来自「小食堂包厢」实查结果。
|
|
122
|
+
// 以前 --restaurant-rooms-file 只被 CLI 接收、无人消费,data.restaurant 恒不存在,
|
|
123
|
+
// 子表、md 段落、缺包厢号的硬校验三处一起失效。
|
|
124
|
+
const booking = normalizeRestaurant({
|
|
125
|
+
data,
|
|
126
|
+
rooms: input.restaurantRoomsFile ? readRoomsFile(input.restaurantRoomsFile) : null,
|
|
127
|
+
});
|
|
128
|
+
if (booking)
|
|
129
|
+
data.restaurant = booking;
|
|
130
|
+
// md 的「待确认事项」读 data.todo(不是 compose 的 todos):会议没表态、包厢没定,
|
|
131
|
+
// 都要在文档里写明,不能出现「场地待定」却把待确认事项写成「无」。
|
|
132
|
+
const todo = Array.isArray(data.todo) ? [...data.todo] : [];
|
|
133
|
+
const addTodo = (item) => {
|
|
134
|
+
if (item && !todo.includes(item))
|
|
135
|
+
todo.push(item);
|
|
136
|
+
};
|
|
137
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
138
|
+
addTodo('是否需要会议未表态:会议室未预留,请行政确认后回填');
|
|
139
|
+
}
|
|
140
|
+
if (booking && booking.booked && !String(booking.roomNo || '').trim()) {
|
|
141
|
+
addTodo(`小餐厅包厢待确认:${booking.roomReason || '未取到可用包厢'}`);
|
|
142
|
+
}
|
|
143
|
+
if (todo.length)
|
|
144
|
+
data.todo = todo;
|
|
86
145
|
const outDir = input.outDir || run.outDir || ctx.outDir;
|
|
87
146
|
ensureDir(outDir);
|
|
88
147
|
const warnings = [];
|
|
@@ -18,7 +18,31 @@ export async function docRender(input, ctx) {
|
|
|
18
18
|
const runId = String((docResult.data || {}).runId || input.runId || '');
|
|
19
19
|
// answers / snapshotPath 已经由 doc 写进 run,这里只传 runId;
|
|
20
20
|
// sdkRender 属于 render 自己的入参,透传即可。
|
|
21
|
-
|
|
21
|
+
let renderResult;
|
|
22
|
+
try {
|
|
23
|
+
renderResult = await render({
|
|
24
|
+
runId,
|
|
25
|
+
sdkRender: input.sdkRender,
|
|
26
|
+
// answers 与 allowMissingRestaurant 必须透传:
|
|
27
|
+
// render 虽然会回落到 run.answers,但「同一 run 二次调用带新 answers」只能靠这里;
|
|
28
|
+
// 漏传 allowMissingRestaurant 会让 doc-render 上的放行开关整个失效。
|
|
29
|
+
answers: input.answers,
|
|
30
|
+
allowMissingRestaurant: input.allowMissingRestaurant === true,
|
|
31
|
+
}, ctx);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// 出件已成功、只有填单参数被拦(典型:提了小餐厅却没给包厢号)。
|
|
35
|
+
// 把产物路径带进错误,调用方才知道「文件已经在本地,补参数重跑本条即可」,
|
|
36
|
+
// 不必重新出件、更不用重新检索案例。
|
|
37
|
+
const err = error;
|
|
38
|
+
const files = (docResult.data || {}).files;
|
|
39
|
+
if (err && err.details && typeof err.details === 'object' && Array.isArray(files) && files.length) {
|
|
40
|
+
err.details.files = files;
|
|
41
|
+
err.details.runId = runId;
|
|
42
|
+
err.details.note = '行程单与参考文档已生成,补齐后重跑 doc-render --run-id 即可,不必重出件';
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
22
46
|
return {
|
|
23
47
|
state: renderResult.state,
|
|
24
48
|
ok: renderResult.ok,
|
|
@@ -78,7 +78,7 @@ export function normalizeMeeting(value) {
|
|
|
78
78
|
* - 明确「是」:有合法房间就沿用,否则按人数上界自动定;
|
|
79
79
|
* - 明确「否」:房间清成「不需会议室」,6 个字段都不填;
|
|
80
80
|
* - 只给了合法房间、没表态:视为要开会(已经点名房间,不该再问一次);
|
|
81
|
-
* -
|
|
81
|
+
* - 什么都没有:不造数据,留给会议屏去问;没答就被 render 的 MEETING_UNCONFIRMED 拦住
|
|
82
82
|
*/
|
|
83
83
|
export function applyMeetingPolicy(data) {
|
|
84
84
|
const declared = normalizeMeeting(data.meeting);
|
|
@@ -208,13 +208,37 @@ export function detectProductIndustry(data = {}, raw = '') {
|
|
|
208
208
|
}
|
|
209
209
|
return { product: '业财', industry };
|
|
210
210
|
}
|
|
211
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* 客户类型 → 解决方案口径:政企 → 数智公文 / 科技公司 → AI 智能化 / 其余 → 数智业财。
|
|
213
|
+
*
|
|
214
|
+
* 政企必须优先判:「某某大数据管理局」含「数据」,先判科技就会推成 AI,口径就错了。
|
|
215
|
+
* 央国企的字号里不会出现「国企」两个字(东方航空、某某电网),所以补一组行业字号;
|
|
216
|
+
* 但不用「集团 / 控股」这种泛词——「某某科技集团」会被误判成公文。
|
|
217
|
+
*/
|
|
218
|
+
export function solutionLabel(data = {}) {
|
|
219
|
+
if (isGovClient(data))
|
|
220
|
+
return '数智公文';
|
|
221
|
+
const name = String(data.customer || '');
|
|
222
|
+
if (/航空|铁路|电力|电网|石油|石化|燃气|水务|烟草|邮政|电信|移动通信|联通|银行|保险|证券/.test(name)) {
|
|
223
|
+
return '数智公文';
|
|
224
|
+
}
|
|
225
|
+
if (/科技|信息技术|网络|软件|互联网|智能|数字|数据/.test(name))
|
|
226
|
+
return 'AI智能化';
|
|
227
|
+
return '数智业财';
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* 需求面板四个选项,第 2 项按客户类型动态拼。
|
|
231
|
+
*
|
|
232
|
+
* 这是**默认值**,不是唯一答案:模型按客户名判断更准时可以改写第 2 项(见 SKILL 面板铁律)。
|
|
233
|
+
* CLI 一定给出完整文案,不会因为模型没替换而把占位符露给用户。
|
|
234
|
+
*/
|
|
212
235
|
export function buildNeedOptions(data = {}) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
236
|
+
return [
|
|
237
|
+
'参观公司总部,了解公司实力',
|
|
238
|
+
`了解泛微产品,与${solutionLabel(data)}解决方案`,
|
|
239
|
+
'推进项目进度,交流实施细节',
|
|
240
|
+
'暂未明确',
|
|
241
|
+
];
|
|
218
242
|
}
|
|
219
243
|
/**
|
|
220
244
|
* 推荐陪访领导:产品线总经理为主,政务加政务群总,技术交流加技术总监,重要客户加副总裁。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LOGISTICS_FIELDS, LOGISTICS_HINT, LOGISTICS_LABEL, LOGISTICS_PLACEHOLDER, LOGISTICS_TITLE, MEETING_OPTIONS, MEETING_TITLE, } from '../constants.js';
|
|
2
|
+
import { buildNeedOptions } from './leads.js';
|
|
2
3
|
/**
|
|
3
4
|
* 后勤与人数自由文本 → 6 个子项。
|
|
4
5
|
*
|
|
@@ -32,8 +33,18 @@ export function parseLogistics(text) {
|
|
|
32
33
|
.map((item) => item.trim())
|
|
33
34
|
.filter(Boolean);
|
|
34
35
|
for (const part of segs) {
|
|
36
|
+
// 会议否定必须先于房间识别:「不用订会议室」「不安排会议」里既没有房间号,
|
|
37
|
+
// 也不能让后面的 named 兜底把它吞成一个叫「不用订会议室」的脏房间。
|
|
38
|
+
// 中间动词(订/定/预)要容忍,否则 SKILL 自己举的例子都认不出来。
|
|
39
|
+
const noMeeting = /(不需要|不用|无需|不安排|不订|不要|取消|没有)\s*(订|定|预)?\s*(会议|会议室|开会|座谈|汇报)/.test(part);
|
|
40
|
+
if (noMeeting) {
|
|
41
|
+
if (!out.meeting)
|
|
42
|
+
out.meeting = '否';
|
|
43
|
+
if (!out.meetingRoom)
|
|
44
|
+
out.meetingRoom = '不需会议室';
|
|
45
|
+
}
|
|
35
46
|
// 一个片段可能同时含多个子项(如「10人 总部130会议室」),因此逐项独立判断,不 continue
|
|
36
|
-
if (!out.meetingRoom) {
|
|
47
|
+
if (!out.meetingRoom && !noMeeting) {
|
|
37
48
|
// 兼容「总部131」「131会议室」「总部131会议室」三种写法;
|
|
38
49
|
// 数字前后不能紧邻数字,否则会从手机号里捞出 131。
|
|
39
50
|
const room = part.match(/(?:总部\s*)?(?<!\d)(129|130|131)(?!\d)\s*会议室/)
|
|
@@ -90,6 +101,15 @@ export function parseLogistics(text) {
|
|
|
90
101
|
out.gift = part;
|
|
91
102
|
}
|
|
92
103
|
}
|
|
104
|
+
if (!out.meeting && !noMeeting) {
|
|
105
|
+
// placeholder 里一直写着「是否会议」,但此前没有任何分支解析它:
|
|
106
|
+
// 用户手写「要开会」「不用订会议室」等于白写,会议字段只能靠 known 里猜。
|
|
107
|
+
// 否定已在片段开头处理(noMeeting),这里只判「要开会」这一侧。
|
|
108
|
+
if (/(要|需要|安排|预定|预订|订|开|有)\s*(会议|开会|座谈|汇报)|会议|开会|座谈/.test(part)) {
|
|
109
|
+
// 点名了房间(总部130会议室)也落到这里:已经给房间就是要开会
|
|
110
|
+
out.meeting = '是';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
93
113
|
}
|
|
94
114
|
return out;
|
|
95
115
|
}
|
|
@@ -109,12 +129,36 @@ export function setCompanionMobile(data, mobile) {
|
|
|
109
129
|
data.mobile = value;
|
|
110
130
|
}
|
|
111
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* 客户需求来源归一:`customerNeed`(SKILL 口径)→ `demand`(内部字段)。
|
|
134
|
+
*
|
|
135
|
+
* 两个字段并存过一段时间:面板与缺口判定只认 `demand`,而 SKILL 让模型写 `customerNeed`,
|
|
136
|
+
* 于是「原话已经说清需求」仍然被追问一屏。统一在入口处收敛,下游只认一个字段。
|
|
137
|
+
*/
|
|
138
|
+
export function normalizeDemand(data) {
|
|
139
|
+
const need = String(data.customerNeed ?? '').trim();
|
|
140
|
+
if (need)
|
|
141
|
+
data.demand = need;
|
|
142
|
+
delete data.customerNeed;
|
|
143
|
+
}
|
|
112
144
|
/** 合并 run 上下文与 ask_user 的 answers。 */
|
|
113
145
|
export function mergeAnswers(run, answers = {}) {
|
|
114
146
|
const data = { ...(run.data || {}) };
|
|
147
|
+
// run 重建(doc --known)走不到 ask,这里补一次归一,md 才不会丢掉客户需求
|
|
148
|
+
normalizeDemand(data);
|
|
115
149
|
if (answers && typeof answers === 'object') {
|
|
116
|
-
if (answers.fields && typeof answers.fields === 'object')
|
|
117
|
-
|
|
150
|
+
if (answers.fields && typeof answers.fields === 'object') {
|
|
151
|
+
// 小餐厅是 CLI 归一后的产物(booked / roomState / roomNo / 时间),
|
|
152
|
+
// answers.fields 里那份通常还是原始入参(没有 booked)。整体 assign 会把归一结果冲掉:
|
|
153
|
+
// 下游 compose 判定「没订餐」整段跳过,render 的缺包厢号硬校验也因为 booked 丢失而失效,
|
|
154
|
+
// 表现就是「文档写了包厢、页面上一行没有、还没有告警」。
|
|
155
|
+
// 因此只逐字段并入,派生字段(booked 等)保留。
|
|
156
|
+
const { restaurant: rawRestaurant, ...rest } = answers.fields;
|
|
157
|
+
Object.assign(data, rest);
|
|
158
|
+
if (rawRestaurant && typeof rawRestaurant === 'object' && !Array.isArray(rawRestaurant)) {
|
|
159
|
+
data.restaurant = { ...(data.restaurant || {}), ...rawRestaurant };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
118
162
|
if (answers.customer_need)
|
|
119
163
|
data.demand = String(answers.customer_need);
|
|
120
164
|
if (answers.logistics) {
|
|
@@ -141,11 +185,18 @@ export function mergeAnswers(run, answers = {}) {
|
|
|
141
185
|
*
|
|
142
186
|
* 硬约束(宿主实测):title 严格单行、超长截断成「…」;placeholder 正常渲染;hint 不渲染。
|
|
143
187
|
* 因此标题只留一句短话,完整清单放 placeholder,口径放 hint。
|
|
144
|
-
*
|
|
188
|
+
*
|
|
189
|
+
* 三屏,顺序固定:客户需求 → 接待细节 → 是否会议。
|
|
190
|
+
* - 客户需求:原话点到具体产品/场景/主题就不出;
|
|
191
|
+
* - 接待细节:**常驻**,已识别项作预填说明,不因信息齐全省略这一屏;
|
|
192
|
+
* - 是否会议:必问项,只有原话明确提及会议室才跳过。
|
|
145
193
|
*/
|
|
146
194
|
export function buildPanels(data) {
|
|
147
195
|
const panels = [];
|
|
148
|
-
|
|
196
|
+
// 双判:正常路径已由 normalizeDemand 收敛过,这里兜住直接调 buildPanels 的调用方,
|
|
197
|
+
// 免得只传 customerNeed 时又弹一屏「客户需求」。
|
|
198
|
+
const hasDemand = Boolean(String(data.demand || data.customerNeed || '').trim());
|
|
199
|
+
if (!hasDemand) {
|
|
149
200
|
panels.push({
|
|
150
201
|
id: 'customer_need',
|
|
151
202
|
// 同样受「标题单行」约束:不写 ①②③ 追问清单,只留一句
|
|
@@ -153,26 +204,39 @@ export function buildPanels(data) {
|
|
|
153
204
|
inputType: 'single',
|
|
154
205
|
required: false,
|
|
155
206
|
allowCustomInput: true,
|
|
156
|
-
options:
|
|
207
|
+
options: buildNeedOptions(data).map((item) => ({ label: item, value: item })),
|
|
157
208
|
});
|
|
158
209
|
}
|
|
159
|
-
|
|
210
|
+
// 接待细节常驻:原话已经写全了也照出,已识别项进 prefilled,由模型在问之前先说一遍。
|
|
211
|
+
// 省略这一屏的代价是「默认值静默生效」——用户不知道系统替他定了什么。
|
|
160
212
|
const mobile = ((data.companions || []).find((item) => item && item.mobile) || {}).mobile || '';
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
213
|
+
const known = LOGISTICS_FIELDS
|
|
214
|
+
.filter((key) => data[key])
|
|
215
|
+
.map((key) => `${LOGISTICS_LABEL[key]}:${data[key]}`);
|
|
216
|
+
if (mobile)
|
|
217
|
+
known.push(`${LOGISTICS_LABEL.mobile}:${mobile}`);
|
|
218
|
+
panels.push({
|
|
219
|
+
id: 'logistics',
|
|
220
|
+
// 标题严格单行:不拼字段清单、不拼已识别项、不讲规则——拼了必被截断成「…」
|
|
221
|
+
title: LOGISTICS_TITLE,
|
|
222
|
+
inputType: 'text',
|
|
223
|
+
required: false,
|
|
224
|
+
allowCustomInput: true,
|
|
225
|
+
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
226
|
+
placeholder: LOGISTICS_PLACEHOLDER,
|
|
227
|
+
prefilled: known,
|
|
228
|
+
});
|
|
229
|
+
// 第 3 问:是否会议。只有已知值(面板回传过,或原话明确表态)才跳过。
|
|
230
|
+
// 不在这里做任何推断:写着「晚上订小餐厅」也只算用餐场地,不算表态。
|
|
231
|
+
const meetingAnswered = data.meeting === '是' || data.meeting === '否';
|
|
232
|
+
if (!meetingAnswered) {
|
|
167
233
|
panels.push({
|
|
168
|
-
id: '
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
175
|
-
placeholder: LOGISTICS_PLACEHOLDER,
|
|
234
|
+
id: 'meeting',
|
|
235
|
+
title: MEETING_TITLE,
|
|
236
|
+
inputType: 'single',
|
|
237
|
+
required: true,
|
|
238
|
+
allowCustomInput: false,
|
|
239
|
+
options: MEETING_OPTIONS.map((item) => ({ label: item.label, value: item.value })),
|
|
176
240
|
});
|
|
177
241
|
}
|
|
178
242
|
return panels;
|
|
@@ -42,6 +42,17 @@ export async function render(input, ctx) {
|
|
|
42
42
|
// 以前只在「房间为空」时才定房,房间是脏值(如「总部130会议室」)就整组丢字段,
|
|
43
43
|
// 表现就是「有时完全不填会议信息」;反过来「已推荐房间却仍写三选一」也是同一处漏的。
|
|
44
44
|
applyMeetingPolicy(data);
|
|
45
|
+
// 会议是必问项:没表态就不出填单页。
|
|
46
|
+
// 这一条不依赖模型自觉——绕过面板直接调 doc-render 也会被拦,
|
|
47
|
+
// 否则会议室与 6 个会议字段会静默全空,只剩一行待办,提交时没人会注意。
|
|
48
|
+
// 「提了小餐厅」不构成表态:小餐厅是晚餐场地,与会议室预定是两条独立线索。
|
|
49
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
50
|
+
throw receptionBusinessError('MEETING_UNCONFIRMED', '是否需要会议未确认,请先补问再出填单页', {
|
|
51
|
+
headcount: data.headcount || '',
|
|
52
|
+
hint: '先向用户确认「是否需要会议室座谈」,拿到答案后放进 answers.fields.meeting("是"/"否")重跑本条;'
|
|
53
|
+
+ '提了小餐厅不代表要开会,不得据此推断',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
45
56
|
if (normalizeMeeting(data.meeting) === '是') {
|
|
46
57
|
if (!Number(data.headcount)) {
|
|
47
58
|
data.todos = [...(Array.isArray(data.todos) ? data.todos : []), '人数未填,会议室按默认预留'];
|
|
@@ -63,6 +74,34 @@ export async function render(input, ctx) {
|
|
|
63
74
|
if (!data.empId)
|
|
64
75
|
composedWarnings.push('主联络人未取到登录人,请在页面上手动选择');
|
|
65
76
|
}
|
|
77
|
+
// 默认值回显:凡用户没给、由 CLI 兜底填的,都要在回包里点名。
|
|
78
|
+
// 默认值静默生效比缺字段更危险——用户会以为那是他自己确认过的。
|
|
79
|
+
const defaultsApplied = [];
|
|
80
|
+
const headcountKnown = Number(data.headcount) > 0;
|
|
81
|
+
if (normalizeMeeting(data.meeting) === '是' && !headcountKnown) {
|
|
82
|
+
defaultsApplied.push({
|
|
83
|
+
field: 'meetingRoom',
|
|
84
|
+
value: String(data.meetingRoom || ''),
|
|
85
|
+
reason: String((data.meetingRoomMeta && data.meetingRoomMeta.reason) || '人数未填,会议室按默认预留'),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (data.restaurant && data.restaurant.booked) {
|
|
89
|
+
if (!headcountKnown) {
|
|
90
|
+
defaultsApplied.push({
|
|
91
|
+
field: 'customerCount',
|
|
92
|
+
value: String(data.restaurant.headcount || ''),
|
|
93
|
+
reason: '人数未填,小餐厅按 10 人预留',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// 用户点名包厢(reason=按指定包厢)不算默认值,其余都是 CLI 按容量挑的
|
|
97
|
+
if (data.restaurant.roomNo && !/按指定包厢/.test(String(data.restaurant.roomReason || ''))) {
|
|
98
|
+
defaultsApplied.push({
|
|
99
|
+
field: 'restaurantRoom',
|
|
100
|
+
value: String(data.restaurant.roomNo),
|
|
101
|
+
reason: String(data.restaurant.roomReason || '按容量匹配'),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
66
105
|
const composed = composeInitialValues({
|
|
67
106
|
snapshot: resolved.snapshot,
|
|
68
107
|
data,
|
|
@@ -139,6 +178,7 @@ export async function render(input, ctx) {
|
|
|
139
178
|
attachmentPending: composed.attachmentPending,
|
|
140
179
|
sdkRenderType: resolveRenderType(input.sdkRender),
|
|
141
180
|
todos: composed.todos,
|
|
181
|
+
defaultsApplied,
|
|
142
182
|
browsertool,
|
|
143
183
|
browsertoolFile,
|
|
144
184
|
browsertoolRef: browsertoolFile ? `<browsertool-file path="${browsertoolFile}" />` : '',
|
|
@@ -181,7 +181,18 @@ function rawCandidateCount(input) {
|
|
|
181
181
|
*/
|
|
182
182
|
export function normalizeRestaurant(options = {}) {
|
|
183
183
|
const data = options.data || {};
|
|
184
|
-
|
|
184
|
+
// answers 里可能直接把餐厅信息写成 data.restaurant(原始对象,没有 booked)。
|
|
185
|
+
// 这份必须当作 explicit 参与取值:否则用户指定的包厢、人数、用餐时间全被忽略,
|
|
186
|
+
// 只剩「按候选挑一间 + 默认 10 人」,表面成功、实际不是他点的那间。
|
|
187
|
+
// 已经带 booked 的是上一轮 CLI 产物,走 prev 沿用逻辑,不能再当入参读。
|
|
188
|
+
const rawRestaurant = (data.restaurant && typeof data.restaurant === 'object'
|
|
189
|
+
&& !Array.isArray(data.restaurant) && data.restaurant.booked !== true)
|
|
190
|
+
? data.restaurant
|
|
191
|
+
: {};
|
|
192
|
+
const explicit = {
|
|
193
|
+
...rawRestaurant,
|
|
194
|
+
...((options.explicit && typeof options.explicit === 'object') ? options.explicit : {}),
|
|
195
|
+
};
|
|
185
196
|
const rooms = options.rooms ?? null;
|
|
186
197
|
const hay = [data.restaurantRaw, data.logisticsRaw, data.meal, explicit.raw, explicit.note]
|
|
187
198
|
.filter(Boolean).join(' ');
|
|
@@ -192,10 +203,12 @@ export function normalizeRestaurant(options = {}) {
|
|
|
192
203
|
|| TRIGGER.test(hay);
|
|
193
204
|
if (!mentioned)
|
|
194
205
|
return null;
|
|
195
|
-
// 人数:用户明确给 > 来访人数(区间取上界)>
|
|
196
|
-
|
|
206
|
+
// 人数:用户明确给 > 来访人数(区间取上界)> 10。
|
|
207
|
+
// 不拿「客户 + 陪同」凑数:客户人数没给时那样只会得到 1~2 人,
|
|
208
|
+
// 订出来的包厢装不下整桌人(实测出现过「1 人订 8 人包厢」)。
|
|
209
|
+
// 缺省 10 是业务确认过的口径,宁可多留也不能少留。
|
|
197
210
|
const visit = Number(data.headcountMax || data.headcount || 0) || 0;
|
|
198
|
-
const headcount = Number(explicit.headcount || data.restaurantHeadcount || visit ||
|
|
211
|
+
const headcount = Number(explicit.headcount || data.restaurantHeadcount || visit || 10) || 10;
|
|
199
212
|
const baseDate = pickStr(explicit.startDate || data.visitDate || '');
|
|
200
213
|
// 时段:说了具体时间就用它;否则按「中午/晚上」落档,都没提按晚上
|
|
201
214
|
const noon = /中午|午餐|午宴|午饭/.test(hay);
|
|
@@ -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, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl,
|
|
25
|
+
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, talentUiCardUrl, resolveInterviewListUrlOrNative, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
26
26
|
// 面试计划表单字段 dataKey(缓存 fields 里取)。
|
|
27
27
|
// 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
|
|
28
28
|
// 放进来会让未部署数字人的环境连非 AI 面试都建不了(单独按需校验)。
|
|
@@ -512,8 +512,14 @@ async function resolveRequiredHint(plan, ctx) {
|
|
|
512
512
|
dataDetails: plan.dataDetails,
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
// 人才卡片详情 URL
|
|
516
|
-
|
|
515
|
+
// 人才卡片详情 URL:装了人才库 ecode 页面就用新卡片页,否则回退 EB 详情页
|
|
516
|
+
// {baseUrl}/sp/ebdpage/view/{ebdDetailPageId}?talentId={id}(2026-11-10 用户要求改指向新页面)
|
|
517
|
+
async function resolveTalentCardUrl(ctx, talentId) {
|
|
518
|
+
if (talentId) {
|
|
519
|
+
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
520
|
+
if (ui)
|
|
521
|
+
return ui;
|
|
522
|
+
}
|
|
517
523
|
const pid = ctx.cache.ebdDetailPageId;
|
|
518
524
|
if (!pid || !talentId) {
|
|
519
525
|
// 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
|
|
@@ -758,7 +764,8 @@ async function applyCore(args, env, payload) {
|
|
|
758
764
|
const verifyWarnings = verification.mismatches.map((m) => '落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual + '(该字段可能未写入)');
|
|
759
765
|
const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
|
|
760
766
|
// 列表链接只打开列表;详情单页由 viewLink 单独给出,不再用「列表+滑出详情」组合地址。
|
|
761
|
-
|
|
767
|
+
// 2026-11-10 用户定稿:装了人才库 ecode 页面就指向新的「面试进展」页,否则回退原生面试台账列表。
|
|
768
|
+
const listLocateUrl = await resolveInterviewListUrlOrNative(ctx.host, ctx.cache, ctx.baseUrl, (ctx.cache.lists?.interview?.listId) || '');
|
|
762
769
|
return rsSuccess('recruit-stage.interview.arrange.apply', {
|
|
763
770
|
mode: 'apply', result: verification.mismatches.length ? 'partial' : 'success', interviewFormId: formDataId,
|
|
764
771
|
interviewCardUrl: detailUrl,
|
|
@@ -799,7 +806,7 @@ async function prefill(args, env) {
|
|
|
799
806
|
}
|
|
800
807
|
throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
|
|
801
808
|
}
|
|
802
|
-
const cardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
809
|
+
const cardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
803
810
|
const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
|
|
804
811
|
const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}');`
|
|
805
812
|
+ ` if (!i) return 'no-form-instance(请先在人才卡片点「安排面试」打开面试安排表单)';`
|
|
@@ -22,7 +22,7 @@ import path from 'node:path';
|
|
|
22
22
|
import schoolTiers from '../school-tiers.json';
|
|
23
23
|
import { rsSuccess, schemaOf } from './types.js';
|
|
24
24
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
25
|
-
import { objIdOf, formIdOf, saveFormData, getFormLayoutMeta, runSaveButtonEsbActions, getTableMapping, invertTableMapping, datasetSaveFormData, datasetUpdateFormData, checkUnique, getCandidateByPhone, buildCardUrl, buildTalentViewUrl, talentLinkExtra, findMenuNode, randHex32, getDsOptions, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
25
|
+
import { objIdOf, formIdOf, saveFormData, getFormLayoutMeta, runSaveButtonEsbActions, getTableMapping, invertTableMapping, datasetSaveFormData, datasetUpdateFormData, checkUnique, getCandidateByPhone, buildCardUrl, buildTalentViewUrl, talentLinkExtra, talentUiCardUrl, resolveTalentListUrl, findMenuNode, randHex32, getDsOptions, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
26
26
|
import { scanResumeSource, findStructuredJson } from '../fs-scan.js';
|
|
27
27
|
import { saveBatchItems, loadBatchItems } from '../batch-store.js';
|
|
28
28
|
// 更新时不允许简历覆盖的字段(人工判定/流程状态,简历无权改写)
|
|
@@ -338,8 +338,13 @@ function makeBriefReader(ctx, formId, objId, fields) {
|
|
|
338
338
|
}
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
// 人才卡片 URL
|
|
342
|
-
function resolveTalentCardUrl(ctx, talentId) {
|
|
341
|
+
// 人才卡片 URL(装了人才库 ecode 页面就指向新卡片页;否则环境缓存 ebdDetailPageId,自用追加 recruitType=useSelf)
|
|
342
|
+
async function resolveTalentCardUrl(ctx, talentId) {
|
|
343
|
+
if (talentId) {
|
|
344
|
+
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
345
|
+
if (ui)
|
|
346
|
+
return ui;
|
|
347
|
+
}
|
|
343
348
|
const pid = ctx.cache.ebdDetailPageId;
|
|
344
349
|
if (!pid || !talentId) {
|
|
345
350
|
// 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
|
|
@@ -350,12 +355,15 @@ function resolveTalentCardUrl(ctx, talentId) {
|
|
|
350
355
|
}
|
|
351
356
|
return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
|
|
352
357
|
}
|
|
353
|
-
//
|
|
358
|
+
// 人才库列表(只打开列表):装了人才库 ecode 页面就指向新页面,否则 {baseUrl}/sp/ebdfpage/list/{listId}
|
|
354
359
|
// 2026-11-06 用户定稿:列表链接不携带 /card/... 段,也不拼 talentId 等 query,
|
|
355
360
|
// 避免打开列表时一同滑出人才详情单页;人才卡片由 talentCardUrl 单独给出。
|
|
356
361
|
// listId 取环境缓存 lists.talent.listId(运行时解析,跨环境不写死)。
|
|
357
|
-
function resolveTalentListLocateUrl(ctx, _talentId) {
|
|
362
|
+
async function resolveTalentListLocateUrl(ctx, _talentId) {
|
|
358
363
|
const listId = ctx.cache.lists?.talent?.listId;
|
|
364
|
+
const preferred = await resolveTalentListUrl(ctx.host, ctx.cache, ctx.baseUrl, listId || '');
|
|
365
|
+
if (preferred)
|
|
366
|
+
return preferred;
|
|
359
367
|
if (!listId)
|
|
360
368
|
return null;
|
|
361
369
|
return `${ctx.baseUrl.replace(/\/+$/, '')}/sp/ebdfpage/list/${listId}`;
|
|
@@ -955,8 +963,8 @@ async function findExistingTalents(ctx, opts) {
|
|
|
955
963
|
talentId: b.talentId,
|
|
956
964
|
candidateId: b.candidateId,
|
|
957
965
|
talentViewUrl: b.candidateId ? buildTalentViewUrl(ctx.baseUrl, b.candidateId) : null,
|
|
958
|
-
talentCardUrl: b.talentId ? resolveTalentCardUrl(ctx, b.talentId) : null,
|
|
959
|
-
talentListLocateUrl: b.talentId ? resolveTalentListLocateUrl(ctx, b.talentId) : null,
|
|
966
|
+
talentCardUrl: b.talentId ? await resolveTalentCardUrl(ctx, b.talentId) : null,
|
|
967
|
+
talentListLocateUrl: b.talentId ? await resolveTalentListLocateUrl(ctx, b.talentId) : null,
|
|
960
968
|
};
|
|
961
969
|
}
|
|
962
970
|
}
|
|
@@ -976,8 +984,8 @@ async function findExistingTalents(ctx, opts) {
|
|
|
976
984
|
if (rec) {
|
|
977
985
|
formConflicts.existing.push({
|
|
978
986
|
talentId: id, ...rec,
|
|
979
|
-
talentCardUrl: resolveTalentCardUrl(ctx, id),
|
|
980
|
-
talentListLocateUrl: resolveTalentListLocateUrl(ctx, id),
|
|
987
|
+
talentCardUrl: await resolveTalentCardUrl(ctx, id),
|
|
988
|
+
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, id),
|
|
981
989
|
recordCardUrl: buildCardUrl(ctx.baseUrl, objId, id),
|
|
982
990
|
});
|
|
983
991
|
}
|
|
@@ -1271,8 +1279,8 @@ async function applyCore(args, env, payload) {
|
|
|
1271
1279
|
talentId: updateTalentId,
|
|
1272
1280
|
afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
|
|
1273
1281
|
verifyWarnings: verifyWarnings.length ? verifyWarnings : undefined,
|
|
1274
|
-
talentCardUrl: resolveTalentCardUrl(ctx, updateTalentId),
|
|
1275
|
-
talentListLocateUrl: resolveTalentListLocateUrl(ctx, updateTalentId),
|
|
1282
|
+
talentCardUrl: await resolveTalentCardUrl(ctx, updateTalentId),
|
|
1283
|
+
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, updateTalentId),
|
|
1276
1284
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || '(空)' },
|
|
1277
1285
|
});
|
|
1278
1286
|
}
|
|
@@ -1375,8 +1383,8 @@ async function applyCore(args, env, payload) {
|
|
|
1375
1383
|
writeWarnings.push('落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual);
|
|
1376
1384
|
}
|
|
1377
1385
|
const result = detailsState === 'complete' && !verification.mismatches.length ? 'success' : 'partial';
|
|
1378
|
-
const talentCardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
1379
|
-
const talentListLocateUrl = resolveTalentListLocateUrl(ctx, talentId);
|
|
1386
|
+
const talentCardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
1387
|
+
const talentListLocateUrl = await resolveTalentListLocateUrl(ctx, talentId);
|
|
1380
1388
|
return rsSuccess('recruit-stage.resume.import.apply', {
|
|
1381
1389
|
mode: 'apply', result,
|
|
1382
1390
|
detailsState,
|