Browse Source

基础框架发布: 8.2.34

1) 修复首页我的已办的时间显示错误
  2) 增加异步任务功能和数据存储功能

前端核心发布: 8.2.127
 1) 增加异步任务
main
wangshaoping 4 weeks ago
parent
commit
d2b97c0f8b
  1. 5
      cips.frontend/package.json
  2. 2
      cips.frontend/public/configure.js
  3. 5
      erm.frontend/package.json
  4. 2
      erm.frontend/public/configure.js
  5. 5
      gradle.properties
  6. 5
      io.sc.engine.mv.frontend/package.json
  7. 2
      io.sc.engine.mv.frontend/public/configure.js
  8. 5
      io.sc.engine.rule.frontend/package.json
  9. 2
      io.sc.engine.rule.frontend/public/configure.js
  10. 5
      io.sc.engine.st.frontend/package.json
  11. 2
      io.sc.engine.st.frontend/public/configure.js
  12. 5
      io.sc.platform.ai.frontend/package.json
  13. 2
      io.sc.platform.ai.frontend/public/configure.js
  14. 151
      io.sc.platform.core.frontend/package copy.json
  15. 2
      io.sc.platform.core.frontend/package.json
  16. 2
      io.sc.platform.core.frontend/public/configure.js
  17. 1
      io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue
  18. 1
      io.sc.platform.core.frontend/src/platform/components/grid/ts/GridTools.ts
  19. 1
      io.sc.platform.core.frontend/src/platform/components/grid/ts/expose-api/ExposeApiManager.ts
  20. 13
      io.sc.platform.core.frontend/src/platform/components/grid/ts/expose-api/src/ResetProperty.ts
  21. 4
      io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts
  22. 140
      io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts
  23. 13
      io.sc.platform.core.frontend/src/platform/components/grid/ts/types/table/UrlType.ts
  24. 13
      io.sc.platform.core.frontend/src/platform/components/radio/WExtRadio.vue
  25. 1
      io.sc.platform.core.frontend/src/platform/i18n/messages.json
  26. 1
      io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json
  27. 1
      io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json
  28. 25
      io.sc.platform.core.frontend/src/platform/layout/sub-layout/AsyncTaskDialog.vue
  29. 92
      io.sc.platform.core.frontend/src/views/testcase/excel/Excel copy.vue
  30. 109
      io.sc.platform.core.frontend/src/views/testcase/excel/Excel.vue
  31. 1
      io.sc.platform.core.frontend/src/views/testcase/form/form.vue
  32. 4
      io.sc.platform.core.frontend/template-project/package.json
  33. 2
      io.sc.platform.core.frontend/template-project/public/configure.js
  34. 92
      io.sc.platform.core.frontend/template-project/src/views/testcase/excel/Excel copy.vue
  35. 109
      io.sc.platform.core.frontend/template-project/src/views/testcase/excel/Excel.vue
  36. 1
      io.sc.platform.core.frontend/template-project/src/views/testcase/form/form.vue
  37. 24
      io.sc.platform.core/src/main/java/io/sc/platform/core/autoconfigure/AsyncExecutorAutoConfiguration.java
  38. 18
      io.sc.platform.core/src/main/resources/META-INF/platform/plugins/application-properties.json
  39. 4
      io.sc.platform.developer.doc/package.json
  40. 5
      io.sc.platform.developer.frontend/package.json
  41. 2
      io.sc.platform.developer.frontend/public/configure.js
  42. 5
      io.sc.platform.lcdp.frontend/package.json
  43. 2
      io.sc.platform.lcdp.frontend/public/configure.js
  44. 5
      io.sc.platform.license.keygen.frontend/package.json
  45. 2
      io.sc.platform.license.keygen.frontend/public/configure.js
  46. 5
      io.sc.platform.mvc.frontend/package.json
  47. 2
      io.sc.platform.mvc.frontend/public/configure.js
  48. 5
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java
  49. 125
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java
  50. 77
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/support/ExportExcelThread.java
  51. 12
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/ExportTask.java
  52. 133
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/ExportTaskBuilder.java
  53. 119
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/TaskBuilder.java
  54. 4
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/exception/AsyncTaskAllreadyExistsException.java
  55. 4
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/exception/JxlsTemplateNotFoundException.java
  56. 8
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/service/TaskService.java
  57. 42
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/service/impl/TaskServiceImpl.java
  58. 93
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/thread/ExportTaskThread.java
  59. 147
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/thread/TaskThread.java
  60. 3
      io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task.properties
  61. 3
      io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task_tw_CN.properties
  62. 3
      io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task_zh_CN.properties
  63. 2
      io.sc.platform.poi/build.gradle
  64. 19
      io.sc.platform.poi/src/test/java/WordTest.java
  65. 5
      io.sc.platform.scheduler.manager.frontend/package.json
  66. 2
      io.sc.platform.scheduler.manager.frontend/public/configure.js
  67. 5
      io.sc.platform.system.frontend/package.json
  68. 2
      io.sc.platform.system.frontend/public/configure.js
  69. 10
      io.sc.platform.system/src/main/java/io/sc/platform/system/initializer/ParameterInitializer.java
  70. 5
      io.sc.platform.system/src/main/java/io/sc/platform/system/task/controller/TaskWebController.java
  71. 2
      io.sc.platform.system/src/main/java/io/sc/platform/system/task/service/TaskService.java
  72. 10
      io.sc.platform.system/src/main/java/io/sc/platform/system/task/service/impl/TaskServiceImpl.java
  73. 5
      io.sc.standard.frontend/package.json
  74. 2
      io.sc.standard.frontend/public/configure.js
  75. 4
      io.sc.website/package.json
  76. 5
      wra.report.frontend/package.json
  77. 2
      wra.report.frontend/public/configure.js

5
cips.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "cips.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
cips.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
erm.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "erm.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
erm.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
gradle.properties

@ -37,9 +37,9 @@ application_version=1.0.0
# platform
###########################################################
platform_group=io.sc
platform_version=8.2.33
platform_version=8.2.34
platform_plugin_version=8.2.10
platform_core_frontend_version=8.2.126
platform_core_frontend_version=8.2.127
###########################################################
# dependencies version
@ -85,6 +85,7 @@ oshi_version=6.6.1
p6spy_version=3.9.1
pinyin4j_version=2.5.1
poi_version=5.2.5
poi_tl_version=1.12.2
reflections_version=0.10.2
schemacrawler_version=16.21.4
shadow_gradle_plugin_version=8.3.1

5
io.sc.engine.mv.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.engine.mv.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.engine.mv.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.engine.rule.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.engine.rule.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.engine.rule.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.engine.st.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.engine.st.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.engine.st.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.ai.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.ai.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.ai.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

151
io.sc.platform.core.frontend/package copy.json

@ -0,0 +1,151 @@
{
"name": "platform-core",
"version": "8.2.126",
"description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件",
"main": "dist/platform-core.js",
"//files": "打包时需要包含的文件列表",
"files": [
".bin",
"dist/configure.js",
"dist/css",
"dist/favicon.svg",
"dist/fonts",
"dist/index.html",
"dist/login-bg.jpg",
"dist/logo.svg",
"dist/platform-core.js",
"dist/types",
"template-project/*.*",
"template-project/public",
"template-project/src"
],
"//types": "类型申明主文件",
"types": "./dist/types/index.d.ts",
"private": false,
"keywords": [],
"author": "",
"license": "ISC",
"//bin": "可直接通过 npx 执行的命令",
"bin": {
"//platform": "npx platform",
"platform": "./.bin/platform.js"
},
"scripts": {
"dev": "nodemon",
"serve": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack serve --config webpack.env.serve.cjs",
"build": "node ./util-components-generator.cjs && cross-env NODE_ENV=development webpack --config webpack.env.build.cjs",
"prod": "node ./util-components-generator.cjs && cross-env NODE_ENV=production webpack --config webpack.env.prod.cjs",
"lib": "node ./util.template-generator.cjs && cross-env NODE_ENV=production webpack --config webpack.env.lib.cjs && tsc --project tsconfig.json --emitDeclarationOnly --noEmit false",
"check": "tsc --project tsconfig.json --emitDeclarationOnly --noEmit false",
"template": "node ./util.template-generator.cjs",
"clean": "platform clean dist ./node_modules ./pnpm-lock.yaml ./package-lock.json",
"sync": "platform sync"
},
"engines": {
"node": ">=18",
"pnpm": ">=7"
},
"publishConfig": {
"registry": "http://nexus.sc.io:8000/repository/npm-releases/",
"access": "public",
"no-git-checks": true
},
"devDependencies": {
"@babel/core": "7.26.0",
"@babel/plugin-transform-class-properties": "7.25.9",
"@babel/plugin-transform-object-rest-spread": "7.25.9",
"@babel/preset-env": "7.26.0",
"@babel/preset-typescript": "7.26.0",
"@quasar/app-webpack": "4.0.7",
"@quasar/cli": "2.4.1",
"@types/mockjs": "1.0.10",
"@types/node": "22.10.7",
"@typescript-eslint/eslint-plugin": "8.20.0",
"@typescript-eslint/parser": "8.20.0",
"@vue/babel-plugin-jsx": "1.2.5",
"@vue/compiler-sfc": "3.5.13",
"@vuepress/bundler-webpack": "2.0.0-rc.15",
"@vuepress/theme-default": "2.0.0-rc.49",
"@webpack-cli/serve": "3.0.1",
"autoprefixer": "10.4.20",
"babel-loader": "9.2.1",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "12.0.2",
"cross-env": "7.0.3",
"css-loader": "7.1.2",
"eslint": "9.18.0",
"eslint-config-prettier": "10.0.1",
"eslint-plugin-prettier": "5.2.2",
"eslint-plugin-vue": "9.32.0",
"eslint-webpack-plugin": "4.2.0",
"html-webpack-plugin": "5.6.3",
"json5": "2.2.3",
"mini-css-extract-plugin": "2.9.2",
"nodemon": "3.1.9",
"postcss": "8.5.1",
"postcss-import": "16.1.0",
"postcss-loader": "8.1.1",
"postcss-preset-env": "10.1.3",
"prettier": "3.4.2",
"sass": "1.83.4",
"sass-loader": "16.0.4",
"tailwindcss": "3.4.17",
"typescript": "5.5.4",
"vue-loader": "17.4.2",
"vuepress": "2.0.0-rc.15",
"webpack": "5.97.1",
"webpack-bundle-analyzer": "4.10.2",
"webpack-cli": "6.0.1",
"webpack-dev-server": "5.2.0",
"webpack-merge": "6.0.1"
},
"dependencies": {
"@codemirror/autocomplete": "6.18.6",
"@codemirror/commands": "6.8.1",
"@codemirror/lang-html": "6.4.9",
"@codemirror/lang-java": "6.0.1",
"@codemirror/lang-javascript": "6.2.3",
"@codemirror/lang-json": "6.0.1",
"@codemirror/lang-sql": "6.8.0",
"@codemirror/lang-xml": "6.1.0",
"@codemirror/language": "6.11.0",
"@codemirror/search": "6.5.10",
"@codemirror/state": "6.5.2",
"@codemirror/view": "6.36.5",
"@maxgraph/core": "0.14.0",
"@quasar/extras": "1.16.15",
"@quasar/quasar-ui-qmarkdown": "2.0.5",
"@univerjs/core": "0.5.4",
"@univerjs/design": "0.5.4",
"@univerjs/docs": "0.5.4",
"@univerjs/docs-ui": "0.5.4",
"@univerjs/engine-formula": "0.5.4",
"@univerjs/engine-render": "0.5.4",
"@univerjs/facade": "0.5.4",
"@univerjs/sheets": "0.5.4",
"@univerjs/sheets-formula": "0.5.4",
"@univerjs/sheets-ui": "0.5.4",
"@univerjs/thread-comment": "0.5.4",
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
"exceljs": "4.4.0",
"file-saver": "2.0.5",
"luckyexcel": "1.0.1",
"mockjs": "1.1.0",
"pinia": "2.3.0",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",
"vue": "3.5.13",
"vue-dompurify-html": "5.2.0",
"vue-i18n": "11.0.1",
"vue-router": "4.5.0",
"xml-formatter": "3.6.3",
"node-sql-parser": "5.3.6"
}
}

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.2.126",
"version": "8.2.127",
"description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件",
"main": "dist/platform-core.js",

