weaver-work-cli 0.1.71 → 0.1.75
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 +37 -1
- package/dist/chunks/{archive-5P33NAUN.js → archive-OZJ6PYUR.js} +14 -9
- package/dist/chunks/{archive-oa-YTY5D7DG.js → archive-oa-BHL5RK2F.js} +10 -7
- package/dist/chunks/{asset-3Q5MFQBX.js → asset-HKRFRQR2.js} +10 -7
- package/dist/chunks/{asset-idle-PQPNYIS7.js → asset-idle-GGIR4KE7.js} +7 -4
- package/dist/chunks/{attachment-content-7CN7JB6B.js → attachment-content-4OV65NK5.js} +3 -3
- package/dist/chunks/{blog-MFHHK6ZR.js → blog-HYDP4DV3.js} +10 -7
- package/dist/chunks/{caizhilian-OZ435AYW.js → caizhilian-JS4RQZ6Z.js} +10 -7
- package/dist/chunks/{calendar-TNJXS5UC.js → calendar-SWRY4DIT.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/{chunk-FRMDHZSN.js → chunk-2AUFKU2D.js} +11 -11
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/{chunk-X2C5CGGM.js → chunk-4FCBEWNB.js} +74 -68
- package/dist/chunks/{chunk-YN5SD4TX.js → chunk-5D2V7ZAN.js} +2 -2
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-5QUTQHXF.js} +282 -158
- package/dist/chunks/{chunk-SKWKCLJX.js → chunk-5ZJGPEIB.js} +2 -2
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/chunk-BNKUHN4N.js +1346 -0
- package/dist/chunks/{chunk-VMVMEIL3.js → chunk-BSR5TM7U.js} +4 -4
- package/dist/chunks/{chunk-EJLP63UO.js → chunk-ERZY6GYL.js} +7 -3
- package/dist/chunks/{chunk-OFCF23FY.js → chunk-FEZK536Z.js} +25 -9
- package/dist/chunks/{chunk-Q3EXRNB4.js → chunk-I6NOHKEK.js} +1 -1
- package/dist/chunks/{chunk-OZ7CJC7W.js → chunk-J7FAAHWH.js} +2 -2
- package/dist/chunks/{chunk-6MMSLE6K.js → chunk-JJONWB5N.js} +16 -2
- package/dist/chunks/chunk-JOY3HZXL.js +467 -0
- package/dist/chunks/{chunk-2DNCKZRX.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/{chunk-ICNUOWLL.js → chunk-KEA4XQPO.js} +4 -4
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-VJWVB55R.js → chunk-KWJEICD4.js} +2 -2
- package/dist/chunks/{chunk-P3AFNAJ6.js → chunk-LJI4N6FV.js} +1 -1
- package/dist/chunks/{chunk-DRJYPXKC.js → chunk-MXCRKXOP.js} +48 -6
- package/dist/chunks/{chunk-OPTJ6IF7.js → chunk-NWYHCZTY.js} +1 -1
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/{chunk-B4NINGP2.js → chunk-OQCK5SAU.js} +2 -2
- package/dist/chunks/chunk-PG5YSNYY.js +1166 -0
- package/dist/chunks/{chunk-LU2SPJYY.js → chunk-QJWVYOOV.js} +2 -2
- package/dist/chunks/{chunk-SUWR5QEG.js → chunk-QVKRNL7L.js} +287 -305
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-MD5RXRI3.js → chunk-TA2RBUTH.js} +2 -2
- package/dist/chunks/{chunk-SSS75WXW.js → chunk-U6Y32KEV.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-GB2MCJPG.js → chunk-VOMDD2C5.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/{chunk-G7ZM2VOX.js → chunk-ZUB4M4N3.js} +38 -36
- package/dist/chunks/{chunk-XLSJC6JZ.js → chunk-ZWIMLT6P.js} +8 -7
- package/dist/chunks/cli-FULPXIKJ.js +226 -0
- package/dist/chunks/commands-BNWFNTD3.js +70 -0
- package/dist/chunks/{conflict-Y4PXZ2YQ.js → conflict-5BKCDV2F.js} +2 -2
- package/dist/chunks/{contract-C3BGUMBM.js → contract-WI23OXVC.js} +12446 -5964
- package/dist/chunks/{cowork-2AWG4QLA.js → cowork-DZBBVNMQ.js} +11 -8
- package/dist/chunks/{create-flow-LOUOK46Z.js → create-flow-7ZRBRKX7.js} +6 -6
- package/dist/chunks/{data-BSFYMXVO.js → data-PAZVE6QE.js} +6 -3
- package/dist/chunks/{ebuilder-form-LAAMTD2Y.js → ebuilder-form-5SQXIGXN.js} +9 -6
- package/dist/chunks/{ehr-36KEX5SH.js → ehr-CX5F4ZAU.js} +27 -19
- package/dist/chunks/{entry-mode-6N2IGCS4.js → entry-mode-I2BYNONZ.js} +3 -3
- package/dist/chunks/{env-QYLS3EB3.js → env-ZAQZ7EHN.js} +2 -2
- package/dist/chunks/{esb-PTYS3E67.js → esb-DQTXDIBF.js} +10 -7
- package/dist/chunks/{factory-LPFPKZ4T.js → factory-XRI6KZ7H.js} +1 -1
- package/dist/chunks/{fna-JNHCLRDE.js → fna-FK6HQVJL.js} +13 -8
- package/dist/chunks/{group-chat-QP2WX4QJ.js → group-chat-MLWNYM2P.js} +3 -3
- package/dist/chunks/{host-C2BLBIID.js → host-3EPREGXS.js} +6 -3
- package/dist/chunks/{host-QXFKQXNX.js → host-J74JGYAW.js} +6 -3
- package/dist/chunks/{host-57LSRSE7.js → host-KUMU3DDK.js} +6 -3
- package/dist/chunks/{host-7BVR7CQ3.js → host-MEC4VQZA.js} +6 -3
- package/dist/chunks/{host-NS36QFLR.js → host-T6NNQGVZ.js} +6 -3
- package/dist/chunks/{host-K2ZKNXME.js → host-VI7Q45PM.js} +6 -3
- package/dist/chunks/{hrm-FSGO4NSH.js → hrm-KKVAW4P5.js} +8 -5
- package/dist/chunks/{im-2BFGS2XO.js → im-47CIWQNL.js} +7 -4
- package/dist/chunks/{invoice-JKLTTHSZ.js → invoice-CDYRBNIG.js} +21 -16
- package/dist/chunks/{jiuchuanhui-PTABJE7V.js → jiuchuanhui-M7QTRHZK.js} +17 -10
- package/dist/chunks/{lazy-dispatch-YN2ZP3CS.js → lazy-dispatch-FKQJZFI5.js} +22 -8
- package/dist/chunks/{mail-YNO7ZZUK.js → mail-NRBS5N6Y.js} +11 -8
- package/dist/chunks/{meeting-NIDHDBCB.js → meeting-WC5LD3IO.js} +22 -18
- package/dist/chunks/{minute-doc-G3QAT7DE.js → minute-doc-OQUMDTKG.js} +4 -4
- package/dist/chunks/{okr-QC52G6AJ.js → okr-EHKSKMPL.js} +10 -7
- package/dist/chunks/{operations-MQV32ITT.js → operations-V5VM5MS2.js} +7 -4
- package/dist/chunks/{performance-3MQ3AHDQ.js → performance-ZJADXJPN.js} +6 -3
- package/dist/chunks/{plan-ISINIEPY.js → plan-OTDNBDJ7.js} +10 -7
- package/dist/chunks/{project-IJ6DVKT7.js → project-4XVBQ3HX.js} +10 -7
- package/dist/chunks/{reception-3H5LUG2I.js → reception-3FAHOOH7.js} +118 -45
- package/dist/chunks/{recruit-stage-MIOJXP6W.js → recruit-stage-3WTVWW2K.js} +1056 -191
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-3S7AVMXR.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/registry-NBTBXR4L.js +30 -0
- package/dist/chunks/{registry-NHHKOEU3.js → registry-TJGCVRCW.js} +7 -4
- package/dist/chunks/{room-recommend-IOKBJVYP.js → room-recommend-KL62XB2Y.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-IB6EUARH.js → schedule-XOISYUPB.js} +4 -4
- package/dist/chunks/{smart-extract-N2TK3CEF.js → smart-extract-UYGNV3BM.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-RINBAL2M.js → workflow-V54LJPXL.js} +15 -10
- package/dist/cli.js +40 -0
- package/dist/cmd/action.js +3 -1
- package/dist/cmd/doctor/index.js +1 -1
- package/dist/cmd/e10/index.js +1 -1
- package/dist/cmd/identity/index.js +5 -8
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/cmd/update/index.js +38 -0
- package/dist/core/manifest-view.js +1 -1
- package/dist/core/output.js +12 -1
- package/dist/core/runtime-agent.js +13 -0
- package/dist/core/update-notice.js +23 -0
- package/dist/index.js +105 -198
- package/dist/internal/e10/auth/agent-host-key.js +16 -0
- package/dist/internal/e10/auth/agent-hosts.js +45 -9
- package/dist/internal/e10/auth/commands.js +66 -36
- package/dist/internal/e10/auth/session.js +30 -15
- package/dist/internal/e10/auth/xiaoe.js +4 -20
- package/dist/internal/e10/auth-recovery.js +44 -4
- package/dist/internal/e10/context.js +5 -2
- package/dist/internal/update/bootstrap.js +96 -0
- package/dist/internal/update/npm.js +78 -0
- package/dist/internal/update/service.js +252 -0
- package/dist/internal/update/store.js +135 -0
- package/dist/shortcuts/archive/index.js +2 -2
- package/dist/shortcuts/archive/manifest.js +1 -0
- package/dist/shortcuts/archive/operations/search.js +3 -1
- package/dist/shortcuts/archive-oa/index.js +1 -1
- package/dist/shortcuts/asset/index.js +1 -1
- package/dist/shortcuts/asset-idle/index.js +1 -1
- package/dist/shortcuts/blog/index.js +1 -1
- package/dist/shortcuts/caizhilian/index.js +1 -1
- package/dist/shortcuts/calendar/index.js +1 -1
- package/dist/shortcuts/contract/data/bi-config.js +156 -0
- package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
- package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
- package/dist/shortcuts/contract/data/report-renderers.js +414 -0
- package/dist/shortcuts/contract/data/report-spec.js +132 -0
- package/dist/shortcuts/contract/error-actions.js +114 -0
- package/dist/shortcuts/contract/host.js +12 -3
- package/dist/shortcuts/contract/index.js +17 -1
- package/dist/shortcuts/contract/manifest.js +398 -3
- package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
- package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
- package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
- package/dist/shortcuts/contract/operations/collection-node.js +229 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
- package/dist/shortcuts/contract/operations/draft-build.js +940 -0
- package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
- package/dist/shortcuts/contract/operations/first-screen.js +3 -2
- package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
- package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
- package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
- package/dist/shortcuts/contract/operations/ledger.js +4 -1
- package/dist/shortcuts/contract/operations/metrics.js +9 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
- package/dist/shortcuts/contract/operations/page.js +9 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
- package/dist/shortcuts/contract/operations/registry.js +20 -0
- package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
- package/dist/shortcuts/contract/operations/viewlink.js +334 -0
- package/dist/shortcuts/cowork/index.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +1 -1
- package/dist/shortcuts/ehr/index.js +2 -2
- package/dist/shortcuts/ehr/manifest.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-position.js +11 -5
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +10 -9
- package/dist/shortcuts/ehr/operations/recruit.js +390 -196
- package/dist/shortcuts/ehr/operations/shared.js +51 -0
- package/dist/shortcuts/esb/index.js +1 -1
- package/dist/shortcuts/fna/index.js +1 -1
- package/dist/shortcuts/fna/manifest.js +1 -0
- package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
- package/dist/shortcuts/hrm/index.js +1 -1
- package/dist/shortcuts/invoice/index.js +1 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -2
- package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
- package/dist/shortcuts/mail/index.js +2 -2
- package/dist/shortcuts/meeting/index.js +1 -1
- package/dist/shortcuts/meeting/manifest.js +1 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
- package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
- package/dist/shortcuts/meeting/operations/invitation.js +4 -4
- package/dist/shortcuts/meeting/operations/link.js +3 -1
- package/dist/shortcuts/okr/index.js +1 -1
- package/dist/shortcuts/performance/index.js +1 -1
- package/dist/shortcuts/plan/index.js +1 -1
- package/dist/shortcuts/project/index.js +1 -1
- package/dist/shortcuts/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +4 -0
- package/dist/shortcuts/reception/manifest.js +16 -2
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +22 -8
- package/dist/shortcuts/recruit-stage/index.js +16 -3
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +20 -11
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +467 -26
- package/dist/shortcuts/recruit-stage/operations/list.js +73 -2
- package/dist/shortcuts/recruit-stage/operations/profile.js +13 -5
- package/dist/shortcuts/recruit-stage/operations/registry.js +18 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +363 -54
- package/dist/shortcuts/recruit-stage/operations/search.js +80 -16
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +124 -0
- package/dist/shortcuts/recruit-stage/shared.js +174 -56
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
- package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
- package/dist/shortcuts/workflow/index.js +2 -2
- package/dist/shortcuts/workflow/manifest.js +1 -0
- package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
- package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
- package/dist/shortcuts/workflow/operations/form.js +44 -4
- package/docs/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
- package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
- package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- package/skills/weaver-e10-meeting/SKILL.md +13 -0
- package/skills/weaver-e10-okr/SKILL.md +11 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
- package/skills/weaver-e10-performance/SKILL.md +131 -39
- package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
- package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
- package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
- package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
- package/skills/weaver-e10-plan/SKILL.md +10 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +533 -137
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +103 -62
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +282 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +331 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +865 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +162 -11
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
- package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +26 -21
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +33 -27
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +11 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +22 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +42 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +11 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +87 -50
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +48 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +45 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +17 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +162 -31
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +55 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +75 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +12 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +80 -46
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +11 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +12 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +10 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +15 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +7 -3
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +119 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +322 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +166 -76
- package/skills/weaver-e10-shared/SKILL.md +40 -5
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
- package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
- package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +5 -5
- package/dist/chunks/chunk-MZVQKQP5.js +0 -2849
- package/dist/chunks/registry-3GQRYP2R.js +0 -27
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -2,32 +2,37 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createRecruitContextLoader,
|
|
5
|
-
ehrValidationError
|
|
6
|
-
|
|
5
|
+
ehrValidationError,
|
|
6
|
+
isSelfTenant,
|
|
7
|
+
toMenuList
|
|
8
|
+
} from "./chunk-5QUTQHXF.js";
|
|
7
9
|
import {
|
|
8
10
|
MANIFEST_LIST_COMPACT_PATHS,
|
|
9
11
|
manifestView,
|
|
10
12
|
schemaOptionsOf
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2QCCXPNU.js";
|
|
14
|
+
import {
|
|
15
|
+
CONTINUATION_TTL_MS
|
|
16
|
+
} from "./chunk-7BDPM5ST.js";
|
|
12
17
|
import {
|
|
13
18
|
shouldReportPlatformError,
|
|
14
19
|
toPlatformError
|
|
15
20
|
} from "./chunk-MD5CW4B6.js";
|
|
16
|
-
import {
|
|
17
|
-
CONTINUATION_TTL_MS
|
|
18
|
-
} from "./chunk-7BDPM5ST.js";
|
|
19
21
|
import {
|
|
20
22
|
E10ApiError,
|
|
21
23
|
createE10RequestRuntime,
|
|
22
24
|
isE10SessionExpiredResponse,
|
|
23
25
|
requireE10Session
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MXCRKXOP.js";
|
|
25
27
|
import {
|
|
26
28
|
E10_SESSION_EXPIRED_MESSAGE
|
|
27
29
|
} from "./chunk-IZCQU5D5.js";
|
|
28
30
|
import {
|
|
29
31
|
getActiveProfile
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-QVKRNL7L.js";
|
|
33
|
+
import "./chunk-Y3C6MDL7.js";
|
|
34
|
+
import "./chunk-7DE3VMZD.js";
|
|
35
|
+
import "./chunk-2BZ7TY4M.js";
|
|
31
36
|
import {
|
|
32
37
|
CliError,
|
|
33
38
|
isCliError,
|
|
@@ -36,7 +41,7 @@ import {
|
|
|
36
41
|
import "./chunk-BUSC6UAE.js";
|
|
37
42
|
|
|
38
43
|
// src/shortcuts/recruit-stage/index.ts
|
|
39
|
-
import { readFile as
|
|
44
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
40
45
|
|
|
41
46
|
// src/shortcuts/recruit-stage/continuation.ts
|
|
42
47
|
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
@@ -267,7 +272,9 @@ function createRecruitStageHost(ctx, dependencies = {}) {
|
|
|
267
272
|
}
|
|
268
273
|
|
|
269
274
|
// src/shortcuts/recruit-stage/operations/jd-create.ts
|
|
270
|
-
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
275
|
+
import { createHash as createHash2, randomBytes as randomBytes2 } from "node:crypto";
|
|
276
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync as existsSync2, rmSync } from "node:fs";
|
|
277
|
+
import { resolve as resolvePath2, dirname } from "node:path";
|
|
271
278
|
|
|
272
279
|
// src/shortcuts/recruit-stage/operations/types.ts
|
|
273
280
|
function rsSuccess(action, data, meta) {
|
|
@@ -291,8 +298,9 @@ function schemaOf(properties, options = {}) {
|
|
|
291
298
|
}
|
|
292
299
|
|
|
293
300
|
// src/shortcuts/recruit-stage/shared.ts
|
|
294
|
-
import { randomUUID } from "node:crypto";
|
|
301
|
+
import { randomUUID, createHash } from "node:crypto";
|
|
295
302
|
import { unlinkSync } from "node:fs";
|
|
303
|
+
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
|
|
296
304
|
import { homedir as homedir2 } from "node:os";
|
|
297
305
|
import { join, resolve as resolvePath } from "node:path";
|
|
298
306
|
function randHex32() {
|
|
@@ -439,7 +447,10 @@ async function saveFormData(host, opts) {
|
|
|
439
447
|
}
|
|
440
448
|
async function getCandidateByPhone(host, phone) {
|
|
441
449
|
const r = await host.request({ path: "/api/recruit/candidate/getCandidateByPhone", method: "POST", body: { phone: String(phone) } });
|
|
442
|
-
const d = r?.data
|
|
450
|
+
const d = r?.data;
|
|
451
|
+
if (!d || typeof d !== "object") {
|
|
452
|
+
throw rsFail("getCandidateByPhone \u65E0\u6709\u6548\u56DE\u5305\uFF08\u65E0\u6CD5\u786E\u8BA4\u624B\u673A\u53F7\u662F\u5426\u5DF2\u5B58\u5728\uFF09\uFF1A" + JSON.stringify(r || {}).slice(0, 200));
|
|
453
|
+
}
|
|
443
454
|
return {
|
|
444
455
|
talentId: d.talentId ? String(d.talentId) : "",
|
|
445
456
|
candidateId: d.candidateId ? String(d.candidateId) : "",
|
|
@@ -465,7 +476,10 @@ async function checkUnique(host, opts) {
|
|
|
465
476
|
method: "POST",
|
|
466
477
|
body: { dataDetail, module: "ebuilderform", customParam }
|
|
467
478
|
});
|
|
468
|
-
const d = r?.data
|
|
479
|
+
const d = r?.data;
|
|
480
|
+
if (!d || typeof d !== "object" || typeof d.unique !== "boolean" && !Array.isArray(d.formDataIds)) {
|
|
481
|
+
throw rsFail("checkUnique \u65E0\u6709\u6548\u56DE\u5305\uFF08\u65E0\u6CD5\u786E\u8BA4\u624B\u673A\u53F7\u552F\u4E00\u6027\uFF09\uFF1A" + JSON.stringify(r || {}).slice(0, 200));
|
|
482
|
+
}
|
|
469
483
|
let ids = [];
|
|
470
484
|
const rawList = d.formDataIds;
|
|
471
485
|
if (Array.isArray(rawList)) ids = rawList.map((x) => String(x)).filter((x) => /^\d{10,}$/.test(x));
|
|
@@ -474,7 +488,8 @@ async function checkUnique(host, opts) {
|
|
|
474
488
|
const m = text.match(/"formDataIds"\s*:\s*\[([^\]]*)\]/);
|
|
475
489
|
if (m) ids = m[1].match(/\d{10,}/g) || [];
|
|
476
490
|
}
|
|
477
|
-
|
|
491
|
+
const unique = typeof d.unique === "boolean" ? d.unique : ids.length === 0;
|
|
492
|
+
return { unique, formDataIds: [...new Set(ids)] };
|
|
478
493
|
}
|
|
479
494
|
async function getTableMapping(host, objId) {
|
|
480
495
|
const r = await host.request({ path: "/api/ebuilder/form/dataset/v1/getTableMapping?objId=" + encodeURIComponent(objId), method: "GET" });
|
|
@@ -562,15 +577,67 @@ async function runSaveButtonEsbActions(host, opts) {
|
|
|
562
577
|
}
|
|
563
578
|
return done;
|
|
564
579
|
}
|
|
580
|
+
var __teamsCheckMemo = /* @__PURE__ */ new Map();
|
|
581
|
+
async function fetchTeamsCheck(host) {
|
|
582
|
+
let key = "__default__";
|
|
583
|
+
try {
|
|
584
|
+
const session = await host.getSession();
|
|
585
|
+
const base = String(session?.baseUrl || "").replace(/\/+$/, "");
|
|
586
|
+
if (base) key = base;
|
|
587
|
+
} catch {
|
|
588
|
+
}
|
|
589
|
+
const hit = __teamsCheckMemo.get(key);
|
|
590
|
+
if (hit) return hit;
|
|
591
|
+
const pending = host.request({ path: "/api/baseserver/layout/teamsCheck", method: "POST", body: {} }).catch((e) => {
|
|
592
|
+
__teamsCheckMemo.delete(key);
|
|
593
|
+
throw e;
|
|
594
|
+
});
|
|
595
|
+
__teamsCheckMemo.set(key, pending);
|
|
596
|
+
return pending;
|
|
597
|
+
}
|
|
565
598
|
async function resolveCurrentUser(host) {
|
|
566
599
|
try {
|
|
567
|
-
const r = await host
|
|
600
|
+
const r = await fetchTeamsCheck(host);
|
|
568
601
|
const cu = r && (r.currentUser || r.data && r.data.currentUser) || null;
|
|
569
602
|
return cu && cu.id ? { id: String(cu.id), name: cu.username || String(cu.id) } : null;
|
|
570
603
|
} catch {
|
|
571
604
|
return null;
|
|
572
605
|
}
|
|
573
606
|
}
|
|
607
|
+
async function resolveCurrentUserOrg(host) {
|
|
608
|
+
try {
|
|
609
|
+
const r = await fetchTeamsCheck(host);
|
|
610
|
+
const root = r || {};
|
|
611
|
+
const nested = root.data || {};
|
|
612
|
+
const cu = root.currentUser ?? nested.currentUser ?? null;
|
|
613
|
+
if (!cu) return null;
|
|
614
|
+
const isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
615
|
+
const dept = isObj(cu.department) ? cu.department : {};
|
|
616
|
+
const sub = isObj(cu.subCompany) ? cu.subCompany : isObj(cu.subcompany) ? cu.subcompany : {};
|
|
617
|
+
const pick = (...vals) => {
|
|
618
|
+
for (const v of vals) {
|
|
619
|
+
const s = v == null ? "" : String(v).trim();
|
|
620
|
+
if (s) return s;
|
|
621
|
+
}
|
|
622
|
+
return "";
|
|
623
|
+
};
|
|
624
|
+
const org = {
|
|
625
|
+
id: pick(cu.id, nested.employeeId, root.employeeId),
|
|
626
|
+
name: pick(cu.username, cu.name),
|
|
627
|
+
departmentId: pick(dept.id, cu.departmentId, cu.departmentid),
|
|
628
|
+
departmentName: pick(dept.name, cu.departmentName),
|
|
629
|
+
// 🔴 分部 id 实测落在 currentUser.department.subCompanyId(2026-11-28 teamsCheck 实测:
|
|
630
|
+
// department={"id":"9080...","name":"邮件协作组","subCompanyId":"6998..."}),
|
|
631
|
+
// 顶层只有名称 root.subCompanyName,所以两处都要取,缺一不可。
|
|
632
|
+
subCompanyId: pick(dept.subCompanyId, sub.id, cu.subCompanyId, cu.subcompanyId, root.subCompanyId, nested.subCompanyId),
|
|
633
|
+
subCompanyName: pick(dept.subCompanyName, sub.name, cu.subCompanyName, cu.subcompanyName, root.subCompanyName, nested.subCompanyName)
|
|
634
|
+
};
|
|
635
|
+
if (!org.id && !org.name) return null;
|
|
636
|
+
return org;
|
|
637
|
+
} catch {
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
574
641
|
async function resolvePersonId(host, _fieldId, keyword) {
|
|
575
642
|
const kw = String(keyword || "").trim();
|
|
576
643
|
if (!kw) return null;
|
|
@@ -732,12 +799,47 @@ async function fetchDsOptionsRaw(host, objId, fieldId, groupId) {
|
|
|
732
799
|
});
|
|
733
800
|
return r?.data || [];
|
|
734
801
|
}
|
|
802
|
+
var RS_DS_TTL_MS = 10 * 60 * 1e3;
|
|
803
|
+
function rsShortCacheDir() {
|
|
804
|
+
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolvePath(homedir2(), ".weaver-work-cli");
|
|
805
|
+
const root = process.env.E10_SKILL_CACHE_DIR || join(home, "env-cache", "recruit-ops");
|
|
806
|
+
return join(root, "_short-cache");
|
|
807
|
+
}
|
|
808
|
+
async function rsHostBaseUrl(host) {
|
|
809
|
+
try {
|
|
810
|
+
const s = await host.getSession?.();
|
|
811
|
+
return String(s?.baseUrl || "").replace(/\/+$/, "");
|
|
812
|
+
} catch {
|
|
813
|
+
return "";
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
async function rsCachedDsOptions(host, objId, fieldId, groupId) {
|
|
817
|
+
const fetcher = () => fetchDsOptionsRaw(host, objId, fieldId, groupId);
|
|
818
|
+
if (process.env.E10_RS_NO_SHORT_CACHE === "1") return fetcher();
|
|
819
|
+
const baseUrl = await rsHostBaseUrl(host);
|
|
820
|
+
if (!baseUrl) return fetcher();
|
|
821
|
+
const file = join(rsShortCacheDir(), "rs-ds-" + createHash("sha1").update(`${baseUrl}|${objId}|${fieldId}|${groupId}`).digest("hex").slice(0, 24) + ".json");
|
|
822
|
+
try {
|
|
823
|
+
const raw = JSON.parse(await readFile2(file, "utf8"));
|
|
824
|
+
if (raw?.at && Array.isArray(raw.data) && Date.now() - raw.at <= RS_DS_TTL_MS) return raw.data;
|
|
825
|
+
} catch {
|
|
826
|
+
}
|
|
827
|
+
const data = await fetcher();
|
|
828
|
+
if (Array.isArray(data) && data.length) {
|
|
829
|
+
try {
|
|
830
|
+
await mkdir2(rsShortCacheDir(), { recursive: true });
|
|
831
|
+
await writeFile2(file, JSON.stringify({ at: Date.now(), data }), "utf8");
|
|
832
|
+
} catch {
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return data;
|
|
836
|
+
}
|
|
735
837
|
async function getDsOptionsFull(host, objId, fieldId, groupId = "") {
|
|
736
838
|
const key = objId + ":" + fieldId + (groupId ? ":" + groupId : "") + ":full";
|
|
737
839
|
const hit = dsOptionsFullMemo.get(key);
|
|
738
840
|
if (hit) return hit;
|
|
739
841
|
const task = (async () => {
|
|
740
|
-
const list = await
|
|
842
|
+
const list = await rsCachedDsOptions(host, objId, fieldId, groupId);
|
|
741
843
|
const map = {};
|
|
742
844
|
const disabled = [];
|
|
743
845
|
for (const x of list) {
|
|
@@ -765,6 +867,14 @@ async function getDsOptions(host, objId, fieldId, groupId = "") {
|
|
|
765
867
|
});
|
|
766
868
|
return task;
|
|
767
869
|
}
|
|
870
|
+
function cachedDsMap(cache, objId, fieldKey) {
|
|
871
|
+
const fidv = (cache.fields[objId] || {})[fieldKey];
|
|
872
|
+
const opts = fidv && cache.field_options?.[objId] && cache.field_options[objId][fidv];
|
|
873
|
+
if (!opts || !Object.keys(opts).length) return null;
|
|
874
|
+
const map = {};
|
|
875
|
+
for (const [id, name] of Object.entries(opts)) map[name] = id;
|
|
876
|
+
return map;
|
|
877
|
+
}
|
|
768
878
|
async function getFormButtonsForData(host, objId, formId, dataId, layoutId) {
|
|
769
879
|
const body = {
|
|
770
880
|
layoutType: "formLayout",
|
|
@@ -964,43 +1074,15 @@ function buildCardUrl(baseUrl, objId, dataId) {
|
|
|
964
1074
|
if (!baseUrl || !objId || !dataId) return null;
|
|
965
1075
|
return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/card/0/" + objId + "/" + dataId;
|
|
966
1076
|
}
|
|
967
|
-
|
|
968
|
-
async function detectTalentUi(host, cache) {
|
|
969
|
-
const flag = String(cache.talentUi || "");
|
|
970
|
-
if (flag === "1") return true;
|
|
971
|
-
if (flag === "0") return false;
|
|
972
|
-
let installed = false;
|
|
973
|
-
try {
|
|
974
|
-
const r = await host.request({
|
|
975
|
-
path: "/api/ecode/project/searchAll",
|
|
976
|
-
method: "GET",
|
|
977
|
-
query: { page: 1, size: 100 },
|
|
978
|
-
operation: "detect-talent-ui"
|
|
979
|
-
});
|
|
980
|
-
const list = r && r.data && r.data.list || r && r.list || [];
|
|
981
|
-
installed = Array.isArray(list) && list.some((x) => String(x && x.projectName || "").startsWith("recruit-talent-ui"));
|
|
982
|
-
} catch {
|
|
983
|
-
installed = false;
|
|
984
|
-
}
|
|
985
|
-
cache.talentUi = installed ? "1" : "0";
|
|
986
|
-
return installed;
|
|
987
|
-
}
|
|
988
|
-
async function resolveTalentListUrl(host, cache, baseUrl, fallbackListId) {
|
|
989
|
-
if (await detectTalentUi(host, cache)) {
|
|
990
|
-
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE;
|
|
991
|
-
}
|
|
1077
|
+
async function resolveTalentListUrl(_host, _cache, baseUrl, fallbackListId) {
|
|
992
1078
|
return buildListUrl(baseUrl, fallbackListId);
|
|
993
1079
|
}
|
|
994
|
-
async function resolveInterviewListUrlOrNative(
|
|
995
|
-
if (await detectTalentUi(host, cache)) {
|
|
996
|
-
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE + "/interview";
|
|
997
|
-
}
|
|
1080
|
+
async function resolveInterviewListUrlOrNative(_host, _cache, baseUrl, fallbackListId) {
|
|
998
1081
|
return buildListUrl(baseUrl, fallbackListId);
|
|
999
1082
|
}
|
|
1000
|
-
async function talentUiCardUrl(
|
|
1083
|
+
async function talentUiCardUrl(_host, _cache, _baseUrl, talentId) {
|
|
1001
1084
|
if (!talentId) return null;
|
|
1002
|
-
|
|
1003
|
-
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE + "/card?talentId=" + encodeURIComponent(String(talentId));
|
|
1085
|
+
return null;
|
|
1004
1086
|
}
|
|
1005
1087
|
function buildListUrl(baseUrl, listId) {
|
|
1006
1088
|
if (!baseUrl || !listId) return null;
|
|
@@ -1011,9 +1093,9 @@ function buildListUrl(baseUrl, listId) {
|
|
|
1011
1093
|
var SCHEMA_ID_STR = { type: "string", description: "18 \u4F4D\u8BB0\u5F55 id\uFF08\u5B57\u7B26\u4E32\uFF09" };
|
|
1012
1094
|
var DATAKEYS_TEXT = ["position_name"];
|
|
1013
1095
|
var DATAKEYS_MTEXT = ["position_duty", "work_request"];
|
|
1014
|
-
var DEF_TEXT = { recruit_count: "
|
|
1096
|
+
var DEF_TEXT = { recruit_count: "3", number_of_pay_months: "12" };
|
|
1015
1097
|
var DEF_OPTION = { salary_type: "\u6708\u85AA", recruit_type: "\u793E\u4F1A\u62DB\u8058" };
|
|
1016
|
-
var DEF_CURRENT_USER = ["recr_principal", "employ_manager"];
|
|
1098
|
+
var DEF_CURRENT_USER = ["recr_principal", "employ_manager", "interviewer"];
|
|
1017
1099
|
var DEF_FROM_REF = [
|
|
1018
1100
|
"position_nature",
|
|
1019
1101
|
"education",
|
|
@@ -1021,13 +1103,34 @@ var DEF_FROM_REF = [
|
|
|
1021
1103
|
];
|
|
1022
1104
|
var DEF_STATUS = "\u62DB\u8058\u4E2D";
|
|
1023
1105
|
var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
|
|
1106
|
+
var DEF_DICT = {
|
|
1107
|
+
position_nature: "\u5168\u804C",
|
|
1108
|
+
education: "\u672C\u79D1",
|
|
1109
|
+
work_years: "\u4E0D\u9650",
|
|
1110
|
+
// 🔴 2026-11-28 用户口径:招聘优先级默认「中」(该字段走数据字典 低/中/高)
|
|
1111
|
+
recruit_priority: "\u4E2D"
|
|
1112
|
+
};
|
|
1113
|
+
var DEF_CACHE_OPTION = {
|
|
1114
|
+
// 用户表述为「内部招聘」,该字段实际只有这两个选项,即内部招聘的全部渠道
|
|
1115
|
+
internal_channels: ["\u5185\u90E8\u63A8\u8350", "\u5185\u90E8\u9074\u9009"],
|
|
1116
|
+
third_party_platform: ["BOSS\u76F4\u8058", "\u524D\u7A0B\u65E0\u5FE7"]
|
|
1117
|
+
};
|
|
1118
|
+
var DEFAULT_JOB_CATEGORY = "\u6280\u672F";
|
|
1119
|
+
var DEFAULT_DAYS_TO_DEADLINE = 60;
|
|
1120
|
+
var DEF_SALARY = { salary_min: "15", salary_max: "30" };
|
|
1121
|
+
function inferJobCategory(positionName) {
|
|
1122
|
+
const n = String(positionName || "");
|
|
1123
|
+
if (/销售|客户经理|商务|大客户|渠道|BD|城市负责|区域负责|拓展/i.test(n)) return "\u9500\u552E";
|
|
1124
|
+
if (/人力|行政|财务|法务|会计|招聘|HR|人事|薪酬|绩效|审计|合规|秘书/i.test(n)) return "\u804C\u80FD";
|
|
1125
|
+
return DEFAULT_JOB_CATEGORY;
|
|
1126
|
+
}
|
|
1024
1127
|
var NUM_KEYS = /* @__PURE__ */ new Set(["recruit_count", "number_of_pay_months", "salary_min", "salary_max", "internship_duration", "working_days"]);
|
|
1025
1128
|
var PERSON_KEYS = /* @__PURE__ */ new Set(["recr_principal", "recr_helper", "employ_manager", "interviewer"]);
|
|
1026
1129
|
var OPTION_KEYS = /* @__PURE__ */ new Set(["salary_type", "recruit_type", "status"]);
|
|
1027
1130
|
var DICT_KEYS = /* @__PURE__ */ new Set(["position_nature", "job_category", "education", "work_years"]);
|
|
1028
1131
|
var MTEXT_KEYS = /* @__PURE__ */ new Set(["position_duty", "work_request"]);
|
|
1029
1132
|
function fingerprint(value) {
|
|
1030
|
-
return
|
|
1133
|
+
return createHash2("sha256").update(JSON.stringify(value)).digest("hex");
|
|
1031
1134
|
}
|
|
1032
1135
|
function detailValueId(d) {
|
|
1033
1136
|
if (!d) return "";
|
|
@@ -1106,11 +1209,11 @@ async function fetchAllMenusFlat(ctx) {
|
|
|
1106
1209
|
});
|
|
1107
1210
|
const flat = [];
|
|
1108
1211
|
(function walk2(ns) {
|
|
1109
|
-
for (const n of ns
|
|
1212
|
+
for (const n of toMenuList(ns)) if (n && typeof n === "object") {
|
|
1110
1213
|
flat.push(n);
|
|
1111
|
-
walk2(n.children
|
|
1214
|
+
walk2(n.children ?? n.childs);
|
|
1112
1215
|
}
|
|
1113
|
-
})(r?.data
|
|
1216
|
+
})(r?.data);
|
|
1114
1217
|
allMenusMemo.set(key, flat);
|
|
1115
1218
|
return flat;
|
|
1116
1219
|
} catch {
|
|
@@ -1133,6 +1236,93 @@ async function findWorkPlaceMenu(ctx) {
|
|
|
1133
1236
|
}
|
|
1134
1237
|
return null;
|
|
1135
1238
|
}
|
|
1239
|
+
var FLOW_MENU_NAMES = ["\u62DB\u8058\u6D41\u7A0B"];
|
|
1240
|
+
var flowDataMemo = /* @__PURE__ */ new Map();
|
|
1241
|
+
function isDefaultFlowRow(x) {
|
|
1242
|
+
if (!x || typeof x !== "object") return false;
|
|
1243
|
+
const cands = [x.is_default, x.isDefault, x.default_flow, x.defaultFlow, x.is_enable, x.enabled, x.status];
|
|
1244
|
+
for (const v of cands) {
|
|
1245
|
+
if (v === true || v === 1 || v === "1") return true;
|
|
1246
|
+
const s = String(v ?? "");
|
|
1247
|
+
if (s === "\u662F" || s === "\u542F\u7528" || s === "\u9ED8\u8BA4") return true;
|
|
1248
|
+
}
|
|
1249
|
+
return false;
|
|
1250
|
+
}
|
|
1251
|
+
async function resolveFlowByData(ctx) {
|
|
1252
|
+
const { host, appId, cache } = ctx;
|
|
1253
|
+
let menu = null;
|
|
1254
|
+
const allSearch = (cache.lists || {}).all_search || [];
|
|
1255
|
+
menu = allSearch.find(
|
|
1256
|
+
(m) => m && m.listId && FLOW_MENU_NAMES.some((n) => String(m.menuName || "").includes(n))
|
|
1257
|
+
) || null;
|
|
1258
|
+
if (!menu) {
|
|
1259
|
+
const hit2 = findMenuNode(cache.menus || [], FLOW_MENU_NAMES, (m) => m && m.listId);
|
|
1260
|
+
if (hit2) menu = hit2;
|
|
1261
|
+
}
|
|
1262
|
+
if (!menu) {
|
|
1263
|
+
const flat = await fetchAllMenusFlat(ctx);
|
|
1264
|
+
const hit3 = findMenuNode(flat, FLOW_MENU_NAMES, (m) => m && m.listId);
|
|
1265
|
+
if (hit3) menu = hit3;
|
|
1266
|
+
}
|
|
1267
|
+
if (!menu || !menu.listId) return null;
|
|
1268
|
+
const key = appId + "|" + String(menu.listId);
|
|
1269
|
+
if (flowDataMemo.has(key)) return flowDataMemo.get(key) ?? null;
|
|
1270
|
+
try {
|
|
1271
|
+
let flowObjId = "";
|
|
1272
|
+
try {
|
|
1273
|
+
const liBody = {
|
|
1274
|
+
cusMenuId: menu.cusMenuId || "",
|
|
1275
|
+
listId: String(menu.listId),
|
|
1276
|
+
urlPageTitle: String(menu.menuName || "\u62DB\u8058\u6D41\u7A0B")
|
|
1277
|
+
};
|
|
1278
|
+
liBody["appId_" + String(menu.listId)] = appId;
|
|
1279
|
+
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: liBody });
|
|
1280
|
+
flowObjId = String(li?.data?.objid || "");
|
|
1281
|
+
} catch {
|
|
1282
|
+
}
|
|
1283
|
+
if (!flowObjId) {
|
|
1284
|
+
const t = await host.request({ path: `/api/ebuilder/form/obj/getObjsByTag?appId=${appId}&tag=uf_rcrt_recruit_flow`, method: "GET" }).catch(() => null);
|
|
1285
|
+
flowObjId = Array.isArray(t?.data) && t.data[0] ? String(t.data[0].id || "") : "";
|
|
1286
|
+
}
|
|
1287
|
+
if (!flowObjId) {
|
|
1288
|
+
flowDataMemo.set(key, null);
|
|
1289
|
+
return null;
|
|
1290
|
+
}
|
|
1291
|
+
const body = {
|
|
1292
|
+
current: 1,
|
|
1293
|
+
pageSize: 50,
|
|
1294
|
+
tableuid: randHex32(),
|
|
1295
|
+
listId: String(menu.listId),
|
|
1296
|
+
searchParamData: { searchType: "3", type: "and" },
|
|
1297
|
+
terminal: "PC",
|
|
1298
|
+
browser: "Chrome",
|
|
1299
|
+
requiredMatch: 1,
|
|
1300
|
+
mapResult: 1,
|
|
1301
|
+
recheckQuery: 1,
|
|
1302
|
+
isFollow: 0,
|
|
1303
|
+
isShareToMe: 0,
|
|
1304
|
+
filterCondition: {},
|
|
1305
|
+
cusMenuId: String(menu.cusMenuId || ""),
|
|
1306
|
+
urlPageTitle: String(menu.menuName || "\u62DB\u8058\u6D41\u7A0B"),
|
|
1307
|
+
menuName: String(menu.menuName || "\u62DB\u8058\u6D41\u7A0B")
|
|
1308
|
+
};
|
|
1309
|
+
const r = await host.request({
|
|
1310
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${flowObjId}&cid=${flowObjId}`,
|
|
1311
|
+
body,
|
|
1312
|
+
headers: { ebBusinessId: String(menu.listId) }
|
|
1313
|
+
});
|
|
1314
|
+
const rows = (r?.data?.data || r?.data?.displayData || []).filter(Boolean);
|
|
1315
|
+
const pick = rows.find(isDefaultFlowRow) || (rows.length === 1 ? rows[0] : null);
|
|
1316
|
+
const id = pick ? String(pick.form_data_id || pick.id || "") : "";
|
|
1317
|
+
const name = pick ? stripHtml(pick.name || pick.flow_name || pick.content || "") : "";
|
|
1318
|
+
const out = id && name ? { id, name } : null;
|
|
1319
|
+
flowDataMemo.set(key, out);
|
|
1320
|
+
return out;
|
|
1321
|
+
} catch {
|
|
1322
|
+
flowDataMemo.set(key, null);
|
|
1323
|
+
return null;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1136
1326
|
var workPlaceMemo = /* @__PURE__ */ new Map();
|
|
1137
1327
|
function stripHtml(s) {
|
|
1138
1328
|
return String(s ?? "").replace(/<[^>]*>/g, "").trim();
|
|
@@ -1229,6 +1419,7 @@ async function resolveWorkLocation(ctx, value) {
|
|
|
1229
1419
|
return hit ? { id: hit.id, name: hit.detail || hit.name || String(value) } : null;
|
|
1230
1420
|
}
|
|
1231
1421
|
async function resolveDefaultWorkLocation(ctx) {
|
|
1422
|
+
if (!isSelfTenant(ctx.cache?.tenantKey)) return null;
|
|
1232
1423
|
return resolveWorkLocation(ctx, DEFAULT_WORK_LOCATION);
|
|
1233
1424
|
}
|
|
1234
1425
|
async function resolveSetValue(ctx, key, value, refByFid) {
|
|
@@ -1240,8 +1431,8 @@ async function resolveSetValue(ctx, key, value, refByFid) {
|
|
|
1240
1431
|
if (key === "salary_min" || key === "salary_max") {
|
|
1241
1432
|
const n = Number(String(value).replace(/,/g, ""));
|
|
1242
1433
|
if (Number.isFinite(n) && n > 0) {
|
|
1243
|
-
const k = n / 1e3;
|
|
1244
|
-
return { formField: { id }, content: String(Number.isInteger(k) ? k : Number(k.toFixed(
|
|
1434
|
+
const k = n >= 1e3 ? n / 1e3 : n;
|
|
1435
|
+
return { formField: { id }, content: String(Number.isInteger(k) ? k : Number(k.toFixed(2))) };
|
|
1245
1436
|
}
|
|
1246
1437
|
}
|
|
1247
1438
|
return { formField: { id }, content: String(value) };
|
|
@@ -1424,14 +1615,35 @@ async function buildJd(opts) {
|
|
|
1424
1615
|
skippedSets.push(k + "=" + v);
|
|
1425
1616
|
}
|
|
1426
1617
|
}
|
|
1618
|
+
const cacheOptionId = (key, name) => {
|
|
1619
|
+
const id = fid(key);
|
|
1620
|
+
if (!id) return "";
|
|
1621
|
+
const optMap = (cache.field_options?.[objId] || {})[String(id)] || {};
|
|
1622
|
+
for (const oid of Object.keys(optMap)) {
|
|
1623
|
+
if (String(optMap[oid]) === name) return String(oid);
|
|
1624
|
+
}
|
|
1625
|
+
return "";
|
|
1626
|
+
};
|
|
1627
|
+
const optionIdOf = async (key, name) => {
|
|
1628
|
+
const hit = cacheOptionId(key, name);
|
|
1629
|
+
if (hit) return hit;
|
|
1630
|
+
const id = fid(key);
|
|
1631
|
+
if (!id) return "";
|
|
1632
|
+
const m = await getDsOptions(host, objId, id).catch(() => ({}));
|
|
1633
|
+
return String(m[name] || "");
|
|
1634
|
+
};
|
|
1427
1635
|
if (!hasKey("status")) {
|
|
1428
1636
|
if (!fid("status")) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 status\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1637
|
+
const statusId = await optionIdOf("status", DEF_STATUS);
|
|
1638
|
+
if (!statusId) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u300C\u62DB\u8058\u72B6\u6001\u300D\u672A\u89E3\u6790\u5230\u300C" + DEF_STATUS + "\u300D\u9009\u9879\uFF08\u7F13\u5B58 field_options \u4E0E ds/options \u5747\u672A\u547D\u4E2D\uFF09");
|
|
1639
|
+
put({ formField: { id: fid("status") }, dataOptions: [{ optionId: statusId, content: DEF_STATUS }] });
|
|
1640
|
+
}
|
|
1641
|
+
let defFlow = cache.defaultRecruitFlow;
|
|
1642
|
+
let flowFromData = false;
|
|
1643
|
+
if (!hasKey("recruit_flow") && fid("recruit_flow") && (!defFlow || !defFlow.id)) {
|
|
1644
|
+
defFlow = await resolveFlowByData(ctx).catch(() => null);
|
|
1645
|
+
flowFromData = !!(defFlow && defFlow.id);
|
|
1433
1646
|
}
|
|
1434
|
-
const defFlow = cache.defaultRecruitFlow;
|
|
1435
1647
|
if (!hasKey("recruit_flow") && fid("recruit_flow") && defFlow && defFlow.id) {
|
|
1436
1648
|
put({ formField: { id: fid("recruit_flow") }, dataOptions: [{ optionId: String(defFlow.id), content: defFlow.name }] });
|
|
1437
1649
|
}
|
|
@@ -1456,10 +1668,9 @@ async function buildJd(opts) {
|
|
|
1456
1668
|
}
|
|
1457
1669
|
for (const [k, name] of Object.entries(DEF_OPTION)) {
|
|
1458
1670
|
if (fid(k) && !hasKey(k)) {
|
|
1459
|
-
const
|
|
1460
|
-
const oid = m[name];
|
|
1671
|
+
const oid = await optionIdOf(k, name);
|
|
1461
1672
|
if (oid) {
|
|
1462
|
-
put({ formField: { id: fid(k) }, dataOptions: [{ optionId:
|
|
1673
|
+
put({ formField: { id: fid(k) }, dataOptions: [{ optionId: oid, content: name }] });
|
|
1463
1674
|
filled.push(k);
|
|
1464
1675
|
}
|
|
1465
1676
|
}
|
|
@@ -1476,6 +1687,99 @@ async function buildJd(opts) {
|
|
|
1476
1687
|
}
|
|
1477
1688
|
}
|
|
1478
1689
|
}
|
|
1690
|
+
const defaultedFields = [];
|
|
1691
|
+
const defaultSkipped = [];
|
|
1692
|
+
const putDictDefault = (key, name) => {
|
|
1693
|
+
const id = fid(key);
|
|
1694
|
+
if (!id || map.has(String(id))) return false;
|
|
1695
|
+
const group = dictGroupOf(cache, detailValueId(refByFid[String(id)]));
|
|
1696
|
+
const did = dictIdByName(cache, name, group) || dictIdByName(cache, name, "");
|
|
1697
|
+
if (!did) return false;
|
|
1698
|
+
put({ formField: { id }, dataOptions: [{ optionId: String(did), content: name }] });
|
|
1699
|
+
filled.push(key);
|
|
1700
|
+
defaultedFields.push({ field: key, value: name });
|
|
1701
|
+
return true;
|
|
1702
|
+
};
|
|
1703
|
+
const putCacheOptionDefault = (key, names) => {
|
|
1704
|
+
const id = fid(key);
|
|
1705
|
+
if (!id || map.has(String(id))) return false;
|
|
1706
|
+
const picked = [];
|
|
1707
|
+
const missed = [];
|
|
1708
|
+
for (const name of names) {
|
|
1709
|
+
const oid = cacheOptionId(key, name);
|
|
1710
|
+
if (oid) picked.push({ optionId: oid, content: name });
|
|
1711
|
+
else missed.push(name);
|
|
1712
|
+
}
|
|
1713
|
+
if (!picked.length) {
|
|
1714
|
+
defaultSkipped.push({
|
|
1715
|
+
field: key,
|
|
1716
|
+
wanted: names.join("\u3001"),
|
|
1717
|
+
reason: "\u73AF\u5883 field_options \u4E2D\u4E0D\u5B58\u5728\u8BE5\u9009\u9879\uFF0C\u672C\u6B21\u672A\u586B\uFF08\u8BE5\u5B57\u6BB5\u53EF\u80FD\u7559\u7A7A\uFF09"
|
|
1718
|
+
});
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
put({ formField: { id }, dataOptions: picked });
|
|
1722
|
+
filled.push(key);
|
|
1723
|
+
defaultedFields.push({ field: key, value: picked.map((p) => p.content).join("\u3001") });
|
|
1724
|
+
if (missed.length) {
|
|
1725
|
+
defaultSkipped.push({
|
|
1726
|
+
field: key,
|
|
1727
|
+
wanted: missed.join("\u3001"),
|
|
1728
|
+
reason: "\u90E8\u5206\u9009\u9879\u5728\u73AF\u5883\u4E2D\u4E0D\u5B58\u5728\uFF0C\u4EC5\u586B\u5165\u5DF2\u547D\u4E2D\u7684\u503C"
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
return true;
|
|
1732
|
+
};
|
|
1733
|
+
for (const [k, name] of Object.entries(DEF_DICT)) putDictDefault(k, name);
|
|
1734
|
+
putDictDefault("job_category", inferJobCategory(positionName));
|
|
1735
|
+
for (const [k, names] of Object.entries(DEF_CACHE_OPTION)) putCacheOptionDefault(k, names);
|
|
1736
|
+
const deadlineFid = fid("recruitment_deadline");
|
|
1737
|
+
if (deadlineFid && !map.has(String(deadlineFid))) {
|
|
1738
|
+
const d = /* @__PURE__ */ new Date();
|
|
1739
|
+
d.setDate(d.getDate() + DEFAULT_DAYS_TO_DEADLINE);
|
|
1740
|
+
const pad = (x) => String(x).padStart(2, "0");
|
|
1741
|
+
const deadline = d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate());
|
|
1742
|
+
put({ formField: { id: deadlineFid }, content: deadline });
|
|
1743
|
+
filled.push("recruitment_deadline");
|
|
1744
|
+
defaultedFields.push({ field: "recruitment_deadline", value: deadline });
|
|
1745
|
+
}
|
|
1746
|
+
for (const [k, v] of Object.entries(DEF_SALARY)) {
|
|
1747
|
+
const id = fid(k);
|
|
1748
|
+
if (!id || map.has(String(id))) continue;
|
|
1749
|
+
put({ formField: { id }, content: v });
|
|
1750
|
+
filled.push(k);
|
|
1751
|
+
defaultedFields.push({ field: k, value: v });
|
|
1752
|
+
}
|
|
1753
|
+
const needOrg = ["sub_company", "department"].some((k) => {
|
|
1754
|
+
const id = fid(k);
|
|
1755
|
+
return !!id && !map.has(String(id));
|
|
1756
|
+
});
|
|
1757
|
+
let orgDefaultWarning = null;
|
|
1758
|
+
if (needOrg) {
|
|
1759
|
+
const org = await resolveCurrentUserOrg(host).catch(() => null);
|
|
1760
|
+
if (!org) {
|
|
1761
|
+
orgDefaultWarning = "\u672A\u80FD\u89E3\u6790\u5F53\u524D\u767B\u5F55\u4EBA\u7684\u6240\u5C5E\u7EC4\u7EC7\uFF08teamsCheck \u4E0D\u53EF\u7528\uFF09\uFF0C\u672C\u6B21\u4E0D\u5199\u300C\u804C\u4F4D\u6240\u5C5E\u5206\u90E8 / \u804C\u4F4D\u6240\u5C5E\u90E8\u95E8\u300D\uFF1B\u8BF7\u7528 sets \u6307\u5B9A";
|
|
1762
|
+
} else {
|
|
1763
|
+
if (fid("sub_company") && !hasKey("sub_company")) {
|
|
1764
|
+
if (org.subCompanyId) {
|
|
1765
|
+
put({ formField: { id: fid("sub_company") }, dataOptions: [{ optionId: org.subCompanyId, content: org.subCompanyName }] });
|
|
1766
|
+
filled.push("sub_company");
|
|
1767
|
+
defaultedFields.push({ field: "sub_company", value: org.subCompanyName });
|
|
1768
|
+
} else {
|
|
1769
|
+
defaultSkipped.push({ field: "sub_company", wanted: "\u5F53\u524D\u4EBA\u6240\u5728\u5206\u90E8", reason: "teamsCheck \u672A\u8FD4\u56DE\u5206\u90E8\u8BB0\u5F55 id\uFF08subCompanyId\uFF09\uFF0C\u672C\u6B21\u672A\u586B" });
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
if (fid("department") && !hasKey("department")) {
|
|
1773
|
+
if (org.departmentId) {
|
|
1774
|
+
put({ formField: { id: fid("department") }, dataOptions: [{ optionId: org.departmentId, content: org.departmentName }] });
|
|
1775
|
+
filled.push("department");
|
|
1776
|
+
defaultedFields.push({ field: "department", value: org.departmentName });
|
|
1777
|
+
} else {
|
|
1778
|
+
defaultSkipped.push({ field: "department", wanted: "\u5F53\u524D\u4EBA\u6240\u5728\u90E8\u95E8", reason: "teamsCheck \u672A\u8FD4\u56DE\u90E8\u95E8\u8BB0\u5F55 id\uFF0C\u672C\u6B21\u672A\u586B" });
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1479
1783
|
const inheritedSalaryWarnings = [];
|
|
1480
1784
|
for (const key of ["salary_min", "salary_max"]) {
|
|
1481
1785
|
const hit = inheritedFromRef.find((x) => x.field === key);
|
|
@@ -1493,6 +1797,8 @@ async function buildJd(opts) {
|
|
|
1493
1797
|
put({ formField: { id: fid("work_location") }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
|
|
1494
1798
|
filled.push("work_location");
|
|
1495
1799
|
workLocationDefault = loc.name;
|
|
1800
|
+
} else if (!isSelfTenant(ctx.cache?.tenantKey)) {
|
|
1801
|
+
workLocationWarning = "\u5F53\u524D\u73AF\u5883\u672A\u914D\u7F6E\u9ED8\u8BA4\u529E\u516C\u5730\u70B9\uFF0C\u672C\u6B21\u4E0D\u5199 work_location\uFF1B\u8BF7\u7528 sets \u6307\u5B9A";
|
|
1496
1802
|
} else {
|
|
1497
1803
|
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 sets \u6307\u5B9A`;
|
|
1498
1804
|
}
|
|
@@ -1514,6 +1820,8 @@ async function buildJd(opts) {
|
|
|
1514
1820
|
status: DEF_STATUS,
|
|
1515
1821
|
// 解析不到环境默认流程时不写该字段,表单自身默认值生效;文案按实际行为表述,避免误导。
|
|
1516
1822
|
recruitFlow: defFlow && defFlow.id ? defFlow.name : "\uFF08\u6CBF\u7528\u8868\u5355\u9ED8\u8BA4\u503C\uFF09",
|
|
1823
|
+
// 流程来源:cache=上下文缓存命中;data=缓存缺失时从「招聘流程」列表数据兜底解析
|
|
1824
|
+
recruitFlowSource: defFlow && defFlow.id ? flowFromData ? "data" : "cache" : void 0,
|
|
1517
1825
|
currentUser: currentUser ? currentUser.name : null,
|
|
1518
1826
|
setApplied: appliedSets,
|
|
1519
1827
|
setSkipped: skippedSets,
|
|
@@ -1524,6 +1832,14 @@ async function buildJd(opts) {
|
|
|
1524
1832
|
inheritedNote: inheritedFromRef.length ? "\u4EE5\u4E0A\u5B57\u6BB5\u672A\u6307\u5B9A\uFF0C\u503C\u7EE7\u627F\u81EA\u73AF\u5883\u5185\u6700\u8FD1\u4E00\u6761\u804C\u4F4D\u8BB0\u5F55\uFF0C\u53EF\u80FD\u542B\u5386\u53F2\u810F\u6570\u636E\uFF0C\u8BF7\u6838\u5BF9\u540E\u518D\u63D0\u4EA4\uFF08\u5DE5\u4F5C\u5730\u70B9\u4E0D\u53C2\u4E0E\u7EE7\u627F\uFF09" : void 0,
|
|
1525
1833
|
workLocationDefault: workLocationDefault || void 0,
|
|
1526
1834
|
workLocationWarning: workLocationWarning || void 0,
|
|
1835
|
+
// A/C 告警:想填但填不上的默认值(环境缺选项 / 取不到记录 id)。不阻断创建,但必须让用户看见,
|
|
1836
|
+
// 否则会出现「摘要说已默认填写、实际字段留空」这种最难排查的情况。
|
|
1837
|
+
defaultSkipped: defaultSkipped.length ? defaultSkipped : void 0,
|
|
1838
|
+
defaultSkippedNote: defaultSkipped.length ? "\u4EE5\u4E0A\u9ED8\u8BA4\u503C\u672A\u80FD\u586B\u5165\uFF08\u73AF\u5883\u7F3A\u5C11\u5BF9\u5E94\u9009\u9879\uFF0C\u6216\u53D6\u4E0D\u5230\u8BB0\u5F55 id\uFF09\uFF0C\u5BF9\u5E94\u5B57\u6BB5\u53EF\u80FD\u7559\u7A7A\uFF1B\u8BF7\u6838\u5BF9\u540E\u7528 sets \u663E\u5F0F\u6307\u5B9A" : void 0,
|
|
1839
|
+
orgDefaultWarning: orgDefaultWarning || void 0,
|
|
1840
|
+
// 本次自动补上的固定默认值(用户未指定、继承也没拿到):摘要里明示,便于创建前核对
|
|
1841
|
+
defaultedFields: defaultedFields.length ? defaultedFields : void 0,
|
|
1842
|
+
defaultedNote: defaultedFields.length ? "\u4EE5\u4E0A\u5B57\u6BB5\u672A\u6307\u5B9A\uFF0C\u5DF2\u6309\u62DB\u8058\u52A9\u624B\u56FA\u5B9A\u9ED8\u8BA4\u503C\u81EA\u52A8\u586B\u5165\uFF08\u53EF\u968F\u65F6\u7528 sets \u8986\u76D6\uFF09" : void 0,
|
|
1527
1843
|
requiredDefaultsFilled
|
|
1528
1844
|
}
|
|
1529
1845
|
};
|
|
@@ -1656,6 +1972,53 @@ async function prepare(args, env) {
|
|
|
1656
1972
|
confirmHint: "\u7528\u6237\u660E\u786E\u786E\u8BA4\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E\u672C continuation \u8C03\u7528 recruit-stage.jd.create.apply"
|
|
1657
1973
|
});
|
|
1658
1974
|
}
|
|
1975
|
+
var JD_PENDING_TTL_MS = 10 * 60 * 1e3;
|
|
1976
|
+
function jdPendingFile(positionName) {
|
|
1977
|
+
const home = process.env.USERPROFILE || process.env.HOME || ".";
|
|
1978
|
+
const key = createHash2("sha1").update(positionName).digest("hex").slice(0, 16);
|
|
1979
|
+
return resolvePath2(home, ".weaver-work-cli", "state", "jd-pending", key + ".json");
|
|
1980
|
+
}
|
|
1981
|
+
function readJdPending(positionName) {
|
|
1982
|
+
try {
|
|
1983
|
+
const p = jdPendingFile(positionName);
|
|
1984
|
+
if (!existsSync2(p)) return null;
|
|
1985
|
+
const j = JSON.parse(readFileSync(p, "utf8"));
|
|
1986
|
+
if (String(j.positionName || "") !== positionName) return null;
|
|
1987
|
+
if (!j.formDataId) return null;
|
|
1988
|
+
if (Date.now() - Number(j.savedAt || 0) > JD_PENDING_TTL_MS) return null;
|
|
1989
|
+
return { formDataId: String(j.formDataId), savedAt: Number(j.savedAt) };
|
|
1990
|
+
} catch {
|
|
1991
|
+
return null;
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
function writeJdPending(positionName, formDataId) {
|
|
1995
|
+
try {
|
|
1996
|
+
const p = jdPendingFile(positionName);
|
|
1997
|
+
mkdirSync(dirname(p), { recursive: true });
|
|
1998
|
+
writeFileSync(p, JSON.stringify({ positionName, formDataId, savedAt: Date.now() }), "utf8");
|
|
1999
|
+
} catch {
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
async function jdStatusName(ctx, formId, objId, dataId) {
|
|
2003
|
+
try {
|
|
2004
|
+
const rec = await getFormDataRecord(ctx.host, formId, dataId, objId);
|
|
2005
|
+
const dets = rec?.dataDetails || [];
|
|
2006
|
+
const statusFid = String((ctx.cache.fields[objId] || {})["status"] || "");
|
|
2007
|
+
const cell = dets.find((d) => String(d.fieldId) === statusFid && !d.subFormId);
|
|
2008
|
+
if (!cell) return "";
|
|
2009
|
+
const direct = String(cell.dataOptions?.[0]?.content || cell.content || "");
|
|
2010
|
+
if (direct) return direct;
|
|
2011
|
+
const oid = String(cell.dataOptions?.[0]?.optionId || "");
|
|
2012
|
+
if (oid) {
|
|
2013
|
+
const map = await getDsOptions(ctx.host, objId, statusFid).catch(() => ({}));
|
|
2014
|
+
const hit = Object.keys(map).find((k) => String(map[k]) === oid);
|
|
2015
|
+
if (hit) return hit;
|
|
2016
|
+
}
|
|
2017
|
+
return "";
|
|
2018
|
+
} catch {
|
|
2019
|
+
return "";
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
1659
2022
|
async function apply(args, env) {
|
|
1660
2023
|
if (args.confirm !== true) throw rsConfirmationError("recruit-stage.jd.create.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
|
|
1661
2024
|
if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
|
|
@@ -1687,19 +2050,43 @@ async function apply(args, env) {
|
|
|
1687
2050
|
throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF08\u5B57\u6BB5\u503C\u5DF2\u53D8\u5316\uFF09\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
|
|
1688
2051
|
}
|
|
1689
2052
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
2053
|
+
let formDataId = "";
|
|
2054
|
+
let resumedFromPending = false;
|
|
2055
|
+
let alreadyCreated = false;
|
|
2056
|
+
const pending = readJdPending(positionName);
|
|
2057
|
+
if (pending) {
|
|
2058
|
+
const st = await jdStatusName(ctx, jd.formId, jd.objId, pending.formDataId);
|
|
2059
|
+
formDataId = pending.formDataId;
|
|
2060
|
+
resumedFromPending = true;
|
|
2061
|
+
if (st && st !== "\u5F85\u53D1\u5E03") alreadyCreated = true;
|
|
2062
|
+
}
|
|
2063
|
+
if (!formDataId) {
|
|
2064
|
+
try {
|
|
2065
|
+
formDataId = await saveFormData(host, {
|
|
2066
|
+
appId: jd.appId,
|
|
2067
|
+
formId: jd.formId,
|
|
2068
|
+
objId: jd.objId,
|
|
2069
|
+
name: "\u804C\u4F4D\u7BA1\u7406-" + positionName,
|
|
2070
|
+
dataDetails: jd.dataDetails
|
|
2071
|
+
});
|
|
2072
|
+
} catch (e) {
|
|
2073
|
+
throw rsFail("\u2460 \u4FDD\u5B58\u804C\u4F4D\u7BA1\u7406\u8868\u5355\u5931\u8D25\uFF1A" + String(e?.message || e));
|
|
2074
|
+
}
|
|
2075
|
+
writeJdPending(positionName, formDataId);
|
|
2076
|
+
}
|
|
2077
|
+
let r2 = null;
|
|
2078
|
+
if (!alreadyCreated) {
|
|
2079
|
+
try {
|
|
2080
|
+
r2 = await host.request({ path: "/api/recruit/position/v2/addPosition?formDataId=" + formDataId, method: "POST" });
|
|
2081
|
+
} catch (e) {
|
|
2082
|
+
throw rsFail("\u2461 addPosition \u751F\u6210\u804C\u4F4D\u5931\u8D25\uFF08\u5DF2\u4FDD\u5B58\u7684\u804C\u4F4D\u8BB0\u5F55 id=" + formDataId + " \u5DF2\u4FDD\u7559\uFF0C10 \u5206\u949F\u5185\u91CD\u8DD1\u53EF\u7EED\uFF09\uFF1A" + String(e?.message || e));
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
1698
2085
|
const data = r2?.data || {};
|
|
1699
2086
|
const positionPostId = data.positionPostId;
|
|
1700
2087
|
const checkRpa = data.checkRpa;
|
|
1701
2088
|
const rpaValidMsg = data.rpaValidMsg || null;
|
|
1702
|
-
const okByResponse = r2?.status !== false && r2?.fail !== true && data.fail !== true;
|
|
2089
|
+
const okByResponse = r2 ? r2?.status !== false && r2?.fail !== true && data.fail !== true : true;
|
|
1703
2090
|
const verification = await verifySubmitted({
|
|
1704
2091
|
host,
|
|
1705
2092
|
formId: jd.formId,
|
|
@@ -1716,6 +2103,7 @@ async function apply(args, env) {
|
|
|
1716
2103
|
if (verification.mismatches.length) invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
1717
2104
|
const recordOk = verification.unavailable ? okByResponse : verification.mismatches.length === 0;
|
|
1718
2105
|
const created = okByResponse && recordOk;
|
|
2106
|
+
if (created) writeJdPending(positionName, formDataId);
|
|
1719
2107
|
const result = !created ? "failed" : verification.mismatches.length ? "partial" : "success";
|
|
1720
2108
|
const listUrl = buildListUrl(ctx.baseUrl, ctx.cache.lists?.position?.listId || "");
|
|
1721
2109
|
const cardUrl = buildCardUrl(ctx.baseUrl, jd.objId, formDataId);
|
|
@@ -1723,6 +2111,9 @@ async function apply(args, env) {
|
|
|
1723
2111
|
mode: "apply",
|
|
1724
2112
|
result,
|
|
1725
2113
|
formDataId,
|
|
2114
|
+
// 幂等语义(供 Agent 与用户判断"是否真的又建了一条")
|
|
2115
|
+
resumedFromPending,
|
|
2116
|
+
alreadyCreatedBeforeThisRun: alreadyCreated,
|
|
1726
2117
|
positionPostId: positionPostId || null,
|
|
1727
2118
|
rpaChecked: checkRpa === void 0 ? null : !!checkRpa,
|
|
1728
2119
|
rpaValidMsg,
|
|
@@ -1736,7 +2127,6 @@ async function apply(args, env) {
|
|
|
1736
2127
|
// 由 Agent 按 recruit-output-links.md「链接覆盖规则」替换 path 段后再输出。
|
|
1737
2128
|
viewLink: cardUrl ? `[\u67E5\u770B ${jd.summary.positionName || "\u65B0\u5EFA\u804C\u4F4D"} \u804C\u4F4D\u8BE6\u60C5](${cardUrl})` : null,
|
|
1738
2129
|
listLocateLink: listUrl ? `[\u6253\u5F00\u804C\u4F4D\u5217\u8868](${listUrl})` : null,
|
|
1739
|
-
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",
|
|
1740
2130
|
...jd.summary
|
|
1741
2131
|
});
|
|
1742
2132
|
}
|
|
@@ -1831,7 +2221,7 @@ var jdCreateOperations = [
|
|
|
1831
2221
|
];
|
|
1832
2222
|
|
|
1833
2223
|
// src/shortcuts/recruit-stage/operations/resume-import.ts
|
|
1834
|
-
import { createHash as
|
|
2224
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
1835
2225
|
import fs from "node:fs";
|
|
1836
2226
|
import path from "node:path";
|
|
1837
2227
|
|
|
@@ -2277,9 +2667,9 @@ async function queryEntityTags(host, talentId) {
|
|
|
2277
2667
|
}
|
|
2278
2668
|
|
|
2279
2669
|
// src/shortcuts/recruit-stage/fs-scan.ts
|
|
2280
|
-
import { mkdtempSync, readdirSync, readFileSync, statSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2670
|
+
import { mkdtempSync, readdirSync, readFileSync as readFileSync2, statSync, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
2281
2671
|
import { tmpdir } from "node:os";
|
|
2282
|
-
import { basename, dirname, extname, join as join2, resolve as resolve2 } from "node:path";
|
|
2672
|
+
import { basename, dirname as dirname2, extname, join as join2, resolve as resolve2 } from "node:path";
|
|
2283
2673
|
import { inflateRawSync } from "node:zlib";
|
|
2284
2674
|
var RESUME_EXTS = /* @__PURE__ */ new Set([".pdf", ".doc", ".docx", ".rtf", ".txt", ".wps"]);
|
|
2285
2675
|
function decodeName(bytes, utf8Flag) {
|
|
@@ -2291,7 +2681,7 @@ function decodeName(bytes, utf8Flag) {
|
|
|
2291
2681
|
}
|
|
2292
2682
|
}
|
|
2293
2683
|
function extractZip(zipPath) {
|
|
2294
|
-
const buf =
|
|
2684
|
+
const buf = readFileSync2(zipPath);
|
|
2295
2685
|
let eocd = -1;
|
|
2296
2686
|
const floor = Math.max(0, buf.length - 22 - 65535);
|
|
2297
2687
|
for (let i = buf.length - 22; i >= floor; i--) {
|
|
@@ -2338,8 +2728,8 @@ function extractZip(zipPath) {
|
|
|
2338
2728
|
continue;
|
|
2339
2729
|
}
|
|
2340
2730
|
const target = join2(dest, ...parts);
|
|
2341
|
-
|
|
2342
|
-
|
|
2731
|
+
mkdirSync2(dirname2(target), { recursive: true });
|
|
2732
|
+
writeFileSync2(target, out);
|
|
2343
2733
|
written++;
|
|
2344
2734
|
}
|
|
2345
2735
|
if (!written) throw new Error("zip \u5185\u6CA1\u6709\u53EF\u8BFB\u53D6\u7684\u6587\u4EF6\uFF08\u53EF\u80FD\u4E3A\u7A7A\u5305\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u538B\u7F29\u65B9\u5F0F\uFF09");
|
|
@@ -2398,18 +2788,18 @@ function scanResumeSource(source) {
|
|
|
2398
2788
|
}
|
|
2399
2789
|
|
|
2400
2790
|
// src/shortcuts/recruit-stage/batch-store.ts
|
|
2401
|
-
import { createHash as
|
|
2402
|
-
import { chmodSync, mkdirSync as
|
|
2791
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
2792
|
+
import { chmodSync, mkdirSync as mkdirSync3, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
2403
2793
|
import { homedir as homedir3 } from "node:os";
|
|
2404
2794
|
import { join as join3, resolve as resolve3, sep } from "node:path";
|
|
2405
2795
|
function batchDir() {
|
|
2406
2796
|
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve3(homedir3(), ".weaver-work-cli");
|
|
2407
2797
|
const dir = join3(home, "batch");
|
|
2408
|
-
|
|
2798
|
+
mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
2409
2799
|
return dir;
|
|
2410
2800
|
}
|
|
2411
2801
|
function digest(value) {
|
|
2412
|
-
return
|
|
2802
|
+
return createHash3("sha256").update(JSON.stringify(value)).digest("hex");
|
|
2413
2803
|
}
|
|
2414
2804
|
function cleanup(dir) {
|
|
2415
2805
|
try {
|
|
@@ -2430,7 +2820,7 @@ function saveBatchItems(kind, items) {
|
|
|
2430
2820
|
cleanup(dir);
|
|
2431
2821
|
const fingerprint3 = digest(items);
|
|
2432
2822
|
const file = join3(dir, `${kind}-${fingerprint3.slice(0, 16)}.json`);
|
|
2433
|
-
|
|
2823
|
+
writeFileSync3(file, JSON.stringify(items), { mode: 384 });
|
|
2434
2824
|
try {
|
|
2435
2825
|
chmodSync(file, 384);
|
|
2436
2826
|
} catch {
|
|
@@ -2445,7 +2835,7 @@ function loadBatchItems(file, expectedFingerprint) {
|
|
|
2445
2835
|
}
|
|
2446
2836
|
let items;
|
|
2447
2837
|
try {
|
|
2448
|
-
items = JSON.parse(
|
|
2838
|
+
items = JSON.parse(readFileSync3(target, "utf8"));
|
|
2449
2839
|
} catch {
|
|
2450
2840
|
throw rsValidationError("batch_file_missing", "\u6279\u91CF\u6E05\u5355\u5DF2\u5931\u6548\uFF08\u6587\u4EF6\u88AB\u79FB\u52A8\u6216\u5220\u9664\uFF09\uFF0C\u8BF7\u91CD\u65B0 prepare");
|
|
2451
2841
|
}
|
|
@@ -2468,7 +2858,7 @@ function saveOcrResult(fileId, structured) {
|
|
|
2468
2858
|
const dir = batchDir();
|
|
2469
2859
|
cleanup(dir);
|
|
2470
2860
|
const p = ocrFile(fileId);
|
|
2471
|
-
|
|
2861
|
+
writeFileSync3(p, JSON.stringify(structured), { mode: 384 });
|
|
2472
2862
|
try {
|
|
2473
2863
|
chmodSync(p, 384);
|
|
2474
2864
|
} catch {
|
|
@@ -2482,7 +2872,7 @@ function loadOcrResult(fileId, maxAgeMs = 24 * 3600 * 1e3) {
|
|
|
2482
2872
|
const p = ocrFile(fileId);
|
|
2483
2873
|
const st = statSync2(p);
|
|
2484
2874
|
if (Date.now() - st.mtimeMs > maxAgeMs) return null;
|
|
2485
|
-
const v = JSON.parse(
|
|
2875
|
+
const v = JSON.parse(readFileSync3(p, "utf8"));
|
|
2486
2876
|
return v && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
2487
2877
|
} catch {
|
|
2488
2878
|
return null;
|
|
@@ -2534,7 +2924,7 @@ async function uploadResume(host, baseUrl, filePath, fieldId, formId) {
|
|
|
2534
2924
|
const uploadType = c?.data?.uploadType || "common";
|
|
2535
2925
|
if (!preUploadId) throw rsFail("\u7B80\u5386\u9884\u4E0A\u4F20\u68C0\u67E5\u5931\u8D25\uFF1A" + JSON.stringify(c || {}).slice(0, 200));
|
|
2536
2926
|
const fd = baseForm();
|
|
2537
|
-
const md5 =
|
|
2927
|
+
const md5 = createHash4("md5").update(buf).digest("hex");
|
|
2538
2928
|
const lm = String(Math.round(fs.statSync(filePath).mtimeMs || Date.now()));
|
|
2539
2929
|
fd.append("name", filename);
|
|
2540
2930
|
fd.append("MD5", md5);
|
|
@@ -2574,7 +2964,7 @@ function snapshotParsedResume(s) {
|
|
|
2574
2964
|
return void 0;
|
|
2575
2965
|
}
|
|
2576
2966
|
}
|
|
2577
|
-
var BUILT_SNAPSHOT_LIMIT =
|
|
2967
|
+
var BUILT_SNAPSHOT_LIMIT = 512 * 1024;
|
|
2578
2968
|
function snapshotBuilt(built) {
|
|
2579
2969
|
if (!built || typeof built !== "object") return void 0;
|
|
2580
2970
|
try {
|
|
@@ -2679,6 +3069,8 @@ async function resolveSubTableMeta(ctx) {
|
|
|
2679
3069
|
if (cfg.start && cfg.end && cfg.start.dataKey && cfg.end.dataKey) {
|
|
2680
3070
|
col.startKey = String(cfg.start.dataKey);
|
|
2681
3071
|
col.endKey = String(cfg.end.dataKey);
|
|
3072
|
+
if (cfg.start.fieldId) col.startFieldId = String(cfg.start.fieldId);
|
|
3073
|
+
if (cfg.end.fieldId) col.endFieldId = String(cfg.end.fieldId);
|
|
2682
3074
|
}
|
|
2683
3075
|
cols[String(cfg.dataKey)] = col;
|
|
2684
3076
|
}
|
|
@@ -2892,6 +3284,107 @@ async function readTalentSnapshot(ctx, opts) {
|
|
|
2892
3284
|
for (const [dk, s] of Object.entries(seen)) subRows[dk] = s.size;
|
|
2893
3285
|
return { main, subRows, subCells };
|
|
2894
3286
|
}
|
|
3287
|
+
async function readTalentRecordMeta(ctx, opts) {
|
|
3288
|
+
const L = await getFormLayoutMeta(ctx.host, opts.formId);
|
|
3289
|
+
const r = await ctx.host.request({
|
|
3290
|
+
path: "/api/ebuilder/form/form/core/getFormDataAndLayout",
|
|
3291
|
+
method: "POST",
|
|
3292
|
+
body: {
|
|
3293
|
+
terminalType: "PC",
|
|
3294
|
+
dataId: opts.dataId,
|
|
3295
|
+
formId: opts.formId,
|
|
3296
|
+
module: "ebuilderform",
|
|
3297
|
+
newLayout: true,
|
|
3298
|
+
layoutId: L?.formLayout?.id,
|
|
3299
|
+
layoutMultiId: L?.formLayoutMultiple?.id,
|
|
3300
|
+
dataCrossLayout: false,
|
|
3301
|
+
permissionId: "",
|
|
3302
|
+
allReadOnly: true,
|
|
3303
|
+
initialDatas: [],
|
|
3304
|
+
dynamicData: false,
|
|
3305
|
+
cost: false,
|
|
3306
|
+
customParam: { objId: opts.objId, dataId: opts.dataId }
|
|
3307
|
+
}
|
|
3308
|
+
});
|
|
3309
|
+
const dets = r?.data?.formData?.dataDetails || [];
|
|
3310
|
+
const rowIdsBySubForm = {};
|
|
3311
|
+
for (const d of dets) {
|
|
3312
|
+
if (!d.subFormId) continue;
|
|
3313
|
+
const sid = String(d.subFormId);
|
|
3314
|
+
const idx = Number(d.dataIndex || 0);
|
|
3315
|
+
if (idx < 1) continue;
|
|
3316
|
+
const arr = rowIdsBySubForm[sid] = rowIdsBySubForm[sid] || [];
|
|
3317
|
+
if (!arr[idx - 1]) arr[idx - 1] = String(d.rowId || "");
|
|
3318
|
+
}
|
|
3319
|
+
return {
|
|
3320
|
+
updateTimeStamp: String(r?.data?.formData?.updateTimeStamp || ""),
|
|
3321
|
+
formLayoutId: String(r?.data?.formLayout?.id || L?.formLayout?.id || ""),
|
|
3322
|
+
rowIdsBySubForm
|
|
3323
|
+
};
|
|
3324
|
+
}
|
|
3325
|
+
function debugDumpSubCells(built, rowIdsBySubForm) {
|
|
3326
|
+
for (const [dk, node] of Object.entries(built.detailNodes)) {
|
|
3327
|
+
const sub = (built.subMeta || {})[dk];
|
|
3328
|
+
const rows = (built.detailsPayload || {})[node] || [];
|
|
3329
|
+
const sid = sub ? String(sub.subFormId) : "";
|
|
3330
|
+
const oldIds = rowIdsBySubForm[sid] || [];
|
|
3331
|
+
const cols = Object.entries(sub?.columns || {}).map(([k, c]) => `${k}:${c.type}@${c.id}${c.startKey ? `(s=${c.startKey},e=${c.endKey})` : ""}`).join(" | ");
|
|
3332
|
+
console.error(`[debug-cells] ${dk} node=${node} subFormId=${sid} oldRows=${oldIds.length} newRows=${rows.length} cols=${cols}`);
|
|
3333
|
+
rows.forEach((r, i) => console.error(`[debug-cells] row${i + 1} rowId=${oldIds[i] || ""} json=${JSON.stringify(r)}`));
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
function normDateCell(colType, v) {
|
|
3337
|
+
if (!/date/i.test(String(colType || ""))) return v;
|
|
3338
|
+
const s = String(v || "").trim().replace(/\//g, "-");
|
|
3339
|
+
const m0 = s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
|
|
3340
|
+
if (m0) return `${m0[1]}-${String(m0[2]).padStart(2, "0")}-${String(m0[3]).padStart(2, "0")}`;
|
|
3341
|
+
const m = s.match(/^(\d{4})-(\d{1,2})$/);
|
|
3342
|
+
if (m) return `${m[1]}-${String(m[2]).padStart(2, "0")}-01`;
|
|
3343
|
+
const y = s.match(/^(\d{4})$/);
|
|
3344
|
+
if (y) return `${y[1]}-01-01`;
|
|
3345
|
+
return null;
|
|
3346
|
+
}
|
|
3347
|
+
function buildSubFormCells(built, rowIdsBySubForm, dictName) {
|
|
3348
|
+
const cells = [];
|
|
3349
|
+
const skippedOldRows = [];
|
|
3350
|
+
const droppedCells = [];
|
|
3351
|
+
if (process.env.E10_RS_DEBUG_CELLS === "1") debugDumpSubCells(built, rowIdsBySubForm);
|
|
3352
|
+
for (const [dk, node] of Object.entries(built.detailNodes)) {
|
|
3353
|
+
const sub = (built.subMeta || {})[dk];
|
|
3354
|
+
const rows = (built.detailsPayload || {})[node] || [];
|
|
3355
|
+
if (!sub || !rows.length) continue;
|
|
3356
|
+
const sid = String(sub.subFormId);
|
|
3357
|
+
const oldIds = rowIdsBySubForm[sid] || [];
|
|
3358
|
+
const keyMap = {};
|
|
3359
|
+
for (const [ck0, c0] of Object.entries(sub.columns || {})) {
|
|
3360
|
+
if (c0?.id) keyMap[ck0] = { fieldId: String(c0.id), date: /date/i.test(String(c0.type || "")) };
|
|
3361
|
+
if (c0?.startKey && c0?.startFieldId) keyMap[String(c0.startKey)] = { fieldId: String(c0.startFieldId), date: true };
|
|
3362
|
+
if (c0?.endKey && c0?.endFieldId) keyMap[String(c0.endKey)] = { fieldId: String(c0.endFieldId), date: true };
|
|
3363
|
+
}
|
|
3364
|
+
rows.forEach((row, i) => {
|
|
3365
|
+
const rowId = i < oldIds.length ? oldIds[i] || "" : "";
|
|
3366
|
+
for (const [ck, v] of Object.entries(row)) {
|
|
3367
|
+
const col = keyMap[ck];
|
|
3368
|
+
if (!col) {
|
|
3369
|
+
droppedCells.push(`${dk}#${i + 1}.${ck} \u65E0\u5BF9\u5E94\u5217\uFF08\u5E03\u5C40\u672A\u89E3\u6790\u5230 fieldId\uFF09\uFF0C\u5DF2\u8DF3\u8FC7`);
|
|
3370
|
+
continue;
|
|
3371
|
+
}
|
|
3372
|
+
const sv = String(v ?? "");
|
|
3373
|
+
const dateVal = col.date ? normDateCell("Date", sv) : sv;
|
|
3374
|
+
if (dateVal === null) {
|
|
3375
|
+
droppedCells.push(`${dk}#${i + 1}.${ck}\u300C${sv}\u300D\u975E\u65E5\u671F\u503C\uFF0C\u5DF2\u8DF3\u8FC7`);
|
|
3376
|
+
continue;
|
|
3377
|
+
}
|
|
3378
|
+
const isOption = /^\d{6,}$/.test(sv) && !!dictName(sv);
|
|
3379
|
+
cells.push(isOption ? { dataIndex: i + 1, rowId, formField: { id: col.fieldId }, subForm: { id: sid }, dataOptions: [{ optionId: sv, content: dictName(sv) }] } : { dataIndex: i + 1, rowId, formField: { id: col.fieldId }, subForm: { id: sid }, content: dateVal });
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3382
|
+
if (oldIds.length > rows.length) {
|
|
3383
|
+
skippedOldRows.push(`${dk}\uFF1A\u539F\u8868 ${oldIds.length} \u884C > \u672C\u6B21\u89E3\u6790 ${rows.length} \u884C\uFF0C\u591A\u51FA\u7684\u65E7\u884C\u65E0\u6CD5\u7ECF\u672C\u901A\u9053\u5220\u9664\uFF0C\u9700\u9875\u9762\u624B\u5DE5\u5904\u7406`);
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
return { cells, skippedOldRows, droppedCells };
|
|
3387
|
+
}
|
|
2895
3388
|
async function matchTalentLabel(host, talentId) {
|
|
2896
3389
|
const r = await host.request({ path: "/api/recruit/label/matchTalentLabel?talentId=" + encodeURIComponent(talentId), method: "POST", body: {} });
|
|
2897
3390
|
return r?.data || null;
|
|
@@ -3008,6 +3501,7 @@ async function buildImport(ctx, args) {
|
|
|
3008
3501
|
dataDetails.push({ formField: { id: resumeFieldId }, dataOptions: [{ optionId: String(fileid), content: fileName || "\u7B80\u5386\u9644\u4EF6", type: "file" }] });
|
|
3009
3502
|
}
|
|
3010
3503
|
let channelLabel = null;
|
|
3504
|
+
let channelWarning = null;
|
|
3011
3505
|
if (args.channel) {
|
|
3012
3506
|
let channelOption;
|
|
3013
3507
|
for (const x of cache.dict?.raw || []) if (x.selection_name === args.channel) channelOption = x.option_id;
|
|
@@ -3016,10 +3510,39 @@ async function buildImport(ctx, args) {
|
|
|
3016
3510
|
channelLabel = args.channel;
|
|
3017
3511
|
} else if (fields.channel) {
|
|
3018
3512
|
const byName = cache.dict?.by_name || {};
|
|
3019
|
-
const
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3513
|
+
const aliases = ["\u7B80\u5386\u9644\u4EF6\u5BFC\u5165", "\u624B\u52A8\u5F55\u5165", "\u624B\u5DE5\u5F55\u5165", "\u7B80\u5386\u5BFC\u5165", "\u5BFC\u5165\u7B80\u5386", "\u624B\u52A8\u6DFB\u52A0", "\u624B\u5DE5\u6DFB\u52A0", "\u624B\u52A8", "\u624B\u5DE5", "\u5F55\u5165"];
|
|
3514
|
+
const findName = (map) => {
|
|
3515
|
+
for (const name of aliases) if (map?.[name]) return name;
|
|
3516
|
+
return "";
|
|
3517
|
+
};
|
|
3518
|
+
let manualName = findName(byName);
|
|
3519
|
+
let manualId = manualName ? String(byName[manualName]) : "";
|
|
3520
|
+
let channelSource = manualId ? "dict" : "";
|
|
3521
|
+
if (!manualId) {
|
|
3522
|
+
const offline = cachedDsMap(cache, objId, "channel");
|
|
3523
|
+
manualName = findName(offline);
|
|
3524
|
+
manualId = manualName ? String(offline?.[manualName]) : "";
|
|
3525
|
+
if (manualId) channelSource = "field_options";
|
|
3526
|
+
}
|
|
3527
|
+
if (!manualId) {
|
|
3528
|
+
try {
|
|
3529
|
+
const live = await getDsOptions(host, objId, fields.channel);
|
|
3530
|
+
manualName = findName(live);
|
|
3531
|
+
manualId = manualName ? String(live?.[manualName]) : "";
|
|
3532
|
+
if (manualId) channelSource = "ds/options";
|
|
3533
|
+
} catch {
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
if (!manualId) {
|
|
3537
|
+
channelWarning = "\u6570\u636E\u5B57\u5178\u4E2D\u672A\u627E\u5230\u300C\u7B80\u5386\u9644\u4EF6\u5BFC\u5165/\u624B\u52A8\u5F55\u5165\u300D\uFF0C\u672C\u6B21\u7B80\u5386\u6765\u6E90\u7559\u7A7A\uFF08\u4E0D\u963B\u585E\u5F55\u5165\uFF09";
|
|
3538
|
+
channelLabel = "\u672A\u8BBE\u7F6E\uFF08\u5B57\u5178\u65E0\u6765\u6E90\u9009\u9879\uFF09";
|
|
3539
|
+
} else {
|
|
3540
|
+
if (channelSource && channelSource !== "dict" && process.env.WEAVER_CLI_DEBUG_CACHE) {
|
|
3541
|
+
console.error("[resume-import] \u7B80\u5386\u6765\u6E90\u7531", channelSource, "\u53CD\u67E5\u5F97\u5230\uFF08\u5B57\u5178\u4E3A\u7A7A\uFF0C\u83DC\u5355\u901A\u9053\u4E0D\u53EF\u7528\uFF09");
|
|
3542
|
+
}
|
|
3543
|
+
dataDetails.push({ formField: { id: fields.channel }, dataOptions: [{ optionId: manualId, content: manualName }] });
|
|
3544
|
+
channelLabel = manualName;
|
|
3545
|
+
}
|
|
3023
3546
|
}
|
|
3024
3547
|
mark("build.\u6E20\u9053\u6620\u5C04\u5B8C\u6210");
|
|
3025
3548
|
const blacklistP = fields.is_blacklist ? getDsOptions(host, objId, fields.is_blacklist).catch(() => ({})) : Promise.resolve({});
|
|
@@ -3077,12 +3600,24 @@ async function buildImport(ctx, args) {
|
|
|
3077
3600
|
tagNames,
|
|
3078
3601
|
schoolTagInfo,
|
|
3079
3602
|
channelLabel,
|
|
3603
|
+
channelWarning,
|
|
3080
3604
|
resumeFieldId
|
|
3081
3605
|
};
|
|
3082
3606
|
}
|
|
3083
3607
|
async function findExistingTalents(ctx, opts) {
|
|
3084
3608
|
const { objId, formId, fields, mobile } = opts;
|
|
3085
|
-
const blank = {
|
|
3609
|
+
const blank = {
|
|
3610
|
+
checked: true,
|
|
3611
|
+
unique: true,
|
|
3612
|
+
applicable: false,
|
|
3613
|
+
phoneChecked: true,
|
|
3614
|
+
uniqueChecked: true,
|
|
3615
|
+
checkErrors: [],
|
|
3616
|
+
byPhone: null,
|
|
3617
|
+
byPhoneError: void 0,
|
|
3618
|
+
formConflicts: { existing: [], unreadable: [] },
|
|
3619
|
+
ids: []
|
|
3620
|
+
};
|
|
3086
3621
|
if (!mobile) return blank;
|
|
3087
3622
|
const phoneTask = getCandidateByPhone(ctx.host, mobile).then(
|
|
3088
3623
|
(b) => ({ ok: true, b }),
|
|
@@ -3090,8 +3625,8 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3090
3625
|
);
|
|
3091
3626
|
const uniqueTask = fields.telephone ? checkUnique(ctx.host, { objId, fieldId: fields.telephone, value: mobile }).then(
|
|
3092
3627
|
(r) => ({ ok: true, r }),
|
|
3093
|
-
() => ({ ok: false,
|
|
3094
|
-
) : Promise.resolve({ ok: false,
|
|
3628
|
+
(e) => ({ ok: false, e })
|
|
3629
|
+
) : Promise.resolve({ ok: false, e: new Error("\u4EBA\u624D\u8868\u5355\u7F3A\u5C11 telephone \u5B57\u6BB5\u6620\u5C04") });
|
|
3095
3630
|
const [phoneRes, uniqueRes] = await Promise.all([phoneTask, uniqueTask]);
|
|
3096
3631
|
let byPhone = null;
|
|
3097
3632
|
if (phoneRes.ok) {
|
|
@@ -3110,9 +3645,11 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3110
3645
|
}
|
|
3111
3646
|
const formConflicts = { existing: [], unreadable: [] };
|
|
3112
3647
|
let ids = [];
|
|
3648
|
+
let uniqueFlag = true;
|
|
3113
3649
|
if (uniqueRes.ok && uniqueRes.r) {
|
|
3114
3650
|
const r = uniqueRes.r;
|
|
3115
3651
|
ids = r.formDataIds;
|
|
3652
|
+
uniqueFlag = r.unique !== false;
|
|
3116
3653
|
const readBrief = makeBriefReader(ctx, formId, objId, fields);
|
|
3117
3654
|
for (const id of ids) {
|
|
3118
3655
|
if (byPhone?.talentId === id) continue;
|
|
@@ -3128,11 +3665,34 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3128
3665
|
} else formConflicts.unreadable.push(id);
|
|
3129
3666
|
}
|
|
3130
3667
|
}
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3668
|
+
const phoneChecked = phoneRes.ok;
|
|
3669
|
+
const uniqueChecked = uniqueRes.ok && !!uniqueRes.r;
|
|
3670
|
+
const checkErrors = [];
|
|
3671
|
+
if (!phoneChecked) checkErrors.push("getCandidateByPhone \u67E5\u8BE2\u5931\u8D25\uFF1A" + (phoneRes.e?.message || "\u672A\u77E5\u9519\u8BEF"));
|
|
3672
|
+
if (!fields.telephone) checkErrors.push("\u4EBA\u624D\u8868\u5355\u7F3A\u5C11 telephone \u5B57\u6BB5\u6620\u5C04\uFF0CcheckUnique \u65E0\u6CD5\u6267\u884C");
|
|
3673
|
+
else if (!uniqueChecked) checkErrors.push("checkUnique \u67E5\u8BE2\u5931\u8D25\uFF1A" + (uniqueRes.e?.message || "\u672A\u77E5\u9519\u8BEF"));
|
|
3674
|
+
const checked = phoneChecked && uniqueChecked;
|
|
3675
|
+
const hit = Boolean(byPhone?.candidateId || byPhone?.talentId) || formConflicts.existing.length > 0 || !uniqueFlag;
|
|
3676
|
+
return {
|
|
3677
|
+
checked,
|
|
3678
|
+
// 只有两级都成功且无命中才是 unique;查重失败一律返回 false,下游必须阻断。
|
|
3679
|
+
unique: checked ? !hit : false,
|
|
3680
|
+
applicable: true,
|
|
3681
|
+
phoneChecked,
|
|
3682
|
+
uniqueChecked,
|
|
3683
|
+
checkErrors,
|
|
3684
|
+
byPhone: byPhone && !byPhone.error ? byPhone : null,
|
|
3685
|
+
byPhoneError: byPhone?.error,
|
|
3686
|
+
formConflicts,
|
|
3687
|
+
ids
|
|
3688
|
+
};
|
|
3133
3689
|
}
|
|
3134
3690
|
function fingerprint2(value) {
|
|
3135
|
-
return
|
|
3691
|
+
return createHash4("sha256").update(JSON.stringify(value)).digest("hex");
|
|
3692
|
+
}
|
|
3693
|
+
function isDuplicateSaveError(message) {
|
|
3694
|
+
const text = String(message?.message || message || "");
|
|
3695
|
+
return /(查重|重复|已存在|唯一性|违反唯一|unique constraint|duplicate key|duplicate entry)/i.test(text);
|
|
3136
3696
|
}
|
|
3137
3697
|
function fingerprintMainTable(mainTable) {
|
|
3138
3698
|
const copy = { ...mainTable };
|
|
@@ -3299,6 +3859,7 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3299
3859
|
},
|
|
3300
3860
|
mappedFieldCount: built.dataDetails.length,
|
|
3301
3861
|
channel: built.channelLabel || "(\u672A\u6307\u5B9A)",
|
|
3862
|
+
channelWarning: built.channelWarning || void 0,
|
|
3302
3863
|
subTables: built.subBuild.stats,
|
|
3303
3864
|
subTableRows: built.subRowTotal,
|
|
3304
3865
|
subTableNodes: built.detailNodes,
|
|
@@ -3307,6 +3868,11 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3307
3868
|
duplicate: {
|
|
3308
3869
|
checked: dupInfo.checked,
|
|
3309
3870
|
unique: dupInfo.unique,
|
|
3871
|
+
applicable: dupInfo.applicable,
|
|
3872
|
+
phoneChecked: dupInfo.phoneChecked,
|
|
3873
|
+
uniqueChecked: dupInfo.uniqueChecked,
|
|
3874
|
+
checkErrors: dupInfo.checkErrors.length ? dupInfo.checkErrors : void 0,
|
|
3875
|
+
blocked: !dupInfo.checked,
|
|
3310
3876
|
bound: dupInfo.byPhone,
|
|
3311
3877
|
formConflicts: dupInfo.formConflicts.existing,
|
|
3312
3878
|
unreadableIds: dupInfo.formConflicts.unreadable,
|
|
@@ -3315,8 +3881,8 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3315
3881
|
// 实测:apply 成功后再跑一次 prepare(不带 updateTalentId)会 unique:false 命中刚建的自己,
|
|
3316
3882
|
// 而文档口径是「已存在同手机号人才 → 提示并停住,不重复建档」→ 重试路径被自己的查重挡死。
|
|
3317
3883
|
// 这里不改判定逻辑(查重该拦就拦),只补一个明确出口,避免 Agent 笼统报「已存在」后卡住。
|
|
3318
|
-
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",
|
|
3319
|
-
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"
|
|
3884
|
+
retryHint: !dupInfo.checked ? "\u67E5\u91CD\u672A\u5B8C\u6210\uFF0C\u7981\u6B62 apply \u65B0\u5EFA\uFF1B\u8BF7\u91CD\u8BD5 prepare\uFF0C\u6216\u5148\u5230\u4EBA\u624D\u5E93\u9875\u9762\u4EBA\u5DE5\u786E\u8BA4\u8BE5\u624B\u673A\u53F7" : 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",
|
|
3885
|
+
note: !dupInfo.checked ? "\u67E5\u91CD\u672A\u5B8C\u6210\uFF08getCandidateByPhone/checkUnique \u81F3\u5C11\u4E00\u4E2A\u5931\u8D25\uFF09\u2192 \u5DF2\u963B\u65AD\u65B0\u5EFA\uFF0C\u5FC5\u987B\u5148\u89E3\u51B3\u67E5\u91CD\u518D\u63D0\u4EA4" : 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"
|
|
3320
3886
|
}
|
|
3321
3887
|
};
|
|
3322
3888
|
const willSubmit = { formId: built.formId, objId: built.objId, mainTable: fingerprintMainTable(toDatasetMainTable(built.dataDetails, built.fields)), details: built.detailsPayload };
|
|
@@ -3325,6 +3891,19 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3325
3891
|
operation: "recruit-stage.resume.import.apply",
|
|
3326
3892
|
fingerprint: fp,
|
|
3327
3893
|
enumMaps: await dsOptionsSnapshot(),
|
|
3894
|
+
// 🔴 2026-11-28 修复「提速失效」:新建模式此前**从未签入 built**(只有更新通道签了),
|
|
3895
|
+
// 导致 apply 每次都重跑 buildImport(~6 HTTP)与 findExistingTalents(2 HTTP),
|
|
3896
|
+
// 优化写了但完全没生效。现补上;同时把 prepare 的查重结果签入 dupCheck,
|
|
3897
|
+
// 让 apply 能据此决策:unique=true 才跳过 HTTP 查重,unique=false 直接拒绝写入。
|
|
3898
|
+
built: snapshotBuilt(built),
|
|
3899
|
+
dupCheck: {
|
|
3900
|
+
checked: dupInfo.checked,
|
|
3901
|
+
unique: dupInfo.unique,
|
|
3902
|
+
conflictCount: dupInfo.formConflicts.existing.length,
|
|
3903
|
+
unreadableCount: dupInfo.formConflicts.unreadable.length,
|
|
3904
|
+
byPhoneTalentId: dupInfo.byPhone?.talentId || null,
|
|
3905
|
+
byPhoneCandidateId: dupInfo.byPhone?.candidateId || null
|
|
3906
|
+
},
|
|
3328
3907
|
// 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
|
|
3329
3908
|
// confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
|
|
3330
3909
|
// 否则会报 resume_source_required(文档写法跑不通)。
|
|
@@ -3398,12 +3977,18 @@ async function applyCore(args, env, payload) {
|
|
|
3398
3977
|
if (payload.fingerprint !== fingerprint2(willSubmit)) {
|
|
3399
3978
|
throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
|
|
3400
3979
|
}
|
|
3401
|
-
await
|
|
3980
|
+
const fresh = await readTalentRecordMeta(ctx, { formId: built.formId, objId: built.objId, dataId: updateTalentId });
|
|
3981
|
+
const subCells = buildSubFormCells(built, fresh.rowIdsBySubForm, makeDictLookup(ctx.cache));
|
|
3982
|
+
const savedId = await saveFormData(ctx.host, {
|
|
3983
|
+
appId: ctx.appId,
|
|
3984
|
+
formId: built.formId,
|
|
3402
3985
|
objId: built.objId,
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3986
|
+
name: built.structured.candidateName || void 0,
|
|
3987
|
+
dataDetails: [...built.dataDetails, ...subCells.cells],
|
|
3988
|
+
rightType: "2",
|
|
3989
|
+
formDataId: updateTalentId,
|
|
3990
|
+
updateTimeStamp: fresh.updateTimeStamp || void 0,
|
|
3991
|
+
layoutId: fresh.formLayoutId || void 0
|
|
3407
3992
|
});
|
|
3408
3993
|
const avatarRes2 = await writeAvatarIfProvided(ctx, {
|
|
3409
3994
|
photoFile: argsT.photoFile,
|
|
@@ -3427,17 +4012,18 @@ async function applyCore(args, env, payload) {
|
|
|
3427
4012
|
return out;
|
|
3428
4013
|
};
|
|
3429
4014
|
let after = await readTalentSnapshot(ctx, { formId: built.formId, objId: built.objId, fields: built.fields, subMeta: built.subMeta, dataId: updateTalentId });
|
|
3430
|
-
let verifyWarnings = checkAfter(after);
|
|
4015
|
+
let verifyWarnings = [...subCells.skippedOldRows, ...subCells.droppedCells, ...checkAfter(after)];
|
|
3431
4016
|
if (verifyWarnings.length) {
|
|
3432
4017
|
await new Promise((r) => setTimeout(r, 600));
|
|
3433
4018
|
after = await readTalentSnapshot(ctx, { formId: built.formId, objId: built.objId, fields: built.fields, subMeta: built.subMeta, dataId: updateTalentId });
|
|
3434
|
-
verifyWarnings = checkAfter(after);
|
|
4019
|
+
verifyWarnings = [...subCells.skippedOldRows, ...subCells.droppedCells, ...checkAfter(after)];
|
|
3435
4020
|
}
|
|
3436
4021
|
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
3437
4022
|
// 更新模式同理:明细行/格数对不上时只能报 partial,不能因主表写入成功就报 success
|
|
3438
4023
|
mode: "update",
|
|
3439
4024
|
result: verifyWarnings.length ? "partial" : "success",
|
|
3440
4025
|
detailsState: verifyWarnings.length ? "missing" : "complete",
|
|
4026
|
+
writeChannel: "form/core saveFormData\uFF08formDataId+\u4E50\u89C2\u9501\uFF1Bdataset v2 \u5BF9\u4EBA\u624D\u8868\u5931\u660E\u5DF2\u5F03\u7528\uFF09",
|
|
3441
4027
|
talentId: updateTalentId,
|
|
3442
4028
|
afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
|
|
3443
4029
|
verifyWarnings: verifyWarnings.length ? verifyWarnings : void 0,
|
|
@@ -3447,8 +4033,26 @@ async function applyCore(args, env, payload) {
|
|
|
3447
4033
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || "(\u7A7A)" }
|
|
3448
4034
|
});
|
|
3449
4035
|
}
|
|
3450
|
-
|
|
4036
|
+
const signedDup = payload.built && payload.dupCheck && payload.dupCheck.checked === true ? payload.dupCheck : null;
|
|
4037
|
+
if (signedDup && signedDup.unique !== true) {
|
|
4038
|
+
const hasBatch = !!(signedDup.byPhoneCandidateId || signedDup.byPhoneTalentId);
|
|
4039
|
+
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
4040
|
+
mode: "apply",
|
|
4041
|
+
result: "duplicate",
|
|
4042
|
+
message: signedDup.unique === false ? hasBatch ? "\u5F53\u524D\u624B\u673A\u53F7\u5DF2\u7ED1\u5B9A\u4EBA\u624D\u4FE1\u606F\uFF0C\u6309\u9875\u9762\u89C4\u5219\u4E0D\u65B0\u5EFA\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09" : "\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\uFF0C\u4E0D\u65B0\u5EFA\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09" : "\u67E5\u91CD\u7ED3\u8BBA\u4E0D\u5B8C\u6574\uFF08prepare \u672A\u8FD4\u56DE\u660E\u786E unique \u7ED3\u8BBA\uFF09\uFF0C\u4E3A\u9632\u6B62\u91CD\u590D\u5EFA\u6863\u5DF2\u963B\u65AD\uFF1B\u8BF7\u91CD\u65B0 prepare",
|
|
4043
|
+
existingTalent: hasBatch ? {
|
|
4044
|
+
talentId: signedDup.byPhoneTalentId || "",
|
|
4045
|
+
candidateId: signedDup.byPhoneCandidateId || ""
|
|
4046
|
+
} : void 0,
|
|
4047
|
+
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
|
|
4048
|
+
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\u91CD\u65B0 prepare \u65F6\u4F20 updateTalentId=<\u5DF2\u6709\u4EBA\u624Did>\uFF0C\u786E\u8BA4\u5DEE\u5F02\u540E apply\uFF1B\u4E0D\u8981\u7528\u539F\u65B0\u5EFA continuation \u76F4\u63A5 apply"
|
|
4049
|
+
});
|
|
4050
|
+
}
|
|
4051
|
+
if (!signedDup) {
|
|
3451
4052
|
const dupInfo = await findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone });
|
|
4053
|
+
if (!dupInfo.checked) {
|
|
4054
|
+
throw rsFail("\u624B\u673A\u53F7\u67E5\u91CD\u672A\u5B8C\u6210\uFF0C\u4E3A\u9632\u6B62\u91CD\u590D\u5EFA\u6863\u5DF2\u963B\u65AD\uFF1A" + (dupInfo.checkErrors.join("\uFF1B") || "\u672A\u77E5\u539F\u56E0") + "\u3002\u8BF7\u91CD\u8BD5\uFF0C\u6216\u5148\u5230\u4EBA\u624D\u5E93\u9875\u9762\u786E\u8BA4\u8BE5\u624B\u673A\u53F7\u662F\u5426\u5DF2\u5B58\u5728");
|
|
4055
|
+
}
|
|
3452
4056
|
if (dupInfo.byPhone?.candidateId || dupInfo.byPhone?.talentId) {
|
|
3453
4057
|
const b = dupInfo.byPhone;
|
|
3454
4058
|
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
@@ -3459,7 +4063,7 @@ async function applyCore(args, env, payload) {
|
|
|
3459
4063
|
talentViewUrl: b.talentViewUrl,
|
|
3460
4064
|
otherRecords: dupInfo.formConflicts.existing.length ? dupInfo.formConflicts.existing : void 0,
|
|
3461
4065
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
|
|
3462
|
-
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\
|
|
4066
|
+
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\u91CD\u65B0 prepare \u65F6\u4F20 updateTalentId=<\u5DF2\u6709\u4EBA\u624Did>\uFF0C\u786E\u8BA4\u5DEE\u5F02\u540E apply\uFF1B\u4E0D\u8981\u7528\u539F\u65B0\u5EFA continuation \u76F4\u63A5 apply"
|
|
3463
4067
|
});
|
|
3464
4068
|
}
|
|
3465
4069
|
if (dupInfo.formConflicts.existing.length) {
|
|
@@ -3469,12 +4073,22 @@ async function applyCore(args, env, payload) {
|
|
|
3469
4073
|
message: "\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\uFF0C\u4E0D\u65B0\u5EFA\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09",
|
|
3470
4074
|
formConflicts: dupInfo.formConflicts.existing,
|
|
3471
4075
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
|
|
3472
|
-
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\
|
|
4076
|
+
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\u91CD\u65B0 prepare \u65F6\u4F20 updateTalentId=<\u5DF2\u6709\u4EBA\u624Did>\uFF0C\u786E\u8BA4\u5DEE\u5F02\u540E apply\uFF1B\u4E0D\u8981\u7528\u539F\u65B0\u5EFA continuation \u76F4\u63A5 apply"
|
|
3473
4077
|
});
|
|
3474
4078
|
}
|
|
3475
4079
|
if (!dupInfo.unique && dupInfo.formConflicts.unreadable.length) {
|
|
3476
4080
|
throw rsFail("\u624B\u673A\u53F7\u88AB " + dupInfo.formConflicts.unreadable.length + " \u6761\u5DF2\u5220\u9664\u8BB0\u5F55\u5360\u7528\uFF08\u5E73\u53F0\u552F\u4E00\u6027\u6821\u9A8C\u4ECD\u62E6\u65B0\u5EFA\uFF0Cid=" + dupInfo.formConflicts.unreadable.join(",") + "\uFF09\uFF1A\u8BF7\u5148\u5728\u56DE\u6536\u7AD9\u6E05\u7406\uFF0C\u6216\u6539\u4E3A\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D");
|
|
3477
4081
|
}
|
|
4082
|
+
if (!dupInfo.unique) {
|
|
4083
|
+
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
4084
|
+
mode: "apply",
|
|
4085
|
+
result: "duplicate",
|
|
4086
|
+
message: "\u624B\u673A\u53F7\u5728\u4EBA\u624D\u5E93\u5DF2\u5B58\u5728\uFF08\u5E73\u53F0\u552F\u4E00\u6027\u6821\u9A8C\u672A\u901A\u8FC7\uFF09\uFF0C\u4E0D\u65B0\u5EFA\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09",
|
|
4087
|
+
formConflicts: dupInfo.formConflicts.existing.length ? dupInfo.formConflicts.existing : void 0,
|
|
4088
|
+
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
|
|
4089
|
+
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u8BE5\u4EBA\u624D\uFF0C\u91CD\u65B0 prepare \u65F6\u4F20 updateTalentId=<\u5DF2\u6709\u4EBA\u624Did>\uFF0C\u786E\u8BA4\u5DEE\u5F02\u540E apply\uFF1B\u4E0D\u8981\u7528\u539F\u65B0\u5EFA continuation \u76F4\u63A5 apply"
|
|
4090
|
+
});
|
|
4091
|
+
}
|
|
3478
4092
|
}
|
|
3479
4093
|
mark("apply.\u67E5\u91CD\u5B8C\u6210");
|
|
3480
4094
|
const datasetMain = toDatasetMainTable(built.dataDetails, built.fields);
|
|
@@ -3486,20 +4100,37 @@ async function applyCore(args, env, payload) {
|
|
|
3486
4100
|
newId = created.dataId;
|
|
3487
4101
|
writeChannel = "dataset/v2/saveFormData\uFF08\u4E3B\u8868 + \u660E\u7EC6\u4E00\u6B21\u5199\u5165\uFF09";
|
|
3488
4102
|
} catch (e) {
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
4103
|
+
const msg = String(e?.message || e || "");
|
|
4104
|
+
if (isDuplicateSaveError(msg)) {
|
|
4105
|
+
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
4106
|
+
mode: "apply",
|
|
4107
|
+
result: "duplicate",
|
|
4108
|
+
message: "\u5E73\u53F0\u624B\u673A\u53F7\u552F\u4E00\u6027\u6821\u9A8C\u62E6\u622A\uFF0C\u672A\u65B0\u5EFA\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09",
|
|
4109
|
+
duplicateGuard: "dataset-save-duplicate-blocked",
|
|
4110
|
+
existingTalent: signedDup && (signedDup.byPhoneTalentId || signedDup.byPhoneCandidateId) ? {
|
|
4111
|
+
talentId: signedDup.byPhoneTalentId || "",
|
|
4112
|
+
candidateId: signedDup.byPhoneCandidateId || ""
|
|
4113
|
+
} : void 0,
|
|
4114
|
+
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
|
|
4115
|
+
nextStep: "\u5982\u9700\u6309\u8FD9\u4EFD\u7B80\u5386\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D\uFF0C\u91CD\u65B0 prepare \u65F6\u4F20 updateTalentId=<\u5DF2\u6709\u4EBA\u624Did>\uFF0C\u786E\u8BA4\u5DEE\u5F02\u540E apply\uFF1B\u4E0D\u8981\u6362\u901A\u9053\u91CD\u8BD5\u65B0\u5EFA",
|
|
4116
|
+
writeWarnings: ["dataset/v2/saveFormData \u8FD4\u56DE\u67E5\u91CD\u5931\u8D25\uFF1A" + msg + "\uFF08\u5DF2\u505C\u6B62\uFF0C\u672A\u964D\u7EA7\u5199\u5165\uFF09"]
|
|
4117
|
+
});
|
|
3498
4118
|
}
|
|
4119
|
+
writeWarnings.push("\u6570\u636E\u96C6\u65B0\u589E\u672A\u901A\u8FC7\uFF08" + msg + "\uFF09\uFF0C\u56DE\u9000\u9875\u9762\u7EA7\u901A\u9053\uFF1A\u4E3B\u8868+\u660E\u7EC6\u4E00\u6B21\u5199\u5165");
|
|
4120
|
+
const subCells = buildSubFormCells(built, {}, makeDictLookup(ctx.cache));
|
|
4121
|
+
newId = await saveFormData(host, { appId: ctx.appId, formId: built.formId, objId: built.objId, name: built.structured.candidateName || "\u7B80\u5386\u5BFC\u5165", dataDetails: [...built.dataDetails, ...subCells.cells] });
|
|
4122
|
+
writeChannel = "form/core/saveFormData\uFF08\u4E3B\u8868 + \u660E\u7EC6 subForm \u4E00\u6B21\u5199\u5165\uFF09";
|
|
4123
|
+
writeWarnings.push(...subCells.droppedCells);
|
|
3499
4124
|
}
|
|
3500
4125
|
mark("apply.saveFormData");
|
|
3501
4126
|
const r2 = await host.request({ path: "/api/recruit/candidate/initTalentBatch?formDataId=" + newId, method: "POST" });
|
|
3502
4127
|
mark("apply.initTalentBatch");
|
|
4128
|
+
const batchRaw = r2;
|
|
4129
|
+
const batchOk = !(batchRaw?.status === false || typeof batchRaw?.code === "number" && batchRaw.code !== 200 || batchRaw?.data?.success === false || batchRaw?.data?.status === false);
|
|
4130
|
+
const batchMsg = String(batchRaw?.data?.msg || batchRaw?.msg || "");
|
|
4131
|
+
if (!batchOk) {
|
|
4132
|
+
writeWarnings.push("\u4EBA\u624D\u5DF2\u521B\u5EFA\uFF08talentId=" + newId + "\uFF09\uFF0C\u4F46 initTalentBatch \u521D\u59CB\u5316\u6279\u6B21\u5931\u8D25\uFF1A" + (batchMsg || "\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u6210\u529F\u72B6\u6001") + "\u3002\u8BF7\u5728 E10 \u4E2D\u786E\u8BA4\u6279\u6B21\u72B6\u6001\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5\u521B\u5EFA\u3002");
|
|
4133
|
+
}
|
|
3503
4134
|
const talentId = String(newId);
|
|
3504
4135
|
const avatarRes = await writeAvatarIfProvided(ctx, {
|
|
3505
4136
|
photoFile: argsT.photoFile,
|
|
@@ -3541,6 +4172,10 @@ async function applyCore(args, env, payload) {
|
|
|
3541
4172
|
}
|
|
3542
4173
|
}
|
|
3543
4174
|
const saveEsbActions = esbRes.ok ? esbRes.v : { error: esbRes.e?.message };
|
|
4175
|
+
const saveActionsOk = esbRes.ok && !saveEsbActions?.error;
|
|
4176
|
+
if (!saveActionsOk) {
|
|
4177
|
+
writeWarnings.push("\u4FDD\u5B58\u6309\u94AE\u540E\u7EED\u52A8\u4F5C\u6267\u884C\u5931\u8D25\uFF1A" + (saveEsbActions?.error || "\u672A\u77E5\u539F\u56E0") + "\u3002\u4EBA\u624D\u6863\u6848\u5DF2\u5199\u5165\uFF0C\u8BF7\u4EBA\u5DE5\u5728 E10 \u4E2D\u786E\u8BA4\u76F8\u5173\u52A8\u4F5C\u3002");
|
|
4178
|
+
}
|
|
3544
4179
|
const labelMatch = labelRes.ok ? labelRes.v : "ERR:" + (labelRes.e?.message || "");
|
|
3545
4180
|
const tagResult = tagRes.ok ? tagRes.v : { applied: [], skipped: built.tagNames, error: tagRes.e?.message };
|
|
3546
4181
|
mark("apply.\u6807\u7B7E\u56DE\u8BFB");
|
|
@@ -3577,7 +4212,7 @@ async function applyCore(args, env, payload) {
|
|
|
3577
4212
|
if (attachMismatch) {
|
|
3578
4213
|
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");
|
|
3579
4214
|
}
|
|
3580
|
-
const result = detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
|
|
4215
|
+
const result = batchOk && saveActionsOk && detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
|
|
3581
4216
|
mark("apply.\u56DE\u67E5\u5B8C\u6210");
|
|
3582
4217
|
const talentCardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
3583
4218
|
mark("apply.\u5361\u7247/\u5217\u8868\u94FE\u63A5");
|
|
@@ -3601,8 +4236,11 @@ async function applyCore(args, env, payload) {
|
|
|
3601
4236
|
avatar: avatarRes.written ? { written: true, fileId: avatarRes.fileId, name: avatarRes.name } : { written: false, warning: avatarRes.warning },
|
|
3602
4237
|
subTablesExpected: built.subBuild.stats,
|
|
3603
4238
|
subTableVerify,
|
|
3604
|
-
initTalentBatch:
|
|
4239
|
+
initTalentBatch: batchMsg,
|
|
4240
|
+
initTalentBatchOk: batchOk,
|
|
4241
|
+
initTalentBatchError: batchOk ? void 0 : batchMsg || "\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u6210\u529F\u72B6\u6001",
|
|
3605
4242
|
saveEsbActions,
|
|
4243
|
+
saveActionsOk,
|
|
3606
4244
|
schoolTags: built.schoolTagInfo,
|
|
3607
4245
|
labelMatch,
|
|
3608
4246
|
tagsApplied: tagResult.applied,
|
|
@@ -3613,7 +4251,6 @@ async function applyCore(args, env, payload) {
|
|
|
3613
4251
|
// 产物链接(Agent 原样搬运:① 人才卡片单页 ② 人才库列表;缺失哪个只给另一个)
|
|
3614
4252
|
viewLink: talentCardUrl ? `[\u67E5\u770B ${built.structured.candidateName || "\u65B0\u4EBA\u624D"} \u7684\u4EBA\u624D\u5361\u7247](${talentCardUrl})` : null,
|
|
3615
4253
|
listLocateLink: talentListLocateUrl ? `[\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](${talentListLocateUrl})` : null,
|
|
3616
|
-
agentNote: "\u6B63\u6587\u7ED9\u4E24\u4E2A Markdown \u94FE\u63A5\u2014\u2014\u2460 [\u67E5\u770B <\u59D3\u540D> \u7684\u4EBA\u624D\u5361\u7247](talentCardUrl) \u8BE6\u60C5\u5355\u9875 \u2461 [\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](talentListLocateUrl) \u53EA\u6253\u5F00\u5217\u8868\u3001\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF1B\u7F3A\u5931\u54EA\u4E2A\u5C31\u53EA\u7ED9\u53E6\u4E00\u4E2A\uFF0C\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u7528 artifact / browsertool\u3002",
|
|
3617
4254
|
parsed: {
|
|
3618
4255
|
name: built.structured.candidateName,
|
|
3619
4256
|
mobile: built.structured.telephone,
|
|
@@ -3742,7 +4379,7 @@ async function batchPrepare(args, env) {
|
|
|
3742
4379
|
}
|
|
3743
4380
|
});
|
|
3744
4381
|
}
|
|
3745
|
-
const fp =
|
|
4382
|
+
const fp = createHash4("sha256").update(JSON.stringify(ready.map((x) => [x.file, x.fingerprint]))).digest("hex");
|
|
3746
4383
|
const store = saveBatchItems("resume-import", ready);
|
|
3747
4384
|
const continuation = await env.continuation.issue({
|
|
3748
4385
|
operation: "recruit-stage.resume.import.batch.apply",
|
|
@@ -3839,8 +4476,7 @@ async function batchApply(args, env) {
|
|
|
3839
4476
|
skippedAtPrepare: blockedAtPrepare,
|
|
3840
4477
|
skippedTotal: blockedAtPrepare + skipped,
|
|
3841
4478
|
items: results,
|
|
3842
|
-
resultTable: lines.join("\n")
|
|
3843
|
-
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"
|
|
4479
|
+
resultTable: lines.join("\n")
|
|
3844
4480
|
});
|
|
3845
4481
|
}
|
|
3846
4482
|
var resumeImportOperations = [
|
|
@@ -3865,7 +4501,7 @@ var resumeImportOperations = [
|
|
|
3865
4501
|
capability: "recruit.resume.import",
|
|
3866
4502
|
risk: "write",
|
|
3867
4503
|
requiresConfirmation: true,
|
|
3868
|
-
inputSchema: schemaOf({ ...baseInput2, confirm: { type: "boolean" }, continuation: { type: "string" } }, {}),
|
|
4504
|
+
inputSchema: schemaOf({ ...baseInput2, confirm: { type: "boolean" }, continuation: { type: "string" } }, { required: ["confirm", "continuation"] }),
|
|
3869
4505
|
handler: apply2
|
|
3870
4506
|
},
|
|
3871
4507
|
{
|
|
@@ -4318,7 +4954,7 @@ async function resolveSaveActions(plan) {
|
|
|
4318
4954
|
async function callAssignedInterview(host, formDataId) {
|
|
4319
4955
|
const r = await host.request({ path: "/api/recruit/candidate/assignedInterview?formDataId=" + formDataId, method: "POST" });
|
|
4320
4956
|
const ok = String(r?.code) === "200" || r?.status === true || r?.success === true;
|
|
4321
|
-
if (!ok) throw rsFail("\u5206\u914D\u9762\u8BD5\uFF08assignedInterview\uFF09\u5931\u8D25\uFF1A" + (r?.msg || JSON.stringify(r).slice(0, 200)));
|
|
4957
|
+
if (!ok) throw rsFail("\u5206\u914D\u9762\u8BD5\uFF08assignedInterview\uFF09\u5931\u8D25\uFF1A" + (r?.msg || JSON.stringify(r).slice(0, 200)) + "\u3002\u26A0\uFE0F \u9762\u8BD5\u8BB0\u5F55\u5DF2\u4FDD\u5B58\uFF08formDataId=" + formDataId + "\uFF0C\u72B6\u6001\u505C\u7559\u5728\u8868\u5355\u9ED8\u8BA4\u503C\uFF0C\u901A\u5E38\u4E3A\u300C\u672A\u5F00\u59CB\u300D\uFF09\uFF1B\u4E0D\u8981\u91CD\u65B0 apply\uFF08\u4F1A\u91CD\u590D\u521B\u5EFA\u9762\u8BD5\u8BB0\u5F55\uFF09\u3002\u8BF7\u5230\u9762\u8BD5\u7BA1\u7406\u5217\u8868\u67E5\u770B\u8BE5\u8BB0\u5F55\uFF0C\u4FEE\u6B63\u804C\u4F4D\u6D41\u7A0B\u914D\u7F6E\u540E\u7528 updateTalentId \u8D70\u66F4\u65B0\u901A\u9053\u3002\u5E38\u89C1\u539F\u56E0\uFF1A\u804C\u4F4D\u672A\u914D\u7F6E\u62DB\u8058\u6D41\u7A0B\uFF08\u6D41\u7A0B ID \u4E3A\u7A7A\uFF09\u3002");
|
|
4322
4958
|
return r?.data || {};
|
|
4323
4959
|
}
|
|
4324
4960
|
async function execSaveActions(plan, formDataId) {
|
|
@@ -4340,7 +4976,7 @@ async function execSaveActions(plan, formDataId) {
|
|
|
4340
4976
|
const r = await runEsb(host, { objId: plan.objId, dataIds: formDataId, esbActionIds: a.id });
|
|
4341
4977
|
const ok = r?.status !== false;
|
|
4342
4978
|
executed.push({ ...base, ok, msg: r?.successMsg || r?.failMsg || "" });
|
|
4343
|
-
if (!ok) throw rsFail("\u300C\u4FDD\u5B58\u300D\u540E\u7EED\u52A8\u4F5C\u300C" + (a.name || a.id) + "\u300D\u6267\u884C\u5931\u8D25\uFF1A" + (r?.failMsg || "\u672A\u77E5\u539F\u56E0"));
|
|
4979
|
+
if (!ok) throw rsFail("\u300C\u4FDD\u5B58\u300D\u540E\u7EED\u52A8\u4F5C\u300C" + (a.name || a.id) + "\u300D\u6267\u884C\u5931\u8D25\uFF1A" + (r?.failMsg || "\u672A\u77E5\u539F\u56E0") + "\u3002\u26A0\uFE0F \u9762\u8BD5\u8BB0\u5F55\u5DF2\u4FDD\u5B58\u5E76\u5206\u914D\u6210\u529F\uFF08formDataId=" + formDataId + "\uFF09\uFF0C\u8BE5\u540E\u7EED\u52A8\u4F5C\u4E0D\u5F71\u54CD\u9762\u8BD5\u8BB0\u5F55\u672C\u8EAB\uFF1B\u4E0D\u8981\u91CD\u65B0 apply\uFF08\u4F1A\u91CD\u590D\u521B\u5EFA\uFF09\u3002");
|
|
4344
4980
|
} else if (a.actionType === "jsCode") {
|
|
4345
4981
|
if (ASSIGNED_API_RE.test(a.ecode || "")) {
|
|
4346
4982
|
assigned = await callAssignedInterview(host, formDataId);
|
|
@@ -4392,14 +5028,18 @@ async function resolveInterviewListUrl(ctx) {
|
|
|
4392
5028
|
if (cachedMenu?.listId && cachedMenu.combinationId) {
|
|
4393
5029
|
return `${baseUrl}/ebdapp/view/${appId}/combination/${cachedMenu.combinationId}-${cachedMenu.listId || cachedMenu.cusMenuId}/search/${cachedMenu.pageId || cachedMenu.cusMenuId}?terminal=PC&cusMenuId=${cachedMenu.cusMenuId}`;
|
|
4394
5030
|
}
|
|
4395
|
-
const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
|
|
4396
5031
|
const flat = [];
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
5032
|
+
try {
|
|
5033
|
+
const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
|
|
5034
|
+
(function walk2(ns) {
|
|
5035
|
+
for (const n of toMenuList(ns)) if (n && typeof n === "object") {
|
|
5036
|
+
flat.push(n);
|
|
5037
|
+
walk2(n.children ?? n.childs);
|
|
5038
|
+
}
|
|
5039
|
+
})(r?.data);
|
|
5040
|
+
} catch {
|
|
5041
|
+
return null;
|
|
5042
|
+
}
|
|
4403
5043
|
const node = findMenuNode(flat, ["\u9762\u8BD5\u7BA1\u7406", "\u9762\u8BD5\u5B89\u6392\u5217\u8868", "\u9762\u8BD5\u5B89\u6392"], (n) => n.combinationId && n.id && n.pageId);
|
|
4404
5044
|
if (!node) return null;
|
|
4405
5045
|
return `${baseUrl}/ebdapp/view/${appId}/combination/${node.combinationId}-${node.id}/search/${node.pageId}?terminal=PC&cusMenuId=${node.id}`;
|
|
@@ -4493,8 +5133,8 @@ async function prepare3(args, env, opts = {}) {
|
|
|
4493
5133
|
}
|
|
4494
5134
|
const defaultAiPlan = defPlan?.optionId ? { id: defPlan.optionId, name: defPlan.content } : void 0;
|
|
4495
5135
|
const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
|
|
4496
|
-
const { createHash:
|
|
4497
|
-
const fp =
|
|
5136
|
+
const { createHash: createHash5 } = await import("node:crypto");
|
|
5137
|
+
const fp = createHash5("sha256").update(JSON.stringify(willSubmit)).digest("hex");
|
|
4498
5138
|
const continuation = await env.continuation.issue({
|
|
4499
5139
|
operation: "recruit-stage.interview.arrange.apply",
|
|
4500
5140
|
fingerprint: fp,
|
|
@@ -4576,8 +5216,8 @@ async function applyCore2(args, env, payload) {
|
|
|
4576
5216
|
throw rsFail("AI\u9762\u8BD5\u5FC5\u987B\u9009\u62E9\u300CAI\u9762\u8BD5\u65B9\u6848\u300D\uFF08\u5FC5\u586B\uFF09\uFF0C\u5F53\u524D\u672A\u6307\u5B9A\u3002\u53EF\u9009\u65B9\u6848\uFF1A" + (plan.aiPlanOptions.items?.length ? planBrief(plan.aiPlanOptions.items) : "\uFF08\u65E0\uFF09") + "\u3002\u8BF7\u8BA9\u7528\u6237\u9009\u62E9\u540E\u5E26 aiPlan \u91CD\u8BD5\u3002");
|
|
4577
5217
|
}
|
|
4578
5218
|
const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
|
|
4579
|
-
const { createHash:
|
|
4580
|
-
if (payload.fingerprint !==
|
|
5219
|
+
const { createHash: createHash5 } = await import("node:crypto");
|
|
5220
|
+
if (payload.fingerprint !== createHash5("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
|
|
4581
5221
|
throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
|
|
4582
5222
|
}
|
|
4583
5223
|
const formDataId = await saveFormData(ctx.host, {
|
|
@@ -4627,7 +5267,6 @@ async function applyCore2(args, env, payload) {
|
|
|
4627
5267
|
interviewer: plan.summary.interviewer,
|
|
4628
5268
|
viewLink: detailUrl ? `[\u67E5\u770B ${plan.cand.name || ""} \u7684\u9762\u8BD5\u5B89\u6392\u8BE6\u60C5](${detailUrl})` : null,
|
|
4629
5269
|
listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868](${listLocateUrl})` : null,
|
|
4630
|
-
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",
|
|
4631
5270
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : void 0,
|
|
4632
5271
|
saveActions: actionsRun.executed,
|
|
4633
5272
|
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
@@ -4753,8 +5392,8 @@ async function batchPrepare2(args, env) {
|
|
|
4753
5392
|
}
|
|
4754
5393
|
});
|
|
4755
5394
|
}
|
|
4756
|
-
const { createHash:
|
|
4757
|
-
const fp =
|
|
5395
|
+
const { createHash: createHash5 } = await import("node:crypto");
|
|
5396
|
+
const fp = createHash5("sha256").update(JSON.stringify(ready.map((x) => [x.talentId, x.fingerprint]))).digest("hex");
|
|
4758
5397
|
const continuation = await env.continuation.issue({
|
|
4759
5398
|
operation: "recruit-stage.interview.arrange.batch.apply",
|
|
4760
5399
|
fingerprint: fp,
|
|
@@ -4832,8 +5471,7 @@ async function batchApply2(args, env) {
|
|
|
4832
5471
|
partial,
|
|
4833
5472
|
failed,
|
|
4834
5473
|
items: results,
|
|
4835
|
-
resultTable: lines.join("\n")
|
|
4836
|
-
agentNote: "\u628A resultTable \u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF08\u8FD9\u662F\u672C\u6B21\u6279\u91CF\u7EA6\u9762\u7684\u7ED3\u679C\u6E05\u5355\uFF09\uFF1B\u5931\u8D25/\u90E8\u5206\u6210\u529F\u7684\u6761\u76EE\u8981\u8FDE\u540C message \u4E00\u8D77\u8BF4\u6E05\u695A\uFF0C\u4E0D\u8981\u53EA\u62A5\u603B\u6570\u3002"
|
|
5474
|
+
resultTable: lines.join("\n")
|
|
4837
5475
|
});
|
|
4838
5476
|
}
|
|
4839
5477
|
var interviewArrangeOperations = [
|
|
@@ -4858,7 +5496,7 @@ var interviewArrangeOperations = [
|
|
|
4858
5496
|
capability: "recruit.interview.arrange",
|
|
4859
5497
|
risk: "write",
|
|
4860
5498
|
requiresConfirmation: true,
|
|
4861
|
-
inputSchema: schemaOf({ ...baseInput3, confirm: { type: "boolean" }, continuation: { type: "string" } }, {}),
|
|
5499
|
+
inputSchema: schemaOf({ ...baseInput3, confirm: { type: "boolean" }, continuation: { type: "string" } }, { required: ["confirm", "continuation"] }),
|
|
4862
5500
|
handler: apply3
|
|
4863
5501
|
},
|
|
4864
5502
|
{
|
|
@@ -5011,8 +5649,8 @@ async function prepare4(args, env) {
|
|
|
5011
5649
|
const newComment = args.comment !== void 0 ? String(args.comment) : t.target.judgement;
|
|
5012
5650
|
const newResultName = args.result ? String(args.result) : t.target.result;
|
|
5013
5651
|
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
5014
|
-
const { createHash:
|
|
5015
|
-
const fp =
|
|
5652
|
+
const { createHash: createHash5 } = await import("node:crypto");
|
|
5653
|
+
const fp = createHash5("sha256").update(JSON.stringify(willSubmit)).digest("hex");
|
|
5016
5654
|
const continuation = await env.continuation.issue({
|
|
5017
5655
|
operation: "recruit-stage.interview.feedback.edit.apply",
|
|
5018
5656
|
fingerprint: fp,
|
|
@@ -5073,8 +5711,8 @@ async function apply4(args, env) {
|
|
|
5073
5711
|
const newComment = merged.comment !== void 0 ? String(merged.comment) : t.target.judgement;
|
|
5074
5712
|
const newResultName = merged.result ? String(merged.result) : t.target.result;
|
|
5075
5713
|
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
5076
|
-
const { createHash:
|
|
5077
|
-
if (payload.fingerprint !==
|
|
5714
|
+
const { createHash: createHash5 } = await import("node:crypto");
|
|
5715
|
+
if (payload.fingerprint !== createHash5("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
|
|
5078
5716
|
throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
|
|
5079
5717
|
}
|
|
5080
5718
|
const newDetails = details2.map((x) => {
|
|
@@ -5184,7 +5822,7 @@ var interviewFeedbackOperations = [
|
|
|
5184
5822
|
comment: { type: "string" },
|
|
5185
5823
|
confirm: { type: "boolean" },
|
|
5186
5824
|
continuation: { type: "string" }
|
|
5187
|
-
}, {}),
|
|
5825
|
+
}, { required: ["confirm", "continuation"] }),
|
|
5188
5826
|
handler: apply4
|
|
5189
5827
|
}
|
|
5190
5828
|
];
|
|
@@ -5199,6 +5837,52 @@ var TYPES = {
|
|
|
5199
5837
|
candidate: { listKey: "candidate", formType: "candidate_manage", title: "\u5E94\u8058\u8005", menuNames: ["\u5E94\u8058\u8005", "\u5E94\u8058\u7BA1\u7406", "\u5019\u9009\u4EBA", "\u5E94\u8058\u6279\u6B21"] }
|
|
5200
5838
|
};
|
|
5201
5839
|
var FEEDBACK_TODO_MENU_NAMES = ["\u6211\u7684\u9762\u8BD5", "\u6211\u7684\u9762\u8BD5\u5B89\u6392", "\u6211\u53C2\u4E0E\u7684\u9762\u8BD5"];
|
|
5840
|
+
function participationOf(r) {
|
|
5841
|
+
const tp = String(r?.interview_type_key || r?.interview_type || "").trim();
|
|
5842
|
+
const pick = (...keys) => {
|
|
5843
|
+
for (const k of keys) {
|
|
5844
|
+
const v = r?.[k];
|
|
5845
|
+
if (v === void 0 || v === null) continue;
|
|
5846
|
+
const s = String(v).trim();
|
|
5847
|
+
if (s) return { key: k, val: s };
|
|
5848
|
+
}
|
|
5849
|
+
return null;
|
|
5850
|
+
};
|
|
5851
|
+
if (/现场/.test(tp)) {
|
|
5852
|
+
const got2 = pick("interview_location");
|
|
5853
|
+
return {
|
|
5854
|
+
mode: "\u73B0\u573A\u9762\u8BD5",
|
|
5855
|
+
field: "interview_location",
|
|
5856
|
+
value: got2?.val ?? null,
|
|
5857
|
+
...got2 ? {} : { note: "\u5217\u8868\u672A\u8FD4\u56DE\u9762\u8BD5\u5730\u70B9\uFF1B\u9700\u5728 E10 \u540E\u53F0\u628A\u300C\u9762\u8BD5\u5730\u70B9\u300D\u52A0\u5165\u9762\u8BD5\u7BA1\u7406\u5217\u8868\u663E\u793A\u5217" }
|
|
5858
|
+
};
|
|
5859
|
+
}
|
|
5860
|
+
if (/AI\s*面试/i.test(tp)) {
|
|
5861
|
+
const got2 = pick("applet_code");
|
|
5862
|
+
return {
|
|
5863
|
+
mode: "AI\u9762\u8BD5",
|
|
5864
|
+
field: "applet_code",
|
|
5865
|
+
value: got2?.val ?? null,
|
|
5866
|
+
...got2 ? {} : { note: "AI \u9762\u8BD5\u4EE5\u5C0F\u7A0B\u5E8F\u7801/\u94FE\u63A5\u9080\u7EA6\uFF0C\u672C\u8EAB\u6CA1\u6709\u5730\u70B9" }
|
|
5867
|
+
};
|
|
5868
|
+
}
|
|
5869
|
+
if (/视频/.test(tp)) {
|
|
5870
|
+
const got2 = pick("video_url_info", "meeting_vedio", "meeting_id");
|
|
5871
|
+
return {
|
|
5872
|
+
mode: "\u89C6\u9891\u9762\u8BD5",
|
|
5873
|
+
field: got2?.key ?? "video_url_info",
|
|
5874
|
+
value: got2?.val ?? null,
|
|
5875
|
+
...got2 ? {} : { note: "\u89C6\u9891\u9762\u8BD5\u4EE5\u89C6\u9891\u94FE\u63A5/\u4F1A\u8BAE\u53F7\u9080\u7EA6\uFF0C\u672C\u8EAB\u6CA1\u6709\u5730\u70B9" }
|
|
5876
|
+
};
|
|
5877
|
+
}
|
|
5878
|
+
const got = pick("interview_location");
|
|
5879
|
+
return {
|
|
5880
|
+
mode: tp || "\u672A\u586B\u9762\u8BD5\u65B9\u5F0F",
|
|
5881
|
+
field: "interview_location",
|
|
5882
|
+
value: got?.val ?? null,
|
|
5883
|
+
...got ? {} : { note: "\u8BE5\u9762\u8BD5\u65B9\u5F0F\u672A\u914D\u7F6E\u53C2\u4E0E\u65B9\u5F0F\u5B57\u6BB5\uFF0C\u6216\u5217\u8868\u672A\u8FD4\u56DE" }
|
|
5884
|
+
};
|
|
5885
|
+
}
|
|
5202
5886
|
var DISPLAY_ALIASES = {
|
|
5203
5887
|
candidate_name: ["talent_id", "name"],
|
|
5204
5888
|
position_name: ["position_manage_id", "position"],
|
|
@@ -5468,6 +6152,8 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5468
6152
|
}
|
|
5469
6153
|
const out = {
|
|
5470
6154
|
env: new URL(baseUrl).hostname,
|
|
6155
|
+
baseUrl,
|
|
6156
|
+
selfUse: String(cache.selfUse || ""),
|
|
5471
6157
|
type,
|
|
5472
6158
|
listId,
|
|
5473
6159
|
menuName,
|
|
@@ -5567,6 +6253,9 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5567
6253
|
break;
|
|
5568
6254
|
}
|
|
5569
6255
|
}
|
|
6256
|
+
if (type === "interview") {
|
|
6257
|
+
row.participation = participationOf(r);
|
|
6258
|
+
}
|
|
5570
6259
|
outRows.push(row);
|
|
5571
6260
|
}
|
|
5572
6261
|
if (feedbackTodoMode) {
|
|
@@ -5586,7 +6275,9 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5586
6275
|
subject: r.subject,
|
|
5587
6276
|
mobile: r.mobile,
|
|
5588
6277
|
talent_id: r.talent_id,
|
|
5589
|
-
position_manage_id: r.position_manage_id
|
|
6278
|
+
position_manage_id: r.position_manage_id,
|
|
6279
|
+
// 参与方式按面试方式取值(现场=地点 / 视频=链接 / AI=小程序码),不要统一当"地点"
|
|
6280
|
+
participation: participationOf(r)
|
|
5590
6281
|
});
|
|
5591
6282
|
const pending = serverFilterApplied ? outRows : outRows.filter((r) => /待反馈/.test(st(r)));
|
|
5592
6283
|
const mineAll = serverFilterApplied ? outRows : me ? pending.filter((r) => iv(r).includes(me)) : [];
|
|
@@ -5738,7 +6429,9 @@ async function runInterviewNotAttended(env, args) {
|
|
|
5738
6429
|
// 🔴 type=interview 的 talent_id 放的是**候选人姓名**不是 id(已知口径,见聚才林
|
|
5739
6430
|
// recruit-read.md);下游编排一律用 candidate_manage_id / form_data_id,故此处不透传 talent_id。
|
|
5740
6431
|
candidate_manage_id: r.candidate_manage_id || null,
|
|
5741
|
-
form_data_id: r.form_data_id || null
|
|
6432
|
+
form_data_id: r.form_data_id || null,
|
|
6433
|
+
// 参与方式按面试方式取值(现场=地点 / 视频=链接 / AI=小程序码)
|
|
6434
|
+
participation: participationOf(r)
|
|
5742
6435
|
};
|
|
5743
6436
|
};
|
|
5744
6437
|
const total = base.total;
|
|
@@ -5770,7 +6463,6 @@ async function runInterviewNotAttended(env, args) {
|
|
|
5770
6463
|
rows: notAttended.map(slim),
|
|
5771
6464
|
listUrl,
|
|
5772
6465
|
listLocateLink: listUrl ? { title: "\u6253\u5F00\u6211\u53D1\u8D77\u7684\u9762\u8BD5\u5217\u8868", url: listUrl } : null,
|
|
5773
|
-
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",
|
|
5774
6466
|
note: notes.join("\uFF1B")
|
|
5775
6467
|
};
|
|
5776
6468
|
}
|
|
@@ -5889,7 +6581,24 @@ function clampPageSize(v) {
|
|
|
5889
6581
|
if (!Number.isFinite(n) || n <= 0) return 10;
|
|
5890
6582
|
return Math.min(200, Math.trunc(n));
|
|
5891
6583
|
}
|
|
5892
|
-
|
|
6584
|
+
var ledgerObjIdMemo = /* @__PURE__ */ new Map();
|
|
6585
|
+
async function resolveLedgerObjId(host, listId, fallbackObjId) {
|
|
6586
|
+
const key = String(listId || "");
|
|
6587
|
+
if (!key) return String(fallbackObjId);
|
|
6588
|
+
const cached = ledgerObjIdMemo.get(key);
|
|
6589
|
+
if (cached) return cached;
|
|
6590
|
+
try {
|
|
6591
|
+
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: { listId: key } });
|
|
6592
|
+
const v = String(li?.data?.objid || "");
|
|
6593
|
+
if (v) {
|
|
6594
|
+
ledgerObjIdMemo.set(key, v);
|
|
6595
|
+
return v;
|
|
6596
|
+
}
|
|
6597
|
+
} catch {
|
|
6598
|
+
}
|
|
6599
|
+
return String(fallbackObjId);
|
|
6600
|
+
}
|
|
6601
|
+
async function candidateSearchHandler(args, env) {
|
|
5893
6602
|
const host = env.host;
|
|
5894
6603
|
const session = await host.getSession();
|
|
5895
6604
|
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
@@ -5903,6 +6612,7 @@ async function handler(args, env) {
|
|
|
5903
6612
|
const cusMenuId = talent.cusMenuId;
|
|
5904
6613
|
const menuName = talent.menuName || "\u4EBA\u624D\u7BA1\u7406";
|
|
5905
6614
|
const fields = cache.fields[objId] || {};
|
|
6615
|
+
const ledgerObjId = await resolveLedgerObjId(host, String(listId), String(objId));
|
|
5906
6616
|
const nameField = "field_" + (fields.candidate_name || fields.name);
|
|
5907
6617
|
const mobileField = "field_" + fields.telephone;
|
|
5908
6618
|
const name = args.name ? String(args.name) : "";
|
|
@@ -5915,22 +6625,33 @@ async function handler(args, env) {
|
|
|
5915
6625
|
let searchType = "and";
|
|
5916
6626
|
let searchFields;
|
|
5917
6627
|
let searchNote;
|
|
6628
|
+
let keywordIgnored;
|
|
6629
|
+
if (keyword && (name || mobile)) {
|
|
6630
|
+
keywordIgnored = {
|
|
6631
|
+
keyword,
|
|
6632
|
+
reason: "keyword \u4E0E name/mobile \u4E92\u65A5\uFF1A\u672C\u6B21\u6309 name/mobile \u7CBE\u786E\u6761\u4EF6\u8FC7\u6EE4\uFF0Ckeyword \u5DF2\u5FFD\u7565\uFF1B\u5982\u9700\u8DE8\u5B57\u6BB5\u5173\u952E\u8BCD\u641C\u7D22\uFF0C\u8BF7\u4E0D\u8981\u540C\u65F6\u4F20\u59D3\u540D/\u624B\u673A\u53F7"
|
|
6633
|
+
};
|
|
6634
|
+
}
|
|
5918
6635
|
if (keyword && !name && !mobile) {
|
|
5919
6636
|
searchType = "or";
|
|
5920
6637
|
const meta = await resolveListSearchMeta(host, String(listId));
|
|
5921
6638
|
const used = [];
|
|
6639
|
+
const fellBack = [];
|
|
5922
6640
|
for (const dk of KEYWORD_TEXT_FIELDS) {
|
|
5923
6641
|
const fid = fields[dk];
|
|
5924
6642
|
if (!fid) continue;
|
|
5925
6643
|
const bare = String(fid);
|
|
5926
6644
|
const mk = "field_" + bare;
|
|
5927
|
-
const
|
|
5928
|
-
|
|
5929
|
-
|
|
6645
|
+
const norm = normalizeListOperator(meta.operators[bare]);
|
|
6646
|
+
if (norm.fellBack) fellBack.push(meta.labels[bare] || dk);
|
|
6647
|
+
conds[mk] = [{ [mk]: keyword, [mk + "_condition_type"]: norm.op }];
|
|
6648
|
+
used.push({ field: dk, label: meta.labels[bare] || dk, operator: norm.op, ...norm.fellBack ? { operatorFallback: true } : {} });
|
|
5930
6649
|
}
|
|
5931
6650
|
searchFields = used;
|
|
5932
6651
|
if (!used.length) {
|
|
5933
6652
|
searchNote = "\u5173\u952E\u8BCD\u641C\u7D22\u672A\u5B9A\u4F4D\u5230\u4EFB\u4F55\u53EF\u7528\u5B57\u6BB5\uFF08\u73AF\u5883\u7F13\u5B58 fields \u4E0E\u76EE\u6807\u5B57\u6BB5\u6E05\u5355\u65E0\u4EA4\u96C6\uFF09\uFF0C\u672C\u6B21\u672A\u505A\u5173\u952E\u8BCD\u8FC7\u6EE4\uFF0C\u8FD4\u56DE\u7684\u662F\u5168\u5E93\u5206\u9875\u7ED3\u679C\uFF1B\u8BF7\u6539\u7528 name/mobile \u7CBE\u786E\u641C\u7D22";
|
|
6653
|
+
} else if (fellBack.length) {
|
|
6654
|
+
searchNote = `\u5B57\u6BB5\u300C${fellBack.join("\u3001")}\u300D\u914D\u7F6E\u7684\u64CD\u4F5C\u7B26\u4E0D\u5728\u5217\u8868\u67E5\u8BE2\u5DF2\u77E5\u96C6\u5408\u5185\uFF0C\u5DF2\u56DE\u9000 like\uFF1B\u5982\u9700\u7CBE\u786E\u5339\u914D\u8BF7\u6539\u7528 name/mobile`;
|
|
5934
6655
|
}
|
|
5935
6656
|
}
|
|
5936
6657
|
const wantPageSize = clampPageSize(args.pageSize);
|
|
@@ -5959,12 +6680,12 @@ async function handler(args, env) {
|
|
|
5959
6680
|
delete cntBody.pageSize;
|
|
5960
6681
|
const [resp, c] = await Promise.all([
|
|
5961
6682
|
host.request({
|
|
5962
|
-
path: "/api/ebuilder/form/list/getListDatas?passid=" +
|
|
6683
|
+
path: "/api/ebuilder/form/list/getListDatas?passid=" + ledgerObjId + "&cid=" + ledgerObjId,
|
|
5963
6684
|
body: baseBody,
|
|
5964
6685
|
headers: extra
|
|
5965
6686
|
}),
|
|
5966
6687
|
host.request({
|
|
5967
|
-
path: "/api/ebuilder/form/list/getListDataCount?passid=" +
|
|
6688
|
+
path: "/api/ebuilder/form/list/getListDataCount?passid=" + ledgerObjId + "&cid=" + ledgerObjId,
|
|
5968
6689
|
body: cntBody,
|
|
5969
6690
|
headers: extra
|
|
5970
6691
|
}).catch(() => null)
|
|
@@ -5981,11 +6702,13 @@ async function handler(args, env) {
|
|
|
5981
6702
|
}
|
|
5982
6703
|
const out = {
|
|
5983
6704
|
env: new URL(baseUrl).hostname,
|
|
6705
|
+
baseUrl,
|
|
5984
6706
|
total,
|
|
5985
6707
|
// 🔴 显式回执「本次关键词实际搜了哪些字段、各用什么操作符」:
|
|
5986
6708
|
// 条件被服务端静默忽略时(total 与全库相同)调用方无从判断,有了这个清单才能自查。
|
|
5987
6709
|
...searchFields ? { keyword, searchFields } : {},
|
|
5988
6710
|
...searchNote ? { searchNote } : {},
|
|
6711
|
+
...keywordIgnored ? { keywordIgnored } : {},
|
|
5989
6712
|
rows: []
|
|
5990
6713
|
};
|
|
5991
6714
|
const outRows = out.rows;
|
|
@@ -6039,6 +6762,9 @@ async function handler(args, env) {
|
|
|
6039
6762
|
fetched,
|
|
6040
6763
|
matched: kept.length,
|
|
6041
6764
|
fetchPageSize,
|
|
6765
|
+
// 🔴 2026-11-28 修「total 语义歧义」:顶层 total 是**服务端未过滤**的总数(关键词命中全量),
|
|
6766
|
+
// 不是时间段内的数量。这里显式带出,避免调用方把 total 当成「半年内有多少人」。
|
|
6767
|
+
totalUnfiltered: total,
|
|
6042
6768
|
// 🔴 必须显式声明「命中数 ≠ 该时间段全库总数」:客户端只能筛已取回的行,
|
|
6043
6769
|
// 不写清会让调用方把 matched 当成真实总数,进而误判「半年内只有这么多人」。
|
|
6044
6770
|
note: kept.length < wantPageSize ? `\u670D\u52A1\u7AEF\u4E0D\u652F\u6301\u6309\u521B\u5EFA\u65F6\u95F4\u8FC7\u6EE4\uFF0C\u5DF2\u5BA2\u6237\u7AEF\u7B5B\u9009\uFF1A\u53D6\u56DE ${fetched} \u884C\u3001\u547D\u4E2D ${kept.length} \u884C\uFF08\u5C11\u4E8E\u671F\u671B ${wantPageSize}\uFF09\u3002\u547D\u4E2D\u6570\u4E0D\u4EE3\u8868\u8BE5\u65F6\u95F4\u6BB5\u5168\u5E93\u603B\u6570\uFF0C\u53EF\u52A0\u5927 pageSize \u6216\u7FFB\u9875\u540E\u91CD\u67E5` : `\u670D\u52A1\u7AEF\u4E0D\u652F\u6301\u6309\u521B\u5EFA\u65F6\u95F4\u8FC7\u6EE4\uFF0C\u5DF2\u5BA2\u6237\u7AEF\u7B5B\u9009\uFF1A\u53D6\u56DE ${fetched} \u884C\u3001\u547D\u4E2D ${kept.length} \u884C`
|
|
@@ -6058,6 +6784,13 @@ function clampInt(v, min, max, fallback) {
|
|
|
6058
6784
|
function normTag(s) {
|
|
6059
6785
|
return String(s == null ? "" : s).trim().toLowerCase();
|
|
6060
6786
|
}
|
|
6787
|
+
var LIST_QUERY_OPS = /* @__PURE__ */ new Set(["like", "eq", "neq", "ne", "in", "between", "inc", "contains", "notlike", "uncontains"]);
|
|
6788
|
+
function normalizeListOperator(raw) {
|
|
6789
|
+
const rawStr = String(raw ?? "").trim();
|
|
6790
|
+
const s = rawStr.toLowerCase();
|
|
6791
|
+
if (s && LIST_QUERY_OPS.has(s)) return { op: rawStr, fellBack: false };
|
|
6792
|
+
return { op: "like", fellBack: true };
|
|
6793
|
+
}
|
|
6061
6794
|
function firstConditionType(it) {
|
|
6062
6795
|
const ct = it?.conditionType ?? it?.conditionTypeValue ?? it?.conditionTypes ?? it?.conditions;
|
|
6063
6796
|
const pick = (v) => {
|
|
@@ -6190,6 +6923,7 @@ async function handlerSearchByTag(args, env) {
|
|
|
6190
6923
|
if (!resolved.length) {
|
|
6191
6924
|
return rsSuccess("recruit-stage.candidate.searchByTag", {
|
|
6192
6925
|
env: new URL(baseUrl).hostname,
|
|
6926
|
+
baseUrl,
|
|
6193
6927
|
wanted,
|
|
6194
6928
|
match,
|
|
6195
6929
|
resolved: [],
|
|
@@ -6203,12 +6937,7 @@ async function handlerSearchByTag(args, env) {
|
|
|
6203
6937
|
});
|
|
6204
6938
|
}
|
|
6205
6939
|
const keys = await resolveListSearchMeta(host, String(listId));
|
|
6206
|
-
|
|
6207
|
-
try {
|
|
6208
|
-
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: { listId: String(listId) } });
|
|
6209
|
-
if (li?.data?.objid) ledgerObjId = String(li.data.objid);
|
|
6210
|
-
} catch {
|
|
6211
|
-
}
|
|
6940
|
+
const ledgerObjId = await resolveLedgerObjId(host, String(listId), String(objId));
|
|
6212
6941
|
const listPath = "/api/ebuilder/form/list/getListDatas?passid=" + ledgerObjId + "&cid=" + ledgerObjId;
|
|
6213
6942
|
const countPath = "/api/ebuilder/form/list/getListDataCount?passid=" + ledgerObjId + "&cid=" + ledgerObjId;
|
|
6214
6943
|
const headers = { ebBusinessId: listId };
|
|
@@ -6395,7 +7124,7 @@ var searchOperations = [
|
|
|
6395
7124
|
pageSize: { type: "integer", minimum: 1, maximum: 100 },
|
|
6396
7125
|
current: { type: "integer", minimum: 1 }
|
|
6397
7126
|
}, {}),
|
|
6398
|
-
handler
|
|
7127
|
+
handler: candidateSearchHandler
|
|
6399
7128
|
},
|
|
6400
7129
|
{
|
|
6401
7130
|
name: "recruit-stage.candidate.searchByTag",
|
|
@@ -6702,8 +7431,9 @@ function makeDictLookup2(cache) {
|
|
|
6702
7431
|
function detailDisplayValue(d, dictName) {
|
|
6703
7432
|
if (!d) return "";
|
|
6704
7433
|
if (Array.isArray(d.dataOptions) && d.dataOptions.length) {
|
|
6705
|
-
const
|
|
6706
|
-
|
|
7434
|
+
const names = d.dataOptions.map((o) => String(o?.content ?? "")).filter(Boolean);
|
|
7435
|
+
if (names.length) return names.join(",");
|
|
7436
|
+
return String(d.dataOptions[0]?.optionId ?? "");
|
|
6707
7437
|
}
|
|
6708
7438
|
if (d.dataText?.content != null) return String(d.dataText.content);
|
|
6709
7439
|
if (d.content != null) {
|
|
@@ -6842,10 +7572,125 @@ var profileOperations = [
|
|
|
6842
7572
|
}
|
|
6843
7573
|
];
|
|
6844
7574
|
|
|
7575
|
+
// src/shortcuts/recruit-stage/operations/shortlist.ts
|
|
7576
|
+
function clampInt2(v, min, max, fallback) {
|
|
7577
|
+
const n = Number(v);
|
|
7578
|
+
if (!Number.isFinite(n)) return fallback;
|
|
7579
|
+
return Math.min(max, Math.max(min, Math.trunc(n)));
|
|
7580
|
+
}
|
|
7581
|
+
function slimProfile(profile, full) {
|
|
7582
|
+
if (full) return profile || {};
|
|
7583
|
+
const basic = profile?.basic || {};
|
|
7584
|
+
const rawMain = profile?.rawMain || {};
|
|
7585
|
+
return {
|
|
7586
|
+
talentId: profile?.talentId || "",
|
|
7587
|
+
name: basic.name || "",
|
|
7588
|
+
degree: basic.degree || "",
|
|
7589
|
+
college: basic.college || "",
|
|
7590
|
+
current_position: basic.current_position || "",
|
|
7591
|
+
current_industry: basic.current_industry || "",
|
|
7592
|
+
intend_position: basic.intend_position || "",
|
|
7593
|
+
expect_salary: basic.expect_salary || "",
|
|
7594
|
+
location_area: basic.location_area || "",
|
|
7595
|
+
graduate_date: basic.graduate_date || "",
|
|
7596
|
+
recruit_status: basic.recruit_status || "",
|
|
7597
|
+
// 渠道导入的人才,工作年限常只落在 rawMain.work_exp,这里提出到顶层方便直接读
|
|
7598
|
+
work_exp: rawMain.work_exp || "",
|
|
7599
|
+
education: profile?.education || [],
|
|
7600
|
+
workExperience: profile?.workExperience || [],
|
|
7601
|
+
projectExperience: profile?.projectExperience || [],
|
|
7602
|
+
subTableStats: profile?.subTableStats || {},
|
|
7603
|
+
...profile?.warnings ? { warnings: profile.warnings } : {}
|
|
7604
|
+
};
|
|
7605
|
+
}
|
|
7606
|
+
async function handlerShortlist(args, env) {
|
|
7607
|
+
const keyword = String(args.keyword || "").trim();
|
|
7608
|
+
if (!keyword) {
|
|
7609
|
+
throw rsFail('keyword \u5FC5\u586B\uFF1A\u8BF7\u63D0\u4F9B\u8981\u68C0\u7D22\u7684\u5173\u952E\u8BCD\uFF0C\u4F8B\u5982 {"keyword":"Java\u5F00\u53D1"}');
|
|
7610
|
+
}
|
|
7611
|
+
const limit = clampInt2(args.limit, 1, 10, 5);
|
|
7612
|
+
const concurrency = clampInt2(args.concurrency, 1, 10, 10);
|
|
7613
|
+
const full = args.full === true;
|
|
7614
|
+
const startedAt = Date.now();
|
|
7615
|
+
const tSearch = Date.now();
|
|
7616
|
+
const searchEnv = await candidateSearchHandler(
|
|
7617
|
+
{
|
|
7618
|
+
keyword,
|
|
7619
|
+
pageSize: limit,
|
|
7620
|
+
...args.current ? { current: Number(args.current) } : {}
|
|
7621
|
+
},
|
|
7622
|
+
env
|
|
7623
|
+
);
|
|
7624
|
+
const sdata = searchEnv?.data || {};
|
|
7625
|
+
const rows = (sdata.rows || []).slice(0, limit);
|
|
7626
|
+
const searchMs = Date.now() - tSearch;
|
|
7627
|
+
const tProfiles = Date.now();
|
|
7628
|
+
const candidates = [];
|
|
7629
|
+
const errors = [];
|
|
7630
|
+
for (let i = 0; i < rows.length; i += concurrency) {
|
|
7631
|
+
const batch = rows.slice(i, i + concurrency);
|
|
7632
|
+
const settled = await Promise.allSettled(
|
|
7633
|
+
batch.map((r) => handlerProfile({ talentId: r.talentId }, env))
|
|
7634
|
+
);
|
|
7635
|
+
settled.forEach((s, idx) => {
|
|
7636
|
+
const src = batch[idx] || {};
|
|
7637
|
+
if (s.status === "fulfilled") {
|
|
7638
|
+
const data = s.value?.data || {};
|
|
7639
|
+
candidates.push(slimProfile(data, full));
|
|
7640
|
+
} else {
|
|
7641
|
+
const reason = s.reason;
|
|
7642
|
+
errors.push({
|
|
7643
|
+
talentId: src.talentId || null,
|
|
7644
|
+
name: src.name || null,
|
|
7645
|
+
message: String(reason && reason.message || reason || "\u672A\u77E5\u9519\u8BEF")
|
|
7646
|
+
});
|
|
7647
|
+
}
|
|
7648
|
+
});
|
|
7649
|
+
}
|
|
7650
|
+
const profilesMs = Date.now() - tProfiles;
|
|
7651
|
+
return rsSuccess("recruit-stage.candidate.shortlist", {
|
|
7652
|
+
keyword,
|
|
7653
|
+
...sdata.env ? { env: sdata.env } : {},
|
|
7654
|
+
...sdata.baseUrl ? { baseUrl: sdata.baseUrl } : {},
|
|
7655
|
+
// total 是服务端关键词命中总数(不是本次取回数),returned/shown 才是本次实际处理量
|
|
7656
|
+
total: Number(sdata.total) || 0,
|
|
7657
|
+
returned: rows.length,
|
|
7658
|
+
shown: candidates.length,
|
|
7659
|
+
limit,
|
|
7660
|
+
concurrency,
|
|
7661
|
+
...sdata.searchFields ? { searchFields: sdata.searchFields } : {},
|
|
7662
|
+
...sdata.searchNote ? { searchNote: sdata.searchNote } : {},
|
|
7663
|
+
listRows: rows,
|
|
7664
|
+
candidates,
|
|
7665
|
+
...errors.length ? { errors } : {},
|
|
7666
|
+
timing: { searchMs, profilesMs, totalMs: Date.now() - startedAt }
|
|
7667
|
+
});
|
|
7668
|
+
}
|
|
7669
|
+
var shortlistOperations = [
|
|
7670
|
+
{
|
|
7671
|
+
name: "recruit-stage.candidate.shortlist",
|
|
7672
|
+
resource: "recruit.candidate",
|
|
7673
|
+
method: "query",
|
|
7674
|
+
action: "candidate.shortlist",
|
|
7675
|
+
summary: "\u5173\u952E\u8BCD\u4E00\u6B21\u5B8C\u6210\u300C\u641C\u7D22 + \u9010\u4EBA\u6863\u6848\u300D\uFF1A\u53EA\u53D6\u524D limit \u4EBA\u5E76\u5E76\u53D1\u62C9\u53D6\u6863\u6848\uFF0C\u8FD4\u56DE\u7CBE\u7B80\u6863\u6848\uFF08\u5DE5\u4F5C/\u9879\u76EE\u7ECF\u5386\uFF09\u4E0E\u5206\u6BB5\u8017\u65F6\u3002\u7528\u4E8E\u7B80\u5386\u68C0\u7D22\u4E0E\u4EBA\u5C97\u5339\u914D\uFF0C\u66FF\u4EE3\u300C\u5148 search \u518D\u9010\u4EBA profile\u300D\u7684\u591A\u6B21\u5F80\u8FD4",
|
|
7676
|
+
capability: "recruit.candidate.shortlist",
|
|
7677
|
+
risk: "read",
|
|
7678
|
+
inputSchema: schemaOf({
|
|
7679
|
+
keyword: { type: "string", description: "\u8DE8\u5B57\u6BB5\u5173\u952E\u8BCD\uFF08\u5339\u914D\u59D3\u540D/\u671F\u671B\u804C\u4F4D/\u5F53\u524D\u804C\u4F4D/\u6700\u8FD1\u804C\u4F4D/\u516C\u53F8/\u9662\u6821/\u81EA\u6211\u8BC4\u4EF7\uFF09" },
|
|
7680
|
+
limit: { type: "integer", minimum: 1, maximum: 10, description: "\u53D6\u524D N \u4EBA\uFF0C\u9ED8\u8BA4 5\uFF0C\u4E0A\u9650 10" },
|
|
7681
|
+
current: { type: "integer", minimum: 1, description: "\u641C\u7D22\u7ED3\u679C\u8D77\u59CB\u9875\uFF0C\u9ED8\u8BA4 1" },
|
|
7682
|
+
concurrency: { type: "integer", minimum: 1, maximum: 10, description: "\u6863\u6848\u5E76\u53D1\u6570\uFF0C\u9ED8\u8BA4 10" },
|
|
7683
|
+
full: { type: "boolean", description: "true=\u8FD4\u56DE\u5B8C\u6574\u6863\u6848\uFF08\u542B rawMain \u5168\u5B57\u6BB5\uFF09\uFF1B\u9ED8\u8BA4 false \u8FD4\u56DE\u7CBE\u7B80\u6863\u6848" }
|
|
7684
|
+
}, { required: ["keyword"] }),
|
|
7685
|
+
handler: handlerShortlist
|
|
7686
|
+
}
|
|
7687
|
+
];
|
|
7688
|
+
|
|
6845
7689
|
// src/shortcuts/recruit-stage/operations/registry.ts
|
|
6846
7690
|
var definitions = [
|
|
6847
7691
|
...searchOperations,
|
|
6848
7692
|
...profileOperations,
|
|
7693
|
+
...shortlistOperations,
|
|
6849
7694
|
...listOperations,
|
|
6850
7695
|
...tagOperations,
|
|
6851
7696
|
...jdCreateOperations,
|
|
@@ -6874,10 +7719,12 @@ function getRecruitStageOperation(operation) {
|
|
|
6874
7719
|
}
|
|
6875
7720
|
async function executeRecruitStageOperation(operation, input, env) {
|
|
6876
7721
|
const definition = getRecruitStageOperation(operation);
|
|
7722
|
+
const debugTimings = input.debugTimings === true;
|
|
7723
|
+
const validated = debugTimings ? Object.fromEntries(Object.entries(input).filter(([k]) => k !== "debugTimings")) : input;
|
|
6877
7724
|
const schema = definition.inputSchema;
|
|
6878
7725
|
if (schema && schema.additionalProperties === false) {
|
|
6879
7726
|
const known = Object.keys(schema.properties || {});
|
|
6880
|
-
const unknown = Object.keys(
|
|
7727
|
+
const unknown = Object.keys(validated || {}).filter((key) => !known.includes(key));
|
|
6881
7728
|
if (unknown.length > 0) {
|
|
6882
7729
|
throw new RecruitStageCliError(
|
|
6883
7730
|
"validation",
|
|
@@ -6887,7 +7734,13 @@ async function executeRecruitStageOperation(operation, input, env) {
|
|
|
6887
7734
|
);
|
|
6888
7735
|
}
|
|
6889
7736
|
}
|
|
6890
|
-
|
|
7737
|
+
const startedAt = Date.now();
|
|
7738
|
+
const result = await definition.handler(validated, env);
|
|
7739
|
+
if (debugTimings && result && typeof result === "object") {
|
|
7740
|
+
const marks = { ...env?.__recruitTimings ?? {} };
|
|
7741
|
+
result.meta = { ...result.meta ?? {}, timings: { ...marks, totalMs: Date.now() - startedAt } };
|
|
7742
|
+
}
|
|
7743
|
+
return result;
|
|
6891
7744
|
}
|
|
6892
7745
|
|
|
6893
7746
|
// src/shortcuts/recruit-stage/manifest.ts
|
|
@@ -6918,9 +7771,9 @@ var recruitStageManifest = {
|
|
|
6918
7771
|
};
|
|
6919
7772
|
|
|
6920
7773
|
// src/shortcuts/recruit-stage/context.ts
|
|
6921
|
-
import { join as join4, resolve as resolve4, dirname as
|
|
6922
|
-
import { existsSync as
|
|
6923
|
-
import { readFile as
|
|
7774
|
+
import { join as join4, resolve as resolve4, dirname as dirname3 } from "node:path";
|
|
7775
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
7776
|
+
import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3 } from "node:fs/promises";
|
|
6924
7777
|
import { homedir as homedir4 } from "node:os";
|
|
6925
7778
|
var flowMemo = /* @__PURE__ */ new Map();
|
|
6926
7779
|
var SELFUSE_DEFAULT_FLOW = {
|
|
@@ -6940,7 +7793,7 @@ function cacheDirFor(baseUrl) {
|
|
|
6940
7793
|
async function readLegacyCacheExtra(baseUrl) {
|
|
6941
7794
|
try {
|
|
6942
7795
|
const dir = cacheDirFor(baseUrl);
|
|
6943
|
-
if (!
|
|
7796
|
+
if (!existsSync3(dir)) return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
6944
7797
|
const files = await (await import("node:fs/promises")).readdir(dir);
|
|
6945
7798
|
const jsonFiles = files.filter((f) => f.endsWith(".json"));
|
|
6946
7799
|
let flow = null;
|
|
@@ -6948,7 +7801,7 @@ async function readLegacyCacheExtra(baseUrl) {
|
|
|
6948
7801
|
for (const f of jsonFiles) {
|
|
6949
7802
|
let raw;
|
|
6950
7803
|
try {
|
|
6951
|
-
raw = JSON.parse(await
|
|
7804
|
+
raw = JSON.parse(await readFile3(join4(dir, f), "utf8"));
|
|
6952
7805
|
} catch {
|
|
6953
7806
|
continue;
|
|
6954
7807
|
}
|
|
@@ -6978,7 +7831,7 @@ function flowMissPath(baseUrl) {
|
|
|
6978
7831
|
async function readFlowMissAt(baseUrl) {
|
|
6979
7832
|
if (process.env.E10_RS_NO_FLOW_CACHE === "1") return null;
|
|
6980
7833
|
try {
|
|
6981
|
-
const raw = JSON.parse(await
|
|
7834
|
+
const raw = JSON.parse(await readFile3(flowMissPath(baseUrl), "utf8"));
|
|
6982
7835
|
if (raw?.baseUrl !== baseUrl || !raw?.missedAt) return null;
|
|
6983
7836
|
if (Date.now() - raw.missedAt > FLOW_MISS_TTL_MS) return null;
|
|
6984
7837
|
return raw.missedAt;
|
|
@@ -6990,10 +7843,10 @@ async function writeFlowMiss(baseUrl) {
|
|
|
6990
7843
|
if (process.env.E10_RS_NO_FLOW_CACHE === "1") return;
|
|
6991
7844
|
try {
|
|
6992
7845
|
const dir = cacheDirFor(baseUrl);
|
|
6993
|
-
if (!
|
|
7846
|
+
if (!existsSync3(dir)) return;
|
|
6994
7847
|
const target = flowMissPath(baseUrl);
|
|
6995
|
-
await
|
|
6996
|
-
await
|
|
7848
|
+
await mkdir3(dirname3(target), { recursive: true });
|
|
7849
|
+
await writeFile3(target, JSON.stringify({ baseUrl, missedAt: Date.now() }), "utf8");
|
|
6997
7850
|
} catch {
|
|
6998
7851
|
}
|
|
6999
7852
|
}
|
|
@@ -7005,7 +7858,7 @@ function findFlowMenu(cache) {
|
|
|
7005
7858
|
}
|
|
7006
7859
|
return null;
|
|
7007
7860
|
}
|
|
7008
|
-
function
|
|
7861
|
+
function isDefaultFlowRow2(x) {
|
|
7009
7862
|
if (!x) return false;
|
|
7010
7863
|
const cands = [x.is_default, x.isDefault, x.default_flow, x.defaultFlow, x.is_enable, x.enabled, x.status];
|
|
7011
7864
|
for (const v of cands) {
|
|
@@ -7065,7 +7918,7 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
7065
7918
|
headers: { ebBusinessId: menu.listId }
|
|
7066
7919
|
});
|
|
7067
7920
|
const rows = r?.data?.data || r?.data?.displayData || [];
|
|
7068
|
-
const pick = rows.find(
|
|
7921
|
+
const pick = rows.find(isDefaultFlowRow2) || (rows.length === 1 ? rows[0] : null);
|
|
7069
7922
|
if (pick) {
|
|
7070
7923
|
const id = String(pick.form_data_id || pick.id || "");
|
|
7071
7924
|
const name = String(pick.name || pick.flow_name || pick.content || "");
|
|
@@ -7088,7 +7941,7 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
7088
7941
|
});
|
|
7089
7942
|
const rows = r?.data?.list || r?.data?.rows || r?.data || [];
|
|
7090
7943
|
const list = Array.isArray(rows) ? rows : [];
|
|
7091
|
-
const enabled = list.find(
|
|
7944
|
+
const enabled = list.find(isDefaultFlowRow2) || null;
|
|
7092
7945
|
if (enabled?.id) {
|
|
7093
7946
|
result = { id: String(enabled.id), name: String(enabled.name || enabled.flow_name || "") };
|
|
7094
7947
|
serverResolved = true;
|
|
@@ -7104,7 +7957,8 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
7104
7957
|
} catch {
|
|
7105
7958
|
host2 = "";
|
|
7106
7959
|
}
|
|
7107
|
-
|
|
7960
|
+
const bySelfTenant = isSelfTenant(cache?.tenantKey);
|
|
7961
|
+
if (bySelfTenant || isSelfUse && host2 === SELFUSE_DEFAULT_FLOW.selfUseHost) {
|
|
7108
7962
|
result = { id: SELFUSE_DEFAULT_FLOW.id, name: SELFUSE_DEFAULT_FLOW.name };
|
|
7109
7963
|
}
|
|
7110
7964
|
}
|
|
@@ -7132,17 +7986,22 @@ async function resolveDigitalHumanMenu(host, baseUrl, cache) {
|
|
|
7132
7986
|
}
|
|
7133
7987
|
var loaders = /* @__PURE__ */ new Map();
|
|
7134
7988
|
function createRecruitStageContext() {
|
|
7135
|
-
|
|
7989
|
+
let own = null;
|
|
7990
|
+
const fn = (async (host) => {
|
|
7136
7991
|
const loaderKey = "shared";
|
|
7137
7992
|
if (!loaders.has(loaderKey)) loaders.set(loaderKey, createRecruitContextLoader());
|
|
7993
|
+
own = null;
|
|
7138
7994
|
const cache = await loaders.get(loaderKey).load(host);
|
|
7995
|
+
own = loaders.get(loaderKey).lastMeta();
|
|
7139
7996
|
const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, "");
|
|
7140
7997
|
const [defaultRecruitFlow, digitalHumanMenu] = await Promise.all([
|
|
7141
7998
|
resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache),
|
|
7142
7999
|
resolveDigitalHumanMenu(host, baseUrl, cache)
|
|
7143
8000
|
]);
|
|
7144
8001
|
return { ...cache, defaultRecruitFlow, digitalHumanMenu };
|
|
7145
|
-
};
|
|
8002
|
+
});
|
|
8003
|
+
fn.lastCacheMeta = () => own;
|
|
8004
|
+
return fn;
|
|
7146
8005
|
}
|
|
7147
8006
|
|
|
7148
8007
|
// src/shortcuts/recruit-stage/index.ts
|
|
@@ -7171,7 +8030,7 @@ async function inputFrom(options, extra = {}) {
|
|
|
7171
8030
|
if (opts.input) {
|
|
7172
8031
|
let raw;
|
|
7173
8032
|
try {
|
|
7174
|
-
raw = stripBom(opts.input === "-" ? await readStdin() : await
|
|
8033
|
+
raw = stripBom(opts.input === "-" ? await readStdin() : await readFile4(String(opts.input), "utf8"));
|
|
7175
8034
|
} catch {
|
|
7176
8035
|
throw rsValidationError("input_unreadable", `\u65E0\u6CD5\u8BFB\u53D6 --input\uFF1A${String(opts.input)}`);
|
|
7177
8036
|
}
|
|
@@ -7212,6 +8071,10 @@ function failureEnvelope(error) {
|
|
|
7212
8071
|
error: toErrorEnvelope(error)
|
|
7213
8072
|
};
|
|
7214
8073
|
}
|
|
8074
|
+
function attachCacheMeta(result, meta) {
|
|
8075
|
+
if (!meta) return result;
|
|
8076
|
+
return { ...result, meta: { ...result.meta || {}, cache: meta } };
|
|
8077
|
+
}
|
|
7215
8078
|
async function executeAndPrint(ctx, operation, input) {
|
|
7216
8079
|
try {
|
|
7217
8080
|
const host = createRecruitStageHost(ctx);
|
|
@@ -7222,14 +8085,15 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
7222
8085
|
continuation: createRecruitStageContinuationSigner(ctx),
|
|
7223
8086
|
recruitContext: () => contextLoader(host)
|
|
7224
8087
|
});
|
|
7225
|
-
|
|
8088
|
+
const cacheMeta = contextLoader.lastCacheMeta();
|
|
8089
|
+
ctx.output.write(successEnvelope(operation, attachCacheMeta(result, cacheMeta)), { json: true });
|
|
7226
8090
|
} catch (error) {
|
|
7227
8091
|
const env = failureEnvelope(error);
|
|
7228
8092
|
if (shouldReportPlatformError(error)) {
|
|
7229
8093
|
const pe = toPlatformError(error);
|
|
7230
|
-
|
|
8094
|
+
ctx.output.error({ ...env, code: pe.code, message: pe.message });
|
|
7231
8095
|
} else {
|
|
7232
|
-
|
|
8096
|
+
ctx.output.error(env);
|
|
7233
8097
|
}
|
|
7234
8098
|
process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
|
|
7235
8099
|
}
|
|
@@ -7254,6 +8118,7 @@ var recruitStageShortcut = {
|
|
|
7254
8118
|
}
|
|
7255
8119
|
};
|
|
7256
8120
|
export {
|
|
8121
|
+
attachCacheMeta,
|
|
7257
8122
|
inputFrom,
|
|
7258
8123
|
recruitStageShortcut,
|
|
7259
8124
|
successEnvelope
|