diff --git a/app.platform/src/main/java/app/platform/Application.java b/app.platform/src/main/java/app/platform/Application.java index b411bafa..fbf65453 100644 --- a/app.platform/src/main/java/app/platform/Application.java +++ b/app.platform/src/main/java/app/platform/Application.java @@ -17,5 +17,118 @@ import java.util.List; public class Application extends PlatformSpringBootServletInitializer implements WebApplicationInitializer { public static void main(String[] args) throws Exception { ApplicationLauncher.run(Application.class,args); + String xml ="\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " {\"A2\":\"platformAssigneeQueryService\"}\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " "; } } diff --git a/cips.frontend/package.json b/cips.frontend/package.json index d7178929..e17dfe99 100644 --- a/cips.frontend/package.json +++ b/cips.frontend/package.json @@ -1,6 +1,6 @@ { "name": "cips.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/erm.frontend/package.json b/erm.frontend/package.json index bbb62d67..d088be21 100644 --- a/erm.frontend/package.json +++ b/erm.frontend/package.json @@ -1,6 +1,6 @@ { "name": "erm.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/gradle.properties b/gradle.properties index 721ac6f0..043e0108 100644 --- a/gradle.properties +++ b/gradle.properties @@ -37,9 +37,9 @@ application_version=1.0.0 # platform ########################################################### platform_group=io.sc -platform_version=8.2.30 +platform_version=8.2.31 platform_plugin_version=8.2.10 -platform_core_frontend_version=8.2.117 +platform_core_frontend_version=8.2.121 ########################################################### # dependencies version @@ -52,6 +52,7 @@ checker_version=3.43.0 commons_compress_version=1.25.0 commons_fileupload_version=1.4 commons_io_version=2.16.1 +commons_jexl3_version=3.2 commons_text_version=1.12.0 curvesapi_version=1.08 cxf_version=3.2.7 diff --git a/io.sc.engine.mv.frontend/package.json b/io.sc.engine.mv.frontend/package.json index 52ffc99f..7269f4e2 100644 --- a/io.sc.engine.mv.frontend/package.json +++ b/io.sc.engine.mv.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.mv.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 84b95eb9..425dd069 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/io.sc.engine.rule.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.rule.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.engine.st.frontend/package.json b/io.sc.engine.st.frontend/package.json index 9fd812f0..178b593a 100644 --- a/io.sc.engine.st.frontend/package.json +++ b/io.sc.engine.st.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.st.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.ai.frontend/package.json b/io.sc.platform.ai.frontend/package.json index a3c91648..31aebe77 100644 --- a/io.sc.platform.ai.frontend/package.json +++ b/io.sc.platform.ai.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.ai.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 0ba004dc..d9bc9143 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.117", + "version": "8.2.121", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/components/index.ts b/io.sc.platform.core.frontend/src/components/index.ts index 06947387..fd00c33d 100644 --- a/io.sc.platform.core.frontend/src/components/index.ts +++ b/io.sc.platform.core.frontend/src/components/index.ts @@ -13,6 +13,7 @@ import component_testcase_excel from '@/views/testcase/excel/Excel.vue'; import component_testcase_word from '@/views/testcase/word/Word.vue'; import component_testcase_maxgraph from '@/views/testcase/maxgraph/Maxgraph.vue'; import component_testcase_ai from '@/views/testcase/ai/Ai.vue'; +import component_testcase_bpm from '@/views/testcase/bpm/Bpm.vue'; import component_testcase_likmDialog from '@/views/likm/Dialog.vue'; import component_testcase_likmDrawer from '@/views/likm/Drawer.vue'; import component_testcase_likmForm from '@/views/likm/Form.vue'; @@ -35,6 +36,7 @@ const localComponents = { 'component.testcase.word': component_testcase_word, 'component.testcase.maxgraph': component_testcase_maxgraph, 'component.testcase.ai': component_testcase_ai, + 'component.testcase.bpm': component_testcase_bpm, 'component.testcase.likmDialog': component_testcase_likmDialog, 'component.testcase.likmDrawer': component_testcase_likmDrawer, 'component.testcase.likmForm': component_testcase_likmForm, diff --git a/io.sc.platform.core.frontend/src/i18n/messages.json b/io.sc.platform.core.frontend/src/i18n/messages.json index bae37506..727e9d08 100644 --- a/io.sc.platform.core.frontend/src/i18n/messages.json +++ b/io.sc.platform.core.frontend/src/i18n/messages.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "Graph Editor", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "No Menu Route" } diff --git a/io.sc.platform.core.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.core.frontend/src/i18n/messages_tw_CN.json index 44e60ea3..5db47eaf 100644 --- a/io.sc.platform.core.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.core.frontend/src/i18n/messages_tw_CN.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "图形编辑器", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "無關聯菜單路由" } diff --git a/io.sc.platform.core.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/src/i18n/messages_zh_CN.json index 6acb675d..1b7e6575 100644 --- a/io.sc.platform.core.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/src/i18n/messages_zh_CN.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "图形编辑器", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "无关联菜单路由" } diff --git a/io.sc.platform.core.frontend/src/menus/menus.json b/io.sc.platform.core.frontend/src/menus/menus.json index b05d7a9d..60c44c40 100644 --- a/io.sc.platform.core.frontend/src/menus/menus.json +++ b/io.sc.platform.core.frontend/src/menus/menus.json @@ -127,7 +127,15 @@ "icon": "bi-palette", "routeName": "route.testcase.ai" }, - + { + "type": "ROUTE", + "order": 800, + "parentId": "menu.testcase", + "id": "menu.testcase.bpm", + "titleI18nKey": "menu.testcase.bpm", + "icon": "bi-palette", + "routeName": "route.testcase.bpm" + }, { "type": "GROUP", "order": 30000, "id": "menu.testcase.likm", "titleI18nKey": "测试用例-likm", "icon": "home" }, { "type": "ROUTE", diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts b/io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts index 20e1d8c3..c025be3f 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts +++ b/io.sc.platform.core.frontend/src/platform/components/grid/ts/toolbar/buttons/Export.ts @@ -1,4 +1,4 @@ -import { $t, axios, Downloader } from '@/platform'; +import { $t, axios, Downloader, Tools } from '@/platform'; import { PropsType, TableType } from '../../index'; import { Button } from '../Button'; @@ -16,7 +16,10 @@ export class Export extends Button { async click(args) { const reqParams: any = { pageable: false }; const urlSearchParams = this.tools?.criteriaFM.buildURLSearchParams(reqParams); - const url = this.table?.url.exportDataUrl || this.table.url.dataUrl + '/exportExcel'; + 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); + } Downloader.get(url, { params: urlSearchParams }); } diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages.json b/io.sc.platform.core.frontend/src/platform/i18n/messages.json index 7fd884dc..38553af5 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages.json @@ -331,6 +331,7 @@ "home.card.task.tip.routeOrComponentNotSetting": "Action Operator NOT Setting!", "home.card.task.tip.remoteComponentLoadError": "Action Component Loading Failed!", + "home.card.task.tip.taskNotExists": "Task NOT Exists, Can NOT Open Handler Dialog!", "home.card.myTask.title": "My Tasks", "home.card.myTask.action.list": "all my tasks", diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json index 2617d0d1..9341938d 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json @@ -331,6 +331,7 @@ "home.card.task.tip.routeOrComponentNotSetting": "任務辦理動作未設置, 無法執行!", "home.card.task.tip.remoteComponentLoadError": "任務辦理組件加載失敗, 無法執行!", + "home.card.task.tip.taskNotExists": "未找到任務, 無法打開任務處理對話框!", "home.card.myTask.title": "待辦任務", "home.card.myTask.action.list": "顯示所有", diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json index 06b8c7ba..2a1db8f8 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json @@ -332,6 +332,7 @@ "home.card.task.tip.routeOrComponentNotSetting": "任务办理动作未设置, 无法执行!", "home.card.task.tip.remoteComponentLoadError": "任务办理组件加载失败, 无法执行!", + "home.card.task.tip.taskNotExists": "未找到任务, 无法打开任务处理对话框!", "home.card.myTask.title": "待办任务", "home.card.myTask.action.list": "显示所有", diff --git a/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue index c67c051b..14880750 100644 --- a/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue +++ b/io.sc.platform.core.frontend/src/platform/layout/sub-layout/Topper.vue @@ -77,8 +77,8 @@ - {{ item.createTimeAndNowDiff }}{{ $t(item.createTimeAndNowDiffUnit) }}{{ $t('before') }} - {{ item.createTime }} + {{ item.startTimeAndNowDiff }}{{ $t(item.startTimeAndNowDiffUnit) }}{{ $t('before') }} + {{ item.startTime }} {{ item.previousAssignee }} diff --git a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts index 89872089..a56c9351 100644 --- a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts +++ b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts @@ -1099,6 +1099,18 @@ class Tools { html = html.replace(/>/g, '>'); return html; } + + /** + * 获取字符串的字节长度 + * @param str 字符串 + * @returns 字符串的字节长度 + */ + public static lengthB(str: string) { + if (Tools.isNill(str)) { + return 0; + } + return new TextEncoder().encode(str).length; + } } export { Tools }; diff --git a/io.sc.platform.core.frontend/src/platform/views/Home.vue b/io.sc.platform.core.frontend/src/platform/views/Home.vue index bdcd8938..96e346a5 100644 --- a/io.sc.platform.core.frontend/src/platform/views/Home.vue +++ b/io.sc.platform.core.frontend/src/platform/views/Home.vue @@ -7,11 +7,11 @@
- +
- +
- +
@@ -24,6 +24,7 @@ diff --git a/io.sc.platform.core.frontend/src/platform/views/home/AnnouncementDialog.vue b/io.sc.platform.core.frontend/src/platform/views/home/AnnouncementDialog.vue index e6a16604..4e80d294 100644 --- a/io.sc.platform.core.frontend/src/platform/views/home/AnnouncementDialog.vue +++ b/io.sc.platform.core.frontend/src/platform/views/home/AnnouncementDialog.vue @@ -1,7 +1,7 @@ diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 8c9b354d..d0257b82 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.117", + "version": "8.2.121", "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.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.core.frontend/template-project/src/components/index.ts b/io.sc.platform.core.frontend/template-project/src/components/index.ts index 06947387..fd00c33d 100644 --- a/io.sc.platform.core.frontend/template-project/src/components/index.ts +++ b/io.sc.platform.core.frontend/template-project/src/components/index.ts @@ -13,6 +13,7 @@ import component_testcase_excel from '@/views/testcase/excel/Excel.vue'; import component_testcase_word from '@/views/testcase/word/Word.vue'; import component_testcase_maxgraph from '@/views/testcase/maxgraph/Maxgraph.vue'; import component_testcase_ai from '@/views/testcase/ai/Ai.vue'; +import component_testcase_bpm from '@/views/testcase/bpm/Bpm.vue'; import component_testcase_likmDialog from '@/views/likm/Dialog.vue'; import component_testcase_likmDrawer from '@/views/likm/Drawer.vue'; import component_testcase_likmForm from '@/views/likm/Form.vue'; @@ -35,6 +36,7 @@ const localComponents = { 'component.testcase.word': component_testcase_word, 'component.testcase.maxgraph': component_testcase_maxgraph, 'component.testcase.ai': component_testcase_ai, + 'component.testcase.bpm': component_testcase_bpm, 'component.testcase.likmDialog': component_testcase_likmDialog, 'component.testcase.likmDrawer': component_testcase_likmDrawer, 'component.testcase.likmForm': component_testcase_likmForm, diff --git a/io.sc.platform.core.frontend/template-project/src/i18n/messages.json b/io.sc.platform.core.frontend/template-project/src/i18n/messages.json index bae37506..727e9d08 100644 --- a/io.sc.platform.core.frontend/template-project/src/i18n/messages.json +++ b/io.sc.platform.core.frontend/template-project/src/i18n/messages.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "Graph Editor", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "No Menu Route" } diff --git a/io.sc.platform.core.frontend/template-project/src/i18n/messages_tw_CN.json b/io.sc.platform.core.frontend/template-project/src/i18n/messages_tw_CN.json index 44e60ea3..5db47eaf 100644 --- a/io.sc.platform.core.frontend/template-project/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.core.frontend/template-project/src/i18n/messages_tw_CN.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "图形编辑器", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "無關聯菜單路由" } diff --git a/io.sc.platform.core.frontend/template-project/src/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/template-project/src/i18n/messages_zh_CN.json index 6acb675d..1b7e6575 100644 --- a/io.sc.platform.core.frontend/template-project/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/template-project/src/i18n/messages_zh_CN.json @@ -12,6 +12,7 @@ "menu.testcase.word": "Word", "menu.testcase.maxgraph": "图形编辑器", "menu.testcase.ai": "AI", + "menu.testcase.bpm": "BPM", "route.testcase.noMenuRoute": "无关联菜单路由" } diff --git a/io.sc.platform.core.frontend/template-project/src/menus/menus.json b/io.sc.platform.core.frontend/template-project/src/menus/menus.json index b05d7a9d..60c44c40 100644 --- a/io.sc.platform.core.frontend/template-project/src/menus/menus.json +++ b/io.sc.platform.core.frontend/template-project/src/menus/menus.json @@ -127,7 +127,15 @@ "icon": "bi-palette", "routeName": "route.testcase.ai" }, - + { + "type": "ROUTE", + "order": 800, + "parentId": "menu.testcase", + "id": "menu.testcase.bpm", + "titleI18nKey": "menu.testcase.bpm", + "icon": "bi-palette", + "routeName": "route.testcase.bpm" + }, { "type": "GROUP", "order": 30000, "id": "menu.testcase.likm", "titleI18nKey": "测试用例-likm", "icon": "home" }, { "type": "ROUTE", diff --git a/io.sc.platform.core.frontend/template-project/src/routes/routes.json b/io.sc.platform.core.frontend/template-project/src/routes/routes.json index 4683a359..b897c056 100644 --- a/io.sc.platform.core.frontend/template-project/src/routes/routes.json +++ b/io.sc.platform.core.frontend/template-project/src/routes/routes.json @@ -141,6 +141,19 @@ } }, + { + "name": "route.testcase.bpm", + "path": "testcase/bpm", + "parent": "/", + "priority": 0, + "component": "component.testcase.bpm", + "componentPath": "@/views/testcase/bpm/Bpm.vue", + "redirect": null, + "meta": { + "permissions": ["/testcase/bpm/**/*"] + } + }, + { "name": "route.testcase.likm.dialog", "path": "testcase/likm/dialog", diff --git a/io.sc.platform.core.frontend/template-project/src/views/testcase/bpm/Bpm.vue b/io.sc.platform.core.frontend/template-project/src/views/testcase/bpm/Bpm.vue new file mode 100644 index 00000000..0a1c5307 --- /dev/null +++ b/io.sc.platform.core.frontend/template-project/src/views/testcase/bpm/Bpm.vue @@ -0,0 +1,142 @@ + + diff --git a/io.sc.platform.developer.doc/package.json b/io.sc.platform.developer.doc/package.json index 27c82127..c82ce790 100644 --- a/io.sc.platform.developer.doc/package.json +++ b/io.sc.platform.developer.doc/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.doc", - "version": "8.2.28", + "version": "8.2.31", "description": "", "main": "index.js", "scripts": { @@ -28,7 +28,7 @@ "vuepress": "2.0.0-rc.15" }, "dependencies": { - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "vue": "3.5.13", "vue-i18n": "11.0.1" diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index 75a0ad80..03f2e0e8 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/io.sc.platform.developer.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessEntityWebController.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessEntityWebController.java index 878d1074..1a4917c2 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessEntityWebController.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessEntityWebController.java @@ -7,10 +7,11 @@ import io.sc.platform.flowable.jpa.entity.ProcessEntity; import io.sc.platform.flowable.jpa.repository.ProcessEntityRepository; import io.sc.platform.flowable.service.ProcessEntityService; import io.sc.platform.mvc.controller.support.RestCrudController; +import io.sc.platform.orm.util.EntityVoUtil; import org.flowable.bpmn.model.UserTask; import org.springframework.web.bind.annotation.*; -import java.util.List; +import java.util.*; @RestController("io.sc.platform.flowable.controller.ProcessEntityWebController") @RequestMapping("/api/flowable/process") @@ -20,9 +21,22 @@ public class ProcessEntityWebController extends RestCrudController findAllDeployedProcessDefines() throws Exception { - return service.findAllDeployedProcessDefines(); + @PostMapping("findByProcessDefineKeysExcludes") + public Map findByProcessDefineKeysExcludes(@RequestBody Set excludes) throws Exception { + List entities =null; + if(excludes==null || excludes.isEmpty()){ + entities =service.getRepository().findByProcessDefineKeys(); + }else { + entities =service.getRepository().findByProcessDefineKeysExcludes(excludes); + } + if(entities==null || entities.isEmpty()){ + return Collections.emptyMap(); + } + Map restult =new LinkedHashMap<>(); + for(ProcessEntity entity : entities){ + restult.put(entity.getKey(),entity.getName()); + } + return restult; } @GetMapping("findUserTasksByProcessDeployId/{deployId}") diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessQueryWebController.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessQueryWebController.java index 11f07560..868dee6e 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessQueryWebController.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/controller/ProcessQueryWebController.java @@ -63,15 +63,30 @@ public class ProcessQueryWebController { return service.queryProcessTasks(queryParameter); } + @GetMapping("myTaskById/{taskId}") + public ProcessTaskWrapper myTaskById(@PathVariable("taskId")String taskId) throws Exception { + return service.queryProcessTaskById(taskId); + } + @GetMapping("myDoneTask") - public Page doneTask(QueryParameter queryParameter) throws Exception { + public Page myDoneTask(QueryParameter queryParameter) throws Exception { return service.queryDoneProcessTasks(queryParameter); } + @GetMapping("myDoneTaskById/{taskId}") + public ProcessTaskWrapper myDoneTaskById(@PathVariable("taskId")String taskId) throws Exception { + return service.queryDoneProcessTaskById(taskId); + } + @GetMapping("myFinishedTask") - public Page finishedTask(QueryParameter queryParameter) throws Exception { + public Page myFinishedTask(QueryParameter queryParameter) throws Exception { return service.queryFinishedProcessTasks(queryParameter); } + + @GetMapping("myFinishedTaskById/{taskId}") + public ProcessTaskWrapper myFinishedTaskById(@PathVariable("taskId")String taskId) throws Exception { + return service.queryFinishedProcessTaskById(taskId); + } @GetMapping("variable") public List variableQuery(@RequestParam(name="procInstId",required=false) String procInstId) throws Exception{ diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/jpa/repository/ProcessEntityRepository.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/jpa/repository/ProcessEntityRepository.java index 313183ed..3f51761f 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/jpa/repository/ProcessEntityRepository.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/jpa/repository/ProcessEntityRepository.java @@ -3,9 +3,12 @@ package io.sc.platform.flowable.jpa.repository; import io.sc.platform.flowable.jpa.entity.ProcessEntity; import io.sc.platform.flowable.enums.ProcessStatus; import io.sc.platform.orm.repository.DaoRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Set; @Repository("io.sc.platform.flowable.jpa.repository.ProcessEntityRepository") public interface ProcessEntityRepository extends DaoRepository { @@ -30,6 +33,14 @@ public interface ProcessEntityRepository extends DaoRepository findByStatusOrderByVersion(ProcessStatus status); + + @Query("select e from io.sc.platform.flowable.jpa.entity.ProcessEntity e where e.key not in (:excludes) order by e.name") + public List findByProcessDefineKeysExcludes(@Param("excludes")Set excludes); + + @Query("select e from io.sc.platform.flowable.jpa.entity.ProcessEntity e order by e.name") + public List findByProcessDefineKeys(); } diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/ProcessQueryService.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/ProcessQueryService.java index 597c8bdd..2f6692ae 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/ProcessQueryService.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/ProcessQueryService.java @@ -48,6 +48,14 @@ public interface ProcessQueryService { */ public Page queryProcessTasks(QueryParameter queryParameter) throws Exception; + /** + * 查询任务(代办) + * @param taskId 任务ID + * @return 任务 + * @throws Exception 违例 + */ + public ProcessTaskWrapper queryProcessTaskById(String taskId) throws Exception; + /** * 查询任务(已办) * @param queryParameter 查询参数 @@ -56,6 +64,14 @@ public interface ProcessQueryService { */ public Page queryDoneProcessTasks(QueryParameter queryParameter) throws Exception; + /** + * 查询任务(已办) + * @param taskId 任务ID + * @return 任务 + * @throws Exception 违例 + */ + public ProcessTaskWrapper queryDoneProcessTaskById(String taskId) throws Exception; + /** * 查询任务(办结) * @param queryParameter 查询参数 @@ -64,6 +80,14 @@ public interface ProcessQueryService { */ public Page queryFinishedProcessTasks(QueryParameter queryParameter) throws Exception; + /** + * 查询任务(办结) + * @param taskId 任务ID + * @return 任务 + * @throws Exception 违例 + */ + public ProcessTaskWrapper queryFinishedProcessTaskById(String taskId) throws Exception; + /** * 查询流程实例变量集 diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessEntityServiceImpl.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessEntityServiceImpl.java index a213b825..3cff06ca 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessEntityServiceImpl.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessEntityServiceImpl.java @@ -35,7 +35,7 @@ public class ProcessEntityServiceImpl extends DaoServiceImpl variables =new HashMap<>(); + variables.put("businessKey",StringUtil.escapeSqlSpecialChar(businessKey)); + + String sql =StringUtil.format(entity.getBusinessDescriptionSql(),variables); + BusinessKeyAndDescriptionWrapper wrapper =jdbcTemplate.queryForObject(sql,new BusinessKeyAndDescriptionWrapperMapper()); + if(wrapper==null){ + return; + } + jdbcTemplate.update("insert into SYS_PROCESS_INST_EXT(PROC_INST_ID_,CUST_NO_,CUST_NAME_) values(?,?,?)",processInstanceId,wrapper.getCustNo(),wrapper.getCustName()); + } + + @Transactional + private void insertProcInsExtByDefinitionId(String processDefinitionId, String processInstanceId, String businessKey){ + if(!StringUtils.hasText(processDefinitionId) || !StringUtils.hasText(processInstanceId) || !StringUtils.hasText(businessKey)){ + return; + } + + ProcessEntity entity =processEntityService.getRepository().findByDeployedId(processDefinitionId); + if(entity==null || !StringUtils.hasText(entity.getBusinessDescriptionSql())){ + return; + } + + Map variables =new HashMap<>(); + variables.put("businessKey",StringUtil.escapeSqlSpecialChar(businessKey)); + + String sql =StringUtil.format(entity.getBusinessDescriptionSql(),variables); + BusinessKeyAndDescriptionWrapper wrapper =jdbcTemplate.queryForObject(sql,new BusinessKeyAndDescriptionWrapperMapper()); + if(wrapper==null){ + return; + } + jdbcTemplate.update("insert into SYS_PROCESS_INST_EXT(PROC_INST_ID_,CUST_NO_,CUST_NAME_) values(?,?,?)",processInstanceId,wrapper.getCustNo(),wrapper.getCustName()); + } private AssigneeQueryService getAssignmentStrategySpringBean(BpmnModel model,ProcessInstance processInstance,UserTask taskDefine) { String beanName =DEFAULT_ASSIGNMENT_STRATEGY_SPRING_BEAN_NAME; diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl.java index 2cc42a30..2e1dd774 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl.java @@ -1,6 +1,5 @@ package io.sc.platform.flowable.service.impl; -import io.sc.platform.flowable.jpa.entity.ProcessEntity; import io.sc.platform.flowable.service.AssigneeQueryService; import io.sc.platform.flowable.service.ProcessEntityService; import io.sc.platform.flowable.service.ProcessQueryService; @@ -10,11 +9,10 @@ import io.sc.platform.lcdp.form.service.JdbcTemplateService; import io.sc.platform.orm.service.support.QueryParameter; import io.sc.platform.orm.service.support.QueryResult; import io.sc.platform.orm.service.support.criteria.Criteria; -import io.sc.platform.orm.service.support.criteria.impl.Contains; import io.sc.platform.orm.service.support.criteria.impl.Equals; import io.sc.platform.security.util.SecurityUtil; import io.sc.platform.util.CollectionUtil; -import io.sc.platform.util.DateUtil; +import io.sc.platform.util.FileUtil; import io.sc.platform.util.StringUtil; import org.flowable.bpmn.model.BpmnModel; import org.flowable.bpmn.model.EndEvent; @@ -24,14 +22,13 @@ import org.flowable.engine.HistoryService; import org.flowable.engine.RepositoryService; import org.flowable.engine.RuntimeService; import org.flowable.engine.TaskService; -import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.engine.repository.ProcessDefinition; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.runtime.ProcessInstanceQuery; import org.flowable.image.impl.DefaultProcessDiagramGenerator; import org.flowable.task.api.Task; -import org.flowable.task.api.TaskQuery; import org.flowable.task.api.history.HistoricTaskInstance; +import org.flowable.task.api.history.HistoricTaskInstanceQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Page; @@ -42,6 +39,7 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; +import java.io.IOException; import java.io.InputStream; import java.util.*; @@ -61,7 +59,31 @@ public class ProcessQueryServiceImpl implements ProcessQueryService { @Autowired private Dialect dialect; @Autowired private JdbcTemplate jdbcTemplate; - @Override + private static final String PROCESS_TASK_SQL; + private static final String PROCESS_PREFIX_ASSIGNEE_SQL; + private static final String DONE_TASK_SQL; + private static final String FINISHED_TASK_SQL; + + private static final String PROCESS_TASK_BY_ID_SQL; + private static final String DONE_TASK_BY_ID_SQL; + private static final String FINISHED_TASK_BY_ID_SQL; + + static { + try { + PROCESS_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyTasks.sql"); + PROCESS_PREFIX_ASSIGNEE_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/ProcessPrefixAssignee.sql"); + DONE_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyDoneTasks.sql"); + FINISHED_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyFinishedTasks.sql"); + + PROCESS_TASK_BY_ID_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/Task.sql"); + DONE_TASK_BY_ID_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/DoneTask.sql"); + FINISHED_TASK_BY_ID_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/FinishedTask.sql"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override public ProcessDefinition queryProcessDefinition(String processDefinitionId) { return repositoryService.getProcessDefinition(processDefinitionId); } @@ -209,574 +231,152 @@ public class ProcessQueryServiceImpl implements ProcessQueryService { } return new PageImpl(wrappers,pageable,total); } - - @Override - public Page queryProcessTasks(QueryParameter queryParameter) throws Exception { - TaskQuery query =taskService.createTaskQuery(); - if(queryParameter!=null && queryParameter.existsCriteria()){ - // 流程定义ID - Criteria processDefinitionIdCriteria =queryParameter.getCriteriaByFieldName("processDefinitionId"); - if(processDefinitionIdCriteria!=null && processDefinitionIdCriteria instanceof Equals){ - Equals _processDefinitionIdCriteria =(Equals)processDefinitionIdCriteria; - query.processDefinitionId(_processDefinitionIdCriteria.getValue()); - } - // 流程实例ID - Criteria processInstanceIdCriteria =queryParameter.getCriteriaByFieldName("processInstanceId"); - if(processInstanceIdCriteria!=null && processInstanceIdCriteria instanceof Equals){ - Equals _processInstanceIdCriteria =(Equals)processInstanceIdCriteria; - query.processInstanceId(_processInstanceIdCriteria.getValue()); - } - // 业务ID - Criteria businessKeyCriteria =queryParameter.getCriteriaByFieldName("businessKey"); - if(businessKeyCriteria!=null && businessKeyCriteria instanceof Equals){ - Equals _businessKeyCriteria =(Equals)businessKeyCriteria; - query.processInstanceBusinessKeyLike("%" + _businessKeyCriteria.getValue() + "%"); - } - // 处理人 - Criteria assigneeCriteria =queryParameter.getCriteriaByFieldName("assignee"); - if(assigneeCriteria!=null && assigneeCriteria instanceof Equals){ - Equals _assigneeCriteria =(Equals)assigneeCriteria; - query.taskAssignee(_assigneeCriteria.getValue()); - } - - // 任务节点 KEY - Criteria taskDefinitionKeyCriteria =queryParameter.getCriteriaByFieldName("taskDefinitionKey"); - if(taskDefinitionKeyCriteria!=null && taskDefinitionKeyCriteria instanceof Equals){ - Equals _taskDefinitionKeyCriteria =(Equals)taskDefinitionKeyCriteria; - query.taskDefinitionKey(_taskDefinitionKeyCriteria.getValue()); - } - // 任务描述 - Criteria taskDescriptionCriteria =queryParameter.getCriteriaByFieldName("description"); - if(taskDescriptionCriteria!=null && taskDescriptionCriteria instanceof Contains){ - Contains _taskDescriptionCriteria =(Contains)taskDescriptionCriteria; - query.taskDescriptionLike("%" + StringUtil.escapeSqlSpecialChar(_taskDescriptionCriteria.getValue()) + "%"); - } - } - if(queryParameter!=null && queryParameter.existsSortBy()){ - Order order =queryParameter.getFirstSort(); - String propertyName =order.getProperty(); - if("id".equals(propertyName)){ - if(order.isDescending()){ - query.orderByTaskId().desc(); - }else { - query.orderByTaskId().asc(); - } - }else if("assignee".equals(propertyName)){ - if(order.isDescending()){ - query.orderByTaskAssignee().desc(); - }else { - query.orderByTaskAssignee().asc(); - } - }else if("createTime".equals(propertyName)){ - if(order.isDescending()){ - query.orderByTaskCreateTime().desc(); - }else { - query.orderByTaskCreateTime().asc(); - } - }else if("owner".equals(propertyName)){ - if(order.isDescending()){ - query.orderByTaskOwner().desc(); - }else { - query.orderByTaskOwner().asc(); - } - }else if("name".equals(propertyName)){ - if(order.isDescending()){ - query.orderByTaskName().desc(); - }else { - query.orderByTaskName().asc(); - } - } - }else{ - query.orderByTaskCreateTime().desc(); - } - Pageable pageable =queryParameter.getJpaPageable(); - long total =query.count(); - List items =query.listPage((int)pageable.getOffset(),pageable.getPageSize()); - if(!CollectionUtil.hasElements(items)){ + public Page queryProcessTasks(QueryParameter queryParameter) throws Exception { + runtimeService.createProcessInstanceQuery().processInstanceId("").list(); + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("businessDescription",String.class); + String sql =PROCESS_TASK_SQL.replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); + if(page==null || page.isEmpty()){ return QueryResult.emptyPage(); } - - List wrappers =new ArrayList<>(); - Set processIntanceIds =new HashSet<>(); - Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); - for(Task item : items){ - ProcessTaskWrapper wrapper =new ProcessTaskWrapper(); - wrapper.setId(item.getId()); - wrapper.setName(item.getName()); - wrapper.setDescription(item.getDescription()); - wrapper.setPriority(item.getPriority()); - wrapper.setOwner(item.getOwner()); - wrapper.setAssignee(item.getAssignee()); - wrapper.setProcessInstanceId(item.getProcessInstanceId()); - wrapper.setExecutionId(item.getExecutionId()); - wrapper.setProcessDefinitionId(item.getProcessDefinitionId()); - wrapper.setScopeId(item.getScopeId()); - wrapper.setSubScopeId(item.getSubScopeId()); - wrapper.setScopeType(item.getScopeType()); - wrapper.setScopeDefinitionId(item.getScopeDefinitionId()); - wrapper.setCreateTime(item.getCreateTime()); - wrapper.setTaskDefinitionKey(item.getTaskDefinitionKey()); - wrapper.setDueDate(item.getDueDate()); - wrapper.setCategory(item.getCategory()); - wrapper.setParentTaskId(item.getParentTaskId()); - wrapper.setTenantId(item.getTenantId()); - wrapper.setFormKey(item.getFormKey()); - wrapper.setClaimTime(item.getClaimTime()); - wrappers.add(wrapper); - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(item.getProcessDefinitionId()); - if(processInstanceAndBusinessMap==null){ - processInstanceAndBusinessMap =new HashMap<>(); - processDefineAndInstanceAndBusinessMap.put(item.getProcessDefinitionId(),processInstanceAndBusinessMap); - } - processInstanceAndBusinessMap.put(item.getProcessInstanceId(),new BusinessKeyAndDescription()); - processIntanceIds.add(item.getProcessInstanceId()); + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ + return QueryResult.emptyPage(); } - // 建立流程实例和业务Key的关系 - List processInstances =runtimeService.createProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); - if(CollectionUtil.hasElements(processInstances)) { - for (ProcessInstance processInstance : processInstances) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); - if(processInstanceAndBusinessMap!=null){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); - businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); - businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); - businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); - - List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); - if(CollectionUtil.hasElements(historicTaskInstances)){ - businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); - } - } - } - } + //以下用于设置前一个处理人 + List processInstanceIds =new ArrayList<>(); + for(ProcessTaskWrapper wrapper : wrappers) { + processInstanceIds.add("'" + wrapper.getProcessInstanceId() + "'"); } - - for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); - if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ - continue; - } - ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); - businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); - businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); - businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); - } - } - if(processEntity==null){ - continue; - } - String sql =processEntity.getBusinessDescriptionSql(); - if(!StringUtils.hasText(sql)){ - continue; - } - - Set businessKeys =new HashSet<>(); - for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ - businessKeys.add(entry.getValue().getBusinessKey()); - } - if(!CollectionUtil.hasElements(businessKeys)){ - continue; - } - Map variables =new HashMap<>(); - variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); - sql =StringUtil.format(sql,variables); - List> result =jdbcTemplate.queryForList(sql); - if(!CollectionUtil.hasElements(result)){ - continue; - } - for(Map row : result){ - String bussinessKey =row.get("BUSSINESS_KEY").toString(); - String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ - businessKeyAndDescription.setBusinessDescription(bussinessDescription); - break; + String ins =StringUtil.combine(",",processInstanceIds); + sql =StringUtil.format(PROCESS_PREFIX_ASSIGNEE_SQL,ins).replace("\r"," ").replace("\n"," "); + List list =jdbcTemplate.query(sql,new ProcessTaskAssigneeWrapperMapper()); + if(list!=null && !list.isEmpty()){ + Map prefixAssigneeNames =new HashMap<>(); + for(ProcessTaskAssigneeWrapper item : list){ + prefixAssigneeNames.put(item.getProcessInstanceId(),item); + } + for(ProcessTaskWrapper wrapper : wrappers) { + if(!StringUtils.hasText(wrapper.getPreviousAssignee())){ + wrapper.setPreviousAssignee(SecurityUtil.getLoginName()); + wrapper.setPreviousAssigneeName(SecurityUtil.getUserName()); + }else { + ProcessTaskAssigneeWrapper item = prefixAssigneeNames.get(wrapper.getProcessInstanceId()); + if (item != null) { + wrapper.setPreviousAssignee(item.getAssignee()); + wrapper.setPreviousAssigneeName(item.getAssigneeName()); } } } } - - //合并 - for(ProcessTaskWrapper wrapper : wrappers){ - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); - wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); - wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); - wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); - wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); - wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); - wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); - wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); - wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); - wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); - } - + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); return new PageImpl(wrappers,pageable,total); } @Override + public ProcessTaskWrapper queryProcessTaskById(String taskId) throws Exception { + String sql =PROCESS_TASK_BY_ID_SQL.replace("\r"," ").replace("\n"," "); + sql =StringUtil.format(sql,StringUtil.escapeSqlSpecialChar(taskId),SecurityUtil.getLoginName()); + List wrappers =jdbcTemplate.query(sql,new ProcessTaskWrapperMapper()); + if(wrappers==null || wrappers.isEmpty()){ + return null; + } + return wrappers.get(0); + } + public Page queryDoneProcessTasks(QueryParameter queryParameter) throws Exception { - String loginName =SecurityUtil.getLoginName(); - String taskSql ="" + - "select * from (\n" + - " select * from (\n" + - " select\n" + - " T.ID_ as id,\n" + - " T.NAME_ as name,\n" + - " T.DESCRIPTION_ as description,\n" + - " T.PRIORITY_ as priority,\n" + - " T.OWNER_ as owner,\n" + - " T.ASSIGNEE_ as assignee,\n" + - " T.PROC_INST_ID_ as processInstanceId,\n" + - " T.EXECUTION_ID_ as executionId,\n" + - " T.PROC_DEF_ID_ as processDefinitionId,\n" + - " T.SCOPE_ID_ as scopeId,\n" + - " T.SUB_SCOPE_ID_ as subScopeId,\n" + - " T.SCOPE_TYPE_ as scopeType,\n" + - " T.SCOPE_DEFINITION_ID_ as scopeDefinitionId,\n" + - " T.CREATE_TIME_ as createTime,\n" + - " T.TASK_DEF_KEY_ as taskDefinitionKey,\n" + - " T.DUE_DATE_ as dueDate,\n" + - " T.CATEGORY_ as category,\n" + - " T.PARENT_TASK_ID_ as parentTaskId,\n" + - " T.TENANT_ID_ as tenantId,\n" + - " T.FORM_KEY_ as formKey,\n" + - " T.CLAIM_TIME_ as claimTime,\n" + - " \n" + - " RP.NAME_ as processDefinitionName,\n" + - " RP.VERSION_ as processDefinitionVersion,\n" + - " \n" + - " E.BUSINESS_KEY_ \t as businessKey,\n" + - " \n" + - " HT.START_TIME_ as START_TIME,\n" + - " HT.END_TIME_ as END_TIME,\n" + - " \n" + - " row_number() over(partition by HT.PROC_INST_ID_ order by HT.END_TIME_ desc) as RK\n" + - " from ACT_HI_TASKINST HT\n" + - " join ACT_RU_TASK T on T.PROC_INST_ID_ = HT.PROC_INST_ID_\n" + - " join ACT_RU_EXECUTION E on T.PROC_INST_ID_ = E.ID_\n" + - " left join ACT_RE_PROCDEF RP on HT.PROC_DEF_ID_ = RP.ID_\n" + - " left join SYS_USER U on T.ASSIGNEE_ = U.LOGINNAME_\n" + - " where \n" + - " HT.ASSIGNEE_ ='" + loginName + "' \n" + - " and T.ASSIGNEE_ <> '" + loginName + "' \n" + - " and HT.END_TIME_ is not null\n" + - " ) TMP where TMP.RK = 1\n" + - ") t"; Map> fieldTypeMap =new HashMap<>(); fieldTypeMap.put("processDefinitionId",String.class); fieldTypeMap.put("processInstanceId",String.class); fieldTypeMap.put("businessKey",String.class); fieldTypeMap.put("assignee",String.class); fieldTypeMap.put("taskDefinitionKey",String.class); - fieldTypeMap.put("description",String.class); - Map page =jdbcTemplateService.listBySql(queryParameter,taskSql,fieldTypeMap,new ProcessTaskWrapperMapper()); - - List wrappers =new ArrayList<>(); - Set processIntanceIds =new HashSet<>(); - Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); - + fieldTypeMap.put("businessDescription",String.class); + String sql =StringUtil.format(DONE_TASK_SQL,SecurityUtil.getLoginName()).replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); if(page==null || page.isEmpty()){ return QueryResult.emptyPage(); } - List items =(List)page.get("content"); - if(items==null || items.isEmpty()){ + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ return QueryResult.emptyPage(); } - for(ProcessTaskWrapper item : items){ - ProcessTaskWrapper wrapper =item; - wrappers.add(wrapper); - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); - if(processInstanceAndBusinessMap==null){ - processInstanceAndBusinessMap =new HashMap<>(); - processDefineAndInstanceAndBusinessMap.put(wrapper.getProcessDefinitionId(),processInstanceAndBusinessMap); - } - processInstanceAndBusinessMap.put(wrapper.getProcessInstanceId(),new BusinessKeyAndDescription()); - processIntanceIds.add(wrapper.getProcessInstanceId()); - } - - // 建立流程实例和业务Key的关系 - List processInstances =runtimeService.createProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); - if(CollectionUtil.hasElements(processInstances)) { - for (ProcessInstance processInstance : processInstances) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); - if(processInstanceAndBusinessMap!=null){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); - businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); - businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); - businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } - List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); - if(CollectionUtil.hasElements(historicTaskInstances)){ - businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); - } - } - } - } + @Override + public ProcessTaskWrapper queryDoneProcessTaskById(String taskId) throws Exception { + if(!StringUtils.hasText(taskId)){ + return null; } - - for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); - if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ - continue; - } - ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); - businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); - businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); - businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); - } - } - if(processEntity==null){ - continue; - } - String sql =processEntity.getBusinessDescriptionSql(); - if(!StringUtils.hasText(sql)){ - continue; - } - - Set businessKeys =new HashSet<>(); - for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ - businessKeys.add(entry.getValue().getBusinessKey()); - } - if(!CollectionUtil.hasElements(businessKeys)){ - continue; - } - Map variables =new HashMap<>(); - variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); - sql =StringUtil.format(sql,variables); - List> result =jdbcTemplate.queryForList(sql); - if(!CollectionUtil.hasElements(result)){ - continue; - } - for(Map row : result){ - String bussinessKey =row.get("BUSSINESS_KEY").toString(); - String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ - businessKeyAndDescription.setBusinessDescription(bussinessDescription); - break; - } - } - } + List hisTasks =historyService.createHistoricTaskInstanceQuery().taskId(taskId).list(); + if(hisTasks==null || hisTasks.isEmpty()){ + return null; } - - //合并 - for(ProcessTaskWrapper wrapper : wrappers){ - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); - wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); - wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); - wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); - wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); - wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); - wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); - wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); - wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); - wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); + HistoricTaskInstance hisTask =hisTasks.get(0); + String sql =DONE_TASK_BY_ID_SQL.replace("\r"," ").replace("\n"," "); + sql =StringUtil.format(sql,StringUtil.escapeSqlSpecialChar(hisTask.getProcessInstanceId())); + List wrappers =jdbcTemplate.query(sql,new ProcessTaskWrapperMapper()); + if(wrappers==null || wrappers.isEmpty()){ + return null; } - - Pageable pageable =queryParameter.getJpaPageable(); - long total =Long.parseLong(page.get("totalElements").toString()); - return new PageImpl(wrappers,pageable,total); + return wrappers.get(0); } @Override public Page queryFinishedProcessTasks(QueryParameter queryParameter) throws Exception { - String loginName =SecurityUtil.getLoginName(); - String taskSql ="" + - "select * from (\n" + - " select * from (\n" + - " select \n" + - " ht.ID_ as id,\n" + - " ht.NAME_ as name,\n" + - " ht.DESCRIPTION_ as description,\n" + - " ht.PRIORITY_ as priority,\n" + - " ht.OWNER_ as owner,\n" + - " ht.ASSIGNEE_ as assignee,\n" + - " ht.PROC_INST_ID_ as processInstanceId,\n" + - " ht.EXECUTION_ID_ as executionId,\n" + - " ht.PROC_DEF_ID_ as processDefinitionId,\n" + - " ht.SCOPE_ID_ as scopeId,\n" + - " ht.SUB_SCOPE_ID_ as subScopeId,\n" + - " ht.SCOPE_TYPE_ as scopeType,\n" + - " ht.SCOPE_DEFINITION_ID_ as scopeDefinitionId,\n" + - " -- ht.CREATE_TIME_ as createTime,\n" + - " ht.TASK_DEF_KEY_ as taskDefinitionKey,\n" + - " ht.DUE_DATE_ as dueDate,\n" + - " ht.CATEGORY_ as category,\n" + - " ht.PARENT_TASK_ID_ as parentTaskId,\n" + - " ht.TENANT_ID_ as tenantId,\n" + - " ht.FORM_KEY_ as formKey,\n" + - " ht.CLAIM_TIME_ as claimTime,\n" + - " \n" + - " ht.START_TIME_ as createTime,\n" + - " ht.END_TIME_ as END_TIME,\n" + - " \n" + - " rp.NAME_ as processDefinitionName,\n" + - " rp.VERSION_ as processDefinitionVersion,\n" + - " \n" + - " e.BUSINESS_KEY_ \t as businessKey,\n" + - " \n" + - " row_number() over(partition by ht.proc_inst_id_ order by ht.end_time_ desc) as rk\n" + - " from ACT_HI_TASKINST ht\n" + - " left join ACT_RE_PROCDEF rp on ht.proc_def_id_ = rp.id_\n" + - " join ACT_HI_PROCINST e on ht.proc_inst_id_ = e.PROC_INST_ID_\n" + - " left join sys_user u on ht.assignee_ = u.loginname_\n" + - " where \n" + - " exists (\n" + - " select 1 from ACT_HI_TASKINST aht \n" + - " where \n" + - " aht.ASSIGNEE_ = '" + loginName + "' \n" + - " and aht.end_time_ is not null\n" + - " and exists (\n" + - " select 1 from ACT_HI_PROCINST hp \n" + - " where \n" + - " hp.end_time_ is not null \n" + - " and hp.end_act_id_ is not null \n" + - " and hp.proc_inst_id_ = ht.proc_inst_id_\n" + - " ) \n" + - " and aht.proc_inst_id_ = ht.proc_inst_id_\n" + - " )\n" + - " ) tmp where tmp.rk = 1\n" + - ") t"; Map> fieldTypeMap =new HashMap<>(); fieldTypeMap.put("processDefinitionId",String.class); fieldTypeMap.put("processInstanceId",String.class); fieldTypeMap.put("businessKey",String.class); fieldTypeMap.put("assignee",String.class); fieldTypeMap.put("taskDefinitionKey",String.class); - fieldTypeMap.put("description",String.class); - Map page =jdbcTemplateService.listBySql(queryParameter,taskSql,fieldTypeMap,new ProcessTaskWrapperMapper()); - - List wrappers =new ArrayList<>(); - Set processIntanceIds =new HashSet<>(); - Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); - + fieldTypeMap.put("businessDescription",String.class); + String sql =StringUtil.format(FINISHED_TASK_SQL,SecurityUtil.getLoginName()).replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); if(page==null || page.isEmpty()){ return QueryResult.emptyPage(); } - List items =(List)page.get("content"); - if(items==null || items.isEmpty()){ + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ return QueryResult.emptyPage(); } - for(ProcessTaskWrapper item : items){ - ProcessTaskWrapper wrapper =item; - wrappers.add(wrapper); - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); - if(processInstanceAndBusinessMap==null){ - processInstanceAndBusinessMap =new HashMap<>(); - processDefineAndInstanceAndBusinessMap.put(wrapper.getProcessDefinitionId(),processInstanceAndBusinessMap); - } - processInstanceAndBusinessMap.put(wrapper.getProcessInstanceId(),new BusinessKeyAndDescription()); - processIntanceIds.add(wrapper.getProcessInstanceId()); - } - - // 建立流程实例和业务Key的关系 - List processInstances =historyService.createHistoricProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); - if(CollectionUtil.hasElements(processInstances)) { - for (HistoricProcessInstance processInstance : processInstances) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); - if(processInstanceAndBusinessMap!=null){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); - businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); - businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); - businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } - List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); - if(CollectionUtil.hasElements(historicTaskInstances)){ - businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); - } - } - } - } + @Override + public ProcessTaskWrapper queryFinishedProcessTaskById(String taskId) throws Exception { + if(!StringUtils.hasText(taskId)){ + return null; } - - for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); - if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ - continue; - } - ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription!=null){ - businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); - businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); - businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); - businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); - } - } - if(processEntity==null){ - continue; - } - String sql =processEntity.getBusinessDescriptionSql(); - if(!StringUtils.hasText(sql)){ - continue; - } - - Set businessKeys =new HashSet<>(); - for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ - businessKeys.add(entry.getValue().getBusinessKey()); - } - if(!CollectionUtil.hasElements(businessKeys)){ - continue; - } - Map variables =new HashMap<>(); - variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); - sql =StringUtil.format(sql,variables); - List> result =jdbcTemplate.queryForList(sql); - if(!CollectionUtil.hasElements(result)){ - continue; - } - for(Map row : result){ - String bussinessKey =row.get("BUSSINESS_KEY").toString(); - String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); - for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); - if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ - businessKeyAndDescription.setBusinessDescription(bussinessDescription); - break; - } - } - } + List hisTasks =historyService.createHistoricTaskInstanceQuery().taskId(taskId).list(); + if(hisTasks==null || hisTasks.isEmpty()){ + return null; } - - //合并 - for(ProcessTaskWrapper wrapper : wrappers){ - Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); - BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); - wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); - wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); - wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); - wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); - wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); - wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); - wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); - wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); - wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); + HistoricTaskInstance hisTask =hisTasks.get(0); + String sql =FINISHED_TASK_BY_ID_SQL.replace("\r"," ").replace("\n"," "); + sql =StringUtil.format(sql,StringUtil.escapeSqlSpecialChar(hisTask.getProcessInstanceId())); + List wrappers =jdbcTemplate.query(sql,new ProcessTaskWrapperMapper()); + if(wrappers==null || wrappers.isEmpty()){ + return null; } - - Pageable pageable =queryParameter.getJpaPageable(); - long total =Long.parseLong(page.get("totalElements").toString()); - return new PageImpl(wrappers,pageable,total); + return wrappers.get(0); } @Override diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl2.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl2.java new file mode 100644 index 00000000..6a93f49e --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/service/impl/ProcessQueryServiceImpl2.java @@ -0,0 +1,968 @@ +package io.sc.platform.flowable.service.impl; + +import io.sc.platform.flowable.jpa.entity.ProcessEntity; +import io.sc.platform.flowable.service.AssigneeQueryService; +import io.sc.platform.flowable.service.ProcessEntityService; +import io.sc.platform.flowable.service.ProcessQueryService; +import io.sc.platform.flowable.support.*; +import io.sc.platform.jdbc.sql.dialect.Dialect; +import io.sc.platform.lcdp.form.service.JdbcTemplateService; +import io.sc.platform.orm.service.support.QueryParameter; +import io.sc.platform.orm.service.support.QueryResult; +import io.sc.platform.orm.service.support.criteria.Criteria; +import io.sc.platform.orm.service.support.criteria.impl.Contains; +import io.sc.platform.orm.service.support.criteria.impl.Equals; +import io.sc.platform.security.util.SecurityUtil; +import io.sc.platform.util.CollectionUtil; +import io.sc.platform.util.FileUtil; +import io.sc.platform.util.StringUtil; +import org.flowable.bpmn.model.BpmnModel; +import org.flowable.bpmn.model.EndEvent; +import org.flowable.bpmn.model.FlowElement; +import org.flowable.bpmn.model.UserTask; +import org.flowable.engine.HistoryService; +import org.flowable.engine.RepositoryService; +import org.flowable.engine.RuntimeService; +import org.flowable.engine.TaskService; +import org.flowable.engine.history.HistoricProcessInstance; +import org.flowable.engine.repository.ProcessDefinition; +import org.flowable.engine.runtime.ProcessInstance; +import org.flowable.engine.runtime.ProcessInstanceQuery; +import org.flowable.image.impl.DefaultProcessDiagramGenerator; +import org.flowable.task.api.Task; +import org.flowable.task.api.TaskQuery; +import org.flowable.task.api.history.HistoricTaskInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Order; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +//@Service("io.sc.platform.flowable.service.impl.ProcessQueryServiceImpl") +public class ProcessQueryServiceImpl2 implements ProcessQueryService { + @Autowired private RepositoryService repositoryService; + @Autowired private TaskService taskService; + @Autowired private ProcessEntityService processEntityService; + @Autowired private HistoryService historyService; + @Autowired private RuntimeService runtimeService; + @Autowired private JdbcTemplateService jdbcTemplateService; + + @Autowired + @Qualifier("io.sc.platform.flowable.service.impl.AssigneeQueryServiceImpl") + private AssigneeQueryService assigneeQueryService; + + @Autowired private Dialect dialect; + @Autowired private JdbcTemplate jdbcTemplate; + + private static final String PROCESS_TASK_SQL; + private static final String PROCESS_PREFIX_ASSIGNEE_SQL; + private static final String DONE_TASK_SQL; + private static final String FINISHED_TASK_SQL; + + static { + try { + PROCESS_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyTasks.sql"); + PROCESS_PREFIX_ASSIGNEE_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/ProcessPrefixAssignee.sql"); + DONE_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyDoneTasks.sql"); + FINISHED_TASK_SQL = FileUtil.readString("classpath:/io/sc/platform/flowable/service/impl/sql/MyFinishedTasks.sql"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public ProcessDefinition queryProcessDefinition(String processDefinitionId) { + return repositoryService.getProcessDefinition(processDefinitionId); + } + + @Override + public InputStream showProcessDiagramByInstanceId(String processInstanceId) throws Exception { + List tasks =taskService.createTaskQuery().processInstanceId(processInstanceId).list(); + return showProcessDiagram(tasks); + } + + @Override + public InputStream showProcessDiagramByTaskId(String taskId) throws Exception { + List tasks =taskService.createTaskQuery().taskId(taskId).list(); + return showProcessDiagram(tasks); + } + + private InputStream showProcessDiagram(List tasks) { + if(tasks!=null && tasks.size()>0){ + String procDefinitionId =tasks.get(0).getProcessDefinitionId(); + BpmnModel model = repositoryService.getBpmnModel(procDefinitionId); + + List taskDefinitionKeys =new ArrayList(); + for(Task task : tasks) { + taskDefinitionKeys.add(task.getTaskDefinitionKey()); + } + List highLightedActivities =getHighLightedActivities(model,taskDefinitionKeys); + DefaultProcessDiagramGenerator defaultProcessDiagramGenerator = new DefaultProcessDiagramGenerator(); + return defaultProcessDiagramGenerator.generateDiagram(model,"PNG",highLightedActivities,Collections.emptyList(),"宋体","宋体","宋体",null,1.0,true); + } + return null; + } + + private List getHighLightedActivities(BpmnModel model,List taskDefinitionKeys){ + if(model!=null && taskDefinitionKeys!=null) { + List result =new ArrayList(); + Collection elements =model.getMainProcess().getFlowElements(); + if(elements!=null && elements.size()>0){ + for(FlowElement element : elements){ + for(String taskDefinitionKey : taskDefinitionKeys) { + if(taskDefinitionKey.equals(element.getId())){ + result.add(element.getId()); + break; + } + } + } + } + return result; + } + return Collections.emptyList(); + } + + @Override + public Page queryProcessInstances(QueryParameter queryParameter) throws Exception { + ProcessInstanceQuery query =runtimeService.createProcessInstanceQuery(); + if(queryParameter!=null && queryParameter.existsCriteria()){ + // 流程定义ID + Criteria processDefinitionIdCriteria =queryParameter.getCriteriaByFieldName("processDefinitionId"); + if(processDefinitionIdCriteria!=null && processDefinitionIdCriteria instanceof Equals){ + Equals _processDefinitionIdCriteria =(Equals)processDefinitionIdCriteria; + query.processDefinitionId(_processDefinitionIdCriteria.getValue()); + } + // 流程实例ID + Criteria processInstanceIdCriteria =queryParameter.getCriteriaByFieldName("processInstanceId"); + if(processInstanceIdCriteria!=null && processInstanceIdCriteria instanceof Equals){ + Equals _processInstanceIdCriteria =(Equals)processInstanceIdCriteria; + query.processInstanceId(_processInstanceIdCriteria.getValue()); + } + // 业务ID + Criteria businessKeyCriteria =queryParameter.getCriteriaByFieldName("businessKey"); + if(businessKeyCriteria!=null && businessKeyCriteria instanceof Equals){ + Equals _businessKeyCriteria =(Equals)businessKeyCriteria; + query.processInstanceBusinessKeyLike("%" + _businessKeyCriteria.getValue() + "%"); + } + // 创建人 + Criteria startUserIdCriteria =queryParameter.getCriteriaByFieldName("startUserId"); + if(startUserIdCriteria!=null && startUserIdCriteria instanceof Equals){ + Equals _startUserIdCriteria =(Equals)startUserIdCriteria; + query.startedBy(_startUserIdCriteria.getValue()); + } + // 是否挂起 + Criteria suspendedCriteria =queryParameter.getCriteriaByFieldName("suspended"); + if(suspendedCriteria!=null && suspendedCriteria instanceof Equals){ + Equals _suspendedCriteria =(Equals)suspendedCriteria; + if("true".equals(_suspendedCriteria.getValue())) { + query.suspended(); + } + } + } + if(queryParameter!=null && queryParameter.existsSortBy()){ + Order order =queryParameter.getFirstSort(); + String propertyName =order.getProperty(); + if("id".equals(propertyName)){ + if(order.isDescending()){ + query.orderByProcessInstanceId().desc(); + }else { + query.orderByProcessInstanceId().asc(); + } + }else if("processDefinitionId".equals(propertyName)){ + if(order.isDescending()){ + query.orderByProcessDefinitionId().desc(); + }else { + query.orderByProcessDefinitionId().asc(); + } + }else if("processDefinitionKey".equals(propertyName)){ + if(order.isDescending()){ + query.orderByProcessDefinitionKey().desc(); + }else { + query.orderByProcessDefinitionKey().asc(); + } + }else if("startTime".equals(propertyName)){ + if(order.isDescending()){ + query.orderByStartTime().desc(); + }else { + query.orderByStartTime().asc(); + } + } + } + Pageable pageable =queryParameter.getJpaPageable(); + long total =query.count(); + List items =query.listPage((int)pageable.getOffset(),pageable.getPageSize()); + if(!CollectionUtil.hasElements(items)){ + return QueryResult.emptyPage(); + } + + List wrappers =new ArrayList<>(); + for(ProcessInstance item : items){ + ProcessInstanceWrapper wrapper =new ProcessInstanceWrapper(); + wrapper.setId(item.getId()); + wrapper.setName(item.getName()); + wrapper.setLocalizedName(item.getLocalizedName()); + wrapper.setDescription(item.getDescription()); + wrapper.setLocalizedDescription(item.getLocalizedDescription()); + wrapper.setBusinessKey(item.getBusinessKey()); + wrapper.setStartTime(item.getStartTime()); + wrapper.setStartUserId(item.getStartUserId()); + wrapper.setSuspended(item.isSuspended()); + wrapper.setCallbackId(item.getCallbackId()); + wrapper.setCallbackType(item.getCallbackType()); + wrapper.setProcessVariables(item.getProcessVariables()); + wrapper.setProcessDefinitionId(item.getProcessDefinitionId()); + wrapper.setProcessDefinitionName(item.getProcessDefinitionName()); + wrapper.setProcessDefinitionKey(item.getProcessDefinitionKey()); + wrapper.setProcessDefinitionVersion(item.getProcessDefinitionVersion()); + wrappers.add(wrapper); + } + return new PageImpl(wrappers,pageable,total); + } + + public Page queryProcessTasks(QueryParameter queryParameter) throws Exception { + runtimeService.createProcessInstanceQuery().processInstanceId("").list(); + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("businessDescription",String.class); + String sql =PROCESS_TASK_SQL.replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); + if(page==null || page.isEmpty()){ + return QueryResult.emptyPage(); + } + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ + return QueryResult.emptyPage(); + } + + //以下用于设置前一个处理人 + List processInstanceIds =new ArrayList<>(); + for(ProcessTaskWrapper wrapper : wrappers) { + processInstanceIds.add("'" + wrapper.getProcessInstanceId() + "'"); + } + String ins =StringUtil.combine(",",processInstanceIds); + sql =StringUtil.format(PROCESS_PREFIX_ASSIGNEE_SQL,ins).replace("\r"," ").replace("\n"," "); + List list =jdbcTemplate.query(sql,new ProcessTaskAssigneeWrapperMapper()); + if(list!=null && !list.isEmpty()){ + Map prefixAssigneeNames =new HashMap<>(); + for(ProcessTaskAssigneeWrapper item : list){ + prefixAssigneeNames.put(item.getProcessInstanceId(),item); + } + for(ProcessTaskWrapper wrapper : wrappers) { + if(!StringUtils.hasText(wrapper.getPreviousAssignee())){ + wrapper.setPreviousAssignee(SecurityUtil.getLoginName()); + wrapper.setPreviousAssigneeName(SecurityUtil.getUserName()); + }else { + ProcessTaskAssigneeWrapper item = prefixAssigneeNames.get(wrapper.getProcessInstanceId()); + if (item != null) { + wrapper.setPreviousAssignee(item.getAssignee()); + wrapper.setPreviousAssigneeName(item.getAssigneeName()); + } + } + } + } + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } + + public Page queryProcessTasks2(QueryParameter queryParameter) throws Exception { + TaskQuery query =taskService.createTaskQuery(); + if(queryParameter!=null && queryParameter.existsCriteria()){ + // 流程定义ID + Criteria processDefinitionIdCriteria =queryParameter.getCriteriaByFieldName("processDefinitionId"); + if(processDefinitionIdCriteria!=null && processDefinitionIdCriteria instanceof Equals){ + Equals _processDefinitionIdCriteria =(Equals)processDefinitionIdCriteria; + query.processDefinitionId(_processDefinitionIdCriteria.getValue()); + } + // 流程实例ID + Criteria processInstanceIdCriteria =queryParameter.getCriteriaByFieldName("processInstanceId"); + if(processInstanceIdCriteria!=null && processInstanceIdCriteria instanceof Equals){ + Equals _processInstanceIdCriteria =(Equals)processInstanceIdCriteria; + query.processInstanceId(_processInstanceIdCriteria.getValue()); + } + // 业务ID + Criteria businessKeyCriteria =queryParameter.getCriteriaByFieldName("businessKey"); + if(businessKeyCriteria!=null && businessKeyCriteria instanceof Equals){ + Equals _businessKeyCriteria =(Equals)businessKeyCriteria; + query.processInstanceBusinessKeyLike("%" + _businessKeyCriteria.getValue() + "%"); + } + // 处理人 + Criteria assigneeCriteria =queryParameter.getCriteriaByFieldName("assignee"); + if(assigneeCriteria!=null && assigneeCriteria instanceof Equals){ + Equals _assigneeCriteria =(Equals)assigneeCriteria; + query.taskAssignee(_assigneeCriteria.getValue()); + } + + // 任务节点 KEY + Criteria taskDefinitionKeyCriteria =queryParameter.getCriteriaByFieldName("taskDefinitionKey"); + if(taskDefinitionKeyCriteria!=null && taskDefinitionKeyCriteria instanceof Equals){ + Equals _taskDefinitionKeyCriteria =(Equals)taskDefinitionKeyCriteria; + query.taskDefinitionKey(_taskDefinitionKeyCriteria.getValue()); + } + + // 任务描述 + Criteria taskDescriptionCriteria =queryParameter.getCriteriaByFieldName("description"); + if(taskDescriptionCriteria!=null && taskDescriptionCriteria instanceof Contains){ + Contains _taskDescriptionCriteria =(Contains)taskDescriptionCriteria; + query.taskDescriptionLike("%" + StringUtil.escapeSqlSpecialChar(_taskDescriptionCriteria.getValue()) + "%"); + } + } + if(queryParameter!=null && queryParameter.existsSortBy()){ + Order order =queryParameter.getFirstSort(); + String propertyName =order.getProperty(); + if("id".equals(propertyName)){ + if(order.isDescending()){ + query.orderByTaskId().desc(); + }else { + query.orderByTaskId().asc(); + } + }else if("assignee".equals(propertyName)){ + if(order.isDescending()){ + query.orderByTaskAssignee().desc(); + }else { + query.orderByTaskAssignee().asc(); + } + }else if("createTime".equals(propertyName)){ + if(order.isDescending()){ + query.orderByTaskCreateTime().desc(); + }else { + query.orderByTaskCreateTime().asc(); + } + }else if("owner".equals(propertyName)){ + if(order.isDescending()){ + query.orderByTaskOwner().desc(); + }else { + query.orderByTaskOwner().asc(); + } + }else if("name".equals(propertyName)){ + if(order.isDescending()){ + query.orderByTaskName().desc(); + }else { + query.orderByTaskName().asc(); + } + } + }else{ + query.orderByTaskCreateTime().desc(); + } + Pageable pageable =queryParameter.getJpaPageable(); + long total =query.count(); + List items =query.listPage((int)pageable.getOffset(),pageable.getPageSize()); + if(!CollectionUtil.hasElements(items)){ + return QueryResult.emptyPage(); + } + + List wrappers =new ArrayList<>(); + Set processIntanceIds =new HashSet<>(); + Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); + for(Task item : items){ + ProcessTaskWrapper wrapper =new ProcessTaskWrapper(); + wrapper.setId(item.getId()); + wrapper.setName(item.getName()); + wrapper.setDescription(item.getDescription()); + wrapper.setPriority(item.getPriority()); + wrapper.setOwner(item.getOwner()); + wrapper.setAssignee(item.getAssignee()); + wrapper.setProcessInstanceId(item.getProcessInstanceId()); + wrapper.setExecutionId(item.getExecutionId()); + wrapper.setProcessDefinitionId(item.getProcessDefinitionId()); + wrapper.setScopeId(item.getScopeId()); + wrapper.setSubScopeId(item.getSubScopeId()); + wrapper.setScopeType(item.getScopeType()); + wrapper.setScopeDefinitionId(item.getScopeDefinitionId()); + wrapper.setStartTime(item.getCreateTime()); + wrapper.setTaskDefinitionKey(item.getTaskDefinitionKey()); + wrapper.setDueDate(item.getDueDate()); + wrapper.setCategory(item.getCategory()); + wrapper.setParentTaskId(item.getParentTaskId()); + wrapper.setTenantId(item.getTenantId()); + wrapper.setFormKey(item.getFormKey()); + wrapper.setClaimTime(item.getClaimTime()); + wrappers.add(wrapper); + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(item.getProcessDefinitionId()); + if(processInstanceAndBusinessMap==null){ + processInstanceAndBusinessMap =new HashMap<>(); + processDefineAndInstanceAndBusinessMap.put(item.getProcessDefinitionId(),processInstanceAndBusinessMap); + } + processInstanceAndBusinessMap.put(item.getProcessInstanceId(),new BusinessKeyAndDescription()); + processIntanceIds.add(item.getProcessInstanceId()); + } + + // 建立流程实例和业务Key的关系 + List processInstances =runtimeService.createProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); + if(CollectionUtil.hasElements(processInstances)) { + for (ProcessInstance processInstance : processInstances) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); + if(processInstanceAndBusinessMap!=null){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); + businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); + businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); + businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); + + List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); + if(CollectionUtil.hasElements(historicTaskInstances)){ + businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); + } + } + } + } + } + + for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); + if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ + continue; + } + ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); + businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); + businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); + businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); + } + } + if(processEntity==null){ + continue; + } + String sql =processEntity.getBusinessDescriptionSql(); + if(!StringUtils.hasText(sql)){ + continue; + } + + Set businessKeys =new HashSet<>(); + for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ + businessKeys.add(entry.getValue().getBusinessKey()); + } + if(!CollectionUtil.hasElements(businessKeys)){ + continue; + } + Map variables =new HashMap<>(); + variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); + sql =StringUtil.format(sql,variables); + List> result =jdbcTemplate.queryForList(sql); + if(!CollectionUtil.hasElements(result)){ + continue; + } + for(Map row : result){ + String bussinessKey =row.get("BUSSINESS_KEY").toString(); + String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ + businessKeyAndDescription.setBusinessDescription(bussinessDescription); + break; + } + } + } + } + + //合并 + for(ProcessTaskWrapper wrapper : wrappers){ + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); + wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); + wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); + wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); + wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); + wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); + wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); + wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); + wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); + wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); + } + + return new PageImpl(wrappers,pageable,total); + } + + public Page queryDoneProcessTasks(QueryParameter queryParameter) throws Exception { + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("businessDescription",String.class); + String sql =StringUtil.format(DONE_TASK_SQL,SecurityUtil.getLoginName()).replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); + if(page==null || page.isEmpty()){ + return QueryResult.emptyPage(); + } + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ + return QueryResult.emptyPage(); + } + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } + + //@Override + public Page queryDoneProcessTasks2(QueryParameter queryParameter) throws Exception { + String loginName =SecurityUtil.getLoginName(); + String taskSql ="" + + "select * from (\n" + + " select * from (\n" + + " select\n" + + " T.ID_ as id,\n" + + " T.NAME_ as name,\n" + + " T.DESCRIPTION_ as description,\n" + + " T.PRIORITY_ as priority,\n" + + " T.OWNER_ as owner,\n" + + " T.ASSIGNEE_ as assignee,\n" + + " T.PROC_INST_ID_ as processInstanceId,\n" + + " T.EXECUTION_ID_ as executionId,\n" + + " T.PROC_DEF_ID_ as processDefinitionId,\n" + + " T.SCOPE_ID_ as scopeId,\n" + + " T.SUB_SCOPE_ID_ as subScopeId,\n" + + " T.SCOPE_TYPE_ as scopeType,\n" + + " T.SCOPE_DEFINITION_ID_ as scopeDefinitionId,\n" + + " T.CREATE_TIME_ as createTime,\n" + + " T.TASK_DEF_KEY_ as taskDefinitionKey,\n" + + " T.DUE_DATE_ as dueDate,\n" + + " T.CATEGORY_ as category,\n" + + " T.PARENT_TASK_ID_ as parentTaskId,\n" + + " T.TENANT_ID_ as tenantId,\n" + + " T.FORM_KEY_ as formKey,\n" + + " T.CLAIM_TIME_ as claimTime,\n" + + " \n" + + " RP.NAME_ as processDefinitionName,\n" + + " RP.VERSION_ as processDefinitionVersion,\n" + + " \n" + + " E.BUSINESS_KEY_ \t as businessKey,\n" + + " \n" + + " HT.START_TIME_ as START_TIME,\n" + + " HT.END_TIME_ as END_TIME,\n" + + " \n" + + " row_number() over(partition by HT.PROC_INST_ID_ order by HT.END_TIME_ desc) as RK\n" + + " from ACT_HI_TASKINST HT\n" + + " join ACT_RU_TASK T on T.PROC_INST_ID_ = HT.PROC_INST_ID_\n" + + " join ACT_RU_EXECUTION E on T.PROC_INST_ID_ = E.ID_\n" + + " left join ACT_RE_PROCDEF RP on HT.PROC_DEF_ID_ = RP.ID_\n" + + " left join SYS_USER U on T.ASSIGNEE_ = U.LOGINNAME_\n" + + " where \n" + + " HT.ASSIGNEE_ ='" + loginName + "' \n" + + " and T.ASSIGNEE_ <> '" + loginName + "' \n" + + " and HT.END_TIME_ is not null\n" + + " ) TMP where TMP.RK = 1\n" + + ") t"; + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("description",String.class); + Map page =jdbcTemplateService.listBySql(queryParameter,taskSql,fieldTypeMap,new ProcessTaskWrapperMapper()); + + List wrappers =new ArrayList<>(); + Set processIntanceIds =new HashSet<>(); + Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); + + if(page==null || page.isEmpty()){ + return QueryResult.emptyPage(); + } + List items =(List)page.get("content"); + if(items==null || items.isEmpty()){ + return QueryResult.emptyPage(); + } + for(ProcessTaskWrapper item : items){ + ProcessTaskWrapper wrapper =item; + wrappers.add(wrapper); + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); + if(processInstanceAndBusinessMap==null){ + processInstanceAndBusinessMap =new HashMap<>(); + processDefineAndInstanceAndBusinessMap.put(wrapper.getProcessDefinitionId(),processInstanceAndBusinessMap); + } + processInstanceAndBusinessMap.put(wrapper.getProcessInstanceId(),new BusinessKeyAndDescription()); + processIntanceIds.add(wrapper.getProcessInstanceId()); + } + + // 建立流程实例和业务Key的关系 + List processInstances =runtimeService.createProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); + if(CollectionUtil.hasElements(processInstances)) { + for (ProcessInstance processInstance : processInstances) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); + if(processInstanceAndBusinessMap!=null){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); + businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); + businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); + businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); + + List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); + if(CollectionUtil.hasElements(historicTaskInstances)){ + businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); + } + } + } + } + } + + for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); + if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ + continue; + } + ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); + businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); + businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); + businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); + } + } + if(processEntity==null){ + continue; + } + String sql =processEntity.getBusinessDescriptionSql(); + if(!StringUtils.hasText(sql)){ + continue; + } + + Set businessKeys =new HashSet<>(); + for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ + businessKeys.add(entry.getValue().getBusinessKey()); + } + if(!CollectionUtil.hasElements(businessKeys)){ + continue; + } + Map variables =new HashMap<>(); + variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); + sql =StringUtil.format(sql,variables); + List> result =jdbcTemplate.queryForList(sql); + if(!CollectionUtil.hasElements(result)){ + continue; + } + for(Map row : result){ + String bussinessKey =row.get("BUSSINESS_KEY").toString(); + String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ + businessKeyAndDescription.setBusinessDescription(bussinessDescription); + break; + } + } + } + } + + //合并 + for(ProcessTaskWrapper wrapper : wrappers){ + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); + wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); + wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); + wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); + wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); + wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); + wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); + wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); + wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); + wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); + } + + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } + + @Override + public Page queryFinishedProcessTasks(QueryParameter queryParameter) throws Exception { + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("businessDescription",String.class); + String sql =StringUtil.format(FINISHED_TASK_SQL,SecurityUtil.getLoginName()).replace("\r"," ").replace("\n"," "); + Map page =jdbcTemplateService.listBySql(queryParameter,sql,fieldTypeMap,new ProcessTaskWrapperMapper()); + if(page==null || page.isEmpty()){ + return QueryResult.emptyPage(); + } + List wrappers =(List)page.get("content"); + if(wrappers==null || wrappers.isEmpty()){ + return QueryResult.emptyPage(); + } + //构建结果返回 + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } + + //@Override + public Page queryFinishedProcessTasks2(QueryParameter queryParameter) throws Exception { + String loginName =SecurityUtil.getLoginName(); + String taskSql ="" + + "select * from (\n" + + " select * from (\n" + + " select \n" + + " ht.ID_ as id,\n" + + " ht.NAME_ as name,\n" + + " ht.DESCRIPTION_ as description,\n" + + " ht.PRIORITY_ as priority,\n" + + " ht.OWNER_ as owner,\n" + + " ht.ASSIGNEE_ as assignee,\n" + + " ht.PROC_INST_ID_ as processInstanceId,\n" + + " ht.EXECUTION_ID_ as executionId,\n" + + " ht.PROC_DEF_ID_ as processDefinitionId,\n" + + " ht.SCOPE_ID_ as scopeId,\n" + + " ht.SUB_SCOPE_ID_ as subScopeId,\n" + + " ht.SCOPE_TYPE_ as scopeType,\n" + + " ht.SCOPE_DEFINITION_ID_ as scopeDefinitionId,\n" + + " -- ht.CREATE_TIME_ as createTime,\n" + + " ht.TASK_DEF_KEY_ as taskDefinitionKey,\n" + + " ht.DUE_DATE_ as dueDate,\n" + + " ht.CATEGORY_ as category,\n" + + " ht.PARENT_TASK_ID_ as parentTaskId,\n" + + " ht.TENANT_ID_ as tenantId,\n" + + " ht.FORM_KEY_ as formKey,\n" + + " ht.CLAIM_TIME_ as claimTime,\n" + + " \n" + + " ht.START_TIME_ as createTime,\n" + + " ht.END_TIME_ as END_TIME,\n" + + " \n" + + " rp.NAME_ as processDefinitionName,\n" + + " rp.VERSION_ as processDefinitionVersion,\n" + + " \n" + + " e.BUSINESS_KEY_ \t as businessKey,\n" + + " \n" + + " row_number() over(partition by ht.proc_inst_id_ order by ht.end_time_ desc) as rk\n" + + " from ACT_HI_TASKINST ht\n" + + " left join ACT_RE_PROCDEF rp on ht.proc_def_id_ = rp.id_\n" + + " join ACT_HI_PROCINST e on ht.proc_inst_id_ = e.PROC_INST_ID_\n" + + " left join sys_user u on ht.assignee_ = u.loginname_\n" + + " where \n" + + " exists (\n" + + " select 1 from ACT_HI_TASKINST aht \n" + + " where \n" + + " aht.ASSIGNEE_ = '" + loginName + "' \n" + + " and aht.end_time_ is not null\n" + + " and exists (\n" + + " select 1 from ACT_HI_PROCINST hp \n" + + " where \n" + + " hp.end_time_ is not null \n" + + " and hp.end_act_id_ is not null \n" + + " and hp.proc_inst_id_ = ht.proc_inst_id_\n" + + " ) \n" + + " and aht.proc_inst_id_ = ht.proc_inst_id_\n" + + " )\n" + + " ) tmp where tmp.rk = 1\n" + + ") t"; + Map> fieldTypeMap =new HashMap<>(); + fieldTypeMap.put("processDefinitionId",String.class); + fieldTypeMap.put("processInstanceId",String.class); + fieldTypeMap.put("businessKey",String.class); + fieldTypeMap.put("assignee",String.class); + fieldTypeMap.put("taskDefinitionKey",String.class); + fieldTypeMap.put("description",String.class); + Map page =jdbcTemplateService.listBySql(queryParameter,taskSql,fieldTypeMap,new ProcessTaskWrapperMapper()); + + List wrappers =new ArrayList<>(); + Set processIntanceIds =new HashSet<>(); + Map> processDefineAndInstanceAndBusinessMap =new HashMap<>(); + + if(page==null || page.isEmpty()){ + return QueryResult.emptyPage(); + } + List items =(List)page.get("content"); + if(items==null || items.isEmpty()){ + return QueryResult.emptyPage(); + } + for(ProcessTaskWrapper item : items){ + ProcessTaskWrapper wrapper =item; + wrappers.add(wrapper); + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); + if(processInstanceAndBusinessMap==null){ + processInstanceAndBusinessMap =new HashMap<>(); + processDefineAndInstanceAndBusinessMap.put(wrapper.getProcessDefinitionId(),processInstanceAndBusinessMap); + } + processInstanceAndBusinessMap.put(wrapper.getProcessInstanceId(),new BusinessKeyAndDescription()); + processIntanceIds.add(wrapper.getProcessInstanceId()); + } + + // 建立流程实例和业务Key的关系 + List processInstances =historyService.createHistoricProcessInstanceQuery().processInstanceIds(processIntanceIds).list(); + if(CollectionUtil.hasElements(processInstances)) { + for (HistoricProcessInstance processInstance : processInstances) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processInstance.getProcessDefinitionId()); + if(processInstanceAndBusinessMap!=null){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstance.getId()); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setProcessDefinitionName(processInstance.getProcessDefinitionName()); + businessKeyAndDescription.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); + businessKeyAndDescription.setBusinessKey(processInstance.getBusinessKey()); + businessKeyAndDescription.setBusinessDescription(processInstance.getProcessDefinitionName()); + + List historicTaskInstances =historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstance.getId()).finished().orderByHistoricTaskInstanceEndTime().desc().list(); + if(CollectionUtil.hasElements(historicTaskInstances)){ + businessKeyAndDescription.setPreviousAssignee(historicTaskInstances.get(0).getAssignee()); + } + } + } + } + } + + for(String processDefineId : processDefineAndInstanceAndBusinessMap.keySet()) { + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(processDefineId); + if(processInstanceAndBusinessMap==null || processInstanceAndBusinessMap.size()<=0){ + continue; + } + ProcessEntity processEntity =processEntityService.getRepository().findByDeployedId(processDefineId); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription!=null){ + businessKeyAndDescription.setTaskHandFrontendRouteName(processEntity.getTaskHandFrontendRouteName()); + businessKeyAndDescription.setTaskHandFrontendModelName(processEntity.getTaskHandFrontendModelName()); + businessKeyAndDescription.setTaskHandFrontendComponentName(processEntity.getTaskHandFrontendComponentName()); + businessKeyAndDescription.setTaskHandFrontendComponentProperties(processEntity.getTaskHandFrontendComponentProperties()); + } + } + if(processEntity==null){ + continue; + } + String sql =processEntity.getBusinessDescriptionSql(); + if(!StringUtils.hasText(sql)){ + continue; + } + + Set businessKeys =new HashSet<>(); + for(Map.Entry entry: processInstanceAndBusinessMap.entrySet()){ + businessKeys.add(entry.getValue().getBusinessKey()); + } + if(!CollectionUtil.hasElements(businessKeys)){ + continue; + } + Map variables =new HashMap<>(); + variables.put("bussinessKeys","'" + StringUtil.combine("','",businessKeys) + "'"); + sql =StringUtil.format(sql,variables); + List> result =jdbcTemplate.queryForList(sql); + if(!CollectionUtil.hasElements(result)){ + continue; + } + for(Map row : result){ + String bussinessKey =row.get("BUSSINESS_KEY").toString(); + String bussinessDescription =row.get("BUSSINESS_DESCRIPTION").toString(); + for(String processInstanceId : processInstanceAndBusinessMap.keySet()){ + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(processInstanceId); + if(businessKeyAndDescription.getBusinessKey().equals(bussinessKey)){ + businessKeyAndDescription.setBusinessDescription(bussinessDescription); + break; + } + } + } + } + + //合并 + for(ProcessTaskWrapper wrapper : wrappers){ + Map processInstanceAndBusinessMap =processDefineAndInstanceAndBusinessMap.get(wrapper.getProcessDefinitionId()); + BusinessKeyAndDescription businessKeyAndDescription =processInstanceAndBusinessMap.get(wrapper.getProcessInstanceId()); + wrapper.setPreviousAssignee(businessKeyAndDescription.getPreviousAssignee()); + wrapper.setBusinessKey(businessKeyAndDescription.getBusinessKey()); + wrapper.setBusinessDescription(businessKeyAndDescription.getBusinessDescription()); + wrapper.setProcessDefinitionName(businessKeyAndDescription.getProcessDefinitionName()); + wrapper.setProcessDefinitionVersion(businessKeyAndDescription.getProcessDefinitionVersion()); + wrapper.setTaskHandFrontendRouteName(businessKeyAndDescription.getTaskHandFrontendRouteName()); + wrapper.setTaskHandFrontendModelName(businessKeyAndDescription.getTaskHandFrontendModelName()); + wrapper.setTaskHandFrontendComponentName(businessKeyAndDescription.getTaskHandFrontendComponentName()); + wrapper.setTaskHandFrontendComponentProperties(businessKeyAndDescription.getTaskHandFrontendComponentProperties()); + } + + Pageable pageable =queryParameter.getJpaPageable(); + long total =Long.parseLong(page.get("totalElements").toString()); + return new PageImpl(wrappers,pageable,total); + } + + @Override + public List queryVariables(String processInstId) throws Exception { + if(StringUtils.hasText(processInstId)){ + String sql ="select * from ACT_RU_VARIABLE where PROC_INST_ID_=? order by NAME_"; + return jdbcTemplate.query(sql,new VariableWrapperRowMapper(),processInstId); + } + return null; + } + + @Override + public List queryUserTaskDefinition(String taskId) throws Exception { + if(StringUtils.hasText(taskId)) { + List tasks =taskService.createTaskQuery().taskId(taskId).list(); + if(tasks!=null && tasks.size()>0){ + String procDefinitionId =tasks.get(0).getProcessDefinitionId(); + BpmnModel model = repositoryService.getBpmnModel(procDefinitionId); + Collection elements =model.getMainProcess().getFlowElements(); + if(elements!=null && elements.size()>0){ + List result =new ArrayList(); + //添加用户任务 + for(FlowElement element : elements){ + if((element instanceof UserTask)) { + result.add(new UserTaskDefinitionWrapper(element.getId(),element.getName())); + } + } + //添加结束节点 + for(FlowElement element : elements){ + if((element instanceof EndEvent)) { + result.add(new UserTaskDefinitionWrapper(element.getId(),element.getName())); + } + } + return result; + } + } + } + return null; + } + + @Override + public List queryCandidate(String taskId,String activityId) throws Exception { + if(StringUtils.hasText(taskId) && StringUtils.hasText(activityId)) { + List tasks =taskService.createTaskQuery().taskId(taskId).list(); + if(tasks!=null && tasks.size()>0){ + String procDefinitionId =tasks.get(0).getProcessDefinitionId(); + BpmnModel model = repositoryService.getBpmnModel(procDefinitionId); + Collection elements =model.getMainProcess().getFlowElements(); + if(elements!=null && elements.size()>0){ + for(FlowElement element : elements){ + if((element instanceof UserTask) && element.getId().equals(activityId)) { + return assigneeQueryService.query((UserTask)element); + } + } + } + } + } + return null; + } + + @Override + public ProcessTaskWrapper queryProcessTaskById(String taskId) throws Exception { + return null; + } + + @Override + public ProcessTaskWrapper queryDoneProcessTaskById(String taskId) throws Exception { + return null; + } + + @Override + public ProcessTaskWrapper queryFinishedProcessTaskById(String taskId) throws Exception { + return null; + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapper.java new file mode 100644 index 00000000..de330311 --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapper.java @@ -0,0 +1,46 @@ +package io.sc.platform.flowable.support; + +import io.sc.platform.util.DateUtil; +import io.sc.platform.util.support.DateDiff; + +import java.time.temporal.ChronoUnit; +import java.util.Date; + +public class BusinessKeyAndDescriptionWrapper { + private String businessKey; + private String custNo; + private String custName; + private String processStatus; + + public String getBusinessKey() { + return businessKey; + } + + public void setBusinessKey(String businessKey) { + this.businessKey = businessKey; + } + + public String getCustNo() { + return custNo; + } + + public void setCustNo(String custNo) { + this.custNo = custNo; + } + + public String getCustName() { + return custName; + } + + public void setCustName(String custName) { + this.custName = custName; + } + + public String getProcessStatus() { + return processStatus; + } + + public void setProcessStatus(String processStatus) { + this.processStatus = processStatus; + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapperMapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapperMapper.java new file mode 100644 index 00000000..76f6765f --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/BusinessKeyAndDescriptionWrapperMapper.java @@ -0,0 +1,18 @@ +package io.sc.platform.flowable.support; + +import org.springframework.jdbc.core.RowMapper; + +import java.sql.ResultSet; +import java.sql.SQLException; + +public class BusinessKeyAndDescriptionWrapperMapper implements RowMapper { + @Override + public BusinessKeyAndDescriptionWrapper mapRow(ResultSet rs, int rowNum) throws SQLException { + BusinessKeyAndDescriptionWrapper wrapper =new BusinessKeyAndDescriptionWrapper(); + wrapper.setBusinessKey(rs.getString("BUSINESS_KEY")); + wrapper.setCustNo(rs.getString("CUST_NO")); + wrapper.setCustName(rs.getString("CUST_NAME")); + wrapper.setProcessStatus(rs.getString("PROCESS_STATUS")); + return wrapper; + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapper.java new file mode 100644 index 00000000..7aa70a70 --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapper.java @@ -0,0 +1,60 @@ +package io.sc.platform.flowable.support; + +import java.util.Date; + +public class ProcessTaskAssigneeWrapper { + private String id; + private String name; + private String processInstanceId; + private Date endTime; + private String assignee; + private String assigneeName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProcessInstanceId() { + return processInstanceId; + } + + public void setProcessInstanceId(String processInstanceId) { + this.processInstanceId = processInstanceId; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String getAssignee() { + return assignee; + } + + public void setAssignee(String assignee) { + this.assignee = assignee; + } + + public String getAssigneeName() { + return assigneeName; + } + + public void setAssigneeName(String assigneeName) { + this.assigneeName = assigneeName; + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapperMapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapperMapper.java new file mode 100644 index 00000000..c8758a9a --- /dev/null +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskAssigneeWrapperMapper.java @@ -0,0 +1,20 @@ +package io.sc.platform.flowable.support; + +import org.springframework.jdbc.core.RowMapper; + +import java.sql.ResultSet; +import java.sql.SQLException; + +public class ProcessTaskAssigneeWrapperMapper implements RowMapper { + @Override + public ProcessTaskAssigneeWrapper mapRow(ResultSet rs, int rowNum) throws SQLException { + ProcessTaskAssigneeWrapper wrapper =new ProcessTaskAssigneeWrapper(); + wrapper.setId(rs.getString("id")); + wrapper.setName(rs.getString("name")); + wrapper.setProcessInstanceId(rs.getString("processInstanceId")); + wrapper.setEndTime(rs.getTimestamp("endTime")); + wrapper.setAssignee(rs.getString("assignee")); + wrapper.setAssigneeName(rs.getString("assigneeName")); + return wrapper; + } +} diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapper.java index ac2c0948..6a3ec5f2 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapper.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapper.java @@ -10,7 +10,6 @@ import java.time.temporal.ChronoUnit; import java.util.Date; public class ProcessTaskWrapper { - //流程任务信息 private String id; private String name; private String description; @@ -18,7 +17,7 @@ public class ProcessTaskWrapper { private String owner; private String assignee; private String assigneeName; - + private String processInstanceId; private String executionId; private String processDefinitionId; @@ -26,7 +25,8 @@ public class ProcessTaskWrapper { private String subScopeId; private String scopeType; private String scopeDefinitionId; - private Date createTime; + private Date startTime; + private Date endTime; private String taskDefinitionKey; private Date dueDate; private String category; @@ -35,7 +35,7 @@ public class ProcessTaskWrapper { private String formKey; private Date claimTime; - private String previousAssignee; + private String processDefinitionKey; private String processDefinitionName; private Integer processDefinitionVersion; private String businessKey; @@ -45,157 +45,227 @@ public class ProcessTaskWrapper { private String taskHandFrontendComponentName; private String taskHandFrontendComponentProperties; - private long createTimeAndNowDiff; - private ChronoUnit createTimeAndNowDiffUnit; + private String custNo; + private String custName; + private String processStatus; + + private String previousAssignee; + private String previousAssigneeName; + + private long startTimeAndNowDiff; + private ChronoUnit startTimeAndNowDiffUnit; + + private long endTimeAndNowDiff; + private ChronoUnit endTimeAndNowDiffUnit; public String getId() { return id; } + public void setId(String id) { this.id = id; } + public String getName() { return name; } + public void setName(String name) { this.name = name; } + public String getDescription() { return description; } + public void setDescription(String description) { this.description = description; } + public int getPriority() { return priority; } + public void setPriority(int priority) { this.priority = priority; } + public String getOwner() { return owner; } + public void setOwner(String owner) { this.owner = owner; } + public String getAssignee() { return assignee; } + public void setAssignee(String assignee) { this.assignee = assignee; } + public String getAssigneeName() { return assigneeName; } + public void setAssigneeName(String assigneeName) { this.assigneeName = assigneeName; } + public String getProcessInstanceId() { return processInstanceId; } + public void setProcessInstanceId(String processInstanceId) { this.processInstanceId = processInstanceId; } + public String getExecutionId() { return executionId; } + public void setExecutionId(String executionId) { this.executionId = executionId; } + public String getProcessDefinitionId() { return processDefinitionId; } + public void setProcessDefinitionId(String processDefinitionId) { this.processDefinitionId = processDefinitionId; } + public String getScopeId() { return scopeId; } + public void setScopeId(String scopeId) { this.scopeId = scopeId; } + public String getSubScopeId() { return subScopeId; } + public void setSubScopeId(String subScopeId) { this.subScopeId = subScopeId; } + public String getScopeType() { return scopeType; } + public void setScopeType(String scopeType) { this.scopeType = scopeType; } + public String getScopeDefinitionId() { return scopeDefinitionId; } + public void setScopeDefinitionId(String scopeDefinitionId) { this.scopeDefinitionId = scopeDefinitionId; } - public Date getCreateTime() { - return createTime; + + public Date getStartTime() { + return startTime; } - public void setCreateTime(Date createTime) { - this.createTime = createTime; - Date now =new Date(); - DateDiff dateDiff = DateUtil.dateDiff(this.createTime,now); - this.createTimeAndNowDiff =dateDiff.getAmount(); - this.createTimeAndNowDiffUnit =dateDiff.getUnit(); + + public void setStartTime(Date startTime) { + this.startTime = startTime; + if(this.startTime!=null) { + Date now = new Date(); + DateDiff dateDiff = DateUtil.dateDiff(this.startTime, now); + this.startTimeAndNowDiff = dateDiff.getAmount(); + this.startTimeAndNowDiffUnit = dateDiff.getUnit(); + } } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + if(this.endTime!=null) { + Date now = new Date(); + DateDiff dateDiff = DateUtil.dateDiff(this.endTime, now); + this.endTimeAndNowDiff = dateDiff.getAmount(); + this.endTimeAndNowDiffUnit = dateDiff.getUnit(); + } + } + public String getTaskDefinitionKey() { return taskDefinitionKey; } + public void setTaskDefinitionKey(String taskDefinitionKey) { this.taskDefinitionKey = taskDefinitionKey; } + public Date getDueDate() { return dueDate; } + public void setDueDate(Date dueDate) { this.dueDate = dueDate; } + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + public String getParentTaskId() { return parentTaskId; } + public void setParentTaskId(String parentTaskId) { this.parentTaskId = parentTaskId; } + public String getTenantId() { return tenantId; } + public void setTenantId(String tenantId) { this.tenantId = tenantId; } + public String getFormKey() { return formKey; } + public void setFormKey(String formKey) { this.formKey = formKey; } + public Date getClaimTime() { return claimTime; } + public void setClaimTime(Date claimTime) { this.claimTime = claimTime; } - public String getPreviousAssignee() { - return previousAssignee; + public String getProcessDefinitionKey() { + return processDefinitionKey; } - public void setPreviousAssignee(String previousAssignee) { - this.previousAssignee = previousAssignee; + public void setProcessDefinitionKey(String processDefinitionKey) { + this.processDefinitionKey = processDefinitionKey; } public String getProcessDefinitionName() { return processDefinitionName; } + public void setProcessDefinitionName(String processDefinitionName) { this.processDefinitionName = processDefinitionName; } @@ -211,6 +281,7 @@ public class ProcessTaskWrapper { public String getBusinessKey() { return businessKey; } + public void setBusinessKey(String businessKey) { this.businessKey = businessKey; } @@ -255,19 +326,75 @@ public class ProcessTaskWrapper { this.taskHandFrontendComponentProperties = taskHandFrontendComponentProperties; } - public long getCreateTimeAndNowDiff() { - return createTimeAndNowDiff; + public String getCustNo() { + return custNo; + } + + public void setCustNo(String custNo) { + this.custNo = custNo; + } + + public String getCustName() { + return custName; + } + + public void setCustName(String custName) { + this.custName = custName; + } + + public String getProcessStatus() { + return processStatus; + } + + public void setProcessStatus(String processStatus) { + this.processStatus = processStatus; + } + + public String getPreviousAssignee() { + return previousAssignee; + } + + public void setPreviousAssignee(String previousAssignee) { + this.previousAssignee = previousAssignee; + } + + public String getPreviousAssigneeName() { + return previousAssigneeName; + } + + public void setPreviousAssigneeName(String previousAssigneeName) { + this.previousAssigneeName = previousAssigneeName; + } + + public long getStartTimeAndNowDiff() { + return startTimeAndNowDiff; + } + + public void setStartTimeAndNowDiff(long startTimeAndNowDiff) { + this.startTimeAndNowDiff = startTimeAndNowDiff; + } + + public ChronoUnit getStartTimeAndNowDiffUnit() { + return startTimeAndNowDiffUnit; + } + + public void setStartTimeAndNowDiffUnit(ChronoUnit startTimeAndNowDiffUnit) { + this.startTimeAndNowDiffUnit = startTimeAndNowDiffUnit; + } + + public long getEndTimeAndNowDiff() { + return endTimeAndNowDiff; } - public void setCreateTimeAndNowDiff(long createTimeAndNowDiff) { - this.createTimeAndNowDiff = createTimeAndNowDiff; + public void setEndTimeAndNowDiff(long endTimeAndNowDiff) { + this.endTimeAndNowDiff = endTimeAndNowDiff; } - public ChronoUnit getCreateTimeAndNowDiffUnit() { - return createTimeAndNowDiffUnit; + public ChronoUnit getEndTimeAndNowDiffUnit() { + return endTimeAndNowDiffUnit; } - public void setCreateTimeAndNowDiffUnit(ChronoUnit createTimeAndNowDiffUnit) { - this.createTimeAndNowDiffUnit = createTimeAndNowDiffUnit; + public void setEndTimeAndNowDiffUnit(ChronoUnit endTimeAndNowDiffUnit) { + this.endTimeAndNowDiffUnit = endTimeAndNowDiffUnit; } } diff --git a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapperMapper.java b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapperMapper.java index 88237f20..eb7ce38e 100644 --- a/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapperMapper.java +++ b/io.sc.platform.flowable/src/main/java/io/sc/platform/flowable/support/ProcessTaskWrapperMapper.java @@ -13,29 +13,45 @@ public class ProcessTaskWrapperMapper implements RowMapper { @Override public ProcessTaskWrapper mapRow(ResultSet rs, int rowNum) throws SQLException { ProcessTaskWrapper wrapper =new ProcessTaskWrapper(); + wrapper.setId(rs.getString("id")); wrapper.setName(rs.getString("name")); wrapper.setDescription(rs.getString("description")); wrapper.setPriority(rs.getInt("priority")); wrapper.setOwner(rs.getString("owner")); wrapper.setAssignee(rs.getString("assignee")); + wrapper.setAssigneeName(rs.getString("assigneeName")); + wrapper.setProcessInstanceId(rs.getString("processInstanceId")); wrapper.setExecutionId(rs.getString("executionId")); wrapper.setProcessDefinitionId(rs.getString("processDefinitionId")); - wrapper.setProcessDefinitionName(rs.getString("processDefinitionName")); - wrapper.setProcessDefinitionVersion(rs.getInt("processDefinitionVersion")); wrapper.setScopeId(rs.getString("scopeId")); wrapper.setSubScopeId(rs.getString("subScopeId")); wrapper.setScopeType(rs.getString("scopeType")); wrapper.setScopeDefinitionId(rs.getString("scopeDefinitionId")); - wrapper.setCreateTime(rs.getDate("createTime")); + wrapper.setStartTime(rs.getTimestamp("startTime")); + wrapper.setEndTime(rs.getTimestamp("endTime")); wrapper.setTaskDefinitionKey(rs.getString("taskDefinitionKey")); - wrapper.setDueDate(rs.getDate("dueDate")); + wrapper.setDueDate(rs.getTimestamp("dueDate")); wrapper.setCategory(rs.getString("category")); wrapper.setParentTaskId(rs.getString("parentTaskId")); wrapper.setTenantId(rs.getString("tenantId")); wrapper.setFormKey(rs.getString("formKey")); - wrapper.setClaimTime(rs.getDate("claimTime")); + wrapper.setClaimTime(rs.getTimestamp("claimTime")); + + wrapper.setProcessDefinitionKey(rs.getString("processDefinitionKey")); + wrapper.setProcessDefinitionName(rs.getString("processDefinitionName")); + wrapper.setProcessDefinitionVersion(rs.getInt("processDefinitionVersion")); + wrapper.setBusinessKey(rs.getString("businessKey")); + wrapper.setBusinessDescription(rs.getString("businessDescription")); + wrapper.setTaskHandFrontendRouteName(rs.getString("taskHandFrontendRouteName")); + wrapper.setTaskHandFrontendModelName(rs.getString("taskHandFrontendModelName")); + wrapper.setTaskHandFrontendComponentName(rs.getString("taskHandFrontendComponentName")); + wrapper.setTaskHandFrontendComponentProperties(rs.getString("taskHandFrontendComponentProperties")); + + wrapper.setCustNo(rs.getString("custNo")); + wrapper.setCustName(rs.getString("custName")); + wrapper.setProcessStatus(rs.getString("processStatus")); return wrapper; } } diff --git a/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/messages.json b/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/messages.json index 049713c7..e66e6032 100644 --- a/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/messages.json +++ b/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/messages.json @@ -2,6 +2,7 @@ "includes":[ "io/sc/platform/flowable/i18n/initializer", "io/sc/platform/flowable/i18n/enums", - "io/sc/platform/flowable/i18n/dictionary" + "io/sc/platform/flowable/i18n/dictionary", + "io/sc/platform/flowable/i18n/parameters" ] } \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/parameters.json b/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/parameters.json new file mode 100644 index 00000000..dab0ee15 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/META-INF/platform/plugins/parameters.json @@ -0,0 +1,22 @@ +[ + /*系统/工作台*/ + { "id": "parameter.system.workbench", "parentId": "parameter.system","order": 100 }, + /*系统/工作台/流程定义*/ + { + "id": "parameter.system.workbench.processDefines", + "parentId": "parameter.system.workbench", + "code": "parameter.system.workbench.processDefines", + "multiLineText": true, + "defaultValue": "{}", + "order": 100 + }, + /*系统/工作台/流程状态*/ + { + "id": "parameter.system.workbench.processStatus", + "parentId": "parameter.system.workbench", + "code": "parameter.system.workbench.processStatus", + "multiLineText": true, + "defaultValue": "{}", + "order": 200 + } +] diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters.properties b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters.properties new file mode 100644 index 00000000..47e18ede --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters.properties @@ -0,0 +1,3 @@ +parameter.system.workbench=Workbench +parameter.system.workbench.processDefines=Process Defines Mapping +parameter.system.workbench.processStatus=Process Status Enums \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_tw_CN.properties b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_tw_CN.properties new file mode 100644 index 00000000..06a9625b --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_tw_CN.properties @@ -0,0 +1,3 @@ +parameter.system.workbench=\u5DE5\u4F5C\u53F0 +parameter.system.workbench.processDefines=\u6D41\u7A0B\u5B9A\u7FA9\u6620\u5C04 +parameter.system.workbench.processStatus=\u6D41\u7A0B\u72C0\u614B\u679A\u8209 \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_zh_CN.properties b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_zh_CN.properties new file mode 100644 index 00000000..8f758b71 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/i18n/parameters_zh_CN.properties @@ -0,0 +1,3 @@ +parameter.system.workbench=\u5DE5\u4F5C\u53F0 +parameter.system.workbench.processDefines=\u6D41\u7A0B\u5B9A\u4E49\u6620\u5C04 +parameter.system.workbench.processStatus=\u6D41\u7A0B\u72B6\u6001\u679A\u4E3E \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/DoneTask.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/DoneTask.sql new file mode 100644 index 00000000..18a38c35 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/DoneTask.sql @@ -0,0 +1,46 @@ +select * from ( + select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + T.START_TIME_ as startTime, + T.END_TIME_ as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + EXE.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus, + row_number() over(partition by T.PROC_INST_ID_ order by T.END_TIME_ desc) as RK + from ACT_HI_TASKINST T + left join ACT_RE_PROCDEF DEF on DEF.ID_ = T.PROC_DEF_ID_ + left join ACT_RU_EXECUTION EXE on EXE.ID_ = T.PROC_INST_ID_ + left join SYS_USER U on U.LOGINNAME_ = T.ASSIGNEE_ + left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ + left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ + where T.PROC_INST_ID_ ='${0}' +) TMP where TMP.RK = 1 diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/FinishedTask.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/FinishedTask.sql new file mode 100644 index 00000000..f9aaf5e7 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/FinishedTask.sql @@ -0,0 +1,48 @@ +select * from ( + select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + INST.START_TIME_ as startTime, + INST.END_TIME_ as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + + INST.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus, + row_number() over(partition by T.PROC_INST_ID_ order by T.END_TIME_ desc) as RK + from ACT_HI_TASKINST T + left join ACT_RE_PROCDEF DEF on DEF.ID_ = T.PROC_DEF_ID_ + left join ACT_HI_PROCINST INST on T.PROC_INST_ID_ = INST.PROC_INST_ID_ + left join SYS_USER U on U.LOGINNAME_ = T.ASSIGNEE_ + left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ + left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ + where T.PROC_INST_ID_ ='${0}' +) tmp where tmp.RK = 1 \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyDoneTasks.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyDoneTasks.sql new file mode 100644 index 00000000..99c6f88a --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyDoneTasks.sql @@ -0,0 +1,52 @@ +select * from ( + select * from ( + select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + T.CREATE_TIME_ as startTime, + NULL as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + EXE.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus, + row_number() over(partition by HT.PROC_INST_ID_ order by HT.END_TIME_ desc) as RK + from ACT_HI_TASKINST HT + join ACT_RU_TASK T on T.PROC_INST_ID_ = HT.PROC_INST_ID_ + join ACT_RU_EXECUTION EXE on T.PROC_INST_ID_ = EXE.ID_ + left join ACT_RE_PROCDEF DEF on HT.PROC_DEF_ID_ = DEF.ID_ + left join SYS_USER U on T.ASSIGNEE_ = U.LOGINNAME_ + left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ + left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ + where + HT.ASSIGNEE_ ='${0}' + and T.ASSIGNEE_ <> '${0}' + and HT.END_TIME_ is not null + ) TMP where TMP.RK = 1 + ) R diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyFinishedTasks.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyFinishedTasks.sql new file mode 100644 index 00000000..e6ea05fa --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyFinishedTasks.sql @@ -0,0 +1,64 @@ +select * from ( + select * from ( + select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + INST.START_TIME_ as startTime, + INST.END_TIME_ as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + + INST.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus, + row_number() over(partition by T.PROC_INST_ID_ order by T.END_TIME_ desc) as RK + from ACT_HI_TASKINST T + left join ACT_RE_PROCDEF DEF on T.PROC_DEF_ID_ = DEF.ID_ + join ACT_HI_PROCINST INST on T.PROC_INST_ID_ = INST.PROC_INST_ID_ + left join SYS_USER U on U.LOGINNAME_ = T.ASSIGNEE_ + left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ + left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ + where + exists ( + select 1 from ACT_HI_TASKINST AHT + where + AHT.ASSIGNEE_ = '${0}' + and AHT.END_TIME_ is not null + and exists ( + select 1 from ACT_HI_PROCINST AHP + where + AHP.END_TIME_ is not null + and AHP.END_ACT_ID_ is not null + and AHP.PROC_INST_ID_ = T.PROC_INST_ID_ + ) + and AHT.PROC_INST_ID_ = T.PROC_INST_ID_ + ) + ) tmp where tmp.RK = 1 +) R diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyTasks.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyTasks.sql new file mode 100644 index 00000000..e9cd38a1 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/MyTasks.sql @@ -0,0 +1,44 @@ +select * from ( + select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + T.CREATE_TIME_ as startTime, + NULL as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + EXE.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus + from ACT_RU_TASK T + left join ACT_RE_PROCDEF DEF on DEF.ID_ = T.PROC_DEF_ID_ + left join ACT_RU_EXECUTION EXE on EXE.ID_ = T.PROC_INST_ID_ + left join SYS_USER U on U.LOGINNAME_ = T.ASSIGNEE_ + left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ + left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ +) R diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/ProcessPrefixAssignee.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/ProcessPrefixAssignee.sql new file mode 100644 index 00000000..6496f7bd --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/ProcessPrefixAssignee.sql @@ -0,0 +1,16 @@ +select * from ( + select + HT.ID_ as id, + HT.NAME_ as name, + HT.PROC_INST_ID_ as processInstanceId, + HT.END_TIME_ as endTime, + HT.ASSIGNEE_ as assignee, + USER.USERNAME_ as assigneeName, + row_number() over(partition by PROC_INST_ID_ order by END_TIME_ desc) as RK + from ACT_HI_TASKINST HT + left join SYS_USER USER on USER.LOGINNAME_ = HT.ASSIGNEE_ + where + HT.END_TIME_ is not null + and HT.PROC_INST_ID_ in (${0}) +) R +where R.RK = 1 diff --git a/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/Task.sql b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/Task.sql new file mode 100644 index 00000000..d5c92606 --- /dev/null +++ b/io.sc.platform.flowable/src/main/resources/io/sc/platform/flowable/service/impl/sql/Task.sql @@ -0,0 +1,43 @@ +select + T.ID_ as id, + T.NAME_ as name, + T.DESCRIPTION_ as description, + T.PRIORITY_ as priority, + T.OWNER_ as owner, + T.ASSIGNEE_ as assignee, + T.PROC_INST_ID_ as processInstanceId, + T.EXECUTION_ID_ as executionId, + T.PROC_DEF_ID_ as processDefinitionId, + T.SCOPE_ID_ as scopeId, + T.SUB_SCOPE_ID_ as subScopeId, + T.SCOPE_TYPE_ as scopeType, + T.SCOPE_DEFINITION_ID_ as scopeDefinitionId, + T.CREATE_TIME_ as startTime, + NULL as endTime, + T.TASK_DEF_KEY_ as taskDefinitionKey, + T.DUE_DATE_ as dueDate, + T.CATEGORY_ as category, + T.PARENT_TASK_ID_ as parentTaskId, + T.TENANT_ID_ as tenantId, + T.FORM_KEY_ as formKey, + T.CLAIM_TIME_ as claimTime, + U.USERNAME_ as assigneeName, + DEF.KEY_ as processDefinitionKey, + DEF.NAME_ as processDefinitionName, + DEF.VERSION_ as processDefinitionVersion, + EXE.BUSINESS_KEY_ as businessKey, + CONCAT(PROCESS_EXT.CUST_NO_,PROCESS_EXT.CUST_NAME_) as businessDescription, + PROCESS.TASK_HAND_FE_ROUTE_NAME_ as taskHandFrontendRouteName, + PROCESS.TASK_HAND_FE_MODEL_NAME_ as taskHandFrontendModelName, + PROCESS.TASK_HAND_FE_COMP_NAME_ as taskHandFrontendComponentName, + PROCESS.TASK_HAND_FE_COMP_PROPS_ as taskHandFrontendComponentProperties, + PROCESS_EXT.CUST_NO_ as custNo, + PROCESS_EXT.CUST_NAME_ as custName, + PROCESS_EXT.PROCESS_STATUS_ as processStatus +from ACT_RU_TASK T +left join ACT_RE_PROCDEF DEF on DEF.ID_ = T.PROC_DEF_ID_ +left join ACT_RU_EXECUTION EXE on EXE.ID_ = T.PROC_INST_ID_ +left join SYS_USER U on U.LOGINNAME_ = T.ASSIGNEE_ +left join SYS_PROCESS PROCESS on PROCESS.DEPLOYED_ID_ = T.PROC_DEF_ID_ +left join SYS_PROCESS_INST_EXT PROCESS_EXT on PROCESS_EXT.PROC_INST_ID_ = T.PROC_INST_ID_ +where T.ID_ ='${0}' and T.ASSIGNEE_='${1}' \ No newline at end of file diff --git a/io.sc.platform.flowable/src/main/resources/liquibase/io.sc.platform.flowable_8.0.0_20220606__Process_Manager_Database_Schema_DDL.xml b/io.sc.platform.flowable/src/main/resources/liquibase/io.sc.platform.flowable_8.0.0_20220606__Process_Manager_Database_Schema_DDL.xml index 357d170b..a7469fbe 100644 --- a/io.sc.platform.flowable/src/main/resources/liquibase/io.sc.platform.flowable_8.0.0_20220606__Process_Manager_Database_Schema_DDL.xml +++ b/io.sc.platform.flowable/src/main/resources/liquibase/io.sc.platform.flowable_8.0.0_20220606__Process_Manager_Database_Schema_DDL.xml @@ -49,6 +49,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/io.sc.platform.lcdp.frontend/package.json b/io.sc.platform.lcdp.frontend/package.json index c0e36bea..45330a84 100644 --- a/io.sc.platform.lcdp.frontend/package.json +++ b/io.sc.platform.lcdp.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.lcdp.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.lcdp.frontend/src/i18n/messages.json b/io.sc.platform.lcdp.frontend/src/i18n/messages.json index 068d578d..b4d3b206 100644 --- a/io.sc.platform.lcdp.frontend/src/i18n/messages.json +++ b/io.sc.platform.lcdp.frontend/src/i18n/messages.json @@ -170,6 +170,7 @@ "lcdp.bpm.tabs.processInstance": "Process Instance", "lcdp.bpm.tabs.task": "Process Task", "lcdp.bpm.tabs.tools": "Tools", + "lcdp.bpm.tabs.workbench": "Workbench", "lcdp.bpm.processDefine.grid.title": "Process Define List", "lcdp.bpm.processDefine.grid.toolbar.design": "Design", @@ -252,6 +253,9 @@ "lcdp.bpm.tools.action.cleanHistoryData": "Clean History Data", "lcdp.bpm.tools.action.cleanHistoryData.tip": "Are you sure to clean the history data?", + "lcdp.bpm.task.grid.workbench.processDefine": "Process Define List", + "lcdp.bpm.task.grid.workbench.processStatus": "Process Status List", + "lcdp.jxls.template.grid.title": "Templates", "lcdp.jxls.template.grid.action.updateAttachment": "Update Attachment", "lcdp.jxls.template.grid.action.downloadAttachment": "Download Attachment", diff --git a/io.sc.platform.lcdp.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.lcdp.frontend/src/i18n/messages_tw_CN.json index 4763a775..3574d790 100644 --- a/io.sc.platform.lcdp.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.lcdp.frontend/src/i18n/messages_tw_CN.json @@ -170,6 +170,7 @@ "lcdp.bpm.tabs.processInstance": "流程實例", "lcdp.bpm.tabs.task": "工作任務", "lcdp.bpm.tabs.tools": "工具", + "lcdp.bpm.tabs.workbench": "工作台", "lcdp.bpm.processDefine.grid.title": "流程定義列表", "lcdp.bpm.processDefine.grid.toolbar.design": "設計", @@ -252,6 +253,9 @@ "lcdp.bpm.tools.action.cleanHistoryData": "清除歷史數據", "lcdp.bpm.tools.action.cleanHistoryData.tip": "您確定要清除歷史數據嗎?", + "lcdp.bpm.task.grid.workbench.processDefine": "流程定義列表", + "lcdp.bpm.task.grid.workbench.processStatus": "流程狀態列表", + "lcdp.jxls.template.grid.title": "JXLS 模版列表", "lcdp.jxls.template.grid.action.updateAttachment": "上傳模版", "lcdp.jxls.template.grid.action.downloadAttachment": "下載模版", diff --git a/io.sc.platform.lcdp.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.lcdp.frontend/src/i18n/messages_zh_CN.json index 6316bf34..e4588f03 100644 --- a/io.sc.platform.lcdp.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.lcdp.frontend/src/i18n/messages_zh_CN.json @@ -170,6 +170,7 @@ "lcdp.bpm.tabs.processInstance": "流程实例", "lcdp.bpm.tabs.task": "工作任务", "lcdp.bpm.tabs.tools": "工具", + "lcdp.bpm.tabs.workbench": "工作台", "lcdp.bpm.processDefine.grid.title": "流程定义列表", "lcdp.bpm.processDefine.grid.toolbar.design": "设计", @@ -252,6 +253,9 @@ "lcdp.bpm.tools.action.cleanHistoryData": "清除历史数据", "lcdp.bpm.tools.action.cleanHistoryData.tip": "您确定要清除历史数据吗?", + "lcdp.bpm.task.grid.workbench.processDefine": "流程定义列表", + "lcdp.bpm.task.grid.workbench.processStatus": "流程状态列表", + "lcdp.jxls.template.grid.title": "JXLS 模版列表", "lcdp.jxls.template.grid.action.updateAttachment": "上传模版", "lcdp.jxls.template.grid.action.downloadAttachment": "下载模版", diff --git a/io.sc.platform.lcdp.frontend/src/views/bpm/Bpm.vue b/io.sc.platform.lcdp.frontend/src/views/bpm/Bpm.vue index 5b09e0a9..57aa49de 100644 --- a/io.sc.platform.lcdp.frontend/src/views/bpm/Bpm.vue +++ b/io.sc.platform.lcdp.frontend/src/views/bpm/Bpm.vue @@ -7,6 +7,7 @@ + @@ -727,6 +788,9 @@ const selectedTabRef = ref('processDefine'); const processDefineGridRef = ref(); const processInstanceGridRef = ref(); const taskGridRef = ref(); +const workbenchProcessDefineGridRef = ref(); +const workbenchProcessStatusGridRef = ref(); + const variableDialogRef = ref(); const completeTaskDialogRef = ref(); const jumpTaskDialogRef = ref(); diff --git a/io.sc.platform.license.keygen.frontend/package.json b/io.sc.platform.license.keygen.frontend/package.json index 9b39ea5f..9ee8069e 100644 --- a/io.sc.platform.license.keygen.frontend/package.json +++ b/io.sc.platform.license.keygen.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.license.keygen.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.mvc.frontend/package.json b/io.sc.platform.mvc.frontend/package.json index cc208ece..f695f9d8 100644 --- a/io.sc.platform.mvc.frontend/package.json +++ b/io.sc.platform.mvc.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.mvc.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/support/RestCrudController.java b/io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/support/RestCrudController.java index 75bd4477..89c0be81 100644 --- a/io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/support/RestCrudController.java +++ b/io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/support/RestCrudController.java @@ -243,8 +243,9 @@ public abstract class RestCrudController options; + protected Boolean multiLineText; //附加属性 private String configurationFileUrl; //菜单贡献项配置文件位置 @@ -80,6 +81,14 @@ public class Parameter { this.options = options; } + public Boolean getMultiLineText() { + return multiLineText; + } + + public void setMultiLineText(Boolean multiLineText) { + this.multiLineText = multiLineText; + } + public String getConfigurationFileUrl() { return configurationFileUrl; } @@ -87,16 +96,4 @@ public class Parameter { public void setConfigurationFileUrl(String configurationFileUrl) { this.configurationFileUrl = configurationFileUrl; } - - @Override - public String toString() { - return "SystemParameterContributionItem [id=" + id - + ", parentId=" + parentId - + ", code=" + code - + ", defaultValue=" + defaultValue - + ", order=" + order - + ", priority=" + priority - + ", description=" + description - + ", configurationFileUrl=" + configurationFileUrl + "]"; - } } diff --git a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java index ccecbf4c..7e4c3b4e 100644 --- a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java +++ b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java @@ -65,5 +65,5 @@ public interface DaoService stream(Specification specification, Sort sort) throws Exception; public DataExportConfigure getExportConfigure(); - public DataExportConfigure export(QueryParameter queryParameter, OutputStream outputStream) throws Exception; + public DataExportConfigure export(QueryParameter queryParameter, OutputStream outputStream,String downloadFileName) throws Exception; } diff --git a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java index 7e3e63d5..31c9933e 100644 --- a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java +++ b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java @@ -636,11 +636,14 @@ public abstract class DaoServiceImpl extends Between { if(pStart==null && pEnd==null){ return condition; }else if(pStart!=null && pEnd!=null){ - condition.setWhere(StringUtil.format("${0} >= ${1} and ${0} <= ${2}",fieldName,nStart, nEnd)); + condition.setWhere(StringUtil.format("${0} >= ${1} and ${0} < ${2}",fieldName,nStart, nEnd)); condition.getParameters().put(nStart.substring(1),pStart); condition.getParameters().put(nEnd.substring(1),pEnd); }else if(pStart!=null){ condition.setWhere(StringUtil.format("${0} >= ${1}",fieldName,nStart)); condition.getParameters().put(nStart.substring(1),pStart); }else { - condition.setWhere(StringUtil.format("${0} <= ${1}",fieldName,nEnd)); + condition.setWhere(StringUtil.format("${0} < ${1}",fieldName,nEnd)); condition.getParameters().put(nEnd.substring(1),pEnd); } return condition; diff --git a/io.sc.platform.poi/build.gradle b/io.sc.platform.poi/build.gradle index 0026538c..181f82d9 100644 --- a/io.sc.platform.poi/build.gradle +++ b/io.sc.platform.poi/build.gradle @@ -7,5 +7,6 @@ dependencies { "org.jxls:jxls:${jxls_version}", "org.jxls:jxls-poi:${jxls_version}", + "org.apache.commons:commons-jexl3:${commons_jexl3_version}", ) } diff --git a/io.sc.platform.scheduler.manager.frontend/package.json b/io.sc.platform.scheduler.manager.frontend/package.json index ef6dfbef..38ff0096 100644 --- a/io.sc.platform.scheduler.manager.frontend/package.json +++ b/io.sc.platform.scheduler.manager.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.scheduler.manager.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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 +113,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.system.api/src/main/java/io/sc/platform/system/api/parameter/ParameterVo.java b/io.sc.platform.system.api/src/main/java/io/sc/platform/system/api/parameter/ParameterVo.java index 676032ad..c6279403 100644 --- a/io.sc.platform.system.api/src/main/java/io/sc/platform/system/api/parameter/ParameterVo.java +++ b/io.sc.platform.system.api/src/main/java/io/sc/platform/system/api/parameter/ParameterVo.java @@ -14,6 +14,7 @@ public class ParameterVo extends CorporationAuditorVo { private Integer order; private String defaultValue; private Map options; + private Boolean multiLineText; private String parent; public String getId() { @@ -64,6 +65,14 @@ public class ParameterVo extends CorporationAuditorVo { this.options = options; } + public Boolean getMultiLineText() { + return multiLineText; + } + + public void setMultiLineText(Boolean multiLineText) { + this.multiLineText = multiLineText; + } + public String getParent() { return parent; } diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index e69ff1b9..e7c5d43e 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/io.sc.platform.system.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.system.frontend", - "version": "8.2.28", + "version": "8.2.31", "description": "", "private": false, "keywords": [], @@ -102,6 +102,7 @@ "@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", @@ -111,7 +112,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.6", "pinia": "2.3.0", - "platform-core": "8.2.117", + "platform-core": "8.2.121", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.system.frontend/src/i18n/messages.json b/io.sc.platform.system.frontend/src/i18n/messages.json index c1e3c031..a9c98a53 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages.json +++ b/io.sc.platform.system.frontend/src/i18n/messages.json @@ -212,33 +212,26 @@ "settings.shortcutMenus.entity.shortcutMenuName": "Shortcut Menu Name", "settings.shortcutMenus.entity.menuIconColor": "Icon Color", + "workbench.grid.entity.processDefinitionName": "Process Name", + "workbench.grid.entity.businessKey": "Business Key", + "workbench.grid.entity.businessDescription": "Business Description", + "workbench.grid.entity.custNo": "Customer No.", + "workbench.grid.entity.custName": "Customer Name", + "workbench.grid.entity.taskType": "Task Type", + "workbench.grid.entity.processStatus": "Process Status", + "workbench.grid.entity.activityName": "Activity Name", + "workbench.grid.entity.previousAssignee": "Previous Assignee", + "workbench.grid.entity.currentAssignee": "Current Assignee", + "workbench.grid.entity.lastAssignee": "Last Assignee", + "workbench.grid.entity.startTime": "Task Start Time", + "workbench.grid.entity.endTime": "Task End Time", + "workbench.myTask.grid.title": "My Tasks", "workbench.myTask.grid.action.process": "Process", - "workbench.myTask.grid.entity.businessKey": "Business Key", - "workbench.myTask.grid.entity.businessDescription": "Business Description", - "workbench.myTask.grid.entity.processDefinitionName": "Process Name", - "workbench.myTask.grid.entity.activityName": "Activity Name", - "workbench.myTask.grid.entity.taskDescription": "Task Description", - "workbench.myTask.grid.entity.prefixAssignee": "Prefix Assignee", - "workbench.myTask.grid.entity.createTime": "Task Create Time", "workbench.myDoneTask.grid.title": "My Done Tasks", "workbench.myDoneTask.grid.action.view": "View", - "workbench.myDoneTask.grid.entity.businessKey": "Business Key", - "workbench.myDoneTask.grid.entity.businessDescription": "Business Description", - "workbench.myDoneTask.grid.entity.processDefinitionName": "Process Name", - "workbench.myDoneTask.grid.entity.activityName": "Activity Name", - "workbench.myDoneTask.grid.entity.taskDescription": "Task Description", - "workbench.myDoneTask.grid.entity.prefixAssignee": "Prefix Assignee", - "workbench.myDoneTask.grid.entity.createTime": "Task Create Time", "workbench.myFinishedTask.grid.title": "My Finished Tasks", - "workbench.myFinishedTask.grid.action.view": "View", - "workbench.myFinishedTask.grid.entity.businessKey": "Business Key", - "workbench.myFinishedTask.grid.entity.businessDescription": "Business Description", - "workbench.myFinishedTask.grid.entity.processDefinitionName": "Process Name", - "workbench.myFinishedTask.grid.entity.activityName": "Activity Name", - "workbench.myFinishedTask.grid.entity.taskDescription": "Task Description", - "workbench.myFinishedTask.grid.entity.prefixAssignee": "Prefix Assignee", - "workbench.myFinishedTask.grid.entity.createTime": "Task Create Time" + "workbench.myFinishedTask.grid.action.view": "View" } diff --git a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json index 3ce12131..4dc34da9 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json @@ -190,33 +190,26 @@ "settings.shortcutMenus.entity.shortcutMenuName": "快捷菜單名稱", "settings.shortcutMenus.entity.menuIconColor": "圖標顏色", + "workbench.grid.entity.processDefinitionName": "流程名稱", + "workbench.grid.entity.businessKey": "業務流水號", + "workbench.grid.entity.businessDescription": "業務描述", + "workbench.grid.entity.custNo": "客戶編號", + "workbench.grid.entity.custName": "客戶名稱", + "workbench.grid.entity.taskType": "任務類型", + "workbench.grid.entity.processStatus": "流程狀態", + "workbench.grid.entity.activityName": "任務節點", + "workbench.grid.entity.previousAssignee": "前一處理人", + "workbench.grid.entity.currentAssignee": "當前處理人", + "workbench.grid.entity.lastAssignee": "最後處理人", + "workbench.grid.entity.startTime": "任務開始時間", + "workbench.grid.entity.endTime": "任務結束時間", + "workbench.myTask.grid.title": "待辦任務", "workbench.myTask.grid.action.process": "辦理", - "workbench.myTask.grid.entity.businessKey": "業務流水號", - "workbench.myTask.grid.entity.businessDescription": "業務描述", - "workbench.myTask.grid.entity.processDefinitionName": "流程名稱", - "workbench.myTask.grid.entity.activityName": "任務節點", - "workbench.myTask.grid.entity.taskDescription": "任務描述", - "workbench.myTask.grid.entity.prefixAssignee": "前一處理人", - "workbench.myTask.grid.entity.createTime": "任務開始日期", "workbench.myDoneTask.grid.title": "辦理中任務", "workbench.myDoneTask.grid.action.view": "查看", - "workbench.myDoneTask.grid.entity.businessKey": "業務流水號", - "workbench.myDoneTask.grid.entity.businessDescription": "業務描述", - "workbench.myDoneTask.grid.entity.processDefinitionName": "流程名稱", - "workbench.myDoneTask.grid.entity.activityName": "任務節點", - "workbench.myDoneTask.grid.entity.taskDescription": "任務描述", - "workbench.myDoneTask.grid.entity.prefixAssignee": "前一處理人", - "workbench.myDoneTask.grid.entity.createTime": "任務開始日期", "workbench.myFinishedTask.grid.title": "已完成任務", - "workbench.myFinishedTask.grid.action.view": "查看", - "workbench.myFinishedTask.grid.entity.businessKey": "業務流水號", - "workbench.myFinishedTask.grid.entity.businessDescription": "業務描述", - "workbench.myFinishedTask.grid.entity.processDefinitionName": "流程名稱", - "workbench.myFinishedTask.grid.entity.activityName": "任務節點", - "workbench.myFinishedTask.grid.entity.taskDescription": "任務描述", - "workbench.myFinishedTask.grid.entity.prefixAssignee": "前一處理人", - "workbench.myFinishedTask.grid.entity.createTime": "任務開始日期" + "workbench.myFinishedTask.grid.action.view": "查看" } diff --git a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json index 6743f55b..610176bd 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json @@ -220,33 +220,26 @@ "settings.shortcutMenus.entity.shortcutMenuName": "快捷菜单名称", "settings.shortcutMenus.entity.menuIconColor": "图标颜色", + "workbench.grid.entity.processDefinitionName": "流程名称", + "workbench.grid.entity.businessKey": "业务流水号", + "workbench.grid.entity.businessDescription": "业务描述", + "workbench.grid.entity.custNo": "客户编号", + "workbench.grid.entity.custName": "客户名称", + "workbench.grid.entity.taskType": "任务类型", + "workbench.grid.entity.processStatus": "流程状态", + "workbench.grid.entity.activityName": "任务节点", + "workbench.grid.entity.previousAssignee": "前一处理人", + "workbench.grid.entity.currentAssignee": "当前处理人", + "workbench.grid.entity.lastAssignee": "最后处理人", + "workbench.grid.entity.startTime": "任务开始时间", + "workbench.grid.entity.endTime": "任务结束时间", + "workbench.myTask.grid.title": "待办任务", "workbench.myTask.grid.action.process": "办理", - "workbench.myTask.grid.entity.businessKey": "业务流水号", - "workbench.myTask.grid.entity.businessDescription": "业务描述", - "workbench.myTask.grid.entity.processDefinitionName": "流程名称", - "workbench.myTask.grid.entity.activityName": "任务节点", - "workbench.myTask.grid.entity.taskDescription": "任务描述", - "workbench.myTask.grid.entity.prefixAssignee": "前一处理人", - "workbench.myTask.grid.entity.createTime": "任务开始日期", "workbench.myDoneTask.grid.title": "办理中任务", "workbench.myDoneTask.grid.action.view": "查看", - "workbench.myDoneTask.grid.entity.businessKey": "业务流水号", - "workbench.myDoneTask.grid.entity.businessDescription": "业务描述", - "workbench.myDoneTask.grid.entity.processDefinitionName": "流程名称", - "workbench.myDoneTask.grid.entity.activityName": "任务节点", - "workbench.myDoneTask.grid.entity.taskDescription": "任务描述", - "workbench.myDoneTask.grid.entity.prefixAssignee": "前一处理人", - "workbench.myDoneTask.grid.entity.createTime": "任务开始日期", "workbench.myFinishedTask.grid.title": "已完成任务", - "workbench.myFinishedTask.grid.action.view": "查看", - "workbench.myFinishedTask.grid.entity.businessKey": "业务流水号", - "workbench.myFinishedTask.grid.entity.businessDescription": "业务描述", - "workbench.myFinishedTask.grid.entity.processDefinitionName": "流程名称", - "workbench.myFinishedTask.grid.entity.activityName": "任务节点", - "workbench.myFinishedTask.grid.entity.taskDescription": "任务描述", - "workbench.myFinishedTask.grid.entity.prefixAssignee": "前一处理人", - "workbench.myFinishedTask.grid.entity.createTime": "任务开始日期" + "workbench.myFinishedTask.grid.action.view": "查看" } diff --git a/io.sc.platform.system.frontend/src/views/parameter/Parameter.vue b/io.sc.platform.system.frontend/src/views/parameter/Parameter.vue index 416dc298..fb218f35 100644 --- a/io.sc.platform.system.frontend/src/views/parameter/Parameter.vue +++ b/io.sc.platform.system.frontend/src/views/parameter/Parameter.vue @@ -104,7 +104,18 @@ label: $t('value'), type: 'w-text', showIf: (arg) => { - return !isExistsOptions(); + return !isExistsOptions() && !isMultiLineText(); + }, + }, + { + name: 'valueCodeMirror', + label: $t('value'), + type: 'w-code-mirror', + lang: 'json', + toolbar: false, + rows: 10, + showIf: (arg) => { + return !isExistsOptions() && isMultiLineText(); }, }, { @@ -154,6 +165,8 @@ treeGridRef.getEditorForm().setFieldValue('title', t(args.data.code)); if (isExistsOptions()) { treeGridRef.getEditorForm().setFieldValue('valueSelect', args.data.value); + } else if (isMultiLineText()) { + treeGridRef.getEditorForm().setFieldValue('valueCodeMirror', args.data.value); } else { treeGridRef.getEditorForm().setFieldValue('valueInput', args.data.value); } @@ -163,6 +176,8 @@ (args) => { if (isExistsOptions()) { args.data.value = treeGridRef.getEditorForm().getFieldValue('valueSelect'); + } else if (isMultiLineText()) { + args.data.value = treeGridRef.getEditorForm().getFieldValue('valueCodeMirror'); } else { args.data.value = treeGridRef.getEditorForm().getFieldValue('valueInput'); } @@ -198,4 +213,12 @@ const isExistsOptions = () => { } return false; }; + +const isMultiLineText = () => { + const row = treeGridRef.value.getSelectedRow(); + if (row) { + return row.multiLineText ? true : false; + } + return false; +}; diff --git a/io.sc.platform.system.frontend/src/views/workbench/MyDoneTask.vue b/io.sc.platform.system.frontend/src/views/workbench/MyDoneTask.vue index 74365137..87bdb581 100644 --- a/io.sc.platform.system.frontend/src/views/workbench/MyDoneTask.vue +++ b/io.sc.platform.system.frontend/src/views/workbench/MyDoneTask.vue @@ -5,40 +5,30 @@ :title="$t('workbench.myDoneTask.grid.title')" :config-button="true" :checkbox-selection="false" - db-click-operation="edit" - :sort-no="true" + db-click-operation="taskView" + :sort-no="false" :data-url="Environment.apiContextPath('/api/flowable/process/query/myDoneTask')" - :sort-by="['-createTime']" + :sort-by="['-startTime']" :query-form-cols-num="4" :query-form-fields="[ - { name: 'businessKey', label: $t('workbench.myDoneTask.grid.entity.businessKey'), type: 'w-text' }, { - name: 'processDefinitionId', - label: $t('workbench.myDoneTask.grid.entity.processDefinitionName'), - type: 'w-select', - options: processDefinitionsRef, - onUpdateValue: async (args: any) => { - const form = gridRef.getQueryForm(); - form.setFieldValue('taskDefinitionKey', undefined); - const field = form.getFields().taskDefinitionKey; - let options = []; - if (args?.value) { - const response = await axios.get(Environment.apiContextPath('/api/flowable/process/findUserTasksByProcessDeployId/' + args.value)); - if (response) { - options = response.data; - } - } - field.options = options; - }, + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 60)], + }, + { + name: 'custName', + label: $t('workbench.grid.entity.custName'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 200)], }, { - name: 'taskDefinitionKey', - label: $t('workbench.myDoneTask.grid.entity.activityName'), + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), type: 'w-select', - options: [], - queryOperator: 'equals', + options: processDefinitionOptionsRef, }, - { name: 'description', label: $t('workbench.myDoneTask.grid.entity.taskDescription'), type: 'w-text' }, ]" :toolbar-configure="{ noIcon: false }" :toolbar-actions="[ @@ -52,7 +42,7 @@ }, 'separator', { - name: 'process', + name: 'taskView', icon: 'bi-caret-right', label: $t('workbench.myDoneTask.grid.action.view'), enableIf: (args) => { @@ -64,20 +54,37 @@ }, ]" :columns="[ - { width: 150, name: 'businessKey', label: $t('workbench.myDoneTask.grid.entity.businessKey'), sortable: false }, - { width: '100%', name: 'businessDescription', label: $t('workbench.myDoneTask.grid.entity.businessDescription'), sortable: false }, { width: 150, - name: 'processDefinitionName', - label: $t('workbench.myDoneTask.grid.entity.processDefinitionName'), + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + }, + { width: '100%', name: 'custName', label: $t('workbench.grid.entity.custName') }, + { + width: 200, + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), + format: (value, row) => { + return processDefinitionsRef[value]; + }, + }, + { + width: 100, + name: 'processStatus', + label: $t('workbench.grid.entity.processStatus'), + format: (value, row) => { + return processStatusRef[value]; + }, + }, + { + width: 150, + name: 'assignee', + label: $t('workbench.grid.entity.currentAssignee'), format: (value, row) => { - return value + '_V' + row.processDefinitionVersion; + return row.assigneeName + '(' + row.assignee + ')'; }, }, - { width: 100, name: 'name', label: $t('workbench.myDoneTask.grid.entity.activityName') }, - { width: 100, name: 'description', label: $t('workbench.myDoneTask.grid.entity.taskDescription') }, - { width: 100, name: 'assignee', label: $t('workbench.myDoneTask.grid.entity.prefixAssignee') }, - { width: 150, name: 'createTime', label: $t('workbench.myDoneTask.grid.entity.createTime') }, + { width: 100, name: 'name', label: $t('workbench.grid.entity.activityName') }, ]" >
@@ -88,11 +95,13 @@ diff --git a/io.sc.platform.system.frontend/src/views/workbench/MyFinishedTask.vue b/io.sc.platform.system.frontend/src/views/workbench/MyFinishedTask.vue index ffe640a7..71b7eb0f 100644 --- a/io.sc.platform.system.frontend/src/views/workbench/MyFinishedTask.vue +++ b/io.sc.platform.system.frontend/src/views/workbench/MyFinishedTask.vue @@ -5,40 +5,30 @@ :title="$t('workbench.myFinishedTask.grid.title')" :config-button="true" :checkbox-selection="false" - db-click-operation="edit" - :sort-no="true" + db-click-operation="taskView" + :sort-no="false" :data-url="Environment.apiContextPath('/api/flowable/process/query/myFinishedTask')" - :sort-by="['-createTime']" + :sort-by="['-startTime']" :query-form-cols-num="4" :query-form-fields="[ - { name: 'businessKey', label: $t('workbench.myFinishedTask.grid.entity.businessKey'), type: 'w-text' }, { - name: 'processDefinitionId', - label: $t('workbench.myFinishedTask.grid.entity.processDefinitionName'), - type: 'w-select', - options: processDefinitionsRef, - onUpdateValue: async (args: any) => { - const form = gridRef.getQueryForm(); - form.setFieldValue('taskDefinitionKey', undefined); - const field = form.getFields().taskDefinitionKey; - let options = []; - if (args?.value) { - const response = await axios.get(Environment.apiContextPath('/api/flowable/process/findUserTasksByProcessDeployId/' + args.value)); - if (response) { - options = response.data; - } - } - field.options = options; - }, + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 60)], + }, + { + name: 'custName', + label: $t('workbench.grid.entity.custName'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 200)], }, { - name: 'taskDefinitionKey', - label: $t('workbench.myFinishedTask.grid.entity.activityName'), + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), type: 'w-select', - options: [], - queryOperator: 'equals', + options: processDefinitionOptionsRef, }, - { name: 'description', label: $t('workbench.myFinishedTask.grid.entity.taskDescription'), type: 'w-text' }, ]" :toolbar-configure="{ noIcon: false }" :toolbar-actions="[ @@ -52,7 +42,7 @@ }, 'separator', { - name: 'process', + name: 'taskView', icon: 'bi-caret-right', label: $t('workbench.myFinishedTask.grid.action.view'), enableIf: (args) => { @@ -64,20 +54,30 @@ }, ]" :columns="[ - { width: 150, name: 'businessKey', label: $t('workbench.myFinishedTask.grid.entity.businessKey'), sortable: false }, - { width: '100%', name: 'businessDescription', label: $t('workbench.myFinishedTask.grid.entity.businessDescription'), sortable: false }, { width: 150, - name: 'processDefinitionName', - label: $t('workbench.myFinishedTask.grid.entity.processDefinitionName'), + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + }, + { width: '100%', name: 'custName', label: $t('workbench.grid.entity.custName') }, + { + width: 200, + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), format: (value, row) => { - return value + '_V' + row.processDefinitionVersion; + return processDefinitionsRef[value]; }, }, - { width: 100, name: 'name', label: $t('workbench.myFinishedTask.grid.entity.activityName') }, - { width: 100, name: 'description', label: $t('workbench.myFinishedTask.grid.entity.taskDescription') }, - { width: 100, name: 'assignee', label: $t('workbench.myFinishedTask.grid.entity.prefixAssignee') }, - { width: 150, name: 'createTime', label: $t('workbench.myFinishedTask.grid.entity.createTime') }, + { + width: 100, + name: 'processStatus', + label: $t('workbench.grid.entity.processStatus'), + format: (value, row) => { + return processStatusRef[value]; + }, + }, + { width: 150, name: 'startTime', label: $t('workbench.grid.entity.startTime') }, + { width: 150, name: 'endTime', label: $t('workbench.grid.entity.endTime') }, ]" >
@@ -88,11 +88,13 @@ diff --git a/io.sc.platform.system.frontend/src/views/workbench/MyTask.vue b/io.sc.platform.system.frontend/src/views/workbench/MyTask.vue index 258d74b3..300ea4c9 100644 --- a/io.sc.platform.system.frontend/src/views/workbench/MyTask.vue +++ b/io.sc.platform.system.frontend/src/views/workbench/MyTask.vue @@ -5,40 +5,30 @@ :title="$t('workbench.myTask.grid.title')" :config-button="true" :checkbox-selection="false" - db-click-operation="edit" - :sort-no="true" + db-click-operation="process" + :sort-no="false" :data-url="Environment.apiContextPath('/api/flowable/process/query/myTask')" - :sort-by="['-createTime']" + :sort-by="['-startTime']" :query-form-cols-num="4" :query-form-fields="[ - { name: 'businessKey', label: $t('workbench.myTask.grid.entity.businessKey'), type: 'w-text' }, { - name: 'processDefinitionId', - label: $t('workbench.myTask.grid.entity.processDefinitionName'), - type: 'w-select', - options: processDefinitionsRef, - onUpdateValue: async (args: any) => { - const form = gridRef.getQueryForm(); - form.setFieldValue('taskDefinitionKey', undefined); - const field = form.getFields().taskDefinitionKey; - let options = []; - if (args?.value) { - const response = await axios.get(Environment.apiContextPath('/api/flowable/process/findUserTasksByProcessDeployId/' + args.value)); - if (response) { - options = response.data; - } - } - field.options = options; - }, + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 60)], + }, + { + name: 'custName', + label: $t('workbench.grid.entity.custName'), + type: 'w-text', + rules: [FormValidators.lengthRange(0, 200)], }, { - name: 'taskDefinitionKey', - label: $t('workbench.myTask.grid.entity.activityName'), + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), type: 'w-select', - options: [], - queryOperator: 'equals', + options: processDefinitionOptionsRef, }, - { name: 'description', label: $t('workbench.myTask.grid.entity.taskDescription'), type: 'w-text' }, ]" :toolbar-configure="{ noIcon: false }" :toolbar-actions="[ @@ -64,20 +54,37 @@ }, ]" :columns="[ - { width: 150, name: 'businessKey', label: $t('workbench.myTask.grid.entity.businessKey'), sortable: false }, - { width: '100%', name: 'businessDescription', label: $t('workbench.myTask.grid.entity.businessDescription'), sortable: false }, { width: 150, - name: 'processDefinitionName', - label: $t('workbench.myTask.grid.entity.processDefinitionName'), + name: 'custNo', + label: $t('workbench.grid.entity.custNo'), + }, + { width: '100%', name: 'custName', label: $t('workbench.grid.entity.custName') }, + { + width: 200, + name: 'processDefinitionKey', + label: $t('workbench.grid.entity.taskType'), format: (value, row) => { - return value + '_V' + row.processDefinitionVersion; + return processDefinitionsRef[value]; }, }, - { width: 100, name: 'name', label: $t('workbench.myTask.grid.entity.activityName') }, - { width: 100, name: 'description', label: $t('workbench.myTask.grid.entity.taskDescription') }, - { width: 100, name: 'assignee', label: $t('workbench.myTask.grid.entity.prefixAssignee') }, - { width: 150, name: 'createTime', label: $t('workbench.myTask.grid.entity.createTime') }, + { + width: 100, + name: 'processStatus', + label: $t('workbench.grid.entity.processStatus'), + format: (value, row) => { + return processStatusRef[value]; + }, + }, + // { + // width: 150, + // name: 'assignee', + // label: $t('workbench.grid.entity.previousAssignee'), + // format: (value, row) => { + // return row.previousAssigneeName + '(' + row.previousAssignee + ')'; + // }, + // }, + { width: 150, name: 'startTime', label: $t('workbench.grid.entity.startTime') }, ]" >
@@ -88,11 +95,13 @@ diff --git a/io.sc.platform.system/src/main/java/io/sc/platform/system/parameter/controller/ParameterWebController.java b/io.sc.platform.system/src/main/java/io/sc/platform/system/parameter/controller/ParameterWebController.java index 9ef4195c..a4277e8e 100644 --- a/io.sc.platform.system/src/main/java/io/sc/platform/system/parameter/controller/ParameterWebController.java +++ b/io.sc.platform.system/src/main/java/io/sc/platform/system/parameter/controller/ParameterWebController.java @@ -68,6 +68,7 @@ public class ParameterWebController extends RestCrudController