weaver-work-cli 0.1.44 → 0.1.46
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 +9 -5
- package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
- package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
- package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
- package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
- package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-MCXQBD6N.js} +3 -3
- package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
- package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-4RWS2YYL.js} +5 -5
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-6AXKWFKG.js} +32 -12
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-6V5ZPKHV.js} +56 -12
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-76H3IKH6.js} +178 -37
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-AD46OMQK.js} +239 -41
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
- package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
- package/dist/chunks/{chunk-CWYGFU5B.js → chunk-GSZTA43P.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-IP4CWQCF.js} +11 -11
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-IRMIEDXN.js} +1 -1
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-JFAWZX53.js} +134 -13
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-OXHHJWNC.js} +1 -1
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-PSOMGA3U.js} +4 -4
- package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
- package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
- package/dist/chunks/{chunk-XHK4MDR5.js → chunk-UFIFZ4YC.js} +48 -14
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
- package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
- package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-H7EHQXYY.js} +2 -2
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
- package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
- package/dist/chunks/{create-flow-J22BO65E.js → create-flow-VRVJEOBX.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-SH2LM3NK.js} +648 -88
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-66FPSJDV.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-UH2TZBVA.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-CAKMMV7K.js} +3 -3
- package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
- package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
- package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
- package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
- package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
- package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
- package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
- package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
- package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-DD6ULZ3I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-VTBFW4HI.js} +12 -12
- package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
- package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
- package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
- package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-CAKZTUA7.js} +1343 -178
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-JVQBLFQ5.js} +10 -10
- package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
- package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
- package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-5U55FMXZ.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-IDETODCA.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/cmd/action.js +14 -10
- package/dist/index.js +30 -30
- package/dist/internal/e10/auth/commands.js +32 -0
- package/dist/internal/e10/auth/error-log.js +156 -26
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/context.js +12 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +19 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/ehr/host.js +2 -2
- package/dist/shortcuts/ehr/index.js +14 -3
- package/dist/shortcuts/ehr/manifest.js +5 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +44 -12
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +146 -43
- package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +154 -36
- package/dist/shortcuts/ehr/operations/recruit.js +196 -12
- package/dist/shortcuts/ehr/operations/registry.js +4 -0
- package/dist/shortcuts/ehr/operations.js +24 -0
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +274 -75
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +63 -11
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +38 -7
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/invitation.js +27 -4
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +356 -29
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +36 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +309 -67
- package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +310 -17
- package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
- package/dist/shortcuts/recruit-stage/shared.js +221 -24
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/docs/contract.md +1 -0
- package/docs/e10-auth.md +4 -2
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jucailin/SKILL.md +12 -3
- package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
- package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -91
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
- package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +55 -11
- package/skills/weaver-e10-meeting/SKILL.md +103 -11
- package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -11
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -8
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +23 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +11 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
|
@@ -3,6 +3,7 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
EHR_PAGES,
|
|
5
5
|
EhrCliError,
|
|
6
|
+
LIST_TYPES,
|
|
6
7
|
READ,
|
|
7
8
|
SCHEMA_DATE,
|
|
8
9
|
SCHEMA_ID,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
ehrSuccess,
|
|
28
29
|
ehrValidationError,
|
|
29
30
|
fetchListRows,
|
|
31
|
+
namesOf,
|
|
30
32
|
normalizePaged,
|
|
31
33
|
pickDefined,
|
|
32
34
|
recruitOperations,
|
|
@@ -37,9 +39,10 @@ import {
|
|
|
37
39
|
toNumber,
|
|
38
40
|
toPageQuery,
|
|
39
41
|
toPositiveInt
|
|
40
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-JFAWZX53.js";
|
|
41
43
|
import {
|
|
42
|
-
|
|
44
|
+
shouldReportPlatformError,
|
|
45
|
+
toPlatformError
|
|
43
46
|
} from "./chunk-6N4JPNFL.js";
|
|
44
47
|
import {
|
|
45
48
|
CONTINUATION_TTL_MS,
|
|
@@ -50,11 +53,11 @@ import {
|
|
|
50
53
|
createE10RequestRuntime,
|
|
51
54
|
isE10SessionExpiredResponse,
|
|
52
55
|
requireE10Session
|
|
53
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-6NXT4ICB.js";
|
|
54
57
|
import {
|
|
55
58
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
56
59
|
getActiveProfile
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-U6R6FZHD.js";
|
|
58
61
|
import {
|
|
59
62
|
isCliError,
|
|
60
63
|
toErrorEnvelope
|
|
@@ -244,7 +247,8 @@ function createEhrHost(ctx, dependencies = {}) {
|
|
|
244
247
|
form,
|
|
245
248
|
multipart,
|
|
246
249
|
headers: extraHeaders = {},
|
|
247
|
-
timeoutMs = 3e4
|
|
250
|
+
timeoutMs = 3e4,
|
|
251
|
+
skipBusinessCheck = false
|
|
248
252
|
} = request2;
|
|
249
253
|
assertPath(path);
|
|
250
254
|
const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 ? "GET" : "POST");
|
|
@@ -293,7 +297,7 @@ function createEhrHost(ctx, dependencies = {}) {
|
|
|
293
297
|
exitCode: 1
|
|
294
298
|
});
|
|
295
299
|
}
|
|
296
|
-
if (!isBusinessSuccess(response.value)) {
|
|
300
|
+
if (!skipBusinessCheck && !isBusinessSuccess(response.value)) {
|
|
297
301
|
throw new EhrCliError("api", "business_error", businessMessage(response.value), {
|
|
298
302
|
code: businessCode(response.value),
|
|
299
303
|
details: { code: businessCode(response.value), message: businessMessage(response.value) },
|
|
@@ -2283,6 +2287,11 @@ async function verifyLease2(args, action, env) {
|
|
|
2283
2287
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
2284
2288
|
throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
2285
2289
|
}
|
|
2290
|
+
const snap = lease.payload && typeof lease.payload === "object" ? lease.payload : {};
|
|
2291
|
+
for (const [k, v] of Object.entries(snap)) {
|
|
2292
|
+
if (k === "formId" || k === "objId" || k === "dataDetails") continue;
|
|
2293
|
+
if (args[k] === void 0 || args[k] === null || args[k] === "") args[k] = v;
|
|
2294
|
+
}
|
|
2286
2295
|
return lease;
|
|
2287
2296
|
}
|
|
2288
2297
|
function isNetworkError2(error) {
|
|
@@ -2295,22 +2304,19 @@ async function requireRecruitCache(env) {
|
|
|
2295
2304
|
return env.recruitContext.load(env.host);
|
|
2296
2305
|
}
|
|
2297
2306
|
function recruitTalentCardUrl(cache, baseUrl, talentId) {
|
|
2298
|
-
if (!
|
|
2299
|
-
const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
|
|
2300
|
-
return `${baseUrl.replace(/\/+$/, "")}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`;
|
|
2301
|
-
}
|
|
2302
|
-
function recruitSlideLocateUrl(cache, baseUrl, listKey, formKey, dataId) {
|
|
2303
|
-
const listId = cache.lists?.[listKey]?.listId;
|
|
2304
|
-
const objId = cache.forms?.[formKey]?.objId;
|
|
2305
|
-
if (!listId || !objId || !dataId || !cache.appId) return null;
|
|
2307
|
+
if (!talentId) return null;
|
|
2306
2308
|
const base = baseUrl.replace(/\/+$/, "");
|
|
2307
|
-
|
|
2309
|
+
if (cache.ebdDetailPageId) {
|
|
2310
|
+
const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
|
|
2311
|
+
return `${base}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`;
|
|
2312
|
+
}
|
|
2313
|
+
const objId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || "");
|
|
2314
|
+
return objId ? `${base}/sp/ebdfpage/card/0/${objId}/${talentId}` : null;
|
|
2308
2315
|
}
|
|
2309
|
-
function recruitOpenListUrl(cache, baseUrl, listKey
|
|
2316
|
+
function recruitOpenListUrl(cache, baseUrl, listKey) {
|
|
2310
2317
|
const menu = cache.lists?.[listKey];
|
|
2311
2318
|
if (!menu?.listId) return null;
|
|
2312
|
-
|
|
2313
|
-
return `${baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${menu.listId}${extra}`;
|
|
2319
|
+
return `${baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${menu.listId}`;
|
|
2314
2320
|
}
|
|
2315
2321
|
async function checkDuplicateByMobile(env, cache, mobile) {
|
|
2316
2322
|
const talent = cache.lists.talent;
|
|
@@ -2455,14 +2461,62 @@ async function getDsOptions(host, objId, fieldId, groupId) {
|
|
|
2455
2461
|
}
|
|
2456
2462
|
return map;
|
|
2457
2463
|
}
|
|
2458
|
-
async function resolvePersonId(host,
|
|
2464
|
+
async function resolvePersonId(host, _fieldId, keyword) {
|
|
2465
|
+
const kw = String(keyword || "").trim();
|
|
2466
|
+
if (!kw) return null;
|
|
2467
|
+
const formDatas = {
|
|
2468
|
+
status: [{ statusSelect: ["normal"] }],
|
|
2469
|
+
subcompany: [{ subcompanyOpt: "in" }],
|
|
2470
|
+
department: [{ departmentOpt: "in" }],
|
|
2471
|
+
role: [{ roleOpt: "in" }],
|
|
2472
|
+
position: [{ positionOpt: "in" }],
|
|
2473
|
+
superior: [{ superiorOpt: "in" }]
|
|
2474
|
+
};
|
|
2475
|
+
if (/@/.test(kw)) formDatas.email = [{ emailOpt: "in", emailInput: kw }];
|
|
2476
|
+
else if (/^\d{11}$/.test(kw)) formDatas.mobile = [{ mobileOpt: "in", mobileInput: kw }];
|
|
2477
|
+
else formDatas.username = [{ usernameOpt: "in", usernameInput: kw }];
|
|
2459
2478
|
const response = await host.request({
|
|
2460
|
-
path: "/api/
|
|
2461
|
-
body: {
|
|
2479
|
+
path: "/api/hrm/common/browser/data/resource",
|
|
2480
|
+
body: {
|
|
2481
|
+
browserMultiple: true,
|
|
2482
|
+
authWecahtBook: false,
|
|
2483
|
+
wxDepNeedConvertCount: 0,
|
|
2484
|
+
wxEmpNeedConvertCount: 0,
|
|
2485
|
+
wxTotalNeedConvertCount: 0,
|
|
2486
|
+
...formDatas,
|
|
2487
|
+
cmd: "all",
|
|
2488
|
+
formDatas,
|
|
2489
|
+
quickSearchDatas: {},
|
|
2490
|
+
type: "and",
|
|
2491
|
+
current: 1,
|
|
2492
|
+
pageSize: 200,
|
|
2493
|
+
containsNoneAccount: false,
|
|
2494
|
+
containsPartTimeEmployee: false,
|
|
2495
|
+
containsDls: false
|
|
2496
|
+
}
|
|
2462
2497
|
});
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2465
|
-
|
|
2498
|
+
const rows = (response?.data?.data ?? []).filter((r) => r && (r.id || r.value) && r.name);
|
|
2499
|
+
if (!rows.length) return null;
|
|
2500
|
+
const nameOf = (x) => String(x.name || "").trim();
|
|
2501
|
+
const idOf = (x) => String(x.id ?? x.value ?? "");
|
|
2502
|
+
const exact = rows.filter((r) => nameOf(r) === kw);
|
|
2503
|
+
if (exact.length === 1) return idOf(exact[0]) || null;
|
|
2504
|
+
if (exact.length > 1) throw ambiguousPerson(kw, exact);
|
|
2505
|
+
if (rows.length === 1) return idOf(rows[0]) || null;
|
|
2506
|
+
throw ambiguousPerson(kw, rows);
|
|
2507
|
+
}
|
|
2508
|
+
function ambiguousPerson(keyword, rows) {
|
|
2509
|
+
const candidates = rows.slice(0, 20).map((r) => ({
|
|
2510
|
+
id: String(r.id ?? r.value ?? ""),
|
|
2511
|
+
name: String(r.name ?? ""),
|
|
2512
|
+
department: String(r.department ?? ""),
|
|
2513
|
+
position: String(r.position ?? "")
|
|
2514
|
+
}));
|
|
2515
|
+
return ehrValidationError(
|
|
2516
|
+
"person_ambiguous",
|
|
2517
|
+
`\u4EBA\u5458\u300C${keyword}\u300D\u547D\u4E2D ${rows.length} \u4EBA\uFF0C\u8BF7\u6307\u660E\u5177\u4F53\u662F\u54EA\u4E00\u4F4D\uFF1A${candidates.map((c) => `${c.name}${c.department ? `\uFF08${c.department}\uFF09` : ""}`).join("\u3001")}`,
|
|
2518
|
+
{ candidates }
|
|
2519
|
+
);
|
|
2466
2520
|
}
|
|
2467
2521
|
async function saveFormData(host, params) {
|
|
2468
2522
|
const layoutId = params.layoutId || params.formId;
|
|
@@ -2691,12 +2745,14 @@ var candidateCreateApply = {
|
|
|
2691
2745
|
confirm: { const: true },
|
|
2692
2746
|
continuation: { type: "string", minLength: 1 }
|
|
2693
2747
|
},
|
|
2694
|
-
|
|
2748
|
+
// name/mobile 不再列入 required(2026-11-07):prepare 已把它们签进 continuation,
|
|
2749
|
+
// apply 只带 confirm + continuation 即可;仍传则用于与快照比对防偷改。
|
|
2750
|
+
{ required: ["confirm", "continuation"] }
|
|
2695
2751
|
),
|
|
2696
2752
|
handler: async (args, env) => {
|
|
2697
2753
|
requireConfirm2(args, "ehr.recruit.candidate.create.apply");
|
|
2698
|
-
const { name, mobile } = validateNameMobile(args.name, args.mobile);
|
|
2699
2754
|
const lease = await verifyLease2(args, "ehr.recruit.candidate.create.apply", env);
|
|
2755
|
+
const { name, mobile } = validateNameMobile(args.name, args.mobile);
|
|
2700
2756
|
const payload = lease.payload || {};
|
|
2701
2757
|
const channelName = args.channel !== void 0 && args.channel !== null && String(args.channel).trim() !== "" ? String(args.channel).trim() : null;
|
|
2702
2758
|
const currentFingerprint = fingerprint2({ name, mobile, channel: channelName, dataDetails: payload.dataDetails });
|
|
@@ -2782,7 +2838,7 @@ var candidateCreateApply = {
|
|
|
2782
2838
|
initTalentBatch: initMsg,
|
|
2783
2839
|
searchHint: `\u53EF\u7528 ehr.recruit.candidate.search \u6309 name=${name} \u6216 mobile=${mobile} \u56DE\u67E5`,
|
|
2784
2840
|
talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, newId),
|
|
2785
|
-
talentListLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, "talent"
|
|
2841
|
+
talentListLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, "talent")
|
|
2786
2842
|
});
|
|
2787
2843
|
}
|
|
2788
2844
|
};
|
|
@@ -2803,11 +2859,12 @@ var INTERVIEW_DATAKEYS = [
|
|
|
2803
2859
|
"interview_location",
|
|
2804
2860
|
"notice_mould"
|
|
2805
2861
|
];
|
|
2806
|
-
function defaultInterviewWindow() {
|
|
2862
|
+
function defaultInterviewWindow(isAI = false) {
|
|
2807
2863
|
const pad = (n) => String(n).padStart(2, "0");
|
|
2808
2864
|
const now = /* @__PURE__ */ new Date();
|
|
2809
2865
|
const fmt = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
2810
|
-
const
|
|
2866
|
+
const spanMs = isAI ? 7 * 24 * 60 * 60 * 1e3 : 60 * 60 * 1e3;
|
|
2867
|
+
const end = new Date(now.getTime() + spanMs);
|
|
2811
2868
|
return { start: fmt(now), end: fmt(end) };
|
|
2812
2869
|
}
|
|
2813
2870
|
async function resolveCurrentUserForWrite(host) {
|
|
@@ -2988,7 +3045,7 @@ async function buildInterviewPlan(env, cache, args) {
|
|
|
2988
3045
|
if (interviewerInput) {
|
|
2989
3046
|
interviewerId = await resolvePersonId(host, fieldIdOf("interviewer"), interviewerInput);
|
|
2990
3047
|
if (!interviewerId) {
|
|
2991
|
-
throw ehrValidationError("interviewer_not_found", `\u9762\u8BD5\u5B98\u300C${interviewerInput}\u300D\
|
|
3048
|
+
throw ehrValidationError("interviewer_not_found", `\u9762\u8BD5\u5B98\u300C${interviewerInput}\u300D\u5728\u4EBA\u5458\u5E93\u4E2D\u67E5\u4E0D\u5230\uFF08\u53EF\u80FD\u59D3\u540D\u5199\u9519\u3001\u4E0D\u5728\u672C\u79DF\u6237\uFF0C\u6216\u4E0D\u662F\u5728\u804C\u4EBA\u5458\uFF09`);
|
|
2992
3049
|
}
|
|
2993
3050
|
} else {
|
|
2994
3051
|
const me = await resolveCurrentUserForWrite(host);
|
|
@@ -3046,7 +3103,7 @@ async function buildInterviewPlan(env, cache, args) {
|
|
|
3046
3103
|
throw ehrValidationError("email_invalid", `\u5019\u9009\u4EBA\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E\uFF1A${email}`);
|
|
3047
3104
|
}
|
|
3048
3105
|
}
|
|
3049
|
-
const window = defaultInterviewWindow();
|
|
3106
|
+
const window = defaultInterviewWindow(isAI);
|
|
3050
3107
|
const start = typeof args.startTime === "string" && args.startTime.trim() ? args.startTime.trim() : window.start;
|
|
3051
3108
|
const end = typeof args.endTime === "string" && args.endTime.trim() ? args.endTime.trim() : window.end;
|
|
3052
3109
|
if (!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(start) || !/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(end)) {
|
|
@@ -3074,6 +3131,7 @@ async function buildInterviewPlan(env, cache, args) {
|
|
|
3074
3131
|
candidateName: candidate.name,
|
|
3075
3132
|
positionName: candidate.positionName,
|
|
3076
3133
|
interviewTime: `${start} ~ ${end}`,
|
|
3134
|
+
timeFieldIds: { start: fieldIdOf("start_time"), end: fieldIdOf("end_time") },
|
|
3077
3135
|
interviewer,
|
|
3078
3136
|
email: email || void 0,
|
|
3079
3137
|
mobile: mobile || void 0,
|
|
@@ -3155,14 +3213,28 @@ var interviewArrangeApply = {
|
|
|
3155
3213
|
requiresConfirmation: true,
|
|
3156
3214
|
inputSchema: schemaOf(
|
|
3157
3215
|
{ ...interviewArrangeSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
|
|
3158
|
-
|
|
3216
|
+
// 业务参数(talentId/interviewer)已由 prepare 签进 continuation,apply 只需两项;
|
|
3217
|
+
// 显式传仍作数(与快照比对,用于防偷改)。
|
|
3218
|
+
{ required: ["confirm", "continuation"] }
|
|
3159
3219
|
),
|
|
3160
3220
|
handler: async (args, env) => {
|
|
3161
3221
|
requireConfirm2(args, "ehr.recruit.candidate.interview.arrange.apply");
|
|
3162
3222
|
const lease = await verifyLease2(args, "ehr.recruit.candidate.interview.arrange.apply", env);
|
|
3163
3223
|
const payload = lease.payload || {};
|
|
3164
3224
|
const cache = await requireRecruitCache(env);
|
|
3225
|
+
const explicitTime = args.startTime !== void 0 || args.endTime !== void 0;
|
|
3165
3226
|
const plan = await buildInterviewPlan(env, cache, args);
|
|
3227
|
+
if (!explicitTime && Array.isArray(payload.dataDetails) && payload.dataDetails.length) {
|
|
3228
|
+
const snap = payload.dataDetails;
|
|
3229
|
+
plan.dataDetails = snap;
|
|
3230
|
+
const pick = (fid) => {
|
|
3231
|
+
const hit = snap.find((d) => String(d?.formField?.id || "") === fid);
|
|
3232
|
+
return typeof hit?.content === "string" ? hit.content : null;
|
|
3233
|
+
};
|
|
3234
|
+
const s = pick(plan.timeFieldIds.start);
|
|
3235
|
+
const e = pick(plan.timeFieldIds.end);
|
|
3236
|
+
if (s && e) plan.interviewTime = `${s} ~ ${e}`;
|
|
3237
|
+
}
|
|
3166
3238
|
if (fingerprint2({ dataDetails: plan.dataDetails, notify: args.notify === true }) !== lease.fingerprint) {
|
|
3167
3239
|
throw ehrValidationError("target_changed", "\u8F93\u5165\u4E0E prepare \u65F6\u7684\u5FEB\u7167\u4E0D\u4E00\u81F4\uFF08\u5019\u9009\u4EBA/\u9762\u8BD5\u5B98/\u65F6\u95F4\u7B49\u88AB\u4FEE\u6539\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
3168
3240
|
}
|
|
@@ -3213,13 +3285,23 @@ var interviewArrangeApply = {
|
|
|
3213
3285
|
return ehrSuccess("ehr.recruit.candidate.interview.arrange.apply", {
|
|
3214
3286
|
status: "COMPLETE",
|
|
3215
3287
|
interviewFormId: planFormId,
|
|
3288
|
+
// 🔴 两入口产出不同质,必须显式标注(2026-11-07 实测):本入口只做「建面试单 + assignedInterview」,
|
|
3289
|
+
// 额外动作仅在 notify=true 时补跑「新建日程」esb;**不**执行页面那一整串按钮动作流。
|
|
3290
|
+
// 而 ehr.recruit.stage.interview.arrange.apply 会无条件跑 prepare 侧解析到的全部 saveActions
|
|
3291
|
+
// (含「新建EB日程」「安排面试后续动作API」「AI面试时发送提醒」等)。要完整页面效果就用 stage 入口。
|
|
3292
|
+
sideEffects: {
|
|
3293
|
+
executesFormButtonActions: false,
|
|
3294
|
+
onlyAction: "assignedInterview",
|
|
3295
|
+
scheduleCreation: notify ? "runEsb:\u65B0\u5EFA\u65E5\u7A0B" : "skipped\uFF08notify=false\uFF09"
|
|
3296
|
+
},
|
|
3297
|
+
consistencyNote: "\u672C\u5165\u53E3\u5199\u5165\u7684\u9762\u8BD5\u5355\u4E0D\u89E6\u53D1\u9875\u9762\u6309\u94AE\u52A8\u4F5C\u6D41\uFF08\u65E0\u300C\u65B0\u5EFAEB\u65E5\u7A0B/AI\u9762\u8BD5\u63D0\u9192/\u540E\u7EED\u52A8\u4F5C\u300D\uFF09\uFF1B\u843D\u5E93\u7684\u300C\u72B6\u6001(union_status)\u300D\u4E5F\u4E0D\u7531\u672C\u5165\u53E3\u8BBE\u7F6E\u3002\u82E5\u9700\u8981\u4E0E\u9875\u9762\u624B\u5DE5\u300C\u5B89\u6392\u9762\u8BD5\u300D\u5B8C\u5168\u4E00\u81F4\u7684\u526F\u4F5C\u7528\uFF0C\u8BF7\u6539\u7528 ehr.recruit.stage.interview.arrange.prepare/apply\uFF0C\u5E76\u5728\u6458\u8981\u91CC\u6838\u5BF9 saveActions \u5217\u8868\u3002",
|
|
3216
3298
|
notify: notifyResult,
|
|
3217
3299
|
assigned: assigned?.data || {},
|
|
3218
3300
|
candidate: `${plan.candidateName}\uFF08talentId=${args.talentId}\uFF09`,
|
|
3219
3301
|
time: plan.interviewTime,
|
|
3220
3302
|
interviewer: plan.interviewer,
|
|
3221
3303
|
talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, args.talentId),
|
|
3222
|
-
interviewLocateUrl:
|
|
3304
|
+
interviewLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, "interview")
|
|
3223
3305
|
});
|
|
3224
3306
|
}
|
|
3225
3307
|
};
|
|
@@ -3263,7 +3345,10 @@ async function resolveOfferTemplate(host, cache, templateName) {
|
|
|
3263
3345
|
}
|
|
3264
3346
|
const allData = await host.request({
|
|
3265
3347
|
path: "/api/ebuilder/form/dataset/v2/getAllData",
|
|
3266
|
-
body: { datajson: { header: { objId: mouldObjId }, mainTable: {}, pageInfo: { pageNo: 1, pageSize: 200 } } }
|
|
3348
|
+
body: { datajson: { header: { objId: mouldObjId }, mainTable: {}, pageInfo: { pageNo: 1, pageSize: 200 } } },
|
|
3349
|
+
// EB OpenAPI 族顶层无 code/status(message.code 为 "0"),跳过通用业务判定;
|
|
3350
|
+
// 是否成功由下面读取 `data.datajson.datas` 的调用方按数据自身判断。
|
|
3351
|
+
skipBusinessCheck: true
|
|
3267
3352
|
});
|
|
3268
3353
|
const datas = allData?.data?.datajson?.datas || [];
|
|
3269
3354
|
const hit = datas.find((item) => {
|
|
@@ -3402,7 +3487,7 @@ var offerSendApply = {
|
|
|
3402
3487
|
requiresConfirmation: true,
|
|
3403
3488
|
inputSchema: schemaOf(
|
|
3404
3489
|
{ ...offerSendSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
|
|
3405
|
-
{ required: ["
|
|
3490
|
+
{ required: ["confirm", "continuation"] }
|
|
3406
3491
|
),
|
|
3407
3492
|
handler: async (args, env) => {
|
|
3408
3493
|
requireConfirm2(args, "ehr.recruit.offer.send.apply");
|
|
@@ -3674,7 +3759,7 @@ var entryProcessApply = {
|
|
|
3674
3759
|
requiresConfirmation: true,
|
|
3675
3760
|
inputSchema: schemaOf(
|
|
3676
3761
|
{ ...entryProcessSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
|
|
3677
|
-
{ required: ["
|
|
3762
|
+
{ required: ["confirm", "continuation"] }
|
|
3678
3763
|
),
|
|
3679
3764
|
handler: async (args, env) => {
|
|
3680
3765
|
requireConfirm2(args, "ehr.recruit.entry.process.apply");
|
|
@@ -3922,7 +4007,7 @@ var feedbackEditApply = {
|
|
|
3922
4007
|
requiresConfirmation: true,
|
|
3923
4008
|
inputSchema: schemaOf(
|
|
3924
4009
|
{ ...feedbackEditSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
|
|
3925
|
-
{ required: ["
|
|
4010
|
+
{ required: ["confirm", "continuation"] }
|
|
3926
4011
|
),
|
|
3927
4012
|
handler: async (args, env) => {
|
|
3928
4013
|
requireConfirm2(args, "ehr.recruit.candidate.interview.feedback.edit.apply");
|
|
@@ -4095,7 +4180,7 @@ var feedbackUrgeApply = {
|
|
|
4095
4180
|
requiresConfirmation: true,
|
|
4096
4181
|
inputSchema: schemaOf(
|
|
4097
4182
|
{ ...feedbackUrgeSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
|
|
4098
|
-
{ required: ["
|
|
4183
|
+
{ required: ["confirm", "continuation"] }
|
|
4099
4184
|
),
|
|
4100
4185
|
handler: async (args, env) => {
|
|
4101
4186
|
requireConfirm2(args, "ehr.recruit.candidate.interview.feedback.urge.apply");
|
|
@@ -4180,26 +4265,39 @@ async function countModule(env, cache, key, pageSize, maxPages) {
|
|
|
4180
4265
|
let scanned = 0;
|
|
4181
4266
|
let total = null;
|
|
4182
4267
|
let totalExact = false;
|
|
4268
|
+
let countSource = "unknown";
|
|
4183
4269
|
let note = cfg.note;
|
|
4184
4270
|
for (let current = 1; current <= maxPages; current++) {
|
|
4185
4271
|
const page = await fetchListRows(env.host, objId, list.listId, { ...baseBody, current, pageSize });
|
|
4186
4272
|
if (current === 1 && page.total !== null && page.totalExact) {
|
|
4187
4273
|
total = page.total;
|
|
4188
4274
|
totalExact = true;
|
|
4275
|
+
countSource = "count-api";
|
|
4189
4276
|
break;
|
|
4190
4277
|
}
|
|
4191
4278
|
scanned += page.rows.length;
|
|
4192
4279
|
if (page.rows.length < pageSize) {
|
|
4193
4280
|
total = scanned;
|
|
4194
4281
|
totalExact = true;
|
|
4282
|
+
countSource = "full-scan";
|
|
4195
4283
|
break;
|
|
4196
4284
|
}
|
|
4197
4285
|
}
|
|
4198
4286
|
if (total === null) {
|
|
4199
4287
|
totalExact = false;
|
|
4288
|
+
countSource = "unknown";
|
|
4200
4289
|
note = `\u8BA1\u6570\u63A5\u53E3\u4E0D\u53EF\u7528\u4E14\u8FBE\u626B\u63CF\u4E0A\u9650\uFF08${maxPages} \u9875 \xD7 ${pageSize} \u884C\uFF09\u4ECD\u672A\u53D6\u5B8C\uFF0C\u603B\u6570\u4E0D\u53EF\u77E5\uFF1B\u53EF\u8C03\u5927 pageSize/maxPages \u91CD\u8BD5`;
|
|
4201
4290
|
}
|
|
4202
|
-
return {
|
|
4291
|
+
return {
|
|
4292
|
+
key,
|
|
4293
|
+
module: cfg.title,
|
|
4294
|
+
available: true,
|
|
4295
|
+
total,
|
|
4296
|
+
totalExact,
|
|
4297
|
+
scannedRows: scanned,
|
|
4298
|
+
countSource,
|
|
4299
|
+
...note ? { note } : {}
|
|
4300
|
+
};
|
|
4203
4301
|
}
|
|
4204
4302
|
var recruitStats = {
|
|
4205
4303
|
name: "ehr.recruit.stats",
|
|
@@ -4262,14 +4360,11 @@ var MTEXT_KEYS = ["position_duty", "work_request"];
|
|
|
4262
4360
|
var PERSON_DEFAULT_KEYS = ["recr_principal", "employ_manager"];
|
|
4263
4361
|
var REF_COPY_KEYS = [
|
|
4264
4362
|
"position_nature",
|
|
4265
|
-
"job_category",
|
|
4266
4363
|
"education",
|
|
4267
4364
|
"work_years",
|
|
4268
|
-
"work_location",
|
|
4269
|
-
"salary_min",
|
|
4270
|
-
"salary_max",
|
|
4271
4365
|
"recruit_flow"
|
|
4272
4366
|
];
|
|
4367
|
+
var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
|
|
4273
4368
|
var TEXT_DEFAULTS = { recruit_count: "1", number_of_pay_months: "12" };
|
|
4274
4369
|
var OPTION_DEFAULTS = { salary_type: "\u6708\u85AA", recruit_type: "\u793E\u4F1A\u62DB\u8058", status: "\u62DB\u8058\u4E2D" };
|
|
4275
4370
|
var SET_FIELDS = [
|
|
@@ -4355,11 +4450,28 @@ async function findWorkPlaceMenu(env, cache) {
|
|
|
4355
4450
|
return null;
|
|
4356
4451
|
}
|
|
4357
4452
|
}
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4453
|
+
var workPlaceMemo = /* @__PURE__ */ new Map();
|
|
4454
|
+
function stripHtml(s) {
|
|
4455
|
+
return String(s ?? "").replace(/<[^>]*>/g, "").trim();
|
|
4456
|
+
}
|
|
4457
|
+
function parseSpans(raw) {
|
|
4458
|
+
try {
|
|
4459
|
+
const v = Array.isArray(raw) ? raw : JSON.parse(String(raw || "[]"));
|
|
4460
|
+
return Array.isArray(v) ? v : [];
|
|
4461
|
+
} catch {
|
|
4462
|
+
return [];
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
function isEnabledText(s) {
|
|
4466
|
+
const t = stripHtml(s);
|
|
4467
|
+
return t.includes("\u542F\u7528") && !t.includes("\u7981\u7528");
|
|
4468
|
+
}
|
|
4469
|
+
async function loadWorkPlaces(env, cache) {
|
|
4361
4470
|
const menu = await findWorkPlaceMenu(env, cache);
|
|
4362
|
-
if (!menu?.listId) return
|
|
4471
|
+
if (!menu?.listId) return [];
|
|
4472
|
+
const key = String(cache.appId || "") + "|" + menu.listId;
|
|
4473
|
+
const cached = workPlaceMemo.get(key);
|
|
4474
|
+
if (cached) return cached;
|
|
4363
4475
|
let pObj = "";
|
|
4364
4476
|
try {
|
|
4365
4477
|
const t = await env.host.request({
|
|
@@ -4371,27 +4483,63 @@ async function resolveWorkLocation(env, cache, value) {
|
|
|
4371
4483
|
} catch {
|
|
4372
4484
|
}
|
|
4373
4485
|
if (!pObj) pObj = String(menu.objId || "");
|
|
4374
|
-
if (!pObj) return
|
|
4375
|
-
const
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4486
|
+
if (!pObj) return [];
|
|
4487
|
+
const pageSize = 200;
|
|
4488
|
+
const rawRows = [];
|
|
4489
|
+
const dispRows = [];
|
|
4490
|
+
for (let page = 1; page <= 5; page++) {
|
|
4491
|
+
const body = buildListBody({
|
|
4492
|
+
listId: menu.listId,
|
|
4493
|
+
cusMenuId: menu.cusMenuId,
|
|
4494
|
+
menuName: menu.menuName || "\u529E\u516C\u5730\u70B9",
|
|
4495
|
+
title: menu.menuName || "\u529E\u516C\u5730\u70B9",
|
|
4496
|
+
current: page,
|
|
4497
|
+
pageSize
|
|
4498
|
+
});
|
|
4499
|
+
const r = await env.host.request({
|
|
4500
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
4501
|
+
body,
|
|
4502
|
+
headers: { ebBusinessId: menu.listId }
|
|
4503
|
+
});
|
|
4504
|
+
const batch = r?.data?.data || r?.data?.displayData || [];
|
|
4505
|
+
rawRows.push(...batch);
|
|
4506
|
+
dispRows.push(...r?.data?.displayData || []);
|
|
4507
|
+
if (batch.length < pageSize) break;
|
|
4508
|
+
}
|
|
4509
|
+
const enabledStatusIds = /* @__PURE__ */ new Set();
|
|
4510
|
+
const enabledRowIds = /* @__PURE__ */ new Set();
|
|
4511
|
+
for (const d of dispRows) {
|
|
4512
|
+
const rid = String(d?.form_data_id || d?.id || "");
|
|
4513
|
+
if (isEnabledText(d?.place_status) && rid) enabledRowIds.add(rid);
|
|
4514
|
+
for (const s of parseSpans(d?.place_statusSpan)) {
|
|
4515
|
+
if (isEnabledText(s?.name) && s?.id) enabledStatusIds.add(String(s.id));
|
|
4516
|
+
}
|
|
4517
|
+
}
|
|
4518
|
+
const statusFiltered = enabledRowIds.size > 0 || enabledStatusIds.size > 0;
|
|
4519
|
+
const rows = rawRows.filter((x) => !statusFiltered || enabledRowIds.has(String(x?.form_data_id || x?.id || "")) || enabledStatusIds.has(String(x?.place_status || ""))).map((x) => ({
|
|
4520
|
+
id: String(x?.form_data_id || x?.id || ""),
|
|
4521
|
+
name: String(x?.name || ""),
|
|
4522
|
+
detail: String(x?.detail_location || ""),
|
|
4523
|
+
area: String(x?.area_text || "")
|
|
4524
|
+
})).filter((x) => !!x.id);
|
|
4525
|
+
workPlaceMemo.set(key, rows);
|
|
4526
|
+
return rows;
|
|
4527
|
+
}
|
|
4528
|
+
function matchWorkPlace(rows, value) {
|
|
4529
|
+
const v = String(value).trim();
|
|
4530
|
+
if (!v || !rows.length) return null;
|
|
4531
|
+
const exact = rows.find((r) => r.detail === v) || rows.find((r) => r.name === v);
|
|
4532
|
+
if (exact) return exact;
|
|
4533
|
+
const valid = (s) => s.length >= 4 && !/^\d+$/.test(s);
|
|
4534
|
+
return rows.find((r) => r.detail.includes(v) && valid(r.detail) || r.name.includes(v) && valid(r.name) || r.area.includes(v) && valid(r.area) || v.includes(r.detail) && valid(r.detail)) || null;
|
|
4535
|
+
}
|
|
4536
|
+
async function resolveWorkLocation(env, cache, value) {
|
|
4537
|
+
if (!String(value).trim()) return null;
|
|
4538
|
+
const hit = matchWorkPlace(await loadWorkPlaces(env, cache), value);
|
|
4539
|
+
return hit ? { id: hit.id, name: hit.detail || hit.name || String(value) } : null;
|
|
4540
|
+
}
|
|
4541
|
+
async function resolveDefaultWorkLocation(env, cache) {
|
|
4542
|
+
return resolveWorkLocation(env, cache, DEFAULT_WORK_LOCATION);
|
|
4395
4543
|
}
|
|
4396
4544
|
function detailDisplayValue(detail) {
|
|
4397
4545
|
if (!detail) return "";
|
|
@@ -4458,7 +4606,15 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
4458
4606
|
continue;
|
|
4459
4607
|
}
|
|
4460
4608
|
if (field.kind === "text" || field.kind === "number") {
|
|
4461
|
-
|
|
4609
|
+
let out = String(value);
|
|
4610
|
+
if (field.key === "salary_min" || field.key === "salary_max") {
|
|
4611
|
+
const n = Number(String(value).replace(/,/g, ""));
|
|
4612
|
+
if (Number.isFinite(n) && n > 0) {
|
|
4613
|
+
const k = n / 1e3;
|
|
4614
|
+
out = String(Number.isInteger(k) ? k : Number(k.toFixed(3)));
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
put({ formField: { id: fieldId }, content: out });
|
|
4462
4618
|
applied.push(`${field.key}=${value}`);
|
|
4463
4619
|
} else if (field.kind === "option") {
|
|
4464
4620
|
const options = await getDsOptions(env.host, objId, fieldId, cache.appId);
|
|
@@ -4533,6 +4689,17 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
4533
4689
|
missingRef.push(key);
|
|
4534
4690
|
}
|
|
4535
4691
|
}
|
|
4692
|
+
let workLocationDefault = null;
|
|
4693
|
+
let workLocationWarning = null;
|
|
4694
|
+
if (!has("work_location") && fid("work_location")) {
|
|
4695
|
+
const loc = await resolveDefaultWorkLocation(env, cache).catch(() => null);
|
|
4696
|
+
if (loc) {
|
|
4697
|
+
put({ formField: { id: fid("work_location") }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
|
|
4698
|
+
workLocationDefault = loc.name;
|
|
4699
|
+
} else {
|
|
4700
|
+
workLocationWarning = `\u672A\u5728\u300C\u529E\u516C\u5730\u70B9\u300D\u5217\u8868\u627E\u5230\u542F\u7528\u72B6\u6001\u7684\u9ED8\u8BA4\u5730\u70B9\u300C${DEFAULT_WORK_LOCATION}\u300D\uFF0C\u672C\u6B21\u4E0D\u5199 work_location\uFF1B\u8BF7\u7528 workLocation \u663E\u5F0F\u6307\u5B9A`;
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4536
4703
|
const inverse = {};
|
|
4537
4704
|
for (const [dataKey, fieldId] of Object.entries(fields)) inverse[String(fieldId)] = dataKey;
|
|
4538
4705
|
const inheritedSalaryWarnings = [];
|
|
@@ -4557,10 +4724,12 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
4557
4724
|
explicitApplied: applied,
|
|
4558
4725
|
explicitSkipped: skipped,
|
|
4559
4726
|
inheritedFromExistingPosition: inherited,
|
|
4560
|
-
// 带值的继承清单:Agent
|
|
4561
|
-
//
|
|
4727
|
+
// 带值的继承清单:Agent 必须在确认摘要里逐项点名,不得因为它是默认值就略过
|
|
4728
|
+
// (工作地点不参与继承,已改为启用办公地点列表精确解析)。
|
|
4562
4729
|
inheritedFromRef: inherited.length ? inherited.map((k) => ({ field: k, value: detailDisplayValue(refMap.get(String(fid(k)))) })) : void 0,
|
|
4563
4730
|
inheritedSalaryWarnings: inheritedSalaryWarnings.length ? inheritedSalaryWarnings : void 0,
|
|
4731
|
+
workLocationDefault: workLocationDefault || void 0,
|
|
4732
|
+
workLocationWarning: workLocationWarning || void 0,
|
|
4564
4733
|
noReferenceValue: missingRef,
|
|
4565
4734
|
principalDefault: session.userId ? "\u5F53\u524D\u767B\u5F55\u7528\u6237" : "\u672A\u89E3\u6790\u5230\u5F53\u524D\u7528\u6237"
|
|
4566
4735
|
}
|
|
@@ -4634,8 +4803,8 @@ var positionCreateApply = {
|
|
|
4634
4803
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
4635
4804
|
throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
4636
4805
|
}
|
|
4637
|
-
const positionName = String(args.positionName ?? "").trim();
|
|
4638
4806
|
const payload = lease.payload || {};
|
|
4807
|
+
const positionName = String(args.positionName ?? payload.positionName ?? "").trim();
|
|
4639
4808
|
if (payload.positionName !== positionName) {
|
|
4640
4809
|
throw ehrValidationError("target_changed", "\u804C\u4F4D\u540D\u79F0\u4E0E prepare \u65F6\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
4641
4810
|
}
|
|
@@ -4661,7 +4830,7 @@ var positionCreateApply = {
|
|
|
4661
4830
|
const list = cache.lists.position;
|
|
4662
4831
|
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
4663
4832
|
const cardUrl = `${baseUrl}/sp/ebdfpage/card/0/${payload.objId}/${formDataId}`;
|
|
4664
|
-
const listLocateUrl = list?.listId ? `${baseUrl}/sp/ebdfpage/list/${list.listId}
|
|
4833
|
+
const listLocateUrl = list?.listId ? `${baseUrl}/sp/ebdfpage/list/${list.listId}` : null;
|
|
4665
4834
|
if (!created) {
|
|
4666
4835
|
throw ehrValidationError(
|
|
4667
4836
|
"position_create_failed",
|
|
@@ -4831,7 +5000,10 @@ function normalizeImportDates(input, warnings) {
|
|
|
4831
5000
|
}
|
|
4832
5001
|
if (Array.isArray(input.academicInformations)) {
|
|
4833
5002
|
input.academicInformations.forEach((r, i) => {
|
|
4834
|
-
if (!r || typeof r !== "object"
|
|
5003
|
+
if (!r || typeof r !== "object") return;
|
|
5004
|
+
if (r.start_date !== void 0 && r.start_date !== null) r.start_date = one(`academicInformations[${i}].start_date`, r.start_date, false);
|
|
5005
|
+
if (r.end_date !== void 0 && r.end_date !== null) r.end_date = one(`academicInformations[${i}].end_date`, r.end_date, true);
|
|
5006
|
+
if (r.study_date === void 0) return;
|
|
4835
5007
|
const before = String(r.study_date ?? "").trim();
|
|
4836
5008
|
if (!before) return;
|
|
4837
5009
|
const after = normDateRange(before);
|
|
@@ -4961,9 +5133,9 @@ function buildSubDetails(structured, meta, nodeOfTable, resolveDict) {
|
|
|
4961
5133
|
const parts = Array.isArray(value) ? value : String(value).split(/[,~]/);
|
|
4962
5134
|
const start = String(parts[0] ?? "").trim();
|
|
4963
5135
|
const end = String(parts[1] ?? "").trim();
|
|
4964
|
-
if (!start
|
|
4965
|
-
out[column.startKey] = start;
|
|
4966
|
-
out[column.endKey] = end;
|
|
5136
|
+
if (!start && !end) continue;
|
|
5137
|
+
if (start) out[column.startKey] = start;
|
|
5138
|
+
if (end) out[column.endKey] = end;
|
|
4967
5139
|
continue;
|
|
4968
5140
|
}
|
|
4969
5141
|
out[colKey] = String(value);
|
|
@@ -5001,7 +5173,11 @@ async function datasetSaveFormData(env, objId, mainTable, details) {
|
|
|
5001
5173
|
operationinfo: { fieldNoFindIgnore: "true", doAction: "false" }
|
|
5002
5174
|
}
|
|
5003
5175
|
},
|
|
5004
|
-
operation: "ehr.recruit.candidate.import.apply"
|
|
5176
|
+
operation: "ehr.recruit.candidate.import.apply",
|
|
5177
|
+
// EB OpenAPI 族(dataset/v2/*)顶层没有 code/status,业务结果在
|
|
5178
|
+
// `data.datajson.status` + `data.datajson.message`,且外层 `message.code` 恒为 "0"。
|
|
5179
|
+
// 交给下面的 `ok` 判定按 datajson 自查,不走通用业务判定。
|
|
5180
|
+
skipBusinessCheck: true
|
|
5005
5181
|
});
|
|
5006
5182
|
const datajson = response?.data?.datajson || {};
|
|
5007
5183
|
const code = response?.message?.code;
|
|
@@ -5244,8 +5420,10 @@ async function buildImportPlan(env, cache, args) {
|
|
|
5244
5420
|
}
|
|
5245
5421
|
}
|
|
5246
5422
|
if (fields.is_blacklist) {
|
|
5247
|
-
const
|
|
5248
|
-
|
|
5423
|
+
const opts = await getDsOptions(env.host, objId, fields.is_blacklist, "").catch(() => ({}));
|
|
5424
|
+
const noId = opts["\u5426"];
|
|
5425
|
+
if (noId) main.is_blacklist = String(noId);
|
|
5426
|
+
else warnings.push("\u9ED1\u540D\u5355\u5B57\u6BB5\u672A\u53D6\u5230\u300C\u5426\u300D\u9009\u9879\uFF0C\u8BE5\u5B57\u6BB5\u7559\u7A7A\uFF08\u7531\u7CFB\u7EDF\u9ED8\u8BA4\u503C\u515C\u5E95\uFF09");
|
|
5249
5427
|
}
|
|
5250
5428
|
let subStats = {};
|
|
5251
5429
|
let detailNodes = {};
|
|
@@ -5254,7 +5432,11 @@ async function buildImportPlan(env, cache, args) {
|
|
|
5254
5432
|
const mappingResponse = await env.host.request({
|
|
5255
5433
|
path: `/api/ebuilder/form/dataset/v1/getTableMapping?objId=${encodeURIComponent(objId)}`,
|
|
5256
5434
|
method: "GET",
|
|
5257
|
-
operation: "ehr.recruit.candidate.import.prepare"
|
|
5435
|
+
operation: "ehr.recruit.candidate.import.prepare",
|
|
5436
|
+
// EB OpenAPI 族成功标识在 `data` 里(顶层 message.code 是 "0"),
|
|
5437
|
+
// 走通用业务判定会被误判成 business_error,导致「明细表未写入」。
|
|
5438
|
+
// 真正的判据交给下面的 `mapping.mainTable` 断言。
|
|
5439
|
+
skipBusinessCheck: true
|
|
5258
5440
|
});
|
|
5259
5441
|
const mapping = mappingResponse?.data;
|
|
5260
5442
|
if (!mapping?.mainTable) throw new Error("getTableMapping \u672A\u8FD4\u56DE mainTable");
|
|
@@ -5450,7 +5632,9 @@ var candidateImportApply = {
|
|
|
5450
5632
|
throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
5451
5633
|
}
|
|
5452
5634
|
const payload = lease.payload || {};
|
|
5453
|
-
|
|
5635
|
+
const candidateName = str(args.candidateName) || str(payload.candidateName);
|
|
5636
|
+
const telephone = str(args.telephone) || str(payload.telephone);
|
|
5637
|
+
if (payload.candidateName !== candidateName || payload.telephone !== telephone) {
|
|
5454
5638
|
throw ehrValidationError("target_changed", "\u59D3\u540D\u6216\u624B\u673A\u53F7\u4E0E prepare \u65F6\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
5455
5639
|
}
|
|
5456
5640
|
const cache = await requireCache2(env);
|
|
@@ -5502,9 +5686,10 @@ var candidateImportApply = {
|
|
|
5502
5686
|
const batchNote = batchOutcome.note;
|
|
5503
5687
|
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
5504
5688
|
const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
|
|
5505
|
-
const
|
|
5689
|
+
const talentObjId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || "");
|
|
5690
|
+
const talentCardUrl = cache.ebdDetailPageId ? `${baseUrl}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}` : talentObjId ? `${baseUrl}/sp/ebdfpage/card/0/${talentObjId}/${talentId}` : null;
|
|
5506
5691
|
const talentListId = cache.lists.talent?.listId;
|
|
5507
|
-
const talentListLocateUrl = talentListId ? `${baseUrl}/sp/ebdfpage/list/${talentListId}
|
|
5692
|
+
const talentListLocateUrl = talentListId ? `${baseUrl}/sp/ebdfpage/list/${talentListId}` : null;
|
|
5508
5693
|
const warnings = [...payload.warnings || []];
|
|
5509
5694
|
if (batchNote) warnings.push(batchNote);
|
|
5510
5695
|
let detailsState = "complete";
|
|
@@ -5576,6 +5761,360 @@ var recruitCandidateImportOperations = [
|
|
|
5576
5761
|
candidateImportApply
|
|
5577
5762
|
];
|
|
5578
5763
|
|
|
5764
|
+
// src/shortcuts/ehr/operations/recruit-tag.ts
|
|
5765
|
+
var TAG_QUERY_PATH = "/api/my/tag/query";
|
|
5766
|
+
var MAX_PAGE_SIZE = 100;
|
|
5767
|
+
var DEFAULT_LIMIT = 100;
|
|
5768
|
+
var MAX_LIMIT = 2e3;
|
|
5769
|
+
function normalizeTag(row) {
|
|
5770
|
+
const tagId = String(row?.tagId ?? row?.id ?? "").trim();
|
|
5771
|
+
const name = String(row?.name ?? row?.tagName ?? "").trim();
|
|
5772
|
+
if (!tagId || !name) return null;
|
|
5773
|
+
return {
|
|
5774
|
+
tagId,
|
|
5775
|
+
name,
|
|
5776
|
+
groupId: String(row?.groupId ?? "0"),
|
|
5777
|
+
type: Number(row?.type ?? 0),
|
|
5778
|
+
available: row?.available !== false
|
|
5779
|
+
};
|
|
5780
|
+
}
|
|
5781
|
+
async function queryPage(env, params) {
|
|
5782
|
+
const body = {
|
|
5783
|
+
type: params.type,
|
|
5784
|
+
name: params.keyword,
|
|
5785
|
+
order: 8,
|
|
5786
|
+
pageSize: params.pageSize,
|
|
5787
|
+
pageNo: params.pageNo,
|
|
5788
|
+
search: 1,
|
|
5789
|
+
tagGroup: 0,
|
|
5790
|
+
tagModules: ["ebuilderform"]
|
|
5791
|
+
};
|
|
5792
|
+
if (params.groupId !== void 0) body.groupId = params.groupId;
|
|
5793
|
+
const res = await env.host.request({
|
|
5794
|
+
path: TAG_QUERY_PATH,
|
|
5795
|
+
method: "POST",
|
|
5796
|
+
body,
|
|
5797
|
+
operation: "ehr.recruit.tag.list"
|
|
5798
|
+
});
|
|
5799
|
+
const d = res?.data ?? {};
|
|
5800
|
+
return {
|
|
5801
|
+
total: typeof d.total === "number" ? d.total : null,
|
|
5802
|
+
rows: Array.isArray(d.data) ? d.data : []
|
|
5803
|
+
};
|
|
5804
|
+
}
|
|
5805
|
+
async function listTags(args, env) {
|
|
5806
|
+
const keyword = args.keyword === void 0 ? "" : String(args.keyword).trim();
|
|
5807
|
+
const groupId = args.groupId === void 0 || args.groupId === null ? void 0 : String(args.groupId);
|
|
5808
|
+
const limitRaw = Number(args.limit ?? DEFAULT_LIMIT);
|
|
5809
|
+
const limit = Number.isFinite(limitRaw) ? Math.min(MAX_LIMIT, Math.max(1, Math.trunc(limitRaw))) : DEFAULT_LIMIT;
|
|
5810
|
+
const includeUnavailable = args.includeUnavailable === true;
|
|
5811
|
+
const withGroupStats = args.withGroupStats !== false;
|
|
5812
|
+
const typeArg = args.type;
|
|
5813
|
+
if (typeArg !== void 0 && typeArg !== "all" && typeArg !== 0 && typeArg !== 1) {
|
|
5814
|
+
throw ehrValidationError("invalid_type", 'type \u53EA\u80FD\u662F 0\uFF08\u516C\u5171\u6807\u7B7E\uFF09\u30011\uFF08\u79C1\u6709\u6807\u7B7E\uFF09\u6216 "all"');
|
|
5815
|
+
}
|
|
5816
|
+
const types = typeArg === "all" ? [0, 1] : [Number(typeArg ?? 0)];
|
|
5817
|
+
const collected = [];
|
|
5818
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5819
|
+
let reportedTotal = 0;
|
|
5820
|
+
for (const type of types) {
|
|
5821
|
+
let pageNo = 1;
|
|
5822
|
+
let total = null;
|
|
5823
|
+
while (true) {
|
|
5824
|
+
const page = await queryPage(env, { type, keyword, groupId, pageNo, pageSize: MAX_PAGE_SIZE });
|
|
5825
|
+
if (page.total !== null) total = page.total;
|
|
5826
|
+
for (const raw of page.rows) {
|
|
5827
|
+
const item = normalizeTag(raw);
|
|
5828
|
+
if (!item) continue;
|
|
5829
|
+
if (groupId !== void 0 && item.groupId !== groupId) continue;
|
|
5830
|
+
if (!includeUnavailable && !item.available) continue;
|
|
5831
|
+
const key = `${item.type}:${item.tagId}`;
|
|
5832
|
+
if (seen.has(key)) continue;
|
|
5833
|
+
seen.add(key);
|
|
5834
|
+
collected.push(item);
|
|
5835
|
+
}
|
|
5836
|
+
if (!page.rows.length) break;
|
|
5837
|
+
if (collected.length >= limit) break;
|
|
5838
|
+
if (total !== null && pageNo * MAX_PAGE_SIZE >= total) break;
|
|
5839
|
+
pageNo += 1;
|
|
5840
|
+
if (pageNo > 30) break;
|
|
5841
|
+
}
|
|
5842
|
+
reportedTotal += total ?? 0;
|
|
5843
|
+
}
|
|
5844
|
+
const items = collected.slice(0, limit);
|
|
5845
|
+
const groupStats = withGroupStats ? [...new Map(items.reduce((m, x) => {
|
|
5846
|
+
m.set(x.groupId, (m.get(x.groupId) ?? 0) + 1);
|
|
5847
|
+
return m;
|
|
5848
|
+
}, /* @__PURE__ */ new Map()).entries())].map(([groupId2, count]) => ({ groupId: groupId2, count })).sort((a, b) => b.count - a.count) : void 0;
|
|
5849
|
+
const notes = [];
|
|
5850
|
+
if (groupId === void 0 && keyword === "" && groupStats && groupStats.length) {
|
|
5851
|
+
const top = groupStats[0];
|
|
5852
|
+
const topShare = items.length ? top.count / items.length : 0;
|
|
5853
|
+
if (topShare >= 0.7) {
|
|
5854
|
+
const truncated = reportedTotal > 0 && items.length < reportedTotal;
|
|
5855
|
+
const scope = truncated ? `\u672C\u6B21\u8FD4\u56DE\u7684 ${items.length} \u6761\u6837\u672C\uFF08\u975E\u5168\u91CF\uFF09` : "\u5168\u90E8\u7ED3\u679C";
|
|
5856
|
+
notes.push(
|
|
5857
|
+
`\u6807\u7B7E\u6C60\u672A\u6309\u4E1A\u52A1\u5206\u7EC4\uFF1AgroupId=${top.groupId} \u5360${scope}\u7684 ${top.count}/${items.length}\u3002\u62DB\u8058\u6807\u7B7E\u4E0E\u5BA2\u6237/\u9879\u76EE\u7B49\u5176\u4ED6\u4E1A\u52A1\u6807\u7B7E\u6DF7\u5728\u540C\u4E00\u6C60\u5B50\u91CC\uFF0C\u8981\u771F\u6B63\u9694\u79BB\u9700\u5728 EB \u4FA7\u65B0\u5EFA\u62DB\u8058\u6807\u7B7E\u7EC4\uFF0C\u518D\u6309 groupId \u8FC7\u6EE4\u3002` + (truncated ? " \u60F3\u770B\u5168\u91CF\u7EC4\u5206\u5E03\u8BF7\u8C03\u5927 limit\u3002" : "")
|
|
5858
|
+
);
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
if (keyword) notes.push(`\u5DF2\u6309\u540D\u79F0\u5305\u542B\u5339\u914D\u300C${keyword}\u300D\uFF1B\u670D\u52A1\u7AEF name \u53C2\u6570\u5B9E\u6D4B\u6709\u6548\u3002`);
|
|
5862
|
+
if (groupId !== void 0) notes.push(`\u5DF2\u6309 groupId=${groupId} \u8FC7\u6EE4\uFF08\u670D\u52A1\u7AEF\u53C2\u6570\u5B9E\u6D4B\u6709\u6548\uFF0C\u5BA2\u6237\u7AEF\u518D\u515C\u4E00\u5C42\u6821\u9A8C\uFF09\u3002`);
|
|
5863
|
+
if (reportedTotal && items.length < reportedTotal) {
|
|
5864
|
+
notes.push(`\u547D\u4E2D ${reportedTotal} \u6761\uFF0C\u672C\u6B21\u8FD4\u56DE ${items.length} \u6761\uFF08\u53D7 limit=${limit} \u9650\u5236\uFF0C\u53EF\u8C03\u5927 limit \u6216\u7528 keyword/groupId \u6536\u7A84\uFF09\u3002`);
|
|
5865
|
+
}
|
|
5866
|
+
return ehrSuccess("ehr.recruit.tag.list", {
|
|
5867
|
+
keyword: keyword || null,
|
|
5868
|
+
groupId: groupId ?? null,
|
|
5869
|
+
types,
|
|
5870
|
+
total: reportedTotal || null,
|
|
5871
|
+
returned: items.length,
|
|
5872
|
+
items,
|
|
5873
|
+
groupStats,
|
|
5874
|
+
note: notes.length ? notes.join(" ") : void 0
|
|
5875
|
+
});
|
|
5876
|
+
}
|
|
5877
|
+
var recruitTagOperations = [
|
|
5878
|
+
{
|
|
5879
|
+
name: "ehr.recruit.tag.list",
|
|
5880
|
+
resource: "recruit.tag",
|
|
5881
|
+
method: "list",
|
|
5882
|
+
action: "tag.list",
|
|
5883
|
+
summary: "\u5217\u62DB\u8058\u53EF\u7528\u7684\u5E73\u53F0\u6807\u7B7E\uFF08\u53EA\u8BFB\uFF09\uFF1A\u652F\u6301\u6309\u540D\u79F0\u5173\u952E\u8BCD\u3001groupId \u7CBE\u786E\u8FC7\u6EE4\uFF0C\u5E76\u7ED9\u51FA\u7EC4\u5206\u5E03\u4EE5\u4FBF\u5224\u65AD\u6807\u7B7E\u6C60\u662F\u5426\u5DF2\u5206\u7EC4\u6CBB\u7406",
|
|
5884
|
+
capability: "recruit.tag.list",
|
|
5885
|
+
risk: READ,
|
|
5886
|
+
inputSchema: schemaOf(
|
|
5887
|
+
{
|
|
5888
|
+
keyword: { type: "string", description: "\u6807\u7B7E\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u670D\u52A1\u7AEF\u4E3A\u5305\u542B\u5339\u914D\uFF0C\u5B9E\u6D4B\u6709\u6548\uFF09\u3002\u5982\u300C\u672C\u79D1\u300D\u300C\u6280\u672F\u300D" },
|
|
5889
|
+
groupId: { type: "string", description: '\u6807\u7B7E\u7EC4 id\uFF08\u670D\u52A1\u7AEF\u552F\u4E00\u751F\u6548\u7684\u8FC7\u6EE4\u53C2\u6570\uFF1BtagGroup \u65E0\u6548\uFF09\u3002\u5982 "1"' },
|
|
5890
|
+
type: {
|
|
5891
|
+
oneOf: [{ type: "integer", enum: [0, 1] }, { type: "string", enum: ["all"] }],
|
|
5892
|
+
description: '0=\u516C\u5171\u6807\u7B7E\uFF08\u9ED8\u8BA4\uFF09\u30011=\u79C1\u6709\u6807\u7B7E\u3001"all"=\u4E24\u8005\u90FD\u8981'
|
|
5893
|
+
},
|
|
5894
|
+
limit: { type: "integer", minimum: 1, maximum: MAX_LIMIT, description: `\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 ${DEFAULT_LIMIT}` },
|
|
5895
|
+
includeUnavailable: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u5DF2\u505C\u7528\u6807\u7B7E\uFF0C\u9ED8\u8BA4 false" },
|
|
5896
|
+
withGroupStats: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u7EC4\u5206\u5E03\uFF0C\u9ED8\u8BA4 true" }
|
|
5897
|
+
},
|
|
5898
|
+
{ description: "\u53EA\u8BFB\u67E5\u8BE2\uFF0C\u4E0D\u521B\u5EFA\u3001\u4E0D\u4FEE\u6539\u4EFB\u4F55\u6807\u7B7E" }
|
|
5899
|
+
),
|
|
5900
|
+
handler: listTags
|
|
5901
|
+
}
|
|
5902
|
+
];
|
|
5903
|
+
|
|
5904
|
+
// src/shortcuts/ehr/operations/recruit-interview-overview.ts
|
|
5905
|
+
var DEFAULT_DAYS = 7;
|
|
5906
|
+
var DEFAULT_MAX_PAGES = 100;
|
|
5907
|
+
var SERVER_PAGE_SIZE = 10;
|
|
5908
|
+
function ymd(d) {
|
|
5909
|
+
const y = d.getFullYear();
|
|
5910
|
+
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
5911
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
5912
|
+
return `${y}-${m}-${day}`;
|
|
5913
|
+
}
|
|
5914
|
+
function parseYmd(v, field) {
|
|
5915
|
+
if (typeof v !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(v)) {
|
|
5916
|
+
if (v === void 0 || v === null) return null;
|
|
5917
|
+
throw ehrValidationError("invalid_date", `${field} \u683C\u5F0F\u5FC5\u987B\u662F YYYY-MM-DD`);
|
|
5918
|
+
}
|
|
5919
|
+
const d = /* @__PURE__ */ new Date(`${v}T00:00:00`);
|
|
5920
|
+
if (Number.isNaN(d.getTime())) throw ehrValidationError("invalid_date", `${field} \u4E0D\u662F\u6709\u6548\u65E5\u671F`);
|
|
5921
|
+
return v;
|
|
5922
|
+
}
|
|
5923
|
+
function normalizeStartTime(v) {
|
|
5924
|
+
if (v === void 0 || v === null) return null;
|
|
5925
|
+
const s = String(v).trim();
|
|
5926
|
+
if (!s) return null;
|
|
5927
|
+
const m = s.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{2}:\d{2}))?/);
|
|
5928
|
+
if (!m) return null;
|
|
5929
|
+
return `${m[1]} ${m[2] || "00:00"}`;
|
|
5930
|
+
}
|
|
5931
|
+
async function listInterviewPage(env, params) {
|
|
5932
|
+
const body = buildListBody({
|
|
5933
|
+
listId: params.listId,
|
|
5934
|
+
cusMenuId: params.cusMenuId,
|
|
5935
|
+
menuName: params.menuName,
|
|
5936
|
+
title: LIST_TYPES.interview.title,
|
|
5937
|
+
current: params.current,
|
|
5938
|
+
pageSize: SERVER_PAGE_SIZE
|
|
5939
|
+
});
|
|
5940
|
+
const { rows, total } = await fetchListRows(env.host, params.objId, params.listId, body);
|
|
5941
|
+
return { rows, total };
|
|
5942
|
+
}
|
|
5943
|
+
async function interviewOverview(args, env) {
|
|
5944
|
+
if (!env.recruitContext) {
|
|
5945
|
+
throw ehrValidationError("recruit_context_unavailable", "\u62DB\u8058\u4E0A\u4E0B\u6587\u52A0\u8F7D\u5668\u672A\u521D\u59CB\u5316");
|
|
5946
|
+
}
|
|
5947
|
+
const today = /* @__PURE__ */ new Date();
|
|
5948
|
+
const endDate = parseYmd(args.endDate, "endDate") ?? ymd(today);
|
|
5949
|
+
let startDate = parseYmd(args.startDate, "startDate");
|
|
5950
|
+
if (!startDate) {
|
|
5951
|
+
const daysRaw = Number(args.days ?? DEFAULT_DAYS);
|
|
5952
|
+
if (!Number.isFinite(daysRaw) || daysRaw < 1) {
|
|
5953
|
+
throw ehrValidationError("invalid_days", "days \u5FC5\u987B\u662F \u22651 \u7684\u6574\u6570");
|
|
5954
|
+
}
|
|
5955
|
+
const days = Math.trunc(daysRaw);
|
|
5956
|
+
const s = /* @__PURE__ */ new Date(`${endDate}T00:00:00`);
|
|
5957
|
+
s.setDate(s.getDate() - (days - 1));
|
|
5958
|
+
startDate = ymd(s);
|
|
5959
|
+
}
|
|
5960
|
+
if (startDate > endDate) {
|
|
5961
|
+
throw ehrValidationError("invalid_range", "startDate \u4E0D\u80FD\u665A\u4E8E endDate");
|
|
5962
|
+
}
|
|
5963
|
+
const windowStart = `${startDate} 00:00`;
|
|
5964
|
+
const windowEnd = `${endDate} 23:59`;
|
|
5965
|
+
const maxPagesRaw = Number(args.maxPages ?? DEFAULT_MAX_PAGES);
|
|
5966
|
+
const maxPages = Number.isFinite(maxPagesRaw) && maxPagesRaw >= 1 ? Math.trunc(maxPagesRaw) : DEFAULT_MAX_PAGES;
|
|
5967
|
+
const includeRows = args.includeRows !== false;
|
|
5968
|
+
const rowLimitRaw = Number(args.rowLimit ?? 20);
|
|
5969
|
+
const rowLimit = Number.isFinite(rowLimitRaw) && rowLimitRaw >= 1 ? Math.trunc(rowLimitRaw) : 20;
|
|
5970
|
+
const interviewerLimitRaw = Number(args.interviewerLimit ?? 10);
|
|
5971
|
+
const interviewerLimit = Number.isFinite(interviewerLimitRaw) && interviewerLimitRaw >= 1 ? Math.trunc(interviewerLimitRaw) : 10;
|
|
5972
|
+
const cache = await env.recruitContext.load(env.host);
|
|
5973
|
+
const listType = LIST_TYPES.interview;
|
|
5974
|
+
const listParam = cache.lists[listType.listKey];
|
|
5975
|
+
if (!listParam?.listId) {
|
|
5976
|
+
throw ehrValidationError(
|
|
5977
|
+
"recruit_list_unavailable",
|
|
5978
|
+
`\u5F53\u524D\u73AF\u5883\u672A\u542F\u7528\u300C${listType.title}\u300D\u529F\u80FD\uFF08\u672A\u627E\u5230\u5BF9\u5E94\u83DC\u5355/\u5217\u8868\u53C2\u6570\uFF0C\u6309\u80FD\u529B\u63A2\u6D4B\u62E6\u622A\uFF09\u3002`
|
|
5979
|
+
);
|
|
5980
|
+
}
|
|
5981
|
+
const objId = cache.forms[listType.formType]?.objId;
|
|
5982
|
+
if (!objId) {
|
|
5983
|
+
throw ehrValidationError("recruit_context_missing", `\u672A\u89E3\u6790\u5230\u300C${listType.title}\u300D\u5BF9\u5E94\u8868\u5355\uFF0C\u65E0\u6CD5\u67E5\u8BE2\u3002`);
|
|
5984
|
+
}
|
|
5985
|
+
const counts = { \u672A\u5F00\u59CB: 0, \u5F85\u67E5\u770B: 0, \u5F85\u53CD\u9988: 0, \u5DF2\u53CD\u9988: 0 };
|
|
5986
|
+
const otherStatusCounts = /* @__PURE__ */ new Map();
|
|
5987
|
+
const byInterviewer = /* @__PURE__ */ new Map();
|
|
5988
|
+
const matched = [];
|
|
5989
|
+
let scanned = 0;
|
|
5990
|
+
let listTotal = null;
|
|
5991
|
+
let earlyStop = false;
|
|
5992
|
+
let reachedEnd = false;
|
|
5993
|
+
let consecutiveBefore = 0;
|
|
5994
|
+
for (let current = 1; current <= maxPages; current++) {
|
|
5995
|
+
const page = await listInterviewPage(env, {
|
|
5996
|
+
objId,
|
|
5997
|
+
listId: listParam.listId,
|
|
5998
|
+
cusMenuId: listParam.cusMenuId || "",
|
|
5999
|
+
menuName: listParam.menuName || listType.title,
|
|
6000
|
+
current
|
|
6001
|
+
});
|
|
6002
|
+
if (listTotal === null) listTotal = page.total;
|
|
6003
|
+
if (!page.rows.length) {
|
|
6004
|
+
reachedEnd = true;
|
|
6005
|
+
break;
|
|
6006
|
+
}
|
|
6007
|
+
scanned += page.rows.length;
|
|
6008
|
+
for (const row of page.rows) {
|
|
6009
|
+
const st = normalizeStartTime(row?.start_time);
|
|
6010
|
+
if (!st) continue;
|
|
6011
|
+
if (st > windowEnd) continue;
|
|
6012
|
+
if (st < windowStart) {
|
|
6013
|
+
consecutiveBefore += 1;
|
|
6014
|
+
continue;
|
|
6015
|
+
}
|
|
6016
|
+
consecutiveBefore = 0;
|
|
6017
|
+
const status = String(row?.union_status ?? "").trim();
|
|
6018
|
+
if (status === "\u672A\u5F00\u59CB" || status === "\u5F85\u67E5\u770B" || status === "\u5F85\u53CD\u9988" || status === "\u5DF2\u53CD\u9988") {
|
|
6019
|
+
counts[status] += 1;
|
|
6020
|
+
} else {
|
|
6021
|
+
const key = status || "(\u7A7A)";
|
|
6022
|
+
otherStatusCounts.set(key, (otherStatusCounts.get(key) ?? 0) + 1);
|
|
6023
|
+
}
|
|
6024
|
+
if (status === "\u5F85\u53CD\u9988" || status === "\u5F85\u67E5\u770B") {
|
|
6025
|
+
const who = namesOf(row?.interviewer) || "(\u672A\u6307\u5B9A\u9762\u8BD5\u5B98)";
|
|
6026
|
+
const rec = byInterviewer.get(who) ?? { pendingFeedback: 0, pendingView: 0 };
|
|
6027
|
+
if (status === "\u5F85\u53CD\u9988") rec.pendingFeedback += 1;
|
|
6028
|
+
else rec.pendingView += 1;
|
|
6029
|
+
byInterviewer.set(who, rec);
|
|
6030
|
+
}
|
|
6031
|
+
matched.push({
|
|
6032
|
+
startTime: st,
|
|
6033
|
+
status: status || "(\u7A7A)",
|
|
6034
|
+
// 行内 talent_id / position_manage_id / interviewer 放的是人名或门户结构,不是 id;
|
|
6035
|
+
// 门户结构是 JSON 字符串,必须用 namesOf 解析,否则整段 JSON 会被人当成人名
|
|
6036
|
+
candidate: namesOf(row?.talent_id) || "",
|
|
6037
|
+
position: namesOf(row?.position_manage_id) || "",
|
|
6038
|
+
interviewer: namesOf(row?.interviewer) || "",
|
|
6039
|
+
type: namesOf(row?.interview_type) || "",
|
|
6040
|
+
session: namesOf(row?.interview_session) || "",
|
|
6041
|
+
rounds: namesOf(row?.interview_rounds) || "",
|
|
6042
|
+
formDataId: String(row?.form_data_id ?? "").trim(),
|
|
6043
|
+
candidateManageId: String(row?.candidate_manage_id ?? "").trim()
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6046
|
+
if (consecutiveBefore >= 3) {
|
|
6047
|
+
earlyStop = true;
|
|
6048
|
+
break;
|
|
6049
|
+
}
|
|
6050
|
+
}
|
|
6051
|
+
const truncated = !earlyStop && !reachedEnd;
|
|
6052
|
+
const notes = [];
|
|
6053
|
+
notes.push(
|
|
6054
|
+
"\u72B6\u6001\u540D\uFF08\u672A\u5F00\u59CB/\u5F85\u67E5\u770B/\u5F85\u53CD\u9988/\u5DF2\u53CD\u9988\uFF09\u6309\u7CFB\u7EDF\u539F\u503C\u76F4\u51FA\uFF0C\u8BED\u4E49\u4EE5\u62DB\u8058\u4E1A\u52A1\u53E3\u5F84\u4E3A\u51C6\uFF1B\u300C\u5F85\u53CD\u9988\u300D= \u9762\u8BD5\u5DF2\u7ED3\u675F\u3001\u7B49\u9762\u8BD5\u5B98/HR \u586B\u8BC4\u4EF7\uFF0C\u662F HR \u6700\u9700\u8981\u8DDF\u8FDB\u7684\u4E00\u7C7B\u3002"
|
|
6055
|
+
);
|
|
6056
|
+
if (earlyStop) {
|
|
6057
|
+
notes.push(`\u5DF2\u6309 start_time \u5012\u5E8F\u626B\u63CF\u81F3\u7A97\u53E3\u4E0B\u754C\uFF0C${startDate}~${endDate} \u7A97\u53E3\u5185\u5E94\u65E0\u9057\u6F0F\u3002`);
|
|
6058
|
+
} else if (reachedEnd) {
|
|
6059
|
+
notes.push("\u5217\u8868\u5DF2\u7FFB\u5230\u672B\u9875\uFF0C\u7ED3\u679C\u5B8C\u6574\u3002");
|
|
6060
|
+
} else {
|
|
6061
|
+
notes.push(
|
|
6062
|
+
`\u26A0\uFE0F \u5DF2\u8FBE maxPages=${maxPages}\uFF08\u626B\u63CF ${scanned} \u6761\uFF09\u4ECD\u672A\u626B\u5230 ${startDate} \u4E0B\u754C\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF0C\u53EF\u8C03\u5927 maxPages \u6216\u7F29\u5C0F\u65F6\u95F4\u7A97\u540E\u91CD\u8BD5\u3002\u8FD9\u6761\u6E05\u5355\u4E0D\u80FD\u5F53\u4F5C\u5168\u91CF\u4EA4\u4ED8\u3002`
|
|
6063
|
+
);
|
|
6064
|
+
}
|
|
6065
|
+
if (otherStatusCounts.size) {
|
|
6066
|
+
const total = [...otherStatusCounts.values()].reduce((a, b) => a + b, 0);
|
|
6067
|
+
notes.push(`\u53E6\u6709 ${total} \u6761\u72B6\u6001\u4E3A\u975E\u5E38\u89C4\u503C\uFF08\u89C1 otherStatusCounts\uFF09\uFF0C\u672A\u8BA1\u5165\u56DB\u4E2A\u6807\u51C6\u72B6\u6001\uFF0C\u8BF7\u6309\u9700\u4EBA\u5DE5\u6838\u5BF9\u3002`);
|
|
6068
|
+
}
|
|
6069
|
+
const actionRows = matched.filter((r) => r.status === "\u5F85\u53CD\u9988" || r.status === "\u5F85\u67E5\u770B");
|
|
6070
|
+
const byInterviewerSorted = [...byInterviewer.entries()].map(([interviewer, v]) => ({ interviewer, ...v, total: v.pendingFeedback + v.pendingView })).sort((a, b) => b.total - a.total);
|
|
6071
|
+
notes.push("\u9010\u4EBA\u6E05\u5355\u53EA\u5217\u5F85\u8DDF\u8FDB\uFF08\u5F85\u53CD\u9988/\u5F85\u67E5\u770B\uFF09\uFF0C\u5DF2\u53CD\u9988\u4E0D\u5217\u51FA\uFF1B\u5168\u91CF\u660E\u7EC6\u8BF7\u7528 ehr.recruit.candidate.list type=interview \u7FFB\u9875\u3002");
|
|
6072
|
+
if (byInterviewerSorted.length > interviewerLimit) {
|
|
6073
|
+
notes.push(
|
|
6074
|
+
`\u6309\u9762\u8BD5\u5B98\u7EDF\u8BA1\u5171 ${byInterviewerSorted.length} \u4EBA\uFF0C\u4EC5\u5217\u524D ${interviewerLimit} \u540D\uFF08\u53EF\u8C03 interviewerLimit\uFF09\uFF1B\u56E0\u6B64\u8FD9\u90E8\u5206\u5408\u8BA1\u5C0F\u4E8E actionNeeded \u662F\u6B63\u5E38\u7684\uFF0C\u4E0D\u662F\u6F0F\u8BA1\u3002`
|
|
6075
|
+
);
|
|
6076
|
+
}
|
|
6077
|
+
return ehrSuccess("ehr.recruit.interview.overview", {
|
|
6078
|
+
window: { startDate, endDate, days: args.days ?? null },
|
|
6079
|
+
listTotal,
|
|
6080
|
+
scanned,
|
|
6081
|
+
matched: matched.length,
|
|
6082
|
+
truncated,
|
|
6083
|
+
statusCounts: counts,
|
|
6084
|
+
otherStatusCounts: otherStatusCounts.size ? Object.fromEntries([...otherStatusCounts.entries()].sort((a, b) => b[1] - a[1])) : void 0,
|
|
6085
|
+
actionNeeded: counts.\u5F85\u53CD\u9988 + counts.\u5F85\u67E5\u770B,
|
|
6086
|
+
byInterviewer: byInterviewerSorted.slice(0, interviewerLimit),
|
|
6087
|
+
byInterviewerTotal: byInterviewerSorted.length,
|
|
6088
|
+
rows: includeRows ? actionRows.slice(0, rowLimit) : void 0,
|
|
6089
|
+
rowsNote: includeRows && actionRows.length > rowLimit ? `\u5F85\u8DDF\u8FDB\u5171 ${actionRows.length} \u6761\uFF0C\u4EC5\u5217\u6700\u8FD1 ${rowLimit} \u6761\uFF1B\u5168\u90E8\u660E\u7EC6\u8BF7\u7528 ehr.recruit.candidate.list type=interview \u7FFB\u9875` : void 0,
|
|
6090
|
+
note: notes.join(" ")
|
|
6091
|
+
});
|
|
6092
|
+
}
|
|
6093
|
+
var recruitInterviewOverviewOperations = [
|
|
6094
|
+
{
|
|
6095
|
+
name: "ehr.recruit.interview.overview",
|
|
6096
|
+
resource: "recruit.interview",
|
|
6097
|
+
method: "overview",
|
|
6098
|
+
action: "interview.overview",
|
|
6099
|
+
summary: "\u9762\u8BD5\u8FDB\u5C55\u5168\u5C40\u6C47\u603B\uFF08\u53EA\u8BFB\uFF09\uFF1A\u6309\u65F6\u95F4\u7A97\u7EDF\u8BA1\u5404\u72B6\u6001\uFF08\u672A\u5F00\u59CB/\u5F85\u67E5\u770B/\u5F85\u53CD\u9988/\u5DF2\u53CD\u9988\uFF09\u573A\u6B21\uFF0C\u7ED9\u51FA\u9700 HR \u8DDF\u8FDB\u7684\u4EBA\u6B21\u4E0E\u6309\u9762\u8BD5\u5B98\u7684\u5F85\u529E\u5206\u5E03",
|
|
6100
|
+
capability: "recruit.interview.overview",
|
|
6101
|
+
risk: READ,
|
|
6102
|
+
inputSchema: schemaOf(
|
|
6103
|
+
{
|
|
6104
|
+
days: { type: "integer", minimum: 1, description: `\u6700\u8FD1 N \u5929\uFF08\u542B\u4ECA\u5929\uFF09\uFF0C\u9ED8\u8BA4 ${DEFAULT_DAYS}\uFF1B\u4E0E startDate \u4E8C\u9009\u4E00` },
|
|
6105
|
+
startDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "\u7A97\u53E3\u8D77\u59CB\u65E5 YYYY-MM-DD\uFF0C\u4F18\u5148\u4E8E days" },
|
|
6106
|
+
endDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "\u7A97\u53E3\u7ED3\u675F\u65E5 YYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4ECA\u5929" },
|
|
6107
|
+
maxPages: { type: "integer", minimum: 1, description: `\u6700\u591A\u7FFB\u9875\u6570\uFF0C\u9ED8\u8BA4 ${DEFAULT_MAX_PAGES}\uFF08\u6BCF\u9875 10 \u6761\uFF09` },
|
|
6108
|
+
includeRows: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u5F85\u8DDF\u8FDB\u9010\u4EBA\u6E05\u5355\uFF0C\u9ED8\u8BA4 true" },
|
|
6109
|
+
rowLimit: { type: "integer", minimum: 1, description: "\u5F85\u8DDF\u8FDB\u6E05\u5355\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 20" },
|
|
6110
|
+
interviewerLimit: { type: "integer", minimum: 1, description: "\u6309\u9762\u8BD5\u5B98\u7EDF\u8BA1\u6700\u591A\u8FD4\u56DE\u524D N \u540D\uFF0C\u9ED8\u8BA4 10" }
|
|
6111
|
+
},
|
|
6112
|
+
{ description: "\u53EA\u8BFB\u7EDF\u8BA1\uFF0C\u4E0D\u6539\u4EFB\u4F55\u9762\u8BD5\u8BB0\u5F55" }
|
|
6113
|
+
),
|
|
6114
|
+
handler: interviewOverview
|
|
6115
|
+
}
|
|
6116
|
+
];
|
|
6117
|
+
|
|
5579
6118
|
// src/shortcuts/ehr/operations/salary.ts
|
|
5580
6119
|
function requireMonthRange(value, field) {
|
|
5581
6120
|
if (!Array.isArray(value) || value.length === 0) {
|
|
@@ -5760,7 +6299,9 @@ function buildRegistry() {
|
|
|
5760
6299
|
...recruitWriteOperations,
|
|
5761
6300
|
...recruitStatsOperations,
|
|
5762
6301
|
...recruitPositionOperations,
|
|
5763
|
-
...recruitCandidateImportOperations
|
|
6302
|
+
...recruitCandidateImportOperations,
|
|
6303
|
+
...recruitTagOperations,
|
|
6304
|
+
...recruitInterviewOverviewOperations
|
|
5764
6305
|
];
|
|
5765
6306
|
for (const definition of definitions) {
|
|
5766
6307
|
if (registry.has(definition.name)) {
|
|
@@ -5788,7 +6329,7 @@ var RECRUIT_WITHHELD = [
|
|
|
5788
6329
|
];
|
|
5789
6330
|
var MOBILE_CARD_WITHHELD = ["attend.card.sign.mobile"];
|
|
5790
6331
|
function buildOperations() {
|
|
5791
|
-
|
|
6332
|
+
const standard = ehrOperationDefinitions().map((definition) => ({
|
|
5792
6333
|
name: definition.name,
|
|
5793
6334
|
resource: definition.resource,
|
|
5794
6335
|
summary: definition.summary,
|
|
@@ -5797,6 +6338,7 @@ function buildOperations() {
|
|
|
5797
6338
|
...definition.requiresConfirmation ? { requiresConfirmation: true } : {},
|
|
5798
6339
|
inputSchema: definition.inputSchema
|
|
5799
6340
|
}));
|
|
6341
|
+
return standard;
|
|
5800
6342
|
}
|
|
5801
6343
|
var ehrManifest = {
|
|
5802
6344
|
schemaVersion: 1,
|
|
@@ -5823,10 +6365,23 @@ var ehrManifest = {
|
|
|
5823
6365
|
};
|
|
5824
6366
|
|
|
5825
6367
|
// src/shortcuts/ehr/operations.ts
|
|
6368
|
+
function assertKnownArguments(definition, input) {
|
|
6369
|
+
const schema = definition.inputSchema;
|
|
6370
|
+
if (!schema || schema.additionalProperties !== false) return;
|
|
6371
|
+
const props = schema.properties || {};
|
|
6372
|
+
const known = Object.keys(props);
|
|
6373
|
+
const unknown = Object.keys(input).filter((key) => !known.includes(key));
|
|
6374
|
+
if (unknown.length === 0) return;
|
|
6375
|
+
throw ehrValidationError(
|
|
6376
|
+
"unknown_argument",
|
|
6377
|
+
`\u672A\u77E5\u53C2\u6570\uFF1A${unknown.join("\u3001")}\u3002\u672C\u64CD\u4F5C\u652F\u6301\u7684\u53C2\u6570\uFF1A${known.length ? known.join("\u3001") : "\uFF08\u65E0\uFF09"}\u3002\u53C2\u6570\u540D\u5199\u9519\u4F1A\u88AB\u9759\u9ED8\u5FFD\u7565\u5E76\u8FD4\u56DE\u770B\u4F3C\u6B63\u5E38\u7684\u7ED3\u679C\uFF0C\u8BF7\u6309\u4E0A\u9762\u7684\u53C2\u6570\u540D\u91CD\u4F20\u3002`
|
|
6378
|
+
);
|
|
6379
|
+
}
|
|
5826
6380
|
async function executeEhrOperation(operation, rawInput, context) {
|
|
5827
6381
|
const definition = getEhrOperation(operation);
|
|
5828
6382
|
const input = asObject(rawInput);
|
|
5829
6383
|
assertNoForbiddenKeys(input);
|
|
6384
|
+
assertKnownArguments(definition, input);
|
|
5830
6385
|
const host = {
|
|
5831
6386
|
request(request) {
|
|
5832
6387
|
return context.host.request({
|
|
@@ -5923,8 +6478,13 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
5923
6478
|
});
|
|
5924
6479
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
5925
6480
|
} catch (error) {
|
|
5926
|
-
|
|
5927
|
-
|
|
6481
|
+
const env = failureEnvelope(error);
|
|
6482
|
+
if (shouldReportPlatformError(error)) {
|
|
6483
|
+
const pe = toPlatformError(error);
|
|
6484
|
+
console.error(JSON.stringify({ ...env, code: pe.code, message: pe.message }, null, 2));
|
|
6485
|
+
} else {
|
|
6486
|
+
console.error(JSON.stringify(env, null, 2));
|
|
6487
|
+
}
|
|
5928
6488
|
process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
|
|
5929
6489
|
}
|
|
5930
6490
|
}
|