weaver-work-cli 0.1.1 → 0.1.4

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.
Files changed (351) hide show
  1. package/README.md +187 -76
  2. package/dist/cmd/setup/index.js +5 -5
  3. package/dist/cmd/skills/index.js +1 -1
  4. package/dist/core/hooks.js +7 -0
  5. package/dist/index.js +0 -0
  6. package/dist/internal/e10/auth/commands.js +160 -55
  7. package/dist/internal/e10/auth/crypto.js +7 -22
  8. package/dist/internal/e10/auth/session.js +1 -1
  9. package/dist/internal/e10/auth/xiaoe.js +268 -0
  10. package/dist/internal/e10/context.js +16 -2
  11. package/dist/internal/e10/index.js +1 -0
  12. package/dist/internal/e10/request-runtime.js +344 -0
  13. package/dist/internal/skills/install.js +48 -6
  14. package/dist/internal/skills/reader.js +27 -0
  15. package/dist/shortcuts/archive/continuation.js +70 -0
  16. package/dist/shortcuts/archive/errors.js +53 -0
  17. package/dist/shortcuts/archive/host.js +197 -0
  18. package/dist/shortcuts/archive/index.js +363 -0
  19. package/dist/shortcuts/archive/manifest.js +45 -0
  20. package/dist/shortcuts/archive/operations/archive-info.js +55 -0
  21. package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
  22. package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
  23. package/dist/shortcuts/archive/operations/confirm.js +46 -0
  24. package/dist/shortcuts/archive/operations/download.js +238 -0
  25. package/dist/shortcuts/archive/operations/flow-url.js +240 -0
  26. package/dist/shortcuts/archive/operations/fonds.js +95 -0
  27. package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
  28. package/dist/shortcuts/archive/operations/registry.js +43 -0
  29. package/dist/shortcuts/archive/operations/search.js +88 -0
  30. package/dist/shortcuts/archive/operations/shared.js +120 -0
  31. package/dist/shortcuts/archive/operations/types.js +23 -0
  32. package/dist/shortcuts/archive/operations/upload.js +182 -0
  33. package/dist/shortcuts/archive/operations.js +13 -0
  34. package/dist/shortcuts/archive/render/search-format.js +276 -0
  35. package/dist/shortcuts/archive/render/search-view.js +125 -0
  36. package/dist/shortcuts/asset/continuation.js +70 -0
  37. package/dist/shortcuts/asset/errors.js +67 -0
  38. package/dist/shortcuts/asset/host.js +438 -0
  39. package/dist/shortcuts/asset/index.js +255 -0
  40. package/dist/shortcuts/asset/manifest.js +471 -0
  41. package/dist/shortcuts/asset/operations/query.js +249 -0
  42. package/dist/shortcuts/asset/operations/registry.js +85 -0
  43. package/dist/shortcuts/asset/operations/shared.js +100 -0
  44. package/dist/shortcuts/asset/operations/type-cache.js +49 -0
  45. package/dist/shortcuts/asset/operations/types.js +1 -0
  46. package/dist/shortcuts/asset/operations/viewlink.js +117 -0
  47. package/dist/shortcuts/asset/operations/write.js +435 -0
  48. package/dist/shortcuts/asset/operations.js +9 -0
  49. package/dist/shortcuts/calendar/continuation.js +70 -0
  50. package/dist/shortcuts/calendar/errors.js +53 -0
  51. package/dist/shortcuts/calendar/host.js +148 -0
  52. package/dist/shortcuts/calendar/index.js +125 -0
  53. package/dist/shortcuts/calendar/manifest.js +26 -0
  54. package/dist/shortcuts/calendar/operations/read.js +259 -0
  55. package/dist/shortcuts/calendar/operations/registry.js +31 -0
  56. package/dist/shortcuts/calendar/operations/shared.js +132 -0
  57. package/dist/shortcuts/calendar/operations/types.js +25 -0
  58. package/dist/shortcuts/calendar/operations/write.js +439 -0
  59. package/dist/shortcuts/calendar/operations.js +8 -0
  60. package/dist/shortcuts/ehr/continuation.js +70 -0
  61. package/dist/shortcuts/ehr/errors.js +53 -0
  62. package/dist/shortcuts/ehr/host.js +213 -0
  63. package/dist/shortcuts/ehr/index.js +205 -0
  64. package/dist/shortcuts/ehr/manifest.js +47 -0
  65. package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
  66. package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
  67. package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
  68. package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
  69. package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
  70. package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
  71. package/dist/shortcuts/ehr/operations/recruit.js +803 -0
  72. package/dist/shortcuts/ehr/operations/registry.js +43 -0
  73. package/dist/shortcuts/ehr/operations/salary.js +319 -0
  74. package/dist/shortcuts/ehr/operations/shared.js +246 -0
  75. package/dist/shortcuts/ehr/operations/types.js +25 -0
  76. package/dist/shortcuts/ehr/operations.js +25 -0
  77. package/dist/shortcuts/esb/continuation.js +70 -0
  78. package/dist/shortcuts/esb/errors.js +65 -0
  79. package/dist/shortcuts/esb/host.js +187 -0
  80. package/dist/shortcuts/esb/index.js +112 -0
  81. package/dist/shortcuts/esb/manifest.js +91 -0
  82. package/dist/shortcuts/esb/operations/input-format.js +31 -0
  83. package/dist/shortcuts/esb/operations/registry.js +48 -0
  84. package/dist/shortcuts/esb/operations/shared.js +152 -0
  85. package/dist/shortcuts/esb/operations/trigger.js +76 -0
  86. package/dist/shortcuts/esb/operations/types.js +21 -0
  87. package/dist/shortcuts/esb/operations.js +15 -0
  88. package/dist/shortcuts/fna/continuation.js +70 -0
  89. package/dist/shortcuts/fna/errors.js +59 -0
  90. package/dist/shortcuts/fna/host.js +146 -0
  91. package/dist/shortcuts/fna/index.js +111 -0
  92. package/dist/shortcuts/fna/manifest.js +41 -0
  93. package/dist/shortcuts/fna/operations/budget.js +124 -0
  94. package/dist/shortcuts/fna/operations/expense-center.js +148 -0
  95. package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
  96. package/dist/shortcuts/fna/operations/loan.js +195 -0
  97. package/dist/shortcuts/fna/operations/registry.js +35 -0
  98. package/dist/shortcuts/fna/operations/shared.js +210 -0
  99. package/dist/shortcuts/fna/operations/types.js +25 -0
  100. package/dist/shortcuts/fna/operations.js +19 -0
  101. package/dist/shortcuts/hrm/errors.js +38 -0
  102. package/dist/shortcuts/hrm/host.js +156 -0
  103. package/dist/shortcuts/hrm/index.js +111 -0
  104. package/dist/shortcuts/hrm/manifest.js +32 -0
  105. package/dist/shortcuts/hrm/operations/employee.js +338 -0
  106. package/dist/shortcuts/hrm/operations/org.js +110 -0
  107. package/dist/shortcuts/hrm/operations/position.js +176 -0
  108. package/dist/shortcuts/hrm/operations/registry.js +33 -0
  109. package/dist/shortcuts/hrm/operations/shared.js +143 -0
  110. package/dist/shortcuts/hrm/operations/types.js +23 -0
  111. package/dist/shortcuts/hrm/operations.js +19 -0
  112. package/dist/shortcuts/index.js +20 -0
  113. package/dist/shortcuts/invoice/host.js +99 -94
  114. package/dist/shortcuts/invoice/index.js +65 -61
  115. package/dist/shortcuts/invoice/manifest.js +222 -14
  116. package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
  117. package/dist/shortcuts/invoice/operations/issuing.js +198 -0
  118. package/dist/shortcuts/invoice/operations/ocr-preview.js +6 -3
  119. package/dist/shortcuts/invoice/operations/registry.js +17 -0
  120. package/dist/shortcuts/invoice/operations/reim.js +401 -0
  121. package/dist/shortcuts/invoice/operations/shared.js +271 -6
  122. package/dist/shortcuts/invoice/operations/validate-preview.js +1 -1
  123. package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
  124. package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
  125. package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
  126. package/dist/shortcuts/jiuchuanhui/host.js +159 -0
  127. package/dist/shortcuts/jiuchuanhui/index.js +109 -0
  128. package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
  129. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
  130. package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
  131. package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
  132. package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
  133. package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
  134. package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
  135. package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
  136. package/dist/shortcuts/mail/continuation.js +70 -0
  137. package/dist/shortcuts/mail/errors.js +53 -0
  138. package/dist/shortcuts/mail/host.js +182 -0
  139. package/dist/shortcuts/mail/index.js +519 -0
  140. package/dist/shortcuts/mail/manifest.js +38 -0
  141. package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
  142. package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
  143. package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
  144. package/dist/shortcuts/mail/operations/mail-read.js +508 -0
  145. package/dist/shortcuts/mail/operations/mail-send.js +474 -0
  146. package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
  147. package/dist/shortcuts/mail/operations/mail-template.js +170 -0
  148. package/dist/shortcuts/mail/operations/registry.js +41 -0
  149. package/dist/shortcuts/mail/operations/shared.js +64 -0
  150. package/dist/shortcuts/mail/operations/types.js +27 -0
  151. package/dist/shortcuts/mail/operations.js +19 -0
  152. package/dist/shortcuts/plan/continuation.js +70 -0
  153. package/dist/shortcuts/plan/errors.js +70 -0
  154. package/dist/shortcuts/plan/host.js +180 -0
  155. package/dist/shortcuts/plan/index.js +150 -0
  156. package/dist/shortcuts/plan/manifest.js +53 -0
  157. package/dist/shortcuts/plan/operations/link.js +256 -0
  158. package/dist/shortcuts/plan/operations/read.js +259 -0
  159. package/dist/shortcuts/plan/operations/registry.js +33 -0
  160. package/dist/shortcuts/plan/operations/shared.js +246 -0
  161. package/dist/shortcuts/plan/operations/types.js +49 -0
  162. package/dist/shortcuts/plan/operations/version.js +49 -0
  163. package/dist/shortcuts/plan/operations/write.js +710 -0
  164. package/dist/shortcuts/plan/operations.js +8 -0
  165. package/docs/SKILL.md +11 -7
  166. package/docs/_catalog.md +23 -5
  167. package/docs/agent-invoice.md +31 -10
  168. package/docs/agent-skill-install.md +211 -0
  169. package/docs/calendar.md +87 -0
  170. package/docs/e10-auth.md +28 -9
  171. package/docs/ehr.md +186 -0
  172. package/docs/esb.md +64 -0
  173. package/docs/fna.md +72 -0
  174. package/docs/hrm.md +89 -0
  175. package/docs/invoice.md +66 -20
  176. package/docs/jiuchuanhui.md +131 -0
  177. package/docs/operation-manual.md +443 -0
  178. package/docs/plan.md +82 -0
  179. package/docs/wenshuding.md +129 -0
  180. package/docs/ziguanjia.md +89 -0
  181. package/package.json +4 -4
  182. package/scripts/package-skill.mjs +127 -34
  183. package/scripts/postbuild.mjs +13 -0
  184. package/skill-template/business-info.json +13 -2
  185. package/skill-template/domains/calendar.md +15 -0
  186. package/skill-template/domains/esb.md +13 -0
  187. package/skill-template/domains/hrm.md +16 -0
  188. package/skill-template/domains/jiuchuanhui.md +23 -0
  189. package/skill-template/domains/jucailin.md +22 -0
  190. package/skill-template/domains/mail.md +21 -0
  191. package/skill-template/domains/plan.md +17 -0
  192. package/skill-template/domains/qiyecheng.md +17 -0
  193. package/skill-template/domains/shared.md +9 -3
  194. package/skill-template/domains/skill-maker.md +10 -0
  195. package/skill-template/domains/wenshuding.md +22 -0
  196. package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
  197. package/skill-template/domains/ziguanjia.md +21 -0
  198. package/skill-template/master-skill-template.md +12 -6
  199. package/skill-template/skill-template.md +40 -9
  200. package/skills/weaver-e10-calendar/SKILL.md +101 -0
  201. package/skills/weaver-e10-calendar/product.json +8 -0
  202. package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
  203. package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
  204. package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
  205. package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
  206. package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
  207. package/skills/weaver-e10-esb/SKILL.md +102 -0
  208. package/skills/weaver-e10-esb/product.json +8 -0
  209. package/skills/weaver-e10-esb/references/input-format.md +52 -0
  210. package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
  211. package/skills/weaver-e10-esb/references/trigger.md +99 -0
  212. package/skills/weaver-e10-hrm/SKILL.md +87 -0
  213. package/skills/weaver-e10-hrm/product.json +8 -0
  214. package/skills/weaver-e10-hrm/references/employee.md +109 -0
  215. package/skills/weaver-e10-hrm/references/org.md +95 -0
  216. package/skills/weaver-e10-hrm/references/position.md +95 -0
  217. package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
  218. package/skills/weaver-e10-jiuchuanhui/SKILL.md +174 -0
  219. package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
  220. package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
  221. package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
  222. package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
  223. package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
  224. package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
  225. package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
  226. package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
  227. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
  228. package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
  229. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
  230. package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
  231. package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
  232. package/skills/weaver-e10-jucailin/SKILL.md +101 -0
  233. package/skills/weaver-e10-jucailin/product.json +8 -0
  234. package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
  235. package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
  236. package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
  237. package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
  238. package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
  239. package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
  240. package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
  241. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
  242. package/skills/weaver-e10-jucailin/references/salary.md +110 -0
  243. package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
  244. package/skills/weaver-e10-mail/SKILL.md +151 -0
  245. package/skills/weaver-e10-mail/product.json +8 -0
  246. package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
  247. package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
  248. package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
  249. package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
  250. package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
  251. package/skills/weaver-e10-mail/references/mail-read.md +76 -0
  252. package/skills/weaver-e10-mail/references/mail-send.md +43 -0
  253. package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
  254. package/skills/weaver-e10-mail/references/mail-template.md +31 -0
  255. package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
  256. package/skills/weaver-e10-plan/SKILL.md +139 -0
  257. package/skills/weaver-e10-plan/product.json +8 -0
  258. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
  259. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
  260. package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
  261. package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
  262. package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
  263. package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
  264. package/skills/weaver-e10-qiyecheng/SKILL.md +118 -0
  265. package/skills/weaver-e10-qiyecheng/product.json +8 -0
  266. package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
  267. package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
  268. package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
  269. package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
  270. package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
  271. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
  272. package/skills/weaver-e10-shared/SKILL.md +86 -0
  273. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
  274. package/skills/weaver-e10-shared/references/json-output-contract.md +120 -0
  275. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
  276. package/skills/weaver-e10-skill-maker/SKILL.md +77 -0
  277. package/skills/weaver-e10-skill-maker/product.json +8 -0
  278. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
  279. package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
  280. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
  281. package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
  282. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
  283. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
  284. package/skills/weaver-e10-wenshuding/SKILL.md +157 -0
  285. package/skills/weaver-e10-wenshuding/product.json +8 -0
  286. package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
  287. package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
  288. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
  289. package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
  290. package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
  291. package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
  292. package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
  293. package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
  294. package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
  295. package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
  296. package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
  297. package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
  298. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
  299. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +47 -0
  300. package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
  301. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
  302. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
  303. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
  304. package/skills/weaver-e10-yepiaotong/references/invoice-download.md +31 -0
  305. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +45 -0
  306. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +15 -4
  307. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +45 -0
  308. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
  309. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
  310. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
  311. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +14 -4
  312. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +58 -0
  313. package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
  314. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
  315. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
  316. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +10 -3
  317. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
  318. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
  319. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
  320. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
  321. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
  322. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
  323. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
  324. package/skills/weaver-e10-ziguanjia/SKILL.md +162 -0
  325. package/skills/weaver-e10-ziguanjia/product.json +8 -0
  326. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
  327. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
  328. package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
  329. package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
  330. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
  331. package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
  332. package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
  333. package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
  334. package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
  335. package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
  336. package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
  337. package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
  338. package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
  339. package/skills/weaver-work-cli-invoice/SKILL.md +0 -103
  340. package/skills/weaver-work-cli-invoice/references/invoice-agent-entry.md +0 -38
  341. package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
  342. package/skills/weaver-work-cli-invoice/references/invoice-download.md +0 -22
  343. package/skills/weaver-work-cli-invoice/references/invoice-enterprise-list.md +0 -35
  344. package/skills/weaver-work-cli-invoice/references/invoice-import.md +0 -28
  345. package/skills/weaver-work-cli-invoice/references/invoice-personal-list.md +0 -47
  346. package/skills/weaver-work-cli-shared/SKILL.md +0 -53
  347. package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -83
  348. package/skills/weaver-work-cli-shared/references/json-output-contract.md +0 -61
  349. package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -61
  350. /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
  351. /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
