weaver-work-cli 0.1.76 → 0.1.78
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/README.md +3 -1
- package/dist/chunks/{attachment-content-24RL44SE.js → attachment-content-TFOC3Y3X.js} +3 -3
- package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
- package/dist/chunks/{chunk-SQFKBWTR.js → chunk-5VQ7JHV4.js} +132 -47
- package/dist/chunks/{chunk-KJA7CRES.js → chunk-7SQN5IZR.js} +1 -1
- package/dist/chunks/{chunk-MS7MKBGJ.js → chunk-BP7BONZO.js} +664 -75
- package/dist/chunks/{chunk-L5SCNJKX.js → chunk-DACQKJ6O.js} +1 -1
- package/dist/chunks/{chunk-T7HVQ2WP.js → chunk-E2EY3DMS.js} +2 -2
- package/dist/chunks/{chunk-WJQJ7YEX.js → chunk-FAC4IFGQ.js} +2 -2
- package/dist/chunks/{minute-doc-4BA2R5EA.js → chunk-IBTGXLOT.js} +99 -16
- package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
- package/dist/chunks/{chunk-H6N6U2D6.js → chunk-SWFTWNWL.js} +7 -7
- package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
- package/dist/chunks/{chunk-Q7RXCK2Y.js → chunk-USYFVIUR.js} +22 -7
- package/dist/chunks/{chunk-WHI6YAUE.js → chunk-UZ2E3VNI.js} +1 -1
- package/dist/chunks/{chunk-AZC53XSQ.js → chunk-VNEU7OUN.js} +1 -1
- package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
- package/dist/chunks/{chunk-NZQRW4KL.js → chunk-Z44YFIN6.js} +2 -2
- package/dist/chunks/{chunk-R4PN3OFK.js → chunk-ZOTXXGUM.js} +7 -7
- package/dist/chunks/{cli-DFLV57LO.js → cli-WA7FOQKC.js} +10 -10
- package/dist/chunks/{conflict-72Q6DM4I.js → conflict-D4GVAURN.js} +2 -2
- package/dist/chunks/{contract-IRNRQ5FY.js → contract-GW7US3UF.js} +4399 -3547
- package/dist/chunks/{create-flow-UGTDI7SP.js → create-flow-ERDGW3FZ.js} +10 -6
- package/dist/chunks/{ehr-PHIBBUIG.js → ehr-P6T7OAAV.js} +1 -1
- package/dist/chunks/{entry-mode-5WOXFE67.js → entry-mode-SQU5WTX6.js} +3 -3
- package/dist/chunks/{env-H4ALHESA.js → env-DASBNSEM.js} +2 -2
- package/dist/chunks/{factory-COX6AVK7.js → factory-A3NAKZAA.js} +1 -1
- package/dist/chunks/{group-chat-ZIWQQO4G.js → group-chat-7SEAVAJR.js} +3 -3
- package/dist/chunks/{lazy-dispatch-MZ3EZYDL.js → lazy-dispatch-ZDKLS5MR.js} +3 -3
- package/dist/chunks/{meeting-XE6CTXYA.js → meeting-7AEQGBAT.js} +18 -12
- package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
- package/dist/chunks/{project-XREEXFU2.js → project-6PRGBLO2.js} +38 -14
- package/dist/chunks/{recruit-stage-TSQWOGQD.js → recruit-stage-TLZJUFHD.js} +543 -463
- package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
- package/dist/chunks/{registry-7UDUWYB5.js → registry-UVTI323K.js} +12 -11
- package/dist/chunks/{room-recommend-FO3HLPNB.js → room-recommend-ELEJUYBN.js} +4 -4
- package/dist/chunks/{schedule-DHNNOHVS.js → schedule-XBKY7VEA.js} +4 -4
- package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
- package/dist/chunks/{workflow-MAGCHWYZ.js → workflow-SYCBS5XD.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/internal/update/service.js +9 -8
- package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
- package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
- package/dist/shortcuts/contract/data/report-renderers.js +75 -31
- package/dist/shortcuts/contract/data/report-spec.js +17 -3
- package/dist/shortcuts/contract/manifest.js +20 -3
- package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
- package/dist/shortcuts/contract/operations/collection-node.js +116 -1
- package/dist/shortcuts/contract/operations/compare-report.js +27 -5
- package/dist/shortcuts/contract/operations/credit-page.js +11 -2
- package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
- package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
- package/dist/shortcuts/contract/operations/elements-build.js +162 -30
- package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
- package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
- package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
- package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
- package/dist/shortcuts/contract/operations/ledger.js +88 -16
- package/dist/shortcuts/contract/operations/metrics.js +16 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
- package/dist/shortcuts/contract/operations/page.js +23 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
- package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
- package/dist/shortcuts/contract/operations/review-report.js +11 -3
- package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
- package/dist/shortcuts/contract/operations/triage.js +18 -3
- package/dist/shortcuts/contract/operations/viewlink.js +17 -1
- package/dist/shortcuts/ehr/operations/recruit.js +255 -90
- package/dist/shortcuts/meeting/confirm-gate.js +42 -0
- package/dist/shortcuts/meeting/continuation.js +6 -2
- package/dist/shortcuts/meeting/minute-doc.js +119 -12
- package/dist/shortcuts/meeting/operations/attachment.js +19 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
- package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
- package/dist/shortcuts/meeting/operations/group-share.js +268 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
- package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/project/operations/read.js +40 -15
- package/dist/shortcuts/recruit-stage/context.js +16 -81
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
- package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
- package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
- package/dist/shortcuts/recruit-stage/shared.js +153 -4
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +11 -0
- package/dist/shortcuts/workflow/operations/read.js +24 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
- package/docs/project.md +1 -1
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
- package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
- package/skills/weaver-e10-meeting/SKILL.md +203 -80
- package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
- package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
- package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
- package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +61 -58
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +28 -25
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +20 -14
- package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +71 -25
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +8 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +6 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +2 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +1 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +10 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -1
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +14 -10
- package/skills/weaver-e10-shijingran/SKILL.md +2 -2
- package/skills/weaver-e10-shijingran/references/operations.md +5 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
- package/skills/weaver-e10-workflow/SKILL.md +13 -9
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
- package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
- package/templates/meeting/minute.docx +0 -0
- package/skills/weaver-e10-yepiaotong.zip +0 -0
|
@@ -19,6 +19,8 @@ import { meetingPipelineOperations } from './pipeline.js';
|
|
|
19
19
|
import { meetingInvitationOperations } from './invitation.js';
|
|
20
20
|
import { meetingMemberExpandOperations } from './eb/member-expand.js';
|
|
21
21
|
import { meetingInvitationPublishOperations } from './invitation-publish.js';
|
|
22
|
+
import { minuteExportOperations } from './minute-export.js';
|
|
23
|
+
import { groupShareOperations } from './group-share.js';
|
|
22
24
|
import { meetingQrOperations } from './qrcode.js';
|
|
23
25
|
import { meetingSummaryOperations } from './summary.js';
|
|
24
26
|
import { meetingFormFieldOperations } from './form-fields.js';
|
|
@@ -48,6 +50,8 @@ function buildRegistry() {
|
|
|
48
50
|
...meetingInvitationOperations,
|
|
49
51
|
...meetingMemberExpandOperations,
|
|
50
52
|
...meetingInvitationPublishOperations,
|
|
53
|
+
...minuteExportOperations,
|
|
54
|
+
...groupShareOperations,
|
|
51
55
|
...meetingQrOperations,
|
|
52
56
|
...meetingSummaryOperations,
|
|
53
57
|
...meetingFormFieldOperations,
|
|
@@ -493,26 +493,51 @@ export const projectReadOperations = [
|
|
|
493
493
|
resource: 'project',
|
|
494
494
|
method: 'diagnose',
|
|
495
495
|
action: 'project.version.check',
|
|
496
|
-
summary: '
|
|
496
|
+
summary: '检测事井然应用是否安装及版本(要求 >= 20.6.11);仅用于接口异常诊断或用户主动询问版本',
|
|
497
497
|
risk: 'read',
|
|
498
498
|
inputSchema: schemaOf({ appId: { type: 'string', description: '可选;缺省时自动解析' } }),
|
|
499
499
|
handler: async (args, { host }) => {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
500
|
+
let appId = args.appId ? String(args.appId) : '';
|
|
501
|
+
if (!appId) {
|
|
502
|
+
try {
|
|
503
|
+
appId = await getAppId(host);
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
return projectSuccess('project.version.check', {
|
|
507
|
+
installed: false,
|
|
508
|
+
appId: null,
|
|
509
|
+
commitVersion: null,
|
|
510
|
+
versionOk: false,
|
|
511
|
+
minRequiredVersion: MIN_VERSION.join('.'),
|
|
512
|
+
status: 'NOT_INSTALLED',
|
|
513
|
+
reason: 'app_not_found',
|
|
514
|
+
message: '未检测到事井然项目管理应用(getAppIds 未返回 appId),请先安装应用',
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
let commitVersion = '';
|
|
519
|
+
try {
|
|
520
|
+
const response = await host.request({
|
|
521
|
+
method: 'GET',
|
|
522
|
+
path: '/api/installer/public/querySpAppVersionInfo',
|
|
523
|
+
query: { appId },
|
|
524
|
+
operation: 'project.version.check',
|
|
525
|
+
});
|
|
526
|
+
assertWeaverSuccess(response, 'project.version.check');
|
|
527
|
+
commitVersion = String(response?.data?.commitVersion ?? '').trim();
|
|
528
|
+
}
|
|
529
|
+
catch {
|
|
530
|
+
commitVersion = '';
|
|
531
|
+
}
|
|
532
|
+
const installed = commitVersion !== '';
|
|
533
|
+
const versionOk = installed && versionAtLeast(commitVersion);
|
|
511
534
|
return projectSuccess('project.version.check', {
|
|
535
|
+
installed,
|
|
512
536
|
appId,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
537
|
+
commitVersion: installed ? commitVersion : null,
|
|
538
|
+
versionOk,
|
|
539
|
+
minRequiredVersion: MIN_VERSION.join('.'),
|
|
540
|
+
status: installed ? (versionOk ? 'OK' : 'VERSION_TOO_LOW') : 'NOT_INSTALLED',
|
|
516
541
|
});
|
|
517
542
|
},
|
|
518
543
|
},
|
|
@@ -23,7 +23,6 @@ const SELFUSE_DEFAULT_FLOW = {
|
|
|
23
23
|
id: '874896524979806209',
|
|
24
24
|
name: '初筛+面试+offer阶段',
|
|
25
25
|
};
|
|
26
|
-
const digitalMenuMemo = new Map();
|
|
27
26
|
function cacheDirFor(baseUrl) {
|
|
28
27
|
const url = new URL(baseUrl);
|
|
29
28
|
const host = url.hostname + (url.port ? `_${url.port}` : '');
|
|
@@ -33,48 +32,6 @@ function cacheDirFor(baseUrl) {
|
|
|
33
32
|
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), '.weaver-work-cli');
|
|
34
33
|
return join(home, 'env-cache', 'recruit-ops', host);
|
|
35
34
|
}
|
|
36
|
-
/**
|
|
37
|
-
* 磁盘缓存兼容:脚本版(recruit-stage 技能)播种的缓存里若已带 defaultRecruitFlow /
|
|
38
|
-
* lists.digital_human,直接复用(同环境免请求);CLI 侧则运行时解析一次并 memo。
|
|
39
|
-
*/
|
|
40
|
-
async function readLegacyCacheExtra(baseUrl) {
|
|
41
|
-
try {
|
|
42
|
-
const dir = cacheDirFor(baseUrl);
|
|
43
|
-
if (!existsSync(dir))
|
|
44
|
-
return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
45
|
-
const files = await (await import('node:fs/promises')).readdir(dir);
|
|
46
|
-
const jsonFiles = files.filter((f) => f.endsWith('.json'));
|
|
47
|
-
// 原实现要求「目录内恰好 1 个 json 才读」,多环境/多应用共存时必然读不到 →
|
|
48
|
-
// 改为遍历全部 json,取第一个带所需键的(2026-11-05 修)。
|
|
49
|
-
let flow = null;
|
|
50
|
-
let dh = null;
|
|
51
|
-
for (const f of jsonFiles) {
|
|
52
|
-
let raw;
|
|
53
|
-
try {
|
|
54
|
-
raw = JSON.parse(await readFile(join(dir, f), 'utf8'));
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
if (!flow && raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id) {
|
|
60
|
-
flow = { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || '') };
|
|
61
|
-
}
|
|
62
|
-
if (!dh && raw?.lists?.digital_human?.listId) {
|
|
63
|
-
dh = {
|
|
64
|
-
menuName: String(raw.lists.digital_human.menuName || '面试数字人配置'),
|
|
65
|
-
listId: String(raw.lists.digital_human.listId),
|
|
66
|
-
cusMenuId: String(raw.lists.digital_human.cusMenuId || ''),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (flow && dh)
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
return { defaultRecruitFlow: flow, digitalHumanMenu: dh };
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
35
|
/**
|
|
79
36
|
* 「默认招聘流程」探测失败标记的磁盘 TTL。
|
|
80
37
|
*
|
|
@@ -91,19 +48,22 @@ const FLOW_MISS_TTL_MS = 6 * 60 * 60 * 1000;
|
|
|
91
48
|
* 辅助标记放同目录也不会干扰命中(2026-11-28 缓存治理后双保险;旧实现「目录内恰好
|
|
92
49
|
* 1 个 json 才命中」时放同目录会把上下文缓存打冷,故历史上必须放目录外)。
|
|
93
50
|
*/
|
|
94
|
-
function flowMissPath(baseUrl) {
|
|
51
|
+
function flowMissPath(baseUrl, ownerUserId) {
|
|
95
52
|
const hostDir = cacheDirFor(baseUrl); // .../env-cache/recruit-ops/<host>
|
|
96
53
|
const hostName = hostDir.split(/[\\/]/).pop() || 'unknown';
|
|
97
|
-
|
|
54
|
+
const owner = String(ownerUserId || 'anon').replace(/[^\w.-]/g, '_');
|
|
55
|
+
return join(hostDir, '..', `_recruit-stage`, `flow-miss-${hostName}-${owner}.json`);
|
|
98
56
|
}
|
|
99
|
-
/** 读「上次探测失败」的时间戳(同环境 + 未过期才复用)。 */
|
|
100
|
-
async function readFlowMissAt(baseUrl) {
|
|
57
|
+
/** 读「上次探测失败」的时间戳(同环境 + 同用户 + 未过期才复用)。 */
|
|
58
|
+
async function readFlowMissAt(baseUrl, ownerUserId) {
|
|
101
59
|
if (process.env.E10_RS_NO_FLOW_CACHE === '1')
|
|
102
60
|
return null;
|
|
103
61
|
try {
|
|
104
|
-
const raw = JSON.parse(await readFile(flowMissPath(baseUrl), 'utf8'));
|
|
62
|
+
const raw = JSON.parse(await readFile(flowMissPath(baseUrl, ownerUserId), 'utf8'));
|
|
105
63
|
if (raw?.baseUrl !== baseUrl || !raw?.missedAt)
|
|
106
64
|
return null;
|
|
65
|
+
if (ownerUserId && String(raw.ownerUserId || '') !== ownerUserId)
|
|
66
|
+
return null;
|
|
107
67
|
if (Date.now() - raw.missedAt > FLOW_MISS_TTL_MS)
|
|
108
68
|
return null;
|
|
109
69
|
return raw.missedAt;
|
|
@@ -112,16 +72,16 @@ async function readFlowMissAt(baseUrl) {
|
|
|
112
72
|
return null;
|
|
113
73
|
}
|
|
114
74
|
}
|
|
115
|
-
async function writeFlowMiss(baseUrl) {
|
|
75
|
+
async function writeFlowMiss(baseUrl, ownerUserId) {
|
|
116
76
|
if (process.env.E10_RS_NO_FLOW_CACHE === '1')
|
|
117
77
|
return;
|
|
118
78
|
try {
|
|
119
79
|
const dir = cacheDirFor(baseUrl);
|
|
120
80
|
if (!existsSync(dir))
|
|
121
81
|
return; // 目录不存在说明连环境缓存都没播种过,不额外造目录
|
|
122
|
-
const target = flowMissPath(baseUrl);
|
|
82
|
+
const target = flowMissPath(baseUrl, ownerUserId);
|
|
123
83
|
await mkdir(dirname(target), { recursive: true });
|
|
124
|
-
await writeFile(target, JSON.stringify({ baseUrl, missedAt: Date.now() }), 'utf8');
|
|
84
|
+
await writeFile(target, JSON.stringify({ baseUrl, ownerUserId, missedAt: Date.now() }), 'utf8');
|
|
125
85
|
}
|
|
126
86
|
catch { /* 写失败不影响主流程 */ }
|
|
127
87
|
}
|
|
@@ -152,16 +112,11 @@ function isDefaultFlowRow(x) {
|
|
|
152
112
|
* 探测成功写正缓存(memo);**探测失败**写带 TTL 的落盘标记,避免每个进程重复空跑 3 个 RTT。
|
|
153
113
|
*/
|
|
154
114
|
async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
155
|
-
const memoKey = baseUrl;
|
|
115
|
+
const memoKey = baseUrl + '|' + String(cache?.ownerUserId || '');
|
|
156
116
|
if (flowMemo.has(memoKey))
|
|
157
117
|
return flowMemo.get(memoKey) ?? null;
|
|
158
|
-
const legacy = await readLegacyCacheExtra(baseUrl);
|
|
159
|
-
if (legacy.defaultRecruitFlow) {
|
|
160
|
-
flowMemo.set(memoKey, legacy.defaultRecruitFlow);
|
|
161
|
-
return legacy.defaultRecruitFlow;
|
|
162
|
-
}
|
|
163
118
|
// TTL 内已知探测失败 → 跳过三条探测通道(下面 ③ 的自用兜底仍会生效)
|
|
164
|
-
const missFresh = await readFlowMissAt(baseUrl);
|
|
119
|
+
const missFresh = await readFlowMissAt(baseUrl, String(cache.ownerUserId || ''));
|
|
165
120
|
let result = null;
|
|
166
121
|
/** 是否由服务端通道(①菜单列表 / ②旧接口)解析出来;③ 自用常量兜底不算 */
|
|
167
122
|
let serverResolved = false;
|
|
@@ -255,28 +210,11 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
255
210
|
// 服务端三条通道都没解析出来 → 记一次「探测失败」,TTL 内后续进程不再空跑(见 FLOW_MISS_TTL_MS)。
|
|
256
211
|
// 进程内仍 memo 结果(自用常量兜底的值也好、null 也好),避免同进程重复走 ③。
|
|
257
212
|
if (!missFresh)
|
|
258
|
-
await writeFlowMiss(baseUrl);
|
|
213
|
+
await writeFlowMiss(baseUrl, String(cache.ownerUserId || ''));
|
|
259
214
|
flowMemo.set(memoKey, result);
|
|
260
215
|
}
|
|
261
216
|
return result;
|
|
262
217
|
}
|
|
263
|
-
async function resolveDigitalHumanMenu(host, baseUrl, cache) {
|
|
264
|
-
const memoKey = baseUrl;
|
|
265
|
-
if (digitalMenuMemo.has(memoKey))
|
|
266
|
-
return digitalMenuMemo.get(memoKey) ?? null;
|
|
267
|
-
const legacy = await readLegacyCacheExtra(baseUrl);
|
|
268
|
-
if (legacy.digitalHumanMenu) {
|
|
269
|
-
digitalMenuMemo.set(memoKey, legacy.digitalHumanMenu);
|
|
270
|
-
return legacy.digitalHumanMenu;
|
|
271
|
-
}
|
|
272
|
-
// 从 all_search 菜单里按别名找(跨基线菜单名不同:面试数字人配置/数字人配置)
|
|
273
|
-
const allSearch = (cache.lists?.all_search || []);
|
|
274
|
-
const candidates = allSearch.filter((m) => m.listId);
|
|
275
|
-
let hit = (candidates.find((m) => (m.menuName || '').includes('面试数字人'))
|
|
276
|
-
|| candidates.find((m) => (m.menuName || '').includes('数字人配置'))) ?? null;
|
|
277
|
-
digitalMenuMemo.set(memoKey, hit);
|
|
278
|
-
return hit;
|
|
279
|
-
}
|
|
280
218
|
const loaders = new Map();
|
|
281
219
|
export function createRecruitStageContext() {
|
|
282
220
|
// 每个工厂独立记录「本次调用链」的缓存元信息:
|
|
@@ -291,11 +229,8 @@ export function createRecruitStageContext() {
|
|
|
291
229
|
const cache = await loaders.get(loaderKey).load(host);
|
|
292
230
|
own = loaders.get(loaderKey).lastMeta();
|
|
293
231
|
const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, '');
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
resolveDigitalHumanMenu(host, baseUrl, cache),
|
|
297
|
-
]);
|
|
298
|
-
return { ...cache, defaultRecruitFlow, digitalHumanMenu };
|
|
232
|
+
const defaultRecruitFlow = await resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache);
|
|
233
|
+
return { ...cache, defaultRecruitFlow };
|
|
299
234
|
});
|
|
300
235
|
fn.lastCacheMeta = () => own;
|
|
301
236
|
return fn;
|
|
@@ -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, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, talentUiCardUrl, resolveInterviewListUrlOrNative, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
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, fetchDatasetRows, } from '../shared.js';
|
|
26
26
|
import { toMenuList } from '../../ehr/operations/shared.js';
|
|
27
27
|
// 面试计划表单字段 dataKey(缓存 fields 里取)。
|
|
28
28
|
// 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
|
|
@@ -84,14 +84,29 @@ async function locateTalent(ctx, opts) {
|
|
|
84
84
|
const { host, cache } = ctx;
|
|
85
85
|
const listId = cache.lists?.talent?.listId;
|
|
86
86
|
const objId = cache.forms?.talent_pool?.objId;
|
|
87
|
-
if (!
|
|
88
|
-
throw rsFail('
|
|
87
|
+
if (!objId)
|
|
88
|
+
throw rsFail('环境缓存缺少人才表单(forms.talent_pool)');
|
|
89
89
|
const fields = cache.fields[objId] || {};
|
|
90
90
|
const nameKey = fields.candidate_name || fields.name;
|
|
91
91
|
if (opts.mobile && !fields.telephone)
|
|
92
92
|
throw rsFail('环境缓存缺少人才手机字段(telephone)');
|
|
93
93
|
if (!opts.mobile && opts.name && !nameKey)
|
|
94
94
|
throw rsFail('环境缓存缺少人才姓名字段(candidate_name/name)');
|
|
95
|
+
if (!listId) {
|
|
96
|
+
const ds = await fetchDatasetRows(host, objId, { pageSize: 200, maxRows: 1000 });
|
|
97
|
+
let rows = ds.rows;
|
|
98
|
+
if (opts.mobile)
|
|
99
|
+
rows = rows.filter((x) => String(x.telephone || '').includes(String(opts.mobile)));
|
|
100
|
+
else if (opts.name)
|
|
101
|
+
rows = rows.filter((x) => String(x.candidate_name || x.name || '').includes(String(opts.name)));
|
|
102
|
+
return rows.slice(0, 20).map((x) => ({
|
|
103
|
+
talentId: x.form_data_id || x.id || null,
|
|
104
|
+
name: x.candidate_name || x.name || null,
|
|
105
|
+
mobile: x.telephone || null,
|
|
106
|
+
position: x.position_manage_id || x.position || null,
|
|
107
|
+
recruitStatus: x.recruit_status || null,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
95
110
|
const conds = {};
|
|
96
111
|
if (opts.mobile) {
|
|
97
112
|
const mf = 'field_' + fields.telephone;
|
|
@@ -127,15 +142,6 @@ async function locateTalent(ctx, opts) {
|
|
|
127
142
|
}
|
|
128
143
|
// ── AI 面试方案(面试数字人配置表):objId 走 tag、listId 走菜单,全部运行时解析 ──
|
|
129
144
|
const PLAN_NAME_KEYS = ['msfa_name', 'digital_name', 'plan_name', 'scheme_name'];
|
|
130
|
-
function digitalMenuOf(cache) {
|
|
131
|
-
const hit = cache.digitalHumanMenu;
|
|
132
|
-
if (hit?.listId)
|
|
133
|
-
return hit;
|
|
134
|
-
const menus = cache.lists?.all_search || cache.menus || [];
|
|
135
|
-
return menus.find((m) => (m.menuName || '').includes('面试数字人'))
|
|
136
|
-
|| menus.find((m) => (m.menuName || '').includes('数字人配置'))
|
|
137
|
-
|| null;
|
|
138
|
-
}
|
|
139
145
|
async function digitalObjIdOf(ctx) {
|
|
140
146
|
const cached = ctx.cache.forms?.digital_human?.objId;
|
|
141
147
|
if (cached)
|
|
@@ -148,7 +154,7 @@ async function digitalObjIdOf(ctx) {
|
|
|
148
154
|
// 失败再回退「面试数字人配置」列表。两种都不写死任何 id。
|
|
149
155
|
async function listDigitalPlans(opts) {
|
|
150
156
|
const { ctx, formId, layoutId, fieldId } = opts;
|
|
151
|
-
const { host
|
|
157
|
+
const { host } = ctx;
|
|
152
158
|
// ① 关联字段候选(实测可用,返回 {id,name,ebObjId})
|
|
153
159
|
try {
|
|
154
160
|
const body = {
|
|
@@ -171,47 +177,18 @@ async function listDigitalPlans(opts) {
|
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
catch { /* 回退列表 */ }
|
|
174
|
-
// ②
|
|
175
|
-
const
|
|
176
|
-
if (!
|
|
177
|
-
return { available: false, items: [], reason: '
|
|
180
|
+
// ② 表直读兜底:按 tag/缓存解析 objId 直接读「面试数字人配置」表,不依赖列表菜单。
|
|
181
|
+
const objId = await digitalObjIdOf(ctx).catch(() => '');
|
|
182
|
+
if (!objId) {
|
|
183
|
+
return { available: false, items: [], reason: '候选接口不可用,且未能解析「面试数字人配置」对象 id(缓存/tag 均失败)' };
|
|
178
184
|
}
|
|
179
|
-
let
|
|
185
|
+
let rows = [];
|
|
180
186
|
try {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
const li = await host.request({ path: '/api/ebuilder/form/list/listInit', body: liBody });
|
|
184
|
-
objId = String(li?.data?.objid || '');
|
|
185
|
-
}
|
|
186
|
-
catch { /* 回退 tag 解析 */ }
|
|
187
|
-
if (!objId)
|
|
188
|
-
objId = await digitalObjIdOf(ctx).catch(() => '');
|
|
189
|
-
if (!objId) {
|
|
190
|
-
return { available: false, items: [], reason: '未能解析「面试数字人配置」对象 id(listInit / tag 均失败)' };
|
|
187
|
+
const ds = await fetchDatasetRows(host, objId, { pageSize: 200, maxRows: 1000 });
|
|
188
|
+
rows = ds.rows;
|
|
191
189
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const size = 100;
|
|
195
|
-
for (;;) {
|
|
196
|
-
const body = {
|
|
197
|
-
current: cur, pageSize: size, tableuid: randHex32(),
|
|
198
|
-
listId: menu.listId,
|
|
199
|
-
searchParamData: { searchType: '3', type: 'and' },
|
|
200
|
-
terminal: 'PC', browser: 'Chrome', requiredMatch: 1, mapResult: 1,
|
|
201
|
-
recheckQuery: 1, isFollow: 0, isShareToMe: 0, filterCondition: {},
|
|
202
|
-
cusMenuId: menu.cusMenuId, urlPageTitle: menu.menuName, menuName: menu.menuName,
|
|
203
|
-
};
|
|
204
|
-
const r = await host.request({
|
|
205
|
-
path: `/api/ebuilder/form/list/getListDatas?passid=${objId}&cid=${objId}`,
|
|
206
|
-
body, headers: { ebBusinessId: menu.listId },
|
|
207
|
-
});
|
|
208
|
-
const page = r?.data?.data || [];
|
|
209
|
-
rows.push(...page);
|
|
210
|
-
if (page.length < size)
|
|
211
|
-
break;
|
|
212
|
-
cur++;
|
|
213
|
-
if (cur > 20)
|
|
214
|
-
break; // 防御:最多 2000 条
|
|
190
|
+
catch (e) {
|
|
191
|
+
return { available: false, items: [], reason: '「面试数字人配置」表直读失败:' + (e?.message || e) };
|
|
215
192
|
}
|
|
216
193
|
const items = rows.map((x) => {
|
|
217
194
|
const nk = PLAN_NAME_KEYS.find((k) => String(x[k] || '').trim());
|
|
@@ -222,7 +199,7 @@ async function listDigitalPlans(opts) {
|
|
|
222
199
|
desc: String(x.zwjs || '').trim(),
|
|
223
200
|
};
|
|
224
201
|
}).filter((x) => x.id);
|
|
225
|
-
return { available: true, items, listId:
|
|
202
|
+
return { available: true, items, listId: 'dataset:' + objId, objId, menuName: '面试数字人配置', source: 'dataset' };
|
|
226
203
|
}
|
|
227
204
|
// 方案匹配:id 精确 → 名称全等 → 名称包含;多条命中视为歧义,绝不自动取第一条
|
|
228
205
|
function pickDigitalPlan(items, key) {
|
|
@@ -622,6 +599,7 @@ const baseInput = {
|
|
|
622
599
|
end: { type: 'string', pattern: '^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$', description: '结束时间(缺省=AI +7天 / 其它 +1小时)' },
|
|
623
600
|
email: { type: 'string', description: '候选人邮箱(AI 面试必填;补录值优先于人才资料)' },
|
|
624
601
|
aiPlan: { type: 'string', description: 'AI 面试方案名或 id(AI 面试必填;不传则 prepare 列出候选)' },
|
|
602
|
+
allowDuplicate: { type: 'boolean', description: '默认写前查重:同人才+同开始时间已有记录会阻断;确认要再建一条时显式置 true' },
|
|
625
603
|
};
|
|
626
604
|
async function prepare(args, env, opts = {}) {
|
|
627
605
|
const ctx = await makeCtx(env);
|
|
@@ -724,6 +702,40 @@ async function apply(args, env) {
|
|
|
724
702
|
const payload = await env.continuation.verify(String(args.continuation), 'recruit-stage.interview.arrange.apply');
|
|
725
703
|
return applyCore(args, env, payload);
|
|
726
704
|
}
|
|
705
|
+
/** 纯匹配逻辑(导出便于单测):同人才 + 同开始时间(分钟)+ 同面试方式视为重复。 */
|
|
706
|
+
export function matchDuplicateInterview(rows, target) {
|
|
707
|
+
const minute = (v) => String(v ?? '').trim().replace('T', ' ').slice(0, 16);
|
|
708
|
+
const text = (v) => {
|
|
709
|
+
if (v && typeof v === 'object') {
|
|
710
|
+
const c = v;
|
|
711
|
+
return String(c.fieldOptionId ?? c.fieldValue ?? '');
|
|
712
|
+
}
|
|
713
|
+
return String(v ?? '');
|
|
714
|
+
};
|
|
715
|
+
const wantStart = minute(target.startTime);
|
|
716
|
+
for (const row of rows) {
|
|
717
|
+
const s = minute(text(row.start_time));
|
|
718
|
+
if (!s || s !== wantStart)
|
|
719
|
+
continue;
|
|
720
|
+
const t = text(row.talent_id);
|
|
721
|
+
if (t !== String(target.talentId) && t !== String(target.talentName || ''))
|
|
722
|
+
continue;
|
|
723
|
+
const ty = text(row.interview_type);
|
|
724
|
+
if (target.type && ty && ty !== target.type)
|
|
725
|
+
continue;
|
|
726
|
+
return { formDataId: String(row.form_data_id || ''), start: s };
|
|
727
|
+
}
|
|
728
|
+
return null;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* 写前查重(ISS-401):同人才 + 同开始时间(分钟)+ 同面试方式已有记录 → 视为重复 apply。
|
|
732
|
+
* 只扫首页 1000 行(面试台账按时间倒序,重复记录必是最近的),读失败按放行处理:
|
|
733
|
+
* 读不到表不能阻断正常安排,但调用方会把「查重未执行」写进 warnings。
|
|
734
|
+
*/
|
|
735
|
+
async function findDuplicateInterview(ctx, objId, talentId, talentName, startTime, type) {
|
|
736
|
+
const { rows } = await fetchDatasetRows(ctx.host, objId, { pageSize: 1000, maxRows: 1000 });
|
|
737
|
+
return matchDuplicateInterview(rows, { talentId, talentName, startTime, type });
|
|
738
|
+
}
|
|
727
739
|
/** 单个候选人的落库执行体(供单条 apply 与批量 apply 复用;payload 由调用方校验)。 */
|
|
728
740
|
async function applyCore(args, env, payload) {
|
|
729
741
|
restoreDsOptions(payload.enumMaps);
|
|
@@ -759,6 +771,26 @@ async function applyCore(args, env, payload) {
|
|
|
759
771
|
if (payload.fingerprint !== createHash('sha256').update(JSON.stringify(willSubmit)).digest('hex')) {
|
|
760
772
|
throw rsValidationError('fingerprint_mismatch', '待提交内容与 prepare 确认摘要不一致,请重新 prepare 确认后再 apply');
|
|
761
773
|
}
|
|
774
|
+
// 🔴 写前查重(ISS-401):此前只在失败文案里提醒「不要重新 apply」,重复提交仍会落两条记录。
|
|
775
|
+
// 这里按「同人才 + 同开始时间 + 同面试方式」拦一次;用户明确要建第二条时传 allowDuplicate:true。
|
|
776
|
+
let duplicateCheckSkipped = '';
|
|
777
|
+
if (merged.allowDuplicate !== true) {
|
|
778
|
+
try {
|
|
779
|
+
const dup = await findDuplicateInterview(ctx, plan.objId, talentId, String(plan.cand?.name || ''), String(startTime), String(merged.type || DEFAULT_INTERVIEW_TYPE));
|
|
780
|
+
if (dup) {
|
|
781
|
+
throw rsFail('已存在同人才、同开始时间的面试记录(formDataId=' + (dup.formDataId || '未知')
|
|
782
|
+
+ ',开始时间 ' + dup.start + '),本次未写入任何数据。'
|
|
783
|
+
+ '如确需再建一条(如多轮面试同一时段),请显式传 allowDuplicate:true 后重试;'
|
|
784
|
+
+ '若是上次 apply 已成功,请直接查看该记录,不要重复提交。', { duplicate: true, formDataId: dup.formDataId });
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
catch (e) {
|
|
788
|
+
// rsFail 是业务阻断,必须原样抛出;只有「读表失败」才放行并留痕
|
|
789
|
+
if (e?.type || e?.code)
|
|
790
|
+
throw e;
|
|
791
|
+
duplicateCheckSkipped = '面试记录查重未执行(读取面试台账失败:' + (e?.message || '未知原因') + '),本次仍继续写入';
|
|
792
|
+
}
|
|
793
|
+
}
|
|
762
794
|
const formDataId = await saveFormData(ctx.host, {
|
|
763
795
|
appId: plan.appId, formId: plan.formId, objId: plan.objId,
|
|
764
796
|
name: '面试管理-' + plan.cand.name + ' ' + plan.summary.time, dataDetails: plan.dataDetails,
|
|
@@ -796,7 +828,11 @@ async function applyCore(args, env, payload) {
|
|
|
796
828
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : undefined,
|
|
797
829
|
saveActions: actionsRun.executed,
|
|
798
830
|
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
799
|
-
warnings: [
|
|
831
|
+
warnings: [
|
|
832
|
+
...(actionsRun.warnings || []),
|
|
833
|
+
...(duplicateCheckSkipped ? [duplicateCheckSkipped] : []),
|
|
834
|
+
...verifyWarnings,
|
|
835
|
+
],
|
|
800
836
|
assigned: actionsRun.assigned || {},
|
|
801
837
|
});
|
|
802
838
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
2
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
3
|
-
import { objIdOf, formIdOf, saveFormData, runEsb, getDsOptions, getFormButtonsForData, findSubmitButton, analyzeButtonActions, getFormDataRecord, toSubmitDetails, randHex32, dsOptionsSnapshot, restoreDsOptions, } from '../shared.js';
|
|
3
|
+
import { objIdOf, formIdOf, saveFormData, runEsb, getDsOptions, getFormButtonsForData, findSubmitButton, analyzeButtonActions, getFormDataRecord, toSubmitDetails, randHex32, dsOptionsSnapshot, restoreDsOptions, fetchDatasetRows, } from '../shared.js';
|
|
4
4
|
// InterviewStatusEnum.INVALID(已失效):系统反馈按钮(填写/编辑/代评价)均要求非此状态
|
|
5
5
|
const INVALID_STATUS_ID = '841052191228968977';
|
|
6
6
|
const R = (v) => String(v ?? '').replace(/^<p>|<\/p>$/g, '').trim();
|
|
@@ -9,10 +9,20 @@ async function locateTalentId(host, cache, args) {
|
|
|
9
9
|
return String(args.talentId);
|
|
10
10
|
if (!args.mobile)
|
|
11
11
|
throw rsValidationError('locate_required', '请提供 talentId 或 mobile');
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
throw rsFail('
|
|
15
|
-
const
|
|
12
|
+
const poolObjId = cache.forms?.talent_pool?.objId;
|
|
13
|
+
if (!poolObjId)
|
|
14
|
+
throw rsFail('环境缓存缺少人才表单 objId');
|
|
15
|
+
const listId = cache.lists?.talent?.listId;
|
|
16
|
+
if (!listId) {
|
|
17
|
+
// 无菜单直读人才表,按手机号本地过滤;不再把列表菜单当定位前置条件。
|
|
18
|
+
const ds = await fetchDatasetRows(host, poolObjId, { pageSize: 200, maxRows: 1000 });
|
|
19
|
+
const rows = ds.rows.filter((x) => String(x.telephone || '').includes(String(args.mobile)));
|
|
20
|
+
if (!rows.length)
|
|
21
|
+
throw rsFail('未找到手机号为 ' + args.mobile + ' 的候选人');
|
|
22
|
+
if (rows.length > 1)
|
|
23
|
+
throw rsFail('该手机号命中多条候选人,请提供 talentId 精确定位');
|
|
24
|
+
return String(rows[0].talentId || rows[0].form_data_id || rows[0].id);
|
|
25
|
+
}
|
|
16
26
|
const r = await host.request({
|
|
17
27
|
path: '/api/ebuilder/form/list/getListDatas?passid=' + poolObjId + '&cid=' + poolObjId,
|
|
18
28
|
body: {
|