2
io.sc.platform.core.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

1
io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

@ -143,6 +143,7 @@ watchEffect(() => {
tools.table.url.addDataUrl = props.addDataUrl;
tools.table.url.editDataUrl = props.editDataUrl;
tools.table.url.removeDataUrl = props.removeDataUrl;
tools.table.url.exportDataUrl = props.exportDataUrl;
let flag = false;
if (props.dense !== undefined) {

1
io.sc.platform.core.frontend/src/platform/components/grid/ts/GridTools.ts

@ -138,6 +138,7 @@ export class GridTools {
addDataUrl: props.addDataUrl,
editDataUrl: props.editDataUrl,
removeDataUrl: props.removeDataUrl,
exportDataUrl: props.exportDataUrl,
},
configStore: {
showConfigPanel: false,

1
io.sc.platform.core.frontend/src/platform/components/grid/ts/expose-api/ExposeApiManager.ts

@ -94,6 +94,7 @@ export class ExposeApiManager {
setAddDataUrl: tools.apiFM.resetProperty.setAddDataUrl,
setEditDataUrl: tools.apiFM.resetProperty.setEditDataUrl,
setRemoveDataUrl: tools.apiFM.resetProperty.setRemoveDataUrl,
setExportDataUrl: tools.apiFM.resetProperty.setExportDataUrl,
// 内置按钮api
query: tools.apiFM.button.query,

13
io.sc.platform.core.frontend/src/platform/components/grid/ts/expose-api/src/ResetProperty.ts

@ -14,6 +14,7 @@ export class ResetProperty extends Base {
this.setAddDataUrl = this.setAddDataUrl.bind(this);
this.setEditDataUrl = this.setEditDataUrl.bind(this);
this.setRemoveDataUrl = this.setRemoveDataUrl.bind(this);
this.setExportDataUrl = this.setExportDataUrl.bind(this);
this.setQueryCriteriaFieldValueHandler = this.setQueryCriteriaFieldValueHandler.bind(this);
}
@ -102,6 +103,18 @@ export class ResetProperty extends Base {
this.table.url.removeDataUrl = url;
}
/**
* url
* @param url
* @returns
*/
setExportDataUrl(url: string) {
if (!this.table) {
return;
}
this.table.url.exportDataUrl = url;
}
private setQueryCriteriaFieldValueHandler(criteria: any, fieldName: string, fieldValue: any) {
if (criteria.criteria && criteria.criteria.length > 0) {
criteria.criteria.forEach((item) => {

4
io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts

@ -14,8 +14,8 @@ export class Export extends Button {
}
async click(args) {
const reqParams: any = { pageable: false };
const urlSearchParams = this.tools?.criteriaFM.buildURLSearchParams(reqParams);
console.log(this.table?.url.exportDataUrl);
const urlSearchParams = this.tools?.apiFM.getData.getURLSearchParams(false); //导出不分页
let url = this.table?.url.exportDataUrl || this.table.url.dataUrl + '/exportExcel';
if (!Tools.isEmpty(this.tools?.props.title)) {
url = url + '?downloadFileName=' + encodeURIComponent(this.tools?.props.title);

140
io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts

@ -1,267 +1,271 @@
export type PropsType = {
refreshAfterActive: Boolean,// 当组件被激活时自动刷新一次
refreshAfterActive: Boolean; // 当组件被激活时自动刷新一次
/**
*
*/
height: number,
height: number;
/**
*
*/
title: string,
title: string;
/**
*
*/
autoFetchData: boolean,
autoFetchData: boolean;
/**
* autoFetchData url
*/
localMode: boolean,
localMode: boolean;
/**
*
*/
selectMode: string,
selectMode: string;
/**
* `local``server`
*/
dndMode?: undefined | string,
dndMode?: undefined | string;
/**
* `order`
*/
dndOrderBy: string,
dndOrderBy: string;
/**
*
*/
pageable: boolean,
pageable: boolean;
/**
*
*/
configButton: boolean,
configButton: boolean;
/**
* URL前缀
*/
dataUrl: string,
dataUrl: string;
/**
* URL
*/
fetchDataUrl: string,
fetchDataUrl: string;
/**
* url
*/
addDataUrl: string,
addDataUrl: string;
/**
* url
*/
editDataUrl: string,
editDataUrl: string;
/**
* url
*/
removeDataUrl: string,
removeDataUrl: string;
/**
* url
*/
exportDataUrl: string;
/**
* GETPOST使使
*/
customFetch?: Function | undefined,
customFetch?: Function | undefined;
/**
*
*/
dense?: undefined | boolean,
dense?: undefined | boolean;
/**
*
*/
denseHeader?: undefined | boolean,
denseHeader?: undefined | boolean;
/**
*
*/
denseBody?: undefined | boolean,
denseBody?: undefined | boolean;
/**
*
*/
denseBottom?: undefined | boolean,
denseBottom?: undefined | boolean;
/**
* toolbar按钮栏紧凑模式
*/
denseToolbar?: undefined | boolean,
denseToolbar?: undefined | boolean;
/**
*
*/
sortNo: boolean,
sortNo: boolean;
/**
* 1-10
*/
stickyNum: number,
stickyNum: number;
/**
* 使rgb颜色
*/
stripe: boolean | string,
stripe: boolean | string;
/**
* checkbox选择模式
*/
checkboxSelection: boolean,
checkboxSelection: boolean;
/**
* checkbox勾选状态的字段名
*/
tickedField: string,
tickedField: string;
/**
*
*/
selectedField: string,
selectedField: string;
/**
*
*/
tree: boolean,
tree: boolean;
/**
* ,
*/
treeLazyLoad: boolean,
treeLazyLoad: boolean;
/**
*
*/
treeIcon?: Function | undefined,
treeIcon?: Function | undefined;
/**
*
*/
treeDefaultExpandAll: boolean,
treeDefaultExpandAll: boolean;
/**
* strictleaf
*/
treeTickStrategy: string,
treeTickStrategy: string;
/**
* parent, childrenparent时组件根据数据主键与数据外键构建树形数据children属性中
*/
treeRelationship: string,
treeRelationship: string;
/**
* API入参RestCrudController的update所需的入参
*/
primaryKey: string,
primaryKey: string;
/**
*
*/
foreignKey: string,
foreignKey: string;
/**
* primaryKey集合
*/
refreshData?: boolean,
refreshData?: boolean;
/**
* nameclickexpand()none()
*/
dbClickOperation: string,
dbClickOperation: string;
/**
* 线horizontalverticalcellnone
*/
separator: string,
separator: string;
/**
*
*/
hideHeader?: boolean,
hideHeader?: boolean;
/**
*
*/
hideBottom?: boolean,
hideBottom?: boolean;
/**
* alonemerge
*/
groupMode?: undefined | string,
groupMode?: undefined | string;
/**
* alone分组模式下默认展开的组allfirstnone
*/
groupStartOpen?: string | Array<any> | Function,
groupStartOpen?: string | Array<any> | Function;
/**
* alone
*/
groupByField: string | Array<any>,
groupByField: string | Array<any>;
/**
* alone `format` 使format进行内容显示处理
*/
groupByTitle?: string | Function,
groupByTitle?: string | Function;
/**
*
*/
appendRows: Array<any>,
appendRows: Array<any>;
/**
* ['userName', '-lastModifyDate']-
*/
sortBy: Array<any>,
sortBy: Array<any>;
/**
* columnNamedata
*/
tickedRecord: any,
tickedRecord: any;
/**
*
*/
advancedQuery: boolean,
advancedQuery: boolean;
/**
*
*/
queryCriteria: any,
queryCriteria: any;
/**
*
*/
columns: Array<any>,
columns: Array<any>;
/**
*
*/
queryFormFields: Array<any>,
queryFormFields: Array<any>;
/**
*
*/
queryFormColsNum: any,
queryFormColsNum: any;
/**
*
*/
queryFormRowsNum: number,
queryFormRowsNum: number;
/**
* form
*/
queryFormAttrs: any,
queryFormAttrs: any;
/**
* toolbar
*/
toolbarActions: Array<any>,
toolbarActions: Array<any>;
/**
* toolbar
*/
toolbarConfigure: any,
toolbarConfigure: any;
/**
*
*/
selectableIf?: Function,
selectableIf?: Function;
/**
*
*/
treeTickableIf?: Function,
treeTickableIf?: Function;
/**
*
*/
pagination: any,
pagination: any;
/**
*
*/
editor?: any,
editor?: any;
/**
*
*/
viewer?: any,
viewer?: any;
/**
* form中的组件使用时控制表格是否显示
*/
showIf?: boolean | Function,
showIf?: boolean | Function;
/**
* form中的组件使用时配置表单form实例
*/
form?: any,
form?: any;
/**
*
*/
onRowClick?: Function,
onRowClick?: Function;
/**
*
*/
onRowDbClick?: Function,
onRowDbClick?: Function;
/**
*
*/
onUpdateTicked?: Function,
onUpdateTicked?: Function;
/**
*
*/
onAfterDragAndDrop?: Function,
}
onAfterDragAndDrop?: Function;
};

13
io.sc.platform.core.frontend/src/platform/components/grid/ts/types/table/UrlType.ts

@ -1,7 +1,8 @@
export type UrlType = {
dataUrl: string,
fetchDataUrl: string,
addDataUrl: string,
editDataUrl: string,
removeDataUrl: string,
}
dataUrl: string;
fetchDataUrl: string;
addDataUrl: string;
editDataUrl: string;
removeDataUrl: string;
exportDataUrl: string;
};

13
io.sc.platform.core.frontend/src/platform/components/radio/WExtRadio.vue

@ -6,14 +6,7 @@
<FormElementSlot v-else slot-name="addtion" :slot-content="props['slot']['addtion']"></FormElementSlot>
</template>
<template v-if="props.hideOptions" #after>
<q-btn
flat
round
color="primary"
:icon="expandOptionsModelValue ? 'remove' : 'add'"
size="xs"
@click="expandOptions"
/>
<q-btn flat round color="primary" :icon="expandOptionsModelValue ? 'remove' : 'add'" size="xs" @click="expandOptions" />
</template>
</w-label>
<div class="w-ext-radios">
@ -66,7 +59,7 @@ interface FieldProps extends FormFieldProps {
selectedLabelColor?: string;
hideOptions?: boolean; //
lightNotHideOptionsLabel?: boolean; // label
onExpand?: (args: any) => void;//
onExpand?: (args: any) => void; //
}
const props = withDefaults(defineProps<FieldProps>(), {
showIf: true,
@ -127,7 +120,7 @@ const expandOptions = () => {
form: props['form'],
});
}
}
};
const lightLabelComputed = computed(() => {
if (props.lightNotHideOptionsLabel && !props.hideOptions) {

1
io.sc.platform.core.frontend/src/platform/i18n/messages.json

@ -19,6 +19,7 @@
"confirm": "Confirm",
"expandSiderMenu": "Expand Sider Menu",
"asyncTasks": "Async Tasks",
"cancelAsyncTasksTip": "Are you sure to cancel the task list?",
"cleanAsyncTasksTip": "Are you sure to clean the task list?",
"removeAsyncTaskTip": "Are you sure to remove the task?",
"fullScreen": "Full Screen",

1
io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json

@ -19,6 +19,7 @@
"confirm": "確定",
"expandSiderMenu": "展開邊欄菜單",
"asyncTasks": "異步任務",
"cancelAsyncTasksTip": "您確定要取消該異步任務?",
"cleanAsyncTasksTip": "您確定要清空異步任務列表?",
"removeAsyncTaskTip": "您確定要刪除該異步任務?",
"fullScreen": "全屏",

1
io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json

@ -19,6 +19,7 @@
"confirm": "确定",
"expandSiderMenu": "展开边栏菜单",
"asyncTasks": "异步任务",
"cancelAsyncTasksTip": "您确定要取消该异步任务?",
"cleanAsyncTasksTip": "您确定要清空异步任务列表?",
"removeAsyncTaskTip": "您确定要删除该异步任务?",
"fullScreen": "全屏",

25
io.sc.platform.core.frontend/src/platform/layout/sub-layout/AsyncTaskDialog.vue

@ -14,14 +14,14 @@
<q-card-section v-for="task in tasksRef" :key="task.id" class="row items-center no-wrap" style="padding: 4px 10px 4px 10px">
<q-icon v-if="task.status === 'COMPLETED'" name="check_circle_outline" size="26px" color="green" class="cursor-pointer">
<q-tooltip :delay="1000">{{ $t('io.sc.platform.system.enums.TaskStatus.COMPLETED') }}</q-tooltip>
<q-tooltip :delay="1000">{{ $t('io.sc.platform.orm.task.TaskStatus.COMPLETED') }}</q-tooltip>
</q-icon>
<q-icon v-if="task.status === 'CANCELED'" name="pause_circle_outline" size="26px" color="orange" class="cursor-pointer">
<q-tooltip :delay="1000">{{ $t('io.sc.platform.system.enums.TaskStatus.CANCELED') }}</q-tooltip>
<q-tooltip :delay="1000">{{ $t('io.sc.platform.orm.task.TaskStatus.CANCELED') }}</q-tooltip>
</q-icon>
<q-icon v-if="task.status === 'ERROR'" name="error_outline" size="26px" color="red" class="cursor-pointer">
<q-tooltip :delay="1000">
{{ $t('io.sc.platform.system.enums.TaskStatus.ERROR') + '!' }} <br />
{{ $t('io.sc.platform.orm.task.TaskStatus.ERROR') + '!' }} <br />
{{ task.exception ? $t('task.exception') : task.exceptionMessage }} <br />
</q-tooltip>
</q-icon>
@ -39,9 +39,11 @@
<q-tooltip :delay="1000">{{ $t('running') + ' : ' + (100 * task.currentWeight) / task.totalWeight + ' %' }}</q-tooltip>
</div>
<div class="pl-2">
<a v-if="task.status === 'COMPLETED'" href="javascript:void(0);" class="text-primary underline" @click="handle(task)">
<div class="truncate" style="width: 350px; max-width: 350px">{{ task.name }}</div>
</a>
<div class="truncate" style="width: 350px; max-width: 350px">
<a v-if="task.status === 'COMPLETED'" href="javascript:void(0);" class="text-primary underline" @click="handle(task)">
{{ task.name }}
</a>
</div>
<div v-if="task.status !== 'COMPLETED'" class="truncate" style="width: 350px; max-width: 350px">{{ task.name }}</div>
<div v-if="task.status === 'STARTED'" class="truncate" style="width: 350px; max-width: 350px; font-size: 0.8em">{{ task.message }}</div>
<div v-if="task.status === 'ERROR'" class="truncate text-red-500" style="width: 350px; max-width: 350px; font-size: 0.8em">
@ -55,7 +57,7 @@
<q-tooltip :delay="1000">{{ task.createDate }}</q-tooltip>
</div>
<q-btn v-if="task.status === 'STARTED'" flat round icon="pause" color="primary" size="sm">
<q-btn v-if="task.status === 'STARTED'" flat round icon="pause" color="primary" size="sm" @click="cancel(task)">
<q-tooltip :delay="1000">{{ $t('cancel') }}</q-tooltip>
</q-btn>
@ -93,6 +95,14 @@ const onHide = () => {
removeInterval();
};
const cancel = (task) => {
DialogManager.confirm($t('cancelAsyncTasksTip'), () => {
axios.post(Environment.apiContextPath('/api/system/task/cancelAsyncTask/' + task.id)).then((response) => {
refresh();
});
});
};
const clean = () => {
DialogManager.confirm($t('cleanAsyncTasksTip'), () => {
axios.post(Environment.apiContextPath('/api/system/task/cleanMyAsyncTaskList')).then((response) => {
@ -110,7 +120,6 @@ const remove = (task) => {
};
const refresh = () => {
console.log('refresh');
axios.get(Environment.apiContextPath('/api/system/task?page=1&size=10&pageable=true&sortBy=-createDate')).then((response) => {
tasksRef.value = response.data.content;
});

92
io.sc.platform.core.frontend/src/views/testcase/excel/Excel copy.vue

@ -0,0 +1,92 @@
<template>
<div ref="divRef" class="border border-gray-200" style="height: 100%"></div>
</template>
<script setup lang="ts">
// import '@univerjs/design/lib/index.css';
// import '@univerjs/ui/lib/index.css';
// import '@univerjs/docs-ui/lib/index.css';
// import '@univerjs/sheets-ui/lib/index.css';
// import '@univerjs/sheets-formula/lib/index.css';
import { ref, onMounted } from 'vue';
import { eventBus } from '@/platform';
import { LocaleType, Tools, Univer, UniverInstanceType } from '@univerjs/core';
import { defaultTheme } from '@univerjs/design';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { UniverRenderEnginePlugin } from '@univerjs/engine-render';
import { UniverUIPlugin } from '@univerjs/ui';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsUIPlugin } from '@univerjs/docs-ui';
import { UniverSheetsPlugin } from '@univerjs/sheets';
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';
import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui';
import Design_en_US from '@univerjs/design/locale/en-US';
import UI_en_US from '@univerjs/ui/locale/en-US';
import DocsUI_en_US from '@univerjs/docs-ui/locale/en-US';
import Sheets_en_US from '@univerjs/sheets/locale/en-US';
import SheetsUI_en_US from '@univerjs/sheets-ui/locale/en-US';
import SheetsFormula_en_US from '@univerjs/sheets-formula/locale/en-US';
import Design_zh_CN from '@univerjs/design/locale/zh-CN';
import UI_zh_CN from '@univerjs/ui/locale/zh-CN';
import DocsUI_zh_CN from '@univerjs/docs-ui/locale/zh-CN';
import Sheets_zh_CN from '@univerjs/sheets/locale/zh-CN';
import SheetsUI_zh_CN from '@univerjs/sheets-ui/locale/zh-CN';
import SheetsFormula_zh_CN from '@univerjs/sheets-formula/locale/zh-CN';
import Design_zh_TW from '@univerjs/design/locale/zh-TW';
import UI_zh_TW from '@univerjs/ui/locale/zh-TW';
import DocsUI_zh_TW from '@univerjs/docs-ui/locale/zh-TW';
import Sheets_zh_TW from '@univerjs/sheets/locale/zh-TW';
import SheetsUI_zh_TW from '@univerjs/sheets-ui/locale/zh-TW';
import SheetsFormula_zh_TW from '@univerjs/sheets-formula/locale/zh-TW';
const divRef = ref();
onMounted(() => {
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(Sheets_en_US, DocsUI_en_US, SheetsUI_en_US, SheetsFormula_en_US, UI_en_US, Design_en_US),
[LocaleType.ZH_CN]: Tools.deepMerge(Sheets_zh_CN, DocsUI_zh_CN, SheetsUI_zh_CN, SheetsFormula_zh_CN, UI_zh_CN, Design_zh_CN),
[LocaleType.ZH_TW]: Tools.deepMerge(Sheets_zh_TW, DocsUI_zh_TW, SheetsUI_zh_TW, SheetsFormula_zh_TW, UI_zh_TW, Design_zh_TW),
},
});
/**
* 语言改变事件
*/
eventBus.on('onLocaleChanged', (locale) => {
if (locale === 'en') {
univer.setLocale(LocaleType.EN_US);
} else if (locale === 'zh_CN') {
univer.setLocale(LocaleType.ZH_CN);
} else if (locale === 'tw_CN') {
univer.setLocale(LocaleType.ZH_TW);
}
});
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverFormulaEnginePlugin);
univer.registerPlugin(UniverUIPlugin, {
container: divRef.value,
});
univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverSheetsPlugin);
univer.registerPlugin(UniverSheetsUIPlugin);
univer.registerPlugin(UniverSheetsFormulaPlugin);
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {});
});
</script>

109
io.sc.platform.core.frontend/src/views/testcase/excel/Excel.vue

@ -2,91 +2,30 @@
<div ref="divRef" class="border border-gray-200" style="height: 100%"></div>
</template>
<script setup lang="ts">
// import '@univerjs/design/lib/index.css';
// import '@univerjs/ui/lib/index.css';
// import '@univerjs/docs-ui/lib/index.css';
// import '@univerjs/sheets-ui/lib/index.css';
// import '@univerjs/sheets-formula/lib/index.css';
import { ref, onMounted } from 'vue';
import { eventBus } from '@/platform';
import { LocaleType, Tools, Univer, UniverInstanceType } from '@univerjs/core';
import { defaultTheme } from '@univerjs/design';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { UniverRenderEnginePlugin } from '@univerjs/engine-render';
import { UniverUIPlugin } from '@univerjs/ui';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsUIPlugin } from '@univerjs/docs-ui';
import { UniverSheetsPlugin } from '@univerjs/sheets';
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';
import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui';
import Design_en_US from '@univerjs/design/locale/en-US';
import UI_en_US from '@univerjs/ui/locale/en-US';
import DocsUI_en_US from '@univerjs/docs-ui/locale/en-US';
import Sheets_en_US from '@univerjs/sheets/locale/en-US';
import SheetsUI_en_US from '@univerjs/sheets-ui/locale/en-US';
import SheetsFormula_en_US from '@univerjs/sheets-formula/locale/en-US';
import Design_zh_CN from '@univerjs/design/locale/zh-CN';
import UI_zh_CN from '@univerjs/ui/locale/zh-CN';
import DocsUI_zh_CN from '@univerjs/docs-ui/locale/zh-CN';
import Sheets_zh_CN from '@univerjs/sheets/locale/zh-CN';
import SheetsUI_zh_CN from '@univerjs/sheets-ui/locale/zh-CN';
import SheetsFormula_zh_CN from '@univerjs/sheets-formula/locale/zh-CN';
import Design_zh_TW from '@univerjs/design/locale/zh-TW';
import UI_zh_TW from '@univerjs/ui/locale/zh-TW';
import DocsUI_zh_TW from '@univerjs/docs-ui/locale/zh-TW';
import Sheets_zh_TW from '@univerjs/sheets/locale/zh-TW';
import SheetsUI_zh_TW from '@univerjs/sheets-ui/locale/zh-TW';
import SheetsFormula_zh_TW from '@univerjs/sheets-formula/locale/zh-TW';
const divRef = ref();
onMounted(() => {
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(Sheets_en_US, DocsUI_en_US, SheetsUI_en_US, SheetsFormula_en_US, UI_en_US, Design_en_US),
[LocaleType.ZH_CN]: Tools.deepMerge(Sheets_zh_CN, DocsUI_zh_CN, SheetsUI_zh_CN, SheetsFormula_zh_CN, UI_zh_CN, Design_zh_CN),
[LocaleType.ZH_TW]: Tools.deepMerge(Sheets_zh_TW, DocsUI_zh_TW, SheetsUI_zh_TW, SheetsFormula_zh_TW, UI_zh_TW, Design_zh_TW),
},
});
/**
* 语言改变事件
*/
eventBus.on('onLocaleChanged', (locale) => {
if (locale === 'en') {
univer.setLocale(LocaleType.EN_US);
} else if (locale === 'zh_CN') {
univer.setLocale(LocaleType.ZH_CN);
} else if (locale === 'tw_CN') {
univer.setLocale(LocaleType.ZH_TW);
}
});
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverFormulaEnginePlugin);
univer.registerPlugin(UniverUIPlugin, {
container: divRef.value,
});
univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverSheetsPlugin);
univer.registerPlugin(UniverSheetsUIPlugin);
univer.registerPlugin(UniverSheetsFormulaPlugin);
import { axios, Environment } from '@/platform';
/*
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';
import UniverPresetSheetsCoreZhCN from '@univerjs/preset-sheets-core/locales/zh-CN';
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets';
import '@univerjs/preset-sheets-core/lib/index.css';
const { univer, univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.ZH_CN]: mergeLocales(UniverPresetSheetsCoreZhCN),
},
presets: [
UniverSheetsCorePreset({
container: 'app',
}),
],
});
univerAPI.createWorkbook({});
*/
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {});
console.log(new Date());
axios.get(Environment.apiContextPath('/api/lcdp/configure/test')).then((response) => {
console.log(response);
console.log(new Date());
});
</script>

1
io.sc.platform.core.frontend/src/views/testcase/form/form.vue

@ -77,7 +77,6 @@ import { ref } from 'vue';
import { Environment, SessionManager, axios, Options, Formater, EnumTools } from '@/platform';
import SelectUserGrid from './shared/SelectUserGrid.vue';
import SelectMenuTreeGrid from './shared/SelectMenuTreeGrid.vue';
import { onMounted } from 'vue';
const userGridRef = ref();
</script>

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.2.126",
"version": "8.2.127",
"description": "前端核心包,用于快速构建前端的脚手架",
"private": false,
"keywords": [],
@ -111,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.core.frontend/template-project/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

92
io.sc.platform.core.frontend/template-project/src/views/testcase/excel/Excel copy.vue

@ -0,0 +1,92 @@
<template>
<div ref="divRef" class="border border-gray-200" style="height: 100%"></div>
</template>
<script setup lang="ts">
// import '@univerjs/design/lib/index.css';
// import '@univerjs/ui/lib/index.css';
// import '@univerjs/docs-ui/lib/index.css';
// import '@univerjs/sheets-ui/lib/index.css';
// import '@univerjs/sheets-formula/lib/index.css';
import { ref, onMounted } from 'vue';
import { eventBus } from '@/platform';
import { LocaleType, Tools, Univer, UniverInstanceType } from '@univerjs/core';
import { defaultTheme } from '@univerjs/design';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { UniverRenderEnginePlugin } from '@univerjs/engine-render';
import { UniverUIPlugin } from '@univerjs/ui';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsUIPlugin } from '@univerjs/docs-ui';
import { UniverSheetsPlugin } from '@univerjs/sheets';
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';
import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui';
import Design_en_US from '@univerjs/design/locale/en-US';
import UI_en_US from '@univerjs/ui/locale/en-US';
import DocsUI_en_US from '@univerjs/docs-ui/locale/en-US';
import Sheets_en_US from '@univerjs/sheets/locale/en-US';
import SheetsUI_en_US from '@univerjs/sheets-ui/locale/en-US';
import SheetsFormula_en_US from '@univerjs/sheets-formula/locale/en-US';
import Design_zh_CN from '@univerjs/design/locale/zh-CN';
import UI_zh_CN from '@univerjs/ui/locale/zh-CN';
import DocsUI_zh_CN from '@univerjs/docs-ui/locale/zh-CN';
import Sheets_zh_CN from '@univerjs/sheets/locale/zh-CN';
import SheetsUI_zh_CN from '@univerjs/sheets-ui/locale/zh-CN';
import SheetsFormula_zh_CN from '@univerjs/sheets-formula/locale/zh-CN';
import Design_zh_TW from '@univerjs/design/locale/zh-TW';
import UI_zh_TW from '@univerjs/ui/locale/zh-TW';
import DocsUI_zh_TW from '@univerjs/docs-ui/locale/zh-TW';
import Sheets_zh_TW from '@univerjs/sheets/locale/zh-TW';
import SheetsUI_zh_TW from '@univerjs/sheets-ui/locale/zh-TW';
import SheetsFormula_zh_TW from '@univerjs/sheets-formula/locale/zh-TW';
const divRef = ref();
onMounted(() => {
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(Sheets_en_US, DocsUI_en_US, SheetsUI_en_US, SheetsFormula_en_US, UI_en_US, Design_en_US),
[LocaleType.ZH_CN]: Tools.deepMerge(Sheets_zh_CN, DocsUI_zh_CN, SheetsUI_zh_CN, SheetsFormula_zh_CN, UI_zh_CN, Design_zh_CN),
[LocaleType.ZH_TW]: Tools.deepMerge(Sheets_zh_TW, DocsUI_zh_TW, SheetsUI_zh_TW, SheetsFormula_zh_TW, UI_zh_TW, Design_zh_TW),
},
});
/**
* 语言改变事件
*/
eventBus.on('onLocaleChanged', (locale) => {
if (locale === 'en') {
univer.setLocale(LocaleType.EN_US);
} else if (locale === 'zh_CN') {
univer.setLocale(LocaleType.ZH_CN);
} else if (locale === 'tw_CN') {
univer.setLocale(LocaleType.ZH_TW);
}
});
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverFormulaEnginePlugin);
univer.registerPlugin(UniverUIPlugin, {
container: divRef.value,
});
univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverSheetsPlugin);
univer.registerPlugin(UniverSheetsUIPlugin);
univer.registerPlugin(UniverSheetsFormulaPlugin);
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {});
});
</script>

