weaver-work-cli 0.1.75 → 0.1.78
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 +3 -1
- package/dist/chunks/{archive-OZJ6PYUR.js → archive-ENBSUMHV.js} +1 -1
- package/dist/chunks/{archive-oa-BHL5RK2F.js → archive-oa-7BFPQ6M5.js} +1 -1
- package/dist/chunks/{asset-HKRFRQR2.js → asset-V5SUD3PW.js} +1 -1
- package/dist/chunks/{asset-idle-GGIR4KE7.js → asset-idle-3CEL7WFX.js} +1 -1
- package/dist/chunks/{attachment-content-4OV65NK5.js → attachment-content-TFOC3Y3X.js} +3 -3
- package/dist/chunks/{blog-HYDP4DV3.js → blog-FLI4SS3P.js} +1 -1
- package/dist/chunks/{caizhilian-JS4RQZ6Z.js → caizhilian-7WCTKCCP.js} +3 -3
- package/dist/chunks/{calendar-SWRY4DIT.js → calendar-G726HUUH.js} +1 -1
- package/dist/chunks/{chunk-5ZJGPEIB.js → chunk-2KW7AI6P.js} +1 -1
- package/dist/chunks/{chunk-JOY3HZXL.js → chunk-2UV4IZIT.js} +21 -15
- package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
- package/dist/chunks/{chunk-VOMDD2C5.js → chunk-5E2FDXBU.js} +1 -1
- package/dist/chunks/{chunk-ZUB4M4N3.js → chunk-5VQ7JHV4.js} +134 -49
- package/dist/chunks/{chunk-I6NOHKEK.js → chunk-7SQN5IZR.js} +1 -1
- package/dist/chunks/{chunk-4FCBEWNB.js → chunk-BP7BONZO.js} +675 -86
- package/dist/chunks/{chunk-U6Y32KEV.js → chunk-BWFCTE43.js} +1 -1
- package/dist/chunks/{chunk-PG5YSNYY.js → chunk-DACQKJ6O.js} +3 -3
- package/dist/chunks/{chunk-KWJEICD4.js → chunk-E2EY3DMS.js} +2 -2
- package/dist/chunks/{chunk-KEA4XQPO.js → chunk-FAC4IFGQ.js} +4 -4
- package/dist/chunks/{chunk-MXCRKXOP.js → chunk-FPWCCRKT.js} +1 -1
- package/dist/chunks/{minute-doc-OQUMDTKG.js → chunk-IBTGXLOT.js} +101 -18
- package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
- package/dist/chunks/{chunk-BNKUHN4N.js → chunk-OVTCWLNQ.js} +2 -2
- package/dist/chunks/{chunk-5D2V7ZAN.js → chunk-PMRNIGKZ.js} +1 -1
- package/dist/chunks/{chunk-OQCK5SAU.js → chunk-RVEKGVZU.js} +1 -1
- package/dist/chunks/{chunk-2AUFKU2D.js → chunk-SWFTWNWL.js} +11 -11
- package/dist/chunks/{chunk-TA2RBUTH.js → chunk-TBCKK6LH.js} +1 -1
- package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
- package/dist/chunks/{chunk-J7FAAHWH.js → chunk-UDBQJLQF.js} +1 -1
- package/dist/chunks/{chunk-BSR5TM7U.js → chunk-USYFVIUR.js} +22 -7
- package/dist/chunks/{chunk-ERZY6GYL.js → chunk-UZ2E3VNI.js} +1 -1
- package/dist/chunks/{chunk-NWYHCZTY.js → chunk-VNEU7OUN.js} +1 -1
- package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
- package/dist/chunks/{chunk-LJI4N6FV.js → chunk-XNN5PZTI.js} +1 -1
- package/dist/chunks/{chunk-QJWVYOOV.js → chunk-Z44YFIN6.js} +2 -2
- package/dist/chunks/{chunk-ZWIMLT6P.js → chunk-ZOTXXGUM.js} +7 -7
- package/dist/chunks/{cli-FULPXIKJ.js → cli-WA7FOQKC.js} +35 -35
- package/dist/chunks/{commands-BNWFNTD3.js → commands-J52MJ6NF.js} +3 -3
- package/dist/chunks/{conflict-5BKCDV2F.js → conflict-D4GVAURN.js} +2 -2
- package/dist/chunks/{contract-WI23OXVC.js → contract-GW7US3UF.js} +4400 -3548
- package/dist/chunks/{cowork-DZBBVNMQ.js → cowork-GZDODGKF.js} +1 -1
- package/dist/chunks/{create-flow-7ZRBRKX7.js → create-flow-ERDGW3FZ.js} +10 -6
- package/dist/chunks/{data-PAZVE6QE.js → data-HTQZRPPI.js} +1 -1
- package/dist/chunks/{ebuilder-form-5SQXIGXN.js → ebuilder-form-GHNIZ7ET.js} +2 -2
- package/dist/chunks/{ehr-CX5F4ZAU.js → ehr-P6T7OAAV.js} +2 -2
- package/dist/chunks/{entry-mode-I2BYNONZ.js → entry-mode-SQU5WTX6.js} +3 -3
- package/dist/chunks/{env-ZAQZ7EHN.js → env-DASBNSEM.js} +2 -2
- package/dist/chunks/{esb-DQTXDIBF.js → esb-ATRKVHCD.js} +3 -3
- package/dist/chunks/{factory-XRI6KZ7H.js → factory-A3NAKZAA.js} +1 -1
- package/dist/chunks/{fna-FK6HQVJL.js → fna-IKYI3SST.js} +1 -1
- package/dist/chunks/{group-chat-MLWNYM2P.js → group-chat-7SEAVAJR.js} +3 -3
- package/dist/chunks/{host-MEC4VQZA.js → host-6UOXYOOY.js} +2 -2
- package/dist/chunks/{host-KUMU3DDK.js → host-EJSJSLVK.js} +2 -2
- package/dist/chunks/{host-3EPREGXS.js → host-EYNLB6S4.js} +2 -2
- package/dist/chunks/{host-T6NNQGVZ.js → host-OT4KNR3G.js} +2 -2
- package/dist/chunks/{host-VI7Q45PM.js → host-UY4LQPN4.js} +2 -2
- package/dist/chunks/{host-J74JGYAW.js → host-XXGDQM7D.js} +2 -2
- package/dist/chunks/{hrm-KKVAW4P5.js → hrm-5JQ7QZ6A.js} +2 -2
- package/dist/chunks/{im-47CIWQNL.js → im-2YJW3EI5.js} +2 -2
- package/dist/chunks/{invoice-CDYRBNIG.js → invoice-37HR6L3W.js} +937 -552
- package/dist/chunks/{jiuchuanhui-M7QTRHZK.js → jiuchuanhui-KBWUZ7WT.js} +1 -1
- package/dist/chunks/{lazy-dispatch-FKQJZFI5.js → lazy-dispatch-ZDKLS5MR.js} +6 -6
- package/dist/chunks/{mail-NRBS5N6Y.js → mail-YBKUM6HM.js} +1 -1
- package/dist/chunks/{meeting-WC5LD3IO.js → meeting-7AEQGBAT.js} +19 -13
- package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
- package/dist/chunks/{okr-EHKSKMPL.js → okr-HW7IULIR.js} +1 -1
- package/dist/chunks/{operations-V5VM5MS2.js → operations-4P2UYVLH.js} +3 -3
- package/dist/chunks/{performance-ZJADXJPN.js → performance-PM2G6L3E.js} +1 -1
- package/dist/chunks/{plan-OTDNBDJ7.js → plan-3YYGZ7ZM.js} +1 -1
- package/dist/chunks/{project-4XVBQ3HX.js → project-6PRGBLO2.js} +39 -15
- package/dist/chunks/{reception-3FAHOOH7.js → reception-7G3J2MA6.js} +1 -1
- package/dist/chunks/{recruit-stage-3WTVWW2K.js → recruit-stage-TLZJUFHD.js} +544 -464
- package/dist/chunks/{registry-TJGCVRCW.js → registry-3VTB3KLV.js} +3 -3
- package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
- package/dist/chunks/{registry-NBTBXR4L.js → registry-UVTI323K.js} +12 -11
- package/dist/chunks/{room-recommend-KL62XB2Y.js → room-recommend-ELEJUYBN.js} +4 -4
- package/dist/chunks/{schedule-XOISYUPB.js → schedule-XBKY7VEA.js} +4 -4
- package/dist/chunks/{smart-extract-UYGNV3BM.js → smart-extract-T5Z4AULN.js} +1 -1
- package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
- package/dist/chunks/{workflow-V54LJPXL.js → workflow-SYCBS5XD.js} +3 -3
- package/dist/index.js +3 -3
- package/dist/internal/update/service.js +9 -8
- package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
- package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
- package/dist/shortcuts/contract/data/report-renderers.js +75 -31
- package/dist/shortcuts/contract/data/report-spec.js +17 -3
- package/dist/shortcuts/contract/manifest.js +20 -3
- package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
- package/dist/shortcuts/contract/operations/collection-node.js +116 -1
- package/dist/shortcuts/contract/operations/compare-report.js +27 -5
- package/dist/shortcuts/contract/operations/credit-page.js +11 -2
- package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
- package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
- package/dist/shortcuts/contract/operations/elements-build.js +162 -30
- package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
- package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
- package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
- package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
- package/dist/shortcuts/contract/operations/ledger.js +88 -16
- package/dist/shortcuts/contract/operations/metrics.js +16 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
- package/dist/shortcuts/contract/operations/page.js +23 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
- package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
- package/dist/shortcuts/contract/operations/review-report.js +11 -3
- package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
- package/dist/shortcuts/contract/operations/triage.js +18 -3
- package/dist/shortcuts/contract/operations/viewlink.js +17 -1
- package/dist/shortcuts/ehr/operations/recruit.js +255 -90
- package/dist/shortcuts/invoice/business-response.js +13 -0
- package/dist/shortcuts/invoice/calendar.js +24 -0
- package/dist/shortcuts/invoice/host.js +26 -15
- package/dist/shortcuts/invoice/index.js +2 -2
- package/dist/shortcuts/invoice/invoice-record.js +7 -2
- package/dist/shortcuts/invoice/manifest.js +179 -155
- package/dist/shortcuts/invoice/operations/get.js +9 -3
- package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
- package/dist/shortcuts/invoice/operations/registry.js +4 -5
- package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
- package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
- package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
- package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
- package/dist/shortcuts/invoice/operations/reim.js +2 -126
- package/dist/shortcuts/invoice/operations/shared.js +15 -17
- package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
- package/dist/shortcuts/invoice/projection.js +14 -0
- package/dist/shortcuts/invoice/read-enrichment.js +123 -0
- package/dist/shortcuts/meeting/confirm-gate.js +42 -0
- package/dist/shortcuts/meeting/continuation.js +6 -2
- package/dist/shortcuts/meeting/minute-doc.js +119 -12
- package/dist/shortcuts/meeting/operations/attachment.js +19 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
- package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
- package/dist/shortcuts/meeting/operations/group-share.js +268 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
- package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/project/operations/read.js +40 -15
- package/dist/shortcuts/recruit-stage/context.js +16 -81
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
- package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
- package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
- package/dist/shortcuts/recruit-stage/shared.js +153 -4
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +11 -0
- package/dist/shortcuts/workflow/operations/read.js +24 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
- package/docs/agent-invoice.md +28 -2
- package/docs/invoice.md +60 -9
- package/docs/project.md +1 -1
- package/package.json +1 -1
- package/skill-template/domains/yepiaotong.md +36 -7
- package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
- package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
- package/skills/weaver-e10-meeting/SKILL.md +203 -80
- package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
- package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
- package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
- package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +158 -146
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +64 -51
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +56 -18
- package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +217 -30
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +18 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +19 -20
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +21 -25
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +19 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +31 -58
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +25 -15
- package/skills/weaver-e10-shijingran/SKILL.md +2 -2
- package/skills/weaver-e10-shijingran/references/operations.md +5 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
- package/skills/weaver-e10-workflow/SKILL.md +13 -9
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
- package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
- package/skills/weaver-e10-yepiaotong/SKILL.md +133 -61
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
- package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
- package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
- package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
- package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
- package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
- package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
- package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
- package/templates/meeting/minute.docx +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
|
@@ -387,6 +387,15 @@ function scanSlots(xml) {
|
|
|
387
387
|
const summarySlotId = stopCells.length > 1 && stopCells.length < regionHeaderCells.length && looksMoneyCell
|
|
388
388
|
? `t${table.index}r${stopRow}c${stopCells.length - 1}`
|
|
389
389
|
: '';
|
|
390
|
+
const regionColumns = regionHeaderCells.map((cell, index) => ({ cell: index, name: cell.text.trim() }));
|
|
391
|
+
/**
|
|
392
|
+
* 前置暴露 `fill` 的**缺省金额/求和列**(2026-11-30 事故固化)。
|
|
393
|
+
*
|
|
394
|
+
* `fill` 的缺省是「第一个金额约束列」,模板里像「编号/内容/价格/折扣/金额」这种**多金额列**表,
|
|
395
|
+
* 缺省落在**价格**上;模型若把金额写在「金额」列,区块求和校验会报「金额列没有任何可计算的值」,
|
|
396
|
+
* 而此前 `slots.scan` 不暴露这个缺省值,模型只能先失败一次再猜。
|
|
397
|
+
*/
|
|
398
|
+
const moneyColumn = regionColumns.find((column) => inferConstraint(column.name) === 'money')?.name ?? '';
|
|
390
399
|
slots.push({
|
|
391
400
|
slotId,
|
|
392
401
|
type: 'table-region',
|
|
@@ -395,7 +404,8 @@ function scanSlots(xml) {
|
|
|
395
404
|
startRow: segment.startRow,
|
|
396
405
|
endRow: segment.endRow,
|
|
397
406
|
availableRows: rowCount,
|
|
398
|
-
columns:
|
|
407
|
+
columns: regionColumns,
|
|
408
|
+
...(moneyColumn ? { moneyColumn, sumColumn: moneyColumn } : {}),
|
|
399
409
|
kind,
|
|
400
410
|
currentRows,
|
|
401
411
|
label: segmentIndex === 0 ? `可扩缩区块(${kind})` : `可扩缩区块${segmentIndex + 1}(${kind})`,
|
|
@@ -1012,6 +1022,17 @@ export const contractDocxSlotsOperations = [
|
|
|
1012
1022
|
required: slots.filter((slot) => slot.required).length,
|
|
1013
1023
|
requiredRegion: slots.filter((slot) => slot.type === 'table-region' && slot.required).length,
|
|
1014
1024
|
};
|
|
1025
|
+
/**
|
|
1026
|
+
* **必填位点清单**:即使 `data.slots` 被输出层预览截断(体积保护),这一份也保证完整。
|
|
1027
|
+
*
|
|
1028
|
+
* 2026-11-30 事故:某新客户购买合同模板 26 个位点,预览只回传前 20 条,
|
|
1029
|
+
* 被砍掉的恰是**签署页整组**(代表签字 / 盖章 / **生效日期**)——模型看不到,
|
|
1030
|
+
* 而 `slots.fill` 的必填覆盖校验会要求它们 → 只能"先失败一次再看报错"。
|
|
1031
|
+
* 位点少、体积极小,直接给全量清单最稳。
|
|
1032
|
+
*/
|
|
1033
|
+
const requiredSlots = slots
|
|
1034
|
+
.filter((slot) => slot.required)
|
|
1035
|
+
.map((slot) => ({ slotId: slot.slotId, type: slot.type, label: slot.label }));
|
|
1015
1036
|
// 范文骨架:条款结构(哪一条、在哪个段落、带哪张表),供模型决定按需增删条款。
|
|
1016
1037
|
// 默认给出(动态生成需要它);模板很长时可用 includeText:false 关掉以省上下文。
|
|
1017
1038
|
const includeText = input.includeText !== false;
|
|
@@ -1030,13 +1051,17 @@ export const contractDocxSlotsOperations = [
|
|
|
1030
1051
|
template: templatePath,
|
|
1031
1052
|
slotCount: slots.length,
|
|
1032
1053
|
summary,
|
|
1054
|
+
requiredSlots,
|
|
1033
1055
|
profile,
|
|
1034
1056
|
slots,
|
|
1035
1057
|
...(outline ? { outline: outline.entries, clauses: outline.clauses } : {}),
|
|
1036
1058
|
...(outPath ? { out: outPath } : {}),
|
|
1037
1059
|
note: '模板只是参考:slots 是可填位点;table-region 位点(付款计划 / 费用构成等)'
|
|
1038
1060
|
+ '用 plan.regions 按实际需要决定行数;outline/clauses 是范文条款骨架,'
|
|
1039
|
-
+ '用 plan.clauses
|
|
1061
|
+
+ '用 plan.clauses 新增或删除条款。'
|
|
1062
|
+
+ '⚠️ `data.slots` 可能被预览截断(看预览时先比 slotCount 与 slots.length),'
|
|
1063
|
+
+ '**必填位点一律以 `requiredSlots` 为准**(它保证完整),全量位点用 `out` 落盘或按 `recovery`/`refs get` 取;'
|
|
1064
|
+
+ '段落位点必须回填**完整 `fullText`**(预览里的 fullText 只给前 40 字符,`text` 可能为空)。'
|
|
1040
1065
|
},
|
|
1041
1066
|
};
|
|
1042
1067
|
},
|
|
@@ -2,8 +2,8 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { basename, resolve } from 'node:path';
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
4
|
import { readZip } from '../ooxml/zip.js';
|
|
5
|
-
import { mapCompany, pickOption } from './elements-build.js';
|
|
6
|
-
import { BUILTIN } from './elements-spec.js';
|
|
5
|
+
import { mapCompany, normalizeFieldValue, pickOption } from './elements-build.js';
|
|
6
|
+
import { BUILTIN, resolveSignWay } from './elements-spec.js';
|
|
7
7
|
import { resolveFlow } from './flow.js';
|
|
8
8
|
import { runGeneratedSubmit, str } from './generated-submit.js';
|
|
9
9
|
import { inspectAmount } from './money.js';
|
|
@@ -58,9 +58,11 @@ export function buildDraftFieldResults(args) {
|
|
|
58
58
|
const fieldOf = (key) => spec.fields[key] ?? spec.selects?.[key] ?? '';
|
|
59
59
|
const results = [];
|
|
60
60
|
const add = (fieldInfo, value, reason, origin) => {
|
|
61
|
-
|
|
61
|
+
// 值一律归一到名称/文本(对象 `{id,name}`、数组都会被兜底成名称文本,见 normalizeFieldValue)
|
|
62
|
+
const text = normalizeFieldValue(value);
|
|
63
|
+
if (!fieldInfo || !text)
|
|
62
64
|
return;
|
|
63
|
-
results.push({ fieldInfo, reason, value, origin });
|
|
65
|
+
results.push({ fieldInfo, reason, value: text, origin });
|
|
64
66
|
};
|
|
65
67
|
const originOf = (text) => {
|
|
66
68
|
const value = String(text ?? '').trim();
|
|
@@ -107,8 +109,9 @@ export function buildDraftFieldResults(args) {
|
|
|
107
109
|
? '未约定固定签署日,按默认合同办理当天(技术性默认值)'
|
|
108
110
|
: `用户指定签署日期:${args.signDateType}`, null);
|
|
109
111
|
}
|
|
110
|
-
// ⑨
|
|
111
|
-
|
|
112
|
+
// ⑨ 合同签订方式(用印顺序):用户口述优先——「对方先用印 / 客户方先盖章」必须归一成选项 1,
|
|
113
|
+
// ⛔ 不得因为口语写法匹配不上就落默认「我方先盖章」(2026-11-30 事故:对手方要求被写反)。
|
|
114
|
+
addOption('signWay', resolveSignWay(args.signWay) || DEFAULT_SIGN_WAY, DEFAULT_SIGN_WAY, '合同签订方式', `用户指定签订方式:${args.signWay}`, '未特别约定签署顺序,按我方先盖章(技术性默认值)');
|
|
112
115
|
// ⑩ 合同类型:仅部分流程存在该字段;用户不传就不写,传了必须在选项表内
|
|
113
116
|
if (args.contractType && fieldOf('contractType')) {
|
|
114
117
|
add(fieldOf('contractType'), optionOf(spec, 'contractType', args.contractType, true, '合同类型'), `用户指定合同类型:${args.contractType}`, null);
|
|
@@ -194,7 +194,7 @@ function groupThousands(digits) {
|
|
|
194
194
|
* 除原值外,额外补充去掉括号注释的变体,避免「2026年7月(日留空待填)」
|
|
195
195
|
* 这类带注释的值在正文里匹配不到而丢掉出处;数字补千分位/去千分位变体。
|
|
196
196
|
*/
|
|
197
|
-
function buildNeedles(value) {
|
|
197
|
+
export function buildNeedles(value) {
|
|
198
198
|
if (isEmptyScalar(value))
|
|
199
199
|
return null;
|
|
200
200
|
const values = Array.isArray(value) ? value : [value];
|
|
@@ -407,7 +407,7 @@ export function buildNewCustomer({ triage, fileId, flow, lines, sourceMap, fileI
|
|
|
407
407
|
const add = (key, value, reason, origin) => {
|
|
408
408
|
if (isEmptyScalar(value))
|
|
409
409
|
return;
|
|
410
|
-
results.push({ fieldInfo: fields[key], reason, value:
|
|
410
|
+
results.push({ fieldInfo: fields[key], reason, value: normalizeFieldValue(value), origin: ro(origin) });
|
|
411
411
|
};
|
|
412
412
|
// 购买方式:以「签约相对方是否等于最终用户」判定,不能只看丙方。
|
|
413
413
|
// 判据(references §2.1):实际使用系统的客户通过第三方公司与泛微签约 → 通过伙伴签署;
|
|
@@ -514,6 +514,149 @@ export function buildNewCustomer({ triage, fileId, flow, lines, sourceMap, fileI
|
|
|
514
514
|
return makePayload(spec, flow, fileId, results, subtables);
|
|
515
515
|
}
|
|
516
516
|
/** 契约锁 / 常规二次销售 / 老客户增值:只填文本、数字与已实测选项的复选框。 */
|
|
517
|
+
/**
|
|
518
|
+
* 选项表取值:既接受**表键(显示名 / 口语写法)**,也接受**已经是选项 ID** 的直传值。
|
|
519
|
+
*
|
|
520
|
+
* 用户/上游两种写法都要认:「客户方先盖章」(表键)与「1」(选项 ID)。
|
|
521
|
+
* 返回 `''` 表示取不到(调用方自行决定报错还是留空)。
|
|
522
|
+
*/
|
|
523
|
+
export function pickOptionOrId(table, value) {
|
|
524
|
+
const raw = String(value ?? '').trim();
|
|
525
|
+
if (!raw)
|
|
526
|
+
return '';
|
|
527
|
+
if (Object.values(table).includes(raw))
|
|
528
|
+
return raw;
|
|
529
|
+
return pickOption(table, raw) ?? '';
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* 识别记录字段值归一:**浏览按钮类字段一律落成名称文本**。
|
|
533
|
+
*
|
|
534
|
+
* 🔴 2026-12-01 事故:调用方把 `{"id":"…","name":"韦莱保险经纪有限公司"}` 这种对象当 `value` 传进来,
|
|
535
|
+
* 落库后页面上的客户名称就显示成 `{id,name}` 形态。技能文档明确禁止两种写法——`{id,name}` 对象与纯记录 id。
|
|
536
|
+
*
|
|
537
|
+
* 这里做**兜底**(不等于允许):对象取 `name`(退 `title` / `label` / `text` / `displayName`,再退 `id`),
|
|
538
|
+
* 数组逐项取名称后逗号拼接,其余标量转字符串。归一发生在落库前,调用方仍应直接传名称文本。
|
|
539
|
+
*/
|
|
540
|
+
export function normalizeFieldValue(value) {
|
|
541
|
+
if (value === undefined || value === null)
|
|
542
|
+
return '';
|
|
543
|
+
if (typeof value === 'string')
|
|
544
|
+
return value;
|
|
545
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
546
|
+
return String(value);
|
|
547
|
+
if (Array.isArray(value)) {
|
|
548
|
+
return value.map((item) => normalizeFieldValue(item)).filter((item) => item !== '').join(',');
|
|
549
|
+
}
|
|
550
|
+
if (typeof value === 'object') {
|
|
551
|
+
const record = value;
|
|
552
|
+
for (const key of ['name', 'title', 'label', 'text', 'displayName', 'realName', 'khmc']) {
|
|
553
|
+
const picked = record[key];
|
|
554
|
+
if (typeof picked === 'string' && picked.trim())
|
|
555
|
+
return picked.trim();
|
|
556
|
+
}
|
|
557
|
+
const id = record.id;
|
|
558
|
+
if (typeof id === 'string' && id.trim())
|
|
559
|
+
return id.trim();
|
|
560
|
+
if (typeof id === 'number')
|
|
561
|
+
return String(id);
|
|
562
|
+
try {
|
|
563
|
+
return JSON.stringify(value);
|
|
564
|
+
}
|
|
565
|
+
catch {
|
|
566
|
+
return '';
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return '';
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* 从生成合同正文里挑出**「购买内容」证据行**:只保留带费用/标的语义的行。
|
|
573
|
+
*
|
|
574
|
+
* 为什么要筛:正文里的**服务内容清单**会出现「升级支持」这类服务项,整段扫会把维护合同
|
|
575
|
+
* 误判成"购买了升级包"(复选框语义是"买了什么",不是"服务里提到什么")。
|
|
576
|
+
* 费用明细 / 标的 / 金额 / 许可 / 模块 这类行才是购买证据。
|
|
577
|
+
*/
|
|
578
|
+
const PURCHASE_EVIDENCE_LINE = /(费用|价款|标的|购买|金额|维护费|服务费|许可|licen[cs]e|模块|元|¥|¥)/iu;
|
|
579
|
+
export function purchaseEvidenceText(contractText, limit = 60) {
|
|
580
|
+
if (!contractText)
|
|
581
|
+
return '';
|
|
582
|
+
return contractText
|
|
583
|
+
.split(/\r?\n/u)
|
|
584
|
+
.filter((line) => PURCHASE_EVIDENCE_LINE.test(line))
|
|
585
|
+
.slice(0, limit)
|
|
586
|
+
.join(' ');
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* 字段 ID 串(`<id>#<表单中文名>`)→ **可在正文里检索的表单标签**。
|
|
590
|
+
*
|
|
591
|
+
* 例:`1298278337779310598#流程标题new` → `流程标题`;`100003720000001199#客户名称(最终用户)` → `客户名称`;
|
|
592
|
+
* `1291602365099327623#伙伴名称(文本备份)` → `伙伴名称`。
|
|
593
|
+
*
|
|
594
|
+
* 2026-12-01:报价单 / 运维起草收口要"**全字段过一遍、抽不到留空**",靠的就是
|
|
595
|
+
* 「按表单标签在正文里找『标签:值』」这一条通用机制,避免为每个字段手写一条抽取规则。
|
|
596
|
+
*/
|
|
597
|
+
export function fieldLabel(fieldInfo) {
|
|
598
|
+
const raw = String(fieldInfo ?? '').split('#')[1] ?? '';
|
|
599
|
+
return raw
|
|
600
|
+
.replace(/([^)]*)/gu, '')
|
|
601
|
+
.replace(/\([^)]*\)/gu, '')
|
|
602
|
+
.replace(/new$/iu, '')
|
|
603
|
+
.replace(/\s+/gu, '')
|
|
604
|
+
.trim();
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* 在正文里按**行首标签**取「标签:值」。⛔ 三个硬条件,缺一不可:
|
|
608
|
+
* 1. 标签出现在行首(允许前面有表格竖线 `|`)——避免把叙述句里的「地址按本合同第…」当成送达地址;
|
|
609
|
+
* 2. 标签后必须紧跟冒号(`:` / `:`);
|
|
610
|
+
* 3. 冒号后的值必须非空且有实质内容——模板里那种空标签(`联系人:` / `地址:`)一律视为**抽不到**。
|
|
611
|
+
*/
|
|
612
|
+
export function pickLabeledValue(lines, label) {
|
|
613
|
+
const target = norm(label);
|
|
614
|
+
if (!target)
|
|
615
|
+
return null;
|
|
616
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
617
|
+
const line = String(lines[i] ?? '').replace(/^[\s||]+/u, '');
|
|
618
|
+
const colonAt = line.search(/[::]/u);
|
|
619
|
+
if (colonAt < 0)
|
|
620
|
+
continue;
|
|
621
|
+
const head = norm(line.slice(0, colonAt));
|
|
622
|
+
if (head !== target)
|
|
623
|
+
continue;
|
|
624
|
+
const value = line.slice(colonAt + 1).replace(/[||]/gu, ' ').trim().replace(/[。;;,,]$/u, '');
|
|
625
|
+
if (value.length < 2)
|
|
626
|
+
return null; // 空标签:明确视为抽不到
|
|
627
|
+
return { value: value.slice(0, 60), lineIndex: i };
|
|
628
|
+
}
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* 「合同购买内容」复选框:按语义关键词命中勾选,**命中不到整条不填**(不猜、不落空值)。
|
|
633
|
+
*
|
|
634
|
+
* 🔴 两条链路必须共用本函数(上传合同链路 `buildGeneric` 与报价单/运维起草收口 `buildQuoteFieldResults`):
|
|
635
|
+
* 2026-11-30 事故——运维合同起草走的是**报价单收口**,而该收口的字段表原先没有这一项,
|
|
636
|
+
* 于是识别记录里永远缺「合同购买内容」(合同购买内容本属技能文档 §1「抽取范围」第 2 类)。
|
|
637
|
+
*
|
|
638
|
+
* ⚠️ 关键词表按流程不同(常规二次销售 = RESALE、老客户增值 = UPSALE),
|
|
639
|
+
* 所以**流程选错会直接表现为"这一项是空的"**:年度维护合同只有走常规二次销售才会命中「维护」。
|
|
640
|
+
*/
|
|
641
|
+
export function pickPurchaseCheckbox(flow, parts) {
|
|
642
|
+
const checkbox = BUILTIN[flow]?.checkbox;
|
|
643
|
+
if (!checkbox)
|
|
644
|
+
return null;
|
|
645
|
+
const hints = flow === '常规二次销售' ? CHECKBOX_HINTS_RESALE : CHECKBOX_HINTS_UPSALE;
|
|
646
|
+
const blob = parts.filter((part) => pyTruthy(part)).map((part) => String(part)).join(' ');
|
|
647
|
+
const picked = [];
|
|
648
|
+
const hit = [];
|
|
649
|
+
for (const [name, keywords] of hints) {
|
|
650
|
+
if (keywords.some((keyword) => blob.includes(keyword))) {
|
|
651
|
+
const optionId = checkbox.options[name];
|
|
652
|
+
if (optionId === undefined)
|
|
653
|
+
continue;
|
|
654
|
+
picked.push(optionId);
|
|
655
|
+
hit.push(name);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return picked.length ? { fieldKey: checkbox.fieldKey, value: picked.join(','), hit } : null;
|
|
659
|
+
}
|
|
517
660
|
export function buildGeneric({ triage, fileId, flow, lines, sourceMap, fileIds }) {
|
|
518
661
|
const spec = BUILTIN[flow];
|
|
519
662
|
const fields = spec.fields;
|
|
@@ -523,15 +666,17 @@ export function buildGeneric({ triage, fileId, flow, lines, sourceMap, fileIds }
|
|
|
523
666
|
const ro = (needles) => resolveOrigin(lines, needles, fileId, sourceMap, fileIds);
|
|
524
667
|
const add = (key, value, reason, origin) => {
|
|
525
668
|
const fieldInfo = fields[key];
|
|
526
|
-
|
|
669
|
+
const text = normalizeFieldValue(value);
|
|
670
|
+
if (!fieldInfo || isEmptyScalar(text))
|
|
527
671
|
return;
|
|
528
|
-
results.push({ fieldInfo, reason, value:
|
|
672
|
+
results.push({ fieldInfo, reason, value: text, origin: ro(origin) });
|
|
529
673
|
};
|
|
530
674
|
const addSelect = (key, value, reason, origin) => {
|
|
531
675
|
const fieldInfo = selects[key];
|
|
532
|
-
|
|
676
|
+
const text = normalizeFieldValue(value);
|
|
677
|
+
if (!fieldInfo || isEmptyScalar(text))
|
|
533
678
|
return;
|
|
534
|
-
results.push({ fieldInfo, reason, value:
|
|
679
|
+
results.push({ fieldInfo, reason, value: text, origin: ro(origin) });
|
|
535
680
|
};
|
|
536
681
|
// ① 合同文件:不写入 recognizeResult(附件只走流程组件 customParams)
|
|
537
682
|
// ② 文本类:流程标题优先取合同标题,抽不到用文件名兜底
|
|
@@ -595,30 +740,17 @@ export function buildGeneric({ triage, fileId, flow, lines, sourceMap, fileIds }
|
|
|
595
740
|
addSelect('relatedProduct', optionId('relatedProduct', elements.relatedProduct), '按合同标的判定相关产品', buildNeedles(elements.relatedProduct));
|
|
596
741
|
addSelect('isXinChuang', optionId('isXinChuang', elements.isXinChuang), '合同未涉及信创内容则不填', buildNeedles(elements.isXinChuang));
|
|
597
742
|
// ⑦ 合同购买内容(复选框):按正文语义命中勾选,命中不到整条不填
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
].filter((part) => pyTruthy(part)).map((part) => String(part));
|
|
610
|
-
const blob = blobParts.join(' ');
|
|
611
|
-
const picked = [];
|
|
612
|
-
const hit = [];
|
|
613
|
-
for (const [name, keywords] of hints) {
|
|
614
|
-
if (keywords.some((keyword) => blob.includes(keyword))) {
|
|
615
|
-
picked.push(checkbox.options[name]);
|
|
616
|
-
hit.push(name);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
if (picked.length) {
|
|
620
|
-
add(checkbox.fieldKey, picked.join(','), `按合同标的关键词命中:${hit.join('、')}`, buildNeedles(itemNames) ?? buildNeedles(hit));
|
|
621
|
-
}
|
|
743
|
+
const items = Array.isArray(elements.items) ? elements.items : [];
|
|
744
|
+
const itemNames = items.map((item) => truthyText(item?.name));
|
|
745
|
+
const purchase = pickPurchaseCheckbox(flow, [
|
|
746
|
+
elements.title,
|
|
747
|
+
elements.contractName,
|
|
748
|
+
elements.background,
|
|
749
|
+
elements.serviceScope,
|
|
750
|
+
itemNames.join(' '),
|
|
751
|
+
]);
|
|
752
|
+
if (purchase) {
|
|
753
|
+
add(purchase.fieldKey, purchase.value, `按合同标的关键词命中:${purchase.hit.join('、')}`, buildNeedles(itemNames) ?? buildNeedles(purchase.hit));
|
|
622
754
|
}
|
|
623
755
|
return makePayload(spec, flow, fileId, results);
|
|
624
756
|
}
|
|
@@ -14,6 +14,56 @@
|
|
|
14
14
|
* - 复选框选项 ID 各流程**互不相同**,禁止互抄;
|
|
15
15
|
* - 不登记附件字段到 recognizeResult(附件只走流程组件 customParams)。
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* 用户口述的「用印 / 签署顺序」→ 本流程选项表的**标准写法**(四流程键一致:
|
|
19
|
+
* `我方先盖章=0` / `客户方先盖章=1` / `等待确认=2`)。
|
|
20
|
+
*
|
|
21
|
+
* 为什么必须归正(2026-11-30 事故):装配器原先**没有这个入参**,一律写技术性默认「我方先盖章」,
|
|
22
|
+
* 于是用户明确要求的「对方先用印」被落成了我方先盖章——**把对手方的要求写反**,且不报错。
|
|
23
|
+
* 用户口语五花八门(对方先用印 / 客户方先盖章 / 甲方先签 / 对方先签署),这里统一归一到表键。
|
|
24
|
+
*/
|
|
25
|
+
const SIGN_WAY_ALIASES = [
|
|
26
|
+
{ pattern: /((对方|客户方?|甲方)[^。;;]{0,6}?(先|用印|盖章|签署))/u, label: '客户方先盖章' },
|
|
27
|
+
{ pattern: /(等待|待定|暂不|不确定|需确认|再确认)/u, label: '等待确认' },
|
|
28
|
+
{ pattern: /((我方|乙方)[^。;;]{0,6}?(先|用印|盖章|签署))/u, label: '我方先盖章' },
|
|
29
|
+
];
|
|
30
|
+
export function resolveSignWay(value) {
|
|
31
|
+
const raw = String(value ?? '').replace(/\s+/gu, '').trim();
|
|
32
|
+
if (!raw)
|
|
33
|
+
return '';
|
|
34
|
+
for (const { pattern, label } of SIGN_WAY_ALIASES) {
|
|
35
|
+
if (pattern.test(raw))
|
|
36
|
+
return label;
|
|
37
|
+
}
|
|
38
|
+
return raw;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 「合同类型」按**产品线**归一到本流程的选项 ID(常规二次销售 / 老客户增值 / 新客户都有这个下拉)。
|
|
42
|
+
*
|
|
43
|
+
* 2026-12-01:报价单 / 运维起草收口原先不装配这一项(装配器只吃报价单侧数据、不吃正文),
|
|
44
|
+
* 而产品线恰恰写在**生成后的合同正文**里(如「协同办公系统(e-cology)软件年度维护合同」)。
|
|
45
|
+
* 现在由收口把生成合同正文传进来,本函数按产品线锚词命中 → 返回本流程的选项 ID;
|
|
46
|
+
* **命中不到就不填**(不猜),⛔ 不得跨流程套用选项表(各流程 ID 不同)。
|
|
47
|
+
*/
|
|
48
|
+
export function pickProductLineContractType(flow, parts) {
|
|
49
|
+
const spec = BUILTIN[flow];
|
|
50
|
+
const table = spec?.options?.contractType ?? {};
|
|
51
|
+
if (!spec?.selects?.contractType || !Object.keys(table).length)
|
|
52
|
+
return null;
|
|
53
|
+
const blob = parts
|
|
54
|
+
.filter((part) => part !== undefined && part !== null && String(part).trim() !== '')
|
|
55
|
+
.map((part) => String(part).toLowerCase())
|
|
56
|
+
.join(' ');
|
|
57
|
+
let best = null;
|
|
58
|
+
for (const [alias, id] of Object.entries(table)) {
|
|
59
|
+
const anchor = alias.toLowerCase().replace(/购买$/u, '').trim();
|
|
60
|
+
if (!anchor || !blob.includes(anchor))
|
|
61
|
+
continue;
|
|
62
|
+
if (!best || anchor.length > best.alias.length)
|
|
63
|
+
best = { alias, id };
|
|
64
|
+
}
|
|
65
|
+
return best ? { fieldKey: 'contractType', value: best.id, hit: best.alias } : null;
|
|
66
|
+
}
|
|
17
67
|
/** 新客户流程(workflowId 1269716062340284522)字段表。 */
|
|
18
68
|
export const NEW_CUSTOMER = {
|
|
19
69
|
workflowId: '1269716062340284522',
|
|
@@ -62,6 +62,31 @@ function finalizeRecognizePayload(payload, fileId) {
|
|
|
62
62
|
}
|
|
63
63
|
return payload;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* 发送值快照:`fieldInfo` → `value`(字符串)。
|
|
67
|
+
*
|
|
68
|
+
* 只回传**纯量值的字符串形态**,不改变真正发出去的 payload;
|
|
69
|
+
* 目的是让「实际写了什么」可核对(模型此前看不到收口链的 payload,只能猜)。
|
|
70
|
+
*/
|
|
71
|
+
function sentFieldValues(payload) {
|
|
72
|
+
try {
|
|
73
|
+
const rows = (payload.recognizeResult?.mainTable?.rows ?? []);
|
|
74
|
+
const out = [];
|
|
75
|
+
for (const row of rows) {
|
|
76
|
+
for (const item of (row.fieldResults ?? [])) {
|
|
77
|
+
const value = item?.value;
|
|
78
|
+
out.push({
|
|
79
|
+
fieldInfo: String(item?.fieldInfo ?? ''),
|
|
80
|
+
value: typeof value === 'string' ? value : JSON.stringify(value ?? null),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
65
90
|
/**
|
|
66
91
|
* 执行收口:上传 ∥ 装配 → 存识别记录 → 拼页面地址。
|
|
67
92
|
*
|
|
@@ -161,6 +186,16 @@ export async function runGeneratedSubmit(args) {
|
|
|
161
186
|
attachmentFileId: str(saved.attachmentFileId) || fileId,
|
|
162
187
|
aiExtraId,
|
|
163
188
|
customParams: saved.customParams ?? { aiExtraId, openSource: 'xiaoE' },
|
|
189
|
+
/**
|
|
190
|
+
* 实际发送的字段值快照(`fieldInfo` → `value`,全部是字符串)。
|
|
191
|
+
*
|
|
192
|
+
* 为什么要回传:2026-12-01 反复出现「页面里客户名称显示成 `{id,name}`,到底是谁写的」的争论——
|
|
193
|
+
* 收口链在进程内装配、模型看不到 payload,只能猜。把发送值快照放进响应,
|
|
194
|
+
* 写了什么一望即知,不必再开一次会话去查。
|
|
195
|
+
*/
|
|
196
|
+
sentValues: sentFieldValues(assembled.payload),
|
|
197
|
+
/** 非字符串值被兜底成名称文本的明细(调用方若传了 `{id,name}` 对象,这里必有记录) */
|
|
198
|
+
valueFixups: Array.isArray(saved.valueFixups) ? saved.valueFixups : [],
|
|
164
199
|
pageUrl,
|
|
165
200
|
url: pageUrl,
|
|
166
201
|
workflowUrl: uploadData.url ?? null,
|
|
@@ -76,6 +76,12 @@ export const LEDGER_FILTER_KINDS = {
|
|
|
76
76
|
xsjl2: 'person',
|
|
77
77
|
qy2: 'text',
|
|
78
78
|
hsjg: 'text',
|
|
79
|
+
/**
|
|
80
|
+
* 风险合同(RadioBox,字段 ID `1342854789687115776`,2026-12-01 实测):
|
|
81
|
+
* `0` = 是(实测 `eq 0` → 50 条,首行 `sffxht=是`、`sffxhtSpan=[{"name":"是","id":"0"}]`);`eq 1` → 0 条。
|
|
82
|
+
* ⛔ 该字段**只能用 `eq`**:`like 0/1` 会静默返回全量(实测 341,968 = 无条件总量)。
|
|
83
|
+
*/
|
|
84
|
+
sffxht: 'textList',
|
|
79
85
|
},
|
|
80
86
|
directPerf: {
|
|
81
87
|
hth: 'text',
|
|
@@ -403,7 +409,20 @@ function parseLedgerFilters(pairs, rawJson, viewKey) {
|
|
|
403
409
|
for (const [key, raw] of Object.entries(merged)) {
|
|
404
410
|
const kind = allowed[key];
|
|
405
411
|
if (!kind) {
|
|
406
|
-
|
|
412
|
+
// 2026-12-01 更正:LedgerPage 的 filters **只认台账返回键(dataKey)**——现有键
|
|
413
|
+
// `khmc/hth/htmc/qdrq/htzje/xslx/xsjl2/qy2/hsjg` 全是 dataKey,没有一个 `field_<id>`。
|
|
414
|
+
// `field_<id>` 是**另一条通道**(ebdf 列表卡 comParams 与取数 DSL),⛔ 塞进 LedgerPage 组件不认,
|
|
415
|
+
// 只会表现为"筛选没生效、页面照常打开"这种静默失败。新字段的正解是登记它的 dataKey
|
|
416
|
+
// (用 `contract.performance.list.query` + `includeColumns=true` 读 `data.columns[].dataKey`)。
|
|
417
|
+
throw contractValidationError('ledger_filter_key_invalid', `台账标签 ${viewKey} 没有筛选键 ${pyReprText(key)},可用:${Object.keys(allowed).join('、')}`
|
|
418
|
+
+ '(卡片键必须是台账**返回键 dataKey**,不是 field_<字段ID>;新字段请先读 data.columns[].dataKey 再登记)');
|
|
419
|
+
}
|
|
420
|
+
if (kind === 'textList') {
|
|
421
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
422
|
+
out[key] = list
|
|
423
|
+
.map((item) => (item === null || item === undefined ? '' : typeof item === 'string' ? item.trim() : pyStr(item)))
|
|
424
|
+
.filter((item) => item !== '');
|
|
425
|
+
continue;
|
|
407
426
|
}
|
|
408
427
|
if (kind === 'dateRange' || kind === 'amountRange') {
|
|
409
428
|
if (!Array.isArray(raw) || raw.length !== 2) {
|
|
@@ -535,6 +554,13 @@ function selfCheckLedger(card, viewKey) {
|
|
|
535
554
|
bad.push(`filters 人员键元素必须是含 id(人员主键)与 name(姓名的对象):${key}`);
|
|
536
555
|
}
|
|
537
556
|
}
|
|
557
|
+
else if (kind === 'textList') {
|
|
558
|
+
// 单选/多选类字段(如 风险合同 `sffxht`):接受字符串或字符串数组
|
|
559
|
+
if (!(typeof value === 'string'
|
|
560
|
+
|| (Array.isArray(value) && value.every((item) => typeof item === 'string')))) {
|
|
561
|
+
bad.push(`filters 多值键需要字符串或字符串数组:${key}`);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
538
564
|
else if (typeof value !== 'string') {
|
|
539
565
|
bad.push(`filters 值不是字符串:${key}`);
|
|
540
566
|
}
|
|
@@ -655,7 +681,11 @@ export const contractLedgerCardOperation = {
|
|
|
655
681
|
card,
|
|
656
682
|
selfCheck: problems,
|
|
657
683
|
...(output ? { output } : {}),
|
|
658
|
-
note: '台账页卡:viewKey 决定默认标签,filters 第一层 key 就是 viewKey;渠道订单默认 e-teams(etOrder
|
|
684
|
+
note: '台账页卡:viewKey 决定默认标签,filters 第一层 key 就是 viewKey;渠道订单默认 e-teams(etOrder)。'
|
|
685
|
+
+ '风险合同:键 `sffxht`(该字段的**返回键**,与 khmc/hth 同层),取值 `["0"]` = 是 → '
|
|
686
|
+
+ '`{"menu":"直销合同","title":"风险合同","comParamsJson":"{\\"sffxht\\":[\\"0\\"]}"}`;'
|
|
687
|
+
+ '⛔ 卡片 filters 只认返回键,不认 field_<字段ID>(那是 ebdf 列表卡/取数 DSL 的形态);'
|
|
688
|
+
+ '⛔ 该字段取数时只能用 eq(like 会静默返回全量)。',
|
|
659
689
|
},
|
|
660
690
|
};
|
|
661
691
|
}
|
|
@@ -304,10 +304,12 @@ export function resolveStatSpec(input) {
|
|
|
304
304
|
const explicitPeriods = Array.isArray(input.periods) ? input.periods.map((item) => String(item).trim()) : [];
|
|
305
305
|
let months;
|
|
306
306
|
if (explicitPeriods.length) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
// 2026-12-01 修复:显式 periods 未去重时,同一月份会被 rows 引擎**累加两次**
|
|
308
|
+
// (BI 引擎因按月建桶不受影响 → 两引擎结果不一致)。这里统一去重后排序。
|
|
309
|
+
months = [...new Set(explicitPeriods.map((month) => {
|
|
310
|
+
parseMonth(month, 'periods');
|
|
311
|
+
return month;
|
|
312
|
+
}))].sort();
|
|
311
313
|
}
|
|
312
314
|
else {
|
|
313
315
|
const from = typeof input.from === 'string' ? input.from.trim() : '';
|
|
@@ -616,7 +618,17 @@ export async function runStat(spec, fetcher) {
|
|
|
616
618
|
for (const month of win.previousMonths)
|
|
617
619
|
previousPeriods.push(await runMonth(month, previousAcc));
|
|
618
620
|
const totals = finalize(totalsAcc, metrics);
|
|
619
|
-
|
|
621
|
+
/**
|
|
622
|
+
* 2026-12-01 修复:未请求同比(`compare: none`)时不得伪造去年同期值。
|
|
623
|
+
*
|
|
624
|
+
* `finalize(空 accumulator)` 对 sum / countDistinct 返回 **0**,于是 `previous = 0 → delta = 当前值`,
|
|
625
|
+
* 报表上会出现假的「去年同期 0.00」与「同比 ↑100%」(BI 引擎同情形返回 null,两引擎还不一致)。
|
|
626
|
+
* 未请求对比时把 previous* 一律置 null,与 BI 引擎对齐。
|
|
627
|
+
*/
|
|
628
|
+
const previousTotalsRaw = finalize(previousAcc, metrics);
|
|
629
|
+
const previousTotals = win.compare === 'yoy'
|
|
630
|
+
? previousTotalsRaw
|
|
631
|
+
: Object.fromEntries(Object.keys(previousTotalsRaw).map((key) => [key, null]));
|
|
620
632
|
for (const key of incompleteMetrics) {
|
|
621
633
|
totals[key] = null;
|
|
622
634
|
previousTotals[key] = null;
|