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
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
invoicePartialError,
|
|
23
23
|
invoiceValidationError,
|
|
24
24
|
isInvoiceNetworkError
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-2UV4IZIT.js";
|
|
26
|
+
import "./chunk-FPWCCRKT.js";
|
|
27
27
|
import "./chunk-IZCQU5D5.js";
|
|
28
28
|
import "./chunk-QVKRNL7L.js";
|
|
29
29
|
import "./chunk-Y3C6MDL7.js";
|
|
@@ -113,7 +113,9 @@ var EXT_INFO_FIELDS = [
|
|
|
113
113
|
"from",
|
|
114
114
|
"to",
|
|
115
115
|
"stationGetOn",
|
|
116
|
-
"stationGetOff"
|
|
116
|
+
"stationGetOff",
|
|
117
|
+
"userId",
|
|
118
|
+
"passengerName"
|
|
117
119
|
];
|
|
118
120
|
function asRecord(value) {
|
|
119
121
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
@@ -124,16 +126,16 @@ function text(value) {
|
|
|
124
126
|
}
|
|
125
127
|
function firstText(...values) {
|
|
126
128
|
for (const value of values) {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
+
const candidate2 = text(value);
|
|
130
|
+
if (candidate2) return candidate2;
|
|
129
131
|
}
|
|
130
132
|
return "";
|
|
131
133
|
}
|
|
132
134
|
function invoiceRecordOf(item) {
|
|
133
|
-
const
|
|
134
|
-
const inner = asRecord(
|
|
135
|
-
const hasOwnInvoiceFields =
|
|
136
|
-
return !hasOwnInvoiceFields && Object.keys(inner).length ? inner :
|
|
135
|
+
const record4 = asRecord(item);
|
|
136
|
+
const inner = asRecord(record4.info);
|
|
137
|
+
const hasOwnInvoiceFields = record4.comm_info !== void 0 || record4.fid !== void 0 || record4.number !== void 0;
|
|
138
|
+
return !hasOwnInvoiceFields && Object.keys(inner).length ? inner : record4;
|
|
137
139
|
}
|
|
138
140
|
function parseInvoiceExt(value) {
|
|
139
141
|
if (value && typeof value === "object") return asRecord(value);
|
|
@@ -161,7 +163,10 @@ function invoiceExtInfo(invoice) {
|
|
|
161
163
|
from: firstText(ext.from, invoice.from, passenger.from),
|
|
162
164
|
to: firstText(ext.to, invoice.to, passenger.to),
|
|
163
165
|
stationGetOn: firstText(ext.station_geton, invoice.station_geton, passenger.station_geton),
|
|
164
|
-
stationGetOff: firstText(ext.station_getoff, invoice.station_getoff, passenger.station_getoff)
|
|
166
|
+
stationGetOff: firstText(ext.station_getoff, invoice.station_getoff, passenger.station_getoff),
|
|
167
|
+
// ext.userId 是乘车人身份证号,不是票夹用户 / 登录用户的 ID;保留字符串及末尾 X。
|
|
168
|
+
userId: text(ext.userId),
|
|
169
|
+
passengerName: text(ext.passengerName)
|
|
165
170
|
};
|
|
166
171
|
for (const [key, value] of Object.entries(info)) {
|
|
167
172
|
if (!value) delete info[key];
|
|
@@ -179,6 +184,8 @@ var SUMMARY_ITEM_FIELDS = [
|
|
|
179
184
|
"number",
|
|
180
185
|
"code",
|
|
181
186
|
"typeName",
|
|
187
|
+
"fyn",
|
|
188
|
+
"travel_ids",
|
|
182
189
|
"date",
|
|
183
190
|
"amount",
|
|
184
191
|
"total",
|
|
@@ -221,6 +228,8 @@ function summarizeInvoiceItem(raw) {
|
|
|
221
228
|
number: text2(item.number),
|
|
222
229
|
code: text2(item.code),
|
|
223
230
|
typeName: text2(pro.cname),
|
|
231
|
+
fyn: typeof item.fyn === "string" ? item.fyn : null,
|
|
232
|
+
travel_ids: Array.isArray(item.travel_ids) ? item.travel_ids : [],
|
|
224
233
|
date: text2(pro.date),
|
|
225
234
|
amount: text2(price.amount),
|
|
226
235
|
total: text2(price.total),
|
|
@@ -238,6 +247,7 @@ function summarizeInvoiceItem(raw) {
|
|
|
238
247
|
detailUrl: text2(item.detailUrl)
|
|
239
248
|
};
|
|
240
249
|
for (const [key, value] of Object.entries(summary)) {
|
|
250
|
+
if (key === "fyn" || key === "travel_ids") continue;
|
|
241
251
|
if (value === "" || value === void 0 || value === null) delete summary[key];
|
|
242
252
|
else if (Array.isArray(value) && value.length === 0) delete summary[key];
|
|
243
253
|
}
|
|
@@ -246,6 +256,8 @@ function summarizeInvoiceItem(raw) {
|
|
|
246
256
|
function summarizeListData(data) {
|
|
247
257
|
const items = Array.isArray(data.items) ? data.items : [];
|
|
248
258
|
const summary = {};
|
|
259
|
+
if (data.employeeInfo !== void 0) summary.employeeInfo = data.employeeInfo;
|
|
260
|
+
if (data.preApprovals !== void 0) summary.preApprovals = data.preApprovals;
|
|
249
261
|
for (const key of ["total", "totalAmount", "totalAmountExcludingTax", "hasMore", "scope"]) {
|
|
250
262
|
if (data[key] !== void 0 && data[key] !== null) summary[key] = data[key];
|
|
251
263
|
}
|
|
@@ -256,11 +268,11 @@ function summarizeListData(data) {
|
|
|
256
268
|
var DETAIL_EXTRA_FIELDS = ["issuer", "checkState", "attachments"];
|
|
257
269
|
var DETAIL_ITEM_FIELDS = [...SUMMARY_ITEM_FIELDS, ...DETAIL_EXTRA_FIELDS];
|
|
258
270
|
function attachmentOf(entry) {
|
|
259
|
-
const
|
|
271
|
+
const record4 = asRecord2(entry);
|
|
260
272
|
return {
|
|
261
|
-
id: text2(
|
|
262
|
-
name: text2(
|
|
263
|
-
type: text2(
|
|
273
|
+
id: text2(record4.fileId ?? record4.id),
|
|
274
|
+
name: text2(record4.name),
|
|
275
|
+
type: text2(record4.type)
|
|
264
276
|
};
|
|
265
277
|
}
|
|
266
278
|
function summarizeInvoiceDetailItem(wrapper) {
|
|
@@ -282,6 +294,8 @@ function summarizeInvoiceDetailItem(wrapper) {
|
|
|
282
294
|
function summarizeDetailData(data) {
|
|
283
295
|
const infos = Array.isArray(data.infos) ? data.infos : [];
|
|
284
296
|
const detail = {};
|
|
297
|
+
if (data.employeeInfo !== void 0) detail.employeeInfo = data.employeeInfo;
|
|
298
|
+
if (data.preApprovals !== void 0) detail.preApprovals = data.preApprovals;
|
|
285
299
|
if (data.scope !== void 0 && data.scope !== null) detail.scope = data.scope;
|
|
286
300
|
detail.items = infos.map((entry) => summarizeInvoiceDetailItem(asRecord2(entry)));
|
|
287
301
|
detail.itemCount = detail.items.length;
|
|
@@ -432,7 +446,13 @@ function epochEndDateProperty(label) {
|
|
|
432
446
|
description: `${label}\u3002\u53EF\u4F20 YYYY-MM-DD\uFF08\u6309\u4E1C\u516B\u533A\u5F53\u5929 23:59:59 \u6362\u7B97\uFF09\u6216\u79D2\u7EA7\u65F6\u95F4\u6233\u3002`
|
|
433
447
|
};
|
|
434
448
|
}
|
|
449
|
+
var includePreApprovalsProperty = {
|
|
450
|
+
type: "boolean",
|
|
451
|
+
default: true,
|
|
452
|
+
description: "\u540C\u65F6\u8BFB\u53D6\u6700\u8FD1\u4E00\u4E2A\u65E5\u5386\u6708\u7684\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\uFF0C\u4F9B AI \u6309\u7528\u9014\u5339\u914D\uFF1B\u8BDD\u8D39 / \u6CB9\u8D39\u4E13\u9879\u53CA\u5DF2\u53D6\u5F97\u5019\u9009\u6C60\u540E\u7684\u8865\u5145\u67E5\u7968\u4F20 false\u3002\u4EC5\u63A7\u5236\u672C\u5730\u805A\u5408\uFF0C\u4E0D\u900F\u4F20\u7ED9\u53D1\u7968\u63A5\u53E3\u3002"
|
|
453
|
+
};
|
|
435
454
|
var listProperties = {
|
|
455
|
+
includePreApprovals: includePreApprovalsProperty,
|
|
436
456
|
page_size: { type: "integer", minimum: 1, maximum: 200 },
|
|
437
457
|
start_pos: { type: "integer", minimum: 0, description: "\u670D\u52A1\u7AEF\u5206\u9875\u504F\u79FB\u3002\u7FFB\u9875\u65F6\u6309 page_size \u9012\u589E\uFF0C\u4E0D\u8981\u6309\u8FD4\u56DE\u7684 items \u6761\u6570\u9012\u589E\uFF08items \u5DF2\u5254\u9664\u5168\u989D\u7EA2\u51B2\u7968\uFF0C\u53EF\u80FD\u4E0D\u6EE1\u4E00\u9875\uFF09\u3002" },
|
|
438
458
|
req_type: { type: "integer", enum: [0, 1, 7, 8] },
|
|
@@ -517,6 +537,30 @@ var invoicePartySchema = objectSchema({
|
|
|
517
537
|
company: { type: "string" },
|
|
518
538
|
tcode: { type: "string" }
|
|
519
539
|
}, [], true);
|
|
540
|
+
var invoiceTravelIdsSchema = arrayOf(objectSchema({
|
|
541
|
+
deleteType: { type: "integer" },
|
|
542
|
+
fid: { type: "string" },
|
|
543
|
+
fileId: { type: "string" },
|
|
544
|
+
fileName: { type: "string" },
|
|
545
|
+
fileType: { type: "string" },
|
|
546
|
+
name: { type: "string" },
|
|
547
|
+
total: { type: "string" },
|
|
548
|
+
date: { type: "string" },
|
|
549
|
+
type: { type: "integer" }
|
|
550
|
+
}, [], true), { description: "\u672C\u5F20\u53D1\u7968\u5DF2\u5173\u8054\u7684\u51ED\u8BC1\u5217\u8868\uFF0C\u539F\u6837\u4FDD\u7559 fid\u3001\u6587\u4EF6\u3001\u91D1\u989D\u3001\u65E5\u671F\u53CA\u72B6\u6001\uFF1B\u65E0\u5173\u8054\u4E3A []\uFF0C\u4E0D\u9010\u4E2A\u8865\u67E5\u51ED\u8BC1\u8BE6\u60C5\u3002" });
|
|
551
|
+
var extInfoSchema = objectSchema({
|
|
552
|
+
expenseNote: { type: "string", description: "\u8D39\u7528\u8BF4\u660E\uFF08ext.expenseDesc\uFF09\uFF0C\u5982\u300C\u4E0A\u6D77-\u6B66\u6C49\u300D" },
|
|
553
|
+
content: { type: "string", description: "\u6D88\u8D39\u5185\u5BB9\uFF08ext.content\uFF1B\u4E3A\u7A7A\u65F6\u53D6 ext.products[].name\uFF09" },
|
|
554
|
+
city: { type: "string", description: "\u57CE\u5E02\uFF08ext.city\uFF09" },
|
|
555
|
+
province: { type: "string", description: "\u7701\u4EFD\uFF08ext.province\uFF0C\u4E3A\u7A7A\u65F6\u53D6\u7968\u9762 province\uFF09" },
|
|
556
|
+
comment: { type: "string", description: "\u5907\u6CE8\uFF08ext.comment\uFF09\uFF0C\u5E38\u5199\u51FA\u5DEE\u5730\u3001\u8BA2\u5355\u53F7\u548C\u884C\u7A0B" },
|
|
557
|
+
from: { type: "string", description: "\u51FA\u53D1\u5730\uFF08ext.from \u2192 \u7968\u9762 from \u2192 ext.passengersService[0].from\uFF09" },
|
|
558
|
+
to: { type: "string", description: "\u5230\u8FBE\u5730\uFF08ext.to \u2192 \u7968\u9762 to \u2192 ext.passengersService[0].to\uFF09" },
|
|
559
|
+
stationGetOn: { type: "string", description: "\u4E0A\u8F66\u7AD9\uFF08ext.station_geton\uFF09" },
|
|
560
|
+
stationGetOff: { type: "string", description: "\u4E0B\u8F66\u7AD9\uFF08ext.station_getoff\uFF09" },
|
|
561
|
+
userId: { type: "string", description: "\u6EF4\u6EF4\u4E58\u8F66\u4EBA\u8EAB\u4EFD\u8BC1\u53F7\uFF08ext.userId\uFF09\uFF0C\u6309\u5B57\u7B26\u4E32\u4FDD\u7559\uFF1B\u4E0D\u662F\u767B\u5F55\u7528\u6237 ID\u3002" },
|
|
562
|
+
passengerName: { type: "string", description: "\u6EF4\u6EF4\u4E58\u8F66\u4EBA\u59D3\u540D\uFF08ext.passengerName\uFF09\u3002" }
|
|
563
|
+
});
|
|
520
564
|
var invoiceInfoSchema = objectSchema({
|
|
521
565
|
id: { type: "string", description: "\u53D1\u7968\u4E1A\u52A1 ID\uFF1B\u5217\u8868\u548C\u8BE6\u60C5\u8FD4\u56DE\u65F6\u4E0E fid \u4FDD\u6301\u4E00\u81F4\u3002" },
|
|
522
566
|
fid: { type: "string" },
|
|
@@ -558,18 +602,53 @@ var invoiceInfoSchema = objectSchema({
|
|
|
558
602
|
type: "string",
|
|
559
603
|
description: "JSON \u5B57\u7B26\u4E32\u5F62\u5F0F\u7684\u7968\u79CD\u6269\u5C55\u4FE1\u606F\uFF1B\u89E3\u6790\u540E\u53EF\u5305\u542B ttax\u3001products \u7B49\u5B57\u6BB5\u3002"
|
|
560
604
|
},
|
|
605
|
+
extInfo: { ...extInfoSchema, description: "\u5DF2\u89E3\u6790\u7684 ext \u8BED\u4E49\u5B57\u6BB5\uFF0C\u7A7A\u503C\u7701\u952E\uFF1B\u539F\u59CB ext \u5B57\u7B26\u4E32\u4ECD\u4FDD\u7559" },
|
|
561
606
|
currency: { type: "string" },
|
|
562
607
|
currencyName: { type: "string" },
|
|
563
|
-
fylx: { type: "string" }
|
|
608
|
+
fylx: { type: "string", description: "\u539F\u59CB\u8D39\u7528\u7C7B\u578B ID\uFF0C\u4FDD\u7559\u517C\u5BB9\uFF1B\u8BFB\u53D6\u4E2D\u6587\u540D\u79F0\u4F7F\u7528 fyn\u3002" },
|
|
609
|
+
fyn: { type: ["string", "null"], description: "\u6309 /api/inc/syncFylx \u7684 fyid \u2192 fyn \u6620\u5C04\u5F97\u5230\u7684\u8D39\u7528\u7C7B\u578B\u4E2D\u6587\u540D\u79F0\uFF1B\u65E0\u6CD5\u6620\u5C04\u4E3A null \u5E76\u9644 warnings\uFF0C\u4E0D\u7528\u7968\u9762 kind \u731C\u6D4B\u3002" },
|
|
610
|
+
travel_ids: invoiceTravelIdsSchema
|
|
564
611
|
}, [], true);
|
|
565
612
|
var invoiceResultItemSchema = objectSchema({
|
|
566
613
|
info: invoiceInfoSchema,
|
|
567
614
|
ret: retSchema
|
|
568
615
|
}, ["info", "ret"], true);
|
|
616
|
+
var employeeInfoSchema = {
|
|
617
|
+
...objectSchema({
|
|
618
|
+
department: arrayOf(objectSchema({ id: { type: "string" }, name: { type: "string" } }, ["id", "name"])),
|
|
619
|
+
mobile: { type: ["string", "null"] },
|
|
620
|
+
location: arrayOf(objectSchema({ id: { type: "string" }, name: { type: "string" } }, ["id", "name"]))
|
|
621
|
+
}, ["department", "mobile", "location"]),
|
|
622
|
+
type: ["object", "null"],
|
|
623
|
+
description: "\u5F53\u524D\u767B\u5F55\u4EBA\u5458\u4FE1\u606F\uFF0C\u72EC\u7ACB\u4E8E\u53D1\u7968\u660E\u7EC6\uFF1Bdepartment=\u90E8\u95E8\uFF0Cmobile=\u624B\u673A\u53F7\uFF0Clocation=\u529E\u516C\u6240\u5728\u5730\u3002\u5B9E\u4F53\u4EC5\u4FDD\u7559 id/name\uFF1B\u63A5\u53E3\u4E0D\u53EF\u7528\u65F6\u4E3A null\uFF0C\u5E76\u9644 warnings\u3002\u6BCF\u6279\u53EA\u67E5\u8BE2\u4E00\u6B21\u4EBA\u5458\u5361\u7247\u3002"
|
|
624
|
+
};
|
|
625
|
+
var preApprovalCandidateSchema = objectSchema({
|
|
626
|
+
requestid: { type: "string" },
|
|
627
|
+
workflowid: { type: "string" },
|
|
628
|
+
requestname: { type: "string" },
|
|
629
|
+
flowStatus: { type: ["integer", "string", "null"], description: "\u670D\u52A1\u7AEF\u539F\u59CB\u72B6\u6001\u3002\u5DF2\u660E\u786E\u5BA1\u6279\u4E2D\u6216\u5BA1\u6279\u5B8C\u6210\u7684\u7533\u8BF7\u5747\u6EE1\u8DB3\u5DF2\u63D0\u4EA4\u72B6\u6001\u8981\u6C42\uFF0C\u65E0\u987B\u7B49\u5F85\u5BA1\u6279\u901A\u8FC7\uFF1B6 \u4EC5\u662F\u5DF2\u77E5\u5B8C\u6210\u4EE3\u7801\uFF0C\u4E0D\u662F\u552F\u4E00\u6709\u6548\u72B6\u6001\u3002\u8349\u7A3F/\u672A\u63D0\u4EA4\u4E0D\u53EF\u7528\uFF1B\u542B\u4E49\u4E0D\u660E\u6216\u7F3A\u5931\u7684\u72B6\u6001\u6309\u771F\u5B9E\u7533\u8BF7 ID \u5B9A\u5411\u6838\u9A8C\uFF0C\u4E0D\u81EA\u884C\u6620\u5C04\uFF0C\u4E5F\u4E0D\u76F4\u63A5\u5F53\u4F5C\u65E0\u6548\u7533\u8BF7\u3002\u72B6\u6001\u4ECD\u4E0D\u80FD\u66FF\u4EE3\u672C\u4EBA\u5F52\u5C5E\u3001\u6D41\u7A0B\u7C7B\u578B\u53CA\u7528\u9014\u6821\u9A8C\u3002" },
|
|
630
|
+
creatorId: { type: ["string", "integer", "null"] },
|
|
631
|
+
creatorName: { type: ["string", "null"] },
|
|
632
|
+
createTime: { type: ["string", "integer", "null"] }
|
|
633
|
+
}, ["requestid", "workflowid", "requestname"]);
|
|
634
|
+
var preApprovalsSchema = objectSchema({
|
|
635
|
+
status: { type: "string", enum: ["complete", "partial", "unavailable", "skipped"], description: "\u4EC5\u8868\u793A\u5019\u9009\u8BFB\u53D6\u5B8C\u6574\u6027\uFF0C\u4E0D\u8868\u793A\u7533\u8BF7\u5DF2\u901A\u8FC7\u4E1A\u52A1\u6821\u9A8C\u3002" },
|
|
636
|
+
items: { anyOf: [arrayOf(preApprovalCandidateSchema), { type: "null" }] },
|
|
637
|
+
query: objectSchema({
|
|
638
|
+
cusCreateDateStart: { type: "string" },
|
|
639
|
+
cusCreateDateEnd: { type: "string", description: "\u5317\u4EAC\u65F6\u95F4\u4E1A\u52A1\u7ED3\u675F\u65E5\uFF0C\u5BF9\u5916\u4E0D\u52A0\u4E00\u5929\u3002" },
|
|
640
|
+
workflowIds: arrayOf({ type: "string", enum: ["100003460000000746", "100003460000000046", "100003460000000418", "100003460000000045"] }),
|
|
641
|
+
currentUserId: { type: "string", description: "\u4EC5\u771F\u5B9E\u4F1A\u8BDD\u63D0\u4F9B\u4EBA\u5458 ID \u65F6\u8FD4\u56DE\uFF0C\u7528\u4E8E\u4E0E\u7533\u8BF7 creatorId \u6838\u9A8C\u5F52\u5C5E\uFF1B\u4E0D\u4F20\u7ED9\u7533\u8BF7\u63A5\u53E3\u3002" }
|
|
642
|
+
}, ["cusCreateDateStart", "cusCreateDateEnd", "workflowIds"]),
|
|
643
|
+
hasMore: { type: ["boolean", "null"] },
|
|
644
|
+
reason: { type: "string" }
|
|
645
|
+
}, ["status", "items", "hasMore"]);
|
|
569
646
|
var invoiceDetailOutputSchema = objectSchema({
|
|
647
|
+
employeeInfo: employeeInfoSchema,
|
|
648
|
+
preApprovals: preApprovalsSchema,
|
|
570
649
|
infos: arrayOf(invoiceResultItemSchema),
|
|
571
650
|
res_base: responseBaseSchema
|
|
572
|
-
}, ["infos", "res_base"], true);
|
|
651
|
+
}, ["employeeInfo", "preApprovals", "infos", "res_base"], true);
|
|
573
652
|
var invoicePreviewSchema = objectSchema({
|
|
574
653
|
fid: { type: "string" },
|
|
575
654
|
code: { type: "string" },
|
|
@@ -610,40 +689,24 @@ var resultEnvelopeOutput = (dataSchema = rawValue) => objectSchema({
|
|
|
610
689
|
data: dataSchema,
|
|
611
690
|
workflow: workflowSchema
|
|
612
691
|
}, ["result", "data", "workflow"]);
|
|
613
|
-
var extInfoSchema = objectSchema({
|
|
614
|
-
expenseNote: { type: "string", description: "\u8D39\u7528\u8BF4\u660E\uFF08ext.expenseDesc\uFF09\uFF0C\u5982\u300C\u4E0A\u6D77-\u6B66\u6C49\u300D" },
|
|
615
|
-
content: { type: "string", description: "\u6D88\u8D39\u5185\u5BB9\uFF08ext.content\uFF1B\u4E3A\u7A7A\u65F6\u53D6 ext.products[].name\uFF09" },
|
|
616
|
-
city: { type: "string", description: "\u57CE\u5E02\uFF08ext.city\uFF09" },
|
|
617
|
-
province: { type: "string", description: "\u7701\u4EFD\uFF08ext.province\uFF0C\u4E3A\u7A7A\u65F6\u53D6\u7968\u9762 province\uFF09" },
|
|
618
|
-
comment: { type: "string", description: "\u5907\u6CE8\uFF08ext.comment\uFF09\uFF0C\u5E38\u5199\u51FA\u5DEE\u5730\u3001\u8BA2\u5355\u53F7\u548C\u884C\u7A0B" },
|
|
619
|
-
from: { type: "string", description: "\u51FA\u53D1\u5730\uFF08ext.from \u2192 \u7968\u9762 from \u2192 ext.passengersService[0].from\uFF09" },
|
|
620
|
-
to: { type: "string", description: "\u5230\u8FBE\u5730\uFF08ext.to \u2192 \u7968\u9762 to \u2192 ext.passengersService[0].to\uFF09" },
|
|
621
|
-
stationGetOn: { type: "string", description: "\u4E0A\u8F66\u7AD9\uFF08ext.station_geton\uFF09" },
|
|
622
|
-
stationGetOff: { type: "string", description: "\u4E0B\u8F66\u7AD9\uFF08ext.station_getoff\uFF09" }
|
|
623
|
-
});
|
|
624
|
-
var listInvoiceItemSchema = {
|
|
625
|
-
...invoiceInfoSchema,
|
|
626
|
-
properties: {
|
|
627
|
-
...invoiceInfoSchema.properties,
|
|
628
|
-
extInfo: { ...extInfoSchema, description: "\u5DF2\u89E3\u6790\u7684 ext \u8BED\u4E49\u5B57\u6BB5\uFF0C\u7A7A\u503C\u7701\u952E\uFF1B\u539F\u59CB ext \u5B57\u7B26\u4E32\u4ECD\u4FDD\u7559" }
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
692
|
var listOutputSchema = objectSchema({
|
|
632
|
-
|
|
693
|
+
employeeInfo: employeeInfoSchema,
|
|
694
|
+
preApprovals: preApprovalsSchema,
|
|
695
|
+
items: arrayOf(invoiceInfoSchema, { description: "\u672C\u9875\u53D1\u7968\uFF0C\u5DF2\u5254\u9664\u5168\u989D\u7EA2\u51B2\u7968\uFF08comm_info.pro.status=8\uFF09\uFF0C\u6761\u6570\u53EF\u80FD\u5C11\u4E8E page_size\u3002" }),
|
|
633
696
|
total: { type: "integer", description: "\u670D\u52A1\u7AEF\u6C47\u603B\u7684\u603B\u5F20\u6570\uFF0C\u542B items \u91CC\u5DF2\u5254\u9664\u7684\u5168\u989D\u7EA2\u51B2\u7968\u3002" },
|
|
634
697
|
totalAmount: { type: "string", description: "\u670D\u52A1\u7AEF\u6C47\u603B\u7684\u4EF7\u7A0E\u5408\u8BA1\uFF0C\u542B\u5DF2\u5254\u9664\u7684\u5168\u989D\u7EA2\u51B2\u7968\u3002" },
|
|
635
698
|
totalAmountExcludingTax: { type: "string", description: "\u670D\u52A1\u7AEF\u6C47\u603B\u7684\u4E0D\u542B\u7A0E\u5408\u8BA1\uFF0C\u542B\u5DF2\u5254\u9664\u7684\u5168\u989D\u7EA2\u51B2\u7968\u3002" },
|
|
636
699
|
hasMore: { type: "boolean", description: "\u662F\u5426\u8FD8\u6709\u4E0B\u4E00\u9875\u3002\u5224\u65AD\u662F\u5426\u7FFB\u9875\u53EA\u770B\u5B83\uFF0C\u4E0D\u8981\u7528 items \u6761\u6570\u662F\u5426\u7B49\u4E8E page_size \u63A8\u65AD\u3002" },
|
|
637
700
|
scope: { type: "string", enum: ["personal", "enterprise"] }
|
|
638
|
-
}, ["items", "total", "totalAmount", "totalAmountExcludingTax", "hasMore", "scope"]);
|
|
701
|
+
}, ["employeeInfo", "preApprovals", "items", "total", "totalAmount", "totalAmountExcludingTax", "hasMore", "scope"]);
|
|
639
702
|
var summaryOutputView = {
|
|
640
703
|
name: "summary",
|
|
641
|
-
description: "\u8BED\u4E49\u5316\u5E73\u8868\uFF0C\u7701\u7565\u7A7A\u503C\u5B57\u6BB5\uFF1B\u5217\u8868\u7EA7\u6C47\u603B\u5728\u524D\u3001items \u5728\u540E\uFF0C\u5E76\u9644 itemCount\u3002\u542B
|
|
704
|
+
description: "\u8BED\u4E49\u5316\u5E73\u8868\uFF0C\u7701\u7565\u5E38\u89C4\u7A7A\u503C\u5B57\u6BB5\uFF1B\u5217\u8868\u7EA7\u6C47\u603B\u5728\u524D\u3001items \u5728\u540E\uFF0C\u5E76\u9644 itemCount\u3002\u542B fyn\uFF08\u8D39\u7528\u7C7B\u578B\u4E2D\u6587\u540D\uFF09\u3001travel_ids\uFF08\u76F8\u5173\u51ED\u8BC1\uFF0C\u65E0\u5173\u8054\u4E3A []\uFF09\u53CA ext \u7684\u8D39\u7528\u8BF4\u660E\u3001\u57CE\u5E02\u3001\u5907\u6CE8\u3001\u8D77\u6B62\u5730\u3001\u4E58\u8F66\u4EBA userId / passengerName \u7B49\u3002\u8D39\u7528\u7C7B\u578B\u65E0\u6CD5\u6620\u5C04\u65F6\u4FDD\u7559 fyn:null\uFF0C\u8BF4\u660E\u89C1 warnings\u3002\u9876\u5C42\u4FDD\u7559 employeeInfo \u5F53\u524D\u4EBA\u5458\u4FE1\u606F\u53CA preApprovals \u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\uFF0C\u4E0D\u653E\u5165\u660E\u7EC6\u3002\u7528 CLI \u7684 --view summary \u542F\u7528\u3002",
|
|
642
705
|
itemFields: SUMMARY_ITEM_FIELDS
|
|
643
706
|
};
|
|
644
707
|
var detailOutputView = {
|
|
645
708
|
name: "detail",
|
|
646
|
-
description: "\u5355\u5F20\u53D1\u7968\u7684\u8BED\u4E49\u8BE6\u60C5\uFF1Asummary \u5B57\u6BB5\uFF08\u542B
|
|
709
|
+
description: "\u5355\u5F20\u53D1\u7968\u7684\u8BED\u4E49\u8BE6\u60C5\uFF1Asummary \u5B57\u6BB5\uFF08\u542B fyn \u4E2D\u6587\u8D39\u7528\u7C7B\u578B\u3001travel_ids \u76F8\u5173\u51ED\u8BC1\u3001ext \u8D39\u7528\u8BF4\u660E\u3001\u884C\u7A0B\u53CA\u4E58\u8F66\u4EBA userId / passengerName\uFF09\uFF0C\u5916\u52A0 attachments\uFF08\u53D1\u7968\u81EA\u8EAB\u9644\u4EF6\uFF09\u3001issuer\uFF08\u5F00\u7968\u4EBA\uFF09\u3001checkState\uFF08\u67E5\u9A8C\u6807\u8BB0\uFF0C0=\u672A\u67E5\u9A8C\uFF0C\u4E0E\u7968\u9762 valid \u4E0D\u662F\u4E00\u4E2A\u53E3\u5F84\uFF09\u3002\u9876\u5C42\u4FDD\u7559 employeeInfo \u5F53\u524D\u4EBA\u5458\u4FE1\u606F\u53CA preApprovals \u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u3002\u7528 CLI \u7684 --view detail \u542F\u7528\u3002",
|
|
647
710
|
itemFields: DETAIL_ITEM_FIELDS
|
|
648
711
|
};
|
|
649
712
|
var uploadOutputSchema = objectSchema({
|
|
@@ -791,20 +854,6 @@ var workflowResolveDataSchema = objectSchema({
|
|
|
791
854
|
workFlowName: { type: "string" }
|
|
792
855
|
}, ["workFlowId", "workFlowName"]))
|
|
793
856
|
}, [], true);
|
|
794
|
-
var employeeSchema = objectSchema({
|
|
795
|
-
id: { type: "string" },
|
|
796
|
-
name: { type: "string" }
|
|
797
|
-
}, ["id", "name"], true);
|
|
798
|
-
var employeeSuperiorsDataSchema = objectSchema({
|
|
799
|
-
currentEmployee: employeeSchema,
|
|
800
|
-
allSuperiors: arrayOf(employeeSchema)
|
|
801
|
-
}, ["currentEmployee", "allSuperiors"], true);
|
|
802
|
-
var fieldSearchItemSchema = objectSchema({
|
|
803
|
-
id: { type: "string" },
|
|
804
|
-
name: { type: "string" },
|
|
805
|
-
value: { type: "string" }
|
|
806
|
-
}, ["id", "name"], true);
|
|
807
|
-
var fieldSearchItemsSchema = arrayOf(fieldSearchItemSchema);
|
|
808
857
|
var reimCandidateItemSchema = objectSchema({
|
|
809
858
|
fid: { type: "string" },
|
|
810
859
|
number: { type: "string" },
|
|
@@ -813,11 +862,17 @@ var reimCandidateItemSchema = objectSchema({
|
|
|
813
862
|
buyer: { type: "string" },
|
|
814
863
|
payer: { type: "string" },
|
|
815
864
|
typeName: { type: "string" },
|
|
865
|
+
content: { type: "string", description: "\u6D88\u8D39\u5185\u5BB9\uFF0C\u53D6\u7968\u9762 pro.content\uFF0C\u7F3A\u5931\u65F6\u4ECE ext.content / ext.products \u63D0\u53D6\u3002" },
|
|
866
|
+
extInfo: { ...extInfoSchema, description: "\u5DF2\u89E3\u6790\u7684\u57CE\u5E02\u3001\u8D77\u6B62\u5730\u70B9\u3001\u7AD9\u70B9\u3001\u884C\u7A0B\u8BF4\u660E\u7B49\uFF1B\u4F9B\u51FA\u5DEE\u76EE\u7684\u5730\u53CA\u529E\u516C\u8D77\u70B9\u4EA4\u901A\u5019\u9009\u7B5B\u9009\u590D\u7528\uFF0C\u7A7A\u503C\u7701\u952E\u3002" },
|
|
867
|
+
consumptionTime: { type: ["number", "string"], description: "\u539F\u59CB\u6D88\u8D39\u65F6\u95F4 modify_info.cstm\uFF0C\u79D2\u7EA7\u65F6\u95F4\u6233\uFF1B\u4EC5\u771F\u5B9E\u503C\u5B58\u5728\u65F6\u8FD4\u56DE\uFF0C\u4E0D\u4EE5\u5F00\u7968\u65E5\u4EE3\u66FF\u3002" },
|
|
868
|
+
travel_ids: invoiceTravelIdsSchema,
|
|
816
869
|
status: { type: "integer" },
|
|
817
870
|
valid: { type: "integer" },
|
|
818
871
|
reimRequests: arrayOf({ type: "string" })
|
|
819
872
|
}, ["fid", "number", "total"], true);
|
|
820
873
|
var reimCandidatesOutputSchema = objectSchema({
|
|
874
|
+
employeeInfo: employeeInfoSchema,
|
|
875
|
+
preApprovals: preApprovalsSchema,
|
|
821
876
|
total: { type: "integer" },
|
|
822
877
|
fetched: { type: "integer" },
|
|
823
878
|
hasMore: { type: "boolean" },
|
|
@@ -831,7 +886,7 @@ var reimCandidatesOutputSchema = objectSchema({
|
|
|
831
886
|
}, ["availableCount", "assignedCount", "availableAmount", "assignedAmount"]),
|
|
832
887
|
warnings: arrayOf({ type: "string" }),
|
|
833
888
|
workflow: workflowSchema
|
|
834
|
-
}, ["total", "fetched", "hasMore", "available", "assigned", "summary", "warnings", "workflow"]);
|
|
889
|
+
}, ["employeeInfo", "preApprovals", "total", "fetched", "hasMore", "available", "assigned", "summary", "warnings", "workflow"]);
|
|
835
890
|
var nullableText = { type: ["string", "null"] };
|
|
836
891
|
var relationIdNameSchema = {
|
|
837
892
|
type: ["object", "null"],
|
|
@@ -840,7 +895,7 @@ var relationIdNameSchema = {
|
|
|
840
895
|
properties: {
|
|
841
896
|
id: { type: "string" },
|
|
842
897
|
name: { type: "string" },
|
|
843
|
-
value: { type: "string", description: "\u540D\u79F0(ID)\
|
|
898
|
+
value: { type: "string", description: "\u540D\u79F0(ID) \u5F62\u5F0F\u7684\u767B\u8BB0\u5C55\u793A\u503C\u3002AI \u62A5\u9500\u9875\u9762\u6D4F\u89C8\u5B57\u6BB5\u53EA\u53D6\u540C\u5BF9\u8C61\u7684\u771F\u5B9E id\uFF0C\u7F16\u7801\u4E3A ##ID\uFF1B\u4E0D\u539F\u6837\u586B\u5199 value\uFF0C\u4E0D\u62FC\u63A5\u540D\u79F0\u3002\u67E5\u8BE2\u8FD4\u56DE\u503C\u672C\u8EAB\u4FDD\u6301\u4E0D\u53D8\u3002" }
|
|
844
899
|
}
|
|
845
900
|
};
|
|
846
901
|
var relationPreApprovalSchema = {
|
|
@@ -850,7 +905,7 @@ var relationPreApprovalSchema = {
|
|
|
850
905
|
properties: {
|
|
851
906
|
requestId: { type: "string", description: "\u4E8B\u524D\u7533\u8BF7\u6D41\u7A0B requestid" },
|
|
852
907
|
requestName: { type: "string", description: "\u4E8B\u524D\u7533\u8BF7\u6D41\u7A0B\u6807\u9898\uFF08\u5DF2\u53BB\u6389\u6D4F\u89C8\u6309\u94AE\u672B\u5C3E\u7684\u300C (\u76F8\u5173\u5BA2\u6237:\u2026)\u300D\u6458\u8981\uFF09" },
|
|
853
|
-
value: { type: "string", description: "{requestName}({requestId})\
|
|
908
|
+
value: { type: "string", description: "{requestName}({requestId}) \u5F62\u5F0F\u7684\u7533\u8BF7\u5C55\u793A\u503C\u3002AI \u62A5\u9500\u660E\u7EC6\u300C\u76F8\u5173\u6D41\u7A0B\u300D\u4EC5\u4EE5\u771F\u5B9E requestId \u7F16\u7801\u4E3A ##requestId\uFF0C\u6309\u5DF2\u6838\u9A8C\u7533\u8BF7\u9010\u53D1\u7968\u884C\u91CD\u590D\uFF1B\u4E0D\u76F4\u63A5\u586B\u5199 value \u6216\u9644\u5E26\u6807\u9898\u3002" },
|
|
854
909
|
displayName: { type: "string", description: "\u6D4F\u89C8\u6309\u94AE\u539F\u59CB\u5C55\u793A\u540D" },
|
|
855
910
|
createTime: nullableText
|
|
856
911
|
}
|
|
@@ -859,21 +914,6 @@ var relationGroupsSchema = arrayOf(objectSchema({
|
|
|
859
914
|
value: { type: "string" },
|
|
860
915
|
fids: arrayOf({ type: "string" })
|
|
861
916
|
}, ["value", "fids"]));
|
|
862
|
-
var relationSearchItemSchema = objectSchema({
|
|
863
|
-
id: { type: "string", description: "\u76F8\u5173\u5BA2\u6237 / \u76F8\u5173\u9879\u76EE ID\uFF0C\u767B\u8BB0\u65F6\u4F20 customerId / projectId" },
|
|
864
|
-
name: { type: "string", description: "\u76F8\u5173\u5BA2\u6237 / \u76F8\u5173\u9879\u76EE\u540D\u79F0\uFF0C\u767B\u8BB0\u65F6\u4F20 customerName / projectName" }
|
|
865
|
-
}, ["id", "name"]);
|
|
866
|
-
var relationSearchOutputSchema = objectSchema({
|
|
867
|
-
target: { type: "string", enum: ["customer", "project"] },
|
|
868
|
-
keywords: { type: "string" },
|
|
869
|
-
match: { type: "string", enum: ["unique", "multiple", "none"] },
|
|
870
|
-
items: arrayOf(relationSearchItemSchema),
|
|
871
|
-
selected: {
|
|
872
|
-
anyOf: [relationSearchItemSchema, { type: "null" }],
|
|
873
|
-
description: "\u53EA\u641C\u5230\u4E00\u6761\uFF0C\u6216\u6709\u4E00\u6761\u540D\u79F0\u4E0E keywords \u5B8C\u5168\u4E00\u81F4\u65F6\u7ED9\u51FA\uFF1B\u5426\u5219\u4E3A null\uFF0C\u8BA9\u7528\u6237\u4ECE items \u91CC\u9009"
|
|
874
|
-
},
|
|
875
|
-
workflow: workflowSchema
|
|
876
|
-
}, ["target", "keywords", "match", "items", "selected", "workflow"]);
|
|
877
917
|
var relationSaveOutputSchema = objectSchema({
|
|
878
918
|
saved: { type: "boolean", description: "\u5168\u90E8\u53D1\u7968\u90FD\u8FD4\u56DE\u300C\u5173\u8054\u6210\u529F\u300D\u65F6\u4E3A true" },
|
|
879
919
|
savedCount: { type: "integer" },
|
|
@@ -956,10 +996,32 @@ var issuingContractDetailOutputSchema = objectSchema({
|
|
|
956
996
|
}, ["docId", "fileId", "name"])),
|
|
957
997
|
contractDocIds: { ...nullableText, description: "\u5168\u90E8\u6587\u6863 id\uFF0C\u82F1\u6587\u9017\u53F7\u5206\u9694\u3002\u5F00\u7968\u7533\u8BF7\u300C\u5408\u540C\u6587\u672C\u300D\u4E0D\u8981\u586B\u8FD9\u4E2A\u5B57\u7B26\u4E32" }
|
|
958
998
|
}, ["requestId", "requestName", "workflowName", "customer", "customerSource", "contractDocuments", "contractDocIds"]);
|
|
999
|
+
var issuingRedRequestsOutputSchema = objectSchema({
|
|
1000
|
+
items: arrayOf(objectSchema({
|
|
1001
|
+
requestId: { type: "string", description: "\u84DD\u5B57\u5F00\u7968\u7533\u8BF7\u6D41\u7A0B ID\uFF0C\u7528\u4E8E\u7EA2\u51B2\u8868\u5355\u300C\u84DD\u5B57\u53D1\u7968\u5F00\u7968\u6D41\u7A0B\u300D\uFF1B\u4E0D\u662F\u5408\u540C\u5BA1\u6279\u6D41\u7A0B ID" },
|
|
1002
|
+
requestName: nullableText,
|
|
1003
|
+
title: nullableText,
|
|
1004
|
+
name: nullableText,
|
|
1005
|
+
requestMark: nullableText,
|
|
1006
|
+
workflowId: nullableText,
|
|
1007
|
+
workflowName: nullableText,
|
|
1008
|
+
flowStatus: nullableText,
|
|
1009
|
+
flowStatusCode: nullableText,
|
|
1010
|
+
creator: nullableText,
|
|
1011
|
+
creatorId: nullableText,
|
|
1012
|
+
createTime: nullableText,
|
|
1013
|
+
finished: { type: ["boolean", "null"], description: "\u4EC5\u53D6\u63A5\u53E3\u660E\u786E\u7684\u5B8C\u6210\u6807\u8BC6\uFF0C\u4E0D\u636E\u6B64\u7B5B\u9664\u5019\u9009\u6216\u5224\u65AD\u53EF\u5426\u7EA2\u51B2" }
|
|
1014
|
+
}, ["requestId", "requestName", "title", "name", "requestMark", "workflowId", "workflowName", "flowStatus", "flowStatusCode", "creator", "creatorId", "createTime", "finished"])),
|
|
1015
|
+
count: { type: "integer", description: "\u672C\u9875\u5019\u9009\u6761\u6570" },
|
|
1016
|
+
current: { type: "integer" },
|
|
1017
|
+
pageSize: { type: "integer" },
|
|
1018
|
+
hasMore: { type: "boolean", description: "\u4F18\u5148\u6309\u660E\u786E\u5206\u9875\u5143\u6570\u636E\uFF1B\u63A5\u53E3\u672A\u8FD4\u56DE\u65F6\u6EE1\u9875\u89C6\u4E3A\u53EF\u80FD\u8FD8\u6709\u4E0B\u4E00\u9875" },
|
|
1019
|
+
total: { type: "integer", description: "\u4EC5\u5728\u63A5\u53E3\u660E\u786E\u8FD4\u56DE\u603B\u6570\u65F6\u63D0\u4F9B" }
|
|
1020
|
+
}, ["items", "count", "current", "pageSize", "hasMore"]);
|
|
959
1021
|
var OPERATION_SUMMARIES = {
|
|
960
|
-
"invoice.list": "\u5206\u9875\u67E5\u8BE2\u672C\u4EBA\u7968\u5939\
|
|
961
|
-
"invoice.enterprise.list": "\u5206\u9875\u67E5\u8BE2\u4F01\u4E1A\u7968\u5939\
|
|
962
|
-
"invoice.get": "\u6309 fid \u6216\u7968\u53F7\u53D6\
|
|
1022
|
+
"invoice.list": "\u5206\u9875\u67E5\u8BE2\u672C\u4EBA\u7968\u5939\u53D1\u7968\uFF0C\u540C\u65F6\u8FD4\u56DE\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u4F9B AI \u5339\u914D\uFF1B\u8BDD\u8D39/\u6CB9\u8D39\u4E13\u9879\u53EF\u5173\u95ED\u7533\u8BF7\u67E5\u8BE2",
|
|
1023
|
+
"invoice.enterprise.list": "\u5206\u9875\u67E5\u8BE2\u4F01\u4E1A\u7968\u5939\u53D1\u7968\uFF0C\u540C\u65F6\u8FD4\u56DE\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u4F9B AI \u5339\u914D\uFF1B\u8FC7\u6EE4\u6761\u4EF6\u540C\u7968\u5939\u5217\u8868",
|
|
1024
|
+
"invoice.get": "\u6309 fid \u6216\u7968\u53F7\u53D6\u53D1\u7968\u8BE6\u60C5\uFF0C\u540C\u65F6\u8FD4\u56DE\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u4F9B AI \u5339\u914D",
|
|
963
1025
|
"invoice.upload": "\u4E0A\u4F20\u672C\u5730\u6587\u4EF6\u6216 URL \u5230\u53D1\u7968\u7CFB\u7EDF\uFF08\u4EA7\u51FA fileId\uFF0C\u5C1A\u4E0D\u5165\u7968\u5939\uFF09\uFF1B\u5165\u53C2 file/url",
|
|
964
1026
|
"invoice.ocr.preview": "\u5BF9\u4E0A\u4F20\u7684\u6587\u4EF6\u505A OCR \u9884\u89C8\uFF08\u4E0D\u843D\u5E93\uFF09\uFF1B\u5165\u53C2 file/url\uFF0C\u53EF\u6307\u5B9A upload/is_save",
|
|
965
1027
|
"invoice.upload-and-validate": "\u4E0A\u4F20\u5E76\u505A\u53D1\u7968\u67E5\u9A8C\uFF08\u771F\u5047\u6821\u9A8C\uFF09\uFF0C\u8FD4\u56DE\u67E5\u9A8C\u7ED3\u679C",
|
|
@@ -976,15 +1038,14 @@ var OPERATION_SUMMARIES = {
|
|
|
976
1038
|
"invoice.reim.requests.list": "\u5206\u9875\u67E5\u8BE2\u53EF\u62A5\u9500\u7684\u6D41\u7A0B\u5355\uFF08\u62A5\u9500\u7533\u8BF7\u5217\u8868\uFF09\uFF1B\u53EF\u6309\u65F6\u95F4\u4E0E\u573A\u666F\u8FC7\u6EE4",
|
|
977
1039
|
"invoice.reim.workflow.resolve": "\u6309\u6D41\u7A0B\u5355 ID \u6279\u91CF\u89E3\u6790\u5BF9\u5E94\u7684\u62A5\u9500\u6D41\u7A0B\u5B9A\u4E49",
|
|
978
1040
|
"invoice.reim.employee-superiors": "\u53D6\u5F53\u524D\u5458\u5DE5\u7684\u4E0A\u7EA7\u94FE\uFF08\u62A5\u9500\u5BA1\u6279\u4EBA\u5019\u9009\uFF0C\u65E0\u5165\u53C2\uFF09",
|
|
979
|
-
"invoice.reim.
|
|
980
|
-
"invoice.reim.customer.search": "\u6309\u5173\u952E\u8BCD\u68C0\u7D22\u5BA2\u6237\uFF08\u62A5\u9500\u5173\u8054\u5BA2\u6237\u5019\u9009\uFF09",
|
|
981
|
-
"invoice.reim.relation.search": "\u6309\u76EE\u6807\u4E0E\u5173\u952E\u8BCD\u68C0\u7D22\u62A5\u9500\u5173\u8054\u5173\u7CFB\uFF08\u5BA2\u6237/\u9879\u76EE\uFF09",
|
|
1041
|
+
"invoice.reim.customer.search": "\u6309\u5BA2\u6237\u540D\u79F0\u6A21\u7CCA\u67E5\u8BE2\u5BA2\u6237\u3001\u627F\u62C5\u4E3B\u4F53\u53CA\u5404\u5BA2\u6237\u81EA\u5DF1\u7684\u76F8\u5173\u9879\u76EE\uFF0C\u7EDF\u4E00\u7528\u4E8E\u62A5\u9500\u3001\u8865\u8D34\u3001\u4E0A\u4F20\u767B\u8BB0\u548C\u72EC\u7ACB\u5BA2\u6237\u67E5\u8BE2",
|
|
982
1042
|
"invoice.reim.relation.save": "\u4FDD\u5B58\u53D1\u7968\u4E0E\u5BA2\u6237/\u9879\u76EE\u7684\u5173\u8054\u5173\u7CFB\uFF08\u5199\u64CD\u4F5C\uFF0C\u7ECF\u52A8\u4F5C\u6D41\uFF09",
|
|
983
1043
|
"invoice.reim.relation.list": "\u6309\u53D1\u7968 fid/fids \u67E5\u5DF2\u5EFA\u7ACB\u7684\u62A5\u9500\u5173\u8054\u5173\u7CFB",
|
|
984
|
-
"invoice.reim.candidates.list": "\u6309\u6D88\u8D39\u65E5\u671F\u533A\u95F4\u67E5\u8BE2\
|
|
1044
|
+
"invoice.reim.candidates.list": "\u6309\u6D88\u8D39\u65E5\u671F\u533A\u95F4\u67E5\u8BE2\u62A5\u9500\u53D1\u7968\u5019\u9009\uFF0C\u5E76\u6279\u91CF\u8FD4\u56DE\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u4F9B AI \u5339\u914D",
|
|
985
1045
|
"invoice.reim.subsidy.submit": "\u63D0\u4EA4\u62A5\u9500\u8865\u8D34\u7533\u8BF7\u5E76\u521B\u5EFA\u62A5\u9500\u6D41\u7A0B\uFF08\u9AD8\u98CE\u9669\u5199\u64CD\u4F5C\uFF0C\u4F1A\u843D\u5E93\u53D1\u8D77\u6D41\u7A0B\uFF09",
|
|
986
1046
|
"invoice.issuing.contracts.list": "\u6309\u5408\u540C\u5361\u7247/\u6D41\u7A0B ID \u67E5\u53EF\u5F00\u7968\u7684\u5408\u540C\u5217\u8868",
|
|
987
|
-
"invoice.issuing.contract.detail": "\u6309 requestId \u67E5\u5F00\u7968\u5BF9\u5E94\u5408\u540C\u7684\u6D41\u7A0B\u660E\u7EC6"
|
|
1047
|
+
"invoice.issuing.contract.detail": "\u6309 requestId \u67E5\u5F00\u7968\u5BF9\u5E94\u5408\u540C\u7684\u6D41\u7A0B\u660E\u7EC6",
|
|
1048
|
+
"invoice.issuing.red.requests.list": "\u6309\u5BA2\u6237\u540D\u79F0\u67E5\u8BE2\u7EA2\u51B2\u6240\u5173\u8054\u7684\u84DD\u5B57\u5F00\u7968\u7533\u8BF7\u6D41\u7A0B\u5019\u9009\uFF08\u53EA\u8BFB\u3001\u4E0D\u7B5B\u9664\u5BA1\u6279\u4E2D\u7533\u8BF7\uFF09"
|
|
988
1049
|
};
|
|
989
1050
|
function withSummaries(operations) {
|
|
990
1051
|
return operations.map((item) => ({
|
|
@@ -1019,7 +1080,8 @@ var invoiceOperations = [
|
|
|
1019
1080
|
additionalProperties: false,
|
|
1020
1081
|
properties: {
|
|
1021
1082
|
fid: { type: "string", pattern: "^[1-9]\\d*$" },
|
|
1022
|
-
number: { type: "string", minLength: 1 }
|
|
1083
|
+
number: { type: "string", minLength: 1 },
|
|
1084
|
+
includePreApprovals: includePreApprovalsProperty
|
|
1023
1085
|
},
|
|
1024
1086
|
oneOf: [{ required: ["fid"] }, { required: ["number"] }]
|
|
1025
1087
|
},
|
|
@@ -1322,42 +1384,6 @@ var invoiceOperations = [
|
|
|
1322
1384
|
},
|
|
1323
1385
|
outputSchema: resultEnvelopeOutput(workflowResolveDataSchema)
|
|
1324
1386
|
},
|
|
1325
|
-
{
|
|
1326
|
-
name: "invoice.reim.employee-superiors",
|
|
1327
|
-
risk: "read",
|
|
1328
|
-
fixed: { path: "/api/inc/book/getEmployeeSuperiors" },
|
|
1329
|
-
inputSchema: {
|
|
1330
|
-
type: "object",
|
|
1331
|
-
additionalProperties: false,
|
|
1332
|
-
properties: {}
|
|
1333
|
-
},
|
|
1334
|
-
outputSchema: resultEnvelopeOutput(employeeSuperiorsDataSchema)
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
name: "invoice.reim.field.search",
|
|
1338
|
-
risk: "read",
|
|
1339
|
-
fixed: { path: "/api/government/formStructure/fieldRelateSearch", method: "GET", formModeType: "wf", defaultNodeId: "100004140000000271" },
|
|
1340
|
-
inputSchema: {
|
|
1341
|
-
type: "object",
|
|
1342
|
-
additionalProperties: false,
|
|
1343
|
-
properties: {
|
|
1344
|
-
keywords: { type: "string", minLength: 1 },
|
|
1345
|
-
fieldId: positiveId,
|
|
1346
|
-
workflowId: positiveId,
|
|
1347
|
-
nodeId: { type: "string", minLength: 1, default: "100004140000000271" }
|
|
1348
|
-
},
|
|
1349
|
-
required: ["keywords", "fieldId", "workflowId"]
|
|
1350
|
-
},
|
|
1351
|
-
outputSchema: objectSchema({
|
|
1352
|
-
result: rawObject,
|
|
1353
|
-
data: fieldSearchItemsSchema,
|
|
1354
|
-
keywords: { type: "string" },
|
|
1355
|
-
match: { type: "string", enum: ["unique", "multiple", "none"] },
|
|
1356
|
-
items: fieldSearchItemsSchema,
|
|
1357
|
-
selected: { anyOf: [fieldSearchItemSchema, { type: "null" }] },
|
|
1358
|
-
workflow: workflowSchema
|
|
1359
|
-
}, ["result", "data", "keywords", "match", "items", "workflow"])
|
|
1360
|
-
},
|
|
1361
1387
|
{
|
|
1362
1388
|
name: "invoice.reim.customer.search",
|
|
1363
1389
|
risk: "read",
|
|
@@ -1368,58 +1394,45 @@ var invoiceOperations = [
|
|
|
1368
1394
|
compId: "c39b9e14c0034336adf9e9bc39aeed75",
|
|
1369
1395
|
pageId: "1218181956452048911",
|
|
1370
1396
|
pageNo: "1",
|
|
1371
|
-
|
|
1372
|
-
|
|
1397
|
+
pageSize: "10",
|
|
1398
|
+
maxPages: 20,
|
|
1399
|
+
filter: "\u4EC5\u5BA2\u6237\u8868\u300C\u540D\u79F0\u300D\u5B57\u6BB5 field_1173221220888062665 \u6A21\u7CCA\u5339\u914D keywords\uFF1B\u6EE1\u9875\u7EED\u67E5\uFF0C\u6309\u5BA2\u6237 ID \u53BB\u91CD\uFF0C\u4E0D\u4F9D\u8D56 count",
|
|
1400
|
+
projects: {
|
|
1401
|
+
path: "/api/ebuilder/form/eblist/getData",
|
|
1402
|
+
method: "POST",
|
|
1403
|
+
pageId: "1144658644836794483",
|
|
1404
|
+
appId: "1136121637129502949",
|
|
1405
|
+
compId: "f5b2b31aeb2e4e46956464bba7d2e52c",
|
|
1406
|
+
customerFieldId: "1149506138249011280",
|
|
1407
|
+
projectNameFieldId: "1020275734718578690",
|
|
1408
|
+
pageSize: 10,
|
|
1409
|
+
maxPagesPerCustomer: 20,
|
|
1410
|
+
customerConcurrency: 4,
|
|
1411
|
+
note: "\u6BCF\u4E2A\u53BB\u91CD\u5BA2\u6237\u7528\u81EA\u5DF1\u7684 customerId \u76F4\u63A5\u67E5\u9879\u76EE\uFF0C\u4E0D\u8BFB\u5386\u53F2\u62A5\u9500\uFF1B\u6BCF\u5BA2\u6237\u72EC\u7ACB\u5206\u9875\u5E76\u53BB\u91CD\uFF0C\u6302\u5230\u672C\u884C relatedProject\uFF0C\u4E0D\u6DF7\u5408\u5019\u9009\u3002\u5931\u8D25\u65F6 relatedProject=null \u5E76\u9644 projectsError\uFF0C\u4E0D\u4F2A\u88C5\u6210\u7A7A\u9879\u76EE\uFF1B\u8BA4\u8BC1\u9519\u8BEF\u4F20\u64AD\u3002"
|
|
1412
|
+
}
|
|
1373
1413
|
},
|
|
1374
1414
|
inputSchema: objectSchema({
|
|
1375
1415
|
keywords: { type: "string", minLength: 1, description: "\u7528\u6237\u8F93\u5165\u7684\u5BA2\u6237\u540D\u79F0\uFF0C\u652F\u6301\u6A21\u7CCA\u540D\u79F0\uFF1B\u4E0D\u9700\u8981\u62A5\u9500\u8868\u5355\u6216\u5B57\u6BB5 ID" }
|
|
1376
1416
|
}, ["keywords"]),
|
|
1377
1417
|
outputSchema: objectSchema({
|
|
1378
1418
|
list: arrayOf(objectSchema({
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1419
|
+
customerId: { type: "string", description: "\u5BA2\u6237\u4E1A\u52A1 ID\uFF0C\u6E90\u81EA form_data_id\uFF1B\u65E7\u63A5\u53E3\u54CD\u5E94\u7F3A\u5931\u8BE5\u952E\u65F6\u517C\u5BB9 id\uFF0C\u957F ID \u4FDD\u6301\u5B57\u7B26\u4E32" },
|
|
1420
|
+
customerName: { type: "string", description: "\u76F8\u5173\u5BA2\u6237\u540D\u79F0" },
|
|
1421
|
+
expenseBearer: arrayOf(objectSchema({
|
|
1422
|
+
expenseBearerName: { type: "string", description: "\u627F\u62C5\u4E3B\u4F53\u540D\u79F0" },
|
|
1423
|
+
expenseBearerId: { type: "string", description: "\u627F\u62C5\u4E3B\u4F53 ID" }
|
|
1424
|
+
}, ["expenseBearerName", "expenseBearerId"])),
|
|
1425
|
+
relatedProject: {
|
|
1426
|
+
anyOf: [arrayOf(objectSchema({
|
|
1427
|
+
relatedProjectName: { type: "string", description: "\u8BE5\u5BA2\u6237\u7684\u76F8\u5173\u9879\u76EE\u540D\u79F0" },
|
|
1428
|
+
relatedProjectId: { type: "string", description: "\u8BE5\u5BA2\u6237\u7684\u76F8\u5173\u9879\u76EE ID\uFF0C\u4FDD\u6301\u5B57\u7B26\u4E32" }
|
|
1429
|
+
}, ["relatedProjectName", "relatedProjectId"])), { type: "null" }],
|
|
1430
|
+
description: "\u53EA\u5C5E\u4E8E\u672C\u884C\u5BA2\u6237\u7684\u5B8C\u6574\u9879\u76EE\u5217\u8868\uFF1B[] \u4E3A\u786E\u8BA4\u65E0\u9879\u76EE\uFF0Cnull \u4E3A\u67E5\u8BE2\u5931\u8D25\u6216\u4E0D\u5B8C\u6574"
|
|
1431
|
+
},
|
|
1432
|
+
projectsError: { type: "string", description: "\u4EC5 relatedProject=null \u65F6\u63D0\u4F9B\u7684\u5931\u8D25\u539F\u56E0\uFF0C\u4E0D\u5F97\u5F53\u4F5C\u6CA1\u6709\u9879\u76EE" }
|
|
1433
|
+
}, ["customerId", "customerName", "expenseBearer", "relatedProject"]))
|
|
1387
1434
|
}, ["list"])
|
|
1388
1435
|
},
|
|
1389
|
-
{
|
|
1390
|
-
name: "invoice.reim.relation.search",
|
|
1391
|
-
risk: "read",
|
|
1392
|
-
fixed: {
|
|
1393
|
-
customer: {
|
|
1394
|
-
path: "/api/ebuilder/coms/nlist/getData",
|
|
1395
|
-
headers: { ebbusinessid: "1218181956452048911" },
|
|
1396
|
-
pageId: "1218181956452048911",
|
|
1397
|
-
compId: "c39b9e14c0034336adf9e9bc39aeed75",
|
|
1398
|
-
workflowId: "100003460000000060",
|
|
1399
|
-
isCreate: "1",
|
|
1400
|
-
filter: "\u5BA2\u6237\u8868\u300C\u540D\u79F0\u300D\u5B57\u6BB5 field_1173221220888062665 \u6A21\u7CCA\u5339\u914D keywords",
|
|
1401
|
-
output: "data.list[]\uFF1Aid \u2192 id\uFF0C1173221220888062665 \u2192 name"
|
|
1402
|
-
},
|
|
1403
|
-
project: {
|
|
1404
|
-
path: "/api/ebuilder/form/common/browser/data/ebuilder",
|
|
1405
|
-
quickSearchDatas: "field_1020275734718578690\uFF08\u9879\u76EE\u540D\u79F0\uFF09= keywords",
|
|
1406
|
-
formParam: { formId: "100003660000000007", layoutId: "925333107626672135", fieldId: "100003720000006720", module: "workflow" },
|
|
1407
|
-
output: "data.data[]\uFF1Aid \u2192 id\uFF0Ccontent \u2192 name\uFF1Bdisabled=true \u7684\u4E0D\u8FD4\u56DE"
|
|
1408
|
-
},
|
|
1409
|
-
pageSize: 20,
|
|
1410
|
-
note: "\u4E0A\u4F20\u53D1\u7968\u767B\u8BB0\u5173\u8054\u4FE1\u606F\u65F6\u7528\uFF0C\u4E0D\u9700\u8981\u62A5\u9500\u8868\u5355\uFF1B\u53EA\u4FDD\u7559\u6BCF\u6761\u7684 id \u548C\u540D\u79F0"
|
|
1411
|
-
},
|
|
1412
|
-
inputSchema: {
|
|
1413
|
-
type: "object",
|
|
1414
|
-
additionalProperties: false,
|
|
1415
|
-
properties: {
|
|
1416
|
-
target: { type: "string", enum: ["customer", "project"], description: "customer=\u76F8\u5173\u5BA2\u6237\uFF0Cproject=\u76F8\u5173\u9879\u76EE" },
|
|
1417
|
-
keywords: { type: "string", minLength: 1, description: "\u7528\u6237\u8BF4\u7684\u5BA2\u6237 / \u9879\u76EE\u540D\u79F0\u539F\u8BDD\uFF0C\u53EF\u4EE5\u662F\u6A21\u7CCA\u540D\u79F0" }
|
|
1418
|
-
},
|
|
1419
|
-
required: ["target", "keywords"]
|
|
1420
|
-
},
|
|
1421
|
-
outputSchema: relationSearchOutputSchema
|
|
1422
|
-
},
|
|
1423
1436
|
{
|
|
1424
1437
|
name: "invoice.reim.relation.save",
|
|
1425
1438
|
risk: "write",
|
|
@@ -1436,10 +1449,10 @@ var invoiceOperations = [
|
|
|
1436
1449
|
properties: {
|
|
1437
1450
|
fid: { ...positiveId, description: "\u5355\u5F20\u53D1\u7968 fid\uFF1B\u4E0E fids \u4E8C\u9009\u4E00" },
|
|
1438
1451
|
fids: { ...positiveIdArray, description: "\u540C\u4E00\u6279\u4E0A\u4F20\u6210\u529F\u7684\u53D1\u7968 fid\uFF1B\u4E0E fid \u4E8C\u9009\u4E00" },
|
|
1439
|
-
customerId: { ...positiveId, description: "\u76F8\u5173\u5BA2\u6237 ID\uFF08invoice.reim.
|
|
1452
|
+
customerId: { ...positiveId, description: "\u76F8\u5173\u5BA2\u6237 ID\uFF08invoice.reim.customer.search \u9009\u5B9A\u884C\u7684 customerId\uFF09\uFF0C\u4E0E customerName \u540C\u65F6\u63D0\u4F9B" },
|
|
1440
1453
|
customerName: { type: "string", minLength: 1, description: "\u76F8\u5173\u5BA2\u6237\u540D\u79F0\uFF0C\u4E0E customerId \u540C\u65F6\u63D0\u4F9B" },
|
|
1441
|
-
projectId: { ...positiveId, description: "\u76F8\u5173\u9879\u76EE ID\uFF08invoice.reim.
|
|
1442
|
-
projectName: { type: "string", minLength: 1, description: "\u76F8\u5173\u9879\u76EE\u540D\u79F0\uFF0C\u4E0E projectId \u540C\u65F6\u63D0\u4F9B" },
|
|
1454
|
+
projectId: { ...positiveId, description: "\u76F8\u5173\u9879\u76EE ID\uFF08invoice.reim.customer.search \u9009\u5B9A\u5BA2\u6237\u672C\u884C relatedProject \u7684 relatedProjectId\uFF09\uFF0C\u4E0E projectName \u540C\u65F6\u63D0\u4F9B" },
|
|
1455
|
+
projectName: { type: "string", minLength: 1, description: "\u76F8\u5173\u9879\u76EE\u540D\u79F0\uFF08invoice.reim.customer.search \u9009\u5B9A\u5BA2\u6237\u672C\u884C relatedProject \u7684 relatedProjectName\uFF09\uFF0C\u4E0E projectId \u540C\u65F6\u63D0\u4F9B" },
|
|
1443
1456
|
flowId: { ...positiveId, description: "\u4E8B\u524D\u7533\u8BF7\u6D41\u7A0B\u7684 requestid\uFF08invoice.reim.requests.list \u8FD4\u56DE\uFF09" }
|
|
1444
1457
|
},
|
|
1445
1458
|
oneOf: [{ required: ["fid"] }, { required: ["fids"] }]
|
|
@@ -1472,7 +1485,7 @@ var invoiceOperations = [
|
|
|
1472
1485
|
{
|
|
1473
1486
|
name: "invoice.reim.candidates.list",
|
|
1474
1487
|
risk: "read",
|
|
1475
|
-
fixed: { path: "/api/inc/sync", sreim: "3", billType: 0, excludeProStatus: 8 },
|
|
1488
|
+
fixed: { path: "/api/inc/sync", sreim: "3", billType: 0, mext: FULL_EXT_MASK, excludeProStatus: 8 },
|
|
1476
1489
|
inputSchema: {
|
|
1477
1490
|
type: "object",
|
|
1478
1491
|
additionalProperties: false,
|
|
@@ -1482,7 +1495,8 @@ var invoiceOperations = [
|
|
|
1482
1495
|
consumption_tm_begin: epochDateProperty("\u6D88\u8D39\u65E5\u671F\u8D77\uFF08\u542B\uFF09"),
|
|
1483
1496
|
consumption_tm_end: epochEndDateProperty("\u6D88\u8D39\u65E5\u671F\u6B62\uFF08\u542B\uFF09"),
|
|
1484
1497
|
page_size: { type: "integer", minimum: 10, maximum: 200, default: 50, description: "\u5355\u9875\u6761\u6570\u3002" },
|
|
1485
|
-
max_items: { type: "integer", minimum: 1, maximum: 500, default: 200, description: "\u6700\u591A\u62C9\u53D6\u6761\u6570\uFF0C\u8D85\u51FA\u622A\u65AD\u5E76\u4EA7\u751F warning\u3002" }
|
|
1498
|
+
max_items: { type: "integer", minimum: 1, maximum: 500, default: 200, description: "\u6700\u591A\u62C9\u53D6\u6761\u6570\uFF0C\u8D85\u51FA\u622A\u65AD\u5E76\u4EA7\u751F warning\u3002" },
|
|
1499
|
+
includePreApprovals: includePreApprovalsProperty
|
|
1486
1500
|
}
|
|
1487
1501
|
},
|
|
1488
1502
|
outputSchema: reimCandidatesOutputSchema
|
|
@@ -1595,35 +1609,65 @@ var invoiceOperations = [
|
|
|
1595
1609
|
}
|
|
1596
1610
|
},
|
|
1597
1611
|
outputSchema: issuingContractDetailOutputSchema
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
name: "invoice.issuing.red.requests.list",
|
|
1615
|
+
risk: "read",
|
|
1616
|
+
fixed: {
|
|
1617
|
+
path: "/api/workflow/core/common/browser/data/wfcRequest",
|
|
1618
|
+
workflowId: "100003460000000214",
|
|
1619
|
+
source: "\u84DD\u5B57\u5F00\u7968\u7533\u8BF7\u6D41\u7A0B\u6D4F\u89C8\u5668\uFF1B\u67E5\u8BE2\u7ED3\u679C\u7528\u4E8E\u7EA2\u51B2\u6D41\u7A0B\u300C\u84DD\u5B57\u53D1\u7968\u5F00\u7968\u6D41\u7A0B\u300D"
|
|
1620
|
+
},
|
|
1621
|
+
inputSchema: {
|
|
1622
|
+
type: "object",
|
|
1623
|
+
additionalProperties: false,
|
|
1624
|
+
required: ["customerName"],
|
|
1625
|
+
properties: {
|
|
1626
|
+
customerName: { type: "string", minLength: 1, description: "\u7528\u6237\u660E\u786E\u7684\u5BA2\u6237\u540D\u79F0\uFF0C\u540C\u65F6\u7528\u4E8E\u7533\u8BF7\u6807\u9898\u548C\u6D41\u7A0B\u7F16\u53F7\u5FEB\u6377\u641C\u7D22" },
|
|
1627
|
+
current: { type: "integer", minimum: 1, default: 1 },
|
|
1628
|
+
pageSize: { type: "integer", minimum: 1, maximum: 100, default: 10 }
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
outputSchema: issuingRedRequestsOutputSchema
|
|
1598
1632
|
}
|
|
1599
1633
|
];
|
|
1600
|
-
var REIM_REFERENCE = "references/
|
|
1634
|
+
var REIM_REFERENCE = "references/reim-workflow.md";
|
|
1601
1635
|
var ISSUING_REFERENCE = "references/invoice-issuing-workflow.md";
|
|
1602
1636
|
var UPLOAD_AND_VALIDATE_REFERENCE = "references/invoice-upload-and-validate.md";
|
|
1603
1637
|
var invoiceRetiredOperations = [
|
|
1638
|
+
...["invoice.reim.field.search", "invoice.reim.project.list", "invoice.reim.relation.search"].map((name) => ({
|
|
1639
|
+
name,
|
|
1640
|
+
replacement: "\u5BA2\u6237\u3001\u76F8\u5173\u9879\u76EE\u53CA\u627F\u62C5\u4E3B\u4F53\u7EDF\u4E00\u4F7F\u7528 invoice.reim.customer.search\uFF0C\u53EA\u4F20\u5BA2\u6237\u540D\u79F0 keywords\uFF1B\u5148\u9009\u5BA2\u6237\uFF0C\u518D\u4ECE\u8BE5\u5BA2\u6237\u672C\u884C relatedProject \u9009\u62E9\u9879\u76EE\u3002\u7F3A\u5C11\u5BA2\u6237\u540D\u79F0\u65F6\u5148\u8865\u5145\u5BA2\u6237\uFF0C\u4E0D\u518D\u6309\u9879\u76EE\u540D\u79F0\u67E5\u8BE2\u6216\u8BFB\u53D6\u5386\u53F2\u5F52\u6863\u5173\u8054",
|
|
1641
|
+
reference: "references/reim-customer-search.md"
|
|
1642
|
+
})),
|
|
1643
|
+
{
|
|
1644
|
+
name: "invoice.reim.employee-superiors",
|
|
1645
|
+
replacement: "\u4EBA\u5458\u53CA\u4E0A\u7EA7\u5B57\u6BB5\u4FDD\u7559\u9875\u9762\u9ED8\u8BA4\u503C\uFF1B\u62A5\u9500\u6807\u9898\u590D\u7528\u5DF2\u786E\u8BA4\u7684\u5F53\u524D\u7528\u6237\u59D3\u540D\u6216\u672C\u4EBA\u4E8B\u524D\u7533\u8BF7\u521B\u5EFA\u4EBA\uFF0C\u7F3A\u5C11\u59D3\u540D\u65F6\u4EC5\u5411\u7528\u6237\u8865\u95EE\uFF0C\u4E0D\u518D\u67E5\u8BE2\u4EBA\u5458\u6216\u4E0A\u7EA7\u63A5\u53E3",
|
|
1646
|
+
reference: REIM_REFERENCE
|
|
1647
|
+
},
|
|
1604
1648
|
{
|
|
1605
1649
|
name: "invoice.reim.form.structure",
|
|
1606
|
-
replacement: "\u8F7D\u5165\u62A5\u9500\
|
|
1650
|
+
replacement: "\u8F7D\u5165\u62A5\u9500\u5B57\u6BB5\u6539\u7528 weaver-e10-workflow \u7684 workflow.createRequestDirect\uFF08\u53EA\u4F20 workflow \u5B57\u7B26\u4E32\u6570\u7EC4\uFF09\uFF0C\u7531\u9875\u9762\u9884\u586B\u540E\u7528\u6237\u6838\u5BF9\u4FDD\u5B58",
|
|
1607
1651
|
reference: REIM_REFERENCE
|
|
1608
1652
|
},
|
|
1609
1653
|
{
|
|
1610
1654
|
name: "invoice.reim.row-info",
|
|
1611
|
-
replacement: "\u660E\u7EC6\
|
|
1655
|
+
replacement: "\u660E\u7EC6\u6BCF\u884C\u53EA\u5199\u5DF2\u9009\u53D1\u7968\u4E1A\u52A1 fid \u548C\u5DF2\u7ED1\u5B9A\u7684\u76F8\u5173\u6D41\u7A0B\uFF0C\u5176\u4F59\u5217\u7531\u9875\u9762\u8054\u52A8\u5E26\u51FA\uFF0C\u4E0D\u518D\u67E5\u8BE2\u6216\u8F6C\u6362\u53D1\u7968\u5BF9\u8C61",
|
|
1612
1656
|
reference: REIM_REFERENCE
|
|
1613
1657
|
},
|
|
1614
1658
|
{
|
|
1615
1659
|
name: "invoice.reim.row-info-batch",
|
|
1616
|
-
replacement: "\u660E\u7EC6\
|
|
1660
|
+
replacement: "\u660E\u7EC6\u6BCF\u884C\u53EA\u5199\u5DF2\u9009\u53D1\u7968\u4E1A\u52A1 fid \u548C\u5DF2\u7ED1\u5B9A\u7684\u76F8\u5173\u6D41\u7A0B\uFF0C\u5176\u4F59\u5217\u7531\u9875\u9762\u8054\u52A8\u5E26\u51FA\uFF0C\u4E0D\u518D\u67E5\u8BE2\u6216\u8F6C\u6362\u53D1\u7968\u5BF9\u8C61",
|
|
1617
1661
|
reference: REIM_REFERENCE
|
|
1618
1662
|
},
|
|
1619
1663
|
{
|
|
1620
1664
|
name: "invoice.reim.flow.create.prepare",
|
|
1621
|
-
replacement: "\
|
|
1665
|
+
replacement: "\u666E\u901A\u62A5\u9500\u6539\u7528 workflow.createRequestDirect \u53EA\u8BFB\u5B57\u6BB5\uFF0C\u518D\u6309 reim-workflow.md \u8F93\u51FA\u9875\u9762\u586B\u5355\u6307\u4EE4\uFF0C\u7531\u7528\u6237\u6838\u5BF9\u4FDD\u5B58\uFF0C\u4E0D\u81EA\u52A8\u4FDD\u5B58\u6216\u63D0\u4EA4",
|
|
1622
1666
|
reference: REIM_REFERENCE
|
|
1623
1667
|
},
|
|
1624
1668
|
{
|
|
1625
1669
|
name: "invoice.reim.flow.create.apply",
|
|
1626
|
-
replacement: "\
|
|
1670
|
+
replacement: "\u666E\u901A\u62A5\u9500\u6539\u7528 workflow.createRequestDirect \u53EA\u8BFB\u5B57\u6BB5\uFF0C\u518D\u6309 reim-workflow.md \u8F93\u51FA\u9875\u9762\u586B\u5355\u6307\u4EE4\uFF0C\u7531\u7528\u6237\u6838\u5BF9\u4FDD\u5B58\uFF0C\u4E0D\u81EA\u52A8\u4FDD\u5B58\u6216\u63D0\u4EA4",
|
|
1627
1671
|
reference: REIM_REFERENCE
|
|
1628
1672
|
},
|
|
1629
1673
|
{
|
|
@@ -1638,12 +1682,12 @@ var invoiceRetiredOperations = [
|
|
|
1638
1682
|
},
|
|
1639
1683
|
{
|
|
1640
1684
|
name: "invoice.reim.template.build",
|
|
1641
|
-
replacement: "\u6539\u4E3A invoice.reim.candidates.list \
|
|
1685
|
+
replacement: "\u6539\u4E3A invoice.reim.candidates.list \u9009\u7968 \u2192 workflow.createRequestDirect \u53D6\u5B57\u6BB5 \u2192 \u6309 reim-workflow.md \u7684 Step 4\uFF5E5 \u7EC4\u88C5\u9875\u9762\u53C2\u6570\u5E76\u8F93\u51FA\u586B\u5355\u6307\u4EE4\uFF0C\u7531\u7528\u6237\u6838\u5BF9\u4FDD\u5B58",
|
|
1642
1686
|
reference: REIM_REFERENCE
|
|
1643
1687
|
},
|
|
1644
1688
|
{
|
|
1645
1689
|
name: "invoice.reim.flow.create.auto-prepare",
|
|
1646
|
-
replacement: "\u6539\u4E3A invoice.reim.candidates.list \
|
|
1690
|
+
replacement: "\u6539\u4E3A invoice.reim.candidates.list \u9009\u7968 \u2192 workflow.createRequestDirect \u53D6\u5B57\u6BB5 \u2192 \u6309 reim-workflow.md \u7684 Step 4\uFF5E5 \u7EC4\u88C5\u9875\u9762\u53C2\u6570\u5E76\u8F93\u51FA\u586B\u5355\u6307\u4EE4\uFF0C\u7531\u7528\u6237\u6838\u5BF9\u4FDD\u5B58",
|
|
1647
1691
|
reference: REIM_REFERENCE
|
|
1648
1692
|
},
|
|
1649
1693
|
{
|
|
@@ -1703,6 +1747,302 @@ import { createHash } from "node:crypto";
|
|
|
1703
1747
|
import { existsSync as existsSync2 } from "node:fs";
|
|
1704
1748
|
import { readFile as readFile2, stat, writeFile as writeFile2 } from "node:fs/promises";
|
|
1705
1749
|
import { dirname, extname, basename, resolve as resolve2 } from "node:path";
|
|
1750
|
+
|
|
1751
|
+
// src/shortcuts/invoice/business-response.ts
|
|
1752
|
+
function assertBusinessSuccess(value, subtype, fallbackMessage) {
|
|
1753
|
+
const result = value && typeof value === "object" ? value : {};
|
|
1754
|
+
const code = result.code ?? result.res_base?.ret;
|
|
1755
|
+
const failed = result.fail === true || result.status === false || code !== void 0 && code !== 0 && code !== 200;
|
|
1756
|
+
if (!failed) return;
|
|
1757
|
+
throw new InvoiceCliError("api", subtype, result.message || result.msg || result.res_base?.message || fallbackMessage, {
|
|
1758
|
+
code,
|
|
1759
|
+
details: { result },
|
|
1760
|
+
exitCode: 1
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
// src/shortcuts/invoice/calendar.ts
|
|
1765
|
+
function formatUtcDate(date) {
|
|
1766
|
+
const y = date.getUTCFullYear();
|
|
1767
|
+
const m = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
1768
|
+
const d = String(date.getUTCDate()).padStart(2, "0");
|
|
1769
|
+
return `${y}-${m}-${d}`;
|
|
1770
|
+
}
|
|
1771
|
+
function addCalendarDays(isoDate, offsetDays) {
|
|
1772
|
+
const [year, month, day] = isoDate.split("-").map(Number);
|
|
1773
|
+
return formatUtcDate(new Date(Date.UTC(year, (month ?? 1) - 1, (day ?? 1) + offsetDays)));
|
|
1774
|
+
}
|
|
1775
|
+
function addCalendarMonths(isoDate, offsetMonths) {
|
|
1776
|
+
const [year, month, day] = isoDate.split("-").map(Number);
|
|
1777
|
+
const target = new Date(Date.UTC(year, (month ?? 1) - 1 + offsetMonths, 1));
|
|
1778
|
+
const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate();
|
|
1779
|
+
target.setUTCDate(Math.min(day ?? 1, lastDay));
|
|
1780
|
+
return formatUtcDate(target);
|
|
1781
|
+
}
|
|
1782
|
+
function shanghaiCalendarDate(offsetDays = 0, now = /* @__PURE__ */ new Date()) {
|
|
1783
|
+
const today = new Intl.DateTimeFormat("en-CA", { timeZone: "Asia/Shanghai" }).format(now);
|
|
1784
|
+
return offsetDays === 0 ? today : addCalendarDays(today, offsetDays);
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
// src/shortcuts/invoice/preapproval-enrichment.ts
|
|
1788
|
+
var REQUEST_PATH = "/api/inc/book/getRequestListByTabId";
|
|
1789
|
+
var PAGE_SIZE = 100;
|
|
1790
|
+
var MAX_PAGES = 20;
|
|
1791
|
+
var REQUEST_TIMEOUT_MS = 5e3;
|
|
1792
|
+
var WORKFLOW_IDS = [
|
|
1793
|
+
"100003460000000746",
|
|
1794
|
+
"100003460000000046",
|
|
1795
|
+
"100003460000000418",
|
|
1796
|
+
"100003460000000045"
|
|
1797
|
+
];
|
|
1798
|
+
var ORDINARY_WORKFLOWS = new Set(WORKFLOW_IDS);
|
|
1799
|
+
var OPTIONAL_FIELDS = ["flowStatus", "creatorId", "creatorName", "createTime"];
|
|
1800
|
+
function record(value) {
|
|
1801
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
1802
|
+
}
|
|
1803
|
+
function text3(value) {
|
|
1804
|
+
return typeof value === "string" ? value.trim() : "";
|
|
1805
|
+
}
|
|
1806
|
+
function phoneOrFuelOnly(invoice) {
|
|
1807
|
+
const info = invoiceRecordOf(invoice);
|
|
1808
|
+
const pro = record(info.comm_info?.pro) ?? {};
|
|
1809
|
+
const ext = parseInvoiceExt(info.ext);
|
|
1810
|
+
const primary = [info.fyn, pro.kind, pro.content, invoiceExtInfo(info).content, ext.service_name].map(text3).filter(Boolean);
|
|
1811
|
+
const evidence = primary.join(" ");
|
|
1812
|
+
const subsidy = /话费|电话费|手机账单|电信服务|通讯|通信|流量(?:费|套餐)|汽油|柴油|加油费|燃油|油费|成品油/u;
|
|
1813
|
+
const ordinary = /餐饮|餐费|吃饭|住宿|酒店|客运|运输|机票|火车|通行|过路|停车|办公|招待|团建|聚餐|借款|垫付|设备|维修|矿泉水|食品|食用油|粮油|润滑油/u;
|
|
1814
|
+
if (ordinary.test(evidence)) return false;
|
|
1815
|
+
if (Array.isArray(ext.products) && ext.products.some((product) => {
|
|
1816
|
+
const name = text3(record(product)?.name);
|
|
1817
|
+
return name !== "" && !subsidy.test(name);
|
|
1818
|
+
})) return false;
|
|
1819
|
+
if (subsidy.test(evidence)) return true;
|
|
1820
|
+
if (primary.some((value) => !/^(?:其他|其它|其他费用|其它费用|未分类|未知)$/u.test(value))) return false;
|
|
1821
|
+
const seller = [info.comm_info?.payer?.company, info.sellerName, info.payer].map(text3).join(" ");
|
|
1822
|
+
return /中国移动|中国联通|中国电信|中国广电|电信服务|通信服务|通讯服务|加油站|汽柴油销售/u.test(seller);
|
|
1823
|
+
}
|
|
1824
|
+
function assertRequestListSuccess(response) {
|
|
1825
|
+
const envelope = record(response);
|
|
1826
|
+
if (!envelope) throw new Error("\u4E8B\u524D\u7533\u8BF7\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38");
|
|
1827
|
+
const code = envelope.code ?? record(envelope.res_base)?.ret;
|
|
1828
|
+
assertBusinessSuccess({ ...envelope, ...code !== void 0 ? { code: typeof code === "string" && code.trim() !== "" ? Number(code) : code } : {} }, "preapprovals_query_failed", "\u8BFB\u53D6\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5931\u8D25");
|
|
1829
|
+
const errcode = record(envelope.message)?.errcode;
|
|
1830
|
+
if (errcode !== void 0 && errcode !== null && errcode !== "") {
|
|
1831
|
+
if (!["string", "number"].includes(typeof errcode) || ![0, 200].includes(Number(errcode))) {
|
|
1832
|
+
throw new Error("\u4E8B\u524D\u7533\u8BF7\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25");
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
function skipped(reason) {
|
|
1837
|
+
return { preApprovals: { status: "skipped", items: null, hasMore: null, reason }, warnings: [] };
|
|
1838
|
+
}
|
|
1839
|
+
function requiredId(value) {
|
|
1840
|
+
const id = typeof value === "string" ? value : typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? String(value) : "";
|
|
1841
|
+
if (!/^\d+$/u.test(id) || !/[1-9]/u.test(id)) throw new Error("\u4E8B\u524D\u7533\u8BF7\u8BB0\u5F55\u7F3A\u5C11\u53EF\u9760 ID");
|
|
1842
|
+
return id;
|
|
1843
|
+
}
|
|
1844
|
+
function candidate(row, requestid, workflowid) {
|
|
1845
|
+
const requestname = row.requestname ?? "";
|
|
1846
|
+
if (typeof requestname !== "string") throw new Error("\u4E8B\u524D\u7533\u8BF7\u540D\u79F0\u683C\u5F0F\u5F02\u5E38");
|
|
1847
|
+
const result = { requestid, workflowid, requestname };
|
|
1848
|
+
for (const key of OPTIONAL_FIELDS) {
|
|
1849
|
+
const value = row[key];
|
|
1850
|
+
if (value === void 0) continue;
|
|
1851
|
+
const valid = value === null || typeof value === "string" || key !== "creatorName" && typeof value === "number" && Number.isSafeInteger(value);
|
|
1852
|
+
if (!valid) throw new Error("\u4E8B\u524D\u7533\u8BF7\u5143\u6570\u636E\u683C\u5F0F\u5F02\u5E38");
|
|
1853
|
+
result[key] = value;
|
|
1854
|
+
}
|
|
1855
|
+
return result;
|
|
1856
|
+
}
|
|
1857
|
+
async function readInvoicePreApprovals(host, options) {
|
|
1858
|
+
if (options.includePreApprovals === false) return skipped("disabled");
|
|
1859
|
+
if (options.invoices.length === 0) return skipped("no_invoices");
|
|
1860
|
+
if (options.invoices.every(phoneOrFuelOnly)) return skipped("phone_fuel_only");
|
|
1861
|
+
const items = /* @__PURE__ */ new Map();
|
|
1862
|
+
const seenPages = /* @__PURE__ */ new Set();
|
|
1863
|
+
let query;
|
|
1864
|
+
let completedPages = 0;
|
|
1865
|
+
let received = 0;
|
|
1866
|
+
const partial = (reason) => ({
|
|
1867
|
+
preApprovals: { status: "partial", items: [...items.values()], query, hasMore: true, reason },
|
|
1868
|
+
warnings: ["\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u5C1A\u672A\u5B8C\u6574\u8BFB\u53D6\uFF0C\u4E0D\u80FD\u636E\u6B64\u5224\u65AD\u552F\u4E00\u6216\u6CA1\u6709\u7533\u8BF7\uFF1B\u5DF2\u53D6\u5F97\u7684\u5019\u9009\u53CA\u53D1\u7968\u7ED3\u679C\u4FDD\u7559\u3002"]
|
|
1869
|
+
});
|
|
1870
|
+
try {
|
|
1871
|
+
const today = shanghaiCalendarDate(0, options.now ?? /* @__PURE__ */ new Date());
|
|
1872
|
+
query = {
|
|
1873
|
+
cusCreateDateStart: addCalendarMonths(today, -1),
|
|
1874
|
+
cusCreateDateEnd: today,
|
|
1875
|
+
workflowIds: [...WORKFLOW_IDS]
|
|
1876
|
+
};
|
|
1877
|
+
const session = await host.getSession();
|
|
1878
|
+
const currentUserId = typeof session.userId === "string" ? session.userId.trim() : typeof session.userId === "number" && Number.isSafeInteger(session.userId) ? String(session.userId) : "";
|
|
1879
|
+
if (currentUserId) query.currentUserId = currentUserId;
|
|
1880
|
+
for (let pageNo = 1; pageNo <= MAX_PAGES; pageNo += 1) {
|
|
1881
|
+
const response = await host.invoiceRequest({
|
|
1882
|
+
path: REQUEST_PATH,
|
|
1883
|
+
method: "POST",
|
|
1884
|
+
operation: options.operation,
|
|
1885
|
+
timeoutMs: REQUEST_TIMEOUT_MS,
|
|
1886
|
+
body: {
|
|
1887
|
+
pageNo,
|
|
1888
|
+
pageSize: PAGE_SIZE,
|
|
1889
|
+
cusCreateDateStart: query.cusCreateDateStart,
|
|
1890
|
+
cusCreateDateEnd: addCalendarDays(query.cusCreateDateEnd, 1)
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
assertRequestListSuccess(response);
|
|
1894
|
+
const raw = record(response)?.data;
|
|
1895
|
+
if (!Array.isArray(raw)) throw new Error("\u4E8B\u524D\u7533\u8BF7\u63A5\u53E3\u672A\u8FD4\u56DE data \u6570\u7EC4");
|
|
1896
|
+
const pageRows = raw.map((value) => {
|
|
1897
|
+
const row = record(value);
|
|
1898
|
+
if (!row) throw new Error("\u4E8B\u524D\u7533\u8BF7\u8BB0\u5F55\u7ED3\u6784\u5F02\u5E38");
|
|
1899
|
+
return { row, requestid: requiredId(row.requestid), workflowid: requiredId(row.workflowid) };
|
|
1900
|
+
});
|
|
1901
|
+
const signature2 = JSON.stringify(pageRows.map((row) => row.requestid).sort());
|
|
1902
|
+
if (seenPages.has(signature2)) return partial("repeated_page");
|
|
1903
|
+
const pageItems = pageRows.filter((row) => ORDINARY_WORKFLOWS.has(row.workflowid)).map(({ row, requestid, workflowid }) => candidate(row, requestid, workflowid));
|
|
1904
|
+
seenPages.add(signature2);
|
|
1905
|
+
for (const item of pageItems) {
|
|
1906
|
+
if (!items.has(item.requestid)) items.set(item.requestid, item);
|
|
1907
|
+
}
|
|
1908
|
+
completedPages += 1;
|
|
1909
|
+
received += raw.length;
|
|
1910
|
+
const envelope = record(response);
|
|
1911
|
+
const explicitMore = envelope.hasMore;
|
|
1912
|
+
if (explicitMore !== void 0 && typeof explicitMore !== "boolean") return partial("pagination_inconsistent");
|
|
1913
|
+
const rawTotal = envelope.total;
|
|
1914
|
+
const total = typeof rawTotal === "string" && /^\d+$/u.test(rawTotal) ? Number(rawTotal) : rawTotal;
|
|
1915
|
+
if (total !== void 0 && (!Number.isSafeInteger(total) || total < received)) return partial("pagination_inconsistent");
|
|
1916
|
+
const totalHasMore = total !== void 0 && received < total;
|
|
1917
|
+
if (explicitMore === false && totalHasMore) return partial("pagination_inconsistent");
|
|
1918
|
+
if (explicitMore === true || totalHasMore) {
|
|
1919
|
+
if (raw.length === 0) return partial("pagination_inconsistent");
|
|
1920
|
+
continue;
|
|
1921
|
+
}
|
|
1922
|
+
if (explicitMore === false || total !== void 0 || raw.length < PAGE_SIZE) {
|
|
1923
|
+
return { preApprovals: { status: "complete", items: [...items.values()], query, hasMore: false }, warnings: [] };
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
return partial("page_limit");
|
|
1927
|
+
} catch (error) {
|
|
1928
|
+
if (error && typeof error === "object" && "type" in error && error.type === "authentication") throw error;
|
|
1929
|
+
if (completedPages > 0) return partial("query_failed");
|
|
1930
|
+
return {
|
|
1931
|
+
preApprovals: { status: "unavailable", items: null, ...query ? { query } : {}, hasMore: null, reason: "query_failed" },
|
|
1932
|
+
warnings: ["\u666E\u901A\u4E8B\u524D\u7533\u8BF7\u5019\u9009\u6682\u4E0D\u53EF\u7528\uFF0C\u4E0D\u80FD\u89C6\u4E3A\u6CA1\u6709\u7533\u8BF7\uFF1B\u53D1\u7968\u7ED3\u679C\u4ECD\u6B63\u5E38\u8FD4\u56DE\u3002"]
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
// src/shortcuts/invoice/read-enrichment.ts
|
|
1938
|
+
var EXPENSE_TYPE_TIMEOUT_MS = 5e3;
|
|
1939
|
+
var EMPLOYEE_INFO_TIMEOUT_MS = 5e3;
|
|
1940
|
+
function employeeEntities(value) {
|
|
1941
|
+
if (value === void 0 || value === null) return [];
|
|
1942
|
+
if (!Array.isArray(value)) throw new Error("\u4EBA\u5458\u5B9E\u4F53\u4E0D\u662F\u6570\u7EC4");
|
|
1943
|
+
return value.map((row) => {
|
|
1944
|
+
const id = typeof row?.id === "string" ? row.id : typeof row?.id === "number" && Number.isSafeInteger(row.id) ? String(row.id) : null;
|
|
1945
|
+
if (id === null || typeof row?.name !== "string") throw new Error("\u4EBA\u5458\u5B9E\u4F53\u7F3A\u5C11\u6709\u6548 id / name");
|
|
1946
|
+
return { id, name: row.name };
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
async function readInvoiceEmployeeInfo(host, operation) {
|
|
1950
|
+
try {
|
|
1951
|
+
const session = await host.getSession();
|
|
1952
|
+
if (!session.userId) throw new Error("\u7F3A\u5C11\u5F53\u524D\u4EBA\u5458 ID");
|
|
1953
|
+
const result = await host.invoiceRequest({
|
|
1954
|
+
path: `/api/bs/hrm/card/get/${encodeURIComponent(session.userId)}`,
|
|
1955
|
+
method: "GET",
|
|
1956
|
+
query: { id: session.userId, readOnly: true },
|
|
1957
|
+
headers: { Referer: `${session.baseUrl.replace(/\/+$/u, "")}/sp/hrm/profileInfo/${encodeURIComponent(session.userId)}` },
|
|
1958
|
+
needsInvoiceToken: false,
|
|
1959
|
+
timeoutMs: EMPLOYEE_INFO_TIMEOUT_MS,
|
|
1960
|
+
operation
|
|
1961
|
+
});
|
|
1962
|
+
const succeeded = result?.code !== void 0 && result?.code !== null ? Number(result.code) === 200 : result?.status === true;
|
|
1963
|
+
if (!succeeded) throw new Error("\u4EBA\u5458\u5361\u7247\u8BF7\u6C42\u5931\u8D25");
|
|
1964
|
+
const card = result?.data?.data;
|
|
1965
|
+
if (!card || typeof card !== "object" || Array.isArray(card) || Object.keys(card).length === 0) {
|
|
1966
|
+
throw new Error("\u4EBA\u5458\u5361\u7247\u7F3A\u5C11\u4E1A\u52A1\u6570\u636E");
|
|
1967
|
+
}
|
|
1968
|
+
if (card.mobile !== void 0 && card.mobile !== null && typeof card.mobile !== "string") {
|
|
1969
|
+
throw new Error("\u4EBA\u5458\u624B\u673A\u53F7\u4E0D\u662F\u5B57\u7B26\u4E32");
|
|
1970
|
+
}
|
|
1971
|
+
return {
|
|
1972
|
+
info: {
|
|
1973
|
+
department: employeeEntities(card.department),
|
|
1974
|
+
mobile: card.mobile ?? null,
|
|
1975
|
+
location: employeeEntities(card.location)
|
|
1976
|
+
},
|
|
1977
|
+
warnings: []
|
|
1978
|
+
};
|
|
1979
|
+
} catch (error) {
|
|
1980
|
+
if (error && typeof error === "object" && "type" in error && error.type === "authentication") throw error;
|
|
1981
|
+
return { info: null, warnings: ["\u5F53\u524D\u4EBA\u5458\u4FE1\u606F\u6682\u4E0D\u53EF\u7528\uFF0CemployeeInfo \u8FD4\u56DE null\uFF1B\u53D1\u7968\u7ED3\u679C\u4ECD\u6B63\u5E38\u8FD4\u56DE\u3002"] };
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
async function readExpenseTypes(host, operation) {
|
|
1985
|
+
try {
|
|
1986
|
+
const result = await host.invoiceRequest({
|
|
1987
|
+
path: "/api/inc/syncFylx",
|
|
1988
|
+
method: "POST",
|
|
1989
|
+
operation,
|
|
1990
|
+
timeoutMs: EXPENSE_TYPE_TIMEOUT_MS,
|
|
1991
|
+
body: {
|
|
1992
|
+
start_pos: 0,
|
|
1993
|
+
page_size: 200,
|
|
1994
|
+
uc: 0,
|
|
1995
|
+
mask: 1023,
|
|
1996
|
+
req_base: { trace: String(Date.now()), dev: 1 }
|
|
1997
|
+
}
|
|
1998
|
+
});
|
|
1999
|
+
if (!Array.isArray(result?.infos)) {
|
|
2000
|
+
throw new Error("\u8D39\u7528\u7C7B\u578B\u5B57\u5178\u7F3A\u5C11 infos \u6570\u7EC4");
|
|
2001
|
+
}
|
|
2002
|
+
const names = /* @__PURE__ */ new Map();
|
|
2003
|
+
for (const row of result.infos) {
|
|
2004
|
+
const id = row?.fyid;
|
|
2005
|
+
const name = row?.fyn;
|
|
2006
|
+
if ((typeof id === "string" || typeof id === "number") && typeof name === "string" && name.trim()) {
|
|
2007
|
+
names.set(String(id), name);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
return { names, warnings: [] };
|
|
2011
|
+
} catch (error) {
|
|
2012
|
+
if (error instanceof InvoiceCliError && error.type === "authentication") throw error;
|
|
2013
|
+
return { names: null, warnings: ["\u8D39\u7528\u7C7B\u578B\u5B57\u5178\u6682\u4E0D\u53EF\u7528\uFF0Cfyn \u8FD4\u56DE null\uFF1B\u53D1\u7968\u548C\u76F8\u5173\u51ED\u8BC1\u4ECD\u6B63\u5E38\u8FD4\u56DE\u3002"] };
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
async function readInvoicesWithMetadata(host, request, options = {}) {
|
|
2017
|
+
if (options.includePreApprovals !== void 0 && typeof options.includePreApprovals !== "boolean") {
|
|
2018
|
+
throw new InvoiceCliError("validation", "input_invalid", "includePreApprovals \u5FC5\u987B\u662F\u5E03\u5C14\u503C");
|
|
2019
|
+
}
|
|
2020
|
+
const [response, types, employee] = await Promise.all([
|
|
2021
|
+
host.invoiceRequest(request),
|
|
2022
|
+
readExpenseTypes(host, request.operation),
|
|
2023
|
+
readInvoiceEmployeeInfo(host, request.operation)
|
|
2024
|
+
]);
|
|
2025
|
+
const missing = /* @__PURE__ */ new Set();
|
|
2026
|
+
const infos = Array.isArray(response?.infos) ? response.infos : [];
|
|
2027
|
+
for (const wrapper of infos) {
|
|
2028
|
+
const record4 = invoiceRecordOf(wrapper);
|
|
2029
|
+
const id = record4.fylx === void 0 || record4.fylx === null ? "" : String(record4.fylx);
|
|
2030
|
+
record4.fyn = types.names?.get(id) ?? null;
|
|
2031
|
+
record4.travel_ids = Array.isArray(record4.travel_ids) ? record4.travel_ids : [];
|
|
2032
|
+
if (id && types.names && record4.fyn === null) missing.add(id);
|
|
2033
|
+
}
|
|
2034
|
+
if (missing.size) {
|
|
2035
|
+
types.warnings.push(`\u8D39\u7528\u7C7B\u578B\u5B57\u5178\u672A\u5339\u914D ${missing.size} \u4E2A ID\uFF1A${[...missing].slice(0, 10).join("\u3001")}\uFF1B\u5BF9\u5E94 fyn \u8FD4\u56DE null\u3002`);
|
|
2036
|
+
}
|
|
2037
|
+
const approval = await readInvoicePreApprovals(host, {
|
|
2038
|
+
operation: request.operation,
|
|
2039
|
+
invoices: infos,
|
|
2040
|
+
includePreApprovals: options.includePreApprovals
|
|
2041
|
+
});
|
|
2042
|
+
return { response, employeeInfo: employee.info, preApprovals: approval.preApprovals, warnings: [...types.warnings, ...employee.warnings, ...approval.warnings] };
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
// src/shortcuts/invoice/operations/shared.ts
|
|
1706
2046
|
var LIST_FIELDS = /* @__PURE__ */ new Set([
|
|
1707
2047
|
"page_size",
|
|
1708
2048
|
"start_pos",
|
|
@@ -1911,7 +2251,7 @@ function detailFingerprint(info) {
|
|
|
1911
2251
|
})).digest("hex");
|
|
1912
2252
|
}
|
|
1913
2253
|
function detailInfo(value) {
|
|
1914
|
-
const item = Array.isArray(value?.infos) ? value.infos.find((
|
|
2254
|
+
const item = Array.isArray(value?.infos) ? value.infos.find((candidate2) => candidate2?.ret?.ret === 0 && candidate2.info) : void 0;
|
|
1915
2255
|
if (!item) {
|
|
1916
2256
|
throw new InvoiceCliError("api", "invoice_not_found", "\u672A\u627E\u5230\u6709\u6743\u67E5\u770B\u7684\u53D1\u7968", {
|
|
1917
2257
|
details: { result: value },
|
|
@@ -1920,7 +2260,7 @@ function detailInfo(value) {
|
|
|
1920
2260
|
}
|
|
1921
2261
|
return item.info;
|
|
1922
2262
|
}
|
|
1923
|
-
|
|
2263
|
+
function invoiceDetailRequest(input) {
|
|
1924
2264
|
const body = {};
|
|
1925
2265
|
if (input.fid !== void 0) body.ids = [asPositiveString(input.fid, "fid")];
|
|
1926
2266
|
if (body.ids === void 0 && input.number !== void 0) {
|
|
@@ -1930,11 +2270,14 @@ async function getDetail(input, host) {
|
|
|
1930
2270
|
body.number = input.number.trim();
|
|
1931
2271
|
}
|
|
1932
2272
|
if (!body.ids && !body.number) throw invoiceValidationError("input_invalid", "\u5FC5\u987B\u63D0\u4F9B fid \u6216 number");
|
|
1933
|
-
return
|
|
2273
|
+
return {
|
|
1934
2274
|
path: "/api/inc/get",
|
|
1935
2275
|
method: "POST",
|
|
1936
2276
|
body: { ...body, userFlag: "1", isDelFlag: "1", req_base: reqBase() }
|
|
1937
|
-
}
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
async function getDetail(input, host) {
|
|
2280
|
+
return host.invoiceRequest(invoiceDetailRequest(input));
|
|
1938
2281
|
}
|
|
1939
2282
|
function invoiceDetailUrl(baseUrl, fid) {
|
|
1940
2283
|
return `${baseUrl.replace(/\/+$/, "")}/sp/inc/incDetail?fid=${fid}`;
|
|
@@ -1965,17 +2308,6 @@ function numberOrZero(value) {
|
|
|
1965
2308
|
const parsed = Number(value);
|
|
1966
2309
|
return Number.isFinite(parsed) ? parsed : 0;
|
|
1967
2310
|
}
|
|
1968
|
-
function assertBusinessSuccess(value, subtype, fallbackMessage) {
|
|
1969
|
-
const result = value && typeof value === "object" ? value : {};
|
|
1970
|
-
const code = result.code ?? result.res_base?.ret;
|
|
1971
|
-
const failed = result.fail === true || result.status === false || code !== void 0 && code !== 0 && code !== 200;
|
|
1972
|
-
if (!failed) return;
|
|
1973
|
-
throw new InvoiceCliError("api", subtype, result.message || result.msg || result.res_base?.message || fallbackMessage, {
|
|
1974
|
-
code,
|
|
1975
|
-
details: { result },
|
|
1976
|
-
exitCode: 1
|
|
1977
|
-
});
|
|
1978
|
-
}
|
|
1979
2311
|
function uploadSource(input) {
|
|
1980
2312
|
const { file, url } = input;
|
|
1981
2313
|
if (file !== void 0 && url !== void 0) throw invoiceValidationError("input_ambiguous", "file \u4E0E url \u53EA\u80FD\u63D0\u4F9B\u4E00\u4E2A");
|
|
@@ -2186,8 +2518,8 @@ async function previewOcr(upload, host) {
|
|
|
2186
2518
|
}
|
|
2187
2519
|
return { results, invoices };
|
|
2188
2520
|
}
|
|
2189
|
-
function isRedReversedInvoice(
|
|
2190
|
-
const raw =
|
|
2521
|
+
function isRedReversedInvoice(record4) {
|
|
2522
|
+
const raw = record4?.comm_info?.pro?.status;
|
|
2191
2523
|
return (typeof raw === "number" ? raw : Number(raw ?? 0)) === 8;
|
|
2192
2524
|
}
|
|
2193
2525
|
async function listInvoices(input, host, flag) {
|
|
@@ -2202,23 +2534,31 @@ async function listInvoices(input, host, flag) {
|
|
|
2202
2534
|
req_base: reqBase()
|
|
2203
2535
|
};
|
|
2204
2536
|
for (const [key, value] of Object.entries(input)) {
|
|
2205
|
-
if (key === "flag") continue;
|
|
2537
|
+
if (key === "flag" || key === "includePreApprovals") continue;
|
|
2206
2538
|
if (!LIST_FIELDS.has(key)) throw invoiceValidationError("input_field_unsupported", `\u5217\u8868\u67E5\u8BE2\u4E0D\u652F\u6301\u5B57\u6BB5\uFF1A${key}`);
|
|
2207
2539
|
body[key] = normalizeListField(key, value);
|
|
2208
2540
|
}
|
|
2209
2541
|
const session = await host.getSession();
|
|
2210
|
-
const
|
|
2542
|
+
const { response: result, employeeInfo, preApprovals, warnings } = await readInvoicesWithMetadata(host, {
|
|
2543
|
+
path: "/api/inc/sync",
|
|
2544
|
+
method: "POST",
|
|
2545
|
+
body,
|
|
2546
|
+
operation: flag === 6 ? "invoice.enterprise.list" : "invoice.list"
|
|
2547
|
+
}, { includePreApprovals: input.includePreApprovals });
|
|
2211
2548
|
const items = (result.infos || []).filter((item) => !isRedReversedInvoice(invoiceRecordOf(item))).map((item) => {
|
|
2212
|
-
const
|
|
2213
|
-
if (
|
|
2214
|
-
const fid =
|
|
2215
|
-
if (fid)
|
|
2216
|
-
|
|
2549
|
+
const record4 = invoiceRecordOf(item);
|
|
2550
|
+
if (record4.fid !== void 0) record4.id = record4.fid;
|
|
2551
|
+
const fid = record4.fid ?? record4.id;
|
|
2552
|
+
if (fid) record4.detailUrl = invoiceDetailUrl(session.baseUrl, String(fid));
|
|
2553
|
+
record4.extInfo = invoiceExtInfo(record4);
|
|
2217
2554
|
return item;
|
|
2218
2555
|
});
|
|
2219
2556
|
return {
|
|
2220
2557
|
status: "COMPLETE",
|
|
2558
|
+
warnings,
|
|
2221
2559
|
data: {
|
|
2560
|
+
employeeInfo,
|
|
2561
|
+
preApprovals,
|
|
2222
2562
|
items,
|
|
2223
2563
|
total: result.total ?? 0,
|
|
2224
2564
|
totalAmount: result.totalTn ?? "0",
|
|
@@ -2236,15 +2576,15 @@ function epochSeconds(value, name, options = {}) {
|
|
|
2236
2576
|
if (Number.isInteger(value) && value >= 0) return value;
|
|
2237
2577
|
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F YYYY-MM-DD \u6216\u79D2\u7EA7\u65F6\u95F4\u6233`);
|
|
2238
2578
|
}
|
|
2239
|
-
const
|
|
2240
|
-
if (DATE_PATTERN.test(
|
|
2579
|
+
const text6 = typeof value === "string" ? value.trim() : "";
|
|
2580
|
+
if (DATE_PATTERN.test(text6)) {
|
|
2241
2581
|
const clock = options.endOfDay ? "T23:59:59+08:00" : "T00:00:00+08:00";
|
|
2242
|
-
const seconds = Math.floor(Date.parse(`${
|
|
2582
|
+
const seconds = Math.floor(Date.parse(`${text6}${clock}`) / 1e3);
|
|
2243
2583
|
if (!Number.isFinite(seconds)) throw invoiceValidationError("input_invalid", `${name} \u4E0D\u662F\u6709\u6548\u65E5\u671F`);
|
|
2244
2584
|
return seconds;
|
|
2245
2585
|
}
|
|
2246
|
-
if (/^\d+$/u.test(
|
|
2247
|
-
const seconds = Number(
|
|
2586
|
+
if (/^\d+$/u.test(text6)) {
|
|
2587
|
+
const seconds = Number(text6);
|
|
2248
2588
|
if (Number.isSafeInteger(seconds)) return seconds;
|
|
2249
2589
|
}
|
|
2250
2590
|
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F YYYY-MM-DD \u6216\u79D2\u7EA7\u65F6\u95F4\u6233`);
|
|
@@ -2578,7 +2918,7 @@ var InvoiceDeleteApplyOperation = class {
|
|
|
2578
2918
|
let verified = false;
|
|
2579
2919
|
try {
|
|
2580
2920
|
const after = await getDetail({ fid: lease.fid }, host);
|
|
2581
|
-
verified = !after?.infos?.some((
|
|
2921
|
+
verified = !after?.infos?.some((candidate2) => candidate2?.ret?.ret === 0 && candidate2.info);
|
|
2582
2922
|
} catch (error) {
|
|
2583
2923
|
if (error instanceof InvoiceCliError && error.type === "api") verified = true;
|
|
2584
2924
|
else {
|
|
@@ -2617,15 +2957,19 @@ var InvoiceDownloadOperation = class {
|
|
|
2617
2957
|
var InvoiceGetOperation = class {
|
|
2618
2958
|
name = "invoice.get";
|
|
2619
2959
|
async execute(input, { host }) {
|
|
2960
|
+
const request = invoiceDetailRequest(input);
|
|
2620
2961
|
const session = await host.getSession();
|
|
2621
|
-
const result = await
|
|
2962
|
+
const { response: result, employeeInfo, preApprovals, warnings } = await readInvoicesWithMetadata(host, { ...request, operation: this.name }, { includePreApprovals: input.includePreApprovals });
|
|
2622
2963
|
const infos = Array.isArray(result?.infos) ? result.infos : [];
|
|
2623
2964
|
for (const item of infos) {
|
|
2965
|
+
if (item?.info && typeof item.info === "object" && !Array.isArray(item.info)) {
|
|
2966
|
+
item.info.extInfo = invoiceExtInfo(item.info);
|
|
2967
|
+
}
|
|
2624
2968
|
if (item?.info?.fid !== void 0) item.info.id = item.info.fid;
|
|
2625
2969
|
const fid = item?.info?.fid ?? item?.info?.id;
|
|
2626
2970
|
if (fid) item.detailUrl = invoiceDetailUrl(session.baseUrl, String(fid));
|
|
2627
2971
|
}
|
|
2628
|
-
return { status: "COMPLETE", data: result };
|
|
2972
|
+
return { status: "COMPLETE", data: { ...result, employeeInfo, preApprovals }, warnings };
|
|
2629
2973
|
}
|
|
2630
2974
|
};
|
|
2631
2975
|
|
|
@@ -2744,7 +3088,7 @@ var InvoiceImportApplyOperation = class {
|
|
|
2744
3088
|
verified.push({ fid, info });
|
|
2745
3089
|
} catch {
|
|
2746
3090
|
throw invoicePartialError("\u5BFC\u5165\u5DF2\u8FD4\u56DE\u6210\u529F\uFF0C\u4F46\u8BE6\u60C5\u56DE\u67E5\u5931\u8D25\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A", {
|
|
2747
|
-
fids: succeeded.map((
|
|
3091
|
+
fids: succeeded.map((candidate2) => String(candidate2.info?.fid || candidate2.info?.id)),
|
|
2748
3092
|
result,
|
|
2749
3093
|
workflow: workflow("invoice.import", "VERIFYING")
|
|
2750
3094
|
}, { stage: "readback" });
|
|
@@ -2779,8 +3123,8 @@ var CUSTOMER_FIELD_TITLES = ["\u5BA2\u6237\u540D\u79F0", "\u6700\u7EC8\u7528\u62
|
|
|
2779
3123
|
var CONTRACT_FILE_FIELD_TITLE = "\u5408\u540C\u6B63\u6587\u53CA\u9644\u4EF6";
|
|
2780
3124
|
function textValue(value) {
|
|
2781
3125
|
if (value === void 0 || value === null) return null;
|
|
2782
|
-
const
|
|
2783
|
-
return
|
|
3126
|
+
const text6 = String(value).trim();
|
|
3127
|
+
return text6 === "" ? null : text6;
|
|
2784
3128
|
}
|
|
2785
3129
|
function mainFields(data) {
|
|
2786
3130
|
const details = data?.formData?.dataDetails;
|
|
@@ -2908,8 +3252,8 @@ function contractFilter(requestId) {
|
|
|
2908
3252
|
}
|
|
2909
3253
|
function textValue2(value) {
|
|
2910
3254
|
if (value === void 0 || value === null) return null;
|
|
2911
|
-
const
|
|
2912
|
-
return
|
|
3255
|
+
const text6 = String(value).trim();
|
|
3256
|
+
return text6 === "" ? null : text6;
|
|
2913
3257
|
}
|
|
2914
3258
|
function firstText2(rows, field) {
|
|
2915
3259
|
for (const row of rows) {
|
|
@@ -2927,12 +3271,12 @@ function sellerName(rows) {
|
|
|
2927
3271
|
return null;
|
|
2928
3272
|
}
|
|
2929
3273
|
function amountCents(value, requestId) {
|
|
2930
|
-
const
|
|
2931
|
-
if (
|
|
2932
|
-
if (!/^-?\d+(?:\.\d+)?$/u.test(
|
|
2933
|
-
throw new InvoiceCliError("api", "issuing_amount_invalid", `\u5408\u540C\u6D41\u7A0B ${requestId} \u7684\u5F00\u7968\u91D1\u989D\u4E0D\u662F\u6570\u5B57\uFF1A${
|
|
3274
|
+
const text6 = textValue2(value)?.replace(/,/g, "") ?? null;
|
|
3275
|
+
if (text6 === null) return 0;
|
|
3276
|
+
if (!/^-?\d+(?:\.\d+)?$/u.test(text6)) {
|
|
3277
|
+
throw new InvoiceCliError("api", "issuing_amount_invalid", `\u5408\u540C\u6D41\u7A0B ${requestId} \u7684\u5F00\u7968\u91D1\u989D\u4E0D\u662F\u6570\u5B57\uFF1A${text6}`, { exitCode: 1 });
|
|
2934
3278
|
}
|
|
2935
|
-
return Math.round(Number(
|
|
3279
|
+
return Math.round(Number(text6) * 100);
|
|
2936
3280
|
}
|
|
2937
3281
|
function formatCents(cents) {
|
|
2938
3282
|
return (cents / 100).toFixed(2);
|
|
@@ -3053,6 +3397,129 @@ var InvoiceIssuingContractsListOperation = class {
|
|
|
3053
3397
|
}
|
|
3054
3398
|
};
|
|
3055
3399
|
|
|
3400
|
+
// src/shortcuts/invoice/operations/issuing-red-requests.ts
|
|
3401
|
+
var REQUEST_BROWSER_PATH = "/api/workflow/core/common/browser/data/wfcRequest";
|
|
3402
|
+
var BLUE_INVOICE_WORKFLOW = {
|
|
3403
|
+
fixedVersionId: "100003460000000214",
|
|
3404
|
+
versionid: 1,
|
|
3405
|
+
relateFormTypes: [],
|
|
3406
|
+
// E10 IDs exceed Number.MAX_SAFE_INTEGER; keep the original decimal text.
|
|
3407
|
+
subCompanyId: "6998005497747218000",
|
|
3408
|
+
activeWfId: "100003460000000214",
|
|
3409
|
+
name: "\u5408\u540C\u6536\u6B3E\u53D1\u7968\u5F00\u5177\u53CA\u5FEB\u9012\u7533\u8BF7",
|
|
3410
|
+
moduleName: "workflow",
|
|
3411
|
+
formIds: ["100004030000000086"],
|
|
3412
|
+
id: "100003460000000214",
|
|
3413
|
+
workflowtype: "100501980000000032",
|
|
3414
|
+
workflowTypeName: "\u7C7B\u578B\uFF1A\u9879\u76EE\u7BA1\u7406",
|
|
3415
|
+
status: 1
|
|
3416
|
+
};
|
|
3417
|
+
function invalidResponse() {
|
|
3418
|
+
throw new InvoiceCliError("api", "issuing_red_requests_invalid", "\u67E5\u8BE2\u84DD\u5B57\u5F00\u7968\u7533\u8BF7\u8FD4\u56DE\u7684\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u65E0\u6CD5\u786E\u8BA4\u7EA2\u51B2\u5019\u9009", { exitCode: 1 });
|
|
3419
|
+
}
|
|
3420
|
+
function record2(value) {
|
|
3421
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return invalidResponse();
|
|
3422
|
+
return value;
|
|
3423
|
+
}
|
|
3424
|
+
function textValue3(row, ...keys) {
|
|
3425
|
+
for (const key of keys) {
|
|
3426
|
+
const value = row[key];
|
|
3427
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
3428
|
+
if (typeof value === "number" && Number.isSafeInteger(value)) return String(value);
|
|
3429
|
+
}
|
|
3430
|
+
return null;
|
|
3431
|
+
}
|
|
3432
|
+
function booleanValue(row, ...keys) {
|
|
3433
|
+
for (const key of keys) {
|
|
3434
|
+
if (typeof row[key] === "boolean") return row[key];
|
|
3435
|
+
}
|
|
3436
|
+
return null;
|
|
3437
|
+
}
|
|
3438
|
+
function requestIdOf2(row) {
|
|
3439
|
+
const raw = row.requestid ?? row.requestId ?? row.id;
|
|
3440
|
+
if (typeof raw === "number" && !Number.isSafeInteger(raw)) return invalidResponse();
|
|
3441
|
+
const id = typeof raw === "string" ? raw.trim() : typeof raw === "number" ? String(raw) : "";
|
|
3442
|
+
if (!/^[1-9]\d*$/u.test(id)) return invalidResponse();
|
|
3443
|
+
return id;
|
|
3444
|
+
}
|
|
3445
|
+
function normalizeRequest(value) {
|
|
3446
|
+
const row = record2(value);
|
|
3447
|
+
return {
|
|
3448
|
+
requestId: requestIdOf2(row),
|
|
3449
|
+
requestName: textValue3(row, "requestname", "requestName", "title", "name"),
|
|
3450
|
+
title: textValue3(row, "title"),
|
|
3451
|
+
name: textValue3(row, "name"),
|
|
3452
|
+
requestMark: textValue3(row, "requestmark", "requestMark"),
|
|
3453
|
+
workflowId: textValue3(row, "workflowid", "workflowId"),
|
|
3454
|
+
workflowName: textValue3(row, "workflowname", "workflowName"),
|
|
3455
|
+
flowStatus: textValue3(row, "flowstatus", "flowStatus"),
|
|
3456
|
+
flowStatusCode: textValue3(row, "flowstatuscode", "flowStatusCode"),
|
|
3457
|
+
creator: textValue3(row, "creater", "creator", "creatername", "creatorName"),
|
|
3458
|
+
creatorId: textValue3(row, "createrid", "creatorId"),
|
|
3459
|
+
createTime: textValue3(row, "createdatetime", "createTime", "createDateTime"),
|
|
3460
|
+
finished: booleanValue(row, "isComplete", "finished", "finish")
|
|
3461
|
+
};
|
|
3462
|
+
}
|
|
3463
|
+
function positiveInteger(value, name, defaultValue, maximum = Number.MAX_SAFE_INTEGER) {
|
|
3464
|
+
if (value === void 0) return defaultValue;
|
|
3465
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1 || value > maximum) {
|
|
3466
|
+
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F 1 \u5230 ${maximum} \u4E4B\u95F4\u7684\u6574\u6570`);
|
|
3467
|
+
}
|
|
3468
|
+
return value;
|
|
3469
|
+
}
|
|
3470
|
+
function pagination(root, data, current, pageSize, count) {
|
|
3471
|
+
const rawTotal = data.total ?? root.total;
|
|
3472
|
+
let total;
|
|
3473
|
+
if (rawTotal !== void 0 && rawTotal !== null) {
|
|
3474
|
+
if (typeof rawTotal !== "number" || !Number.isSafeInteger(rawTotal) || rawTotal < 0) return invalidResponse();
|
|
3475
|
+
total = rawTotal;
|
|
3476
|
+
}
|
|
3477
|
+
const explicitHasMore = data.hasMore ?? root.hasMore;
|
|
3478
|
+
if (explicitHasMore !== void 0 && explicitHasMore !== null && typeof explicitHasMore !== "boolean") return invalidResponse();
|
|
3479
|
+
return {
|
|
3480
|
+
current,
|
|
3481
|
+
pageSize,
|
|
3482
|
+
hasMore: typeof explicitHasMore === "boolean" ? explicitHasMore : total !== void 0 ? current < Math.ceil(total / pageSize) : count >= pageSize,
|
|
3483
|
+
...total !== void 0 ? { total } : {}
|
|
3484
|
+
};
|
|
3485
|
+
}
|
|
3486
|
+
var InvoiceIssuingRedRequestsListOperation = class {
|
|
3487
|
+
name = "invoice.issuing.red.requests.list";
|
|
3488
|
+
async execute(input, { host }) {
|
|
3489
|
+
const customerName = asNonEmptyString(input.customerName, "customerName");
|
|
3490
|
+
const current = positiveInteger(input.current, "current", 1);
|
|
3491
|
+
const pageSize = positiveInteger(input.pageSize, "pageSize", 10, 100);
|
|
3492
|
+
const result = await host.invoiceRequest({
|
|
3493
|
+
path: REQUEST_BROWSER_PATH,
|
|
3494
|
+
method: "POST",
|
|
3495
|
+
body: {
|
|
3496
|
+
browserMultiple: true,
|
|
3497
|
+
currentTab: "all",
|
|
3498
|
+
current,
|
|
3499
|
+
pageSize,
|
|
3500
|
+
formDatas: {
|
|
3501
|
+
workflowid: [{ term: "in", browserDatas: [{ ...BLUE_INVOICE_WORKFLOW }] }]
|
|
3502
|
+
},
|
|
3503
|
+
quickSearchDatas: { requestname: customerName, requestmark: customerName }
|
|
3504
|
+
},
|
|
3505
|
+
operation: this.name
|
|
3506
|
+
});
|
|
3507
|
+
assertBusinessSuccess(result, "issuing_red_requests_query_failed", "\u67E5\u8BE2\u84DD\u5B57\u5F00\u7968\u7533\u8BF7\u5931\u8D25");
|
|
3508
|
+
const root = record2(result);
|
|
3509
|
+
const data = record2(root.data);
|
|
3510
|
+
if (!Array.isArray(data.data)) return invalidResponse();
|
|
3511
|
+
const items = data.data.map(normalizeRequest);
|
|
3512
|
+
return {
|
|
3513
|
+
status: "COMPLETE",
|
|
3514
|
+
data: {
|
|
3515
|
+
items,
|
|
3516
|
+
count: items.length,
|
|
3517
|
+
...pagination(root, data, current, pageSize, items.length)
|
|
3518
|
+
}
|
|
3519
|
+
};
|
|
3520
|
+
}
|
|
3521
|
+
};
|
|
3522
|
+
|
|
3056
3523
|
// src/shortcuts/invoice/operations/list.ts
|
|
3057
3524
|
var InvoiceListOperation = class {
|
|
3058
3525
|
constructor(name, flag) {
|
|
@@ -3123,33 +3590,12 @@ function optionalString(value, name) {
|
|
|
3123
3590
|
return asNonEmptyString(value, name);
|
|
3124
3591
|
}
|
|
3125
3592
|
function optionalDate(value, name) {
|
|
3126
|
-
const
|
|
3127
|
-
if (
|
|
3128
|
-
if (!/^\d{4}-\d{2}-\d{2}$/u.test(
|
|
3593
|
+
const text6 = optionalString(value, name);
|
|
3594
|
+
if (text6 === void 0) return void 0;
|
|
3595
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(text6)) {
|
|
3129
3596
|
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F YYYY-MM-DD`);
|
|
3130
3597
|
}
|
|
3131
|
-
return
|
|
3132
|
-
}
|
|
3133
|
-
function formatUtcDate(date) {
|
|
3134
|
-
const y = date.getUTCFullYear();
|
|
3135
|
-
const m = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
3136
|
-
const d = String(date.getUTCDate()).padStart(2, "0");
|
|
3137
|
-
return `${y}-${m}-${d}`;
|
|
3138
|
-
}
|
|
3139
|
-
function addCalendarDays(isoDate, offsetDays) {
|
|
3140
|
-
const [year, month, day] = isoDate.split("-").map(Number);
|
|
3141
|
-
return formatUtcDate(new Date(Date.UTC(year, (month ?? 1) - 1, (day ?? 1) + offsetDays)));
|
|
3142
|
-
}
|
|
3143
|
-
function addCalendarMonths(isoDate, offsetMonths) {
|
|
3144
|
-
const [year, month, day] = isoDate.split("-").map(Number);
|
|
3145
|
-
const target = new Date(Date.UTC(year, (month ?? 1) - 1 + offsetMonths, 1));
|
|
3146
|
-
const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate();
|
|
3147
|
-
target.setUTCDate(Math.min(day ?? 1, lastDay));
|
|
3148
|
-
return formatUtcDate(target);
|
|
3149
|
-
}
|
|
3150
|
-
function shanghaiCalendarDate(offsetDays = 0, now = /* @__PURE__ */ new Date()) {
|
|
3151
|
-
const today = new Intl.DateTimeFormat("en-CA", { timeZone: "Asia/Shanghai" }).format(now);
|
|
3152
|
-
return offsetDays === 0 ? today : addCalendarDays(today, offsetDays);
|
|
3598
|
+
return text6;
|
|
3153
3599
|
}
|
|
3154
3600
|
var REQUEST_DEFAULT_LOOKBACK_DAYS = 7;
|
|
3155
3601
|
var REQUEST_PHONE_LOOKBACK_DAYS = 90;
|
|
@@ -3194,45 +3640,9 @@ function projectRequestListItem(item) {
|
|
|
3194
3640
|
}
|
|
3195
3641
|
function projectRequestListResult(value) {
|
|
3196
3642
|
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
3197
|
-
const
|
|
3198
|
-
if (!Array.isArray(
|
|
3199
|
-
return { ...
|
|
3200
|
-
}
|
|
3201
|
-
var UNSAFE_JSON_INTEGER_ID = /("id"\s*:\s*)(-?\d{16,})(?=\s*[,}\]])/g;
|
|
3202
|
-
function quoteEmployeeIdsInJsonText(text5) {
|
|
3203
|
-
return text5.replace(UNSAFE_JSON_INTEGER_ID, '$1"$2"');
|
|
3204
|
-
}
|
|
3205
|
-
function employeeIdString(value) {
|
|
3206
|
-
if (typeof value === "bigint") return value.toString();
|
|
3207
|
-
if (typeof value === "number" && Number.isFinite(value)) return String(Math.trunc(value));
|
|
3208
|
-
if (typeof value === "string") return value;
|
|
3209
|
-
return value;
|
|
3210
|
-
}
|
|
3211
|
-
function stringifyEmployeeRecordId(employee) {
|
|
3212
|
-
if (!employee || typeof employee !== "object" || Array.isArray(employee)) return employee;
|
|
3213
|
-
const record2 = employee;
|
|
3214
|
-
if (!("id" in record2)) return employee;
|
|
3215
|
-
return { ...record2, id: employeeIdString(record2.id) };
|
|
3216
|
-
}
|
|
3217
|
-
function stringifyEmployeeSuperiorsPayload(payload) {
|
|
3218
|
-
if ("currentEmployee" in payload) {
|
|
3219
|
-
payload.currentEmployee = stringifyEmployeeRecordId(payload.currentEmployee);
|
|
3220
|
-
}
|
|
3221
|
-
if (Array.isArray(payload.allSuperiors)) {
|
|
3222
|
-
payload.allSuperiors = payload.allSuperiors.map(stringifyEmployeeRecordId);
|
|
3223
|
-
}
|
|
3224
|
-
}
|
|
3225
|
-
function stringifyEmployeeSuperiorsIds(value) {
|
|
3226
|
-
if (!value || typeof value !== "object") return value;
|
|
3227
|
-
const cloned = structuredClone(value);
|
|
3228
|
-
stringifyEmployeeSuperiorsPayload(cloned);
|
|
3229
|
-
if (cloned.data && typeof cloned.data === "object" && !Array.isArray(cloned.data)) {
|
|
3230
|
-
stringifyEmployeeSuperiorsPayload(cloned.data);
|
|
3231
|
-
}
|
|
3232
|
-
return cloned;
|
|
3233
|
-
}
|
|
3234
|
-
function employeeSuperiorsEnvelope(value) {
|
|
3235
|
-
return resultEnvelope(stringifyEmployeeSuperiorsIds(value), "invoice.reim.employee-superiors");
|
|
3643
|
+
const record4 = value;
|
|
3644
|
+
if (!Array.isArray(record4.data)) return value;
|
|
3645
|
+
return { ...record4, data: record4.data.map(projectRequestListItem) };
|
|
3236
3646
|
}
|
|
3237
3647
|
var InvoiceReimFileOcrPreviewOperation = class {
|
|
3238
3648
|
name = "invoice.reim.file-ocr.preview";
|
|
@@ -3322,65 +3732,6 @@ var InvoiceReimWorkflowResolveOperation = class {
|
|
|
3322
3732
|
return resultEnvelope(result, "invoice.reim.workflow.resolve");
|
|
3323
3733
|
}
|
|
3324
3734
|
};
|
|
3325
|
-
var InvoiceReimEmployeeSuperiorsOperation = class {
|
|
3326
|
-
name = "invoice.reim.employee-superiors";
|
|
3327
|
-
async execute(_input, { host }) {
|
|
3328
|
-
const result = await host.invoiceRequest({
|
|
3329
|
-
path: "/api/inc/book/getEmployeeSuperiors",
|
|
3330
|
-
method: "GET",
|
|
3331
|
-
operation: this.name,
|
|
3332
|
-
rewriteJsonText: quoteEmployeeIdsInJsonText
|
|
3333
|
-
});
|
|
3334
|
-
return employeeSuperiorsEnvelope(result);
|
|
3335
|
-
}
|
|
3336
|
-
};
|
|
3337
|
-
function projectFieldSearchItems(value) {
|
|
3338
|
-
const raw = Array.isArray(value) ? value : [];
|
|
3339
|
-
const items = [];
|
|
3340
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3341
|
-
for (const item of raw) {
|
|
3342
|
-
const record2 = item && typeof item === "object" && !Array.isArray(item) ? item : {};
|
|
3343
|
-
const id = String(record2.id ?? record2.value ?? "").trim();
|
|
3344
|
-
const name = String(record2.name ?? "").trim();
|
|
3345
|
-
if (!id || !name || seen.has(id)) continue;
|
|
3346
|
-
seen.add(id);
|
|
3347
|
-
items.push({ id, name, value: id });
|
|
3348
|
-
}
|
|
3349
|
-
return items;
|
|
3350
|
-
}
|
|
3351
|
-
var InvoiceReimFieldSearchOperation = class {
|
|
3352
|
-
name = "invoice.reim.field.search";
|
|
3353
|
-
async execute(input, { host }) {
|
|
3354
|
-
const keywords = asNonEmptyString(input.keywords, "keywords");
|
|
3355
|
-
const result = await host.invoiceRequest({
|
|
3356
|
-
path: "/api/government/formStructure/fieldRelateSearch",
|
|
3357
|
-
method: "GET",
|
|
3358
|
-
query: {
|
|
3359
|
-
keywords,
|
|
3360
|
-
fieldId: asNonEmptyString(input.fieldId, "fieldId"),
|
|
3361
|
-
formModeType: "wf",
|
|
3362
|
-
workflowId: asNonEmptyString(input.workflowId, "workflowId"),
|
|
3363
|
-
nodeId: optionalString(input.nodeId, "nodeId") || "100004140000000271"
|
|
3364
|
-
},
|
|
3365
|
-
operation: this.name
|
|
3366
|
-
});
|
|
3367
|
-
assertBusinessSuccess(result, "invoice.reim.field.search_failed", "\u641C\u7D22\u5173\u8054\u5B57\u6BB5\u5931\u8D25");
|
|
3368
|
-
const items = projectFieldSearchItems(responseData(result));
|
|
3369
|
-
const match = items.length === 0 ? "none" : items.length === 1 ? "unique" : "multiple";
|
|
3370
|
-
return {
|
|
3371
|
-
status: "COMPLETE",
|
|
3372
|
-
data: {
|
|
3373
|
-
result,
|
|
3374
|
-
data: items,
|
|
3375
|
-
keywords,
|
|
3376
|
-
match,
|
|
3377
|
-
items,
|
|
3378
|
-
selected: match === "unique" ? items[0] : null,
|
|
3379
|
-
workflow: workflow(this.name, "COMPLETE")
|
|
3380
|
-
}
|
|
3381
|
-
};
|
|
3382
|
-
}
|
|
3383
|
-
};
|
|
3384
3735
|
|
|
3385
3736
|
// src/shortcuts/invoice/operations/reim-auto.ts
|
|
3386
3737
|
var MONEY_PATTERN2 = /^-?\d+(?:\.\d{1,2})?$/u;
|
|
@@ -3431,6 +3782,9 @@ function reimRequestNames(info) {
|
|
|
3431
3782
|
function candidateItem(info) {
|
|
3432
3783
|
const pro = info?.comm_info?.pro || {};
|
|
3433
3784
|
const price = info?.comm_info?.price || {};
|
|
3785
|
+
const extInfo = invoiceExtInfo(info);
|
|
3786
|
+
const consumptionTime = info?.modify_info?.cstm;
|
|
3787
|
+
const hasConsumptionTime = typeof consumptionTime === "number" || typeof consumptionTime === "string" && consumptionTime.trim().length > 0;
|
|
3434
3788
|
return {
|
|
3435
3789
|
fid: invoiceRecordId(info),
|
|
3436
3790
|
number: String(info.number ?? ""),
|
|
@@ -3439,6 +3793,10 @@ function candidateItem(info) {
|
|
|
3439
3793
|
buyer: String(info?.comm_info?.buyer?.company ?? ""),
|
|
3440
3794
|
payer: String(info?.comm_info?.payer?.company ?? ""),
|
|
3441
3795
|
typeName: String(pro.cname ?? ""),
|
|
3796
|
+
content: String(pro.content ?? "").trim() || extInfo.content || "",
|
|
3797
|
+
extInfo,
|
|
3798
|
+
...hasConsumptionTime ? { consumptionTime } : {},
|
|
3799
|
+
travel_ids: Array.isArray(info.travel_ids) ? info.travel_ids : [],
|
|
3442
3800
|
status: typeof pro.status === "number" ? pro.status : Number(pro.status ?? 0),
|
|
3443
3801
|
valid: typeof pro.valid === "number" ? pro.valid : Number(pro.valid ?? 0),
|
|
3444
3802
|
reimRequests: reimRequestNames(info)
|
|
@@ -3447,6 +3805,9 @@ function candidateItem(info) {
|
|
|
3447
3805
|
var InvoiceReimCandidatesListOperation = class {
|
|
3448
3806
|
name = "invoice.reim.candidates.list";
|
|
3449
3807
|
async execute(input, { host }) {
|
|
3808
|
+
if (input.includePreApprovals !== void 0 && typeof input.includePreApprovals !== "boolean") {
|
|
3809
|
+
throw invoiceValidationError("input_invalid", "includePreApprovals \u5FC5\u987B\u662F\u5E03\u5C14\u503C");
|
|
3810
|
+
}
|
|
3450
3811
|
const pageSize = boundedInteger(input.page_size, "page_size", { min: 10, max: 200, defaultValue: 50 });
|
|
3451
3812
|
const maxItems = boundedInteger(input.max_items, "max_items", { min: 1, max: 500, defaultValue: 200 });
|
|
3452
3813
|
const dateBegin = optionalEpochSeconds(input.date_begin, "date_begin");
|
|
@@ -3465,6 +3826,7 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3465
3826
|
let hasMore = false;
|
|
3466
3827
|
let startPos = 0;
|
|
3467
3828
|
let pulled = 0;
|
|
3829
|
+
let employee;
|
|
3468
3830
|
do {
|
|
3469
3831
|
const body = {
|
|
3470
3832
|
flag: 0,
|
|
@@ -3473,17 +3835,31 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3473
3835
|
req_type: 1,
|
|
3474
3836
|
sreim: "3",
|
|
3475
3837
|
bill_type: 0,
|
|
3838
|
+
mext: FULL_EXT_MASK,
|
|
3476
3839
|
req_base: reqBase()
|
|
3477
3840
|
};
|
|
3478
3841
|
if (dateBegin !== void 0) body.date_begin = dateBegin;
|
|
3479
3842
|
if (dateEnd !== void 0) body.date_end = dateEnd;
|
|
3480
3843
|
if (consumptionBegin !== void 0) body.consumption_tm_begin = consumptionBegin;
|
|
3481
3844
|
if (consumptionEnd !== void 0) body.consumption_tm_end = consumptionEnd;
|
|
3482
|
-
const
|
|
3845
|
+
const request = { path: "/api/inc/sync", method: "POST", body, operation: this.name };
|
|
3846
|
+
let result;
|
|
3847
|
+
if (!employee) {
|
|
3848
|
+
const [response, employeeResult] = await Promise.all([
|
|
3849
|
+
host.invoiceRequest(request),
|
|
3850
|
+
readInvoiceEmployeeInfo(host, this.name)
|
|
3851
|
+
]);
|
|
3852
|
+
result = response;
|
|
3853
|
+
employee = employeeResult;
|
|
3854
|
+
warnings.push(...employee.warnings);
|
|
3855
|
+
} else {
|
|
3856
|
+
result = await host.invoiceRequest(request);
|
|
3857
|
+
}
|
|
3483
3858
|
total = Number(result?.total ?? 0);
|
|
3484
3859
|
const infos = Array.isArray(result?.infos) ? result.infos : [];
|
|
3485
|
-
for (const
|
|
3860
|
+
for (const raw of infos) {
|
|
3486
3861
|
pulled += 1;
|
|
3862
|
+
const info = invoiceRecordOf(raw);
|
|
3487
3863
|
if (isRedReversedInvoice(info)) continue;
|
|
3488
3864
|
kept.push(info);
|
|
3489
3865
|
}
|
|
@@ -3513,6 +3889,12 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3513
3889
|
availableAmount: summarize(available),
|
|
3514
3890
|
assignedAmount: summarize(assigned)
|
|
3515
3891
|
};
|
|
3892
|
+
const approval = await readInvoicePreApprovals(host, {
|
|
3893
|
+
operation: this.name,
|
|
3894
|
+
invoices: capped,
|
|
3895
|
+
includePreApprovals: input.includePreApprovals
|
|
3896
|
+
});
|
|
3897
|
+
warnings.push(...approval.warnings);
|
|
3516
3898
|
return {
|
|
3517
3899
|
status: "COMPLETE",
|
|
3518
3900
|
data: {
|
|
@@ -3522,6 +3904,8 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3522
3904
|
available,
|
|
3523
3905
|
assigned,
|
|
3524
3906
|
summary,
|
|
3907
|
+
employeeInfo: employee?.info ?? null,
|
|
3908
|
+
preApprovals: approval.preApprovals,
|
|
3525
3909
|
warnings,
|
|
3526
3910
|
workflow: workflow(this.name, "COMPLETE")
|
|
3527
3911
|
}
|
|
@@ -3529,25 +3913,117 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3529
3913
|
}
|
|
3530
3914
|
};
|
|
3531
3915
|
|
|
3916
|
+
// src/shortcuts/invoice/operations/reim-customer-projects.ts
|
|
3917
|
+
var CUSTOMER_PROJECT_NAME_FIELD = "1020275734718578690";
|
|
3918
|
+
var PAGE_ID2 = "1144658644836794483";
|
|
3919
|
+
var APP_ID = "1136121637129502949";
|
|
3920
|
+
var COMP_ID2 = "f5b2b31aeb2e4e46956464bba7d2e52c";
|
|
3921
|
+
var PAGE_SIZE2 = 10;
|
|
3922
|
+
var MAX_PAGES2 = 20;
|
|
3923
|
+
function projectFilter(customerId) {
|
|
3924
|
+
return [{
|
|
3925
|
+
conditionType: "and",
|
|
3926
|
+
dataType: "field",
|
|
3927
|
+
value: customerId,
|
|
3928
|
+
filterFields: [{
|
|
3929
|
+
compType: "Ebuilder",
|
|
3930
|
+
dataset: {
|
|
3931
|
+
id: "1020275562853482532",
|
|
3932
|
+
text: "\u9879\u76EE\u57FA\u7840",
|
|
3933
|
+
type: "LOGIC",
|
|
3934
|
+
groupId: "weaver-ebuilder-form-service",
|
|
3935
|
+
isPhysical: true,
|
|
3936
|
+
usage: "all",
|
|
3937
|
+
detailTable: false,
|
|
3938
|
+
objType: "physical",
|
|
3939
|
+
module: "ebuilder",
|
|
3940
|
+
appId: "1020021532740116481",
|
|
3941
|
+
ebuilderDataConfig: { dataSetup: { dataSource: "ALL", dataPermission: "HAVE_PERMISSION_DATA", dataType: "ALL" }, type: "FORM" },
|
|
3942
|
+
isFormModuleSelected: true,
|
|
3943
|
+
hasChangeGroupFilter: false,
|
|
3944
|
+
hasChangePermissions: true,
|
|
3945
|
+
hasChangeExtConfig: false
|
|
3946
|
+
},
|
|
3947
|
+
fieldName: "field_1149506138249011280",
|
|
3948
|
+
id: "1149506138249011280",
|
|
3949
|
+
objId: "1020275562853482532",
|
|
3950
|
+
type: "Ebuilder",
|
|
3951
|
+
text: "\u5173\u8054\u5BA2\u6237"
|
|
3952
|
+
}]
|
|
3953
|
+
}];
|
|
3954
|
+
}
|
|
3955
|
+
function projectError(subtype, message) {
|
|
3956
|
+
return new InvoiceCliError("api", subtype, message, { exitCode: 1 });
|
|
3957
|
+
}
|
|
3958
|
+
function project(value) {
|
|
3959
|
+
const row = value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3960
|
+
if (!row || typeof row.form_data_id !== "string" || !/^[1-9]\d*$/u.test(row.form_data_id) || typeof row[CUSTOMER_PROJECT_NAME_FIELD] !== "string" || !row[CUSTOMER_PROJECT_NAME_FIELD].trim()) {
|
|
3961
|
+
throw projectError("reim_customer_projects_invalid", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u9879\u76EE ID \u6216\u9879\u76EE\u540D\u79F0");
|
|
3962
|
+
}
|
|
3963
|
+
return { relatedProjectName: row[CUSTOMER_PROJECT_NAME_FIELD], relatedProjectId: row.form_data_id };
|
|
3964
|
+
}
|
|
3965
|
+
async function readInvoiceCustomerProjects(host, customerId, operation, deadline, cancelled = () => false) {
|
|
3966
|
+
const projects = /* @__PURE__ */ new Map();
|
|
3967
|
+
const seenPages = /* @__PURE__ */ new Set();
|
|
3968
|
+
for (let pageNo = 1; pageNo <= MAX_PAGES2; pageNo += 1) {
|
|
3969
|
+
if (cancelled()) throw projectError("reim_customer_projects_incomplete", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u5DF2\u505C\u6B62");
|
|
3970
|
+
const remaining = deadline - Date.now();
|
|
3971
|
+
if (remaining <= 0) throw projectError("reim_customer_projects_incomplete", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u8FBE\u5230\u672C\u6B21\u67E5\u8BE2\u65F6\u95F4\u4E0A\u9650\uFF0C\u9879\u76EE\u5019\u9009\u672A\u8BFB\u5B8C\u6574");
|
|
3972
|
+
const result = await host.invoiceMultipartRequest({
|
|
3973
|
+
path: "/api/ebuilder/form/eblist/getData",
|
|
3974
|
+
method: "POST",
|
|
3975
|
+
operation,
|
|
3976
|
+
timeoutMs: Math.min(5e3, remaining),
|
|
3977
|
+
headers: {
|
|
3978
|
+
ebbusinessid: PAGE_ID2,
|
|
3979
|
+
langtype: "zh_CN",
|
|
3980
|
+
pragma: "no-cache",
|
|
3981
|
+
priority: "u=1, i",
|
|
3982
|
+
timezoneoffset: "-480",
|
|
3983
|
+
Accept: "*/*"
|
|
3984
|
+
},
|
|
3985
|
+
fields: {
|
|
3986
|
+
[`appId_${PAGE_ID2}`]: APP_ID,
|
|
3987
|
+
filter: projectFilter(customerId),
|
|
3988
|
+
pageAppId: APP_ID,
|
|
3989
|
+
compId: COMP_ID2,
|
|
3990
|
+
pageId: PAGE_ID2,
|
|
3991
|
+
pageNo: String(pageNo),
|
|
3992
|
+
pageSize: String(PAGE_SIZE2)
|
|
3993
|
+
}
|
|
3994
|
+
});
|
|
3995
|
+
assertBusinessSuccess(result, "reim_customer_projects_failed", "\u67E5\u8BE2\u5BA2\u6237\u76F8\u5173\u9879\u76EE\u5931\u8D25");
|
|
3996
|
+
const data = result?.data;
|
|
3997
|
+
if (!data || !Array.isArray(data.list)) throw projectError("reim_customer_projects_invalid", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u672A\u8FD4\u56DE data.list \u6570\u7EC4");
|
|
3998
|
+
const page = data.list.map(project);
|
|
3999
|
+
const signature2 = JSON.stringify(page.map((item) => item.relatedProjectId).sort());
|
|
4000
|
+
if (seenPages.has(signature2)) throw projectError("reim_customer_projects_incomplete", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u8FD4\u56DE\u91CD\u590D\u9875\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B8C\u6574\u9879\u76EE\u5019\u9009");
|
|
4001
|
+
seenPages.add(signature2);
|
|
4002
|
+
for (const item of page) {
|
|
4003
|
+
if (!projects.has(item.relatedProjectId)) projects.set(item.relatedProjectId, item);
|
|
4004
|
+
}
|
|
4005
|
+
if (data.list.length < PAGE_SIZE2) return [...projects.values()];
|
|
4006
|
+
}
|
|
4007
|
+
throw projectError("reim_customer_projects_incomplete", "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u8FBE\u5230 20 \u9875\u4E0A\u9650\uFF0C\u9879\u76EE\u5019\u9009\u672A\u8BFB\u5B8C\u6574");
|
|
4008
|
+
}
|
|
4009
|
+
|
|
3532
4010
|
// src/shortcuts/invoice/operations/reim-customer.ts
|
|
3533
4011
|
var CUSTOMER_PAGE_ID = "1218181956452048911";
|
|
3534
4012
|
var CUSTOMER_COMP_ID = "c39b9e14c0034336adf9e9bc39aeed75";
|
|
3535
4013
|
var CUSTOMER_OBJECT_ID = "1173221220888059964";
|
|
3536
4014
|
var CUSTOMER_NAME_FIELD = "1173221220888062665";
|
|
3537
4015
|
var CUSTOMER_BEARER_FIELD = "1173221220888062667";
|
|
4016
|
+
var CUSTOMER_PAGE_SIZE = 10;
|
|
4017
|
+
var CUSTOMER_MAX_PAGES = 20;
|
|
3538
4018
|
function customerFilter(keywords) {
|
|
3539
4019
|
return [
|
|
3540
4020
|
{
|
|
3541
4021
|
conditionType: "or",
|
|
3542
4022
|
dataType: "field",
|
|
3543
|
-
id: "f9bf956948e54ed58ac32988ff8a84c8",
|
|
3544
|
-
conditionComId: `${CUSTOMER_COMP_ID}_quick_EXCLUDECACHE`,
|
|
3545
4023
|
filterFields: [{
|
|
3546
|
-
compId: CUSTOMER_COMP_ID,
|
|
3547
4024
|
compType: "Text",
|
|
3548
4025
|
dataset: {
|
|
3549
4026
|
isPhysical: true,
|
|
3550
|
-
ebuilderDataConfig: { dataSetup: {}, type: "FORM" },
|
|
3551
4027
|
detailTable: false,
|
|
3552
4028
|
groupId: "weaver-ebuilder-form-service",
|
|
3553
4029
|
usage: "all",
|
|
@@ -3559,55 +4035,48 @@ function customerFilter(keywords) {
|
|
|
3559
4035
|
},
|
|
3560
4036
|
fieldName: `field_${CUSTOMER_NAME_FIELD}`,
|
|
3561
4037
|
id: CUSTOMER_NAME_FIELD,
|
|
3562
|
-
objId: CUSTOMER_OBJECT_ID
|
|
3563
|
-
type: "String",
|
|
3564
|
-
text: "\u540D\u79F0"
|
|
4038
|
+
objId: CUSTOMER_OBJECT_ID
|
|
3565
4039
|
}],
|
|
3566
4040
|
value: keywords
|
|
3567
|
-
},
|
|
3568
|
-
{
|
|
3569
|
-
conditionComId: `${CUSTOMER_COMP_ID}_filter_EXCLUDECACHE`,
|
|
3570
|
-
conditionType: "and",
|
|
3571
|
-
dataType: "classification",
|
|
3572
|
-
useConfig: true
|
|
3573
4041
|
}
|
|
3574
4042
|
];
|
|
3575
4043
|
}
|
|
3576
|
-
function
|
|
4044
|
+
function invalidResponse2() {
|
|
3577
4045
|
throw new InvoiceCliError("api", "reim_customer_search_invalid", "\u5BA2\u6237\u67E5\u8BE2\u8FD4\u56DE\u7684\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u65E0\u6CD5\u786E\u8BA4\u76F8\u5173\u5BA2\u6237\u548C\u627F\u62C5\u4E3B\u4F53", { exitCode: 1 });
|
|
3578
4046
|
}
|
|
3579
|
-
function
|
|
3580
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return
|
|
4047
|
+
function record3(value) {
|
|
4048
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return invalidResponse2();
|
|
3581
4049
|
return value;
|
|
3582
4050
|
}
|
|
3583
4051
|
function responseString(value) {
|
|
3584
|
-
if (typeof value !== "string" || !value.trim()) return
|
|
4052
|
+
if (typeof value !== "string" || !value.trim()) return invalidResponse2();
|
|
3585
4053
|
return value;
|
|
3586
4054
|
}
|
|
4055
|
+
function responseId(value) {
|
|
4056
|
+
const id = responseString(value);
|
|
4057
|
+
if (!/^[1-9]\d*$/u.test(id)) return invalidResponse2();
|
|
4058
|
+
return id;
|
|
4059
|
+
}
|
|
3587
4060
|
function projectCustomer(value) {
|
|
3588
|
-
const row =
|
|
4061
|
+
const row = record3(value);
|
|
3589
4062
|
const bearers = row[CUSTOMER_BEARER_FIELD] ?? [];
|
|
3590
|
-
if (!Array.isArray(bearers)) return
|
|
4063
|
+
if (!Array.isArray(bearers)) return invalidResponse2();
|
|
3591
4064
|
return {
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
const bearer =
|
|
4065
|
+
customerId: responseId(row.form_data_id ?? row.id),
|
|
4066
|
+
customerName: responseString(row[CUSTOMER_NAME_FIELD]),
|
|
4067
|
+
expenseBearer: bearers.map((value2) => {
|
|
4068
|
+
const bearer = record3(value2);
|
|
3596
4069
|
return {
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
type: responseString(bearer.type)
|
|
4070
|
+
expenseBearerName: responseString(bearer.name),
|
|
4071
|
+
expenseBearerId: responseId(bearer.id)
|
|
3600
4072
|
};
|
|
3601
4073
|
})
|
|
3602
4074
|
};
|
|
3603
4075
|
}
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
throw invoiceValidationError("input_invalid", "\u5BA2\u6237\u67E5\u8BE2\u53EA\u63A5\u53D7 keywords\uFF0C\u5176\u4ED6\u67E5\u8BE2\u53C2\u6570\u56FA\u5B9A");
|
|
3609
|
-
}
|
|
3610
|
-
const keywords = asNonEmptyString(input.keywords, "keywords");
|
|
4076
|
+
async function searchInvoiceCustomers(host, keywords, operation) {
|
|
4077
|
+
const customers = /* @__PURE__ */ new Map();
|
|
4078
|
+
const seenPages = /* @__PURE__ */ new Set();
|
|
4079
|
+
for (let pageNo = 1; pageNo <= CUSTOMER_MAX_PAGES; pageNo += 1) {
|
|
3611
4080
|
const result = await host.invoiceMultipartRequest({
|
|
3612
4081
|
path: "/api/ebuilder/coms/nlist/getData",
|
|
3613
4082
|
method: "POST",
|
|
@@ -3623,15 +4092,65 @@ var InvoiceReimCustomerSearchOperation = class {
|
|
|
3623
4092
|
filter: customerFilter(keywords),
|
|
3624
4093
|
compId: CUSTOMER_COMP_ID,
|
|
3625
4094
|
pageId: CUSTOMER_PAGE_ID,
|
|
3626
|
-
pageNo:
|
|
3627
|
-
|
|
4095
|
+
pageNo: String(pageNo),
|
|
4096
|
+
pageSize: String(CUSTOMER_PAGE_SIZE)
|
|
3628
4097
|
},
|
|
3629
|
-
|
|
4098
|
+
timeoutMs: 5e3,
|
|
4099
|
+
operation
|
|
3630
4100
|
});
|
|
3631
4101
|
assertBusinessSuccess(result, "reim_customer_search_failed", "\u641C\u7D22\u76F8\u5173\u5BA2\u6237\u5931\u8D25");
|
|
3632
|
-
const list =
|
|
3633
|
-
if (!Array.isArray(list)) return
|
|
3634
|
-
|
|
4102
|
+
const list = record3(record3(result).data).list;
|
|
4103
|
+
if (!Array.isArray(list)) return invalidResponse2();
|
|
4104
|
+
const page = list.map(projectCustomer);
|
|
4105
|
+
const signature2 = JSON.stringify(page.map((customer) => customer.customerId).sort());
|
|
4106
|
+
if (seenPages.has(signature2)) {
|
|
4107
|
+
throw new InvoiceCliError("api", "reim_customer_search_incomplete", "\u5BA2\u6237\u67E5\u8BE2\u8FD4\u56DE\u91CD\u590D\u9875\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B8C\u6574\u5019\u9009\uFF0C\u8BF7\u7F29\u5C0F\u5BA2\u6237\u540D\u79F0\u8303\u56F4", { exitCode: 1 });
|
|
4108
|
+
}
|
|
4109
|
+
seenPages.add(signature2);
|
|
4110
|
+
for (const customer of page) {
|
|
4111
|
+
if (!customers.has(customer.customerId)) customers.set(customer.customerId, customer);
|
|
4112
|
+
}
|
|
4113
|
+
if (list.length < CUSTOMER_PAGE_SIZE) return [...customers.values()];
|
|
4114
|
+
}
|
|
4115
|
+
throw new InvoiceCliError("api", "reim_customer_search_incomplete", "\u5BA2\u6237\u67E5\u8BE2\u8FBE\u5230 20 \u9875\u4E0A\u9650\uFF0C\u5019\u9009\u672A\u8BFB\u5B8C\u6574\uFF0C\u8BF7\u7F29\u5C0F\u5BA2\u6237\u540D\u79F0\u8303\u56F4", { exitCode: 1 });
|
|
4116
|
+
}
|
|
4117
|
+
async function attachCustomerProjects(host, customers, operation, deadline) {
|
|
4118
|
+
const results = new Array(customers.length);
|
|
4119
|
+
let next = 0;
|
|
4120
|
+
let authenticationError;
|
|
4121
|
+
await Promise.all(Array.from({ length: Math.min(4, customers.length) }, async () => {
|
|
4122
|
+
while (!authenticationError && next < customers.length) {
|
|
4123
|
+
const index = next++;
|
|
4124
|
+
const customer = customers[index];
|
|
4125
|
+
try {
|
|
4126
|
+
results[index] = { ...customer, relatedProject: await readInvoiceCustomerProjects(host, customer.customerId, operation, deadline, () => Boolean(authenticationError)) };
|
|
4127
|
+
} catch (error) {
|
|
4128
|
+
if (error instanceof InvoiceCliError && error.type === "authentication") {
|
|
4129
|
+
authenticationError = error;
|
|
4130
|
+
return;
|
|
4131
|
+
}
|
|
4132
|
+
results[index] = {
|
|
4133
|
+
...customer,
|
|
4134
|
+
relatedProject: null,
|
|
4135
|
+
projectsError: error instanceof InvoiceCliError ? error.message : "\u5BA2\u6237\u9879\u76EE\u67E5\u8BE2\u5931\u8D25\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B8C\u6574\u9879\u76EE\u5019\u9009"
|
|
4136
|
+
};
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
}));
|
|
4140
|
+
if (authenticationError) throw authenticationError;
|
|
4141
|
+
return results;
|
|
4142
|
+
}
|
|
4143
|
+
var InvoiceReimCustomerSearchOperation = class {
|
|
4144
|
+
name = "invoice.reim.customer.search";
|
|
4145
|
+
async execute(input, { host }) {
|
|
4146
|
+
if (Object.keys(input).some((key) => key !== "keywords")) {
|
|
4147
|
+
throw invoiceValidationError("input_invalid", "\u5BA2\u6237\u67E5\u8BE2\u53EA\u63A5\u53D7 keywords\uFF0C\u5176\u4ED6\u67E5\u8BE2\u53C2\u6570\u56FA\u5B9A");
|
|
4148
|
+
}
|
|
4149
|
+
const keywords = asNonEmptyString(input.keywords, "keywords");
|
|
4150
|
+
const deadline = Date.now() + 12e4;
|
|
4151
|
+
const customers = await searchInvoiceCustomers(host, keywords, this.name);
|
|
4152
|
+
const list = await attachCustomerProjects(host, customers, this.name, deadline);
|
|
4153
|
+
return { status: list.some((customer) => customer.relatedProject === null) ? "PARTIAL" : "COMPLETE", data: { list } };
|
|
3635
4154
|
}
|
|
3636
4155
|
};
|
|
3637
4156
|
|
|
@@ -3654,29 +4173,11 @@ var RELATION_FIELD = {
|
|
|
3654
4173
|
projectName: "1336526894274510992",
|
|
3655
4174
|
preApproval: "1336156560590790875"
|
|
3656
4175
|
};
|
|
3657
|
-
var RELATION_SEARCH_PAGE_SIZE = 20;
|
|
3658
|
-
var CUSTOMER_SEARCH_PATH = "/api/ebuilder/coms/nlist/getData";
|
|
3659
|
-
var CUSTOMER_SEARCH_PAGE_ID = "1218181956452048911";
|
|
3660
|
-
var CUSTOMER_SEARCH_COMP_ID = "c39b9e14c0034336adf9e9bc39aeed75";
|
|
3661
|
-
var CUSTOMER_SEARCH_WORKFLOW_ID = "100003460000000060";
|
|
3662
|
-
var CUSTOMER_OBJ_ID = "1173221220888059964";
|
|
3663
|
-
var CUSTOMER_NAME_FIELD2 = "1173221220888062665";
|
|
3664
|
-
var PROJECT_SEARCH_PATH = "/api/ebuilder/form/common/browser/data/ebuilder";
|
|
3665
|
-
var PROJECT_NAME_FIELD = "1020275734718578690";
|
|
3666
|
-
var PROJECT_FORM_PARAM = JSON.stringify({
|
|
3667
|
-
formId: "100003660000000007",
|
|
3668
|
-
layoutId: "925333107626672135",
|
|
3669
|
-
fieldId: "100003720000006720",
|
|
3670
|
-
filterItems: [],
|
|
3671
|
-
module: "workflow",
|
|
3672
|
-
dataDetails: [],
|
|
3673
|
-
templateId: ""
|
|
3674
|
-
});
|
|
3675
4176
|
var BROWSE_SUMMARY_SUFFIX = /\s+\([^()]*[::][^()]*\)\s*$/u;
|
|
3676
4177
|
function asRecord3(value) {
|
|
3677
4178
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
3678
4179
|
}
|
|
3679
|
-
function
|
|
4180
|
+
function text4(value) {
|
|
3680
4181
|
if (value === void 0 || value === null || typeof value === "object") return "";
|
|
3681
4182
|
return String(value).trim();
|
|
3682
4183
|
}
|
|
@@ -3725,12 +4226,12 @@ async function mapInOrder(items, fn) {
|
|
|
3725
4226
|
return results;
|
|
3726
4227
|
}
|
|
3727
4228
|
function saveOutcome(value) {
|
|
3728
|
-
const
|
|
3729
|
-
const message =
|
|
3730
|
-
if (Number(
|
|
4229
|
+
const record4 = asRecord3(value);
|
|
4230
|
+
const message = text4(asRecord3(asRecord3(asRecord3(asRecord3(record4.actionData).responseData).customData).mainTable).msg);
|
|
4231
|
+
if (Number(record4.resultCode) === 200 && message.includes(RELATION_SAVED_MESSAGE)) return { saved: true, message };
|
|
3731
4232
|
return {
|
|
3732
4233
|
saved: false,
|
|
3733
|
-
message: message ||
|
|
4234
|
+
message: message || text4(record4.resultMsg) || `\u52A8\u4F5C\u6D41\u6CA1\u6709\u8FD4\u56DE\u300C${RELATION_SAVED_MESSAGE}\u300D\uFF08resultCode=${text4(record4.resultCode) || "\u65E0"}\uFF09`
|
|
3734
4235
|
};
|
|
3735
4236
|
}
|
|
3736
4237
|
var InvoiceReimRelationSaveOperation = class {
|
|
@@ -3821,9 +4322,9 @@ function relationFilter(fid) {
|
|
|
3821
4322
|
];
|
|
3822
4323
|
}
|
|
3823
4324
|
function idNameOf(row, idField, nameField) {
|
|
3824
|
-
const id =
|
|
4325
|
+
const id = text4(row[idField]);
|
|
3825
4326
|
if (!/^\d+$/u.test(id)) return null;
|
|
3826
|
-
const name =
|
|
4327
|
+
const name = text4(row[nameField]);
|
|
3827
4328
|
return { id, name, value: name ? `${name}(${id})` : id };
|
|
3828
4329
|
}
|
|
3829
4330
|
function stripBrowseSummary(name) {
|
|
@@ -3831,20 +4332,20 @@ function stripBrowseSummary(name) {
|
|
|
3831
4332
|
}
|
|
3832
4333
|
function preApprovalOf(value) {
|
|
3833
4334
|
const item = asRecord3(Array.isArray(value) ? value[0] : value);
|
|
3834
|
-
const requestId =
|
|
4335
|
+
const requestId = text4(item.id);
|
|
3835
4336
|
if (!/^\d+$/u.test(requestId)) return null;
|
|
3836
|
-
const displayName =
|
|
4337
|
+
const displayName = text4(item.name);
|
|
3837
4338
|
const requestName = stripBrowseSummary(displayName);
|
|
3838
4339
|
return {
|
|
3839
4340
|
requestId,
|
|
3840
4341
|
requestName,
|
|
3841
4342
|
value: requestName ? `${requestName}(${requestId})` : requestId,
|
|
3842
4343
|
displayName,
|
|
3843
|
-
createTime:
|
|
4344
|
+
createTime: text4(asRecord3(item.custom).createDateTime) || null
|
|
3844
4345
|
};
|
|
3845
4346
|
}
|
|
3846
4347
|
function relationItemFromRows(fid, rows) {
|
|
3847
|
-
const matched = rows.map(asRecord3).filter((row2) =>
|
|
4348
|
+
const matched = rows.map(asRecord3).filter((row2) => text4(row2[RELATION_FIELD.fid]) === fid).sort((a, b) => text4(b.create_time).localeCompare(text4(a.create_time)));
|
|
3848
4349
|
const row = matched[0];
|
|
3849
4350
|
if (!row) return { fid, found: false, customer: null, project: null, preApproval: null, recordedAt: null };
|
|
3850
4351
|
return {
|
|
@@ -3853,7 +4354,7 @@ function relationItemFromRows(fid, rows) {
|
|
|
3853
4354
|
customer: idNameOf(row, RELATION_FIELD.customerId, RELATION_FIELD.customerName),
|
|
3854
4355
|
project: idNameOf(row, RELATION_FIELD.projectId, RELATION_FIELD.projectName),
|
|
3855
4356
|
preApproval: preApprovalOf(row[RELATION_FIELD.preApproval]),
|
|
3856
|
-
recordedAt:
|
|
4357
|
+
recordedAt: text4(row.create_time) || null
|
|
3857
4358
|
};
|
|
3858
4359
|
}
|
|
3859
4360
|
function groupByValue(items, pick) {
|
|
@@ -3885,120 +4386,6 @@ async function relationRows(host, fid, operation) {
|
|
|
3885
4386
|
if (!Array.isArray(list)) throw new Error(`\u53D1\u7968 ${fid} \u7684\u5173\u8054\u4FE1\u606F\u8FD4\u56DE\u7F3A\u5C11 data.list`);
|
|
3886
4387
|
return list;
|
|
3887
4388
|
}
|
|
3888
|
-
function relationSearchTarget(value) {
|
|
3889
|
-
if (value === "customer" || value === "project") return value;
|
|
3890
|
-
throw invoiceValidationError("input_invalid", "target \u53EA\u80FD\u662F customer\uFF08\u76F8\u5173\u5BA2\u6237\uFF09\u6216 project\uFF08\u76F8\u5173\u9879\u76EE\uFF09");
|
|
3891
|
-
}
|
|
3892
|
-
function customerFilter2(keywords) {
|
|
3893
|
-
return [
|
|
3894
|
-
{
|
|
3895
|
-
conditionType: "or",
|
|
3896
|
-
dataType: "field",
|
|
3897
|
-
id: "d030a0a7b33e48e697277d30086126dc",
|
|
3898
|
-
conditionComId: `${CUSTOMER_SEARCH_COMP_ID}_quick_EXCLUDECACHE`,
|
|
3899
|
-
filterFields: [{
|
|
3900
|
-
compId: CUSTOMER_SEARCH_COMP_ID,
|
|
3901
|
-
compType: "Text",
|
|
3902
|
-
dataset: {
|
|
3903
|
-
isPhysical: true,
|
|
3904
|
-
ebuilderDataConfig: { dataSetup: {}, type: "FORM" },
|
|
3905
|
-
detailTable: false,
|
|
3906
|
-
groupId: "weaver-ebuilder-form-service",
|
|
3907
|
-
usage: "all",
|
|
3908
|
-
appId: "980180677416657173",
|
|
3909
|
-
id: CUSTOMER_OBJ_ID,
|
|
3910
|
-
text: "\u5BA2\u6237",
|
|
3911
|
-
type: "LOGIC",
|
|
3912
|
-
objType: "physical"
|
|
3913
|
-
},
|
|
3914
|
-
fieldName: `field_${CUSTOMER_NAME_FIELD2}`,
|
|
3915
|
-
id: CUSTOMER_NAME_FIELD2,
|
|
3916
|
-
objId: CUSTOMER_OBJ_ID,
|
|
3917
|
-
type: "String",
|
|
3918
|
-
text: "\u540D\u79F0"
|
|
3919
|
-
}],
|
|
3920
|
-
value: keywords
|
|
3921
|
-
},
|
|
3922
|
-
{
|
|
3923
|
-
conditionComId: `${CUSTOMER_SEARCH_COMP_ID}_filter_EXCLUDECACHE`,
|
|
3924
|
-
conditionType: "and",
|
|
3925
|
-
dataType: "classification",
|
|
3926
|
-
id: "f27488c792f44756b7ef1065f7735fc1",
|
|
3927
|
-
useConfig: true
|
|
3928
|
-
}
|
|
3929
|
-
];
|
|
3930
|
-
}
|
|
3931
|
-
async function searchCustomers(host, keywords, operation) {
|
|
3932
|
-
const result = await host.invoiceMultipartRequest({
|
|
3933
|
-
path: CUSTOMER_SEARCH_PATH,
|
|
3934
|
-
method: "POST",
|
|
3935
|
-
headers: { ebbusinessid: CUSTOMER_SEARCH_PAGE_ID },
|
|
3936
|
-
fields: {
|
|
3937
|
-
workflowId: CUSTOMER_SEARCH_WORKFLOW_ID,
|
|
3938
|
-
isCreate: "1",
|
|
3939
|
-
filter: customerFilter2(keywords),
|
|
3940
|
-
compId: CUSTOMER_SEARCH_COMP_ID,
|
|
3941
|
-
pageId: CUSTOMER_SEARCH_PAGE_ID,
|
|
3942
|
-
pageNo: "1",
|
|
3943
|
-
pageSize: String(RELATION_SEARCH_PAGE_SIZE)
|
|
3944
|
-
},
|
|
3945
|
-
operation
|
|
3946
|
-
});
|
|
3947
|
-
assertBusinessSuccess(result, "reim_relation_search_failed", "\u641C\u7D22\u76F8\u5173\u5BA2\u6237\u5931\u8D25");
|
|
3948
|
-
const list = asRecord3(asRecord3(result).data).list;
|
|
3949
|
-
return (Array.isArray(list) ? list : []).map((row) => {
|
|
3950
|
-
const record2 = asRecord3(row);
|
|
3951
|
-
return { id: text3(record2.id), name: text3(record2[CUSTOMER_NAME_FIELD2]) };
|
|
3952
|
-
});
|
|
3953
|
-
}
|
|
3954
|
-
async function searchProjects(host, keywords, operation) {
|
|
3955
|
-
const result = await host.invoiceRequest({
|
|
3956
|
-
path: PROJECT_SEARCH_PATH,
|
|
3957
|
-
method: "POST",
|
|
3958
|
-
body: {
|
|
3959
|
-
browserMultiple: false,
|
|
3960
|
-
current: 1,
|
|
3961
|
-
pageSize: RELATION_SEARCH_PAGE_SIZE,
|
|
3962
|
-
quickSearchDatas: { [`field_${PROJECT_NAME_FIELD}`]: keywords },
|
|
3963
|
-
formParam: PROJECT_FORM_PARAM
|
|
3964
|
-
},
|
|
3965
|
-
operation
|
|
3966
|
-
});
|
|
3967
|
-
assertBusinessSuccess(result, "reim_relation_search_failed", "\u641C\u7D22\u76F8\u5173\u9879\u76EE\u5931\u8D25");
|
|
3968
|
-
const rows = asRecord3(asRecord3(result).data).data;
|
|
3969
|
-
return (Array.isArray(rows) ? rows : []).map(asRecord3).filter((row) => row.disabled !== true).map((row) => ({ id: text3(row.id), name: text3(row.content) || text3(row[PROJECT_NAME_FIELD]) }));
|
|
3970
|
-
}
|
|
3971
|
-
function uniqueValidItems(items) {
|
|
3972
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3973
|
-
return items.filter((item) => {
|
|
3974
|
-
if (!/^\d+$/u.test(item.id) || !item.name || seen.has(item.id)) return false;
|
|
3975
|
-
seen.add(item.id);
|
|
3976
|
-
return true;
|
|
3977
|
-
});
|
|
3978
|
-
}
|
|
3979
|
-
var InvoiceReimRelationSearchOperation = class {
|
|
3980
|
-
name = "invoice.reim.relation.search";
|
|
3981
|
-
async execute(input, { host }) {
|
|
3982
|
-
const target = relationSearchTarget(input.target);
|
|
3983
|
-
const keywords = optionalText(input.keywords, "keywords");
|
|
3984
|
-
if (!keywords) throw invoiceValidationError("input_invalid", "keywords \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");
|
|
3985
|
-
const found = target === "customer" ? await searchCustomers(host, keywords, this.name) : await searchProjects(host, keywords, this.name);
|
|
3986
|
-
const items = uniqueValidItems(found);
|
|
3987
|
-
const exact = items.filter((item) => item.name === keywords);
|
|
3988
|
-
const match = items.length === 0 ? "none" : items.length === 1 ? "unique" : "multiple";
|
|
3989
|
-
return {
|
|
3990
|
-
status: "COMPLETE",
|
|
3991
|
-
data: {
|
|
3992
|
-
target,
|
|
3993
|
-
keywords,
|
|
3994
|
-
match,
|
|
3995
|
-
items,
|
|
3996
|
-
selected: items.length === 1 ? items[0] : exact.length === 1 ? exact[0] : null,
|
|
3997
|
-
workflow: workflow(this.name, "COMPLETE")
|
|
3998
|
-
}
|
|
3999
|
-
};
|
|
4000
|
-
}
|
|
4001
|
-
};
|
|
4002
4389
|
var InvoiceReimRelationListOperation = class {
|
|
4003
4390
|
name = "invoice.reim.relation.list";
|
|
4004
4391
|
async execute(input, { host }) {
|
|
@@ -4043,8 +4430,8 @@ function optionalId2(value, name) {
|
|
|
4043
4430
|
}
|
|
4044
4431
|
function amountCents2(value, name) {
|
|
4045
4432
|
if (value === void 0 || value === null || value === "") return null;
|
|
4046
|
-
const
|
|
4047
|
-
const match = typeof
|
|
4433
|
+
const text6 = typeof value === "number" ? String(value) : value;
|
|
4434
|
+
const match = typeof text6 === "string" ? /^(\d+)(?:\.(\d{1,2}))?$/u.exec(text6.trim()) : null;
|
|
4048
4435
|
const cents = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : NaN;
|
|
4049
4436
|
if (!Number.isSafeInteger(cents) || cents <= 0) {
|
|
4050
4437
|
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F\u5927\u4E8E 0\u3001\u6700\u591A\u4E24\u4F4D\u5C0F\u6570\u7684\u91D1\u989D`);
|
|
@@ -4091,7 +4478,7 @@ function workflowViewUrl(baseUrl, requestId) {
|
|
|
4091
4478
|
return `${baseUrl.replace(/\/+$/, "")}/sp/workflow/flowpage/view/${requestId}`;
|
|
4092
4479
|
}
|
|
4093
4480
|
function subsidyReceipt(options) {
|
|
4094
|
-
const { processTitle, reason, url, details, skipped, allowanceCents, reimbursedTotalCents } = options;
|
|
4481
|
+
const { processTitle, reason, url, details, skipped: skipped2, allowanceCents, reimbursedTotalCents } = options;
|
|
4095
4482
|
const money = (cents) => `\xA5${(cents / 100).toFixed(2)}`;
|
|
4096
4483
|
const includedTotalCents = details.reduce((sum, item) => sum + item.cents, 0);
|
|
4097
4484
|
const partialAmountCents = includedTotalCents - reimbursedTotalCents;
|
|
@@ -4114,9 +4501,9 @@ function subsidyReceipt(options) {
|
|
|
4114
4501
|
if (partialAmountCents > 0) {
|
|
4115
4502
|
lines.push(`\u672C\u6B21\u6309\u6708\u8865\u8D34\u989D\u5EA6\u62A5\u9500\uFF0C\u5DF2\u4F7F\u7528\u53D1\u7968\u4E2D\u8D85\u51FA\u7684 ${money(partialAmountCents)} \u672A\u8BA1\u5165\u62A5\u9500\u91D1\u989D\u3002`, "");
|
|
4116
4503
|
}
|
|
4117
|
-
if (
|
|
4118
|
-
const skippedTotalCents =
|
|
4119
|
-
lines.push(`\u6708\u8865\u8D34\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u53E6\u6709 ${
|
|
4504
|
+
if (skipped2.length > 0) {
|
|
4505
|
+
const skippedTotalCents = skipped2.reduce((sum, item) => sum + item.cents, 0);
|
|
4506
|
+
lines.push(`\u6708\u8865\u8D34\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u53E6\u6709 ${skipped2.length} \u5F20\u53D1\u7968\uFF08\u5408\u8BA1 ${money(skippedTotalCents)}\uFF09\u672A\u7EB3\u5165\u672C\u6B21\u62A5\u9500\uFF0C\u4ECD\u5728\u7968\u5939\u3002\u540E\u7EED\u62A5\u9500\u4ECD\u987B\u6EE1\u8DB3\u6700\u8FD1 30 \u5929\u7684\u5F00\u7968\u65E5\u671F\u8981\u6C42\u3002`, "");
|
|
4120
4507
|
}
|
|
4121
4508
|
lines.push(`[\u67E5\u770B\u62A5\u9500\u6D41\u7A0B\uFF1A${processTitle}](${url})`);
|
|
4122
4509
|
return lines.join("\n");
|
|
@@ -4133,10 +4520,10 @@ var InvoiceReimSubsidySubmitOperation = class {
|
|
|
4133
4520
|
const allowanceCents = amountCents2(input.monthlyAllowance, "monthlyAllowance");
|
|
4134
4521
|
let remainingCents = allowanceCents ?? Number.POSITIVE_INFINITY;
|
|
4135
4522
|
const details = [];
|
|
4136
|
-
const
|
|
4523
|
+
const skipped2 = [];
|
|
4137
4524
|
for (const item of invoices) {
|
|
4138
4525
|
if (remainingCents <= 0) {
|
|
4139
|
-
|
|
4526
|
+
skipped2.push(item);
|
|
4140
4527
|
continue;
|
|
4141
4528
|
}
|
|
4142
4529
|
const reimbursedCents = Math.min(item.cents, remainingCents);
|
|
@@ -4216,11 +4603,11 @@ var InvoiceReimSubsidySubmitOperation = class {
|
|
|
4216
4603
|
invoiceTotal: formatCents2(item.cents),
|
|
4217
4604
|
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
4218
4605
|
})),
|
|
4219
|
-
skippedInvoices:
|
|
4606
|
+
skippedInvoices: skipped2.map((item) => ({
|
|
4220
4607
|
relatedInvoiceId: item.fid,
|
|
4221
4608
|
invoiceTotal: formatCents2(item.cents)
|
|
4222
4609
|
})),
|
|
4223
|
-
finalMarkdown: subsidyReceipt({ processTitle, reason, url, details, skipped, allowanceCents, reimbursedTotalCents }),
|
|
4610
|
+
finalMarkdown: subsidyReceipt({ processTitle, reason, url, details, skipped: skipped2, allowanceCents, reimbursedTotalCents }),
|
|
4224
4611
|
result,
|
|
4225
4612
|
workflow: workflow(this.name, "COMPLETE")
|
|
4226
4613
|
}
|
|
@@ -4354,7 +4741,7 @@ var EXT_NOISE_KEYS = /* @__PURE__ */ new Set([
|
|
|
4354
4741
|
function asRecord4(value) {
|
|
4355
4742
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
4356
4743
|
}
|
|
4357
|
-
function
|
|
4744
|
+
function text5(value) {
|
|
4358
4745
|
return value === void 0 || value === null ? "" : String(value).trim();
|
|
4359
4746
|
}
|
|
4360
4747
|
function compact(value) {
|
|
@@ -4374,13 +4761,13 @@ function usefulExt(rawExt, cname) {
|
|
|
4374
4761
|
const ext = { ...parseInvoiceExt(rawExt) };
|
|
4375
4762
|
for (const key of EXT_NOISE_KEYS) delete ext[key];
|
|
4376
4763
|
for (const key of ["title", "category"]) {
|
|
4377
|
-
if (
|
|
4764
|
+
if (text5(ext[key]) === cname) delete ext[key];
|
|
4378
4765
|
}
|
|
4379
4766
|
return asRecord4(compact(ext));
|
|
4380
4767
|
}
|
|
4381
4768
|
function party(value) {
|
|
4382
|
-
const
|
|
4383
|
-
return { company:
|
|
4769
|
+
const record4 = asRecord4(value);
|
|
4770
|
+
return { company: text5(record4.company), tcode: text5(record4.tcode) };
|
|
4384
4771
|
}
|
|
4385
4772
|
function invoiceResult(item, baseUrl) {
|
|
4386
4773
|
const entry = asRecord4(item);
|
|
@@ -4389,24 +4776,24 @@ function invoiceResult(item, baseUrl) {
|
|
|
4389
4776
|
const pro = asRecord4(comm.pro);
|
|
4390
4777
|
const price = asRecord4(comm.price);
|
|
4391
4778
|
const ret = asRecord4(entry.ret);
|
|
4392
|
-
const fid =
|
|
4393
|
-
const cname =
|
|
4394
|
-
const kind =
|
|
4779
|
+
const fid = text5(info.fid ?? info.id);
|
|
4780
|
+
const cname = text5(pro.cname);
|
|
4781
|
+
const kind = text5(pro.kind);
|
|
4395
4782
|
return {
|
|
4396
4783
|
fid,
|
|
4397
|
-
code:
|
|
4398
|
-
number:
|
|
4784
|
+
code: text5(info.code),
|
|
4785
|
+
number: text5(info.number),
|
|
4399
4786
|
cname,
|
|
4400
4787
|
type: numberOrZero(pro.type),
|
|
4401
4788
|
...kind ? { kind } : {},
|
|
4402
|
-
date:
|
|
4403
|
-
amount:
|
|
4404
|
-
total:
|
|
4405
|
-
dtax:
|
|
4789
|
+
date: text5(pro.date),
|
|
4790
|
+
amount: text5(price.amount),
|
|
4791
|
+
total: text5(price.total),
|
|
4792
|
+
dtax: text5(price.dtax),
|
|
4406
4793
|
buyer: party(comm.buyer),
|
|
4407
4794
|
payer: party(comm.payer),
|
|
4408
4795
|
ext: usefulExt(info.ext, cname),
|
|
4409
|
-
ret: { ret: ret.ret, message:
|
|
4796
|
+
ret: { ret: ret.ret, message: text5(ret.message) },
|
|
4410
4797
|
validated: ret.ret === 0,
|
|
4411
4798
|
...fid ? { detailUrl: invoiceDetailUrl(baseUrl, fid) } : {}
|
|
4412
4799
|
};
|
|
@@ -4478,15 +4865,13 @@ function buildRegistry() {
|
|
|
4478
4865
|
new InvoiceReimRequestsListOperation(),
|
|
4479
4866
|
new InvoiceReimWorkflowResolveOperation(),
|
|
4480
4867
|
new InvoiceReimCandidatesListOperation(),
|
|
4481
|
-
new InvoiceReimEmployeeSuperiorsOperation(),
|
|
4482
|
-
new InvoiceReimFieldSearchOperation(),
|
|
4483
4868
|
new InvoiceReimCustomerSearchOperation(),
|
|
4484
|
-
new InvoiceReimRelationSearchOperation(),
|
|
4485
4869
|
new InvoiceReimRelationSaveOperation(),
|
|
4486
4870
|
new InvoiceReimRelationListOperation(),
|
|
4487
4871
|
new InvoiceReimSubsidySubmitOperation(),
|
|
4488
4872
|
new InvoiceIssuingContractsListOperation(),
|
|
4489
|
-
new InvoiceIssuingContractDetailOperation()
|
|
4873
|
+
new InvoiceIssuingContractDetailOperation(),
|
|
4874
|
+
new InvoiceIssuingRedRequestsListOperation()
|
|
4490
4875
|
];
|
|
4491
4876
|
for (const handler of handlers) {
|
|
4492
4877
|
if (registry.has(handler.name)) throw new Error(`duplicate invoice operation handler: ${handler.name}`);
|
|
@@ -4612,7 +4997,7 @@ function successEnvelope(operation, result, meta) {
|
|
|
4612
4997
|
operation,
|
|
4613
4998
|
data: result.data,
|
|
4614
4999
|
meta: { status: result.status, ...meta ?? {} },
|
|
4615
|
-
warnings: []
|
|
5000
|
+
warnings: result.warnings ?? []
|
|
4616
5001
|
};
|
|
4617
5002
|
}
|
|
4618
5003
|
function failureEnvelope(error) {
|
|
@@ -4632,7 +5017,7 @@ async function executeAndPrint(ctx, operation, input, projection = {}) {
|
|
|
4632
5017
|
continuation: createInvoiceContinuationSigner(ctx)
|
|
4633
5018
|
});
|
|
4634
5019
|
const projected = applyInvoiceProjection(operation, result.data, projection);
|
|
4635
|
-
ctx.output.write(successEnvelope(operation, { status: result.status, data: projected.data }, projected.meta), { json: true });
|
|
5020
|
+
ctx.output.write(successEnvelope(operation, { status: result.status, data: projected.data, warnings: result.warnings }, projected.meta), { json: true });
|
|
4636
5021
|
} catch (error) {
|
|
4637
5022
|
reportPlatformError(error);
|
|
4638
5023
|
ctx.output.error(failureEnvelope(error));
|