109
io.sc.platform.core.frontend/template-project/src/views/testcase/excel/Excel.vue

@ -2,91 +2,30 @@
<div ref="divRef" class="border border-gray-200" style="height: 100%"></div>
</template>
<script setup lang="ts">
// import '@univerjs/design/lib/index.css';
// import '@univerjs/ui/lib/index.css';
// import '@univerjs/docs-ui/lib/index.css';
// import '@univerjs/sheets-ui/lib/index.css';
// import '@univerjs/sheets-formula/lib/index.css';
import { ref, onMounted } from 'vue';
import { eventBus } from '@/platform';
import { LocaleType, Tools, Univer, UniverInstanceType } from '@univerjs/core';
import { defaultTheme } from '@univerjs/design';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { UniverRenderEnginePlugin } from '@univerjs/engine-render';
import { UniverUIPlugin } from '@univerjs/ui';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsUIPlugin } from '@univerjs/docs-ui';
import { UniverSheetsPlugin } from '@univerjs/sheets';
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';
import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui';
import Design_en_US from '@univerjs/design/locale/en-US';
import UI_en_US from '@univerjs/ui/locale/en-US';
import DocsUI_en_US from '@univerjs/docs-ui/locale/en-US';
import Sheets_en_US from '@univerjs/sheets/locale/en-US';
import SheetsUI_en_US from '@univerjs/sheets-ui/locale/en-US';
import SheetsFormula_en_US from '@univerjs/sheets-formula/locale/en-US';
import Design_zh_CN from '@univerjs/design/locale/zh-CN';
import UI_zh_CN from '@univerjs/ui/locale/zh-CN';
import DocsUI_zh_CN from '@univerjs/docs-ui/locale/zh-CN';
import Sheets_zh_CN from '@univerjs/sheets/locale/zh-CN';
import SheetsUI_zh_CN from '@univerjs/sheets-ui/locale/zh-CN';
import SheetsFormula_zh_CN from '@univerjs/sheets-formula/locale/zh-CN';
import Design_zh_TW from '@univerjs/design/locale/zh-TW';
import UI_zh_TW from '@univerjs/ui/locale/zh-TW';
import DocsUI_zh_TW from '@univerjs/docs-ui/locale/zh-TW';
import Sheets_zh_TW from '@univerjs/sheets/locale/zh-TW';
import SheetsUI_zh_TW from '@univerjs/sheets-ui/locale/zh-TW';
import SheetsFormula_zh_TW from '@univerjs/sheets-formula/locale/zh-TW';
const divRef = ref();
onMounted(() => {
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(Sheets_en_US, DocsUI_en_US, SheetsUI_en_US, SheetsFormula_en_US, UI_en_US, Design_en_US),
[LocaleType.ZH_CN]: Tools.deepMerge(Sheets_zh_CN, DocsUI_zh_CN, SheetsUI_zh_CN, SheetsFormula_zh_CN, UI_zh_CN, Design_zh_CN),
[LocaleType.ZH_TW]: Tools.deepMerge(Sheets_zh_TW, DocsUI_zh_TW, SheetsUI_zh_TW, SheetsFormula_zh_TW, UI_zh_TW, Design_zh_TW),
},
});
/**
* 语言改变事件
*/
eventBus.on('onLocaleChanged', (locale) => {
if (locale === 'en') {
univer.setLocale(LocaleType.EN_US);
} else if (locale === 'zh_CN') {
univer.setLocale(LocaleType.ZH_CN);
} else if (locale === 'tw_CN') {
univer.setLocale(LocaleType.ZH_TW);
}
});
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverFormulaEnginePlugin);
univer.registerPlugin(UniverUIPlugin, {
container: divRef.value,
});
univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverSheetsPlugin);
univer.registerPlugin(UniverSheetsUIPlugin);
univer.registerPlugin(UniverSheetsFormulaPlugin);
import { axios, Environment } from '@/platform';
/*
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';
import UniverPresetSheetsCoreZhCN from '@univerjs/preset-sheets-core/locales/zh-CN';
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets';
import '@univerjs/preset-sheets-core/lib/index.css';
const { univer, univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.ZH_CN]: mergeLocales(UniverPresetSheetsCoreZhCN),
},
presets: [
UniverSheetsCorePreset({
container: 'app',
}),
],
});
univerAPI.createWorkbook({});
*/
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {});
console.log(new Date());
axios.get(Environment.apiContextPath('/api/lcdp/configure/test')).then((response) => {
console.log(response);
console.log(new Date());
});
</script>

