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
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
+
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
3
|
+
import { objIdOf, formIdOf, saveFormData, runEsb, getDsOptions, getFormButtonsForData, findSubmitButton, analyzeButtonActions, getFormDataRecord, toSubmitDetails, randHex32, dsOptionsSnapshot, restoreDsOptions, } from '../shared.js';
|
|
4
|
+
// InterviewStatusEnum.INVALID(已失效):系统反馈按钮(填写/编辑/代评价)均要求非此状态
|
|
5
|
+
const INVALID_STATUS_ID = '841052191228968977';
|
|
6
|
+
const R = (v) => String(v ?? '').replace(/^<p>|<\/p>$/g, '').trim();
|
|
7
|
+
async function locateTalentId(host, cache, args) {
|
|
8
|
+
if (args.talentId)
|
|
9
|
+
return String(args.talentId);
|
|
10
|
+
if (!args.mobile)
|
|
11
|
+
throw rsValidationError('locate_required', '请提供 talentId 或 mobile');
|
|
12
|
+
const listId = cache.forms?.talent_pool?.listId;
|
|
13
|
+
if (!listId)
|
|
14
|
+
throw rsFail('环境缓存缺少人才列表 listId');
|
|
15
|
+
const poolObjId = cache.forms.talent_pool.objId;
|
|
16
|
+
const r = await host.request({
|
|
17
|
+
path: '/api/ebuilder/form/list/getListDatas?passid=' + poolObjId + '&cid=' + poolObjId,
|
|
18
|
+
body: {
|
|
19
|
+
listId, cid: poolObjId, passid: poolObjId,
|
|
20
|
+
searchParamData: JSON.stringify({ searchParamList: [{ key: 'field_mobile', value: args.mobile, operator: '=' }] }),
|
|
21
|
+
current: 1, pageSize: 10, tableuid: randHex32(),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const rows = r?.data?.rows || r?.data || [];
|
|
25
|
+
if (!rows.length)
|
|
26
|
+
throw rsFail('未找到手机号为 ' + args.mobile + ' 的候选人');
|
|
27
|
+
if (rows.length > 1)
|
|
28
|
+
throw rsFail('该手机号命中多条候选人,请提供 talentId 精确定位');
|
|
29
|
+
return String(rows[0].talentId || rows[0].form_data_id);
|
|
30
|
+
}
|
|
31
|
+
async function getBatchId(host, talentId) {
|
|
32
|
+
const rk = 'randomkey_' + randHex32().slice(0, 6);
|
|
33
|
+
const r = await host.request({ path: '/api/recruit/candidate/getCandidateCardPrepareQuery?talentId=' + talentId + '&' + rk + '=' + rk.split('_')[1], method: 'GET' });
|
|
34
|
+
return r?.data?.batchId;
|
|
35
|
+
}
|
|
36
|
+
async function listInterviewFeedback(host, talentId, batchId) {
|
|
37
|
+
const r = await host.request({
|
|
38
|
+
path: '/api/recruit/candidate/getCandidateCardInterviewInfo', method: 'POST',
|
|
39
|
+
body: { talentId, batchId, current: 1, pageSize: 20 },
|
|
40
|
+
});
|
|
41
|
+
const list = r?.data?.list || [];
|
|
42
|
+
const out = [];
|
|
43
|
+
for (let i = 0; i < list.length; i++) {
|
|
44
|
+
const it = list[i];
|
|
45
|
+
const fbs = it?.interviewFeedBack || [];
|
|
46
|
+
if (fbs.length) {
|
|
47
|
+
const fb = fbs[0];
|
|
48
|
+
out.push({
|
|
49
|
+
index: i,
|
|
50
|
+
planId: (fb.interviewPlanId || [])[0]?.id,
|
|
51
|
+
planName: (fb.interviewPlanId || [])[0]?.name || (it.subject || ''),
|
|
52
|
+
interviewer: (fb.interviewer || []).map((x) => x.name).join('、') || (it.interviewer || ''),
|
|
53
|
+
feedbackId: fb.id || fb.formDataId,
|
|
54
|
+
result: (fb.result || []).map((x) => x.name).join('、') || '',
|
|
55
|
+
judgement: R(fb.judgement),
|
|
56
|
+
unionStatusId: (it.unionStatus || [])[0]?.id || '',
|
|
57
|
+
unionStatusName: (it.unionStatus || [])[0]?.name || '',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
async function buildTarget(env, args) {
|
|
64
|
+
const host = env.host;
|
|
65
|
+
const session = await host.getSession();
|
|
66
|
+
const cache = await env.recruitContext();
|
|
67
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, '');
|
|
68
|
+
const talentId = await locateTalentId(host, cache, args);
|
|
69
|
+
const batchId = await getBatchId(host, talentId);
|
|
70
|
+
const list = await listInterviewFeedback(host, talentId, batchId);
|
|
71
|
+
if (!list.length)
|
|
72
|
+
throw rsFail('该候选人没有可编辑的面试反馈记录');
|
|
73
|
+
let target;
|
|
74
|
+
if (args.feedbackId) {
|
|
75
|
+
target = list.find((x) => String(x.feedbackId) === String(args.feedbackId));
|
|
76
|
+
if (!target)
|
|
77
|
+
throw rsFail('未找到反馈记录 id=' + args.feedbackId + ',可选:' + list.map((x) => x.feedbackId).join(','));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const idx = args.planIndex !== undefined ? Number(args.planIndex) : 0;
|
|
81
|
+
if (args.planIndex !== undefined && !list[idx])
|
|
82
|
+
throw rsFail('planIndex 超出范围,共 ' + list.length + ' 场含反馈');
|
|
83
|
+
target = list[idx];
|
|
84
|
+
}
|
|
85
|
+
if (target.unionStatusId === INVALID_STATUS_ID) {
|
|
86
|
+
throw rsFail('该面试状态为「已失效」,不允许填写/编辑面试反馈(与系统按钮条件一致:已失效不显示反馈按钮)。面试=' + target.planName + ',反馈记录Id=' + target.feedbackId);
|
|
87
|
+
}
|
|
88
|
+
const objId = objIdOf(cache, 'interview_detail');
|
|
89
|
+
const formId = formIdOf(cache, 'interview_detail');
|
|
90
|
+
const fields = cache.fields?.[objId] || {};
|
|
91
|
+
const resultFid = fields.result;
|
|
92
|
+
const judgementFid = fields.judgement;
|
|
93
|
+
if (!resultFid || !judgementFid)
|
|
94
|
+
throw rsFail('环境缓存缺少面试反馈的 result/judgement 字段映射');
|
|
95
|
+
return { host, baseUrl, appId: cache.appId, cache, talentId, batchId, list, target, objId, formId, fields, resultFid, judgementFid };
|
|
96
|
+
}
|
|
97
|
+
async function prepare(args, env) {
|
|
98
|
+
if (!args.result && args.comment === undefined) {
|
|
99
|
+
throw rsValidationError('result_or_comment_required', '请提供 result(通过/不通过/待定)和/或 comment(评价)');
|
|
100
|
+
}
|
|
101
|
+
const t = await buildTarget(env, args);
|
|
102
|
+
// 反馈记录当前数据(updateTimeStamp + 全字段集)
|
|
103
|
+
const rec = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
|
|
104
|
+
if (!rec.id)
|
|
105
|
+
throw rsFail('无法获取反馈记录数据(formData 为空),可能无权限或记录不存在');
|
|
106
|
+
// 粗定位提交按钮 + 精核验
|
|
107
|
+
const btns = await getFormButtonsForData(t.host, t.objId, t.formId, String(t.target.feedbackId));
|
|
108
|
+
const submitBtn = findSubmitButton(btns);
|
|
109
|
+
const analysis = submitBtn ? analyzeButtonActions(submitBtn) : null;
|
|
110
|
+
// result optionId
|
|
111
|
+
let newOptionId = null;
|
|
112
|
+
if (args.result) {
|
|
113
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
114
|
+
newOptionId = opts[String(args.result)];
|
|
115
|
+
if (!newOptionId)
|
|
116
|
+
throw rsFail('未识别的面试结果「' + args.result + '」,可选:' + Object.keys(opts).join('/'));
|
|
117
|
+
}
|
|
118
|
+
const newComment = args.comment !== undefined ? String(args.comment) : t.target.judgement;
|
|
119
|
+
const newResultName = args.result ? String(args.result) : t.target.result;
|
|
120
|
+
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
121
|
+
const { createHash } = await import('node:crypto');
|
|
122
|
+
const fp = createHash('sha256').update(JSON.stringify(willSubmit)).digest('hex');
|
|
123
|
+
const continuation = await env.continuation.issue({ operation: 'ehr.recruit.stage.interview.feedback.edit.apply', fingerprint: fp,
|
|
124
|
+
enumMaps: await dsOptionsSnapshot(),
|
|
125
|
+
// 🔴 2026-11-07 修复(同 arrange/jd.create 的同类缺陷):apply 原来只从 args 取 talentId/result/comment,
|
|
126
|
+
// 导致「只带 confirm + continuation」时定位不到目标或指纹不符。现将这些参数签进 continuation。
|
|
127
|
+
argsSnapshot: {
|
|
128
|
+
talentId: t.talentId,
|
|
129
|
+
feedbackId: args.feedbackId ? String(args.feedbackId) : String(t.target.feedbackId),
|
|
130
|
+
result: args.result ? String(args.result) : undefined,
|
|
131
|
+
comment: args.comment !== undefined ? String(args.comment) : undefined,
|
|
132
|
+
} });
|
|
133
|
+
return rsSuccess('ehr.recruit.stage.interview.feedback.edit.prepare', {
|
|
134
|
+
mode: 'prepare',
|
|
135
|
+
talentId: t.talentId,
|
|
136
|
+
batchId: t.batchId,
|
|
137
|
+
面试: t.target.planName,
|
|
138
|
+
面试官: t.target.interviewer,
|
|
139
|
+
反馈记录Id: t.target.feedbackId,
|
|
140
|
+
当前反馈: (t.target.result ? '结果 ' + t.target.result : '') + (t.target.judgement ? ';评价 ' + t.target.judgement : ''),
|
|
141
|
+
新反馈: (args.result ? '结果 ' + newResultName : '') + (args.comment !== undefined ? ';评价 ' + newComment : ''),
|
|
142
|
+
将执行动作: analysis
|
|
143
|
+
? {
|
|
144
|
+
保存反馈表单: 'saveFormData(全字段集 + updateTimeStamp 乐观锁)',
|
|
145
|
+
动作流: analysis.esbIds.length ? analysis.esbIds : '(该按钮无 esb 动作流)',
|
|
146
|
+
招聘API: analysis.jsCalls.map((c) => c.url + (Object.keys(c.data).length ? ' data=' + Object.keys(c.data).join(',') : '')),
|
|
147
|
+
}
|
|
148
|
+
: '⚠️ 未定位到「提交评价」按钮(getFormButtons 未取到保存按钮),仅能执行保存+写过程日志',
|
|
149
|
+
willSubmit,
|
|
150
|
+
// 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。把上方的中文字段收进 preview,
|
|
151
|
+
// 让「确认」这一步有统一的机器可读摘要,而不是只能靠人读散装字段。
|
|
152
|
+
preview: {
|
|
153
|
+
action: '提交/修改面试反馈',
|
|
154
|
+
候选人: t.talentId,
|
|
155
|
+
面试: t.target.planName,
|
|
156
|
+
面试官: t.target.interviewer,
|
|
157
|
+
反馈记录Id: t.target.feedbackId,
|
|
158
|
+
当前反馈: (t.target.result ? '结果 ' + t.target.result : '') + (t.target.judgement ? ';评价 ' + t.target.judgement : ''),
|
|
159
|
+
新反馈: (args.result ? '结果 ' + newResultName : '') + (args.comment !== undefined ? ';评价 ' + newComment : ''),
|
|
160
|
+
将执行动作: analysis
|
|
161
|
+
? { 保存反馈表单: 'saveFormData(全字段集 + updateTimeStamp 乐观锁)', 动作流: analysis.esbIds.length ? analysis.esbIds : '(该按钮无 esb 动作流)', 招聘API: analysis.jsCalls.map((c) => c.url) }
|
|
162
|
+
: '⚠️ 未定位到「提交评价」按钮,仅能执行保存+写过程日志',
|
|
163
|
+
},
|
|
164
|
+
}, { continuation, fingerprint: fp, confirmHint: '用户明确确认后,携带 confirm:true 与 continuation 调用 apply' });
|
|
165
|
+
}
|
|
166
|
+
async function apply(args, env) {
|
|
167
|
+
if (args.confirm !== true)
|
|
168
|
+
throw rsConfirmationError('ehr.recruit.stage.interview.feedback.edit.apply', { hint: '写操作必须显式 confirm:true' });
|
|
169
|
+
if (!args.continuation)
|
|
170
|
+
throw rsValidationError('continuation_required', '缺少 continuation(来自 prepare 的 meta)');
|
|
171
|
+
const payload = await env.continuation.verify(String(args.continuation), 'ehr.recruit.stage.interview.feedback.edit.apply');
|
|
172
|
+
restoreDsOptions(payload.enumMaps);
|
|
173
|
+
// 合并 prepare 快照(显式传的优先),使 apply 只带 confirm + continuation 也能执行
|
|
174
|
+
const merged = { ...(payload.argsSnapshot || {}), ...args };
|
|
175
|
+
const t = await buildTarget(env, merged);
|
|
176
|
+
// 重新取最新 updateTimeStamp(乐观锁)
|
|
177
|
+
const rec2 = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
|
|
178
|
+
const details2 = toSubmitDetails(rec2.dataDetails);
|
|
179
|
+
let newOptionId = null;
|
|
180
|
+
if (merged.result) {
|
|
181
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
182
|
+
newOptionId = opts[String(merged.result)];
|
|
183
|
+
if (!newOptionId)
|
|
184
|
+
throw rsFail('未识别的面试结果「' + merged.result + '」,可选:' + Object.keys(opts).join('/'));
|
|
185
|
+
}
|
|
186
|
+
const newComment = merged.comment !== undefined ? String(merged.comment) : t.target.judgement;
|
|
187
|
+
const newResultName = merged.result ? String(merged.result) : t.target.result;
|
|
188
|
+
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
189
|
+
const { createHash } = await import('node:crypto');
|
|
190
|
+
if (payload.fingerprint !== createHash('sha256').update(JSON.stringify(willSubmit)).digest('hex')) {
|
|
191
|
+
throw rsValidationError('fingerprint_mismatch', '待提交内容与 prepare 确认摘要不一致,请重新 prepare 确认后再 apply');
|
|
192
|
+
}
|
|
193
|
+
// 覆盖 result/judgement 字段(原详情缺失则追加,避免整条提交时字段不写入)
|
|
194
|
+
const newDetails = details2.map((x) => {
|
|
195
|
+
const fid = x.formField.id;
|
|
196
|
+
if (fid === t.resultFid && newOptionId)
|
|
197
|
+
return { formField: { id: fid }, dataOptions: [{ optionId: newOptionId, content: newResultName }] };
|
|
198
|
+
if (fid === t.judgementFid)
|
|
199
|
+
return { formField: { id: fid }, dataText: { content: '<p>' + (newComment || '') + '</p>' } };
|
|
200
|
+
return x;
|
|
201
|
+
});
|
|
202
|
+
if (newOptionId && !newDetails.some((x) => x.formField.id === t.resultFid)) {
|
|
203
|
+
newDetails.push({ formField: { id: t.resultFid }, dataOptions: [{ optionId: newOptionId, content: newResultName }] });
|
|
204
|
+
}
|
|
205
|
+
if (args.comment !== undefined && !newDetails.some((x) => x.formField.id === t.judgementFid)) {
|
|
206
|
+
newDetails.push({ formField: { id: t.judgementFid }, dataText: { content: '<p>' + (newComment || '') + '</p>' } });
|
|
207
|
+
}
|
|
208
|
+
// saveFormData(layoutId 用 getFormDataAndLayout 的 formLayout.id,getFormLayout 405 不可靠)
|
|
209
|
+
const savedId = await saveFormData(t.host, {
|
|
210
|
+
appId: t.appId, formId: t.formId, objId: t.objId,
|
|
211
|
+
name: '面试反馈-' + t.target.planName, formDataId: String(t.target.feedbackId),
|
|
212
|
+
updateTimeStamp: rec2.updateTimeStamp, dataDetails: newDetails, rightType: '2',
|
|
213
|
+
layoutId: rec2.formLayoutId,
|
|
214
|
+
extraCustomParam: { secretLevel: '', secretLevelValidity: '' },
|
|
215
|
+
});
|
|
216
|
+
// runEsb 动作流(按钮配置解析)
|
|
217
|
+
const btns = await getFormButtonsForData(t.host, t.objId, t.formId, String(t.target.feedbackId));
|
|
218
|
+
const submitBtn = findSubmitButton(btns);
|
|
219
|
+
const analysis = submitBtn ? analyzeButtonActions(submitBtn) : null;
|
|
220
|
+
let esbRes = null;
|
|
221
|
+
if (analysis?.esbIds?.length) {
|
|
222
|
+
esbRes = await runEsb(t.host, { objId: t.objId, dataIds: String(t.target.feedbackId), esbActionIds: analysis.esbIds.join(',') });
|
|
223
|
+
}
|
|
224
|
+
// addProcessLog 写招聘过程日志(jsCode 里的招聘 API,按标准契约直接调)
|
|
225
|
+
let processRes = null;
|
|
226
|
+
if (analysis?.jsCalls?.length) {
|
|
227
|
+
const call = analysis.jsCalls.find((c) => c.url.includes('/api/recruit/')) || analysis.jsCalls[0];
|
|
228
|
+
processRes = await t.host.request({
|
|
229
|
+
path: call.url, method: (call.method || 'post').toUpperCase(),
|
|
230
|
+
body: {
|
|
231
|
+
talentId: String(t.talentId), batchId: String(t.batchId),
|
|
232
|
+
result: newOptionId || t.target.result, judgement: '<p>' + (newComment || '') + '</p>',
|
|
233
|
+
businessId: String(t.target.feedbackId), processEnum: '20',
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
// 回查校验
|
|
238
|
+
const back = await listInterviewFeedback(t.host, t.talentId, t.batchId);
|
|
239
|
+
const backFb = back.find((x) => String(x.feedbackId) === String(t.target.feedbackId));
|
|
240
|
+
const changed = backFb && String(backFb.result).includes(newResultName) && (args.comment === undefined || String(backFb.judgement).includes(newComment));
|
|
241
|
+
// 产物链接:人才卡片(点进去可看该候选人的面试与反馈)+ 面试管理列表
|
|
242
|
+
const cardPageId = String(t.cache.ebdDetailPageId || '');
|
|
243
|
+
const talentExtra = String(t.cache.selfUse) === '1' ? '&recruitType=useSelf' : '';
|
|
244
|
+
const talentCardUrl = cardPageId ? `${t.baseUrl}/sp/ebdpage/view/${cardPageId}?talentId=${t.talentId}${talentExtra}` : null;
|
|
245
|
+
const interviewListId = String((t.cache.lists?.interview?.listId) || '');
|
|
246
|
+
const interviewListUrl = interviewListId ? `${t.baseUrl}/sp/ebdfpage/list/${interviewListId}` : null;
|
|
247
|
+
return rsSuccess('ehr.recruit.stage.interview.feedback.edit.apply', {
|
|
248
|
+
mode: 'apply', result: 'success',
|
|
249
|
+
saveFormData: { 成功: !!savedId, 记录Id: savedId },
|
|
250
|
+
runEsb: esbRes ? { 动作流数: analysis?.esbIds.length ?? 0, 返回: esbRes?.successNum ?? esbRes?.status ?? 'ok' } : '无 esb 动作流',
|
|
251
|
+
addProcessLog: processRes ? { 返回: processRes?.data ?? processRes?.status ?? 'ok' } : '无 jsCode 招聘 API',
|
|
252
|
+
回查: backFb ? { 结果: backFb.result, 评价: backFb.judgement, 已生效: changed } : '回查未取到该反馈',
|
|
253
|
+
talentId: t.talentId, batchId: t.batchId, 面试: t.target.planName,
|
|
254
|
+
talentCardUrl,
|
|
255
|
+
interviewListUrl,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
export const interviewFeedbackOperations = [
|
|
259
|
+
{
|
|
260
|
+
name: 'ehr.recruit.stage.interview.feedback.edit.prepare',
|
|
261
|
+
resource: 'recruit.interview',
|
|
262
|
+
method: 'prepare',
|
|
263
|
+
action: 'interview.feedback.edit.prepare',
|
|
264
|
+
summary: '面试反馈确认摘要:定位反馈记录(feedbackId 或 planIndex)、按钮动作智能解析(保存+esb+招聘API)、当前/新反馈对照,不写入',
|
|
265
|
+
capability: 'recruit.interview.feedback',
|
|
266
|
+
risk: 'write',
|
|
267
|
+
requiresConfirmation: true,
|
|
268
|
+
inputSchema: schemaOf({
|
|
269
|
+
talentId: { type: 'string', description: '人才 id(与 mobile 二选一)' },
|
|
270
|
+
mobile: { type: 'string', pattern: '^\\d{6,20}$', description: '手机号定位(唯一命中)' },
|
|
271
|
+
feedbackId: { type: 'string', description: '反馈记录 id(最稳;缺省用 planIndex 选第几场)' },
|
|
272
|
+
planIndex: { type: 'integer', minimum: 0, description: '第几场含反馈的面试(默认 0)' },
|
|
273
|
+
result: { type: 'string', description: '面试结果(如 通过/不通过/待定,按环境枚举)' },
|
|
274
|
+
comment: { type: 'string', description: '评价正文' },
|
|
275
|
+
}, {}),
|
|
276
|
+
handler: prepare,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'ehr.recruit.stage.interview.feedback.edit.apply',
|
|
280
|
+
resource: 'recruit.interview',
|
|
281
|
+
method: 'apply',
|
|
282
|
+
action: 'interview.feedback.edit.apply',
|
|
283
|
+
summary: '用户确认后提交反馈:saveFormData(乐观锁全字段集)→ runEsb 动作流 → addProcessLog 过程日志 → 回查校验',
|
|
284
|
+
capability: 'recruit.interview.feedback',
|
|
285
|
+
risk: 'write',
|
|
286
|
+
requiresConfirmation: true,
|
|
287
|
+
inputSchema: schemaOf({
|
|
288
|
+
talentId: { type: 'string' }, mobile: { type: 'string', pattern: '^\\d{6,20}$' },
|
|
289
|
+
feedbackId: { type: 'string' }, planIndex: { type: 'integer', minimum: 0 },
|
|
290
|
+
result: { type: 'string' }, comment: { type: 'string' },
|
|
291
|
+
confirm: { type: 'boolean' }, continuation: { type: 'string' },
|
|
292
|
+
}, {}),
|
|
293
|
+
handler: apply,
|
|
294
|
+
},
|
|
295
|
+
];
|