weaver-work-cli 0.1.44 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
- package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
- package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
- package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
- package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-MCXQBD6N.js} +3 -3
- package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
- package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-4RWS2YYL.js} +5 -5
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-6AXKWFKG.js} +32 -12
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-6V5ZPKHV.js} +56 -12
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-76H3IKH6.js} +178 -37
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-AD46OMQK.js} +239 -41
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
- package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
- package/dist/chunks/{chunk-CWYGFU5B.js → chunk-GSZTA43P.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-IP4CWQCF.js} +11 -11
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-IRMIEDXN.js} +1 -1
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-JFAWZX53.js} +134 -13
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-OXHHJWNC.js} +1 -1
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-PSOMGA3U.js} +4 -4
- package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
- package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
- package/dist/chunks/{chunk-XHK4MDR5.js → chunk-UFIFZ4YC.js} +48 -14
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
- package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
- package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-H7EHQXYY.js} +2 -2
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
- package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
- package/dist/chunks/{create-flow-J22BO65E.js → create-flow-VRVJEOBX.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-SH2LM3NK.js} +648 -88
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-66FPSJDV.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-UH2TZBVA.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-CAKMMV7K.js} +3 -3
- package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
- package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
- package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
- package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
- package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
- package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
- package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
- package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
- package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-DD6ULZ3I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-VTBFW4HI.js} +12 -12
- package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
- package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
- package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
- package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-CAKZTUA7.js} +1343 -178
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-JVQBLFQ5.js} +10 -10
- package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
- package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
- package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-5U55FMXZ.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-IDETODCA.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/cmd/action.js +14 -10
- package/dist/index.js +30 -30
- package/dist/internal/e10/auth/commands.js +32 -0
- package/dist/internal/e10/auth/error-log.js +156 -26
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/context.js +12 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +19 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/ehr/host.js +2 -2
- package/dist/shortcuts/ehr/index.js +14 -3
- package/dist/shortcuts/ehr/manifest.js +5 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +44 -12
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +146 -43
- package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +154 -36
- package/dist/shortcuts/ehr/operations/recruit.js +196 -12
- package/dist/shortcuts/ehr/operations/registry.js +4 -0
- package/dist/shortcuts/ehr/operations.js +24 -0
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +274 -75
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +63 -11
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +38 -7
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/invitation.js +27 -4
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +356 -29
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +36 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +309 -67
- package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +310 -17
- package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
- package/dist/shortcuts/recruit-stage/shared.js +221 -24
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/docs/contract.md +1 -0
- package/docs/e10-auth.md +4 -2
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jucailin/SKILL.md +12 -3
- package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
- package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -91
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
- package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +55 -11
- package/skills/weaver-e10-meeting/SKILL.md +103 -11
- package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -11
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -8
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +23 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +11 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
|
@@ -19,27 +19,30 @@ import { getDsOptions, getFormDataRecord, resolvePersonId, saveFormData, toSubmi
|
|
|
19
19
|
* - 招聘人数 recruit_count=1、薪酬月份数 number_of_pay_months=12
|
|
20
20
|
* - 薪酬类型 salary_type=月薪、招聘方式 recruit_type=社会招聘(ds/options)
|
|
21
21
|
* - 招聘负责人 / 用人经理 = 当前登录用户
|
|
22
|
-
* -
|
|
22
|
+
* - 职位属性/序列/学历/工作年限/薪酬上下限/招聘流程 = **取环境内已有职位记录的值**
|
|
23
23
|
* ("默认值 = 系统现成值",保证引用有效;取不到则跳过并在摘要中标注)
|
|
24
|
+
* - 工作地点 work_location = 「办公地点」列表里启用状态的默认详细地址(**不参与继承**,id 运行时解析)
|
|
24
25
|
*/
|
|
25
26
|
const TEXT_KEYS = ['position_name'];
|
|
26
27
|
const MTEXT_KEYS = ['position_duty', 'work_request'];
|
|
27
28
|
const ASSOC_KEYS = ['demand'];
|
|
28
29
|
const PERSON_DEFAULT_KEYS = ['recr_principal', 'employ_manager'];
|
|
29
|
-
// 🔴
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
30
|
+
// 🔴 2026-11-07 实测修正:不再从参考职位继承以下三项(与 stage 入口同源问题)
|
|
31
|
+
// · job_category(职位序列):每个职位各不相同,继承会把上一职位的「销售」带进新职位(卡片页已坐实);
|
|
32
|
+
// · salary_min / salary_max:继承会把历史脏值「0.00」写成新职位的正式薪酬(卡片页已坐实)。
|
|
33
|
+
// 三个字段在自用 EB 包里 required 均未开启(ebdf_field 实测 required=None),留空可保存;
|
|
34
|
+
// 需要时用 jobCategory / salaryMin / salaryMax 显式传,不再拿脏值填坑。
|
|
35
|
+
// 仅保留「职位属性 / 学历要求 / 工作年限 / 招聘流程」四项偏公司统一口径的字段继承。
|
|
33
36
|
const REF_COPY_KEYS = [
|
|
34
37
|
'position_nature',
|
|
35
|
-
'job_category',
|
|
36
38
|
'education',
|
|
37
39
|
'work_years',
|
|
38
|
-
'work_location',
|
|
39
|
-
'salary_min',
|
|
40
|
-
'salary_max',
|
|
41
40
|
'recruit_flow',
|
|
42
41
|
];
|
|
42
|
+
// 默认办公地点用详细地址名称声明,不写死记录 id:运行时到「办公地点」列表按「启用」状态精确解析。
|
|
43
|
+
// work_location 已从 REF_COPY_KEYS 移除——继承会把 detail_location 为「1」的脏地点带进新职位
|
|
44
|
+
// (2026-11-06 真机实测)。
|
|
45
|
+
const DEFAULT_WORK_LOCATION = '浦江镇三鲁公路3419号泛微软件园';
|
|
43
46
|
const TEXT_DEFAULTS = { recruit_count: '1', number_of_pay_months: '12' };
|
|
44
47
|
const OPTION_DEFAULTS = { salary_type: '月薪', recruit_type: '社会招聘', status: '招聘中' };
|
|
45
48
|
/** 显式入参 → 职位字段 dataKey 与取值类别(逐字段声明,避免用通用 payload 包裹)。 */
|
|
@@ -139,14 +142,34 @@ async function findWorkPlaceMenu(env, cache) {
|
|
|
139
142
|
return null;
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
// 仅进程内 memo(不落盘):记录 id 与「启用」状态 optionId 一律运行时从列表解析。
|
|
146
|
+
const workPlaceMemo = new Map();
|
|
147
|
+
function stripHtml(s) {
|
|
148
|
+
return String(s ?? '').replace(/<[^>]*>/g, '').trim();
|
|
149
|
+
}
|
|
150
|
+
function parseSpans(raw) {
|
|
151
|
+
try {
|
|
152
|
+
const v = Array.isArray(raw) ? raw : JSON.parse(String(raw || '[]'));
|
|
153
|
+
return Array.isArray(v) ? v : [];
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** 「启用」判定只看服务端翻译文本,不写死 optionId(跨环境会变)。 */
|
|
160
|
+
function isEnabledText(s) {
|
|
161
|
+
const t = stripHtml(s);
|
|
162
|
+
return t.includes('启用') && !t.includes('禁用');
|
|
163
|
+
}
|
|
164
|
+
/** 拉取「办公地点」列表并按 place_status=启用 过滤;状态信息缺失时不过滤并依赖精确地址匹配。 */
|
|
165
|
+
async function loadWorkPlaces(env, cache) {
|
|
147
166
|
const menu = await findWorkPlaceMenu(env, cache);
|
|
148
167
|
if (!menu?.listId)
|
|
149
|
-
return
|
|
168
|
+
return [];
|
|
169
|
+
const key = String(cache.appId || '') + '|' + menu.listId;
|
|
170
|
+
const cached = workPlaceMemo.get(key);
|
|
171
|
+
if (cached)
|
|
172
|
+
return cached;
|
|
150
173
|
let pObj = '';
|
|
151
174
|
try {
|
|
152
175
|
const t = (await env.host.request({
|
|
@@ -157,33 +180,84 @@ async function resolveWorkLocation(env, cache, value) {
|
|
|
157
180
|
if (Array.isArray(d) && d[0])
|
|
158
181
|
pObj = String(d[0].id || '');
|
|
159
182
|
}
|
|
160
|
-
catch {
|
|
161
|
-
/* tag 未注册:用菜单节点兜底 */
|
|
162
|
-
}
|
|
183
|
+
catch { /* tag 未注册:用菜单节点兜底 */ }
|
|
163
184
|
if (!pObj)
|
|
164
185
|
pObj = String(menu.objId || '');
|
|
165
186
|
if (!pObj)
|
|
187
|
+
return [];
|
|
188
|
+
const pageSize = 200;
|
|
189
|
+
const rawRows = [];
|
|
190
|
+
const dispRows = [];
|
|
191
|
+
for (let page = 1; page <= 5; page++) {
|
|
192
|
+
const body = buildListBody({
|
|
193
|
+
listId: menu.listId,
|
|
194
|
+
cusMenuId: menu.cusMenuId,
|
|
195
|
+
menuName: menu.menuName || '办公地点',
|
|
196
|
+
title: menu.menuName || '办公地点',
|
|
197
|
+
current: page,
|
|
198
|
+
pageSize,
|
|
199
|
+
});
|
|
200
|
+
const r = (await env.host.request({
|
|
201
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
202
|
+
body,
|
|
203
|
+
headers: { ebBusinessId: menu.listId },
|
|
204
|
+
}));
|
|
205
|
+
const batch = (r?.data?.data || r?.data?.displayData || []);
|
|
206
|
+
rawRows.push(...batch);
|
|
207
|
+
dispRows.push(...(r?.data?.displayData || []));
|
|
208
|
+
if (batch.length < pageSize)
|
|
209
|
+
break; // 服务端 total/hasMore 不可信,唯一可靠判据是分页本身
|
|
210
|
+
}
|
|
211
|
+
const enabledStatusIds = new Set();
|
|
212
|
+
const enabledRowIds = new Set();
|
|
213
|
+
for (const d of dispRows) {
|
|
214
|
+
const rid = String(d?.form_data_id || d?.id || '');
|
|
215
|
+
if (isEnabledText(d?.place_status) && rid)
|
|
216
|
+
enabledRowIds.add(rid);
|
|
217
|
+
for (const s of parseSpans(d?.place_statusSpan)) {
|
|
218
|
+
if (isEnabledText(s?.name) && s?.id)
|
|
219
|
+
enabledStatusIds.add(String(s.id));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const statusFiltered = enabledRowIds.size > 0 || enabledStatusIds.size > 0;
|
|
223
|
+
const rows = rawRows
|
|
224
|
+
.filter((x) => !statusFiltered
|
|
225
|
+
|| enabledRowIds.has(String(x?.form_data_id || x?.id || ''))
|
|
226
|
+
|| enabledStatusIds.has(String(x?.place_status || '')))
|
|
227
|
+
.map((x) => ({
|
|
228
|
+
id: String(x?.form_data_id || x?.id || ''),
|
|
229
|
+
name: String(x?.name || ''),
|
|
230
|
+
detail: String(x?.detail_location || ''),
|
|
231
|
+
area: String(x?.area_text || ''),
|
|
232
|
+
}))
|
|
233
|
+
.filter((x) => !!x.id);
|
|
234
|
+
workPlaceMemo.set(key, rows);
|
|
235
|
+
return rows;
|
|
236
|
+
}
|
|
237
|
+
/** 精确匹配优先;包含匹配要求地址文本足够长且非纯数字,避免把内容写成「1」的脏地点选中。 */
|
|
238
|
+
function matchWorkPlace(rows, value) {
|
|
239
|
+
const v = String(value).trim();
|
|
240
|
+
if (!v || !rows.length)
|
|
241
|
+
return null;
|
|
242
|
+
const exact = rows.find((r) => r.detail === v) || rows.find((r) => r.name === v);
|
|
243
|
+
if (exact)
|
|
244
|
+
return exact;
|
|
245
|
+
const valid = (s) => s.length >= 4 && !/^\d+$/.test(s);
|
|
246
|
+
return rows.find((r) => (r.detail.includes(v) && valid(r.detail))
|
|
247
|
+
|| (r.name.includes(v) && valid(r.name))
|
|
248
|
+
|| (r.area.includes(v) && valid(r.area))
|
|
249
|
+
|| (v.includes(r.detail) && valid(r.detail))) || null;
|
|
250
|
+
}
|
|
251
|
+
/** 工作地点:按名称/详细地址/区域文本解析「办公地点」记录 id(只匹配启用记录);解析不到返回 null,不臆造 id。 */
|
|
252
|
+
async function resolveWorkLocation(env, cache, value) {
|
|
253
|
+
if (!String(value).trim())
|
|
166
254
|
return null;
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
});
|
|
174
|
-
const r = (await env.host.request({
|
|
175
|
-
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
176
|
-
body,
|
|
177
|
-
headers: { ebBusinessId: menu.listId },
|
|
178
|
-
}));
|
|
179
|
-
const rows = (r?.data?.data || r?.data?.displayData || []);
|
|
180
|
-
const hit = rows.find((x) => {
|
|
181
|
-
const name = String(x?.name || '');
|
|
182
|
-
const detail = String(x?.detail_location || '');
|
|
183
|
-
const area = String(x?.area_text || '');
|
|
184
|
-
return name.includes(v) || detail.includes(v) || area.includes(v) || (!!detail && v.includes(detail));
|
|
185
|
-
});
|
|
186
|
-
return hit ? { id: String(hit.form_data_id || hit.id), name: String(hit.detail_location || hit.name || v) } : null;
|
|
255
|
+
const hit = matchWorkPlace(await loadWorkPlaces(env, cache), value);
|
|
256
|
+
return hit ? { id: hit.id, name: hit.detail || hit.name || String(value) } : null;
|
|
257
|
+
}
|
|
258
|
+
/** 默认办公地点:按详细地址在启用列表中精确解析 id,解析不到返回 null(不写、不继承)。 */
|
|
259
|
+
async function resolveDefaultWorkLocation(env, cache) {
|
|
260
|
+
return resolveWorkLocation(env, cache, DEFAULT_WORK_LOCATION);
|
|
187
261
|
}
|
|
188
262
|
/** 从提交 detail 取可读值(用于 summary 里点名「继承来的值」) */
|
|
189
263
|
function detailDisplayValue(detail) {
|
|
@@ -261,7 +335,16 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
261
335
|
continue;
|
|
262
336
|
}
|
|
263
337
|
if (field.kind === 'text' || field.kind === 'number') {
|
|
264
|
-
|
|
338
|
+
// 薪资单位是千元(页面 15.00 = 15K);显式入参按「元」传,换算后再写;继承值不在此路径。
|
|
339
|
+
let out = String(value);
|
|
340
|
+
if (field.key === 'salary_min' || field.key === 'salary_max') {
|
|
341
|
+
const n = Number(String(value).replace(/,/g, ''));
|
|
342
|
+
if (Number.isFinite(n) && n > 0) {
|
|
343
|
+
const k = n / 1000;
|
|
344
|
+
out = String(Number.isInteger(k) ? k : Number(k.toFixed(3)));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
put({ formField: { id: fieldId }, content: out });
|
|
265
348
|
applied.push(`${field.key}=${value}`);
|
|
266
349
|
}
|
|
267
350
|
else if (field.kind === 'option') {
|
|
@@ -348,6 +431,20 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
348
431
|
missingRef.push(key);
|
|
349
432
|
}
|
|
350
433
|
}
|
|
434
|
+
// ⑥ 工作地点默认值:不再从在册职位继承(实测会带出 detail_location 为「1」的脏地点),
|
|
435
|
+
// 改为在「办公地点」列表按启用状态 + 详细地址精确解析;解析不到则不写并点名。
|
|
436
|
+
let workLocationDefault = null;
|
|
437
|
+
let workLocationWarning = null;
|
|
438
|
+
if (!has('work_location') && fid('work_location')) {
|
|
439
|
+
const loc = await resolveDefaultWorkLocation(env, cache).catch(() => null);
|
|
440
|
+
if (loc) {
|
|
441
|
+
put({ formField: { id: fid('work_location') }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
|
|
442
|
+
workLocationDefault = loc.name;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
workLocationWarning = `未在「办公地点」列表找到启用状态的默认地点「${DEFAULT_WORK_LOCATION}」,本次不写 work_location;请用 workLocation 显式指定`;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
351
448
|
const inverse = {};
|
|
352
449
|
for (const [dataKey, fieldId] of Object.entries(fields))
|
|
353
450
|
inverse[String(fieldId)] = dataKey;
|
|
@@ -376,12 +473,14 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
376
473
|
explicitApplied: applied,
|
|
377
474
|
explicitSkipped: skipped,
|
|
378
475
|
inheritedFromExistingPosition: inherited,
|
|
379
|
-
// 带值的继承清单:Agent
|
|
380
|
-
//
|
|
476
|
+
// 带值的继承清单:Agent 必须在确认摘要里逐项点名,不得因为它是默认值就略过
|
|
477
|
+
// (工作地点不参与继承,已改为启用办公地点列表精确解析)。
|
|
381
478
|
inheritedFromRef: inherited.length
|
|
382
479
|
? inherited.map((k) => ({ field: k, value: detailDisplayValue(refMap.get(String(fid(k)))) }))
|
|
383
480
|
: undefined,
|
|
384
481
|
inheritedSalaryWarnings: inheritedSalaryWarnings.length ? inheritedSalaryWarnings : undefined,
|
|
482
|
+
workLocationDefault: workLocationDefault || undefined,
|
|
483
|
+
workLocationWarning: workLocationWarning || undefined,
|
|
385
484
|
noReferenceValue: missingRef,
|
|
386
485
|
principalDefault: session.userId ? '当前登录用户' : '未解析到当前用户',
|
|
387
486
|
},
|
|
@@ -446,8 +545,11 @@ const positionCreateApply = {
|
|
|
446
545
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
447
546
|
throw ehrValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
|
|
448
547
|
}
|
|
449
|
-
const positionName = String(args.positionName ?? '').trim();
|
|
450
548
|
const payload = lease.payload || {};
|
|
549
|
+
// 🔴 2026-11-07 修复:positionName 本来就在 payload 里,但 apply 只从 args 取——
|
|
550
|
+
// 只带 confirm + continuation 时拿到空串,随后与 payload 比对必然报 target_changed(文档写法跑不通)。
|
|
551
|
+
// 改为 args 优先、缺失时回退 payload;后面的比对保留,用于发现「显式传了不同名字」的偷改。
|
|
552
|
+
const positionName = String(args.positionName ?? payload.positionName ?? '').trim();
|
|
451
553
|
if (payload.positionName !== positionName) {
|
|
452
554
|
throw ehrValidationError('target_changed', '职位名称与 prepare 时不一致,请重新执行 prepare');
|
|
453
555
|
}
|
|
@@ -475,8 +577,9 @@ const positionCreateApply = {
|
|
|
475
577
|
const list = cache.lists.position;
|
|
476
578
|
const baseUrl = session.baseUrl.replace(/\/+$/, '');
|
|
477
579
|
const cardUrl = `${baseUrl}/sp/ebdfpage/card/0/${payload.objId}/${formDataId}`;
|
|
580
|
+
// 列表只打开列表(2026-11-06 用户定稿);详情单页由 cardUrl 单独给出,不再用「列表+滑出详情」组合地址。
|
|
478
581
|
const listLocateUrl = list?.listId
|
|
479
|
-
? `${baseUrl}/sp/ebdfpage/list/${list.listId}
|
|
582
|
+
? `${baseUrl}/sp/ebdfpage/list/${list.listId}`
|
|
480
583
|
: null;
|
|
481
584
|
if (!created) {
|
|
482
585
|
throw ehrValidationError('position_create_failed', `职位表单已保存(formDataId=${formDataId}),但 addPosition 未返回职位 id:${response?.msg || '未知原因'};请到职位管理核对后再决定是否重试`);
|
|
@@ -50,6 +50,7 @@ async function countModule(env, cache, key, pageSize, maxPages) {
|
|
|
50
50
|
let scanned = 0;
|
|
51
51
|
let total = null;
|
|
52
52
|
let totalExact = false;
|
|
53
|
+
let countSource = 'unknown';
|
|
53
54
|
let note = cfg.note;
|
|
54
55
|
for (let current = 1; current <= maxPages; current++) {
|
|
55
56
|
const page = await fetchListRows(env.host, objId, list.listId, { ...baseBody, current, pageSize });
|
|
@@ -57,6 +58,7 @@ async function countModule(env, cache, key, pageSize, maxPages) {
|
|
|
57
58
|
if (current === 1 && page.total !== null && page.totalExact) {
|
|
58
59
|
total = page.total;
|
|
59
60
|
totalExact = true;
|
|
61
|
+
countSource = 'count-api';
|
|
60
62
|
break;
|
|
61
63
|
}
|
|
62
64
|
scanned += page.rows.length;
|
|
@@ -64,15 +66,26 @@ async function countModule(env, cache, key, pageSize, maxPages) {
|
|
|
64
66
|
if (page.rows.length < pageSize) {
|
|
65
67
|
total = scanned;
|
|
66
68
|
totalExact = true;
|
|
69
|
+
countSource = 'full-scan';
|
|
67
70
|
break;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
// ③ 达上限仍未取完 → 总数不可知(不编造 0 或估计值)
|
|
71
74
|
if (total === null) {
|
|
72
75
|
totalExact = false;
|
|
76
|
+
countSource = 'unknown';
|
|
73
77
|
note = `计数接口不可用且达扫描上限(${maxPages} 页 × ${pageSize} 行)仍未取完,总数不可知;可调大 pageSize/maxPages 重试`;
|
|
74
78
|
}
|
|
75
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
key,
|
|
81
|
+
module: cfg.title,
|
|
82
|
+
available: true,
|
|
83
|
+
total,
|
|
84
|
+
totalExact,
|
|
85
|
+
scannedRows: scanned,
|
|
86
|
+
countSource,
|
|
87
|
+
...(note ? { note } : {}),
|
|
88
|
+
};
|
|
76
89
|
}
|
|
77
90
|
const recruitStats = {
|
|
78
91
|
name: 'ehr.recruit.stats',
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { READ, ehrSuccess, schemaOf, } from './types.js';
|
|
2
|
+
import { ehrValidationError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* 招聘标签检索(只读)。
|
|
5
|
+
*
|
|
6
|
+
* 背景(2026-11-07 实测,浏览器通道抓真实响应得出):
|
|
7
|
+
* - `POST /api/my/tag/query` 返回的是**全系统标签池**,不是招聘专属池。本环境 1911 条(type=0)+ 13 条(type=1)。
|
|
8
|
+
* - 请求体里的 `tagGroup` 参数**服务端不生效**(传 0/1/2/3/4 与传某个真实 groupId,total 都不变或直接返回空)。
|
|
9
|
+
* 真正生效的是 **`groupId`**(传 1209888460506972163 → 精确返回「可优化」1 条)。
|
|
10
|
+
* - 返回行自带 `groupId` 字段。本环境分布:groupId=1 有 1729 条、groupId=0 有 176 条,
|
|
11
|
+
* 另有 5 条 / 1 条挂在小众组 —— 即**标签池基本没做分组治理**,招聘标签散落在组 1 里。
|
|
12
|
+
* - `name` 参数服务端有效且为包含匹配("本科" → 1 条;"技术" → 8 条),
|
|
13
|
+
* 因此「按关键词精确定位正确标签」是当前环境下最可靠的可用手段。
|
|
14
|
+
*
|
|
15
|
+
* 本 op 的目标不是改标签池,而是让调用方**不必翻 1911 条**:
|
|
16
|
+
* ① 按 `keyword` 直查;② 按 `groupId` 收窄;③ 给出组分布,暴露"未分组"的实情。
|
|
17
|
+
*/
|
|
18
|
+
const TAG_QUERY_PATH = '/api/my/tag/query';
|
|
19
|
+
const MAX_PAGE_SIZE = 100;
|
|
20
|
+
const DEFAULT_LIMIT = 100;
|
|
21
|
+
const MAX_LIMIT = 2000;
|
|
22
|
+
function normalizeTag(row) {
|
|
23
|
+
const tagId = String(row?.tagId ?? row?.id ?? '').trim();
|
|
24
|
+
const name = String(row?.name ?? row?.tagName ?? '').trim();
|
|
25
|
+
if (!tagId || !name)
|
|
26
|
+
return null;
|
|
27
|
+
return {
|
|
28
|
+
tagId,
|
|
29
|
+
name,
|
|
30
|
+
groupId: String(row?.groupId ?? '0'),
|
|
31
|
+
type: Number(row?.type ?? 0),
|
|
32
|
+
available: row?.available !== false,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function queryPage(env, params) {
|
|
36
|
+
const body = {
|
|
37
|
+
type: params.type,
|
|
38
|
+
name: params.keyword,
|
|
39
|
+
order: 8,
|
|
40
|
+
pageSize: params.pageSize,
|
|
41
|
+
pageNo: params.pageNo,
|
|
42
|
+
search: 1,
|
|
43
|
+
tagGroup: 0,
|
|
44
|
+
tagModules: ['ebuilderform'],
|
|
45
|
+
};
|
|
46
|
+
// 🔴 groupId 才是服务端真认的过滤参数(tagGroup 不是),见文件头实测记录
|
|
47
|
+
if (params.groupId !== undefined)
|
|
48
|
+
body.groupId = params.groupId;
|
|
49
|
+
const res = (await env.host.request({
|
|
50
|
+
path: TAG_QUERY_PATH,
|
|
51
|
+
method: 'POST',
|
|
52
|
+
body,
|
|
53
|
+
operation: 'ehr.recruit.tag.list',
|
|
54
|
+
}));
|
|
55
|
+
const d = res?.data ?? {};
|
|
56
|
+
return {
|
|
57
|
+
total: typeof d.total === 'number' ? d.total : null,
|
|
58
|
+
rows: Array.isArray(d.data) ? d.data : [],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function listTags(args, env) {
|
|
62
|
+
const keyword = args.keyword === undefined ? '' : String(args.keyword).trim();
|
|
63
|
+
const groupId = args.groupId === undefined || args.groupId === null ? undefined : String(args.groupId);
|
|
64
|
+
const limitRaw = Number(args.limit ?? DEFAULT_LIMIT);
|
|
65
|
+
const limit = Number.isFinite(limitRaw) ? Math.min(MAX_LIMIT, Math.max(1, Math.trunc(limitRaw))) : DEFAULT_LIMIT;
|
|
66
|
+
const includeUnavailable = args.includeUnavailable === true;
|
|
67
|
+
const withGroupStats = args.withGroupStats !== false;
|
|
68
|
+
const typeArg = args.type;
|
|
69
|
+
if (typeArg !== undefined && typeArg !== 'all' && typeArg !== 0 && typeArg !== 1) {
|
|
70
|
+
throw ehrValidationError('invalid_type', 'type 只能是 0(公共标签)、1(私有标签)或 "all"');
|
|
71
|
+
}
|
|
72
|
+
const types = typeArg === 'all' ? [0, 1] : [Number(typeArg ?? 0)];
|
|
73
|
+
const collected = [];
|
|
74
|
+
const seen = new Set();
|
|
75
|
+
let reportedTotal = 0;
|
|
76
|
+
for (const type of types) {
|
|
77
|
+
let pageNo = 1;
|
|
78
|
+
let total = null;
|
|
79
|
+
while (true) {
|
|
80
|
+
const page = await queryPage(env, { type, keyword, groupId, pageNo, pageSize: MAX_PAGE_SIZE });
|
|
81
|
+
if (page.total !== null)
|
|
82
|
+
total = page.total;
|
|
83
|
+
for (const raw of page.rows) {
|
|
84
|
+
const item = normalizeTag(raw);
|
|
85
|
+
if (!item)
|
|
86
|
+
continue;
|
|
87
|
+
// 服务端参数可能失效(尤其 groupId),此处再兜一层,保证 filter 语义可信
|
|
88
|
+
if (groupId !== undefined && item.groupId !== groupId)
|
|
89
|
+
continue;
|
|
90
|
+
if (!includeUnavailable && !item.available)
|
|
91
|
+
continue;
|
|
92
|
+
const key = `${item.type}:${item.tagId}`;
|
|
93
|
+
if (seen.has(key))
|
|
94
|
+
continue;
|
|
95
|
+
seen.add(key);
|
|
96
|
+
collected.push(item);
|
|
97
|
+
}
|
|
98
|
+
if (!page.rows.length)
|
|
99
|
+
break;
|
|
100
|
+
if (collected.length >= limit)
|
|
101
|
+
break;
|
|
102
|
+
if (total !== null && pageNo * MAX_PAGE_SIZE >= total)
|
|
103
|
+
break;
|
|
104
|
+
pageNo += 1;
|
|
105
|
+
if (pageNo > 30)
|
|
106
|
+
break; // 防御:服务端不回 total 时避免无限翻页
|
|
107
|
+
}
|
|
108
|
+
reportedTotal += total ?? 0;
|
|
109
|
+
}
|
|
110
|
+
const items = collected.slice(0, limit);
|
|
111
|
+
const groupStats = withGroupStats
|
|
112
|
+
? [...new Map(items.reduce((m, x) => {
|
|
113
|
+
m.set(x.groupId, (m.get(x.groupId) ?? 0) + 1);
|
|
114
|
+
return m;
|
|
115
|
+
}, new Map()).entries())]
|
|
116
|
+
.map(([groupId, count]) => ({ groupId, count }))
|
|
117
|
+
.sort((a, b) => b.count - a.count)
|
|
118
|
+
: undefined;
|
|
119
|
+
// 诚实提示:当前环境下标签池基本未按业务分组,是否"混入非 HR 标签"取决于池子本身
|
|
120
|
+
const notes = [];
|
|
121
|
+
if (groupId === undefined && keyword === '' && groupStats && groupStats.length) {
|
|
122
|
+
const top = groupStats[0];
|
|
123
|
+
const topShare = items.length ? top.count / items.length : 0;
|
|
124
|
+
if (topShare >= 0.7) {
|
|
125
|
+
// 截断时组分布只覆盖本次返回的样本,必须点明范围,否则会被读成全量结论
|
|
126
|
+
const truncated = reportedTotal > 0 && items.length < reportedTotal;
|
|
127
|
+
const scope = truncated ? `本次返回的 ${items.length} 条样本(非全量)` : '全部结果';
|
|
128
|
+
notes.push(`标签池未按业务分组:groupId=${top.groupId} 占${scope}的 ${top.count}/${items.length}。` +
|
|
129
|
+
`招聘标签与客户/项目等其他业务标签混在同一池子里,要真正隔离需在 EB 侧新建招聘标签组,再按 groupId 过滤。` +
|
|
130
|
+
(truncated ? ' 想看全量组分布请调大 limit。' : ''));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (keyword)
|
|
134
|
+
notes.push(`已按名称包含匹配「${keyword}」;服务端 name 参数实测有效。`);
|
|
135
|
+
if (groupId !== undefined)
|
|
136
|
+
notes.push(`已按 groupId=${groupId} 过滤(服务端参数实测有效,客户端再兜一层校验)。`);
|
|
137
|
+
if (reportedTotal && items.length < reportedTotal) {
|
|
138
|
+
notes.push(`命中 ${reportedTotal} 条,本次返回 ${items.length} 条(受 limit=${limit} 限制,可调大 limit 或用 keyword/groupId 收窄)。`);
|
|
139
|
+
}
|
|
140
|
+
return ehrSuccess('ehr.recruit.tag.list', {
|
|
141
|
+
keyword: keyword || null,
|
|
142
|
+
groupId: groupId ?? null,
|
|
143
|
+
types,
|
|
144
|
+
total: reportedTotal || null,
|
|
145
|
+
returned: items.length,
|
|
146
|
+
items,
|
|
147
|
+
groupStats,
|
|
148
|
+
note: notes.length ? notes.join(' ') : undefined,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
export const recruitTagOperations = [
|
|
152
|
+
{
|
|
153
|
+
name: 'ehr.recruit.tag.list',
|
|
154
|
+
resource: 'recruit.tag',
|
|
155
|
+
method: 'list',
|
|
156
|
+
action: 'tag.list',
|
|
157
|
+
summary: '列招聘可用的平台标签(只读):支持按名称关键词、groupId 精确过滤,并给出组分布以便判断标签池是否已分组治理',
|
|
158
|
+
capability: 'recruit.tag.list',
|
|
159
|
+
risk: READ,
|
|
160
|
+
inputSchema: schemaOf({
|
|
161
|
+
keyword: { type: 'string', description: '标签名称关键词(服务端为包含匹配,实测有效)。如「本科」「技术」' },
|
|
162
|
+
groupId: { type: 'string', description: '标签组 id(服务端唯一生效的过滤参数;tagGroup 无效)。如 "1"' },
|
|
163
|
+
type: {
|
|
164
|
+
oneOf: [{ type: 'integer', enum: [0, 1] }, { type: 'string', enum: ['all'] }],
|
|
165
|
+
description: '0=公共标签(默认)、1=私有标签、"all"=两者都要',
|
|
166
|
+
},
|
|
167
|
+
limit: { type: 'integer', minimum: 1, maximum: MAX_LIMIT, description: `最多返回条数,默认 ${DEFAULT_LIMIT}` },
|
|
168
|
+
includeUnavailable: { type: 'boolean', description: '是否包含已停用标签,默认 false' },
|
|
169
|
+
withGroupStats: { type: 'boolean', description: '是否返回组分布,默认 true' },
|
|
170
|
+
}, { description: '只读查询,不创建、不修改任何标签' }),
|
|
171
|
+
handler: listTags,
|
|
172
|
+
},
|
|
173
|
+
];
|