1
io.sc.platform.core.frontend/template-project/src/views/testcase/form/form.vue

@ -77,7 +77,6 @@ import { ref } from 'vue';
import { Environment, SessionManager, axios, Options, Formater, EnumTools } from '@/platform';
import SelectUserGrid from './shared/SelectUserGrid.vue';
import SelectMenuTreeGrid from './shared/SelectMenuTreeGrid.vue';
import { onMounted } from 'vue';
const userGridRef = ref();
</script>

24
io.sc.platform.core/src/main/java/io/sc/platform/core/autoconfigure/AsyncExecutorAutoConfiguration.java

@ -37,18 +37,18 @@ public class AsyncExecutorAutoConfiguration implements AsyncConfigurer {
}
}
@Bean
@ConditionalOnMissingBean
@Override
public Executor getAsyncExecutor() {
executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(Runtime.getRuntime().availableProcessors());
executor.setMaxPoolSize(20);
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setThreadNamePrefix("Platform-AsyncExecutor-");
executor.initialize();
return executor;
}
// @Bean
// @ConditionalOnMissingBean
// @Override
// public Executor getAsyncExecutor() {
// executor = new ThreadPoolTaskExecutor();
// executor.setCorePoolSize(Runtime.getRuntime().availableProcessors());
// executor.setMaxPoolSize(20);
// executor.setWaitForTasksToCompleteOnShutdown(true);
// executor.setThreadNamePrefix("Platform-AsyncExecutor-");
// executor.initialize();
// return executor;
// }
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {

18
io.sc.platform.core/src/main/resources/META-INF/platform/plugins/application-properties.json

@ -66,5 +66,23 @@
"server.error.include-message = always",
"server.error.include-stacktrace = always"
]
},
{
"module" : "io.sc.platform.core",
"order": 400,
"description": "Configuration properties for task execution",
"properties": [
"spring.task.execution.threadNamePrefix = async-task-",
"spring.task.execution.pool.coreSize = 4",
"spring.task.execution.pool.maxSize = 20",
"spring.task.execution.pool.queueCapacity = 10",
"spring.task.execution.pool.allowCoreThreadTimeout = true",
"spring.task.execution.pool.keepAlive = 60s",
"spring.task.execution.shutdown.awaitTermination = false",
"spring.task.execution.shutdown.awaitTerminationPeriod = 10s"
]
}
]