@@ -0,0 +1,94 @@
1
+ # 费用科目匹配规则
2
+
3
+ > **费用类型(科目)字段必须有值。优先使用 `invoice.reim.row-info` 返回的 `subjectId`;为空时按下方查找表匹配;全部未命中则填兜底值 `"100502270000000104"`。**
4
+ > **绝不能为空、不能报错、不能放入 `unable_to_fill`。**
5
+
6
+ ---
7
+
8
+ ## 匹配查找表
9
+
10
+ 按优先级依次查表,命中即停。字段值中包含任一关键词即命中。
11
+
12
+ ### 优先级1:expenseType 匹配
13
+
14
+ ```json
15
+ {
16
+ "市内交通": "100502270000000006",
17
+ "住宿": "100502270000000183",
18
+ "餐饮": "100502270000000064",
19
+ "办公": "100502270000000003",
20
+ "通讯": "100502270000000010",
21
+ "活动": "100502270000000002",
22
+ "招待": "100502270000000005"
23
+ }
24
+ ```
25
+
26
+ > expenseType 为空或 "日常消费"/"其他费用" 等泛指值时跳过此表。
27
+
28
+ ### 优先级2:sellerName 关键词匹配
29
+
30
+ ```json
31
+ {
32
+ "滴滴|享道|曹操|高德|首汽": "100502270000000173",
33
+ "酒店|宾馆|民宿|如家|汉庭|全季": "100502270000000183",
34
+ "餐饮|饭店|海底捞|美团|饿了么": "100502270000000064",
35
+ "办公|文具": "100502270000000003",
36
+ "中国移动|中国联通|中国电信": "100502270000000010"
37
+ }
38
+ ```
39
+
40
+ ### 优先级3:consumeContent 关键词匹配
41
+
42
+ ```json
43
+ {
44
+ "客运服务费|运输服务": "100502270000000006",
45
+ "住宿服务|住宿费": "100502270000000183",
46
+ "餐饮服务|餐费": "100502270000000064",
47
+ "电脑|手机|平板|显示器|电子设备": "100502270000000128",
48
+ "押金|保证金": "100502270000000127",
49
+ "家具|桌椅|办公桌|柜子": "100502270000000129"
50
+ }
51
+ ```
52
+
53
+ ### 优先级4:requestname 辅助匹配(事前申请名称)
54
+
55
+ ```json
56
+ {
57
+ "招待|接待": "100502270000000005",
58
+ "采购|办公": "100502270000000003"
59
+ }
60
+ ```
61
+
62
+ > 出差/差旅类事前申请 + 交通类发票 → 使用优先级2的 sellerName 匹配结果。
63
+
64
+ ### 兜底(必定命中)
65
+
66
+ | 条件 | 科目 ID |
67
+ |------|---------|
68
+ | 发票涉及押金、保证金 | `100502270000000127` |
69
+ | 发票涉及电脑、电子设备 | `100502270000000128` |
70
+ | 发票涉及家具、桌椅 | `100502270000000129` |
71
+ | 用户为研发部门 | `100502270000000090` |
72
+ | 事前申请含"销售"关键词 | `100502270000000105` |
73
+ | **以上都不满足** | **`100502270000000104`** |
74
+
75
+ ---
76
+
77
+ ## 滴滴/网约车科目选择
78
+
79
+ | 条件 | 科目 ID |
80
+ |------|---------|
81
+ | 默认(无法确认部门) | `100502270000000173`(管理费用) |
82
+ | 确认为研发部门人员 | `100502270000000177`(研发费) |
83
+
84
+ ---
85
+
86
+ ## 赋值方式
87
+
88
+ 费用科目字段(`fieldType="RelateBrowser"`, `marked=true`)直接用科目 `id` 作为 `value`:
89
+
90
+ ```json
91
+ {"fieldId": "...", "value": "100502270000000006", "fieldName": "费用类型(科目)"}
92
+ ```
93
+
94
+ > ID 必须原样复制,严禁修改。每行明细的科目独立匹配。
@@ -0,0 +1,449 @@
1
+ # 表单字段填充规则与填单 JSON 组装
2
+
3
+ 本文档定义如何根据发票数据、事前申请数据和表单字段结构,组装最终的填单结构化 JSON。
4
+
5
+ > **⚠️ 数据完整性规则适用于本文档所有操作,详见 [reim-workflow.md 顶部](reim-workflow.md#️️️-最高优先级规则严禁篡改任何原始数据值-️️️)。**
6
+
7
+ ---
8
+
9
+ ## 最终输出结构
10
+
11
+ ```json
12
+ {
13
+ "work_flow_id": "需要填单的工作流ID",
14
+ "mainFormId": "报销单主表formId",
15
+ "request_name": "流程标题(按规则生成)",
16
+ "main_fields": [
17
+ {"fieldId": "xxx", "value": "值或ID", "fieldName": "字段名"},
18
+ {"fieldId": "xxx", "optionValue": "选项值", "fieldName": "字段名"}
19
+ ],
20
+ "detail_rows": [
21
+ {
22
+ "dataIndex": 1,
23
+ "subFormId": "明细表ID",
24
+ "invoiceId": "对应发票ID",
25
+ "fields": [
26
+ {"fieldId": "xxx", "value": "值或ID", "fieldName": "字段名"},
27
+ {"fieldId": "xxx", "optionValue": "选项值", "fieldName": "字段名"}
28
+ ]
29
+ }
30
+ ],
31
+ "need_user_confirm": [
32
+ {
33
+ "fieldId": "xxx",
34
+ "fieldName": "字段名",
35
+ "dataIndex": null,
36
+ "reason": "模糊搜索返回多个候选",
37
+ "candidates": [{"id": "xxx", "name": "xxx"}]
38
+ }
39
+ ],
40
+ "unable_to_fill": [
41
+ {
42
+ "fieldId": "xxx",
43
+ "fieldName": "字段名",
44
+ "reason": "无法填写的原因"
45
+ }
46
+ ]
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 各部分说明
53
+
54
+ ### work_flow_id
55
+
56
+ 目标报销流程的工作流ID,**来自 Step 2.5 调用 `invoice.reim.workflow.resolve` 获取**:
57
+
58
+ | 场景 | 来源 |
59
+ |------|------|
60
+ | 有事前申请 | `requestWorkflowMap[requestId].workFlowId` |
61
+ | 无事前申请,候选只有1个 | `candidateWorkflows[0].workFlowId` |
62
+ | 无事前申请,候选多个 | 根据发票/事前数据自动匹配最相关的 `workFlowId` |
63
+
64
+ ### mainFormId
65
+
66
+ 报销单主表formId,**来自 Step 3 调用 `invoice.reim.form.structure` 返回的 `mainFormId`**。
67
+
68
+ ### request_name 生成规则
69
+
70
+ | 场景 | 格式 | 示例 |
71
+ |------|------|------|
72
+ | 有事前申请 | `{事前申请关键词}报销-{用户名}-{日期}(共N笔)` | `"北京出差报销-张三-2026-08-04(共2笔)"` |
73
+ | 无事前申请 | `{费用类型汇总}报销-{用户名}-{日期}(共N笔)` | `"交通费+住宿费报销-张三-2026-08-04(共3笔)"` |
74
+ | 单张发票 | `{费用类型}报销-{用户名}-{日期}` | `"交通费报销-张三-2026-08-04"` |
75
+
76
+ - 日期使用当前日期
77
+ - N = 明细行总数(发票数量)
78
+ - 从事前申请标题中提取核心关键词(去掉"申请"后缀)
79
+ - 标题不超过 30 个字
80
+
81
+ ---
82
+
83
+ ## main_fields 填充规则
84
+
85
+ 来自 `invoice.reim.form.structure` 返回的 `mainFields`,逐个字段推断值。
86
+
87
+ 每条记录格式:
88
+
89
+ ```json
90
+ {"fieldId": "xxx", "value": "值或ID", "fieldName": "字段名称"}
91
+ ```
92
+
93
+ 或(Select 下拉选项型):
94
+
95
+ ```json
96
+ {"fieldId": "xxx", "optionValue": "选项值", "fieldName": "字段名称"}
97
+ ```
98
+
99
+ **value 和 optionValue 二选一**:有 options 的字段用 `optionValue`,其他用 `value`。
100
+
101
+ ---
102
+
103
+ ## detail_rows 填充规则
104
+
105
+ 来自 `invoice.reim.form.structure` 返回的 `subTables[0].subFields`(**只填第一个明细表**)。
106
+
107
+ - **只填写 `subTables` 中第一个明细表(`subTables[0]`)的字段,其他明细表不用填值**
108
+ - `dataIndex` 从 1 开始递增
109
+ - `subFormId` = `subTables[0].subFormId`
110
+
111
+ ### 过滤红冲发票(前置处理第一步)
112
+
113
+ 获取到发票列表后,**必须先过滤掉全额红冲发票**(`info.comm_info.pro.status == 8`),这类发票不允许报销。过滤后的发票才进入后续分类。
114
+
115
+ ### 发票与相关凭证分类(前置处理第二步)
116
+
117
+ 过滤后的发票列表,**按 `invoiceTypeCode`(即 `info.comm_info.pro.type`)分类**,再组装明细行。
118
+
119
+ > 完整的发票类型 ID 与名称映射见 [reim-api-reference.md - 发票类型 ID 映射表](reim-api-reference.md#发票类型-id-映射表)
120
+
121
+ | 分类 | invoiceTypeCode | 示例 | 填单行为 |
122
+ |------|-----------------|------|----------|
123
+ | **发票** | 除 17/18/57/58 以外 | 增值税发票(1/2/3/4)、电子发票(28/32/33)、火车票(12/47)、出租车发票(9) 等 | 每张发票 = 一行明细 |
124
+ | **相关凭证** | 17, 18, 57, 58 | 小票/水单(17)、滴滴行程单(18)、支付凭证(57)、其他票据凭证(58) | **不能独立成行**,必须与对应发票配对放在同一行 |
125
+
126
+ > **注意区分**:type=18 是滴滴的支付行程凭证(不能独立成行);滴滴开具的增值税电子普通发票 type=3,是正式发票,可独立成行。
127
+
128
+ ### 凭证与发票配对规则
129
+
130
+ 相关凭证必须找到对应的发票,配对后放入同一行明细。
131
+
132
+ > **⚠️ 前提条件:相关凭证的金额不能比对应发票的金额大(凭证 `amount` ≤ 发票 `amount`),不满足此条件的不能配对。**
133
+
134
+ 配对策略(按优先级):
135
+
136
+ 1. **金额匹配**:凭证 `amount` ≤ 发票 `amount`,且金额一致或接近
137
+ 2. **日期匹配**:凭证 `invoiceDate` 与发票 `invoiceDate` 接近(前后 7 天内)
138
+ 3. **销方匹配**:凭证 `sellerName` 与发票 `sellerName` 相同或相关(如同一交通平台)
139
+ 4. **费用类型匹配**:凭证 `expenseType` 与发票 `expenseType` 同属一类
140
+
141
+ > 如果凭证找不到可配对的发票,则跳过该凭证(不单独成行),并在结果中提示用户。
142
+
143
+ ### 明细行中的两个 EinvoiceComponent 字段
144
+
145
+ `subTables[0].subFields` 中存在两个 `EinvoiceComponent` 类型的字段:
146
+
147
+ | 字段 | fieldType | single | 填入内容 |
148
+ |------|-----------|--------|----------|
149
+ | **相关发票** | `EinvoiceComponent` | `false` | 发票的 `invoiceId`(**必填**) |
150
+ | **相关凭证** | `EinvoiceComponent` | `true` | 配对凭证的 `invoiceId`(**有则必填,无则不填**) |
151
+
152
+ ### 填值规则
153
+
154
+ | 场景 | 相关发票(single=false) | 相关凭证(single=true) |
155
+ |------|------------------------|----------------------|
156
+ | 发票有配对凭证 | 发票的 `invoiceId` | 凭证的 `invoiceId`(**必填**) |
157
+ | 发票无配对凭证 | 发票的 `invoiceId` | **不填此字段** |
158
+
159
+ ### 示例:有配对凭证
160
+
161
+ ```json
162
+ {
163
+ "dataIndex": 1,
164
+ "subFormId": "100003690000000011",
165
+ "invoiceId": "1298798990831517697",
166
+ "fields": [
167
+ {"fieldId": "100003720000000228", "value": "100.0", "fieldName": "实报金额"},
168
+ {"fieldId": "100003720000000419", "value": "2026-07-29", "fieldName": "费用日期"},
169
+ {"fieldId": "100003720000052200", "value": "100001050000000001", "fieldName": "币种"},
170
+ {"fieldId": "100003720000077896", "value": "1298798990831517697", "fieldName": "相关发票"},
171
+ {"fieldId": "100003720000077897", "value": "1298798990831518001", "fieldName": "相关凭证"}
172
+ ]
173
+ }
174
+ ```
175
+
176
+ ### 示例:无配对凭证(只填相关发票,不填相关凭证)
177
+
178
+ ```json
179
+ {
180
+ "dataIndex": 1,
181
+ "subFormId": "100003690000000011",
182
+ "invoiceId": "1298798990831517697",
183
+ "fields": [
184
+ {"fieldId": "100003720000000228", "value": "100.0", "fieldName": "实报金额"},
185
+ {"fieldId": "100003720000000419", "value": "2026-07-29", "fieldName": "费用日期"},
186
+ {"fieldId": "100003720000052200", "value": "100001050000000001", "fieldName": "币种"},
187
+ {"fieldId": "100003720000077896", "value": "1298798990831517697", "fieldName": "相关发票"}
188
+ ]
189
+ }
190
+ ```
191
+
192
+ ### invoiceId 必须出现的位置
193
+
194
+ > 1. `detail_rows` 的顶层 `invoiceId` 字段 — 填发票(非凭证)的 ID
195
+ > 2. `fields` 中 `EinvoiceComponent`+`single=false` 的字段 — 填发票的 `invoiceId`(必填)
196
+ > 3. `fields` 中 `EinvoiceComponent`+`single=true` 的字段 — 有配对凭证时填凭证的 `invoiceId`,无凭证则不填
197
+ >
198
+ > 位置 1 和 2 必须有值,位置 3 仅在有配对凭证时才填!
199
+
200
+ ---
201
+
202
+ ## 字段值填充策略
203
+
204
+ ### 策略1:marked=false 且有 options(下拉选项型)
205
+
206
+ 从 `options` 列表中选择最匹配的 `optionValue`,用 `optionValue` 字段输出。
207
+
208
+ ```
209
+ 输入:fieldName="报销方式", options=[{optionName:"银行(个人报销)",optionValue:"7"}, ...]
210
+ 推断:默认选"银行(个人报销)" → optionValue = "7"
211
+ 输出:{"fieldId":"xxx", "optionValue":"7", "fieldName":"报销方式"}
212
+ ```
213
+
214
+ **optionValue 填的是选项的 optionValue 值,不是 optionName。**
215
+
216
+ ### 策略2:marked=false 且无 options(文本/日期/金额型)
217
+
218
+ 根据 `fieldName` 语义从已知数据中提取或生成值,用 `value` 字段输出。
219
+
220
+ | fieldType | value 格式 | 示例 |
221
+ |-----------|------------|------|
222
+ | DateComponent | yyyy-MM-dd | `"2026-08-04"` |
223
+ | Text | 文本字符串 | `"差旅报销说明"` |
224
+ | TextArea | 文本字符串 | `"2026-07-31 交通费 - 滴滴出行"` |
225
+ | Money | 数字字符串 | `"108.20"` |
226
+ | NumberComponent | 数字字符串 | `"1"` |
227
+
228
+ ### 策略3:marked=true(需要数据 ID)
229
+
230
+ 必须填写数据 ID,用 `value` 字段输出。
231
+
232
+ > **自动填单时(Step 4),`marked=true` 的字段只从上下文已有数据中获取 ID,不调用 `invoice.reim.field.search`。**
233
+
234
+ 来源(上下文已有 ID):
235
+
236
+ | 字段 | ID 来源 | 是否必填 |
237
+ |------|---------|----------|
238
+ | 报销人/申请人/提单人员/人员ID | 事前申请的 `creatorId`,或当前用户 ID | 有数据就填 |
239
+ | 部门/报销部门/部门ID/承担人部门 | 事前申请的 `creatorDepartmentId`,或当前用户部门 ID | 有数据就填 |
240
+ | 相关流程/事前申请 | 事前申请的 `requestid` | 有数据就填 |
241
+ | **承担主体** | **当前用户 ID(`creatorId`)** | **⚠️ 必填,永远不能为空** |
242
+ | **报销人上级** | **`invoice.reim.employee-superiors` 返回的 `allSuperiors[0].id`(直接上级 ID,直接赋值)** | **⚠️ 必填,永远不能为空** |
243
+ | **承担人直接上级** | **`invoice.reim.employee-superiors` 返回的 `allSuperiors[0].id`(直接上级 ID,直接赋值)** | **⚠️ 必填,永远不能为空** |
244
+ | **承担人所有上级** | **`invoice.reim.employee-superiors` 返回的 `allSuperiors` 所有 `id` 用逗号拼接(如 `"id1,id2,id3"`)** | **⚠️ 必填,永远不能为空** |
245
+ | **费用类型(科目)** | **优先 `invoice.reim.row-info` 返回的 `subjectId`;为空时按 [expense-subject-rules.md](reim-expense-subject-rules.md) 匹配,匹配不到用兜底 `"100502270000000104"`** | **⚠️ 必填,永远不能为空** |
246
+ | 相关发票 | `invoiceId` | 必填 |
247
+ | **相关客户(主表)** | **非出差**:固定值 `"100504500000311504"`(泛微上海);**出差流程**:必须由用户提供具体客户,见下方「出差流程相关客户」 | **⚠️ 必填;出差流程未提供则不允许报销** |
248
+ | 币种 | 固定 `"100001050000000001"`(人民币) | 必填 |
249
+ | 上下文中找不到 ID 的其他字段 | 放入 `unable_to_fill` | — |
250
+
251
+ > **⚠️ 以下字段绝不放入 `unable_to_fill`,必须有值:**
252
+ > - **费用类型(科目)**:按科目匹配规则匹配,所有策略都无法匹配时用兜底科目 `"100502270000000104"`(其他-管理费用)
253
+ > - **相关客户(非出差)**:固定填 `"100504500000311504"`(泛微上海)
254
+ > - **相关客户(出差流程)**:必须由用户提供具体客户后再填,未提供则**暂停且不允许调用 `invoice.reim.flow.create.prepare/apply`**,不能用固定值顶替
255
+ > - **合同编号**:固定填 `"20260999"`,不需要从其他来源提取
256
+ > - **承担主体**:使用当前用户 ID(`creatorId`)
257
+ > - **报销人上级**:`invoice.reim.employee-superiors` 返回的 `allSuperiors[0].id`
258
+ > - **承担人直接上级**:`invoice.reim.employee-superiors` 返回的 `allSuperiors[0].id`
259
+ > - **承担人所有上级**:`invoice.reim.employee-superiors` 返回的 `allSuperiors` 所有 `id` 用逗号拼接
260
+
261
+ ### 出差流程相关客户(硬拦截)
262
+
263
+ > **出差报销必须由用户填写具体相关客户。未提供则不允许报销,禁止调用 `invoice.reim.flow.create.prepare/apply`。**
264
+
265
+ **如何判断是出差流程(满足任一即可):**
266
+
267
+ | 判断依据 | 条件 |
268
+ |----------|------|
269
+ | 报销工作流名称 `workFlowName` | 含「差旅」或「出差」 |
270
+ | 事前申请名称 `requestname` | 含「出差」或「差旅」 |
271
+ | 用户表述 | 明确说「出差报销」「差旅报销」 |
272
+
273
+ **填单规则:**
274
+
275
+ | 流程类型 | 相关客户怎么填 | 未提供时 |
276
+ |----------|----------------|----------|
277
+ | **出差 / 差旅** | 暂停询问用户具体客户名称;用户给出后用 `invoice.reim.field.search` 搜索 ID,唯一结果直接填,多候选让用户选 | **不允许报销**,不创建报销单 |
278
+ | **非出差** | 固定填 `"100504500000311504"`(泛微上海) | 不适用 |
279
+
280
+ **出差流程操作步骤:**
281
+
282
+ 1. 识别为出差后,**在 Step 5 调用 `invoice.reim.flow.create.prepare/apply` 之前必须暂停**
283
+ 2. 明确提醒用户:「当前为出差报销,必须填写相关客户。请提供具体客户名称,否则无法继续报销。」
284
+ 3. 用户给出客户名称 → 调用 `invoice.reim.field.search` 搜索 ID → 填入主表和明细表的「相关客户」字段
285
+ 4. 用户拒绝、取消、或不提供具体客户 → **结束报销流程,禁止调用 `invoice.reim.flow.create.prepare/apply`**
286
+ 5. **禁止**用固定值 `"100504500000311504"` 顶替出差的相关客户
287
+ 6. **禁止**把出差相关客户放入 `unable_to_fill` 后继续创建报销单
288
+
289
+ ---
290
+
291
+ ## 字段名称 → 数据来源映射表
292
+
293
+ ### 主表字段映射
294
+
295
+ | fieldName 关键词 | 数据来源 | value 取值 |
296
+ |------------------|----------|------------|
297
+ | 申请人/报销人/创建人 | 事前申请 | `creatorId` |
298
+ | 部门/报销部门/申请人部门 | 事前申请 | `creatorDepartmentId` |
299
+ | 报销日期/申请日期 | 系统当前日期 | 当天日期 yyyy-MM-dd |
300
+ | 报销方式 | options 默认选项 | 默认选"银行(个人报销)"的 optionValue |
301
+ | 报销事由/摘要 | AI生成 | `"{日期} {费用类型} - {销方简称}"`(**禁止包含 `*` 号**) |
302
+ | 相关流程/事前申请 | 事前申请 | `requestid`(marked=true) |
303
+ | 相关人员 | 事前申请 | `creatorName` |
304
+ | **相关客户** | **按是否出差分流** | **非出差**:固定填 `"100504500000311504"`(泛微上海)。**出差流程**:必须提醒用户填写具体客户,拿到客户名称后搜索 ID 再填;用户未提供则不允许报销 |
305
+ | **合同编号** | **固定值** | **固定填 `"20260999"`,不从其他来源提取,不能留空或放入 unable_to_fill** |
306
+ | **承担主体** | **事前申请/当前用户** | **`creatorId`(marked=true),不能留空或放入 unable_to_fill** |
307
+ | **报销人上级** | **`invoice.reim.employee-superiors`** | **`allSuperiors[0].id`(直接上级 ID,直接赋值),不能留空或放入 unable_to_fill** |
308
+ | **承担人直接上级** | **`invoice.reim.employee-superiors`** | **`allSuperiors[0].id`(直接上级 ID,直接赋值),不能留空或放入 unable_to_fill** |
309
+ | **承担人所有上级** | **`invoice.reim.employee-superiors`** | **`allSuperiors` 所有 `id` 用逗号拼接赋值(如 `"id1,id2,id3"`),不能留空或放入 unable_to_fill** |
310
+ | 币种 | options 默认选项 | 默认选"人民币"的 optionValue |
311
+ | 申请金额/人民币金额 | 发票 | 发票金额合计(所有**发票**的 `amount` 之和,不含相关凭证) |
312
+
313
+ ### 明细表字段映射
314
+
315
+ > **⚠️ 标注"`invoice.reim.row-info` 优先"的字段:先取 `invoice.reim.row-info` 返回值,为空/null 时才回退到 AI 推断。**
316
+
317
+ | fieldName 关键词 | 数据来源 | value 取值 |
318
+ |------------------|----------|------------|
319
+ | 费用日期/发生日期 | **`invoice.reim.row-info` 优先** → 发票 | 优先 `invoice.reim.row-info` 返回的 `date`,回退 `invoiceDate` |
320
+ | 实报金额 | 发票 | `amount` |
321
+ | **申请金额** | **发票** | **`amount`(与实报金额一致,不能遗漏)** |
322
+ | 报销金额/人民币金额/含税金额及其他 `fieldType="Money"` 字段 | 发票 | `amount` |
323
+ | 费用说明/摘要 | **`invoice.reim.row-info` 优先** → 发票 | **交通类发票**:只填 `{出发地精简}-{目的地精简}`,见下方规则;**其他发票**:优先 `invoice.reim.row-info` 返回的 `fysm`,回退从 `consumeContent` 提取(**必须去掉所有 `*` 号**,如 `*交通运输服务*客运服务费` → `交通运输服务客运服务费`),**不能包含逗号和 `*` 号** |
324
+ | **费用类型/费用科目** | **`invoice.reim.row-info` 优先** → 发票+事前申请 | 优先 `invoice.reim.row-info` 返回的 `subjectId`,回退按 [expense-subject-rules.md](reim-expense-subject-rules.md) 匹配,**必须填值,匹配不到用兜底 `"100502270000000104"`** |
325
+ | **相关客户** | **按是否出差分流** | **非出差**:固定填 `"100504500000311504"`。**出差流程**:与主表一致,填用户确认后的客户 ID;用户未提供则不允许报销 |
326
+ | 相关项目 | 事前申请标题 | marked=true时搜索提取的项目名称获取ID |
327
+ | 相关流程 | 匹配绑定关系 | 该发票绑定的 `preApprovalId`(requestid) |
328
+ | 币种 | 默认固定值 | `"100001050000000001"`(人民币) |
329
+ | 附件数 | 默认 | `"1"` |
330
+ | **相关发票**(`EinvoiceComponent`, `single=false`) | **发票** | **发票的 `invoiceId`(必填)** |
331
+ | **相关凭证**(`EinvoiceComponent`, `single=true`) | **`invoice.reim.row-info` 优先** → 凭证配对 | 优先 `invoice.reim.row-info` 返回的 `itinerary`,回退到凭证配对逻辑;**无凭证则不填** |
332
+
333
+ > **⚠️ 明细行金额字段填写规则(重要,容易遗漏):**
334
+ > 明细表中 `fieldType="Money"` 的字段,无论 `fieldName` 叫什么名字(实报金额、报销金额、申请金额、人民币金额、含税金额等),**全部统一填该行发票的 `amount`**。
335
+ > 遍历 `subFields` 时,只要 `fieldType="Money"`,就填 `amount`,不要因为字段名不是"实报金额"就跳过。
336
+
337
+ ### 交通类发票费用说明特殊规则
338
+
339
+ 当发票为交通类时(判断条件:`expenseType` 含"交通"/"出行"/"打车",或 `consumeContent` 含"客运服务费"/"运输服务",或 `sellerName` 含"滴滴"/"享道"/"高德"/"曹操"等),需要**额外调用 `invoice.get`** 获取出发地和目的地(详见 [reim-api-reference.md](reim-api-reference.md#57-获取发票详情交通类发票行程信息)),然后将精简后的行程拼入费用说明。
340
+
341
+ **费用说明格式**:`{出发地精简}-{目的地精简}`(交通类发票**只填行程**,不需要前面的费用类型描述)
342
+
343
+ ### 地名精简规则
344
+
345
+ **1. 去掉冗余修饰词**:方位后缀("西北侧"/"东侧"/"南侧"/"出发层"等)、"股份有限公司"/"有限公司"等企业后缀
346
+
347
+ **2. 保留核心地名和关键标识**:门店名、品牌名、航站楼编号、车站名等
348
+
349
+ **3. 括号内容处理**:
350
+ - 括号内是核心补充信息(如区域名、业务中心名)→ 精简后保留
351
+ - 括号内是方位/门号等冗余信息(如"南门"/"西2门")→ 视情况保留关键部分或去掉
352
+ - 去掉门牌号(如"30号"/"3419号")
353
+
354
+ **4. 长度控制**:每个地名精简后控制在 10 字以内
355
+
356
+ ```
357
+ 示例:
358
+ from = "北京SKP(西2门)西北侧"
359
+ → 精简 = "北京SKP西2门"
360
+ (去掉"西北侧"冗余方位,括号内"西2门"是关键标识保留)
361
+
362
+ from = "泛微网络科技股份有限公司(北方大区业务运营中心)"
363
+ → 精简 = "泛微网络(北方运营中心)"
364
+ (去掉"科技股份有限公司",括号内精简为核心部分)
365
+
366
+ from = "仁济医院南院区门诊部(南门)南侧", to = "浦江瑞和城柒街区30号"
367
+ → 费用说明 = "仁济医院南院-浦江瑞和城"
368
+ (去掉"门诊部""南门""南侧""柒街区30号")
369
+
370
+ from = "虹桥机场T2航站楼出发层", to = "北京南站"
371
+ → 费用说明 = "虹桥机场T2-北京南站"
372
+ (去掉"航站楼出发层",T2是关键标识保留)
373
+
374
+ from = "上海市闵行区三鲁公路3419号", to = "浦东国际机场T1航站楼到达层"
375
+ → 费用说明 = "三鲁公路-浦东机场T1"
376
+ (去掉门牌号"3419号"、"国际""航站楼到达层")
377
+ ```
378
+
379
+ > **注意**:交通类发票的费用说明**忽略** `invoice.reim.row-info` 返回的 `fysm` 和 `consumeContent`,只使用 `{出发地精简}-{目的地精简}`。如果 `invoice.get` 未返回 from/to,则回退到常规费用说明逻辑。
380
+
381
+ ---
382
+
383
+ ## need_user_confirm 触发场景
384
+
385
+ | 场景 | reason | candidates |
386
+ |------|--------|------------|
387
+ | 模糊搜索返回多个匹配项 | `"模糊搜索返回多个候选"` | 填充所有候选 `[{id, name}]` |
388
+ | 字段值需要用户选择确认 | `"需要用户选择确认"` | 填充可选列表 |
389
+
390
+ > **注意**:费用科目/费用类型字段**不放入 need_user_confirm**,始终自动选择最相关的科目。详见 [expense-subject-rules.md](reim-expense-subject-rules.md)。
391
+
392
+ `dataIndex` 说明:
393
+ - 主表字段:`dataIndex = null`
394
+ - 明细表字段:`dataIndex = 对应行号(从1开始)`
395
+
396
+ ---
397
+
398
+ ## unable_to_fill 触发场景
399
+
400
+ | 场景 | reason 示例 |
401
+ |------|-------------|
402
+ | 缺少必要数据源 | `"无相关数据,无法确定开户行"` |
403
+ | 模糊搜索无结果 | `"搜索'XX'无匹配结果"` |
404
+ | 数据不匹配 | `"发票数据中无对应信息"` |
405
+ | 需要用户输入 | `"无历史数据,需人工输入"` |
406
+
407
+ ---
408
+
409
+ ## 组装流程(Step 4 核心逻辑)
410
+
411
+ > **⚠️ 创建多个报销单时,每个报销单都必须独立执行以下完整流程,不能省略任何步骤或字段。**
412
+
413
+ 0. **⚠️ 过滤红冲发票**:先过滤掉 `info.comm_info.pro.status == 8` 的全额红冲发票,不允许报销
414
+ 1. **分类**:按 `invoiceTypeCode` 将列表分为"发票"和"相关凭证"(17/18/57/58),将凭证与发票配对
415
+ 1.5. **⚠️ 禁止 `*` 号**:所有填入报销单的文本值(费用说明、报销事由等)**禁止包含 `*` 符号**。从 `consumeContent` 等字段取值时必须先去掉所有 `*` 号(如 `*交通运输服务*客运服务费` → `交通运输服务客运服务费`)
416
+ 2. 设置 `work_flow_id` + `mainFormId` + 生成 `request_name`
417
+ 2.5. **⚠️ 出差流程拦截相关客户**:若判定为出差/差旅,先提醒用户填写具体相关客户;用户未提供则**停止组装,不允许进入 Step 5**。非出差才填固定值 `"100504500000311504"`
418
+ 3. 遍历 `mainFields` → 推断值 → 有值加入 `main_fields`,多候选→`need_user_confirm`,无法推断→`unable_to_fill`
419
+ 4. **⚠️ 对每张发票调用 `invoice.reim.row-info` 获取预填信息**(详见 [reim-api-reference.md](reim-api-reference.md#56-获取发票明细行预填信息)):
420
+ - 入参:`cdzt`=当前用户ID,`requestid`=匹配到的事前申请ID(无则留空),`invoiceId`=发票ID
421
+ - 返回的 `date`、`fysm`、`itinerary`、`subjectId` **优先使用**,只有返回为空/null时才回退到 AI 推断
422
+ 5. 每张**发票**(非凭证)= 一行明细(`dataIndex` 从 1 递增),**完整遍历 `subTables[0].subFields` 的每个字段**推断值
423
+ 6. **每行必须填写**:费用类型(科目)、所有金额字段、费用日期、费用说明、相关发票等
424
+ 7. **每行必须将发票 `invoiceId` 赋值到 `EinvoiceComponent`+`single=false` 的字段**
425
+ 8. **相关凭证**:优先使用 `invoice.reim.row-info` 返回的 `itinerary`;如无返回,使用原有凭证配对逻辑
426
+ 9. `marked=true` 字段从上下文取 ID,取不到放 `unable_to_fill`(不调用 `invoice.reim.field.search`)
427
+ 10. **⚠️ 最终检查**:检查每行明细的"费用类型(科目)"字段是否有值,如果为空,**立即填 `"100502270000000104"`**
428
+ 11. 返回完整 JSON
429
+
430
+ > **`invoice.reim.row-info` 返回值优先级规则**:
431
+ >
432
+ > | 明细字段 | `invoice.reim.row-info` 返回字段 | 有值时 | 为空/null时 |
433
+ > |----------|-------------------|--------|-------------|
434
+ > | 费用日期 | `date` | **直接使用** | 回退到发票 `invoiceDate` |
435
+ > | 费用说明 | `fysm` | **直接使用** | 回退到 AI 从 `consumeContent` 提取(**去掉所有 `*` 号**) |
436
+ > | 相关凭证 | `itinerary` | **直接使用**(多值逗号分隔) | 回退到原有凭证配对逻辑 |
437
+ > | 费用类型(科目) | `subjectId` | **直接使用** | 回退到 [expense-subject-rules.md](reim-expense-subject-rules.md) 匹配,匹配不到用兜底 |
438
+ >
439
+ > **⚠️ 费用类型(科目)是强制保底:无论来源是 `invoice.reim.row-info` 还是 AI 推断,最终都不能为空,匹配不到直接填 `"100502270000000104"`。**
440
+
441
+ ---
442
+
443
+ ## 补充说明
444
+
445
+ ### Select 类型
446
+ `optionValue` 填的是选项的 `optionValue`(如 `"7"`),不是 `optionName`(如 "银行(个人报销)")。
447
+
448
+ ### marked=true 字段
449
+ 必须填数据 ID,不能填名称文本。**自动填单时**从上下文取 ID,取不到放 `unable_to_fill`。**用户修改时**(`invoice.reim.flow.update.prepare/apply` 场景)才调用 `invoice.reim.field.search` 将文本转 ID。