weaver-work-cli 0.1.50 → 0.1.53
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 +1 -1
- package/dist/chunks/{attachment-content-EJYIOJPH.js → attachment-content-W3TSJC3Y.js} +3 -3
- package/dist/chunks/{chunk-BFKLQLBK.js → chunk-2J3XY4ED.js} +7 -7
- package/dist/chunks/{chunk-K67FODVC.js → chunk-6GCXWKG6.js} +1 -1
- package/dist/chunks/{chunk-WNJUGI2F.js → chunk-76PRVYH4.js} +1 -1
- package/dist/chunks/{chunk-RYFRGTUV.js → chunk-DEHJ7PMA.js} +4 -4
- package/dist/chunks/{chunk-3NCFFHB2.js → chunk-IF33CG4V.js} +1 -1
- package/dist/chunks/{chunk-YB3AJYPY.js → chunk-PE334WL3.js} +4 -4
- package/dist/chunks/{chunk-MCZG6HPM.js → chunk-QQXMHM3J.js} +2 -2
- package/dist/chunks/{chunk-7ECB22G3.js → chunk-U7ROML5E.js} +23 -23
- package/dist/chunks/{chunk-7AYQJSFY.js → chunk-WTLQGS6D.js} +2 -2
- package/dist/chunks/{chunk-6T53BSWZ.js → chunk-XPQN4E5O.js} +50 -19
- package/dist/chunks/{chunk-HARQF5IP.js → chunk-Z4G7LLDD.js} +25 -25
- package/dist/chunks/{conflict-C4UDHCWV.js → conflict-57WDJWL7.js} +2 -2
- package/dist/chunks/{contract-VUC6JOPG.js → contract-LJRAXVZU.js} +8587 -1421
- package/dist/chunks/{create-flow-6OG2LYBD.js → create-flow-3FMMZBCA.js} +6 -6
- package/dist/chunks/{data-QO7QWOIV.js → data-WK5CQXNF.js} +17 -32
- package/dist/chunks/{env-WP57TF2S.js → env-JYZE3BZB.js} +2 -2
- package/dist/chunks/{factory-VUXI7N5C.js → factory-66SCIKW3.js} +1 -1
- package/dist/chunks/{group-chat-UQRGXILK.js → group-chat-MNRYMLNG.js} +3 -3
- package/dist/chunks/{invoice-E7GOITEU.js → invoice-V7ZTITUO.js} +725 -205
- package/dist/chunks/{meeting-4BBLVAWM.js → meeting-IIY4UAJL.js} +10 -10
- package/dist/chunks/{recruit-stage-FKWS5UQF.js → recruit-stage-XCMVEQA2.js} +718 -131
- package/dist/chunks/{registry-V4CHRQDI.js → registry-CJOVECZD.js} +1 -1
- package/dist/chunks/{registry-5CRCN2TV.js → registry-METZ2LWE.js} +10 -10
- package/dist/chunks/{room-recommend-AYR3UG7R.js → room-recommend-YFY7HTOF.js} +4 -4
- package/dist/chunks/{schedule-JZEFIXUS.js → schedule-6I63TERA.js} +4 -4
- package/dist/chunks/smart-extract-FOUYNIG3.js +2882 -0
- package/dist/chunks/{workflow-3ZAF2J5E.js → workflow-YHXFIU63.js} +1 -1
- package/dist/index.js +11 -6
- package/dist/shortcuts/contract/manifest.js +251 -0
- package/dist/shortcuts/contract/ooxml/docx-table.js +233 -0
- package/dist/shortcuts/contract/operations/card-action.js +1165 -0
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +571 -0
- package/dist/shortcuts/contract/operations/card-plan.js +327 -0
- package/dist/shortcuts/contract/operations/card-risk-report.js +565 -0
- package/dist/shortcuts/contract/operations/card.js +6 -5
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +532 -0
- package/dist/shortcuts/contract/operations/docx-verify.js +258 -0
- package/dist/shortcuts/contract/operations/elements-build.js +761 -0
- package/dist/shortcuts/contract/operations/elements-spec.js +216 -0
- package/dist/shortcuts/contract/operations/first-screen.js +588 -0
- package/dist/shortcuts/contract/operations/flow.js +81 -25
- package/dist/shortcuts/contract/operations/ledger.js +438 -0
- package/dist/shortcuts/contract/operations/modeltext.js +132 -0
- package/dist/shortcuts/contract/operations/op-resolver.js +22 -0
- package/dist/shortcuts/contract/operations/performance.js +104 -3
- package/dist/shortcuts/contract/operations/quote.js +131 -25
- package/dist/shortcuts/contract/operations/quotescreen.js +529 -0
- package/dist/shortcuts/contract/operations/registry.js +30 -0
- package/dist/shortcuts/contract/operations/review.js +73 -58
- package/dist/shortcuts/contract/operations/summary-validate.js +293 -0
- package/dist/shortcuts/contract/operations/summary.js +4 -2
- package/dist/shortcuts/contract/operations/triage.js +1100 -0
- package/dist/shortcuts/contract/operations/upload.js +48 -7
- package/dist/shortcuts/contract/prewarm-cache.js +90 -0
- package/dist/shortcuts/contract/prewarm.js +88 -0
- package/dist/shortcuts/contract/upload-cache.js +49 -4
- package/dist/shortcuts/data/index.js +1 -6
- package/dist/shortcuts/data/manifest.js +2 -2
- package/dist/shortcuts/data/operations/index.js +1 -1
- package/dist/shortcuts/data/operations/query.js +23 -46
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/index.js +0 -12
- package/dist/shortcuts/invoice/manifest.js +200 -49
- package/dist/shortcuts/invoice/operations/registry.js +4 -2
- package/dist/shortcuts/invoice/operations/reim-relation.js +438 -0
- package/dist/shortcuts/invoice/operations/shared.js +3 -19
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +109 -73
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +4 -2
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +6 -2
- package/dist/shortcuts/recruit-stage/operations/list.js +217 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +144 -158
- package/dist/shortcuts/recruit-stage/operations/search.js +348 -0
- package/dist/shortcuts/recruit-stage/shared.js +5 -0
- package/dist/shortcuts/recruit-stage/tag-lookup.js +136 -0
- package/dist/shortcuts/smart-extract/constants.js +79 -0
- package/dist/shortcuts/smart-extract/continuation.js +71 -0
- package/dist/shortcuts/smart-extract/errors.js +68 -0
- package/dist/shortcuts/smart-extract/host.js +191 -0
- package/dist/shortcuts/smart-extract/index.js +105 -0
- package/dist/shortcuts/smart-extract/ledger.js +70 -0
- package/dist/shortcuts/smart-extract/manifest.js +35 -0
- package/dist/shortcuts/smart-extract/operations/attachment.js +212 -0
- package/dist/shortcuts/smart-extract/operations/batch.js +67 -0
- package/dist/shortcuts/smart-extract/operations/config.js +118 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +492 -0
- package/dist/shortcuts/smart-extract/operations/preview.js +174 -0
- package/dist/shortcuts/smart-extract/operations/registry.js +34 -0
- package/dist/shortcuts/smart-extract/operations/save.js +355 -0
- package/dist/shortcuts/smart-extract/operations/shared.js +191 -0
- package/dist/shortcuts/smart-extract/operations/structure.js +401 -0
- package/dist/shortcuts/smart-extract/operations/target.js +167 -0
- package/dist/shortcuts/smart-extract/operations/types.js +22 -0
- package/dist/shortcuts/smart-extract/operations/validate.js +454 -0
- package/dist/shortcuts/workflow/operations/form.js +68 -33
- package/dist/shortcuts/workflow/operations/read.js +19 -1
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +3 -0
- package/docs/agent-invoice.md +5 -7
- package/docs/data.md +5 -1
- package/docs/fna.md +14 -1
- package/docs/invoice.md +7 -5
- package/docs/smart-extract.md +156 -0
- package/package.json +1 -1
- package/skill-template/business-info.json +16 -1
- package/skill-template/domains/qiyecheng.md +2 -0
- package/skill-template/domains/smart-extract.md +16 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- package/skills/weaver-e10-data/references/scene-and-misc.md +4 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +223 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +47 -481
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +11 -11
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +32 -16
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +478 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +39 -61
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +18 -13
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -6
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -4
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +263 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +525 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +36 -0
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +128 -0
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +87 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +80 -54
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +110 -14
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +19 -21
- package/skills/weaver-e10-jinchengda/references/orchestration.md +12 -12
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +1 -6
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +2 -1
- package/skills/weaver-e10-qiyecheng/SKILL.md +37 -0
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +25 -0
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +8 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +9 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +13 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/self-hosted-mode.md +239 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +34 -27
- package/skills/weaver-e10-recruit-stage/SKILL.md +62 -4
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +42 -8
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +79 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +11 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +3 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +153 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +7 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +66 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +156 -42
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +122 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +36 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +157 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +35 -0
- package/skills/weaver-e10-smart-extract/SKILL.md +180 -0
- package/skills/weaver-e10-smart-extract/references/api-contract.md +71 -0
- package/skills/weaver-e10-smart-extract/references/result-format.md +102 -0
- package/skills/weaver-e10-smart-extract/references/troubleshooting.md +106 -0
- package/skills/weaver-e10-workflow/references/workflow-create.md +6 -5
- package/skills/weaver-e10-workflow/references/workflow-edit.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +46 -33
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +19 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +8 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +407 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +12 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +97 -39
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +91 -2
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +12 -12
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +136 -91
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +109 -23
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +110 -43
- package/dist/shortcuts/invoice/operations/validate-preview.js +0 -40
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +0 -279
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +0 -450
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +0 -265
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +0 -358
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +0 -588
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +0 -118
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +0 -40
|
@@ -1699,10 +1699,12 @@ async function apply(args, env) {
|
|
|
1699
1699
|
positionListUrl: listUrl,
|
|
1700
1700
|
positionCardUrl: cardUrl,
|
|
1701
1701
|
positionListLocateUrl: listUrl,
|
|
1702
|
-
// 产物链接(Agent
|
|
1702
|
+
// 产物链接(Agent 搬运成 Markdown 链接,按顺序:详情在前、列表在后)
|
|
1703
|
+
// 🔴 listLocateLink 是 CLI 的**运行时解析结果**;技能若配置了固定页面地址,
|
|
1704
|
+
// 由 Agent 按 recruit-output-links.md「链接覆盖规则」替换 path 段后再输出。
|
|
1703
1705
|
viewLink: cardUrl ? `[\u67E5\u770B ${jd.summary.positionName || "\u65B0\u5EFA\u804C\u4F4D"} \u804C\u4F4D\u8BE6\u60C5](${cardUrl})` : null,
|
|
1704
1706
|
listLocateLink: listUrl ? `[\u6253\u5F00\u804C\u4F4D\u5217\u8868](${listUrl})` : null,
|
|
1705
|
-
agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF1A\u2460 viewLink \u804C\u4F4D\u8BE6\u60C5\u5355\u9875
|
|
1707
|
+
agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF1A\u2460 viewLink \u804C\u4F4D\u8BE6\u60C5\u5355\u9875\uFF08\u539F\u6837\u642C\u8FD0\uFF0C\u4E0D\u6539\uFF09\u2461 listLocateLink \u804C\u4F4D\u5217\u8868\u2014\u2014\u82E5\u6280\u80FD\u300C\u56FA\u5B9A\u53C2\u6570\u8868\u300D\u914D\u7F6E\u4E86\u672C\u79DF\u6237\u7684\u56FA\u5B9A\u9875\u9762\u8DEF\u7531\uFF0C\u6309 recruit-output-links.md \u8986\u76D6\u89C4\u5219\u7528\u56FA\u5B9A\u8DEF\u7531\u66FF\u6362 path \u6BB5\uFF08origin \u53D6\u81EA viewLink\uFF09\uFF0C\u5426\u5219\u539F\u6837\u642C\u8FD0\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\uFF1B\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\uFF0C\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u94FE\u63A5\u53EA\u662F\u67E5\u770B\u5165\u53E3\uFF0C\u91CD\u590D\u70B9\u51FB\u4E0D\u4F1A\u91CD\u590D\u521B\u5EFA\u3002",
|
|
1706
1708
|
...jd.summary
|
|
1707
1709
|
});
|
|
1708
1710
|
}
|
|
@@ -2121,6 +2123,127 @@ var school_tiers_default = {
|
|
|
2121
2123
|
]
|
|
2122
2124
|
};
|
|
2123
2125
|
|
|
2126
|
+
// src/shortcuts/recruit-stage/tag-lookup.ts
|
|
2127
|
+
async function queryTagByName(host, name) {
|
|
2128
|
+
const pageSize = 100;
|
|
2129
|
+
const bodyOf = (type) => ({ type, name, order: 8, pageSize, pageNo: 1, search: 1, tagGroup: 0, tagModules: ["ebuilderform"] });
|
|
2130
|
+
const rs = await Promise.all([0, 1].map((type) => host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(type) }).catch(() => null)));
|
|
2131
|
+
const items = [];
|
|
2132
|
+
let filtered = true;
|
|
2133
|
+
for (const r of rs) {
|
|
2134
|
+
const d = r?.data || {};
|
|
2135
|
+
const list = Array.isArray(d.data) ? d.data : [];
|
|
2136
|
+
const total = Number(d.total || 0);
|
|
2137
|
+
if (list.length >= pageSize && total >= pageSize) filtered = false;
|
|
2138
|
+
items.push(...list);
|
|
2139
|
+
}
|
|
2140
|
+
return { items, filtered };
|
|
2141
|
+
}
|
|
2142
|
+
async function fetchTagsOfType(host, type) {
|
|
2143
|
+
const pageSize = 100;
|
|
2144
|
+
const bodyOf = (pageNo) => ({ type, name: "", order: 8, pageSize, pageNo, search: 1, tagGroup: 0, tagModules: ["ebuilderform"] });
|
|
2145
|
+
const first = await host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(1) }).catch(() => null);
|
|
2146
|
+
const d = first?.data || {};
|
|
2147
|
+
const rows = Array.isArray(d.data) ? [...d.data] : [];
|
|
2148
|
+
const total = Number(d.total || 0);
|
|
2149
|
+
const pages = Math.min(40, Math.max(1, Math.ceil(total / pageSize)));
|
|
2150
|
+
if (pages > 1 && rows.length) {
|
|
2151
|
+
const rest = Array.from({ length: pages - 1 }, (_, i) => i + 2);
|
|
2152
|
+
for (let i = 0; i < rest.length; i += 5) {
|
|
2153
|
+
const batch = rest.slice(i, i + 5);
|
|
2154
|
+
const rs = await Promise.all(batch.map((p) => host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(p) }).catch(() => null)));
|
|
2155
|
+
for (const r of rs) {
|
|
2156
|
+
const list = r?.data?.data;
|
|
2157
|
+
if (Array.isArray(list)) rows.push(...list);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
return rows;
|
|
2162
|
+
}
|
|
2163
|
+
async function listPlatformTags(host) {
|
|
2164
|
+
const all = [];
|
|
2165
|
+
for (const type of [0, 1]) {
|
|
2166
|
+
try {
|
|
2167
|
+
all.push(...await fetchTagsOfType(host, type));
|
|
2168
|
+
} catch {
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2172
|
+
return all.filter((t) => t && t.tagId && !seen.has(String(t.tagId)) && seen.add(String(t.tagId)));
|
|
2173
|
+
}
|
|
2174
|
+
async function resolveTags(host, names) {
|
|
2175
|
+
const norm = (s) => String(s == null ? "" : s).trim().toLowerCase();
|
|
2176
|
+
const byName = /* @__PURE__ */ new Map();
|
|
2177
|
+
const uniqNames = [...new Set((names || []).map((n) => String(n)).filter(Boolean))];
|
|
2178
|
+
let availableCount;
|
|
2179
|
+
if (!uniqNames.length) return { resolved: [], found: [], missing: [], available: [], availableCount };
|
|
2180
|
+
const probes = await Promise.all(uniqNames.map((n) => queryTagByName(host, n).catch(() => ({ items: [], filtered: true }))));
|
|
2181
|
+
const nameQueryUsable = probes.every((p) => p.filtered);
|
|
2182
|
+
if (nameQueryUsable) {
|
|
2183
|
+
for (const p of probes) {
|
|
2184
|
+
for (const t of p.items) {
|
|
2185
|
+
if (!t || !t.tagId) continue;
|
|
2186
|
+
const k = norm(t.name);
|
|
2187
|
+
const prev = byName.get(k);
|
|
2188
|
+
if (!prev) byName.set(k, t);
|
|
2189
|
+
else if ((prev.type ?? 0) !== 0 && t.type === 0) byName.set(k, t);
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
} else {
|
|
2193
|
+
const dict = await listPlatformTags(host);
|
|
2194
|
+
availableCount = dict.length;
|
|
2195
|
+
for (const t of dict) {
|
|
2196
|
+
const k = norm(t.name);
|
|
2197
|
+
const prev = byName.get(k);
|
|
2198
|
+
if (!prev) byName.set(k, t);
|
|
2199
|
+
else if ((prev.type ?? 0) !== 0 && t.type === 0) byName.set(k, t);
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
const resolved = [];
|
|
2203
|
+
const found = [];
|
|
2204
|
+
const missing = [];
|
|
2205
|
+
for (const n of names || []) {
|
|
2206
|
+
const t = byName.get(norm(n));
|
|
2207
|
+
if (!t) {
|
|
2208
|
+
missing.push(n);
|
|
2209
|
+
continue;
|
|
2210
|
+
}
|
|
2211
|
+
resolved.push({ id: String(t.tagId), name: t.name, type: t.type ?? 0 });
|
|
2212
|
+
found.push(t.name);
|
|
2213
|
+
}
|
|
2214
|
+
return {
|
|
2215
|
+
resolved,
|
|
2216
|
+
found,
|
|
2217
|
+
missing,
|
|
2218
|
+
availableCount,
|
|
2219
|
+
available: [...byName.values()].map((t) => ({ tagId: String(t.tagId), name: t.name, type: t.type ?? 0 }))
|
|
2220
|
+
};
|
|
2221
|
+
}
|
|
2222
|
+
async function addEntityTags(host, talentId, names) {
|
|
2223
|
+
if (!names || !names.length) return { applied: [], skipped: [] };
|
|
2224
|
+
const { resolved, found, missing } = await resolveTags(host, names);
|
|
2225
|
+
if (!resolved.length) return { applied: [], skipped: missing };
|
|
2226
|
+
const r = await host.request({
|
|
2227
|
+
path: "/api/my/tag/common/batchAddEntityTag",
|
|
2228
|
+
method: "POST",
|
|
2229
|
+
body: { tags: resolved, batchDatas: [{ entityId: String(talentId), module: "ebuilderform" }] }
|
|
2230
|
+
});
|
|
2231
|
+
if (r?.status === false) return { applied: [], skipped: [...missing, ...found], error: r?.msg };
|
|
2232
|
+
return { applied: found, skipped: missing };
|
|
2233
|
+
}
|
|
2234
|
+
async function queryEntityTags(host, talentId) {
|
|
2235
|
+
const out = [];
|
|
2236
|
+
for (const type of [0, 1]) {
|
|
2237
|
+
try {
|
|
2238
|
+
const r = await host.request({ path: "/api/my/tag/common/queryEntityTag", method: "POST", body: { entityId: String(talentId), module: "ebuilderform", type } });
|
|
2239
|
+
const list = r?.data;
|
|
2240
|
+
if (Array.isArray(list)) for (const t of list) out.push(t.content || t.name || t.labelName || String(t.id || ""));
|
|
2241
|
+
} catch {
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
return [...new Set(out.filter(Boolean))];
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2124
2247
|
// src/shortcuts/recruit-stage/fs-scan.ts
|
|
2125
2248
|
import { mkdtempSync, readdirSync, readFileSync, statSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2126
2249
|
import { tmpdir } from "node:os";
|
|
@@ -2366,6 +2489,21 @@ async function uploadResume(host, baseUrl, filePath, fieldId, formId) {
|
|
|
2366
2489
|
if (!j?.data?.fileid) throw rsFail("\u7B80\u5386\u4E0A\u4F20\u5931\u8D25\uFF1A" + JSON.stringify(j || {}).slice(0, 200));
|
|
2367
2490
|
return { fileid: String(j.data.fileid), name: j.data.name || filename };
|
|
2368
2491
|
}
|
|
2492
|
+
async function writeAvatarIfProvided(ctx, opts) {
|
|
2493
|
+
const raw = opts.photoFile ? String(opts.photoFile).trim() : "";
|
|
2494
|
+
if (!raw) return { written: false };
|
|
2495
|
+
const avatarFieldId = (opts.fields || {}).avatar;
|
|
2496
|
+
if (!avatarFieldId) return { written: false, warning: "\u5F53\u524D\u73AF\u5883\u4EBA\u624D\u8868\u5355\u6CA1\u6709\u300C\u5934\u50CF\u300D\u5B57\u6BB5\uFF0C\u5DF2\u8DF3\u8FC7\u5934\u50CF" };
|
|
2497
|
+
const abs = path.resolve(raw);
|
|
2498
|
+
if (!fs.existsSync(abs)) return { written: false, warning: "\u5934\u50CF\u56FE\u7247\u4E0D\u5B58\u5728\uFF0C\u5DF2\u8DF3\u8FC7\uFF1A" + abs };
|
|
2499
|
+
try {
|
|
2500
|
+
const up = await uploadResume(ctx.host, opts.baseUrl, abs, avatarFieldId, opts.formId);
|
|
2501
|
+
await datasetUpdateFormData(ctx.host, { objId: opts.objId, dataId: opts.dataId, mainTable: { avatar: up.fileid } });
|
|
2502
|
+
return { written: true, fileId: up.fileid, name: up.name };
|
|
2503
|
+
} catch (e) {
|
|
2504
|
+
return { written: false, warning: "\u5934\u50CF\u5199\u5165\u5931\u8D25\uFF08\u5DF2\u8DF3\u8FC7\uFF0C\u4E0D\u5F71\u54CD\u5EFA\u6863\uFF09\uFF1A" + (e?.message || e) };
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2369
2507
|
async function extractResume(host, fileid) {
|
|
2370
2508
|
const b = await host.request({ path: "/api/recruit/ocr/checkResumeExtraction", method: "POST", body: {} });
|
|
2371
2509
|
if (b?.data !== true) throw rsFail("\u5F53\u524D\u73AF\u5883\u672A\u5F00\u542F\u7B80\u5386\u62BD\u53D6\uFF08checkResumeExtraction=false\uFF09\uFF1AOCR \u515C\u5E95\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7531\u5927\u6A21\u578B\u89E3\u6790\u540E\u8D70 structured \u8F93\u5165");
|
|
@@ -2670,125 +2808,6 @@ async function matchTalentLabel(host, talentId) {
|
|
|
2670
2808
|
const r = await host.request({ path: "/api/recruit/label/matchTalentLabel?talentId=" + encodeURIComponent(talentId), method: "POST", body: {} });
|
|
2671
2809
|
return r?.data || null;
|
|
2672
2810
|
}
|
|
2673
|
-
async function queryTagByName(host, name) {
|
|
2674
|
-
const pageSize = 100;
|
|
2675
|
-
const bodyOf = (type) => ({ type, name, order: 8, pageSize, pageNo: 1, search: 1, tagGroup: 0, tagModules: ["ebuilderform"] });
|
|
2676
|
-
const rs = await Promise.all([0, 1].map((type) => host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(type) }).catch(() => null)));
|
|
2677
|
-
const items = [];
|
|
2678
|
-
let filtered = true;
|
|
2679
|
-
for (const r of rs) {
|
|
2680
|
-
const d = r?.data || {};
|
|
2681
|
-
const list = Array.isArray(d.data) ? d.data : [];
|
|
2682
|
-
const total = Number(d.total || 0);
|
|
2683
|
-
if (list.length >= pageSize && total >= pageSize) filtered = false;
|
|
2684
|
-
items.push(...list);
|
|
2685
|
-
}
|
|
2686
|
-
return { items, filtered };
|
|
2687
|
-
}
|
|
2688
|
-
async function fetchTagsOfType(host, type) {
|
|
2689
|
-
const pageSize = 100;
|
|
2690
|
-
const bodyOf = (pageNo) => ({ type, name: "", order: 8, pageSize, pageNo, search: 1, tagGroup: 0, tagModules: ["ebuilderform"] });
|
|
2691
|
-
const first = await host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(1) }).catch(() => null);
|
|
2692
|
-
const d = first?.data || {};
|
|
2693
|
-
const rows = Array.isArray(d.data) ? [...d.data] : [];
|
|
2694
|
-
const total = Number(d.total || 0);
|
|
2695
|
-
const pages = Math.min(40, Math.max(1, Math.ceil(total / pageSize)));
|
|
2696
|
-
if (pages > 1 && rows.length) {
|
|
2697
|
-
const rest = Array.from({ length: pages - 1 }, (_, i) => i + 2);
|
|
2698
|
-
for (let i = 0; i < rest.length; i += 5) {
|
|
2699
|
-
const batch = rest.slice(i, i + 5);
|
|
2700
|
-
const rs = await Promise.all(batch.map((p) => host.request({ path: "/api/my/tag/query", method: "POST", body: bodyOf(p) }).catch(() => null)));
|
|
2701
|
-
for (const r of rs) {
|
|
2702
|
-
const list = r?.data?.data;
|
|
2703
|
-
if (Array.isArray(list)) rows.push(...list);
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
}
|
|
2707
|
-
return rows;
|
|
2708
|
-
}
|
|
2709
|
-
async function listPlatformTags(host) {
|
|
2710
|
-
const all = [];
|
|
2711
|
-
for (const type of [0, 1]) {
|
|
2712
|
-
try {
|
|
2713
|
-
all.push(...await fetchTagsOfType(host, type));
|
|
2714
|
-
} catch {
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2718
|
-
return all.filter((t) => t && t.tagId && !seen.has(String(t.tagId)) && seen.add(String(t.tagId)));
|
|
2719
|
-
}
|
|
2720
|
-
async function resolveTags(host, names) {
|
|
2721
|
-
const norm = (s) => String(s == null ? "" : s).trim().toLowerCase();
|
|
2722
|
-
const byName = /* @__PURE__ */ new Map();
|
|
2723
|
-
const uniqNames = [...new Set((names || []).map((n) => String(n)).filter(Boolean))];
|
|
2724
|
-
let availableCount;
|
|
2725
|
-
if (!uniqNames.length) return { resolved: [], found: [], missing: [], available: [], availableCount };
|
|
2726
|
-
const probes = await Promise.all(uniqNames.map((n) => queryTagByName(host, n).catch(() => ({ items: [], filtered: true }))));
|
|
2727
|
-
const nameQueryUsable = probes.every((p) => p.filtered);
|
|
2728
|
-
if (nameQueryUsable) {
|
|
2729
|
-
for (const p of probes) {
|
|
2730
|
-
for (const t of p.items) {
|
|
2731
|
-
if (!t || !t.tagId) continue;
|
|
2732
|
-
const k = norm(t.name);
|
|
2733
|
-
const prev = byName.get(k);
|
|
2734
|
-
if (!prev) byName.set(k, t);
|
|
2735
|
-
else if ((prev.type ?? 0) !== 0 && t.type === 0) byName.set(k, t);
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
} else {
|
|
2739
|
-
const dict = await listPlatformTags(host);
|
|
2740
|
-
availableCount = dict.length;
|
|
2741
|
-
for (const t of dict) {
|
|
2742
|
-
const k = norm(t.name);
|
|
2743
|
-
const prev = byName.get(k);
|
|
2744
|
-
if (!prev) byName.set(k, t);
|
|
2745
|
-
else if ((prev.type ?? 0) !== 0 && t.type === 0) byName.set(k, t);
|
|
2746
|
-
}
|
|
2747
|
-
}
|
|
2748
|
-
const resolved = [];
|
|
2749
|
-
const found = [];
|
|
2750
|
-
const missing = [];
|
|
2751
|
-
for (const n of names || []) {
|
|
2752
|
-
const t = byName.get(norm(n));
|
|
2753
|
-
if (!t) {
|
|
2754
|
-
missing.push(n);
|
|
2755
|
-
continue;
|
|
2756
|
-
}
|
|
2757
|
-
resolved.push({ id: String(t.tagId), name: t.name, type: t.type ?? 0 });
|
|
2758
|
-
found.push(t.name);
|
|
2759
|
-
}
|
|
2760
|
-
return {
|
|
2761
|
-
resolved,
|
|
2762
|
-
found,
|
|
2763
|
-
missing,
|
|
2764
|
-
availableCount,
|
|
2765
|
-
available: [...byName.values()].map((t) => ({ tagId: String(t.tagId), name: t.name, type: t.type ?? 0 }))
|
|
2766
|
-
};
|
|
2767
|
-
}
|
|
2768
|
-
async function addEntityTags(host, talentId, names) {
|
|
2769
|
-
if (!names || !names.length) return { applied: [], skipped: [] };
|
|
2770
|
-
const { resolved, found, missing } = await resolveTags(host, names);
|
|
2771
|
-
if (!resolved.length) return { applied: [], skipped: missing };
|
|
2772
|
-
const r = await host.request({
|
|
2773
|
-
path: "/api/my/tag/common/batchAddEntityTag",
|
|
2774
|
-
method: "POST",
|
|
2775
|
-
body: { tags: resolved, batchDatas: [{ entityId: String(talentId), module: "ebuilderform" }] }
|
|
2776
|
-
});
|
|
2777
|
-
if (r?.status === false) return { applied: [], skipped: [...missing, ...found], error: r?.msg };
|
|
2778
|
-
return { applied: found, skipped: missing };
|
|
2779
|
-
}
|
|
2780
|
-
async function queryEntityTags(host, talentId) {
|
|
2781
|
-
const out = [];
|
|
2782
|
-
for (const type of [0, 1]) {
|
|
2783
|
-
try {
|
|
2784
|
-
const r = await host.request({ path: "/api/my/tag/common/queryEntityTag", method: "POST", body: { entityId: String(talentId), module: "ebuilderform", type } });
|
|
2785
|
-
const list = r?.data;
|
|
2786
|
-
if (Array.isArray(list)) for (const t of list) out.push(t.content || t.name || t.labelName || String(t.id || ""));
|
|
2787
|
-
} catch {
|
|
2788
|
-
}
|
|
2789
|
-
}
|
|
2790
|
-
return [...new Set(out.filter(Boolean))];
|
|
2791
|
-
}
|
|
2792
2811
|
function deriveSchoolTags(structured) {
|
|
2793
2812
|
const cfg = school_tiers_default;
|
|
2794
2813
|
const norm = (x) => String(x || "").replace(/[\s ]/g, "").replace(/[((][^))]*[))]/g, "").replace(/^(.*?(?:大学|学院|学校)).*(?:分校|校区)$/, "$1");
|
|
@@ -3037,7 +3056,16 @@ async function buildImport(ctx, args) {
|
|
|
3037
3056
|
}
|
|
3038
3057
|
const schoolTagInfo = args.noSchoolTags ? { candidates: [], detail: [], schools: [] } : deriveSchoolTags(structured);
|
|
3039
3058
|
const tagNames = [...args.tags || []];
|
|
3040
|
-
|
|
3059
|
+
const schoolNameSet = new Set((schoolTagInfo.schools || []).map((s) => String(s)));
|
|
3060
|
+
const tieredSchoolSet = new Set(
|
|
3061
|
+
(schoolTagInfo.detail || []).filter((d) => Array.isArray(d && d.tiers) && d.tiers.length > 0).map((d) => String(d && d.school || ""))
|
|
3062
|
+
);
|
|
3063
|
+
for (const t of schoolTagInfo.candidates) {
|
|
3064
|
+
if (tagNames.includes(t)) continue;
|
|
3065
|
+
const nm = String(t);
|
|
3066
|
+
if (schoolNameSet.has(nm) && !tieredSchoolSet.has(nm)) continue;
|
|
3067
|
+
tagNames.push(nm);
|
|
3068
|
+
}
|
|
3041
3069
|
const dataDetails = mapToTalent(fields, structured);
|
|
3042
3070
|
if (fileid) {
|
|
3043
3071
|
dataDetails.push({ formField: { id: resumeFieldId }, dataOptions: [{ optionId: String(fileid), content: fileName || "\u7B80\u5386\u9644\u4EF6", type: "file" }] });
|
|
@@ -3173,6 +3201,7 @@ var baseInput2 = {
|
|
|
3173
3201
|
structuredFile: { type: "string", description: "\u7ED3\u6784\u5316\u7B80\u5386 JSON \u6587\u4EF6\u8DEF\u5F84\uFF08\u517C\u5BB9\u811A\u672C\u7248\u7528\u6CD5\uFF09" },
|
|
3174
3202
|
fileId: { type: "string", description: "\u5DF2\u4E0A\u4F20\u5230 E10 \u7684\u7B80\u5386\u9644\u4EF6 id\uFF08\u539F\u4EF6\u5199\u8FDB\u9644\u4EF6\u5B57\u6BB5\uFF09" },
|
|
3175
3203
|
resumeFile: { type: "string", description: "\u672C\u5730\u7B80\u5386\u6587\u4EF6\u8DEF\u5F84\uFF08\u4E24\u6B65 multipart \u4E0A\u4F20\uFF09" },
|
|
3204
|
+
photoFile: { type: "string", description: "\u53EF\u9009\uFF1A\u7528\u6237\u4E3B\u52A8\u63D0\u4F9B\u7684\u5934\u50CF\u56FE\u7247\u672C\u5730\u8DEF\u5F84\u3002\u4E0D\u81EA\u52A8\u4ECE\u7B80\u5386\u63D0\u53D6\uFF1B\u6CA1\u7ED9\u6216\u5199\u5931\u8D25\u90FD\u8DF3\u8FC7\uFF0C\u4E0D\u5F71\u54CD\u5EFA\u6863" },
|
|
3176
3205
|
channel: { type: "string", description: "\u7B80\u5386\u6E20\u9053\uFF08\u987B\u5728\u6570\u636E\u5B57\u5178\u4E2D\u5B58\u5728\uFF1B\u7F3A\u7701\u56FA\u5B9A\u300C\u624B\u52A8\u5F55\u5165\u300D\uFF09" },
|
|
3177
3206
|
tags: { type: "array", items: { type: "string" }, maxItems: 20, description: "\u5E73\u53F0\u6807\u7B7E\u540D\uFF08\u6309\u540D\u547D\u4E2D\u73AF\u5883\u6E05\u5355\uFF0C\u4E0D\u5B58\u5728\u8DF3\u8FC7\uFF1B\u5B66\u6821\u5F52\u5C5E\u81EA\u52A8\u63A8\u5BFC\u53E6\u7B97\uFF09" },
|
|
3178
3207
|
useOcr: { type: "boolean", description: "\u663E\u5F0F\u5F00\u542F OCR \u515C\u5E95\u89E3\u6790\uFF08\u95F8\u95E8=checkResumeExtraction\uFF1B\u9ED8\u8BA4\u6C38\u4E0D\u4E0A\u8C03\uFF09" },
|
|
@@ -3255,6 +3284,7 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3255
3284
|
structuredFile: args.structuredFile ? String(args.structuredFile) : void 0,
|
|
3256
3285
|
fileId: args.fileId ? String(args.fileId) : void 0,
|
|
3257
3286
|
resumeFile: args.resumeFile ? String(args.resumeFile) : void 0,
|
|
3287
|
+
photoFile: args.photoFile ? String(args.photoFile) : void 0,
|
|
3258
3288
|
channel: args.channel ? String(args.channel) : void 0,
|
|
3259
3289
|
updateTalentId: args.updateTalentId ? String(args.updateTalentId) : void 0,
|
|
3260
3290
|
useOcr: args.useOcr === true,
|
|
@@ -3335,6 +3365,11 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3335
3365
|
formConflicts: dupInfo.formConflicts.existing,
|
|
3336
3366
|
unreadableIds: dupInfo.formConflicts.unreadable,
|
|
3337
3367
|
byPhoneError: dupInfo.byPhoneError,
|
|
3368
|
+
// 🔴 2026-11-11 新增:区分「真重复」与「上次建档已成功后的复跑」。
|
|
3369
|
+
// 实测:apply 成功后再跑一次 prepare(不带 updateTalentId)会 unique:false 命中刚建的自己,
|
|
3370
|
+
// 而文档口径是「已存在同手机号人才 → 提示并停住,不重复建档」→ 重试路径被自己的查重挡死。
|
|
3371
|
+
// 这里不改判定逻辑(查重该拦就拦),只补一个明确出口,避免 Agent 笼统报「已存在」后卡住。
|
|
3372
|
+
retryHint: dupInfo.unique ? void 0 : "\u82E5\u672C\u6B21\u662F\u91CD\u8BD5/\u590D\u8DD1\uFF08\u4E0A\u6B21 apply \u53EF\u80FD\u5DF2\u6210\u529F\uFF09\uFF0C\u8BF7\u6539\u7528 updateTalentId=<\u547D\u4E2D\u7684\u4EBA\u624Did> \u8D70\u66F4\u65B0\u901A\u9053\uFF0C\u4E0D\u8981\u91CD\u590D\u5EFA\u6863",
|
|
3338
3373
|
note: dupInfo.byPhone ? "\u624B\u673A\u53F7\u5DF2\u7ED1\u5B9A\u4EBA\u624D\uFF08\u9875\u9762\u540C\u6B3E getCandidateByPhone \u547D\u4E2D\uFF09\u2192 \u4E0D\u65B0\u5EFA\uFF0C\u7ED9\u51FA\u4EBA\u624D\u67E5\u770B\u9875\u5730\u5740" : dupInfo.formConflicts.existing.length ? "\u624B\u673A\u53F7\u5728\u4EBA\u624D\u5E93\u5DF2\u5B58\u5728\uFF08\u8868\u5355\u552F\u4E00\u6027\u547D\u4E2D\uFF0C\u4F46\u65E0\u5E94\u8058\u6279\u6B21\uFF09\u2192 \u4E0D\u65B0\u5EFA" : dupInfo.formConflicts.unreadable.length ? "\u624B\u673A\u53F7\u88AB\u5DF2\u5220\u9664\u8BB0\u5F55\u5360\u7528\uFF08\u5E73\u53F0\u4ECD\u4F1A\u62E6\u65B0\u5EFA\uFF09\uFF1A\u9700\u5148\u5728\u56DE\u6536\u7AD9\u6E05\u7406\uFF0C\u6216\u6539\u4E3A\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D" : "\u65E0\u91CD\u590D"
|
|
3339
3374
|
}
|
|
3340
3375
|
};
|
|
@@ -3362,7 +3397,14 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3362
3397
|
});
|
|
3363
3398
|
return rsSuccess("recruit-stage.resume.import.prepare", {
|
|
3364
3399
|
mode: "prepare",
|
|
3400
|
+
// 🔴 2026-11-11 修「截断丢 token」:prepare 输出 12 KB+,continuation 原落在 data 尾部,
|
|
3401
|
+
// Agent 按行数截断读取(如 Select-Object -First N)就会丢 token → apply 报
|
|
3402
|
+
// continuation_required → 被迫重跑 prepare → 连带重复上传原件、在附件库留孤儿文件
|
|
3403
|
+
// (实测一轮留下 2 个附件 id、只有 1 个被绑定)。前置到 mode 之后,截断也能拿到;
|
|
3404
|
+
// meta.continuation 原样保留,向后兼容。
|
|
3405
|
+
continuation,
|
|
3365
3406
|
...summary,
|
|
3407
|
+
photo: args.photoFile ? { file: path.basename(String(args.photoFile)), exists: fs.existsSync(path.resolve(String(args.photoFile))) } : null,
|
|
3366
3408
|
willSubmit,
|
|
3367
3409
|
tagCheck,
|
|
3368
3410
|
schoolTags: built.schoolTagInfo,
|
|
@@ -3370,6 +3412,7 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3370
3412
|
// 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。新建场景要把「建档字段 + 标签预检结果」一起给出来。
|
|
3371
3413
|
preview: {
|
|
3372
3414
|
...summary,
|
|
3415
|
+
photo: args.photoFile ? { file: path.basename(String(args.photoFile)) } : null,
|
|
3373
3416
|
tagCheck,
|
|
3374
3417
|
schoolTags: built.schoolTagInfo,
|
|
3375
3418
|
onCommit: "\u63D0\u4EA4\u540E\u5C06\uFF1A\u5EFA\u4EBA\u624D \u2192 \u521D\u59CB\u5316\u6279\u6B21 \u2192 \u81EA\u52A8\u6807\u7B7E\u5339\u914D \u2192 \u5199\u5E73\u53F0\u6807\u7B7E \u2192 \u8F93\u51FA\u5361\u7247\u4E0E\u4EBA\u624D\u5E93\u94FE\u63A5"
|
|
@@ -3405,6 +3448,14 @@ async function applyCore(args, env, payload) {
|
|
|
3405
3448
|
details: built.detailsPayload,
|
|
3406
3449
|
coverDetails: Object.keys(built.detailsPayload)
|
|
3407
3450
|
});
|
|
3451
|
+
const avatarRes2 = await writeAvatarIfProvided(ctx, {
|
|
3452
|
+
photoFile: argsT.photoFile,
|
|
3453
|
+
dataId: updateTalentId,
|
|
3454
|
+
fields: built.fields,
|
|
3455
|
+
objId: built.objId,
|
|
3456
|
+
formId: built.formId,
|
|
3457
|
+
baseUrl: ctx.baseUrl
|
|
3458
|
+
});
|
|
3408
3459
|
const checkAfter = (snap) => {
|
|
3409
3460
|
const out = [];
|
|
3410
3461
|
for (const [node, rows] of Object.entries(built.detailsPayload)) {
|
|
@@ -3433,6 +3484,7 @@ async function applyCore(args, env, payload) {
|
|
|
3433
3484
|
talentId: updateTalentId,
|
|
3434
3485
|
afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
|
|
3435
3486
|
verifyWarnings: verifyWarnings.length ? verifyWarnings : void 0,
|
|
3487
|
+
avatar: avatarRes2.written ? { written: true, fileId: avatarRes2.fileId, name: avatarRes2.name } : { written: false, warning: avatarRes2.warning },
|
|
3436
3488
|
talentCardUrl: await resolveTalentCardUrl(ctx, updateTalentId),
|
|
3437
3489
|
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, updateTalentId),
|
|
3438
3490
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || "(\u7A7A)" }
|
|
@@ -3487,6 +3539,14 @@ async function applyCore(args, env, payload) {
|
|
|
3487
3539
|
}
|
|
3488
3540
|
const r2 = await host.request({ path: "/api/recruit/candidate/initTalentBatch?formDataId=" + newId, method: "POST" });
|
|
3489
3541
|
const talentId = String(newId);
|
|
3542
|
+
const avatarRes = await writeAvatarIfProvided(ctx, {
|
|
3543
|
+
photoFile: argsT.photoFile,
|
|
3544
|
+
dataId: newId,
|
|
3545
|
+
fields: built.fields,
|
|
3546
|
+
objId: built.objId,
|
|
3547
|
+
formId: built.formId,
|
|
3548
|
+
baseUrl: ctx.baseUrl
|
|
3549
|
+
});
|
|
3490
3550
|
const [verifyRes, esbRes, labelRes, tagRes] = await Promise.all([
|
|
3491
3551
|
verifySubRows(ctx, built.formId, built.objId, newId).then(
|
|
3492
3552
|
(v) => ({ ok: true, v }),
|
|
@@ -3521,17 +3581,38 @@ async function applyCore(args, env, payload) {
|
|
|
3521
3581
|
const labelMatch = labelRes.ok ? labelRes.v : "ERR:" + (labelRes.e?.message || "");
|
|
3522
3582
|
const tagResult = tagRes.ok ? tagRes.v : { applied: [], skipped: built.tagNames, error: tagRes.e?.message };
|
|
3523
3583
|
const tags = await queryEntityTags(host, talentId).catch(() => []);
|
|
3584
|
+
const CORE_VERIFY_KEYS = ["candidate_name", "telephone", "email"];
|
|
3585
|
+
const submittedKeys = Object.keys(built.fields).filter((k) => built.dataDetails.some((d) => String(d?.formField?.id) === String(built.fields[k])));
|
|
3586
|
+
const strictKeys = CORE_VERIFY_KEYS.filter((k) => submittedKeys.includes(k));
|
|
3587
|
+
const nonEmptyKeys = submittedKeys.filter((k) => !strictKeys.includes(k));
|
|
3588
|
+
const expectedList = [
|
|
3589
|
+
...expectedFields(built.dataDetails, built.fields, strictKeys, [], ["email"]),
|
|
3590
|
+
...expectedFields(built.dataDetails, built.fields, nonEmptyKeys, nonEmptyKeys, [])
|
|
3591
|
+
];
|
|
3524
3592
|
const verification = await verifySubmitted({
|
|
3525
3593
|
host,
|
|
3526
3594
|
formId: built.formId,
|
|
3527
3595
|
objId: built.objId,
|
|
3528
3596
|
dataId: newId,
|
|
3529
|
-
expected:
|
|
3597
|
+
expected: expectedList
|
|
3530
3598
|
});
|
|
3531
3599
|
if (verification.mismatches.length) {
|
|
3532
3600
|
invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
3533
3601
|
for (const m of verification.mismatches) writeWarnings.push("\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual);
|
|
3534
3602
|
}
|
|
3603
|
+
const attachFieldChecked = expectedList.some((e) => e.label === "original_resume");
|
|
3604
|
+
const attachMismatch = verification.mismatches.find((m) => m.label === "original_resume");
|
|
3605
|
+
const attachmentVerify = {
|
|
3606
|
+
field: "original_resume",
|
|
3607
|
+
fileId: built.fileid || null,
|
|
3608
|
+
// checked=false 表示环境缓存无该字段定义、未进回查清单,不代表绑定失败
|
|
3609
|
+
checked: attachFieldChecked,
|
|
3610
|
+
bound: attachFieldChecked ? !attachMismatch : null,
|
|
3611
|
+
detail: attachMismatch ? "\u9644\u4EF6\u5B57\u6BB5\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A\u671F\u671B\u975E\u7A7A\uFF0C\u5B9E\u9645 " + attachMismatch.actual : built.fileid ? attachFieldChecked ? "\u9644\u4EF6\u5B57\u6BB5\u5DF2\u56DE\u67E5\u786E\u8BA4\u975E\u7A7A" : "\u539F\u4EF6\u5DF2\u4E0A\u4F20\uFF08fileId \u89C1\u4E0A\uFF09\uFF0C\u4F46\u73AF\u5883\u7F13\u5B58\u65E0 original_resume \u5B57\u6BB5\u5B9A\u4E49\uFF0C\u672A\u7EB3\u5165\u56DE\u67E5" : "\u672C\u6B21\u672A\u4E0A\u4F20\u539F\u4EF6\uFF08\u6587\u672C\u76F4\u5EFA / \u7EAF structured \u8F93\u5165\uFF09"
|
|
3612
|
+
};
|
|
3613
|
+
if (attachMismatch) {
|
|
3614
|
+
writeWarnings.push("\u7B80\u5386\u9644\u4EF6\u672A\u7ED1\u5B9A\u5230\u4EBA\u624D\u8BB0\u5F55\uFF08original_resume \u56DE\u67E5\u4E3A\u7A7A\uFF09\uFF1A\u539F\u4EF6\u5DF2\u4E0A\u4F20\u4F46\u672A\u5199\u5165\u9644\u4EF6\u5B57\u6BB5\uFF0C\u8BF7\u5728\u4EBA\u624D\u5361\u7247\u9875\u624B\u5DE5\u8865\u6302\uFF0C\u6216\u8D70 updateTalentId \u91CD\u4F20");
|
|
3615
|
+
}
|
|
3535
3616
|
const result = detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
|
|
3536
3617
|
const talentCardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
3537
3618
|
const talentListLocateUrl = await resolveTalentListLocateUrl(ctx, talentId);
|
|
@@ -3542,8 +3623,16 @@ async function applyCore(args, env, payload) {
|
|
|
3542
3623
|
newCandidateFormDataId: newId,
|
|
3543
3624
|
talentId,
|
|
3544
3625
|
writeChannel,
|
|
3545
|
-
|
|
3626
|
+
attachmentVerify,
|
|
3627
|
+
verification: {
|
|
3628
|
+
checked: verification.checked,
|
|
3629
|
+
// 明示本次实际校验了哪些字段:checked 数字 + 空 mismatches 不再能被误读为「全字段通过」
|
|
3630
|
+
checkedFields: expectedList.map((e) => e.label),
|
|
3631
|
+
mismatches: verification.mismatches,
|
|
3632
|
+
unavailable: verification.unavailable || null
|
|
3633
|
+
},
|
|
3546
3634
|
writeWarnings: writeWarnings.length ? writeWarnings : void 0,
|
|
3635
|
+
avatar: avatarRes.written ? { written: true, fileId: avatarRes.fileId, name: avatarRes.name } : { written: false, warning: avatarRes.warning },
|
|
3547
3636
|
subTablesExpected: built.subBuild.stats,
|
|
3548
3637
|
subTableVerify,
|
|
3549
3638
|
initTalentBatch: r2?.data?.msg || "",
|
|
@@ -3587,7 +3676,8 @@ async function batchPrepare(args, env) {
|
|
|
3587
3676
|
file,
|
|
3588
3677
|
name: file ? path.basename(file) : `\u7B2C${i + 1}\u9879`,
|
|
3589
3678
|
structured: x?.structured,
|
|
3590
|
-
structuredFile: x?.structuredFile
|
|
3679
|
+
structuredFile: x?.structuredFile,
|
|
3680
|
+
photoFile: x?.photoFile ? path.resolve(String(x.photoFile)) : void 0
|
|
3591
3681
|
};
|
|
3592
3682
|
}
|
|
3593
3683
|
return { file: x.path, name: x.name, structured: void 0, structuredFile: void 0 };
|
|
@@ -3633,7 +3723,7 @@ async function batchPrepare(args, env) {
|
|
|
3633
3723
|
}
|
|
3634
3724
|
row.status = "ready";
|
|
3635
3725
|
items.push(row);
|
|
3636
|
-
ready.push({ index: i + 1, label: row.name || e.name, file: e.file, args: { ...shared, resumeFile: e.file || void 0, structured, structuredFile: structuredFile || void 0 }, fingerprint: String(meta.fingerprint || "") });
|
|
3726
|
+
ready.push({ index: i + 1, label: row.name || e.name, file: e.file, args: { ...shared, resumeFile: e.file || void 0, photoFile: e.photoFile, structured, structuredFile: structuredFile || void 0 }, fingerprint: String(meta.fingerprint || "") });
|
|
3637
3727
|
} catch (err) {
|
|
3638
3728
|
row.status = "failed";
|
|
3639
3729
|
row.message = err?.message || "prepare \u5931\u8D25";
|
|
@@ -3669,7 +3759,10 @@ async function batchPrepare(args, env) {
|
|
|
3669
3759
|
fingerprint: fp,
|
|
3670
3760
|
enumMaps: await dsOptionsSnapshot(),
|
|
3671
3761
|
batchFile: store.file,
|
|
3672
|
-
batchFingerprint: store.fingerprint
|
|
3762
|
+
batchFingerprint: store.fingerprint,
|
|
3763
|
+
// 准备阶段已被查重拦截的份数:apply 汇总里要如实报「跳过」,不能只报成功/失败
|
|
3764
|
+
blockedAtPrepare: items.filter((x) => x.status === "blocked").length,
|
|
3765
|
+
needsParseAtPrepare: items.filter((x) => x.status === "needs_parse").length
|
|
3673
3766
|
});
|
|
3674
3767
|
return rsSuccess("recruit-stage.resume.import.batch.prepare", {
|
|
3675
3768
|
mode: "batch-prepare",
|
|
@@ -3711,14 +3804,16 @@ async function batchApply(args, env) {
|
|
|
3711
3804
|
try {
|
|
3712
3805
|
const r = await applyCore({ ...it.args || {}, confirm: true }, env, { fingerprint: it.fingerprint, enumMaps: batch.enumMaps });
|
|
3713
3806
|
const d = r.data || {};
|
|
3807
|
+
const isDup = d.result === "duplicate";
|
|
3714
3808
|
results.push({
|
|
3715
3809
|
index: it.index,
|
|
3716
3810
|
file: path.basename(String(it.file || "")),
|
|
3717
3811
|
name: it.label,
|
|
3718
|
-
status: d.result === "partial" ? "partial" : "success",
|
|
3812
|
+
status: isDup ? "skipped" : d.result === "partial" ? "partial" : "success",
|
|
3719
3813
|
talentId: d.talentId,
|
|
3720
3814
|
cardUrl: d.talentCardUrl,
|
|
3721
3815
|
viewLink: d.viewLink,
|
|
3816
|
+
message: isDup ? d.message || "\u624B\u673A\u53F7\u5DF2\u5B58\u5728\uFF0C\u5DF2\u8DF3\u8FC7\uFF08\u672A\u5199\u5165\uFF09" : void 0,
|
|
3722
3817
|
warnings: d.verifyWarnings && d.verifyWarnings.length ? d.verifyWarnings : void 0
|
|
3723
3818
|
});
|
|
3724
3819
|
} catch (e) {
|
|
@@ -3728,10 +3823,13 @@ async function batchApply(args, env) {
|
|
|
3728
3823
|
const ok = results.filter((x) => x.status === "success").length;
|
|
3729
3824
|
const partial = results.filter((x) => x.status === "partial").length;
|
|
3730
3825
|
const failed = results.filter((x) => x.status === "failed").length;
|
|
3826
|
+
const skipped = results.filter((x) => x.status === "skipped").length;
|
|
3827
|
+
const blockedAtPrepare = Number(batch.blockedAtPrepare || 0);
|
|
3828
|
+
const label = (st) => st === "success" ? "\u6210\u529F" : st === "partial" ? "\u90E8\u5206\u6210\u529F" : st === "skipped" ? "\u8DF3\u8FC7\uFF08\u91CD\u590D\uFF09" : "\u5931\u8D25";
|
|
3731
3829
|
const lines = [
|
|
3732
3830
|
"| # | \u6587\u4EF6 | \u59D3\u540D | \u7ED3\u679C | \u8BF4\u660E |",
|
|
3733
3831
|
"|---|---|---|---|---|",
|
|
3734
|
-
...results.map((x) => `| ${x.index} | ${x.file} | ${x.name || "-"} | ${x.status
|
|
3832
|
+
...results.map((x) => `| ${x.index} | ${x.file} | ${x.name || "-"} | ${label(x.status)} | ${x.message || (x.warnings?.length ? x.warnings.join("\uFF1B") : x.cardUrl ? "\u5DF2\u5EFA\u6863" : "")} |`)
|
|
3735
3833
|
];
|
|
3736
3834
|
return rsSuccess("recruit-stage.resume.import.batch.apply", {
|
|
3737
3835
|
mode: "batch-apply",
|
|
@@ -3740,9 +3838,12 @@ async function batchApply(args, env) {
|
|
|
3740
3838
|
succeeded: ok,
|
|
3741
3839
|
partial,
|
|
3742
3840
|
failed,
|
|
3841
|
+
skipped,
|
|
3842
|
+
skippedAtPrepare: blockedAtPrepare,
|
|
3843
|
+
skippedTotal: blockedAtPrepare + skipped,
|
|
3743
3844
|
items: results,
|
|
3744
3845
|
resultTable: lines.join("\n"),
|
|
3745
|
-
agentNote: "\u628A resultTable \u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF1B\u5931\u8D25
|
|
3846
|
+
agentNote: "\u628A resultTable \u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\u3002\u6C47\u603B\u5FC5\u987B\u8BF4\u5168\u56DB\u7C7B\uFF1A\u6210\u529F / \u90E8\u5206\u6210\u529F / \u8DF3\u8FC7\uFF08\u91CD\u590D\uFF0C\u4E0D\u65B0\u5EFA\uFF09/ \u5931\u8D25\uFF1B\u8DF3\u8FC7\u6570 = skippedAtPrepare\uFF08\u51C6\u5907\u9636\u6BB5\u67E5\u91CD\uFF09+ skipped\uFF08\u5EFA\u6863\u65F6\u53D1\u73B0\u91CD\u590D\uFF09\uFF1B\u5931\u8D25\u6216\u90E8\u5206\u6210\u529F\u8981\u5E26 message \u539F\u56E0\uFF0C\u4E0D\u8981\u53EA\u62A5\u603B\u6570\u3002\u672B\u5C3E\u9644\u300C\u4EBA\u624D\u5E93\u300D\u56FA\u5B9A\u5730\u5740\u4E00\u4E2A\u94FE\u63A5\u3002"
|
|
3746
3847
|
});
|
|
3747
3848
|
}
|
|
3748
3849
|
var resumeImportOperations = [
|
|
@@ -4531,7 +4632,7 @@ async function applyCore2(args, env, payload) {
|
|
|
4531
4632
|
interviewer: plan.summary.interviewer,
|
|
4532
4633
|
viewLink: detailUrl ? `[\u67E5\u770B ${plan.cand.name || ""} \u7684\u9762\u8BD5\u5B89\u6392\u8BE6\u60C5](${detailUrl})` : null,
|
|
4533
4634
|
listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868](${listLocateUrl})` : null,
|
|
4534
|
-
agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u5355\u9875
|
|
4635
|
+
agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u5355\u9875\uFF08\u539F\u6837\u642C\u8FD0\uFF0C\u4E0D\u6539\uFF09\u2461 listLocateLink \u9762\u8BD5\u5217\u8868\u2014\u2014\u82E5\u6280\u80FD\u300C\u56FA\u5B9A\u53C2\u6570\u8868\u300D\u914D\u7F6E\u4E86\u672C\u79DF\u6237\u7684\u56FA\u5B9A\u9875\u9762\u8DEF\u7531\uFF0C\u6309 recruit-output-links.md \u8986\u76D6\u89C4\u5219\u7528\u56FA\u5B9A\u8DEF\u7531\u66FF\u6362 path \u6BB5\uFF08origin \u53D6\u81EA viewLink\uFF09\uFF0C\u5426\u5219\u539F\u6837\u642C\u8FD0\u3002\u6309\u987A\u5E8F\u653E\u56DE\u7B54\u6B63\u6587\uFF0C\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3001\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\u3002",
|
|
4535
4636
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : void 0,
|
|
4536
4637
|
saveActions: actionsRun.executed,
|
|
4537
4638
|
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
@@ -5325,6 +5426,7 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5325
5426
|
const out = {
|
|
5326
5427
|
env: new URL(baseUrl).hostname,
|
|
5327
5428
|
type,
|
|
5429
|
+
listId,
|
|
5328
5430
|
total,
|
|
5329
5431
|
totalExact,
|
|
5330
5432
|
...totalNote ? { totalNote } : {},
|
|
@@ -5464,6 +5566,159 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5464
5566
|
}
|
|
5465
5567
|
return out;
|
|
5466
5568
|
}
|
|
5569
|
+
var INITIATOR_FIELD_CANDIDATES = [
|
|
5570
|
+
"arranger",
|
|
5571
|
+
"create_user",
|
|
5572
|
+
"create_user_name",
|
|
5573
|
+
"creator",
|
|
5574
|
+
"initiator",
|
|
5575
|
+
"interview_arranger",
|
|
5576
|
+
"createUserName",
|
|
5577
|
+
"recr_principal"
|
|
5578
|
+
];
|
|
5579
|
+
var ATTENDED_STATUS_RE = /已完成|已反馈|待反馈|已面试|已通过|已拒绝|已取消|已作废|已失效|面试中|作答中/;
|
|
5580
|
+
function parseInterviewTime(v) {
|
|
5581
|
+
const s = String(v ?? "").trim();
|
|
5582
|
+
if (!s) return null;
|
|
5583
|
+
const ts = Date.parse(s.replace(/-/g, "/"));
|
|
5584
|
+
return Number.isNaN(ts) ? null : ts;
|
|
5585
|
+
}
|
|
5586
|
+
function fmtInterviewTime(t) {
|
|
5587
|
+
if (t === null) return null;
|
|
5588
|
+
const d = new Date(t);
|
|
5589
|
+
const p = (n) => String(n).padStart(2, "0");
|
|
5590
|
+
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
|
|
5591
|
+
}
|
|
5592
|
+
function cleanInterviewer(v) {
|
|
5593
|
+
const s = String(v ?? "").trim();
|
|
5594
|
+
if (!s) return null;
|
|
5595
|
+
if (s.startsWith("[") || s.startsWith("{")) {
|
|
5596
|
+
try {
|
|
5597
|
+
const parsed = JSON.parse(s);
|
|
5598
|
+
const list = Array.isArray(parsed) ? parsed : [parsed];
|
|
5599
|
+
const names = list.map((x) => String(x?.name || x?.username || x?.text || x?.title || "").trim()).filter(Boolean);
|
|
5600
|
+
return names.length ? names.join("\u3001") : null;
|
|
5601
|
+
} catch {
|
|
5602
|
+
return s;
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
return s;
|
|
5606
|
+
}
|
|
5607
|
+
async function runInterviewNotAttended(env, args) {
|
|
5608
|
+
const host = env.host;
|
|
5609
|
+
const session = await host.getSession();
|
|
5610
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
5611
|
+
const base = await runList(env, {
|
|
5612
|
+
type: "interview",
|
|
5613
|
+
all: true,
|
|
5614
|
+
pageSize: Number(args.pageSize || 200),
|
|
5615
|
+
maxPages: Number(args.maxPages || 5)
|
|
5616
|
+
}, false);
|
|
5617
|
+
const rows = base.rows || [];
|
|
5618
|
+
const scanned = Number(base.scanned ?? rows.length);
|
|
5619
|
+
const notes = [];
|
|
5620
|
+
const cu = await resolveCurrentUser(host);
|
|
5621
|
+
const me = cu ? cu.name : "";
|
|
5622
|
+
let initiatorField = "";
|
|
5623
|
+
for (const cand of INITIATOR_FIELD_CANDIDATES) {
|
|
5624
|
+
if (rows.some((r) => String(r?.[cand] ?? "").trim() !== "")) {
|
|
5625
|
+
initiatorField = cand;
|
|
5626
|
+
break;
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
const includeAll = Boolean(args.includeAllInitiators);
|
|
5630
|
+
let mine = rows;
|
|
5631
|
+
if (!includeAll) {
|
|
5632
|
+
if (!me) {
|
|
5633
|
+
mine = [];
|
|
5634
|
+
notes.push("\u672A\u80FD\u89E3\u6790\u5F53\u524D\u767B\u5F55\u7528\u6237\uFF0C\u65E0\u6CD5\u6309\u300C\u6211\u53D1\u8D77\u7684\u300D\u8FC7\u6EE4\uFF0C\u7ED3\u679C\u4E3A\u7A7A\uFF1B\u5982\u9700\u67E5\u770B\u5168\u90E8 AI \u9762\u8BD5\u9080\u7EA6\u8BF7\u4F20 includeAllInitiators=true");
|
|
5635
|
+
} else if (!initiatorField) {
|
|
5636
|
+
mine = [];
|
|
5637
|
+
notes.push("\u9762\u8BD5\u5217\u8868\u672A\u8FD4\u56DE\u53EF\u8BC6\u522B\u7684\u53D1\u8D77\u4EBA\u5B57\u6BB5\uFF08\u5DF2\u63A2\u6D4B " + INITIATOR_FIELD_CANDIDATES.join(" / ") + "\uFF09\uFF0C\u65E0\u6CD5\u6309\u300C\u6211\u53D1\u8D77\u7684\u300D\u8FC7\u6EE4\uFF0C\u7ED3\u679C\u4E3A\u7A7A\uFF1B\u5982\u9700\u67E5\u770B\u5168\u90E8 AI \u9762\u8BD5\u9080\u7EA6\u8BF7\u4F20 includeAllInitiators=true");
|
|
5638
|
+
} else {
|
|
5639
|
+
mine = rows.filter((r) => String(r[initiatorField] ?? "").includes(me));
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
const tp = (r) => String(r.interview_type_key || r.interview_type || "");
|
|
5643
|
+
const ai = mine.filter((r) => /AI\s*面试/i.test(tp(r)));
|
|
5644
|
+
const parsedLimit = args.deadlineBefore ? parseInterviewTime(args.deadlineBefore) : null;
|
|
5645
|
+
if (args.deadlineBefore && parsedLimit === null) {
|
|
5646
|
+
throw rsFail("deadlineBefore \u65E0\u6CD5\u89E3\u6790\u4E3A\u65F6\u95F4\uFF0C\u8BF7\u7528 yyyy-MM-dd HH:mm \u6216 ISO \u683C\u5F0F");
|
|
5647
|
+
}
|
|
5648
|
+
const limit = parsedLimit === null ? Date.now() : parsedLimit;
|
|
5649
|
+
const deadlineOf = (r) => {
|
|
5650
|
+
const e = parseInterviewTime(r.end_time);
|
|
5651
|
+
if (e !== null) return { t: e, src: "end_time" };
|
|
5652
|
+
const s = parseInterviewTime(r.start_time);
|
|
5653
|
+
return { t: s, src: s === null ? "none" : "start_time" };
|
|
5654
|
+
};
|
|
5655
|
+
const overdue = ai.filter((r) => {
|
|
5656
|
+
const { t } = deadlineOf(r);
|
|
5657
|
+
return t !== null && t <= limit;
|
|
5658
|
+
});
|
|
5659
|
+
const st = (r) => String(r.union_status_key || r.union_status || "").trim();
|
|
5660
|
+
const notAttended = overdue.filter((r) => !ATTENDED_STATUS_RE.test(st(r)));
|
|
5661
|
+
const statusBreakdown = {};
|
|
5662
|
+
for (const r of overdue) {
|
|
5663
|
+
const k = st(r) || "(\u72B6\u6001\u4E3A\u7A7A)";
|
|
5664
|
+
statusBreakdown[k] = (statusBreakdown[k] || 0) + 1;
|
|
5665
|
+
}
|
|
5666
|
+
const deadlineSourceUsed = [...new Set(overdue.map((r) => deadlineOf(r).src))];
|
|
5667
|
+
const slim = (r) => {
|
|
5668
|
+
const dl = deadlineOf(r);
|
|
5669
|
+
return {
|
|
5670
|
+
candidate_name: r.candidate_name || null,
|
|
5671
|
+
position_name: r.position_name || null,
|
|
5672
|
+
interview_type_key: tp(r) || null,
|
|
5673
|
+
interview_session: r.interview_session || null,
|
|
5674
|
+
interview_rounds: r.interview_rounds || null,
|
|
5675
|
+
start_time: r.start_time || null,
|
|
5676
|
+
end_time: r.end_time || null,
|
|
5677
|
+
deadline: fmtInterviewTime(dl.t),
|
|
5678
|
+
deadlineSource: dl.src,
|
|
5679
|
+
union_status_key: st(r) || null,
|
|
5680
|
+
subject: r.subject || null,
|
|
5681
|
+
interviewer: cleanInterviewer(r.interviewer),
|
|
5682
|
+
mobile: r.mobile || null,
|
|
5683
|
+
// 🔴 type=interview 的 talent_id 放的是**候选人姓名**不是 id(已知口径,见聚才林
|
|
5684
|
+
// recruit-read.md);下游编排一律用 candidate_manage_id / form_data_id,故此处不透传 talent_id。
|
|
5685
|
+
candidate_manage_id: r.candidate_manage_id || null,
|
|
5686
|
+
form_data_id: r.form_data_id || null
|
|
5687
|
+
};
|
|
5688
|
+
};
|
|
5689
|
+
const total = base.total;
|
|
5690
|
+
if (total !== null && total !== void 0 && scanned < Number(total)) {
|
|
5691
|
+
notes.push(`\u672C\u6B21\u4EC5\u626B\u63CF ${scanned}/${total} \u6761\u9762\u8BD5\u8BB0\u5F55\uFF0C\u53EF\u80FD\u4ECD\u6709\u672A\u8986\u76D6\u7684\u9080\u7EA6\uFF1B\u53EF\u52A0\u5927 maxPages \u540E\u91CD\u67E5`);
|
|
5692
|
+
}
|
|
5693
|
+
notes.push("\u300C\u672A\u9762\u8BD5\u300D\u5224\u636E\uFF1AAI \u9762\u8BD5 + \u622A\u6B62\u65F6\u95F4\u5DF2\u8FC7 + \u72B6\u6001\u672A\u547D\u4E2D\u300C\u5DF2\u5B8C\u6210/\u5DF2\u53CD\u9988/\u5F85\u53CD\u9988/\u5DF2\u9762\u8BD5/\u5DF2\u901A\u8FC7/\u5DF2\u62D2\u7EDD/\u5DF2\u53D6\u6D88/\u5DF2\u4F5C\u5E9F/\u5DF2\u5931\u6548/\u9762\u8BD5\u4E2D\u300D");
|
|
5694
|
+
if (deadlineSourceUsed.length && !deadlineSourceUsed.includes("end_time")) {
|
|
5695
|
+
notes.push("\u672C\u73AF\u5883\u9762\u8BD5\u5217\u8868\u4E0D\u8FD4\u56DE\u9080\u7EA6\u622A\u6B62\u65F6\u95F4\uFF08end_time\uFF09\uFF0C\u5DF2\u56DE\u9000\u7528\u9762\u8BD5\u5F00\u59CB\u65F6\u95F4\uFF08start_time\uFF09\u5224\u5B9A\u662F\u5426\u8D85\u671F\uFF0C\u8BE6\u89C1\u6BCF\u884C deadlineSource");
|
|
5696
|
+
}
|
|
5697
|
+
notes.push("\u9762\u8BD5\u72B6\u6001\u7531 E10 \u8C03\u5EA6\u4EFB\u52A1\u5B9A\u65F6\u540C\u6B65\uFF08\u975E\u5B9E\u65F6\uFF09\uFF0C\u521A\u8FC7\u622A\u6B62\u65F6\u95F4\u7684\u9080\u7EA6\u53EF\u80FD\u6709\u51E0\u5206\u949F\u5EF6\u8FDF\uFF0C\u4EE5\u7CFB\u7EDF\u72B6\u6001\u4E3A\u51C6");
|
|
5698
|
+
const resolvedListId = String(args.listId || base.listId || "");
|
|
5699
|
+
const listUrl = resolvedListId ? baseUrl + "/sp/ebdfpage/list/" + resolvedListId : null;
|
|
5700
|
+
return {
|
|
5701
|
+
env: new URL(baseUrl).hostname,
|
|
5702
|
+
currentUser: me || null,
|
|
5703
|
+
initiatorField: initiatorField || null,
|
|
5704
|
+
includeAllInitiators: includeAll,
|
|
5705
|
+
scanned,
|
|
5706
|
+
deadlineBefore: fmtInterviewTime(limit),
|
|
5707
|
+
deadlineSource: deadlineSourceUsed,
|
|
5708
|
+
summary: {
|
|
5709
|
+
initiatedByMe: includeAll ? rows.length : mine.length,
|
|
5710
|
+
aiInterview: ai.length,
|
|
5711
|
+
deadlinePassed: overdue.length,
|
|
5712
|
+
notAttended: notAttended.length
|
|
5713
|
+
},
|
|
5714
|
+
statusBreakdown,
|
|
5715
|
+
rows: notAttended.map(slim),
|
|
5716
|
+
listUrl,
|
|
5717
|
+
listLocateLink: listUrl ? { title: "\u6253\u5F00\u6211\u53D1\u8D77\u7684\u9762\u8BD5\u5217\u8868", url: listUrl } : null,
|
|
5718
|
+
agentNote: "\u4EA7\u7269 = \u7EDF\u8BA1\u7ED3\u8BBA + \u4E00\u4E2A Markdown \u94FE\u63A5\uFF08listLocateLink\uFF09\u3002\u82E5\u6280\u80FD\u300C\u56FA\u5B9A\u53C2\u6570\u8868\u300D\u914D\u7F6E\u4E86\u672C\u79DF\u6237\u7684\u56FA\u5B9A\u9875\u9762\u8DEF\u7531\uFF0C\u6309 recruit-output-links.md \u8986\u76D6\u89C4\u5219\u66FF\u6362 path \u6BB5\uFF08origin \u53D6\u81EA listUrl\uFF09\uFF1B\u8C03\u7528\u65F6\u76F4\u63A5\u4F20 listId \u66F4\u7A33\u3002\u4E0D\u8F93\u51FA\u534A\u622A\u94FE\u63A5\u3002",
|
|
5719
|
+
note: notes.join("\uFF1B")
|
|
5720
|
+
};
|
|
5721
|
+
}
|
|
5467
5722
|
var listInput = {
|
|
5468
5723
|
type: { type: "string", enum: ["demand", "position", "entry", "offer", "interview", "candidate"], description: "\u5217\u8868\u7C7B\u578B" },
|
|
5469
5724
|
pageSize: { type: "integer", minimum: 1, maximum: 200, description: "\u6BCF\u9875\u884C\u6570\uFF08\u9ED8\u8BA4 10\uFF1BfeedbackTodo \u9ED8\u8BA4 200\uFF09" },
|
|
@@ -5501,6 +5756,32 @@ var listOperations = [
|
|
|
5501
5756
|
maxPages: listInput.maxPages
|
|
5502
5757
|
}, {}),
|
|
5503
5758
|
handler: async (args, env) => rsSuccess("recruit-stage.interview.feedbackTodo", await runList(env, { ...args, type: "interview" }, true))
|
|
5759
|
+
},
|
|
5760
|
+
{
|
|
5761
|
+
name: "recruit-stage.interview.notAttended",
|
|
5762
|
+
resource: "recruit.interview",
|
|
5763
|
+
method: "query",
|
|
5764
|
+
action: "interview.notAttended",
|
|
5765
|
+
summary: "\u6211\u53D1\u8D77\u7684 AI \u9762\u8BD5\u9080\u7EA6\u4E2D\u300C\u5230\u622A\u6B62\u65F6\u95F4\u4ECD\u672A\u9762\u8BD5\u300D\u7684\u4EBA\u5458\u7EDF\u8BA1\uFF08\u5168\u5C40\u6C47\u603B\u63D0\u9192\uFF09\uFF1A\u8FD4\u56DE\u672A\u9762\u8BD5\u4EBA\u6570\u3001\u622A\u6B62\u65F6\u95F4\u5DF2\u8FC7\u7684\u72B6\u6001\u5206\u5E03\u3001\u4EBA\u5458\u660E\u7EC6\uFF0C\u4EE5\u53CA\u300C\u6211\u53D1\u8D77\u7684\u9762\u8BD5\u5217\u8868\u300D\u9875\u9762\u94FE\u63A5",
|
|
5766
|
+
capability: "recruit.interview.notAttended",
|
|
5767
|
+
risk: "read",
|
|
5768
|
+
inputSchema: schemaOf({
|
|
5769
|
+
pageSize: listInput.pageSize,
|
|
5770
|
+
maxPages: listInput.maxPages,
|
|
5771
|
+
listId: {
|
|
5772
|
+
type: "string",
|
|
5773
|
+
description: "\u300C\u6211\u53D1\u8D77\u7684\u9762\u8BD5\u5217\u8868\u300D\u9875\u9762 id\uFF0C\u4EC5\u7528\u4E8E\u4EA7\u51FA\u67E5\u770B\u94FE\u63A5\u3002\u4E0D\u4F20\u5219\u56DE\u9000\u8FD0\u884C\u65F6\u89E3\u6790\u7684\u300C\u9762\u8BD5\u7BA1\u7406\u300D\u5217\u8868 id\u3002CLI \u5185\u4E0D\u5199\u6B7B\u4EFB\u4F55\u79DF\u6237\u4E13\u5C5E id\uFF1A\u79DF\u6237\u56FA\u5B9A\u9875\u9762\u5730\u5740\u7531\u6280\u80FD\u4FA7\uFF08SKILL.md \u56FA\u5B9A\u53C2\u6570\u8868\uFF09\u4F20\u5165"
|
|
5774
|
+
},
|
|
5775
|
+
deadlineBefore: {
|
|
5776
|
+
type: "string",
|
|
5777
|
+
description: "\u53EA\u7EDF\u8BA1\u622A\u6B62\u65F6\u95F4\u65E9\u4E8E\u8BE5\u65F6\u523B\u7684\u9080\u7EA6\uFF08yyyy-MM-dd HH:mm \u6216 ISO\uFF09\uFF1B\u9ED8\u8BA4\u5F53\u524D\u65F6\u95F4"
|
|
5778
|
+
},
|
|
5779
|
+
includeAllInitiators: {
|
|
5780
|
+
type: "boolean",
|
|
5781
|
+
description: "true=\u4E0D\u6309\u300C\u6211\u53D1\u8D77\u7684\u300D\u8FC7\u6EE4\uFF0C\u7EDF\u8BA1\u5168\u90E8 AI \u9762\u8BD5\u9080\u7EA6\uFF08\u53D1\u8D77\u4EBA\u5B57\u6BB5\u89E3\u6790\u4E0D\u5230\u65F6\u7684\u515C\u5E95\uFF09"
|
|
5782
|
+
}
|
|
5783
|
+
}, {}),
|
|
5784
|
+
handler: async (args, env) => rsSuccess("recruit-stage.interview.notAttended", await runInterviewNotAttended(env, args))
|
|
5504
5785
|
}
|
|
5505
5786
|
];
|
|
5506
5787
|
|
|
@@ -5641,6 +5922,295 @@ async function handler(args, env) {
|
|
|
5641
5922
|
});
|
|
5642
5923
|
return rsSuccess("recruit-stage.candidate.search", out);
|
|
5643
5924
|
}
|
|
5925
|
+
var FALLBACK_TAG_FIELDS = { public: "field_11", private: "field_12" };
|
|
5926
|
+
var SCAN_PAGE_SIZE = 100;
|
|
5927
|
+
var NO_SUCH_TAG = "__RT_TAG_NOT_EXIST__";
|
|
5928
|
+
function clampInt(v, min, max, fallback) {
|
|
5929
|
+
const n = Number(v);
|
|
5930
|
+
if (!Number.isFinite(n)) return fallback;
|
|
5931
|
+
return Math.min(max, Math.max(min, Math.trunc(n)));
|
|
5932
|
+
}
|
|
5933
|
+
function normTag(s) {
|
|
5934
|
+
return String(s == null ? "" : s).trim().toLowerCase();
|
|
5935
|
+
}
|
|
5936
|
+
async function resolveTagFields(host, listId) {
|
|
5937
|
+
let publicKey = FALLBACK_TAG_FIELDS.public;
|
|
5938
|
+
let privateKey = FALLBACK_TAG_FIELDS.private;
|
|
5939
|
+
let fromConfig = false;
|
|
5940
|
+
try {
|
|
5941
|
+
const r = await host.request({
|
|
5942
|
+
path: "/api/ebuilder/form/listSearch/getListSearch/" + encodeURIComponent(listId),
|
|
5943
|
+
method: "GET"
|
|
5944
|
+
});
|
|
5945
|
+
const d = r?.data || {};
|
|
5946
|
+
for (const row of Array.isArray(d.layout) ? d.layout : []) {
|
|
5947
|
+
for (const it of Array.isArray(row) ? row : []) {
|
|
5948
|
+
if (!it || !it.id) continue;
|
|
5949
|
+
const raw = String(it.id);
|
|
5950
|
+
const key = raw.indexOf("field_") === 0 ? raw : "field_" + raw;
|
|
5951
|
+
const label = String(it.label || "");
|
|
5952
|
+
if (label === "\u516C\u5171\u6807\u7B7E") {
|
|
5953
|
+
publicKey = key;
|
|
5954
|
+
fromConfig = true;
|
|
5955
|
+
} else if (label === "\u6211\u7684\u6807\u7B7E") {
|
|
5956
|
+
privateKey = key;
|
|
5957
|
+
fromConfig = true;
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
}
|
|
5961
|
+
} catch {
|
|
5962
|
+
}
|
|
5963
|
+
return { publicKey, privateKey, fromConfig };
|
|
5964
|
+
}
|
|
5965
|
+
function buildTagCond(ids, keys, mode) {
|
|
5966
|
+
const groups = [];
|
|
5967
|
+
const pub = ids.filter((x) => (x.type ?? 0) === 0).map((x) => String(x.id));
|
|
5968
|
+
const priv = ids.filter((x) => (x.type ?? 0) === 1).map((x) => String(x.id));
|
|
5969
|
+
if (pub.length) groups.push({ key: keys.publicKey, ids: pub });
|
|
5970
|
+
if (priv.length) groups.push({ key: keys.privateKey, ids: priv });
|
|
5971
|
+
if (!groups.length) groups.push({ key: keys.publicKey, ids: pub });
|
|
5972
|
+
const csf = {};
|
|
5973
|
+
const gf = {};
|
|
5974
|
+
for (const g of groups) {
|
|
5975
|
+
csf[g.key] = mode === "all" ? g.ids.map((id) => ({ [g.key]: [id], [g.key + "_condition_type"]: "in" })) : [{ [g.key]: g.ids, [g.key + "_condition_type"]: "in" }];
|
|
5976
|
+
gf[g.key] = g.ids;
|
|
5977
|
+
}
|
|
5978
|
+
return { csf, gf };
|
|
5979
|
+
}
|
|
5980
|
+
function tagsOfRow(disp) {
|
|
5981
|
+
const names = [];
|
|
5982
|
+
const ids = [];
|
|
5983
|
+
for (const key of ["batchpubtags", "batchmytags"]) {
|
|
5984
|
+
const arr = disp && disp[key];
|
|
5985
|
+
if (Array.isArray(arr)) {
|
|
5986
|
+
for (const t of arr) {
|
|
5987
|
+
if (!t) continue;
|
|
5988
|
+
if (typeof t === "object") {
|
|
5989
|
+
const n = String(t.name || t.label || t.text || "").trim();
|
|
5990
|
+
if (n) names.push(n);
|
|
5991
|
+
if (t.id != null) ids.push(String(t.id));
|
|
5992
|
+
} else {
|
|
5993
|
+
const n = String(t).trim();
|
|
5994
|
+
if (n) names.push(n);
|
|
5995
|
+
}
|
|
5996
|
+
}
|
|
5997
|
+
} else if (typeof arr === "string" && arr) {
|
|
5998
|
+
for (const n of arr.split(/[、,,;;/\s|]+/)) if (n.trim()) names.push(n.trim());
|
|
5999
|
+
}
|
|
6000
|
+
}
|
|
6001
|
+
return { names, ids };
|
|
6002
|
+
}
|
|
6003
|
+
async function handlerSearchByTag(args, env) {
|
|
6004
|
+
const host = env.host;
|
|
6005
|
+
const session = await host.getSession();
|
|
6006
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
6007
|
+
const cache = await env.recruitContext();
|
|
6008
|
+
const talent = cache.lists?.talent;
|
|
6009
|
+
const listId = talent?.listId;
|
|
6010
|
+
const objId = cache.forms?.talent_pool?.objId;
|
|
6011
|
+
if (!listId || !objId) {
|
|
6012
|
+
throw rsFail("\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C\u4EBA\u624D\u5E93\u300D\u83DC\u5355\u6216\u4EBA\u624D\u5E93\u8868\u5355\uFF0C\u65E0\u6CD5\u6309\u6807\u7B7E\u641C\u7D22\u4EBA\u624D\u3002\u8BF7\u786E\u8BA4 CLI \u5DF2\u767B\u5F55\u76EE\u6807\u73AF\u5883\u4E14\u8BE5\u73AF\u5883\u5DF2\u90E8\u7F72\u62DB\u8058\u5E94\u7528\u3002");
|
|
6013
|
+
}
|
|
6014
|
+
const wanted = (Array.isArray(args.tags) ? args.tags : [args.tags]).map((x) => String(x == null ? "" : x).trim()).filter(Boolean);
|
|
6015
|
+
if (!wanted.length) throw rsFail('\u8BF7\u63D0\u4F9B\u8981\u641C\u7D22\u7684\u6807\u7B7E\u540D\uFF0C\u4F8B\u5982\uFF1A{"tags":["985"]}\u3002');
|
|
6016
|
+
const match = args.match === "all" ? "all" : "any";
|
|
6017
|
+
const pageSize = clampInt(args.pageSize, 1, 100, 20);
|
|
6018
|
+
const current = clampInt(args.current, 1, 1e4, 1);
|
|
6019
|
+
const maxScan = clampInt(args.maxScan, 100, 1e4, 2e3);
|
|
6020
|
+
const rt = await resolveTags(host, wanted);
|
|
6021
|
+
const resolved = rt.resolved || [];
|
|
6022
|
+
const missing = rt.missing || [];
|
|
6023
|
+
if (!resolved.length) {
|
|
6024
|
+
return rsSuccess("recruit-stage.candidate.searchByTag", {
|
|
6025
|
+
env: new URL(baseUrl).hostname,
|
|
6026
|
+
wanted,
|
|
6027
|
+
match,
|
|
6028
|
+
resolved: [],
|
|
6029
|
+
missing,
|
|
6030
|
+
via: "none",
|
|
6031
|
+
total: 0,
|
|
6032
|
+
countFrom: "local",
|
|
6033
|
+
current,
|
|
6034
|
+
pageSize,
|
|
6035
|
+
rows: []
|
|
6036
|
+
});
|
|
6037
|
+
}
|
|
6038
|
+
const keys = await resolveTagFields(host, String(listId));
|
|
6039
|
+
let ledgerObjId = String(objId);
|
|
6040
|
+
try {
|
|
6041
|
+
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: { listId: String(listId) } });
|
|
6042
|
+
if (li?.data?.objid) ledgerObjId = String(li.data.objid);
|
|
6043
|
+
} catch {
|
|
6044
|
+
}
|
|
6045
|
+
const listPath = "/api/ebuilder/form/list/getListDatas?passid=" + ledgerObjId + "&cid=" + ledgerObjId;
|
|
6046
|
+
const countPath = "/api/ebuilder/form/list/getListDataCount?passid=" + ledgerObjId + "&cid=" + ledgerObjId;
|
|
6047
|
+
const headers = { ebBusinessId: listId };
|
|
6048
|
+
const mkBody = (page2, size, o) => {
|
|
6049
|
+
const b = {
|
|
6050
|
+
current: page2,
|
|
6051
|
+
pageSize: size,
|
|
6052
|
+
requiredMatch: 1,
|
|
6053
|
+
mapResult: "1",
|
|
6054
|
+
recheckQuery: "1",
|
|
6055
|
+
searchParamData: {
|
|
6056
|
+
type: o.type || "and",
|
|
6057
|
+
searchType: "3",
|
|
6058
|
+
commonSearchFields: o.csf || {},
|
|
6059
|
+
groupFields: o.gf || {},
|
|
6060
|
+
quickSearchFields: {}
|
|
6061
|
+
},
|
|
6062
|
+
listId,
|
|
6063
|
+
cusMenuId: talent.cusMenuId,
|
|
6064
|
+
urlPageTitle: "\u4EBA\u624D\u5E93",
|
|
6065
|
+
menuName: talent.menuName || "\u4EBA\u624D\u7BA1\u7406",
|
|
6066
|
+
isFollow: 0,
|
|
6067
|
+
isShareToMe: 0,
|
|
6068
|
+
filterCondition: {},
|
|
6069
|
+
browser: "Chrome",
|
|
6070
|
+
terminal: "PC"
|
|
6071
|
+
};
|
|
6072
|
+
if (o.tableuid) b.tableuid = o.tableuid;
|
|
6073
|
+
return b;
|
|
6074
|
+
};
|
|
6075
|
+
const fetchList = (body) => host.request({ path: listPath, body, headers });
|
|
6076
|
+
const probeCond = buildTagCond([{ id: NO_SUCH_TAG, type: 0 }], keys, "any");
|
|
6077
|
+
const channels = [
|
|
6078
|
+
{ kind: "csf" },
|
|
6079
|
+
{ kind: "csf", tableuid: randHex32() },
|
|
6080
|
+
...match === "any" ? [{ kind: "gf", tableuid: randHex32() }, { kind: "gf" }] : []
|
|
6081
|
+
];
|
|
6082
|
+
let channel = null;
|
|
6083
|
+
for (const ch of channels) {
|
|
6084
|
+
const body = mkBody(1, 2, ch.kind === "csf" ? { csf: probeCond.csf, tableuid: ch.tableuid } : { gf: probeCond.gf, tableuid: ch.tableuid });
|
|
6085
|
+
const r = await fetchList(body).catch(() => null);
|
|
6086
|
+
if (r && (r?.data?.data || []).length === 0) {
|
|
6087
|
+
channel = ch;
|
|
6088
|
+
break;
|
|
6089
|
+
}
|
|
6090
|
+
}
|
|
6091
|
+
if (channel && resolved.length) {
|
|
6092
|
+
const cond = buildTagCond(resolved, keys, match);
|
|
6093
|
+
const type = match === "all" ? "and" : Object.keys(cond.csf).length > 1 ? "or" : "and";
|
|
6094
|
+
const body = mkBody(current, pageSize, channel.kind === "csf" ? { csf: cond.csf, tableuid: channel.tableuid, type } : { gf: cond.gf, tableuid: channel.tableuid, type: "and" });
|
|
6095
|
+
const cntBody = { ...body };
|
|
6096
|
+
delete cntBody.current;
|
|
6097
|
+
delete cntBody.pageSize;
|
|
6098
|
+
const [resp2, cnt] = await Promise.all([
|
|
6099
|
+
fetchList(body),
|
|
6100
|
+
host.request({ path: countPath, body: cntBody, headers }).catch(() => null)
|
|
6101
|
+
]);
|
|
6102
|
+
const raw = resp2?.data?.data || [];
|
|
6103
|
+
const dispRows = Array.isArray(resp2?.data?.displayData) && resp2.data.displayData.length ? resp2.data.displayData : raw;
|
|
6104
|
+
const serverTotal = Number(cnt?.data?.total);
|
|
6105
|
+
const inlineNames = dispRows.map((d) => parsePortalName(d.creator));
|
|
6106
|
+
const pureIds = [];
|
|
6107
|
+
dispRows.forEach((d, i) => {
|
|
6108
|
+
if (inlineNames[i] == null && d.creator != null && ID_RE.test(String(d.creator).trim())) {
|
|
6109
|
+
pureIds.push(String(d.creator).trim());
|
|
6110
|
+
}
|
|
6111
|
+
});
|
|
6112
|
+
const idNameMap = await resolvePureIds(host, pureIds);
|
|
6113
|
+
const statusMap = cache.options?.recruit_status || {};
|
|
6114
|
+
const dictNameMap = {};
|
|
6115
|
+
for (const item of cache.dict?.raw || []) {
|
|
6116
|
+
if (item.option_id && item.selection_name) dictNameMap[item.option_id] = item.selection_name;
|
|
6117
|
+
}
|
|
6118
|
+
const rows = dispRows.map((d, i) => {
|
|
6119
|
+
let creator = inlineNames[i];
|
|
6120
|
+
if (creator == null) {
|
|
6121
|
+
const rawCreator = d.creator != null ? String(d.creator).trim() : null;
|
|
6122
|
+
creator = (rawCreator != null && ID_RE.test(rawCreator) ? idNameMap[rawCreator] || rawCreator : rawCreator) || null;
|
|
6123
|
+
}
|
|
6124
|
+
return {
|
|
6125
|
+
talentId: d.form_data_id || d.id || raw[i]?.id || null,
|
|
6126
|
+
name: d.candidate_name || d.name || null,
|
|
6127
|
+
mobile: d.telephone || null,
|
|
6128
|
+
channel: dictNameMap[d.channel] || d.channel || null,
|
|
6129
|
+
status: statusMap[d.recruit_status] || d.recruit_status || null,
|
|
6130
|
+
creator,
|
|
6131
|
+
createTime: d.create_time || null,
|
|
6132
|
+
tags: resolved.map((t) => t.name)
|
|
6133
|
+
};
|
|
6134
|
+
});
|
|
6135
|
+
return rsSuccess("recruit-stage.candidate.searchByTag", {
|
|
6136
|
+
env: new URL(baseUrl).hostname,
|
|
6137
|
+
wanted,
|
|
6138
|
+
match,
|
|
6139
|
+
resolved: resolved.map((t) => ({ name: t.name, type: (t.type ?? 0) === 0 ? "\u516C\u5171\u6807\u7B7E" : "\u6211\u7684\u6807\u7B7E" })),
|
|
6140
|
+
missing,
|
|
6141
|
+
via: channel.kind,
|
|
6142
|
+
tagFieldsFromConfig: keys.fromConfig,
|
|
6143
|
+
total: Number.isFinite(serverTotal) && serverTotal >= 0 ? serverTotal : rows.length,
|
|
6144
|
+
countFrom: Number.isFinite(serverTotal) && serverTotal >= 0 ? "server" : "local",
|
|
6145
|
+
current,
|
|
6146
|
+
pageSize,
|
|
6147
|
+
rows
|
|
6148
|
+
});
|
|
6149
|
+
}
|
|
6150
|
+
const baseline = await fetchList(mkBody(1, SCAN_PAGE_SIZE, {}));
|
|
6151
|
+
const baseDisp = baseline?.data?.displayData || [];
|
|
6152
|
+
const hasTagColumn = baseDisp.some((d) => Array.isArray(d?.batchpubtags) || Array.isArray(d?.batchmytags));
|
|
6153
|
+
if (!hasTagColumn) {
|
|
6154
|
+
throw rsFail(resolved.length ? "\u5F53\u524D\u73AF\u5883\u7684\u670D\u52A1\u7AEF\u672A\u542F\u7528\u6309\u6807\u7B7E\u7B5B\u9009\uFF0C\u4E14\u4EBA\u624D\u5E93\u5217\u8868\u672A\u8FD4\u56DE\u6807\u7B7E\u5217\uFF0C\u65E0\u6CD5\u6309\u6807\u7B7E\u641C\u7D22\u3002\u8BF7\u5728 E10 \u9875\u9762\u786E\u8BA4\u6807\u7B7E\u7B5B\u9009\u80FD\u529B\uFF0C\u6216\u6539\u7528\u59D3\u540D/\u624B\u673A\u53F7\u641C\u7D22\u3002" : "\u5F53\u524D\u73AF\u5883\u6CA1\u6709\u627E\u5230\u8FD9\u4E9B\u6807\u7B7E\uFF0C\u65E0\u6CD5\u6309\u6807\u7B7E\u641C\u7D22\u3002\u53EF\u5148\u786E\u8BA4\u6807\u7B7E\u540D\u79F0\u662F\u5426\u6B63\u786E\u3002");
|
|
6155
|
+
}
|
|
6156
|
+
const wantedNorm = new Set([...wanted, ...resolved.map((t) => t.name)].map(normTag));
|
|
6157
|
+
const wantedIds = new Set(resolved.map((t) => String(t.id)));
|
|
6158
|
+
const hits = [];
|
|
6159
|
+
const tagPool = /* @__PURE__ */ new Map();
|
|
6160
|
+
let scanned = 0;
|
|
6161
|
+
let truncated = false;
|
|
6162
|
+
let page = 1;
|
|
6163
|
+
let resp = baseline;
|
|
6164
|
+
while (true) {
|
|
6165
|
+
const raw = resp?.data?.data || [];
|
|
6166
|
+
const dispRows = Array.isArray(resp?.data?.displayData) && resp.data.displayData.length ? resp.data.displayData : raw;
|
|
6167
|
+
if (!raw.length) break;
|
|
6168
|
+
for (let i = 0; i < raw.length; i += 1) {
|
|
6169
|
+
const d = dispRows[i] || {};
|
|
6170
|
+
const t = tagsOfRow(d);
|
|
6171
|
+
for (const n of t.names) tagPool.set(n, (tagPool.get(n) || 0) + 1);
|
|
6172
|
+
const byName = t.names.filter((n) => wantedNorm.has(normTag(n)));
|
|
6173
|
+
const byId = t.ids.filter((id) => wantedIds.has(id));
|
|
6174
|
+
const names = [.../* @__PURE__ */ new Set([...byName, ...resolved.filter((r) => byId.includes(String(r.id))).map((r) => r.name)])];
|
|
6175
|
+
const pass = match === "all" ? [...wantedNorm].every((n) => names.some((x) => normTag(x) === n)) : names.length > 0;
|
|
6176
|
+
if (pass) hits.push({ row: raw[i], disp: d, names });
|
|
6177
|
+
}
|
|
6178
|
+
scanned += raw.length;
|
|
6179
|
+
if (scanned >= maxScan) {
|
|
6180
|
+
truncated = raw.length >= SCAN_PAGE_SIZE;
|
|
6181
|
+
break;
|
|
6182
|
+
}
|
|
6183
|
+
if (raw.length < SCAN_PAGE_SIZE) break;
|
|
6184
|
+
page += 1;
|
|
6185
|
+
resp = await fetchList(mkBody(page, SCAN_PAGE_SIZE, {}));
|
|
6186
|
+
}
|
|
6187
|
+
const slice = hits.slice((current - 1) * pageSize, current * pageSize);
|
|
6188
|
+
return rsSuccess("recruit-stage.candidate.searchByTag", {
|
|
6189
|
+
env: new URL(baseUrl).hostname,
|
|
6190
|
+
wanted,
|
|
6191
|
+
match,
|
|
6192
|
+
resolved: resolved.map((t) => ({ name: t.name, type: (t.type ?? 0) === 0 ? "\u516C\u5171\u6807\u7B7E" : "\u6211\u7684\u6807\u7B7E" })),
|
|
6193
|
+
missing,
|
|
6194
|
+
via: "client",
|
|
6195
|
+
tagFieldsFromConfig: keys.fromConfig,
|
|
6196
|
+
total: hits.length,
|
|
6197
|
+
countFrom: "local",
|
|
6198
|
+
scanned,
|
|
6199
|
+
truncated,
|
|
6200
|
+
maxScan,
|
|
6201
|
+
availableHint: [...tagPool.entries()].sort((a, b) => b[1] - a[1] || String(a[0]).localeCompare(String(b[0]))).slice(0, 10).map(([name, count]) => ({ name, count })),
|
|
6202
|
+
current,
|
|
6203
|
+
pageSize,
|
|
6204
|
+
rows: slice.map((h) => ({
|
|
6205
|
+
talentId: h.disp.form_data_id || h.disp.id || h.row?.id || null,
|
|
6206
|
+
name: h.disp.candidate_name || h.disp.name || null,
|
|
6207
|
+
mobile: h.disp.telephone || null,
|
|
6208
|
+
creator: null,
|
|
6209
|
+
createTime: h.disp.create_time || null,
|
|
6210
|
+
tags: h.names
|
|
6211
|
+
}))
|
|
6212
|
+
});
|
|
6213
|
+
}
|
|
5644
6214
|
var searchOperations = [
|
|
5645
6215
|
{
|
|
5646
6216
|
name: "recruit-stage.candidate.search",
|
|
@@ -5657,6 +6227,23 @@ var searchOperations = [
|
|
|
5657
6227
|
current: { type: "integer", minimum: 1 }
|
|
5658
6228
|
}, {}),
|
|
5659
6229
|
handler
|
|
6230
|
+
},
|
|
6231
|
+
{
|
|
6232
|
+
name: "recruit-stage.candidate.searchByTag",
|
|
6233
|
+
resource: "recruit.candidate",
|
|
6234
|
+
method: "query",
|
|
6235
|
+
action: "candidate.searchByTag",
|
|
6236
|
+
summary: "\u6309\u6807\u7B7E\u540D\u641C\u7D22\u4EBA\u624D\uFF08\u652F\u6301\u591A\u4E2A\u6807\u7B7E\u3001any/all \u5339\u914D\uFF09\uFF1B\u6807\u7B7E\u540D\u8FD0\u884C\u65F6\u89E3\u6790\uFF0C\u670D\u52A1\u7AEF\u8FC7\u6EE4\u5148\u8D1F\u6837\u672C\u5224\u5B9A\u3001\u4E0D\u751F\u6548\u9000\u5BA2\u6237\u7AEF\u626B\u63CF\uFF1B\u5E26\u626B\u63CF\u4E0A\u9650\u4E0E\u622A\u65AD\u6807\u8BB0",
|
|
6237
|
+
capability: "recruit.candidate.searchByTag",
|
|
6238
|
+
risk: "read",
|
|
6239
|
+
inputSchema: schemaOf({
|
|
6240
|
+
tags: { type: "array", items: { type: "string" }, maxItems: 20, description: '\u89C4\u8303\u6807\u7B7E\u540D\uFF08\u522B\u540D\u5F52\u4E00\u7531\u6280\u80FD\u4FA7\u5B8C\u6210\uFF09\uFF1B\u5982 ["985"]\u3002\u4EE3\u7801\u540C\u65F6\u517C\u5BB9\u5355\u4E2A\u5B57\u7B26\u4E32' },
|
|
6241
|
+
match: { type: "string", enum: ["any", "all"], description: "\u4EFB\u4E00\u547D\u4E2D\uFF08\u9ED8\u8BA4 any\uFF09/ \u5168\u90E8\u547D\u4E2D\uFF08all\uFF0C\u8D70\u5BA2\u6237\u7AEF\u626B\u63CF\u4FDD\u8BC1\u4EA4\u96C6\u8BED\u4E49\uFF09" },
|
|
6242
|
+
pageSize: { type: "integer", minimum: 1, maximum: 100, description: "\u8FD4\u56DE\u6BCF\u9875\u6761\u6570\uFF0C\u9ED8\u8BA4 20" },
|
|
6243
|
+
current: { type: "integer", minimum: 1, description: "\u8FD4\u56DE\u9875\u7801\uFF0C\u9ED8\u8BA4 1" },
|
|
6244
|
+
maxScan: { type: "integer", minimum: 100, maximum: 1e4, description: "\u626B\u63CF\u884C\u6570\u786C\u4E0A\u9650\uFF0C\u9ED8\u8BA4 2000\uFF1B\u89E6\u9876 truncated=true\uFF0C\u4E0D\u8C0E\u62A5\u5168\u5E93\u547D\u4E2D\u6570" }
|
|
6245
|
+
}, { required: ["tags"] }),
|
|
6246
|
+
handler: handlerSearchByTag
|
|
5660
6247
|
}
|
|
5661
6248
|
];
|
|
5662
6249
|
|