4
io.sc.platform.developer.doc/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.developer.doc",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"main": "index.js",
"scripts": {
@ -28,7 +28,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"vue": "3.5.13",
"vue-i18n": "11.0.1"

5
io.sc.platform.developer.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.developer.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.developer.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.lcdp.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.lcdp.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.lcdp.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.license.keygen.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.license.keygen.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.license.keygen.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.mvc.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.mvc.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.mvc.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java

@ -24,8 +24,6 @@ import java.util.stream.Stream;
public interface DaoService<E,ID extends Serializable,R extends DaoRepository<E,ID>>{
public R getRepository();
public DaoExceptionProvider<E,ID> getExceptionProvider();
public StorageService getStorageService();
public TaskService getTaskService();
public E findById(ID id);
public E findByUniqueKey(E entity);
@ -70,8 +68,5 @@ public interface DaoService<E,ID extends Serializable,R extends DaoRepository<E,
public Stream<E> stream(Specification<E> specification, Sort sort) throws Exception;
public DataExportTemplateConfigure getExportTemplateConfigure();
public byte[] getTemplateBytes(DataExportTemplateConfigure configure) throws IOException;
public Task export(QueryParameter queryParameter, String exportResourceName) throws Exception;
public long getSynchronousExportMaxCount();
}

125
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java

@ -9,27 +9,19 @@ import io.sc.platform.orm.entity.support.JpaEntityPersistentEventType;
import io.sc.platform.orm.repository.DaoRepository;
import io.sc.platform.orm.service.DaoService;
import io.sc.platform.orm.service.DesensitizerAuthorizerService;
import io.sc.platform.orm.service.JxlsTemplateService;
import io.sc.platform.orm.service.support.*;
import io.sc.platform.orm.service.support.criteria.Criteria;
import io.sc.platform.orm.service.support.criteria.impl.Equals;
import io.sc.platform.orm.service.support.criteria.impl.IContains;
import io.sc.platform.orm.service.support.criteria.impl.IsNull;
import io.sc.platform.orm.storage.service.StorageService;
import io.sc.platform.orm.task.ExportTask;
import io.sc.platform.orm.task.Task;
import io.sc.platform.orm.task.TaskExecuteMode;
import io.sc.platform.orm.task.TaskType;
import io.sc.platform.orm.task.service.TaskService;
import io.sc.platform.orm.task.TaskBuilder;
import io.sc.platform.orm.task.thread.ExportTaskThread;
import io.sc.platform.security.util.SecurityUtil;
import io.sc.platform.util.ByteUtil;
import org.jxls.common.Context;
import org.jxls.util.JxlsHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@ -37,14 +29,13 @@ import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.repository.core.EntityInformation;
import org.springframework.data.repository.support.Repositories;
import org.springframework.data.util.DirectFieldAccessFallbackBeanWrapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.Predicate;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;
import java.io.*;
import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.function.Consumer;
@ -57,10 +48,6 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
@Autowired protected Repositories repositories;
@Autowired protected ConversionService conversionService;
@Autowired protected DesensitizerAuthorizerService desensitizerAuthorizerService;
@Autowired protected JxlsTemplateService jxlsTemplateService;
@Autowired protected StorageService storageService;
@Autowired protected TaskService taskService;
@Autowired protected JdbcTemplate jdbcTemplate;
protected DaoExceptionProvider<E,ID> exceptionProvider =getExceptionProvider();
@Override
@ -73,16 +60,6 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
return new DaoExceptionProvider<E, ID>(){};
}
@Override
public StorageService getStorageService() {
return storageService;
}
@Override
public TaskService getTaskService() {
return taskService;
}
@Override
@Transactional
public E findById(ID id) {
@ -662,50 +639,20 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
@Override
public Task export(QueryParameter queryParameter, String exportResourceName) throws Exception {
DataExportTemplateConfigure dataExportTemplateConfigure =this.getExportTemplateConfigure();
if(dataExportTemplateConfigure==null){
return null;
}
String outputPath =DirectoryManager.getInstance().getByName("dir.work.web.export") + "/" + UUID.randomUUID().toString() + ".xlsx";
String exportResourceFileName =exportResourceName + ".xlsx";
ExportTask task =TaskBuilder.EXPORT()
.name(exportResourceName)
.templateConfigure(this.getExportTemplateConfigure())
.outputPath(outputPath)
.exportResourceName(exportResourceName + ".xlsx")
.exportResourceUrl("/api/mvc/download?filePath=" + outputPath + "&exportName=" + exportResourceName + ".xlsx")
.build();
byte[] templateBytes =getTemplateBytes(dataExportTemplateConfigure);
if(templateBytes==null){
return null;
}
ExportTask task =new ExportTask();
task.setName("导出" + exportResourceName);
task.setType(TaskType.EXPORT);
task.setCreateDate(new Date());
task.setOutputPath(DirectoryManager.getInstance().getByName("dir.work.web.export") + "/" + UUID.randomUUID().toString() + ".xlsx");
task.setExportResourceName(exportResourceFileName);
task.setExportResourceUrl("/api/mvc/download?filePath=" + task.getOutputPath() + "&exportName=" + exportResourceFileName);
long count =this.count(queryParameter);
task.setTotalWeight(count);
if(count <= getSynchronousExportMaxCount()){
task.setExecuteMode(TaskExecuteMode.SYNCHRONOUS);
}else{
task.setExecuteMode(TaskExecuteMode.ASYNCHRONOUS);
}
ExportExcelThread thread =new ExportExcelThread(task,this,queryParameter);
if(TaskExecuteMode.SYNCHRONOUS.equals(task.getExecuteMode())){
thread.run();
}else{
thread.startExportTask();
thread.start();
}
return task;
}
@Override
public long getSynchronousExportMaxCount() {
Map<String,Object> row =jdbcTemplate.queryForMap("select VALUE_ from SYS_PARAMETER where CODE_=?","parameter.orm.exportExcel.synchronousExportMaxCount");
if(row==null || row.isEmpty()){
return 1000;
}
return Long.parseLong(row.get("VALUE_").toString());
ExportTaskThread thread =new ExportTaskThread(task);
thread.addContextObject("daoService",this);
thread.addContextObject("queryParameter",queryParameter);
return thread.execute();
}
@Override
@ -832,46 +779,4 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
}
}
}
/**
* 获取导出JXLS模版
* @param configure 模版配置
* @return 模版
* @throws IOException 违例
*/
@Override
public byte[] getTemplateBytes(DataExportTemplateConfigure configure) throws IOException {
if(configure==null){
return null;
}
// 先查找 JXLS 模版中匹配的 code 的模版
String templateCode =configure.getJxlsTemplateCode();
if(StringUtils.hasText(templateCode)) {
JxlsTemplate template =jxlsTemplateService.findTemplateByCode(templateCode);
if(template!=null){
return template.getBytes();
}
}
// 再查找 JXLS 模版中匹配的实体类名的模版
String templateJpaEntityClass =configure.getJxlsTemplateJpaEntityClass();
if(StringUtils.hasText(templateJpaEntityClass)) {
JxlsTemplate template =jxlsTemplateService.findTemplateByJpaEntityClass(templateJpaEntityClass);
if(template!=null){
return template.getBytes();
}
}
// 最后查找预定义的模版类路径
String templateClassPath =configure.getJxlsTemplateClassPath();
if(StringUtils.hasText(templateClassPath)) {
Resource resource = new DefaultResourceLoader().getResource("classpath:/" + templateClassPath);
if (resource != null && resource.exists()) {
try (InputStream inputStream = resource.getInputStream();) {
return ByteUtil.read(inputStream);
}
}
}
return null;
}
}

