From 4910345318e9e7833947a631dd677655c40baf73 Mon Sep 17 00:00:00 2001 From: hanyuqing <1106611654@qq.com> Date: Fri, 24 Oct 2025 08:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gyxtp/package-lock.json | 311 +++++++++++++++++++-- gyxtp/package.json | 1 + .../system/service/impl/SimpleParagraphSaver.java | 89 ++++++ .../ruoyi/system/service/impl/WordSplitter.java | 125 ++++++++- ruoyi-ui/src/views/system/SysPoint/index.vue | 2 +- ruoyi-ui/src/views/system/fileManage/index.vue | 2 +- ruoyi-ui/src/views/system/fileManage/indexNB.vue | 2 +- 7 files changed, 488 insertions(+), 44 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SimpleParagraphSaver.java diff --git a/gyxtp/package-lock.json b/gyxtp/package-lock.json index cf0fd4c..c94ffd0 100644 --- a/gyxtp/package-lock.json +++ b/gyxtp/package-lock.json @@ -19,6 +19,7 @@ "echarts-wordcloud": "^2.0.0", "element-plus": "^2.8.8", "fabric": "^6.4.3", + "mammoth": "^1.11.0", "neovis.js": "^2.1.0", "pdfjs-dist": "^5.4.149", "relation-graph-vue3": "^2.2.11", @@ -4185,6 +4186,14 @@ "integrity": "sha512-ztriE8oFOamRrV9opBURDy+JMiyhur2//vOXsC5CgdnYCB0L1Lnaag4NzP8N+NFCj7uNz9JRYtPmAbQMSDLIsQ==", "dev": true }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz", + "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -4506,7 +4515,6 @@ "version": "1.0.10", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -5721,8 +5729,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cosmiconfig": { "version": "7.1.0", @@ -6375,6 +6382,11 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true }, + "node_modules/dingbat-to-unicode": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz", + "integrity": "sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w==" + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-3.0.1.tgz", @@ -6522,6 +6534,14 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "node_modules/duck": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/duck/-/duck-0.1.12.tgz", + "integrity": "sha512-wkctla1O6VfP89gQ+J/yDesM0S7B7XLXjKGzXxMDVFg7uEn706niAtyYovKbyq1oT9YwDcly721/iUWoc8MVRg==", + "dependencies": { + "underscore": "^1.13.1" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz", @@ -8847,6 +8867,11 @@ "node": ">=0.10.0" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "node_modules/immutable": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz", @@ -8911,8 +8936,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "devOptional": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ip-address": { "version": "9.0.5", @@ -9142,8 +9166,7 @@ "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/isexe": { "version": "2.0.0", @@ -9386,6 +9409,44 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/keycharm": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/keycharm/-/keycharm-0.4.0.tgz", @@ -9527,6 +9588,14 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz", @@ -9832,6 +9901,16 @@ "node": ">=4" } }, + "node_modules/lop": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/lop/-/lop-0.4.2.tgz", + "integrity": "sha512-RefILVDQ4DKoRZsJ4Pj22TxE3omDO47yFpkIBoDKzkqPRISs5U1cnAdg/5583YPkWPaLIYHOKRMQSvjFsO26cw==", + "dependencies": { + "duck": "^0.1.12", + "option": "~0.2.1", + "underscore": "^1.13.1" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/lower-case/-/lower-case-2.0.2.tgz", @@ -9927,6 +10006,34 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/mammoth": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/mammoth/-/mammoth-1.11.0.tgz", + "integrity": "sha512-BcEqqY/BOwIcI1iR5tqyVlqc3KIaMRa4egSoK83YAVrBf6+yqdAAbtUcFDCWX8Zef8/fgNZ6rl4VUv+vVX8ddQ==", + "dependencies": { + "@xmldom/xmldom": "^0.8.6", + "argparse": "~1.0.3", + "base64-js": "^1.5.1", + "bluebird": "~3.4.0", + "dingbat-to-unicode": "^1.0.1", + "jszip": "^3.7.1", + "lop": "^0.4.2", + "path-is-absolute": "^1.0.0", + "underscore": "^1.13.1", + "xmlbuilder": "^10.0.0" + }, + "bin": { + "mammoth": "bin/mammoth" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/mammoth/node_modules/bluebird": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", + "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" + }, "node_modules/map-obj": { "version": "4.3.0", "resolved": "https://registry.npmmirror.com/map-obj/-/map-obj-4.3.0.tgz", @@ -11224,6 +11331,11 @@ "opener": "bin/opener-bin.js" } }, + "node_modules/option": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/option/-/option-0.2.4.tgz", + "integrity": "sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A==" + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz", @@ -11364,6 +11476,11 @@ "node": ">=6" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmmirror.com/param-case/-/param-case-3.0.4.tgz", @@ -11466,7 +11583,6 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -12221,8 +12337,7 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/progress": { "version": "2.0.3", @@ -13370,6 +13485,11 @@ "node": ">= 0.4" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -13659,8 +13779,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/ssri": { "version": "8.0.1", @@ -14391,6 +14510,11 @@ "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", "dev": true }, + "node_modules/underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==" + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz", @@ -14733,8 +14857,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "devOptional": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/utila": { "version": "0.4.0", @@ -15696,6 +15819,14 @@ "node": ">=12" } }, + "node_modules/xmlbuilder": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-10.1.1.tgz", + "integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz", @@ -18781,6 +18912,11 @@ "integrity": "sha512-ztriE8oFOamRrV9opBURDy+JMiyhur2//vOXsC5CgdnYCB0L1Lnaag4NzP8N+NFCj7uNz9JRYtPmAbQMSDLIsQ==", "dev": true }, + "@xmldom/xmldom": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz", + "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==" + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -19016,7 +19152,6 @@ "version": "1.0.10", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -19911,8 +20046,7 @@ "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "cosmiconfig": { "version": "7.1.0", @@ -20372,6 +20506,11 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true }, + "dingbat-to-unicode": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz", + "integrity": "sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w==" + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-3.0.1.tgz", @@ -20484,6 +20623,14 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "duck": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/duck/-/duck-0.1.12.tgz", + "integrity": "sha512-wkctla1O6VfP89gQ+J/yDesM0S7B7XLXjKGzXxMDVFg7uEn706niAtyYovKbyq1oT9YwDcly721/iUWoc8MVRg==", + "requires": { + "underscore": "^1.13.1" + } + }, "duplexer": { "version": "0.1.2", "resolved": "https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz", @@ -22218,6 +22365,11 @@ "dev": true, "optional": true }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "immutable": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz", @@ -22269,8 +22421,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "devOptional": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ip-address": { "version": "9.0.5", @@ -22442,8 +22593,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "isexe": { "version": "2.0.0", @@ -22644,6 +22794,46 @@ "universalify": "^2.0.0" } }, + "jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "keycharm": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/keycharm/-/keycharm-0.4.0.tgz", @@ -22745,6 +22935,14 @@ "type-check": "~0.4.0" } }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, "lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz", @@ -22989,6 +23187,16 @@ } } }, + "lop": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/lop/-/lop-0.4.2.tgz", + "integrity": "sha512-RefILVDQ4DKoRZsJ4Pj22TxE3omDO47yFpkIBoDKzkqPRISs5U1cnAdg/5583YPkWPaLIYHOKRMQSvjFsO26cw==", + "requires": { + "duck": "^0.1.12", + "option": "~0.2.1", + "underscore": "^1.13.1" + } + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/lower-case/-/lower-case-2.0.2.tgz", @@ -23071,6 +23279,30 @@ } } }, + "mammoth": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/mammoth/-/mammoth-1.11.0.tgz", + "integrity": "sha512-BcEqqY/BOwIcI1iR5tqyVlqc3KIaMRa4egSoK83YAVrBf6+yqdAAbtUcFDCWX8Zef8/fgNZ6rl4VUv+vVX8ddQ==", + "requires": { + "@xmldom/xmldom": "^0.8.6", + "argparse": "~1.0.3", + "base64-js": "^1.5.1", + "bluebird": "~3.4.0", + "dingbat-to-unicode": "^1.0.1", + "jszip": "^3.7.1", + "lop": "^0.4.2", + "path-is-absolute": "^1.0.0", + "underscore": "^1.13.1", + "xmlbuilder": "^10.0.0" + }, + "dependencies": { + "bluebird": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", + "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" + } + } + }, "map-obj": { "version": "4.3.0", "resolved": "https://registry.npmmirror.com/map-obj/-/map-obj-4.3.0.tgz", @@ -24085,6 +24317,11 @@ "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", "dev": true }, + "option": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/option/-/option-0.2.4.tgz", + "integrity": "sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A==" + }, "optionator": { "version": "0.9.4", "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz", @@ -24187,6 +24424,11 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "param-case": { "version": "3.0.4", "resolved": "https://registry.npmmirror.com/param-case/-/param-case-3.0.4.tgz", @@ -24272,8 +24514,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "devOptional": true + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", @@ -24769,8 +25010,7 @@ "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { "version": "2.0.3", @@ -25640,6 +25880,11 @@ "has-property-descriptors": "^1.0.2" } }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -25865,8 +26110,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "ssri": { "version": "8.0.1", @@ -26423,6 +26667,11 @@ "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", "dev": true }, + "underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==" + }, "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz", @@ -26650,8 +26899,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "devOptional": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "utila": { "version": "0.4.0", @@ -27334,6 +27582,11 @@ "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "optional": true }, + "xmlbuilder": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-10.1.1.tgz", + "integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==" + }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz", diff --git a/gyxtp/package.json b/gyxtp/package.json index a58086b..c421fc4 100644 --- a/gyxtp/package.json +++ b/gyxtp/package.json @@ -16,6 +16,7 @@ "echarts-wordcloud": "^2.0.0", "element-plus": "^2.8.8", "fabric": "^6.4.3", + "mammoth": "^1.11.0", "neovis.js": "^2.1.0", "pdfjs-dist": "^5.4.149", "relation-graph-vue3": "^2.2.11", diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SimpleParagraphSaver.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SimpleParagraphSaver.java new file mode 100644 index 0000000..f174de1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SimpleParagraphSaver.java @@ -0,0 +1,89 @@ +package com.ruoyi.system.service.impl; + +import lombok.var; +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.apache.poi.xwpf.usermodel.XWPFParagraph; +import org.apache.poi.xwpf.usermodel.XWPFRun; +import org.springframework.stereotype.Service; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import org.apache.poi.xwpf.usermodel.*; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR; + +import java.util.List; +/** + * 极简工具:将一个段落保存为独立的 .docx 文件 + */ +@Service +public class SimpleParagraphSaver { + + public static void saveAsDocx(XWPFDocument sourceDoc, String filePath) throws IOException { + XWPFDocument newDoc = new XWPFDocument(); + + boolean hasContent = false; + int paraIndex = 0; + + for (XWPFParagraph srcPara : sourceDoc.getParagraphs()) { + String text = srcPara.getText(); + System.out.println("处理段落 " + paraIndex++ + ": \"" + srcPara.getText() + "\""); + if (text == null || text.trim().isEmpty()) { + continue; // 跳过空段落(可选) + } + + XWPFParagraph newPara = newDoc.createParagraph(); + + for (XWPFRun run : srcPara.getRuns()) { + XWPFRun newRun = newPara.createRun(); + String runText = run.getText(0); + if (runText != null && !runText.isEmpty()) { + newRun.setText(runText); + hasContent = true; + } + + // 复制基础格式(避免 setSubscript 报错) + newRun.setBold(run.isBold()); + newRun.setItalic(run.isItalic()); + newRun.setUnderline(run.getUnderline()); + newRun.setColor(run.getColor()); + newRun.setFontFamily(run.getFontFamily()); + newRun.setFontSize(run.getFontSize()); + newRun.setStrikeThrough(run.isStrikeThrough()); + } + } + + if (!hasContent) { + // 防止保存完全空白的文档 + XWPFParagraph para = newDoc.createParagraph(); + para.createRun().setText("(本节无有效内容)"); + } + + try (FileOutputStream fos = new FileOutputStream(filePath)) { + newDoc.write(fos); // ✅ 必须调用 write + } finally { + newDoc.close(); + } + } + + public void copyParagraph(XWPFParagraph srcPara, XWPFDocument destDoc) { + // 创建新段落 + XWPFParagraph newPara = destDoc.createParagraph(); + newPara.getCTP().set(srcPara.getCTP()); // ✅ 关键:直接复制底层 CTP XML + } + + /** + * 将整个文档的某一段落保存为新文件(含公式) + */ + public XWPFDocument saveParagraphAsDocx(XWPFParagraph srcPara) throws Exception { + + + XWPFDocument newDoc = new XWPFDocument(); + + // 复制段落(含公式、图片) + copyParagraph(srcPara, newDoc); + return newDoc; + + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java index 27715e7..bf36f1d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java @@ -12,8 +12,10 @@ import com.ruoyi.system.domain.ZhySetInfo; import com.ruoyi.system.mapper.Test1Mapper; import com.ruoyi.system.mapper.ZhyBattleMapper; import com.ruoyi.system.mapper.ZhySetInfoMapper; +import org.apache.commons.compress.utils.IOUtils; import org.apache.poi.openxml4j.util.ZipSecureFile; import org.apache.poi.xwpf.usermodel.*; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -60,17 +62,22 @@ public class WordSplitter { String picSize = info.get(0).getContent(); try { + byte[] fileBytes = IOUtils.toByteArray(fileInputStream); + + // 创建文件输入流 - FileInputStream fis = fileInputStream; -// System.out.println(fis); - XWPFDocument document = new XWPFDocument(fis); + XWPFDocument document = new XWPFDocument(new ByteArrayInputStream(fileBytes)); + XWPFDocument document1 = new XWPFDocument(new ByteArrayInputStream(fileBytes)); // 遍历段落,寻找标题并拆分 List paragraphs = document.getParagraphs(); + List paragraphs1 = document1.getParagraphs(); + String currentSectionTitle = ""; String realTitle = ""; String realleve = ""; XWPFDocument currentSection = new XWPFDocument(); + XWPFDocument currentSection1 = new XWPFDocument(); List currentSectionImages = new ArrayList<>(); @@ -142,9 +149,12 @@ public class WordSplitter { } } } + + List useImgs = new ArrayList<>(); for (int c = 0; c < paragraphs.size(); c++) { - + System.out.println(paragraphs1.get(c).getText()); + System.out.println(paragraphs.get(c).getText()); XWPFParagraph paragraph = paragraphs.get(c); @@ -172,6 +182,10 @@ public class WordSplitter { + + + + String type = String.valueOf(startsWithHeading1(textss,fileUploadDTO).get("type")); String title = String.valueOf(startsWithHeading1(textss,fileUploadDTO).get("title")); String url = String.valueOf(startsWithHeading1(textss,fileUploadDTO).get("docUrl")); @@ -201,7 +215,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); @@ -242,8 +263,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); - + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); currentSectionTitle = paragraph.getText().trim().replaceAll("[/\\\\:*?|]", "&"); @@ -286,8 +313,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); - + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); currentSectionTitle = paragraph.getText().trim().replaceAll("[/\\\\:*?|]", "&"); @@ -327,8 +360,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); - + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); currentSectionTitle = paragraph.getText().trim().replaceAll("[/\\\\:*?|]", "&");; @@ -367,8 +406,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); - + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); currentSectionTitle = paragraph.getText().trim().replaceAll("[/\\\\:*?|]", "&");; @@ -407,8 +452,14 @@ public class WordSplitter { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); +// simpleParagraphSaver.saveAsDocx(currentSection1,outputFolder + "\\" + currentSectionTitle+".docx"); + try (FileOutputStream fos = new FileOutputStream(outputFolder + "\\" + currentSectionTitle + ".docx")) { + currentSection1.write(fos); + } finally { + currentSection1.close(); + } currentSection = new XWPFDocument(); - + currentSection1 = new XWPFDocument(); } useImgs = new ArrayList<>(); currentSectionTitle = paragraph.getText().trim().replaceAll("[/\\\\:*?|]", "&");; @@ -437,6 +488,46 @@ public class WordSplitter { System.out.println("aaaaaaaaaaaaa--------saa"); System.out.println(useImgs.size()); + + + XWPFParagraph newPara = currentSection1.createParagraph(); + newPara.getCTP().set(paragraphs1.get(c).getCTP()); + + + // 3. 遍历原段落中的图片并修复 + for (XWPFRun run1 : paragraphs1.get(c).getRuns()) { + for (XWPFPicture picture : run1.getEmbeddedPictures()) { + try { + byte[] imgData = picture.getPictureData().getData(); + int imgType = picture.getPictureData().getPictureType(); + + // 添加图片到新文档 + String newRid = currentSection1.addPictureData( + new ByteArrayInputStream(imgData), + imgType + ); + + // 获取原 rId + String oldRid = picture.getCTPicture().getBlipFill().getBlip().getEmbed(); + + // 替换 XML 中的关系 ID + String xml = newPara.getCTP().toString(); + if (xml.contains("r:embed=\"" + oldRid + "\"")) { + xml = xml.replace("r:embed=\"" + oldRid + "\"", + "r:embed=\"" + newRid + "\""); + + CTP repaired = CTP.Factory.parse(xml); + newPara.getCTP().set(repaired); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + + //正文 XWPFParagraph newParagraph = currentSection.createParagraph(); newParagraph.setAlignment(paragraph.getAlignment()); @@ -473,11 +564,12 @@ public class WordSplitter { realleve = type; String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; saveSection(currentSection, outputFolder, currentSectionTitle, type, outputFilePath, realTitle,outputFolder,fileId,currentSectionImages); + currentSectionImages = new ArrayList<>(); } levelList = list; // 关闭资源 - fis.close(); +// fis.close(); int a = test1Mapper.insertDocList(docList); docList = new ArrayList<>(); getLevelInfo(); @@ -485,13 +577,15 @@ public class WordSplitter { e.printStackTrace(); } catch (InvalidExtensionException e) { throw new RuntimeException(e); + } catch (Exception e) { + throw new RuntimeException(e); } } - - +@Autowired +SimpleParagraphSaver simpleParagraphSaver; public void testWordOneOld(FileInputStream fileInputStream, String outputFolder, Integer fileId) { levelList = new ArrayList<>(); List list = new ArrayList<>(); @@ -622,6 +716,12 @@ public class WordSplitter { String title = String.valueOf(startsWithHeadingOld(textss).get("title")); String url = String.valueOf(startsWithHeadingOld(textss).get("docUrl")); + + + + + + //判断文件是否为空 if (!textss.equals("")) { //判断为几级标题 @@ -645,6 +745,7 @@ public class WordSplitter { if (!currentSectionTitle.isEmpty()) { currentSectionTitle = currentSectionTitle.replace(" ",""); String outputFilePath = outputFolder + "\\" + currentSectionTitle + ".txt"; + saveSection(currentSection, outputFolder, currentSectionTitle, realleve, outputFilePath, realTitle,outputFolder,fileId,useImgs); currentSection = new XWPFDocument(); diff --git a/ruoyi-ui/src/views/system/SysPoint/index.vue b/ruoyi-ui/src/views/system/SysPoint/index.vue index 71ad86b..fbe742d 100644 --- a/ruoyi-ui/src/views/system/SysPoint/index.vue +++ b/ruoyi-ui/src/views/system/SysPoint/index.vue @@ -223,7 +223,7 @@ export default { typeOptions: [ { label: '作者', value: 'author' }, { label: '机构', value: 'agency' }, - { label: '关键词', value: 'keyword' } + // { label: '关键词', value: 'keyword' } ], // 遮罩层 loading: true, diff --git a/ruoyi-ui/src/views/system/fileManage/index.vue b/ruoyi-ui/src/views/system/fileManage/index.vue index 2aef7f1..f4bc5f1 100644 --- a/ruoyi-ui/src/views/system/fileManage/index.vue +++ b/ruoyi-ui/src/views/system/fileManage/index.vue @@ -341,7 +341,7 @@
将文件拖到此处,或点击上传
- 仅允许导入doc、docx格式文件。 + 仅允许导入docx格式文件。 {{ upload.tip }}
diff --git a/ruoyi-ui/src/views/system/fileManage/indexNB.vue b/ruoyi-ui/src/views/system/fileManage/indexNB.vue index bce2d3e..d9fb1ae 100644 --- a/ruoyi-ui/src/views/system/fileManage/indexNB.vue +++ b/ruoyi-ui/src/views/system/fileManage/indexNB.vue @@ -224,7 +224,7 @@
将文件拖到此处,或点击上传
- 仅允许导入doc、docx格式文件。 + 仅允许导入docx格式文件。 {{ upload.tip }}