77
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/support/ExportExcelThread.java

@ -1,77 +0,0 @@
package io.sc.platform.orm.service.support;
import io.sc.platform.orm.service.DaoService;
import io.sc.platform.orm.task.ExportTask;
import io.sc.platform.orm.task.TaskStatus;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jxls.common.Context;
import org.jxls.util.JxlsHelper;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
public class ExportExcelThread extends Thread {
protected ExportTask task;
protected DaoService daoService;
protected QueryParameter queryParameter;
public ExportExcelThread(ExportTask task, DaoService daoService,QueryParameter queryParameter){
this.task =task;
this.daoService =daoService;
this.queryParameter =queryParameter;
}
@Override
public void run() {
try {
//获取模版
byte[] templateBytes = daoService.getTemplateBytes(daoService.getExportTemplateConfigure());
//导出
String outputFilePath = task.getOutputPath();
Context context = new Context();
context.putVar("list", daoService.list(queryParameter));
changeCurrentWeight(task.getTotalWeight()/2);
try (
InputStream inputStream = new ByteArrayInputStream(templateBytes);
FileOutputStream outputStream = new FileOutputStream(outputFilePath);
) {
JxlsHelper.getInstance().setEvaluateFormulas(true).processTemplate(inputStream, outputStream, context);
}
//存储到存储服务中
daoService.getStorageService().add(outputFilePath, outputFilePath);
complete();
} catch (Exception e) {
error(e.getClass().getName(),e.getMessage(), ExceptionUtils.getStackTrace(e));
throw new RuntimeException(e);
}
}
public void startExportTask(){
String id =daoService.getTaskService().create(task);
task.setId(id);
}
public void create(){
daoService.getTaskService().create(task);
}
public void changeStatus(TaskStatus status){
daoService.getTaskService().changeStatus(task.getId(),status);
}
public void changeCurrentWeight(long currentWeight){
daoService.getTaskService().changeCurrentWeight(task.getId(),currentWeight);
}
public void changeMessage(String message){
daoService.getTaskService().changeMessage(task.getId(),message);
}
public void error(String exception,String exceptionMessage,String exceptionStackTrace){
daoService.getTaskService().error(task.getId(),exception,exceptionMessage,exceptionStackTrace);
}
public void complete(){
daoService.getTaskService().complete(task.getId());
}
public boolean isCanceled(){
return daoService.getTaskService().isCanceled(task.getId());
}
}

12
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/ExportTask.java

@ -1,10 +1,22 @@
package io.sc.platform.orm.task;
import io.sc.platform.orm.service.support.DataExportTemplateConfigure;
public class ExportTask extends Task {
protected DataExportTemplateConfigure templateConfigure;
protected String outputPath;
protected String exportResourceName;
protected String exportResourceUrl;
public DataExportTemplateConfigure getTemplateConfigure() {
return templateConfigure;
}
public void setTemplateConfigure(DataExportTemplateConfigure templateConfigure) {
this.templateConfigure = templateConfigure;
}
public String getOutputPath() {
return outputPath;
}

133
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/ExportTaskBuilder.java

@ -0,0 +1,133 @@
package io.sc.platform.orm.task;
import io.sc.platform.orm.service.support.DataExportTemplateConfigure;
import java.util.Date;
public class ExportTaskBuilder extends TaskBuilder{
protected DataExportTemplateConfigure templateConfigure;
protected String outputPath;
protected String exportResourceName;
protected String exportResourceUrl;
public ExportTask build(){
ExportTask task =new ExportTask();
task.setType(TaskType.EXPORT);
task.setName(this.name);
task.setExecuteMode(this.executeMode);
task.setStatus(this.status);
task.setCreator(this.creator);
task.setCreateDate(this.createDate);
task.setCompletedDate(this.completedDate);
task.setCanceledDate(this.canceledDate);
task.setTotalWeight(this.totalWeight);
task.setCurrentWeight(this.currentWeight);
task.setMessage(this.message);
task.setException(this.exception);
task.setExceptionMessage(this.exceptionMessage);
task.setExceptionStackTrace(this.exceptionStackTrace);
task.setOutputPath(this.outputPath);
task.setExportResourceName(this.exportResourceName);
task.setExportResourceUrl(this.exportResourceUrl);
task.setTemplateConfigure(this.templateConfigure);
return task;
}
public ExportTaskBuilder name(String name){
this.name =name;
return this;
}
public ExportTaskBuilder sync(){
this.executeMode =TaskExecuteMode.SYNCHRONOUS;
return this;
}
public ExportTaskBuilder async(){
this.executeMode =TaskExecuteMode.ASYNCHRONOUS;
return this;
}
public ExportTaskBuilder type(TaskType type){
this.type =type;
return this;
}
public ExportTaskBuilder status(TaskStatus status){
this.status =status;
return this;
}
public ExportTaskBuilder creator(String creator){
this.creator =creator;
return this;
}
public ExportTaskBuilder createDate(Date createDate){
this.createDate =createDate;
return this;
}
public ExportTaskBuilder completedDate(Date completedDate){
this.completedDate =completedDate;
return this;
}
public ExportTaskBuilder canceledDate(Date canceledDate){
this.canceledDate =canceledDate;
return this;
}
public ExportTaskBuilder totalWeight(Long totalWeight){
this.totalWeight =totalWeight;
return this;
}
public ExportTaskBuilder currentWeight(Long currentWeight){
this.currentWeight =currentWeight;
return this;
}
public ExportTaskBuilder message(String message){
this.message =message;
return this;
}
public ExportTaskBuilder exception(String exception){
this.exception =exception;
return this;
}
public ExportTaskBuilder exceptionMessage(String exceptionMessage){
this.exceptionMessage =exceptionMessage;
return this;
}
public ExportTaskBuilder exceptionStackTrace(String exceptionStackTrace){
this.exceptionStackTrace =exceptionStackTrace;
return this;
}
public ExportTaskBuilder outputPath(String outputPath){
this.outputPath =outputPath;
return this;
}
public ExportTaskBuilder exportResourceName(String exportResourceName){
this.exportResourceName =exportResourceName;
return this;
}
public ExportTaskBuilder exportResourceUrl(String exportResourceUrl){
this.exportResourceUrl =exportResourceUrl;
return this;
}
public ExportTaskBuilder templateConfigure(DataExportTemplateConfigure templateConfigure){
this.templateConfigure =templateConfigure;
return this;
}
}

119
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/TaskBuilder.java

@ -0,0 +1,119 @@
package io.sc.platform.orm.task;
import java.util.Date;
public class TaskBuilder {
protected String name;
protected TaskExecuteMode executeMode;
protected TaskType type;
protected TaskStatus status;
protected String creator;
protected Date createDate;
protected Date completedDate;
protected Date canceledDate;
protected Long totalWeight;
protected Long currentWeight;
protected String message;
protected String exception;
protected String exceptionMessage;
protected String exceptionStackTrace;
public static ExportTaskBuilder EXPORT(){
return new ExportTaskBuilder();
}
public Task build(){
Task task =new Task();
task.setName(this.name);
task.setExecuteMode(this.executeMode);
task.setType(this.type);
task.setStatus(this.status);
task.setCreator(this.creator);
task.setCreateDate(this.createDate);
task.setCompletedDate(this.completedDate);
task.setCanceledDate(this.canceledDate);
task.setTotalWeight(this.totalWeight);
task.setCurrentWeight(this.currentWeight);
task.setMessage(this.message);
task.setException(this.exception);
task.setExceptionMessage(this.exceptionMessage);
task.setExceptionStackTrace(this.exceptionStackTrace);
return task;
}
public TaskBuilder name(String name){
this.name =name;
return this;
}
public TaskBuilder sync(){
this.executeMode =TaskExecuteMode.SYNCHRONOUS;
return this;
}
public TaskBuilder async(){
this.executeMode =TaskExecuteMode.ASYNCHRONOUS;
return this;
}
public TaskBuilder type(TaskType type){
this.type =type;
return this;
}
public TaskBuilder status(TaskStatus status){
this.status =status;
return this;
}
public TaskBuilder creator(String creator){
this.creator =creator;
return this;
}
public TaskBuilder createDate(Date createDate){
this.createDate =createDate;
return this;
}
public TaskBuilder completedDate(Date completedDate){
this.completedDate =completedDate;
return this;
}
public TaskBuilder canceledDate(Date canceledDate){
this.canceledDate =canceledDate;
return this;
}
public TaskBuilder totalWeight(Long totalWeight){
this.totalWeight =totalWeight;
return this;
}
public TaskBuilder currentWeight(Long currentWeight){
this.currentWeight =currentWeight;
return this;
}
public TaskBuilder message(String message){
this.message =message;
return this;
}
public TaskBuilder exception(String exception){
this.exception =exception;
return this;
}
public TaskBuilder exceptionMessage(String exceptionMessage){
this.exceptionMessage =exceptionMessage;
return this;
}
public TaskBuilder exceptionStackTrace(String exceptionStackTrace){
this.exceptionStackTrace =exceptionStackTrace;
return this;
}
}

4
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/exception/AsyncTaskAllreadyExistsException.java

@ -0,0 +1,4 @@
package io.sc.platform.orm.task.exception;
public class AsyncTaskAllreadyExistsException extends RuntimeException {
}

4
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/exception/JxlsTemplateNotFoundException.java

@ -0,0 +1,4 @@
package io.sc.platform.orm.task.exception;
public class JxlsTemplateNotFoundException extends Exception {
}

8
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/service/TaskService.java

@ -4,10 +4,10 @@ import io.sc.platform.orm.task.Task;
import io.sc.platform.orm.task.TaskStatus;
public interface TaskService {
public String create(Task task);
public void changeStatus(String taskId,TaskStatus status);
public void changeCurrentWeight(String taskId,long currentWeight);
public void changeMessage(String taskId,String message);
public Task create(Task task);
public void setTotalWeight(String taskId,long totalWeight);
public void setCurrentWeight(String taskId,long currentWeight,String message);
public void setMessage(String taskId,String message);
public void error(String taskId,String exception,String exceptionMessage,String exceptionStackTrace);
public void complete(String taskId);
public boolean isCanceled(String taskId);

42
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/service/impl/TaskServiceImpl.java

@ -4,14 +4,17 @@ import io.sc.platform.orm.task.ExportTask;
import io.sc.platform.orm.task.Task;
import io.sc.platform.orm.task.TaskStatus;
import io.sc.platform.orm.task.TaskType;
import io.sc.platform.orm.task.exception.AsyncTaskAllreadyExistsException;
import io.sc.platform.orm.task.service.TaskService;
import io.sc.platform.security.util.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -21,10 +24,19 @@ public class TaskServiceImpl implements TaskService {
@Override
@Transactional
public String create(Task task) {
public Task create(Task task) {
List<Map<String,Object>> list =jdbcTemplate.queryForList("select ID_ from SYS_TASK where CREATOR_=? and NAME_=? and STATUS_='STARTED'",SecurityUtil.getLoginName(),task.getName());
if(list!=null && !list.isEmpty()){
throw new AsyncTaskAllreadyExistsException();
}
String id =UUID.randomUUID().toString();
task.setId(id);
task.setCreateDate(new Date());
String taskSql ="insert into SYS_TASK(ID_,NAME_,TYPE_,EXECUTE_MODE_,STATUS_,CREATOR_,CREATE_DATE_,TOTAL_WEIGHT_,CURRENT_WEIGHT_,MESSAGE_) values(?,?,?,?,?,?,?,?,?,?)";
String exportTaskSql ="insert into SYS_TASK(ID_,NAME_,TYPE_,EXECUTE_MODE_,STATUS_,CREATOR_,CREATE_DATE_,TOTAL_WEIGHT_,CURRENT_WEIGHT_,MESSAGE_,EXPORT_RESOURCE_NAME_,EXPORT_RESOURCE_URL_) values(?,?,?,?,?,?,?,?,?,?,?,?)";
Date now =new Date();
if(TaskType.EXPORT.equals(task.getType())){
ExportTask exportTask =(ExportTask)task;
jdbcTemplate.update(exportTaskSql,
@ -34,9 +46,9 @@ public class TaskServiceImpl implements TaskService {
task.getExecuteMode().name(),
TaskStatus.STARTED.name(),
SecurityUtil.getLoginName(),
new Date(),
task.getTotalWeight(),
task.getCurrentWeight(),
now,
100,
1,
task.getMessage(),
exportTask.getExportResourceName(),
exportTask.getExportResourceUrl()
@ -49,29 +61,35 @@ public class TaskServiceImpl implements TaskService {
task.getExecuteMode().name(),
TaskStatus.STARTED.name(),
SecurityUtil.getLoginName(),
new Date(),task.getTotalWeight(),
task.getCurrentWeight(),
now,
100,
1,
task.getMessage()
);
}
return id;
return task;
}
@Override
@Transactional
public void changeStatus(String taskId, TaskStatus status) {
jdbcTemplate.update("update SYS_TASK set STATUS_=? where ID_=?",status.name(),taskId);
public void setTotalWeight(String taskId, long totalWeight) {
jdbcTemplate.update("update SYS_TASK set TOTAL_WEIGHT_=? where ID_=?",totalWeight,taskId);
}
@Override
@Transactional
public void changeCurrentWeight(String taskId, long currentWeight) {
jdbcTemplate.update("update SYS_TASK set CURRENT_WEIGHT_=? where ID_=?",currentWeight,taskId);
public void setCurrentWeight(String taskId, long currentWeight,String message) {
if(StringUtils.hasText(message)) {
jdbcTemplate.update("update SYS_TASK set CURRENT_WEIGHT_=?, MESSAGE_=? where ID_=?", currentWeight, message,taskId);
}else{
jdbcTemplate.update("update SYS_TASK set CURRENT_WEIGHT_=? where ID_=?", currentWeight, taskId);
}
}
@Override
@Transactional
public void changeMessage(String taskId, String message) {
public void setMessage(String taskId, String message) {
jdbcTemplate.update("update SYS_TASK set MESSAGE_=? where ID_=?",message,taskId);
}

93
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/thread/ExportTaskThread.java

@ -0,0 +1,93 @@
package io.sc.platform.orm.task.thread;
import io.sc.platform.orm.service.DaoService;
import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.platform.orm.storage.service.StorageService;
import io.sc.platform.orm.task.ExportTask;
import io.sc.platform.orm.task.Task;
import io.sc.platform.orm.task.exception.JxlsTemplateNotFoundException;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jxls.common.Context;
import org.jxls.util.JxlsHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
public class ExportTaskThread extends TaskThread {
private static final Logger log = LoggerFactory.getLogger(ExportTaskThread.class);
private long totalRowCount =0;
public ExportTaskThread(Task task) {
super(task);
if(!(task instanceof ExportTask)) {
throw new IllegalArgumentException("task must been a ExportTask instance");
}
}
@Override
boolean isAsyncExeucte() {
DaoService daoService =(DaoService)getContextObject("daoService");
QueryParameter queryParameter =(QueryParameter)getContextObject("queryParameter");
try {
totalRowCount = daoService.count(queryParameter);
return totalRowCount>getSynchronousExportMaxCount();
} catch (Exception e) {
log.error("",e);
return false;
}
}
@Override
public void run() {
DaoService daoService =(DaoService)getContextObject("daoService");
QueryParameter queryParameter =(QueryParameter)getContextObject("queryParameter");
ExportTask task =(ExportTask)this.task;
setTotalWeight(totalRowCount);//设置进度条总量
setCurrentWeight(1, "Query Database ......");//启动时设置当前进度
try {
//获取模版
byte[] templateBytes = getTemplateBytes(task.getTemplateConfigure());
if(templateBytes==null){
//未找到 jxls 模版错误
error(JxlsTemplateNotFoundException.class.getName(),null,null);
return;
}
//查询数据
Context context = new Context();
context.putVar("list", daoService.list(queryParameter));
//查询完毕后设置进度为 1/2
setCurrentWeight(totalRowCount/2,"Generate Excel ......");
//导出 Excel 文件
String outputFilePath = task.getOutputPath();
try (
InputStream inputStream = new ByteArrayInputStream(templateBytes);
FileOutputStream outputStream = new FileOutputStream(outputFilePath);
) {
JxlsHelper.getInstance().setEvaluateFormulas(true).processTemplate(inputStream, outputStream, context);
}
//查询完毕后设置进度为 1/2
setCurrentWeight((long)(totalRowCount/1.1), "Save Excel ......");
//存储到存储服务中
StorageService storageService =getSpringBean(StorageService.class);
storageService.add(outputFilePath, outputFilePath);
sleep(10000);
//完成
complete();
} catch (Exception e) {
//发生错误
error(e.getClass().getName(),e.getMessage(), ExceptionUtils.getStackTrace(e));
throw new RuntimeException(e);
}
}
}

147
io.sc.platform.orm/src/main/java/io/sc/platform/orm/task/thread/TaskThread.java

@ -0,0 +1,147 @@
package io.sc.platform.orm.task.thread;
import io.sc.platform.core.Environment;
import io.sc.platform.orm.service.JxlsTemplateService;
import io.sc.platform.orm.service.support.DataExportTemplateConfigure;
import io.sc.platform.orm.service.support.JxlsTemplate;
import io.sc.platform.orm.task.Task;
import io.sc.platform.orm.task.TaskExecuteMode;
import io.sc.platform.orm.task.service.TaskService;
import io.sc.platform.util.ByteUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
public abstract class TaskThread extends Thread {
protected Task task;
protected Map<String,Object> context =new HashMap<>();
public TaskThread(Task task){
this.task =task;
}
public void addContextObject(String name,Object value){
context.put(name,value);
}
abstract boolean isAsyncExeucte();
public Task execute(){
if(isAsyncExeucte()){
TaskService taskService = getSpringBean(TaskService.class);
task.setExecuteMode(TaskExecuteMode.ASYNCHRONOUS);
Task _task =taskService.create(task);
Executor executor =getSpringBean(Executor.class);
executor.execute(this);
return _task;
}else{
run();
return this.task;
}
}
@Override
public void run() {
}
protected Object getContextObject(String name){
return context.get(name);
}
protected void setTotalWeight(long totalWeight){
TaskService taskService =getSpringBean(TaskService.class);
taskService.setTotalWeight(task.getId(),totalWeight);
}
protected void setCurrentWeight(long currentWeight,String message){
TaskService taskService =getSpringBean(TaskService.class);
taskService.setCurrentWeight(task.getId(),currentWeight,message);
}
protected void setMessage(String message){
TaskService taskService =getSpringBean(TaskService.class);
taskService.setMessage(task.getId(),message);
}
protected void error(String exception,String exceptionMessage,String exceptionStackTrace){
TaskService taskService =getSpringBean(TaskService.class);
taskService.error(task.getId(),exception,exceptionMessage,exceptionStackTrace);
}
protected void complete(){
TaskService taskService =getSpringBean(TaskService.class);
taskService.complete(task.getId());
}
protected boolean isCanceled(){
TaskService taskService =getSpringBean(TaskService.class);
return taskService.isCanceled(task.getId());
}
protected long getSynchronousExportMaxCount() {
JdbcTemplate jdbcTemplate =getSpringBean(JdbcTemplate.class);
Map<String,Object> row =jdbcTemplate.queryForMap("select VALUE_ from SYS_PARAMETER where CODE_=?","parameter.orm.exportExcel.synchronousExportMaxCount");
if(row==null || row.isEmpty()){
return 1000;
}
return Long.parseLong(row.get("VALUE_").toString());
}
/**
* 获取导出JXLS模版
* @param configure 模版配置
* @return 模版
* @throws IOException 违例
*/
protected byte[] getTemplateBytes(DataExportTemplateConfigure configure) throws IOException {
if(configure==null){
return null;
}
JxlsTemplateService jxlsTemplateService =getSpringBean(JxlsTemplateService.class);
// 先查找 JXLS 模版中匹配的 code 的模版
String templateCode =configure.getJxlsTemplateCode();
if(StringUtils.hasText(templateCode)) {
JxlsTemplate template =jxlsTemplateService.findTemplateByCode(templateCode);
if(template!=null){
return template.getBytes();
}
}
// 再查找 JXLS 模版中匹配的实体类名的模版
String templateJpaEntityClass =configure.getJxlsTemplateJpaEntityClass();
if(StringUtils.hasText(templateJpaEntityClass)) {
JxlsTemplate template =jxlsTemplateService.findTemplateByJpaEntityClass(templateJpaEntityClass);
if(template!=null){
return template.getBytes();
}
}
// 最后查找预定义的模版类路径
String templateClassPath =configure.getJxlsTemplateClassPath();
if(StringUtils.hasText(templateClassPath)) {
Resource resource = new DefaultResourceLoader().getResource("classpath:/" + templateClassPath);
if (resource != null && resource.exists()) {
try (InputStream inputStream = resource.getInputStream();) {
return ByteUtil.read(inputStream);
}
}
}
return null;
}
protected <T> T getSpringBean(Class<T> clazz){
ApplicationContext applicationContext =Environment.getInstance().getApplicationContext();
return applicationContext.getBean(clazz);
}
}

3
io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task.properties

@ -7,3 +7,6 @@ io.sc.platform.orm.task.TaskStatus.STARTED=Started
io.sc.platform.orm.task.TaskStatus.COMPLETED=Completed
io.sc.platform.orm.task.TaskStatus.CANCELED=Canceled
io.sc.platform.orm.task.TaskStatus.ERROR=Error Occur
io.sc.platform.orm.task.exception.AsyncTaskAllreadyExistsException=Asynchronous task allready exists and running!
io.sc.platform.orm.task.exception.JxlsTemplateNotFoundException=Excel template NOT exists!

3
io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task_tw_CN.properties

@ -7,3 +7,6 @@ io.sc.platform.orm.task.TaskStatus.STARTED=\u5DF2\u555F\u52D5
io.sc.platform.orm.task.TaskStatus.COMPLETED=\u5DF2\u5B8C\u6210
io.sc.platform.orm.task.TaskStatus.CANCELED=\u5DF2\u53D6\u6D88
io.sc.platform.orm.task.TaskStatus.ERROR=\u767C\u751F\u932F\u8AA4
io.sc.platform.orm.task.exception.AsyncTaskAllreadyExistsException=\u7570\u6B65\u4EFB\u52D9\u6B63\u5728\u57F7\u884C\u4E2D!
io.sc.platform.orm.task.exception.JxlsTemplateNotFoundException=Excel \u6A21\u7248\u4E0D\u5B58\u5728!

3
io.sc.platform.orm/src/main/resources/io/sc/platform/orm/task/i18n/task_zh_CN.properties

@ -7,3 +7,6 @@ io.sc.platform.orm.task.TaskStatus.STARTED=\u5DF2\u542F\u52A8
io.sc.platform.orm.task.TaskStatus.COMPLETED=\u5DF2\u5B8C\u6210
io.sc.platform.orm.task.TaskStatus.CANCELED=\u5DF2\u53D6\u6D88
io.sc.platform.orm.task.TaskStatus.ERROR=\u53D1\u751F\u9519\u8BEF
io.sc.platform.orm.task.exception.AsyncTaskAllreadyExistsException=\u5F02\u6B65\u4EFB\u52A1\u6B63\u5728\u6267\u884C\u4E2D!
io.sc.platform.orm.task.exception.JxlsTemplateNotFoundException=Excel \u6A21\u7248\u4E0D\u5B58\u5728!

2
io.sc.platform.poi/build.gradle

@ -8,5 +8,7 @@ dependencies {
"org.jxls:jxls:${jxls_version}",
"org.jxls:jxls-poi:${jxls_version}",
"org.apache.commons:commons-jexl3:${commons_jexl3_version}",
"com.deepoove:poi-tl:${poi_tl_version}",
)
}

19
io.sc.platform.poi/src/test/java/WordTest.java

@ -0,0 +1,19 @@
import com.deepoove.poi.XWPFTemplate;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class WordTest {
public static void main(String[] args) throws IOException {
Map<String,Object> context =new HashMap<>();
context.put("title", "Hi, poi-tl Word模板引擎");
context.put("date", new Date());
XWPFTemplate template = XWPFTemplate.compile("/Users/wangshaoping/Desktop/test/template.docx").render(context);
template.writeAndClose(new FileOutputStream("/Users/wangshaoping/Desktop/test/out.docx"));
}
}

5
io.sc.platform.scheduler.manager.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.scheduler.manager.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.scheduler.manager.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

5
io.sc.platform.system.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.platform.system.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -112,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.system.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

10
io.sc.platform.system/src/main/java/io/sc/platform/system/initializer/ParameterInitializer.java

@ -47,15 +47,23 @@ public class ParameterInitializer implements ApplicationInitializer {
}
List<Parameter> needAddedParameters =getNeedAddedParameters();
try {
// 先插入实体
for(Parameter item : needAddedParameters){
ParameterEntity entity =new ParameterEntity();
entity.setCode(StringUtils.hasText(item.getCode())?item.getCode():item.getId());
entity.setValue(item.getDefaultValue());
entity.setOrder(item.getOrder());
entity.setParent(cache.get(item.getParentId()));
ParameterEntity added =parameterService.add(entity);
cache.put(added.getCode(),added);
}
// 再设置父子关系
for(Parameter item : needAddedParameters){
ParameterEntity entity =cache.get(item.getId());
if(entity.getParent()==null && StringUtils.hasText(item.getParentId())){
entity.setParent(cache.get(item.getParentId()));
parameterService.update(entity.getId(),entity);
}
}
} catch (Exception e) {
throw new ApplicationInitializerExecuteException(e);
}

5
io.sc.platform.system/src/main/java/io/sc/platform/system/task/controller/TaskWebController.java

@ -22,4 +22,9 @@ public class TaskWebController extends RestCrudController<Task, TaskEntity, Stri
public void removeAsyncTask(@PathVariable("taskId")String taskId){
service.removeAsyncTask(taskId);
}
@PostMapping("cancelAsyncTask/{taskId}")
public void cancelAsyncTask(@PathVariable("taskId")String taskId){
service.cancelAsyncTask(taskId);
}
}

2
io.sc.platform.system/src/main/java/io/sc/platform/system/task/service/TaskService.java

@ -16,4 +16,6 @@ import java.util.Set;
public interface TaskService extends DaoService<TaskEntity, String, TaskRepository> {
public void cleanMyAsyncTaskList();
public void removeAsyncTask(String taskId);
public void cancelAsyncTask(String taskId);
}

10
io.sc.platform.system/src/main/java/io/sc/platform/system/task/service/impl/TaskServiceImpl.java

@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Date;
@Service("io.sc.platform.system.task.service.impl.TaskServiceImpl")
public class TaskServiceImpl extends DaoServiceImpl<TaskEntity, String, TaskRepository> implements TaskService {
@Autowired private JdbcTemplate jdbcTemplate;
@ -29,4 +31,12 @@ public class TaskServiceImpl extends DaoServiceImpl<TaskEntity, String, TaskRepo
}
jdbcTemplate.update("delete from SYS_TASK where STATUS_<>'STARTED' and ID_=?", taskId);
}
@Override
public void cancelAsyncTask(String taskId) {
if(!StringUtils.hasText(taskId)){
return;
}
jdbcTemplate.update("update SYS_TASK set STATUS_='CANCELED', CANCELED_DATE_=? where ID_=?", new Date(),taskId);
}
}

5
io.sc.standard.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.standard.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -113,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.standard.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

4
io.sc.website/package.json

@ -1,6 +1,6 @@
{
"name": "io.sc.website",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"main": "index.js",
"scripts": {
@ -28,6 +28,6 @@
},
"dependencies": {
"vue": "3.5.13",
"platform-core": "8.2.126"
"platform-core": "8.2.127"
}
}

5
wra.report.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "wra.report.frontend",
"version": "8.2.33",
"version": "8.2.34",
"description": "",
"private": false,
"keywords": [],
@ -102,7 +102,6 @@
"@univerjs/ui": "0.5.4",
"@vueuse/core": "12.4.0",
"axios": "1.8.2",
"bpmn-js": "18.6.2",
"codemirror": "6.0.1",
"dayjs": "1.11.13",
"echarts": "5.6.0",
@ -112,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.126",
"platform-core": "8.2.127",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
wra.report.frontend/public/configure.js

@ -37,7 +37,7 @@ window.APP.configure = {
// axios 配置
axios: {
baseURL: '',
timeout: 1000 * 60,
timeout: 1000 * 60 * 5,
crossdomain: true,
basicAuth: {
username: 'admin',

Loading…
Cancel
Save