Compare commits

...

170 Commits
SAMS-R ... rf

Author SHA1 Message Date
bruce d2e4ea3449 引入ruoyi、flowable。 2025-05-06 17:27:10 +08:00
tony 28e09339dd
!18 fix:修改流程设计器中常规信息无“节点描述”且“节点描述”无法修改、保存问题
Merge pull request !18 from Mr.Guo/master
2025-04-16 22:39:40 +00:00
Tony 3374ec8686 Merge remote-tracking branch 'origin/master' 2025-04-17 06:38:05 +08:00
Tony 7d473d740f 调整流程模块版本 2025-04-17 06:37:26 +08:00
Tony 94eb038184 Merge remote-tracking branch 'refs/remotes/ruoyi/master'
# Conflicts:
#	README.md
#	pom.xml
#	ruoyi-ui/package.json
#	ruoyi-ui/src/views/index.vue
#	ruoyi-ui/vue.config.js
2025-04-17 06:32:26 +08:00
Mr.Guo 8d490a9390
fix:修改流程设计器中常规信息无“节点描述”且“节点描述”无法修改、保存问题
Signed-off-by: Mr.Guo <guofu_gh@163.com>
2025-01-08 17:15:56 +00:00
tony 808e9d8c65
update README.md.
Signed-off-by: tony <846249920@qq.com>
2024-09-28 00:02:22 +00:00
tony 3bbaf2bd99
update README.md.
Signed-off-by: tony <846249920@qq.com>
2024-09-27 11:55:27 +00:00
tony 42b2e615a9
update README.md.
Signed-off-by: tony <846249920@qq.com>
2024-09-27 11:55:00 +00:00
tony 9d1948a616
update README.md.
Signed-off-by: tony <846249920@qq.com>
2024-09-27 11:54:42 +00:00
tony f81179b938
update README.md.
Signed-off-by: tony <846249920@qq.com>
2024-09-27 11:53:47 +00:00
Tony 301bfac904 style: 流程设计面板去除节点描述配置 2024-09-27 18:29:08 +08:00
Tony a21a97d76b Merge remote-tracking branch 'ruoyi/master' 2024-09-27 18:29:01 +08:00
Tony a702238c39 style: 优化issue模板 2024-09-24 08:58:36 +08:00
Tony a3caeeb2a2 Merge remote-tracking branch 'ruoyi/master' 2024-09-24 08:54:26 +08:00
Tony 51e1eecfea style: change README.md 2024-09-06 08:07:17 +08:00
Tony 80d1c4be59 fate: change README.md 2024-09-05 23:57:04 +08:00
zhuyong 73acc6453c fate: 升级流程设计器,表单设计器 2024-09-05 23:51:27 +08:00
zhuyong 27b56d3a01 Merge remote-tracking branch 'refs/remotes/ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/package.json
#	ruoyi-ui/src/views/index.vue
#	ruoyi-ui/vue.config.js
2024-09-05 22:35:52 +08:00
tony 19e44336f7 Merge remote-tracking branch 'origin/master' 2024-06-02 21:50:26 +08:00
tony 370d647655 doc: changes README.md 2024-06-02 21:50:09 +08:00
tony d7a99f349b
!17 修复bpmn:SequenceFlow切换时panel不更新的问题
Merge pull request !17 from 黑岩仔/master
2024-06-02 13:40:53 +00:00
tony 88df695389
!16 修复了当流程发起者的部门为空时,打开已办任务报错的问题
Merge pull request !16 from undefined/master
2024-06-02 13:40:30 +00:00
heyizhao 470c5a3bdd fix:修复bpmn:SequenceFlow切换时panel不更新的问题 2024-05-17 09:56:54 +08:00
undefined 906cc50a07
fix null dept
Signed-off-by: undefined <13834672+asdadadad@user.noreply.gitee.com>
2024-04-16 11:09:18 +00:00
tony f4b69ac55a Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/src/views/index.vue
#	ruoyi-ui/vue.config.js
2024-03-12 08:10:01 +08:00
tony b44110eaae feat: 同步若依 3.8.7 2023-12-12 16:18:00 +08:00
tony 7752a502ac Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/package.json
#	ruoyi-ui/src/utils/index.js
#	ruoyi-ui/src/views/index.vue
2023-12-12 16:16:57 +08:00
tony e41d99e6aa
!14 支持附件上传
Merge pull request !14 from 李明/forked-master
2023-12-11 00:48:47 +00:00
liming 904728ef59 支持附件上传 2023-12-10 20:46:37 +08:00
tony aa18507143 Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/src/views/index.vue
2023-11-11 07:28:41 +08:00
tony fdc4206b9b changes README.md 2023-11-11 07:25:46 +08:00
tony 5ceb10481a docs: 初始化sql更新 2023-09-14 11:13:00 +08:00
tony 7f14a9a501 fix: 修复启动错误问题 2023-09-13 08:01:39 +08:00
tony ebb31057ec fix: 版本号同步 2023-09-01 09:56:06 +08:00
tony 84d107a4af Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/src/views/index.vue
2023-09-01 09:49:24 +08:00
tony f1bf2fdc9d Merge remote-tracking branch 'ruoyi/master' 2023-07-27 15:24:58 +08:00
tony 7e8184f6a1 fix: 版本号同步 2023-07-27 15:24:09 +08:00
tony 700cb52ba0 docs: 更新新群号: 658810320 2023-07-16 12:04:07 +08:00
tony 438327586e docs: 更新新群号: 658810320 2023-07-16 11:50:23 +08:00
tony 8d314f4cc9 docs: 更新新群号: 658810320 2023-07-16 11:47:48 +08:00
tony c92a2f1c15 Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	README.md
#	ruoyi-ui/package.json
#	ruoyi-ui/src/assets/styles/index.scss
#	ruoyi-ui/src/utils/generator/js.js
#	ruoyi-ui/src/views/index.vue
#	ruoyi-ui/vue.config.js
2023-07-12 08:53:31 +08:00
tony 5db00f34a0 fix: 去除流程校验器 2023-04-02 15:02:19 +08:00
tony e0943e55e3 docs: 新增移动端演示地址 2023-04-01 16:51:23 +08:00
tony d2eff3fdec fix: 保存表单选择组件保存未生效 2023-03-30 21:30:41 +08:00
tony 1143924c8c fix: 新增表单选择组件保存未生效 2023-03-30 21:22:33 +08:00
tony 138ee3b117 fix: 表单属性为加载问题 2023-03-30 20:51:20 +08:00
tony 45884f31a8 perf: 去除流程校验器,有需求可自行添加 2023-03-30 19:17:01 +08:00
tony f9f8a293a3 Merge remote-tracking branch 'ruoyi/master'
# Conflicts:
#	ruoyi-ui/src/views/tool/build/index.vue
2023-03-26 16:56:15 +08:00
tony f816b906ae
!10 【Fix】修复文件上传成功触发非空校验的问题;增加文件预览和下载;
Merge pull request !10 from 逸尘/master
2023-03-24 00:20:35 +00:00
逸尘 85d74fafcf fix: 修复上传组件未与表单数据双向绑定的问题,增加文件预览代码 2023-03-23 00:56:46 +08:00
tony d2a990de85
!9 新增内置监听器功能
Merge pull request !9 from 马铃薯头/master
2023-03-21 12:05:46 +00:00
xlsea f7f1d38c9a 新增内置监听器功能 2023-03-21 13:46:34 +08:00
tony de22d90a72
!8 修改到期时间时间格式
Merge pull request !8 from 马铃薯头/master
2023-03-17 04:38:31 +00:00
xlsea 9d79fd9b17 修改到期时间时间格式 2023-03-17 11:41:49 +08:00
tony adb2fe1cc6 docs: 更新演示地址 2023-03-16 23:33:05 +08:00
tony c5a94aa6f9 fix: 修复监听器中使用fastjson序列化参数导致StackOverflowError问题 2023-03-13 20:38:26 +08:00
tony 3727c241b0 fix: 修复表单设计器未引入draggable组件问题 2023-03-10 11:24:55 +08:00
tony 372b4c674a feat: 动态流程校验规则 2023-03-10 11:03:40 +08:00
tony 6c3d5489a1
!7 增加bpmnlint自定义校验规则示例
Merge pull request !7 from 马铃薯头/master
2023-03-10 01:31:56 +00:00
xlsea 912e07625f 增加bpmnlint自定义校验规则示例 2023-03-10 09:20:35 +08:00
tony ff2ad94368 fix: 处理流程校验字符串未替换问题 2023-03-09 20:08:47 +08:00
tony b437c911e4
!6 bpmn.js整合bpmn-js-lint
Merge pull request !6 from 马铃薯头/master
2023-03-09 12:03:29 +00:00
xlsea 5c5c41ce1b bpmn.js整合bpmn-js-lint 2023-03-09 19:53:32 +08:00
tony b55c563811
!5 流程设计导入成功返回的状态码不对
Merge pull request !5 from 马铃薯头/master
2023-03-09 07:38:59 +00:00
xlsea 07053bcd7c 导入失败返回错误信息 2023-03-09 15:20:18 +08:00
tony bd47623b68 fix: 修复选择候选人员数据为空导致页面加载失败问题 2023-03-07 20:11:33 +08:00
tony 6361cef3ed Merge remote-tracking branch 'ruoyi/master' 2023-03-06 20:19:28 +08:00
tony fe8059c419 fix: 只展示任务节点办理人信息 2023-03-02 21:17:25 +08:00
tony a4a12075e5 Merge remote-tracking branch 'ruoyi/master' 2023-03-02 20:31:19 +08:00
tony 38b5fd2773 feat: 已发任务列表展示当前任务节点办理人信息 2023-03-02 20:30:24 +08:00
tony a94131e061 fix: 修复关闭子页面后主页面数据不刷新问题 2023-02-27 20:16:49 +08:00
tony 3cf649a932
!4 排除flowable自带的权限认证
Merge pull request !4 from 马铃薯头/master
2023-02-24 06:48:54 +00:00
xlsea 59e01e69b7 排除flowable自带的权限认证 2023-02-24 14:47:11 +08:00
tony 90fbaee249 docs: sys_oper_log 新增cost_time 2023-02-23 23:37:29 +08:00
tony 028b7c3259 docs: sys_oper_log 新增cost_time 2023-02-23 23:35:30 +08:00
tony 4197dc24db docs: 数据库导入说明 2023-02-23 13:39:29 +08:00
tony b5fa2cd283 Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue 2023-02-22 17:36:28 +08:00
tony 8e70f5e54e feat: 添加Vue3版本演示地址 2023-02-11 13:12:07 +08:00
tony e080553f78 feat: 同步至若依最新版 2023-02-10 09:05:38 +08:00
tony 736db6506f fix: 修复会签节点无法审批问题 2023-02-09 16:02:02 +08:00
tony e63dc6f458 fix: 修复会签节点无法审批问题 2023-02-09 13:47:17 +08:00
tony 9a12856671 fix: 修复会签节点无法审批问题 2023-02-09 12:10:29 +08:00
tony f1ac93030f fix: 修复流程设计修改时 “表单标识key” 无法删除问题 2023-02-08 11:05:08 +08:00
tony 9942a301d0
!2 修复最后一个任务节点挂载子表单formData没有值的问题
Merge pull request !2 from 马铃薯头/master
2023-02-07 07:40:18 +00:00
xlsea 53ce64de4f 修复最后一个任务节点挂载子表单formData没有值的问题 2023-02-07 15:14:14 +08:00
tony e0669573fb fix: 修复表单设计器初始化加载缓存数据问题 2023-02-07 13:41:35 +08:00
tony 5e35251d2e fix: 修复人员未分配部门时获取部门信息错误问题 2023-02-06 14:34:40 +08:00
tony 8cc95aec1b fix: 修复人员未分配部门时获取部门信息错误问题 2023-02-06 14:32:16 +08:00
tony cd9f74f859 fix: 修复表格翻页后已选择数据失效问题 2023-02-06 14:14:41 +08:00
tony e3032608ea fix: 删除xml中已选择数据类型节点 2023-01-13 15:00:01 +08:00
tony 926f8cca63 fix: 修复radio显示 2023-01-12 09:07:16 +08:00
tony 0a2d2f0c3c fix: 修复流程设计时流程候选人员无法回显问题 2023-01-12 08:52:40 +08:00
tony f982d2f7fe fix: 隐藏流程候选信息radio框label值 2023-01-12 08:50:52 +08:00
tony ae3ff10a5e fix: 修复流程线和结束节点监听器无法回显问题 2023-01-11 13:23:27 +08:00
tony 582712d764 docs: 更新README.md 2023-01-07 00:18:53 +08:00
tony 62c668d94c docs: 更新README.md 2023-01-07 00:12:42 +08:00
tony 2d315dff73 docs: 更新README.md 2023-01-07 00:11:11 +08:00
tony bc8cd6c16a docs: 更新README.md 2023-01-07 00:09:56 +08:00
tony 9eb74802ad docs: issue发帖格式 2023-01-06 23:08:51 +08:00
tony 6f78427285 fix: 修复审批任务选择接收人后无法提交流程问题 2023-01-06 22:15:51 +08:00
tony 95d0315dcf fix: 修复待办任务无法审批流程问题 2023-01-06 21:53:41 +08:00
tony b80568dfd7 fix: 流程设计页面优化 2023-01-06 21:27:54 +08:00
tony 942f5e1f54 fix: 修复流程设计保存成功后页面未刷新问题 2023-01-06 15:11:33 +08:00
tony 40fcf5ced2 fix: 处理流程设计切换用户类型时未清空已选中值问题 2023-01-06 14:05:50 +08:00
tony 31e14dd7a3 fix: 去除流程设计器跳过表达式值为null 2023-01-06 10:38:42 +08:00
tony de8e4d5881 style: 调整系统默认主题色 2023-01-05 13:53:57 +08:00
tony 0faf27b78d fix: 修复el-radio__label导致文本无法正常显示问题 2023-01-05 09:00:10 +08:00
tony ad613aee03 docs: 增加流程演示图 2023-01-04 17:23:05 +08:00
tony 8138f0bc1c docs: 更新README.md 2023-01-04 16:43:14 +08:00
tony 90bb3da72e docs: 更新README.md 2023-01-04 16:33:01 +08:00
tony aeb4a50d1a feat: 同步若依 3.8.5 2023-01-01 17:14:43 +08:00
tony eddbeefb40 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	README.md
#	ruoyi-ui/package.json
#	ruoyi-ui/src/views/index.vue
2023-01-01 14:01:42 +08:00
tony c1b786e0e8 fix: 表单设计器富文本加载错误 2022-12-30 10:24:38 +08:00
tony 3cf79bd188 fix: sql参数错误 2022-12-29 10:36:38 +08:00
tony f70fa07209 docs: 流程设计说明 2022-12-29 10:15:55 +08:00
tony 293f9721cb docs: FUNDING.yml更新 2022-12-28 22:25:08 +08:00
tony 9cdbdc51b3 fix: 开始节点展示存在问题 2022-12-28 17:57:05 +08:00
tony bee4603d12 docs: 文档地址更新 2022-12-28 17:47:46 +08:00
tony f7a20f2f49 docs: 新增tony-flowable.sql 2022-12-28 16:40:30 +08:00
tony 2247c97638 docs: 更新README.md 2022-12-28 16:35:56 +08:00
tony 5728864bcd fix: 去除流程详情多余关闭按钮 2022-12-28 16:34:29 +08:00
tony 53c14197dc feat: 流程记录展示开始,结束节点 2022-12-28 13:42:15 +08:00
tony d6a22e8489 fix: 流程详情页面关闭按钮重复 2022-12-27 22:01:55 +08:00
tony 4b6ff48fe9 style: 更换@author 2022-12-27 14:51:19 +08:00
tony 37957f7cad fix: 修复流程设计切换人员类型后列表数据未更新问题 2022-12-27 14:39:11 +08:00
tony bdf4ebf03e fix: 去除<el-dialog/>中:modal="false"属性 2022-12-27 14:02:56 +08:00
tony 2ffb755f8c fix: 去除流程设计器节点颜色选择 2022-12-27 08:58:20 +08:00
tony ae4b725f2e feat:flowable 依赖调整 2022-12-26 18:56:00 +08:00
tony 89ee31b140 feat: 新增多实例加签,减签后端实现 2022-12-26 16:53:17 +08:00
tony 6704ac5c51 fix: 取消申请流程优化 2022-12-26 15:10:46 +08:00
tony 8c393c4f44 fix: 待办任务只查询当前用户所属任务 2022-12-26 11:38:34 +08:00
tony 59935dd2f2 feat: 更新流程表相关ID生成规则 2022-12-26 11:37:28 +08:00
tony 7dc7f92c2d fix: 修复已发流程列表删除多个问题 2022-12-26 09:47:53 +08:00
tony 5dce8b6182 fix: 修复待办任务列表所有用户都可查看同一任务问题 2022-12-26 09:22:17 +08:00
tony 1446dcb72c fix: 修复流程设计器中模态框加载问题 2022-12-26 09:22:06 +08:00
tony ad891029fe fix: 修复流程设计器中指定人员后发起流程还需要选择接受人员问题 2022-12-25 21:29:30 +08:00
tony 08a43e8f4a feat: 去掉流程定义表单中导入按钮 2022-12-25 17:09:01 +08:00
tony c74a1c8fc2 feat: 流程设计器全屏展示 2022-12-25 17:07:00 +08:00
tony ffd7a7ba41 feat: 开始节点key更新 2022-12-25 15:37:34 +08:00
tony 532f791cc3 feat: 新增流程监听 2022-12-25 14:17:29 +08:00
tony ff0cf07746 feat: 新增流程设计器color-picker 2022-12-25 10:49:55 +08:00
tony b57ccd6a8f fix: 更新流程设计面板 2022-12-24 20:05:33 +08:00
tony 56864b81f4 Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue 2022-12-24 18:55:57 +08:00
tony b2ff2d6b2d fix: 更新流程设计面板 2022-12-24 18:54:59 +08:00
tony 559caf1fdc fix: 修复新增监听器错误问题moddleExtensions 2022-12-19 21:20:26 +08:00
tony ffe870872f feat: 更新依赖版本 2022-12-19 19:56:24 +08:00
tony 6d390605ad feat: 更新依赖版本 2022-12-19 14:41:58 +08:00
tony 3a61651a98 feat: 节点表单信息配置 2022-12-19 14:21:47 +08:00
tony 682592fcdf feat: 任务节点单独设置表单 2022-12-18 21:55:50 +08:00
tony bfd75ac552 fix: 会签任务可选择任务接收人 2022-12-18 17:20:40 +08:00
tony be62877c37 fix: 优化已完成流程节点显示问题 2022-12-18 15:45:15 +08:00
tony 1486beb897 fix: 修复流程设计时多实例数据回显问题 2022-12-18 13:37:59 +08:00
tony 9436bb4154 fix: 修复流程xml更新后在线查看数据未更新问题 2022-12-17 23:47:59 +08:00
tony 683528d5dd feat: 解决表单设计器数据缓存问题 2022-12-17 10:43:11 +08:00
tony 2f5fed6f44 feat: 表单数据保存修复 2022-12-16 21:52:53 +08:00
tony bc42ac6005 feat: 流程设计器显示优化 2022-12-16 14:53:33 +08:00
tony 15fd39fe98 feat: 监听器处理 2022-12-16 14:53:07 +08:00
tony a899003440 feat: 流程详情页面优化显示 2022-12-16 11:17:20 +08:00
tony 295a46662e feat: 开始节点获取 2022-12-15 18:24:12 +08:00
tony dd11a1ac66 feat: 更新按钮显示 2022-12-15 08:30:57 +08:00
tony 8c8dfa1c0f feat: 流程设计数据回显 2022-12-15 08:13:53 +08:00
tony f8a4d8f9a7 feat: 候选角色组可选表达式 2022-12-14 16:25:11 +08:00
tony be2171de98 feat: 同步若依 2022-12-13 22:43:13 +08:00
tony e37577f7fb feat: 流程设计模块更新用户类型 2022-12-13 22:34:34 +08:00
tony e093855bd9 feat: 流程分类处理 2022-12-12 11:25:20 +08:00
tony 22de6bafc1 feat: 分组流程详情查看 2022-12-12 11:02:24 +08:00
tony 83bb7cd5ba feat: 我发起流程加载处理优化 2022-12-12 08:18:45 +08:00
tony ae0226a8f4 feat: flowable前端改造 2022-12-11 21:08:14 +08:00
zhuyong dcbef01709 feat: flowable后端改造 2022-12-11 17:43:31 +08:00
313 changed files with 37495 additions and 4645 deletions

View File

@ -0,0 +1,54 @@
name: Bug 反馈
description: 当你在代码中发现了一个 Bug导致应用崩溃或抛出异常或者有一个组件存在问题或者某些地方看起来不对劲。
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
感谢对项目的支持与关注。在提出问题之前,请确保你已查看相关开发或使用文档:
- https://www.yuque.com/u1024153/icipor
- https://www.flowable.com/open-source/docs/bpmn/ch02-GettingStarted/
- type: checkboxes
attributes:
label: 这个问题是否已经存在?
options:
- label: 我已经搜索过现有的问题 (https://gitee.com/tony2y/RuoYi-flowable/issues)
required: true
- type: textarea
attributes:
label: 如何复现
description: 请详细告诉我们如何复现你遇到的问题,如涉及代码,可提供一个最小代码示例,并使用反引号```附上它
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: textarea
attributes:
label: 预期结果
description: 请告诉我们你预期会发生什么。
validations:
required: true
- type: textarea
attributes:
label: 实际结果
description: 请告诉我们实际发生了什么。
validations:
required: true
- type: textarea
attributes:
label: 截图或视频
description: 如果可以的话,上传任何关于 bug 的截图。
value: |
[在这里上传图片]
- type: dropdown
id: version
attributes:
label: 版本
description: 你当前正在使用我们软件的哪个版本/分支?
options:
- master (默认)
validations:
required: true

View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 使用文档
url: https://www.yuque.com/u1024153/icipor
about: 提交 Issue 前请先阅读文档,包含基本功能使用、介绍和常见问题解答等内容

View File

@ -0,0 +1,43 @@
name: 功能建议
description: 对本项目提出一个功能建议
title: "[功能建议]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
感谢提出功能建议,我们将仔细考虑!
- type: textarea
id: related-problem
attributes:
label: 你的功能建议是否和某个问题相关?
description: 清晰并简洁地描述问题是什么,例如,当我...时,我总是感到困扰。
validations:
required: false
- type: textarea
id: desired-solution
attributes:
label: 你希望看到什么解决方案?
description: 清晰并简洁地描述你希望发生的事情。
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: 你考虑过哪些替代方案?
description: 清晰并简洁地描述你考虑过的任何替代解决方案或功能。
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: 你有其他上下文或截图吗?
description: 在此处添加有关功能请求的任何其他上下文或截图。
validations:
required: false
- type: checkboxes
attributes:
label: 意向参与贡献
options:
- label: 我有意向参与具体功能的开发实现并将代码贡献回到仓库
required: false

2
.github/FUNDING.yml vendored
View File

@ -1 +1 @@
custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html
custom: https://foruda.gitee.com/images/1672215449995765124/596b46c3_2042292.png

213
LICENSE
View File

@ -1,20 +1,201 @@
The MIT License (MIT)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2018 RuoYi
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
1. Definitions.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright (c) 2022 tony Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

132
README.md
View File

@ -1,95 +1,91 @@
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Flowable</h1>
<h4 align="center">基于RuoYi+Flowable 6.x的工作流管理平台</h4>
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.8.9</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.8.9-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
<a href="https://gitee.com/tony2y/RuoYi-flowable/stargazers"><img src="https://gitee.com/tony2y/RuoYi-flowable/badge/star.svg?theme=dark?theme=dark"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
基于RuoYi-vue + Flowable 6.8.x 的工作流管理平台 ~
- 不定时同步[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)至最新版本。
- 前端采用Vue、Element UI。
- 后端采用Spring Boot、Spring Security、Redis & Jwt。
- 权限认证使用Jwt支持多终端认证系统。
- 支持加载动态权限菜单,多方式轻松权限控制.
- 项目地址:[Gitee](https://gitee.com/tony2y/RuoYi-flowable.git)&nbsp;&nbsp;&nbsp;[Github](https://github.com/tony2y/RuoYi-flowable.git)
- 阿里云折扣场:[点我进入](https://www.aliyun.com/activity/daily/bestoffer?userCode=q2b8atsa),腾讯云秒杀场:[点我进入](https://curl.qcloud.com/W5KFkBG4)&nbsp;&nbsp;
- 阿里云优惠券:[点我领取](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=q2b8atsa),腾讯云优惠券:[点我领取](https://curl.qcloud.com/AacfyRxq)&nbsp;&nbsp;
- 特别鸣谢:[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
- 在线流程设计器
- 在线流程表单设计器
- 单节点配置表单
- 多实例会签任务
- 任务节点配置任务/执行监听器
- 动态配置任务候选人
- 其它流程相关功能点
## 在线体验
## 演示地址
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
- 开源版演示地址http://open.tony2y.top
- Vue2 / Vue3 演示地址(付费版)http://vue3.tony2y.top
- 移动端演示(h5)地址http://mobile.tony2y.top
- 使用文档https://www.yuque.com/u1024153/icipor
演示地址http://vue.ruoyi.vip
文档地址http://doc.ruoyi.vip
## 其它业务系统
- [[ 智慧农业认养系统 ]](https://gitee.com/tony2y/smart-breed)基于Java + SpringBoot + Mybatis Plus + Redis + Vue + antdv支持认养、商城、营销、会员、进销存、多租户等功能包含小程序系统管理后台。
- [[ 智慧景区管理系统 ]](https://gitee.com/tony2y/scenic-spot)基于Java + SpringBoot + Mybatis Plus + Redis + Vue + antdv支持景区管理、售票、地块管理、认养、商城、农资管理、积分兑换等功能包含小程序系统管理后台。
## 联系方式
付费版咨询、技术咨询、项目定制开发等其它支持可扫码添加微信进行沟通交流。
![微信](https://foruda.gitee.com/images/1673021725627728693/f3d6216b_2042292.jpeg)
## 工作流交流群
### QQ群号
- ~~群1: 782924350(1)~~-已满、
- 群二: 658810320(2)
- star 项目后复制群号申请入群。
## 请作者喝杯咖啡 ~ (*^▽^*)
<img src="https://foruda.gitee.com/images/1672215449995765124/596b46c3_2042292.png">
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
<td><img src="https://foruda.gitee.com/images/1672821697044447970/6bc09d47_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1672821770531098361/972cf362_2042292.png"/></td>
</tr>
<tr>
<td><img src="https://foruda.gitee.com/images/1725580931106887779/326bf7f6_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1725580975079462113/f13c15f8_2042292.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
<td><img src="https://foruda.gitee.com/images/1725581014458193305/f58bf176_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1725581065882554528/be686bb6_2042292.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
<td><img src="https://foruda.gitee.com/images/1725581121073519190/3f99f2fc_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1725581177903309316/70d24a73_2042292.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
<td><img src="https://foruda.gitee.com/images/1672214208441821384/b90c26be_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1672214266396146807/3e6408a3_2042292.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
<td><img src="https://foruda.gitee.com/images/1672214318671690501/80c425ed_2042292.png"/></td>
<td><img src="https://foruda.gitee.com/images/1672214425678628903/251c4200_2042292.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/已满-101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/已满-167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](https://img.shields.io/badge/已满-104748341-blue.svg)](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](https://img.shields.io/badge/已满-160110482-blue.svg)](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](https://img.shields.io/badge/已满-170801498-blue.svg)](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](https://img.shields.io/badge/已满-108482800-blue.svg)](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](https://img.shields.io/badge/已满-101046199-blue.svg)](https://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](https://img.shields.io/badge/已满-136919097-blue.svg)](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](https://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](https://img.shields.io/badge/已满-174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [![加入QQ群](https://img.shields.io/badge/已满-161281055-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [![加入QQ群](https://img.shields.io/badge/已满-138988063-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [![加入QQ群](https://img.shields.io/badge/已满-151450850-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [![加入QQ群](https://img.shields.io/badge/已满-224622315-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [![加入QQ群](https://img.shields.io/badge/已满-287842588-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [![加入QQ群](https://img.shields.io/badge/已满-187944233-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) [![加入QQ群](https://img.shields.io/badge/228578329-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G6r5KGCaa3pqdbUSXNIgYloyb8e0_L0D&authKey=4w8tF1eGW7%2FedWn%2FHAypQksdrML%2BDHolQSx7094Agm7Luakj9EbfPnSTxSi2T1LQ&noverify=0&group_code=228578329) 点击按钮入群。
## 推荐
大家在使用本项目时,推荐结合贺波老师的书
[《深入Flowable流程引擎核心原理与高阶实战》](https://item.jd.com/14804836.html)学习。这本书得到了Flowable创始人Tijs Rademakers亲笔作序推荐对系统学习和深入掌握Flowable的用法非常有帮助。
<img src="https://foruda.gitee.com/images/1727432593738798662/46c08088_2042292.png" width="800" height="1000"/>

47
pom.xml
View File

@ -3,15 +3,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<version>3.8.9</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.8.9</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -35,6 +35,7 @@
<logback.version>1.2.13</logback.version>
<spring-security.version>5.7.12</spring-security.version>
<spring-framework.version>5.3.39</spring-framework.version>
<flowable.version>6.8.0</flowable.version>
</properties>
<!-- 依赖声明 -->
@ -218,6 +219,41 @@
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-flowable</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>sams_sms</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>sams_ams</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -228,6 +264,9 @@
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>sams_sms</module>
<module>sams_ams</module>
<module>ruoyi-flowable</module>
</modules>
<packaging>pom</packaging>
@ -271,4 +310,4 @@
</pluginRepository>
</pluginRepositories>
</project>
</project>

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>
@ -61,6 +61,25 @@
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-flowable</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>sams_sms</artifactId>
<version>3.8.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>sams_ams</artifactId>
<version>3.8.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,50 @@
package com.ruoyi.web.controller.common;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.NonCaptureException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/file")
public class FileUploadController {
private final Logger log = LoggerFactory.getLogger(FileUploadController.class);
@Autowired
private ServerConfig serverConfig;
@Anonymous
@PostMapping("/upload")
@SuppressWarnings("DuplicatedCode")
public AjaxResult uploadFile(MultipartFile file) {
try {
log.info("文件 {} 上传中...", file.getOriginalFilename());
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
log.info("文件 {} 上传成功!", file.getOriginalFilename());
return ajax;
} catch (Exception e) {
throw new NonCaptureException(StringUtils.format("文件 {} 上传失败!", file.getOriginalFilename()), e);
}
}
}

View File

@ -57,6 +57,16 @@ public class SysDeptController extends BaseController
return success(depts);
}
/**
*
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
}
/**
*
*/

View File

@ -6,16 +6,16 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3307/sams_rf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
password: password
password: admin123
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
@ -39,7 +39,7 @@ spring:
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
webStatFilter:
enabled: true
statViewServlet:
enabled: true
@ -58,4 +58,4 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
multi-statement-allow: true

View File

@ -127,3 +127,10 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# flowable相关表
flowable:
# true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用)
database-schema-update: true
# 关闭定时任务JOB
async-executor-activate: false

View File

@ -1,31 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<property name="log.path" value="/Users/2y/zhj/logs" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 彩色日志 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- &lt;!&ndash; 日志输出格式 &ndash;&gt;-->
<!-- <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />-->
<!-- Console 设置默认输出格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符 -->
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
@ -33,16 +46,16 @@
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
@ -50,16 +63,16 @@
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
@ -70,23 +83,23 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>

View File

@ -0,0 +1,43 @@
package com.ruoyi.common.exception;
/**
*
*
* @author ruoyi
*/
public class CustomException extends RuntimeException
{
private static final long serialVersionUID = 1L;
private Integer code;
private String message;
public CustomException(String message)
{
this.message = message;
}
public CustomException(String message, Integer code)
{
this.message = message;
this.code = code;
}
public CustomException(String message, Throwable e)
{
super(message, e);
this.message = message;
}
@Override
public String getMessage()
{
return message;
}
public Integer getCode()
{
return code;
}
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.common.exception;
/**
*
*
* @author liming
* @date 2023/12/10 20:11
*/
public class NonCaptureException extends RuntimeException {
public NonCaptureException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-flowable</artifactId>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<!--常用工具类 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- JSON工具类 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<!-- 排除flowable自带的权限认证 -->
<exclusions>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-security</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<!-- websocket -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!--el表达式计算-->
<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
<version>5.3.3</version>
</dependency>
</dependencies>
<!-- <build>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>

View File

@ -0,0 +1,80 @@
package com.ruoyi.flowable.common.constant;
/**
*
*
* @author Tony
* @date 2021/4/17 22:46
*/
public class ProcessConstants {
/**
*
*/
public static final String DYNAMIC = "dynamic";
/**
*
*/
public static final String FIXED = "fixed";
/**
*
*/
public static final String ASSIGNEE = "assignee";
/**
*
*/
public static final String CANDIDATE_USERS = "candidateUsers";
/**
*
*/
public static final String CANDIDATE_GROUPS = "candidateGroups";
/**
*
*/
public static final String PROCESS_APPROVAL = "approval";
/**
*
*/
public static final String PROCESS_MULTI_INSTANCE_USER = "userList";
/**
* nameapace
*/
public static final String NAMASPASE = "http://flowable.org/bpmn";
/**
*
*/
public static final String PROCESS_MULTI_INSTANCE = "multiInstance";
/**
* dataType
*/
public static final String PROCESS_CUSTOM_DATA_TYPE = "dataType";
/**
* userType
*/
public static final String PROCESS_CUSTOM_USER_TYPE = "userType";
/**
*
*/
public static final String PROCESS_INITIATOR = "INITIATOR";
/**
*
*/
public static final String FLOWABLE_SKIP_EXPRESSION_ENABLED = "_FLOWABLE_SKIP_EXPRESSION_ENABLED";
}

View File

@ -0,0 +1,43 @@
package com.ruoyi.flowable.common.enums;
/**
*
*
* @author Tony
* @date 2021/4/19
*/
public enum FlowComment {
/**
*
*/
NORMAL("1", "正常意见"),
REBACK("2", "退回意见"),
REJECT("3", "驳回意见"),
DELEGATE("4", "委派意见"),
ASSIGN("5", "转办意见"),
STOP("6", "终止流程");
/**
*
*/
private final String type;
/**
*
*/
private final String remark;
FlowComment(String type, String remark) {
this.type = type;
this.remark = remark;
}
public String getType() {
return type;
}
public String getRemark() {
return remark;
}
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.flowable.common.expand.el;
/**
*
*
* @author Tony
* @date 2023-03-04 09:10
*/
public interface BaseEl {
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.flowable.common.expand.el;
import com.ruoyi.system.service.ISysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
*
* @author Tony
* @date 2023-03-04 12:10
*/
@Component
@Slf4j
public class FlowEl implements BaseEl {
@Resource
private ISysDeptService sysDeptService;
public String findDeptLeader(String name){
log.info("开始查询表达式变量值,getName");
return name;
}
public String getName(String name){
log.info("开始查询表达式变量值,getName");
return name;
}
}

View File

@ -0,0 +1,23 @@
package com.ruoyi.flowable.config;
import org.flowable.engine.impl.db.DbIdGenerator;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;
/**
*
* @author Tony
* @date 2022-12-26 10:24
*/
@Configuration
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
@Override
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
engineConfiguration.setActivityFontName("宋体");
engineConfiguration.setLabelFontName("宋体");
engineConfiguration.setAnnotationFontName("宋体");
engineConfiguration.setIdGenerator(new DbIdGenerator());
}
}

View File

@ -0,0 +1,95 @@
//package com.ruoyi.flowable.config;
//
//import com.sun.prism.paint.Color;
//import org.flowable.bpmn.model.AssociationDirection;
//import org.flowable.image.impl.DefaultProcessDiagramCanvas;
//
//import java.awt.*;
//import java.awt.geom.Line2D;
//import java.awt.geom.RoundRectangle2D;
//
///**
// * @author Tony
// * @date 2021-04-03
// */
//public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
// //设置高亮线的颜色 这里我设置成绿色
// protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN;
//
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
// super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
// }
//
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
// super(width, height, minX, minY, imageType);
// }
//
//
// /**
// * 画线颜色设置
// */
// @Override
// public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType,
// AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
//
// Paint originalPaint = g.getPaint();
// Stroke originalStroke = g.getStroke();
//
// g.setPaint(CONNECTION_COLOR);
// if (connectionType.equals("association")) {
// g.setStroke(ASSOCIATION_STROKE);
// } else if (highLighted) {
// //设置线的颜色
// g.setPaint(originalPaint);
// g.setStroke(HIGHLIGHT_FLOW_STROKE);
// }
//
// for (int i = 1; i < xPoints.length; i++) {
// Integer sourceX = xPoints[i - 1];
// Integer sourceY = yPoints[i - 1];
// Integer targetX = xPoints[i];
// Integer targetY = yPoints[i];
// Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);
// g.draw(line);
// }
//
// if (isDefault) {
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
// drawDefaultSequenceFlowIndicator(line, scaleFactor);
// }
//
// if (conditional) {
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
// drawConditionalSequenceFlowIndicator(line, scaleFactor);
// }
//
// if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
// Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);
// drawArrowHead(line, scaleFactor);
// }
// if (associationDirection == AssociationDirection.BOTH) {
// Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
// drawArrowHead(line, scaleFactor);
// }
// g.setPaint(originalPaint);
// g.setStroke(originalStroke);
// }
//
// /**
// * 高亮节点设置
// */
// @Override
// public void drawHighLight(int x, int y, int width, int height) {
// Paint originalPaint = g.getPaint();
// Stroke originalStroke = g.getStroke();
// //设置高亮节点的颜色
// g.setPaint(HIGHLIGHT_COLOR);
// g.setStroke(THICK_TASK_BORDER_STROKE);
//
// RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
// g.draw(rect);
//
// g.setPaint(originalPaint);
// g.setStroke(originalStroke);
// }
//}

View File

@ -0,0 +1,209 @@
package com.ruoyi.flowable.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.FlowProcDefDto;
import com.ruoyi.flowable.domain.dto.FlowSaveXmlVo;
import com.ruoyi.flowable.service.IFlowDefinitionService;
import com.ruoyi.system.domain.SysExpression;
import com.ruoyi.system.service.ISysExpressionService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @author Tony
* @date 2021-04-03
*/
@Slf4j
@Api(tags = "流程定义")
@RestController
@RequestMapping("/flowable/definition")
public class FlowDefinitionController extends BaseController {
@Autowired
private IFlowDefinitionService flowDefinitionService;
@Autowired
private ISysUserService userService;
@Resource
private ISysRoleService sysRoleService;
@Resource
private ISysExpressionService sysExpressionService;
@GetMapping(value = "/list")
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
public AjaxResult list(@ApiParam(value = "当前页码", required = true) @RequestParam Integer pageNum,
@ApiParam(value = "每页条数", required = true) @RequestParam Integer pageSize,
@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name) {
return AjaxResult.success(flowDefinitionService.list(name, pageNum, pageSize));
}
@ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
@PostMapping("/import")
public AjaxResult importFile(@RequestParam(required = false) String name,
@RequestParam(required = false) String category,
MultipartFile file) {
InputStream in = null;
try {
in = file.getInputStream();
flowDefinitionService.importFile(name, category, in);
} catch (Exception e) {
log.error("导入失败:", e);
return AjaxResult.success(e.getMessage());
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
log.error("关闭输入流出错", e);
}
}
return AjaxResult.success("导入成功");
}
@ApiOperation(value = "读取xml文件")
@GetMapping("/readXml/{deployId}")
public AjaxResult readXml(@ApiParam(value = "流程定义id") @PathVariable(value = "deployId") String deployId) {
try {
return flowDefinitionService.readXml(deployId);
} catch (Exception e) {
return AjaxResult.error("加载xml文件异常");
}
}
@ApiOperation(value = "读取图片文件")
@GetMapping("/readImage/{deployId}")
public void readImage(@ApiParam(value = "流程定义id") @PathVariable(value = "deployId") String deployId, HttpServletResponse response) {
OutputStream os = null;
BufferedImage image = null;
try {
image = ImageIO.read(flowDefinitionService.readImage(deployId));
response.setContentType("image/png");
os = response.getOutputStream();
if (image != null) {
ImageIO.write(image, "png", os);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (os != null) {
os.flush();
os.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
@ApiOperation(value = "保存流程设计器内的xml文件")
@Log(title = "流程定义", businessType = BusinessType.INSERT)
@PostMapping("/save")
public AjaxResult save(@RequestBody FlowSaveXmlVo vo) {
InputStream in = null;
try {
in = new ByteArrayInputStream(vo.getXml().getBytes(StandardCharsets.UTF_8));
flowDefinitionService.importFile(vo.getName(), vo.getCategory(), in);
} catch (Exception e) {
log.error("导入失败:", e);
return AjaxResult.error(e.getMessage());
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
log.error("关闭输入流出错", e);
}
}
return AjaxResult.success("导入成功");
}
@ApiOperation(value = "发起流程")
@Log(title = "发起流程", businessType = BusinessType.INSERT)
@PostMapping("/start/{procDefId}")
public AjaxResult start(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
return flowDefinitionService.startProcessInstanceById(procDefId, variables);
}
@ApiOperation(value = "激活或挂起流程定义")
@Log(title = "激活/挂起流程", businessType = BusinessType.UPDATE)
@PutMapping(value = "/updateState")
public AjaxResult updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
@ApiParam(value = "流程部署ID", required = true) @RequestParam String deployId) {
flowDefinitionService.updateState(state, deployId);
return AjaxResult.success();
}
@ApiOperation(value = "删除流程")
@Log(title = "删除流程", businessType = BusinessType.DELETE)
@DeleteMapping(value = "/{deployIds}")
public AjaxResult delete(@PathVariable String[] deployIds) {
for (String deployId : deployIds) {
flowDefinitionService.delete(deployId);
}
return AjaxResult.success();
}
@ApiOperation(value = "指定流程办理人员列表")
@GetMapping("/userList")
public AjaxResult userList(SysUser user) {
List<SysUser> list = userService.selectUserList(user);
return AjaxResult.success(list);
}
@ApiOperation(value = "指定流程办理组列表")
@GetMapping("/roleList")
public AjaxResult roleList(SysRole role) {
List<SysRole> list = sysRoleService.selectRoleList(role);
return AjaxResult.success(list);
}
@ApiOperation(value = "指定流程达式列表")
@GetMapping("/expList")
public AjaxResult expList(SysExpression sysExpression) {
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
return AjaxResult.success(list);
}
}

View File

@ -0,0 +1,67 @@
package com.ruoyi.flowable.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import com.ruoyi.flowable.service.IFlowInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Slf4j
@Api(tags = "工作流流程实例管理")
@RestController
@RequestMapping("/flowable/instance")
public class FlowInstanceController extends BaseController {
@Autowired
private IFlowInstanceService flowInstanceService;
@ApiOperation(value = "根据流程定义id启动流程实例")
@PostMapping("/startBy/{procDefId}")
public AjaxResult startById(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
return flowInstanceService.startProcessInstanceById(procDefId, variables);
}
@ApiOperation(value = "激活或挂起流程实例")
@PostMapping(value = "/updateState")
public AjaxResult updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId) {
flowInstanceService.updateState(state,instanceId);
return AjaxResult.success();
}
@ApiOperation("结束流程实例")
@PostMapping(value = "/stopProcessInstance")
public AjaxResult stopProcessInstance(@RequestBody FlowTaskVo flowTaskVo) {
flowInstanceService.stopProcessInstance(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "删除流程实例")
@Log(title = "删除任务", businessType = BusinessType.DELETE)
@DeleteMapping(value = "/delete/{instanceIds}")
public AjaxResult delete(@ApiParam(value = "流程实例ID", required = true) @PathVariable String[] instanceIds,
@ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) {
for (String instanceId : instanceIds) {
flowInstanceService.delete(instanceId,deleteReason);
}
return AjaxResult.success();
}
}

View File

@ -0,0 +1,277 @@
package com.ruoyi.flowable.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.flowable.domain.dto.FlowTaskDto;
import com.ruoyi.flowable.domain.vo.FlowQueryVo;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import com.ruoyi.flowable.service.IFlowTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Slf4j
@Api(tags = "工作流流程任务管理")
@RestController
@RequestMapping("/flowable/task")
public class FlowTaskController extends BaseController {
@Autowired
private IFlowTaskService flowTaskService;
@ApiOperation(value = "我发起的流程", response = FlowTaskDto.class)
@GetMapping(value = "/myProcess")
public AjaxResult myProcess(FlowQueryVo queryVo) {
return flowTaskService.myProcess(queryVo);
}
@ApiOperation(value = "取消申请", response = FlowTaskDto.class)
@Log(title = "取消申请", businessType = BusinessType.UPDATE)
@PostMapping(value = "/stopProcess")
public AjaxResult stopProcess(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.stopProcess(flowTaskVo);
}
@ApiOperation(value = "撤回流程", response = FlowTaskDto.class)
@Log(title = "撤回流程", businessType = BusinessType.UPDATE)
@PostMapping(value = "/revokeProcess")
public AjaxResult revokeProcess(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.revokeProcess(flowTaskVo);
}
@ApiOperation(value = "获取待办列表", response = FlowTaskDto.class)
@GetMapping(value = "/todoList")
public AjaxResult todoList(FlowQueryVo queryVo) {
return flowTaskService.todoList(queryVo);
}
@ApiOperation(value = "获取已办任务", response = FlowTaskDto.class)
@GetMapping(value = "/finishedList")
public AjaxResult finishedList(FlowQueryVo queryVo) {
return flowTaskService.finishedList(queryVo);
}
@ApiOperation(value = "流程历史流转记录", response = FlowTaskDto.class)
@GetMapping(value = "/flowRecord")
public AjaxResult flowRecord(String procInsId, String deployId) {
return flowTaskService.flowRecord(procInsId, deployId);
}
@ApiOperation(value = "根据任务ID查询挂载的表单信息")
@GetMapping(value = "/getTaskForm")
public AjaxResult getTaskForm(String taskId) {
return flowTaskService.getTaskForm(taskId);
}
@ApiOperation(value = "流程初始化表单", response = FlowTaskDto.class)
@GetMapping(value = "/flowFormData")
public AjaxResult flowFormData(String deployId) {
return flowTaskService.flowFormData(deployId);
}
@ApiOperation(value = "获取流程变量", response = FlowTaskDto.class)
@GetMapping(value = "/processVariables/{taskId}")
public AjaxResult processVariables(@ApiParam(value = "流程任务Id") @PathVariable(value = "taskId") String taskId) {
return flowTaskService.processVariables(taskId);
}
@ApiOperation(value = "审批任务")
@Log(title = "审批任务", businessType = BusinessType.UPDATE)
@PostMapping(value = "/complete")
public AjaxResult complete(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.complete(flowTaskVo);
}
@ApiOperation(value = "驳回任务")
@Log(title = "驳回任务", businessType = BusinessType.UPDATE)
@PostMapping(value = "/reject")
public AjaxResult taskReject(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.taskReject(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "退回任务")
@Log(title = "退回任务", businessType = BusinessType.UPDATE)
@PostMapping(value = "/return")
public AjaxResult taskReturn(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.taskReturn(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "获取所有可回退的节点")
@PostMapping(value = "/returnList")
public AjaxResult findReturnTaskList(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.findReturnTaskList(flowTaskVo);
}
@ApiOperation(value = "删除任务")
@Log(title = "删除任务", businessType = BusinessType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.deleteTask(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "认领/签收任务")
@PostMapping(value = "/claim")
public AjaxResult claim(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.claim(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "取消认领/签收任务")
@PostMapping(value = "/unClaim")
public AjaxResult unClaim(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.unClaim(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "委派任务")
@PostMapping(value = "/delegateTask")
public AjaxResult delegate(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.delegateTask(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "任务归还")
@PostMapping(value = "/resolveTask")
public AjaxResult resolveTask(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.resolveTask(flowTaskVo);
return AjaxResult.success();
}
@ApiOperation(value = "转办任务")
@PostMapping(value = "/assignTask")
public AjaxResult assign(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.assignTask(flowTaskVo);
return AjaxResult.success();
}
@PostMapping(value = "/addMultiInstanceExecution")
@ApiOperation(value = "多实例加签")
public AjaxResult addMultiInstanceExecution(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.addMultiInstanceExecution(flowTaskVo);
return AjaxResult.success("加签成功");
}
@PostMapping(value = "/deleteMultiInstanceExecution")
@ApiOperation(value = "多实例减签")
public AjaxResult deleteMultiInstanceExecution(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.deleteMultiInstanceExecution(flowTaskVo);
return AjaxResult.success("减签成功");
}
@ApiOperation(value = "获取下一节点")
@PostMapping(value = "/nextFlowNode")
public AjaxResult getNextFlowNode(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.getNextFlowNode(flowTaskVo);
}
@ApiOperation(value = "流程发起时获取下一节点")
@PostMapping(value = "/nextFlowNodeByStart")
public AjaxResult getNextFlowNodeByStart(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.getNextFlowNodeByStart(flowTaskVo);
}
/**
*
*
* @param processId ID
*/
@GetMapping("/diagram/{processId}")
public void genProcessDiagram(HttpServletResponse response,
@PathVariable("processId") String processId) {
InputStream inputStream = flowTaskService.diagram(processId);
OutputStream os = null;
BufferedImage image = null;
try {
image = ImageIO.read(inputStream);
response.setContentType("image/png");
os = response.getOutputStream();
if (image != null) {
ImageIO.write(image, "png", os);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (os != null) {
os.flush();
os.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
*
*
* @param procInsId
* @param procInsId
*/
@GetMapping("/flowViewer/{procInsId}/{executionId}")
public AjaxResult getFlowViewer(@PathVariable("procInsId") String procInsId,
@PathVariable("executionId") String executionId) {
return flowTaskService.getFlowViewer(procInsId, executionId);
}
/**
*
*
* @param procInsId id
* @return
*/
@GetMapping("/flowXmlAndNode")
public AjaxResult flowXmlAndNode(@RequestParam(value = "procInsId", required = false) String procInsId,
@RequestParam(value = "deployId", required = false) String deployId) {
return flowTaskService.flowXmlAndNode(procInsId, deployId);
}
/**
*
*
* @param taskId
* @return
*/
@GetMapping("/flowTaskForm")
public AjaxResult flowTaskForm(@RequestParam(value = "taskId", required = false) String taskId) throws Exception {
return flowTaskService.flowTaskForm(taskId);
}
/**
*
*
* @param procInsId
* @param elementId
* @return
*/
@GetMapping("/flowTaskInfo")
public AjaxResult flowTaskInfo(@RequestParam(value = "procInsId") String procInsId,
@RequestParam(value = "elementId") String elementId){
return flowTaskService.flowTaskInfo(procInsId,elementId);
}
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.flowable.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysExpression;
import com.ruoyi.system.service.ISysExpressionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2022-12-12
*/
@RestController
@RequestMapping("/system/expression")
public class SysExpressionController extends BaseController
{
@Autowired
private ISysExpressionService sysExpressionService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:list')")
@GetMapping("/list")
public TableDataInfo list(SysExpression sysExpression)
{
startPage();
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:export')")
@Log(title = "流程达式", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysExpression sysExpression)
{
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
ExcelUtil<SysExpression> util = new ExcelUtil<SysExpression>(SysExpression.class);
util.exportExcel(response, list, "流程达式数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysExpressionService.selectSysExpressionById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:add')")
@Log(title = "流程达式", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysExpression sysExpression)
{
return toAjax(sysExpressionService.insertSysExpression(sysExpression));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:edit')")
@Log(title = "流程达式", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysExpression sysExpression)
{
return toAjax(sysExpressionService.updateSysExpression(sysExpression));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:expression:remove')")
@Log(title = "流程达式", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysExpressionService.deleteSysExpressionByIds(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.ruoyi.flowable.controller;
import java.util.List;
import com.ruoyi.flowable.service.ISysDeployFormService;
import com.ruoyi.system.domain.SysDeployForm;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysForm;
import com.ruoyi.flowable.service.ISysFormService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Tony
* @date 2021-04-03
*/
@RestController
@RequestMapping("/flowable/form")
public class SysFormController extends BaseController {
@Autowired
private ISysFormService SysFormService;
@Autowired
private ISysDeployFormService sysDeployFormService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:list')")
@GetMapping("/list")
public TableDataInfo list(SysForm sysForm) {
startPage();
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
return getDataTable(list);
}
@GetMapping("/formList")
public AjaxResult formList(SysForm sysForm) {
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
return AjaxResult.success(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:export')")
@Log(title = "流程表单", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysForm sysForm) {
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
ExcelUtil<SysForm> util = new ExcelUtil<SysForm>(SysForm.class);
return util.exportExcel(list, "form");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:query')")
@GetMapping(value = "/{formId}")
public AjaxResult getInfo(@PathVariable("formId") Long formId) {
return AjaxResult.success(SysFormService.selectSysFormById(formId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:add')")
@Log(title = "流程表单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysForm sysForm) {
return toAjax(SysFormService.insertSysForm(sysForm));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:edit')")
@Log(title = "流程表单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysForm sysForm) {
return toAjax(SysFormService.updateSysForm(sysForm));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('flowable:form:remove')")
@Log(title = "流程表单", businessType = BusinessType.DELETE)
@DeleteMapping("/{formIds}")
public AjaxResult remove(@PathVariable Long[] formIds) {
return toAjax(SysFormService.deleteSysFormByIds(formIds));
}
/**
*
*/
@Log(title = "流程表单", businessType = BusinessType.INSERT)
@PostMapping("/addDeployForm")
public AjaxResult addDeployForm(@RequestBody SysDeployForm sysDeployForm) {
return toAjax(sysDeployFormService.insertSysDeployForm(sysDeployForm));
}
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.flowable.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysListener;
import com.ruoyi.system.service.ISysListenerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Tony
* @date 2022-12-25
*/
@RestController
@RequestMapping("/system/listener")
public class SysListenerController extends BaseController
{
@Autowired
private ISysListenerService sysListenerService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:list')")
@GetMapping("/list")
public TableDataInfo list(SysListener sysListener)
{
startPage();
List<SysListener> list = sysListenerService.selectSysListenerList(sysListener);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:export')")
@Log(title = "流程监听", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysListener sysListener)
{
List<SysListener> list = sysListenerService.selectSysListenerList(sysListener);
ExcelUtil<SysListener> util = new ExcelUtil<SysListener>(SysListener.class);
util.exportExcel(response, list, "流程监听数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysListenerService.selectSysListenerById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:add')")
@Log(title = "流程监听", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysListener sysListener)
{
return toAjax(sysListenerService.insertSysListener(sysListener));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:edit')")
@Log(title = "流程监听", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysListener sysListener)
{
return toAjax(sysListenerService.updateSysListener(sysListener));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:listener:remove')")
@Log(title = "流程监听", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysListenerService.deleteSysListenerByIds(ids));
}
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.flowable.domain.dto;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* @author Tony
* @date 2021/3/28 15:50
*/
@Data
@Builder
public class FlowCommentDto implements Serializable {
/**
* 0 1 退 2
*/
private String type;
/**
*
*/
private String comment;
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.flowable.domain.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author Tony
* @date 2021/3/31 23:20
*/
@Data
public class FlowFromFieldDTO implements Serializable {
private Object fields;
}

View File

@ -0,0 +1,33 @@
package com.ruoyi.flowable.domain.dto;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
* @author Tony
* @date 2021/4/17 22:59
*/
@Data
public class FlowNextDto implements Serializable {
/**
*
*/
private String type;
/**
*
*/
private String dataType;
/**
*
*/
private String vars;
}

View File

@ -0,0 +1,28 @@
package com.ruoyi.flowable.domain.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author Tony
* @date 2021/3/28 19:48
*/
@Data
public class FlowSaveXmlVo implements Serializable {
/**
*
*/
private String name;
/**
*
*/
private String category;
/**
* xml
*/
private String xml;
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.flowable.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Getter
@Setter
@ApiModel("工作流任务相关-返回参数")
public class FlowTaskDto implements Serializable {
@ApiModelProperty("任务编号")
private String taskId;
@ApiModelProperty("任务执行编号")
private String executionId;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("任务Key")
private String taskDefKey;
@ApiModelProperty("任务执行人Id")
private Long assigneeId;
@ApiModelProperty("部门名称")
private String deptName;
@ApiModelProperty("流程发起人部门名称")
private String startDeptName;
@ApiModelProperty("任务执行人名称")
private String assigneeName;
@ApiModelProperty("任务执行人部门")
private String assigneeDeptName;;
@ApiModelProperty("流程发起人Id")
private String startUserId;
@ApiModelProperty("流程发起人名称")
private String startUserName;
@ApiModelProperty("流程类型")
private String category;
@ApiModelProperty("流程变量信息")
private Object variables;
@ApiModelProperty("局部变量信息")
private Object taskLocalVars;
@ApiModelProperty("流程部署编号")
private String deployId;
@ApiModelProperty("流程ID")
private String procDefId;
@ApiModelProperty("流程key")
private String procDefKey;
@ApiModelProperty("流程定义名称")
private String procDefName;
@ApiModelProperty("流程定义内置使用版本")
private int procDefVersion;
@ApiModelProperty("流程实例ID")
private String procInsId;
@ApiModelProperty("历史流程实例ID")
private String hisProcInsId;
@ApiModelProperty("任务耗时")
private String duration;
@ApiModelProperty("任务意见")
private FlowCommentDto comment;
@ApiModelProperty("候选执行人")
private String candidate;
@ApiModelProperty("任务创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ApiModelProperty("任务完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
}

View File

@ -0,0 +1,23 @@
package com.ruoyi.flowable.domain.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author Tony
* @date 2021/4/21 20:55
*/
@Data
public class FlowViewerDto implements Serializable {
/**
* key
*/
private String key;
/**
* ()
*/
private boolean completed;
}

View File

@ -0,0 +1,36 @@
package com.ruoyi.flowable.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Data
@ApiModel("工作流任务相关--请求参数")
public class FlowQueryVo {
@ApiModelProperty("流程名称")
private String name;
@ApiModelProperty("开始时间")
private String startTime;
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("当前页码")
private Integer pageNum;
@ApiModelProperty("每页条数")
private Integer pageSize;
}

View File

@ -0,0 +1,56 @@
package com.ruoyi.flowable.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Data
@ApiModel("工作流任务相关--请求参数")
public class FlowTaskVo {
@ApiModelProperty("任务Id")
private String taskId;
@ApiModelProperty("用户Id")
private String userId;
@ApiModelProperty("任务意见")
private String comment;
@ApiModelProperty("流程实例Id")
private String instanceId;
@ApiModelProperty("节点")
private String targetKey;
private String deploymentId;
@ApiModelProperty("流程环节定义ID")
private String defId;
@ApiModelProperty("子执行流ID")
private String currentChildExecutionId;
@ApiModelProperty("子执行流是否已执行")
private Boolean flag;
@ApiModelProperty("流程变量信息")
private Map<String, Object> variables;
@ApiModelProperty("审批人")
private String assignee;
@ApiModelProperty("候选人")
private List<String> candidateUsers;
@ApiModelProperty("审批组")
private List<String> candidateGroups;
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.flowable.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* <p>退<p>
*
* @author tony
* @date 2022-04-23 11:01:52
*/
@Data
@ApiModel("可退回节点")
public class ReturnTaskNodeVo {
@ApiModelProperty("任务Id")
private String id;
@ApiModelProperty("用户Id")
private String name;
}

View File

@ -0,0 +1,41 @@
package com.ruoyi.flowable.factory;
import lombok.Getter;
import org.flowable.engine.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* flowable
* @author Tony
* @date 2021-04-03
*/
@Component
@Getter
public class FlowServiceFactory {
@Resource
protected RepositoryService repositoryService;
@Resource
protected RuntimeService runtimeService;
@Resource
protected IdentityService identityService;
@Resource
protected TaskService taskService;
@Resource
protected HistoryService historyService;
@Resource
protected ManagementService managementService;
@Qualifier("processEngine")
@Resource
protected ProcessEngine processEngine;
}

View File

@ -0,0 +1,370 @@
package com.ruoyi.flowable.flow;
import org.flowable.bpmn.model.AssociationDirection;
import org.flowable.bpmn.model.GraphicInfo;
import org.flowable.image.impl.DefaultProcessDiagramCanvas;
import org.flowable.image.util.ReflectUtil;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
/**
* @author Tony
* @date 2021/4/4 23:58
*/
public class CustomProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
//定义走过流程连线颜色为绿色
protected static Color HIGHLIGHT_SequenceFlow_COLOR = Color.GREEN;
//设置未走过流程的连接线颜色
protected static Color CONNECTION_COLOR = Color.BLACK;
//设置flows连接线字体颜色red
protected static Color LABEL_COLOR = new Color(0, 0, 0);
//高亮显示task框颜色
protected static Color HIGHLIGHT_COLOR = Color.GREEN;
protected static Color HIGHLIGHT_COLOR1 = Color.RED;
public CustomProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
this.initialize(imageType);
}
/**
* 线,
* @param xPoints
* @param yPoints
* @param conditional
* @param isDefault
* @param connectionType
* @param associationDirection
* @param highLighted
* @param scaleFactor
*/
@Override
public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
Paint originalPaint = this.g.getPaint();
Stroke originalStroke = this.g.getStroke();
this.g.setPaint(CONNECTION_COLOR);
if (connectionType.equals("association")) {
this.g.setStroke(ASSOCIATION_STROKE);
} else if (highLighted) {
this.g.setPaint(HIGHLIGHT_SequenceFlow_COLOR);
this.g.setStroke(HIGHLIGHT_FLOW_STROKE);
}
for (int i = 1; i < xPoints.length; ++i) {
Integer sourceX = xPoints[i - 1];
Integer sourceY = yPoints[i - 1];
Integer targetX = xPoints[i];
Integer targetY = yPoints[i];
java.awt.geom.Line2D.Double line = new java.awt.geom.Line2D.Double((double) sourceX, (double) sourceY, (double) targetX, (double) targetY);
this.g.draw(line);
}
java.awt.geom.Line2D.Double line;
if (isDefault) {
line = new java.awt.geom.Line2D.Double((double) xPoints[0], (double) yPoints[0], (double) xPoints[1], (double) yPoints[1]);
this.drawDefaultSequenceFlowIndicator(line, scaleFactor);
}
if (conditional) {
line = new java.awt.geom.Line2D.Double((double) xPoints[0], (double) yPoints[0], (double) xPoints[1], (double) yPoints[1]);
this.drawConditionalSequenceFlowIndicator(line, scaleFactor);
}
if (associationDirection.equals(AssociationDirection.ONE) || associationDirection.equals(AssociationDirection.BOTH)) {
line = new java.awt.geom.Line2D.Double((double) xPoints[xPoints.length - 2], (double) yPoints[xPoints.length - 2], (double) xPoints[xPoints.length - 1], (double) yPoints[xPoints.length - 1]);
this.drawArrowHead(line, scaleFactor);
}
if (associationDirection.equals(AssociationDirection.BOTH)) {
line = new java.awt.geom.Line2D.Double((double) xPoints[1], (double) yPoints[1], (double) xPoints[0], (double) yPoints[0]);
this.drawArrowHead(line, scaleFactor);
}
this.g.setPaint(originalPaint);
this.g.setStroke(originalStroke);
}
/**
*
* @param imageType
*/
@Override
public void initialize(String imageType) {
if ("png".equalsIgnoreCase(imageType)) {
this.processDiagram = new BufferedImage(this.canvasWidth, this.canvasHeight, 2);
} else {
this.processDiagram = new BufferedImage(this.canvasWidth, this.canvasHeight, 1);
}
this.g = this.processDiagram.createGraphics();
if (!"png".equalsIgnoreCase(imageType)) {
this.g.setBackground(new Color(255, 255, 255, 0));
this.g.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
}
this.g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//修改图标颜色,修改图标字体大小
this.g.setPaint(Color.black);
Font font = new Font(this.activityFontName, 10, 14);
this.g.setFont(font);
this.fontMetrics = this.g.getFontMetrics();
//修改连接线字体大小
LABEL_FONT = new Font(this.labelFontName, 10, 15);
ANNOTATION_FONT = new Font(this.annotationFontName, 0, 11);
try {
USERTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/userTask.png", this.customClassLoader));
SCRIPTTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/scriptTask.png", this.customClassLoader));
SERVICETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/serviceTask.png", this.customClassLoader));
RECEIVETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/receiveTask.png", this.customClassLoader));
SENDTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/sendTask.png", this.customClassLoader));
MANUALTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/manualTask.png", this.customClassLoader));
BUSINESS_RULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/businessRuleTask.png", this.customClassLoader));
SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/shellTask.png", this.customClassLoader));
DMN_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/dmnTask.png", this.customClassLoader));
CAMEL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/camelTask.png", this.customClassLoader));
MULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/muleTask.png", this.customClassLoader));
HTTP_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/httpTask.png", this.customClassLoader));
TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/timer.png", this.customClassLoader));
COMPENSATE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate-throw.png", this.customClassLoader));
COMPENSATE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate.png", this.customClassLoader));
ERROR_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/error-throw.png", this.customClassLoader));
ERROR_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/error.png", this.customClassLoader));
MESSAGE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/message-throw.png", this.customClassLoader));
MESSAGE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/message.png", this.customClassLoader));
SIGNAL_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/signal-throw.png", this.customClassLoader));
SIGNAL_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/signal.png", this.customClassLoader));
} catch (IOException var4) {
LOGGER.warn("Could not load image for process diagram creation: {}", var4.getMessage());
}
}
/**
* 线
* @param text
* @param graphicInfo
* @param centered
*/
@Override
public void drawLabel(String text, GraphicInfo graphicInfo, boolean centered) {
float interline = 1.0f;
// text
if (text != null && text.length() > 0) {
Paint originalPaint = g.getPaint();
Font originalFont = g.getFont();
g.setPaint(LABEL_COLOR);
g.setFont(LABEL_FONT);
int wrapWidth = 100;
int textY = (int) graphicInfo.getY();
// TODO: use drawMultilineText()
AttributedString as = new AttributedString(text);
as.addAttribute(TextAttribute.FOREGROUND, g.getPaint());
as.addAttribute(TextAttribute.FONT, g.getFont());
AttributedCharacterIterator aci = as.getIterator();
FontRenderContext frc = new FontRenderContext(null, true, false);
LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
while (lbm.getPosition() < text.length()) {
TextLayout tl = lbm.nextLayout(wrapWidth);
textY += tl.getAscent();
Rectangle2D bb = tl.getBounds();
double tX = graphicInfo.getX();
if (centered) {
tX += (int) (graphicInfo.getWidth() / 2 - bb.getWidth() / 2);
}
tl.draw(g, (float) tX, textY);
textY += tl.getDescent() + tl.getLeading() + (interline - 1.0f) * tl.getAscent();
}
// restore originals
g.setFont(originalFont);
g.setPaint(originalPaint);
}
}
/**
* task
* @param x
* @param y
* @param width
* @param height
*/
@Override
public void drawHighLight(int x, int y, int width, int height) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
g.setPaint(HIGHLIGHT_COLOR);
g.setStroke(THICK_TASK_BORDER_STROKE);
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
g.draw(rect);
g.setPaint(originalPaint);
g.setStroke(originalStroke);
}
/**
* task
* @param x
* @param y
* @param width
* @param height
*/
public void drawHighLightNow(int x, int y, int width, int height) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
g.setPaint(HIGHLIGHT_COLOR1);
g.setStroke(THICK_TASK_BORDER_STROKE);
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
g.draw(rect);
g.setPaint(originalPaint);
g.setStroke(originalStroke);
}
/**
*
* @param x
* @param y
* @param width
* @param height
*/
public void drawHighLightEnd(int x, int y, int width, int height) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
g.setPaint(HIGHLIGHT_COLOR);
g.setStroke(THICK_TASK_BORDER_STROKE);
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
g.draw(rect);
g.setPaint(originalPaint);
g.setStroke(originalStroke);
}
/**
* task
* @param name
* @param graphicInfo
* @param thickBorder
* @param scaleFactor
*/
@Override
protected void drawTask(String name, GraphicInfo graphicInfo, boolean thickBorder, double scaleFactor) {
Paint originalPaint = g.getPaint();
int x = (int) graphicInfo.getX();
int y = (int) graphicInfo.getY();
int width = (int) graphicInfo.getWidth();
int height = (int) graphicInfo.getHeight();
// Create a new gradient paint for every task box, gradient depends on x and y and is not relative
g.setPaint(TASK_BOX_COLOR);
int arcR = 6;
if (thickBorder) {
arcR = 3;
}
// shape
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcR, arcR);
g.fill(rect);
g.setPaint(TASK_BORDER_COLOR);
if (thickBorder) {
Stroke originalStroke = g.getStroke();
g.setStroke(THICK_TASK_BORDER_STROKE);
g.draw(rect);
g.setStroke(originalStroke);
} else {
g.draw(rect);
}
g.setPaint(originalPaint);
// text
if (scaleFactor == 1.0 && name != null && name.length() > 0) {
int boxWidth = width - (2 * TEXT_PADDING);
int boxHeight = height - 16 - ICON_PADDING - ICON_PADDING - MARKER_WIDTH - 2 - 2;
int boxX = x + width / 2 - boxWidth / 2;
int boxY = y + height / 2 - boxHeight / 2 + ICON_PADDING + ICON_PADDING - 2 - 2;
drawMultilineCentredText(name, boxX, boxY, boxWidth, boxHeight);
}
}
protected static Color EVENT_COLOR = new Color(255, 255, 255);
/**
*
* @param graphicInfo
* @param image
* @param scaleFactor
*/
@Override
public void drawStartEvent(GraphicInfo graphicInfo, BufferedImage image, double scaleFactor) {
Paint originalPaint = g.getPaint();
g.setPaint(EVENT_COLOR);
Ellipse2D circle = new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(),
graphicInfo.getWidth(), graphicInfo.getHeight());
g.fill(circle);
g.setPaint(EVENT_BORDER_COLOR);
g.draw(circle);
g.setPaint(originalPaint);
if (image != null) {
// calculate coordinates to center image
int imageX = (int) Math.round(graphicInfo.getX() + (graphicInfo.getWidth() / 2) - (image.getWidth() / (2 * scaleFactor)));
int imageY = (int) Math.round(graphicInfo.getY() + (graphicInfo.getHeight() / 2) - (image.getHeight() / (2 * scaleFactor)));
g.drawImage(image, imageX, imageY,
(int) (image.getWidth() / scaleFactor), (int) (image.getHeight() / scaleFactor), null);
}
}
/**
*
* @param graphicInfo
* @param scaleFactor
*/
@Override
public void drawNoneEndEvent(GraphicInfo graphicInfo, double scaleFactor) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
g.setPaint(EVENT_COLOR);
Ellipse2D circle = new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(),
graphicInfo.getWidth(), graphicInfo.getHeight());
g.fill(circle);
g.setPaint(EVENT_BORDER_COLOR);
// g.setPaint(HIGHLIGHT_COLOR);
if (scaleFactor == 1.0) {
g.setStroke(END_EVENT_STROKE);
} else {
g.setStroke(new BasicStroke(2.0f));
}
g.draw(circle);
g.setStroke(originalStroke);
g.setPaint(originalPaint);
}
}

View File

@ -0,0 +1,404 @@
package com.ruoyi.flowable.flow;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.*;
import org.flowable.image.impl.DefaultProcessDiagramCanvas;
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
import java.util.Iterator;
import java.util.List;
/**
* @author Tony
* @date 2021/4/5 0:31
*/
public class CustomProcessDiagramGenerator extends DefaultProcessDiagramGenerator {
@Override
protected DefaultProcessDiagramCanvas generateProcessDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) {
this.prepareBpmnModel(bpmnModel);
DefaultProcessDiagramCanvas processDiagramCanvas = initProcessDiagramCanvas(bpmnModel, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
Iterator var13 = bpmnModel.getPools().iterator();
while (var13.hasNext()) {
Pool process = (Pool) var13.next();
GraphicInfo subProcesses = bpmnModel.getGraphicInfo(process.getId());
processDiagramCanvas.drawPoolOrLane(process.getName(), subProcesses, scaleFactor);
}
var13 = bpmnModel.getProcesses().iterator();
Process process1;
Iterator subProcesses1;
while (var13.hasNext()) {
process1 = (Process) var13.next();
subProcesses1 = process1.getLanes().iterator();
while (subProcesses1.hasNext()) {
Lane artifact = (Lane) subProcesses1.next();
GraphicInfo subProcess = bpmnModel.getGraphicInfo(artifact.getId());
processDiagramCanvas.drawPoolOrLane(artifact.getName(), subProcess, scaleFactor);
}
}
var13 = bpmnModel.getProcesses().iterator();
while (var13.hasNext()) {
process1 = (Process) var13.next();
subProcesses1 = process1.findFlowElementsOfType(FlowNode.class).iterator();
while (subProcesses1.hasNext()) {
FlowNode artifact1 = (FlowNode) subProcesses1.next();
if (!this.isPartOfCollapsedSubProcess(artifact1, bpmnModel)) {
this.drawActivity(processDiagramCanvas, bpmnModel, artifact1, highLightedActivities, highLightedFlows, scaleFactor, Boolean.valueOf(drawSequenceFlowNameWithNoLabelDI));
}
}
}
var13 = bpmnModel.getProcesses().iterator();
label75:
while (true) {
List subProcesses2;
do {
if (!var13.hasNext()) {
return processDiagramCanvas;
}
process1 = (Process) var13.next();
subProcesses1 = process1.getArtifacts().iterator();
while (subProcesses1.hasNext()) {
Artifact artifact2 = (Artifact) subProcesses1.next();
this.drawArtifact(processDiagramCanvas, bpmnModel, artifact2);
}
subProcesses2 = process1.findFlowElementsOfType(SubProcess.class, true);
} while (subProcesses2 == null);
Iterator artifact3 = subProcesses2.iterator();
while (true) {
GraphicInfo graphicInfo;
SubProcess subProcess1;
do {
do {
if (!artifact3.hasNext()) {
continue label75;
}
subProcess1 = (SubProcess) artifact3.next();
graphicInfo = bpmnModel.getGraphicInfo(subProcess1.getId());
} while (graphicInfo != null && graphicInfo.getExpanded() != null && !graphicInfo.getExpanded().booleanValue());
} while (this.isPartOfCollapsedSubProcess(subProcess1, bpmnModel));
Iterator var19 = subProcess1.getArtifacts().iterator();
while (var19.hasNext()) {
Artifact subProcessArtifact = (Artifact) var19.next();
this.drawArtifact(processDiagramCanvas, bpmnModel, subProcessArtifact);
}
}
}
}
protected static DefaultProcessDiagramCanvas initProcessDiagramCanvas(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
double minX = 1.7976931348623157E308D;
double maxX = 0.0D;
double minY = 1.7976931348623157E308D;
double maxY = 0.0D;
GraphicInfo nrOfLanes;
for (Iterator flowNodes = bpmnModel.getPools().iterator(); flowNodes.hasNext(); maxY = nrOfLanes.getY() + nrOfLanes.getHeight()) {
Pool artifacts = (Pool) flowNodes.next();
nrOfLanes = bpmnModel.getGraphicInfo(artifacts.getId());
minX = nrOfLanes.getX();
maxX = nrOfLanes.getX() + nrOfLanes.getWidth();
minY = nrOfLanes.getY();
}
List var23 = gatherAllFlowNodes(bpmnModel);
Iterator var24 = var23.iterator();
label155:
while (var24.hasNext()) {
FlowNode var26 = (FlowNode) var24.next();
GraphicInfo artifact = bpmnModel.getGraphicInfo(var26.getId());
if (artifact.getX() + artifact.getWidth() > maxX) {
maxX = artifact.getX() + artifact.getWidth();
}
if (artifact.getX() < minX) {
minX = artifact.getX();
}
if (artifact.getY() + artifact.getHeight() > maxY) {
maxY = artifact.getY() + artifact.getHeight();
}
if (artifact.getY() < minY) {
minY = artifact.getY();
}
Iterator process = var26.getOutgoingFlows().iterator();
while (true) {
List l;
do {
if (!process.hasNext()) {
continue label155;
}
SequenceFlow graphicInfoList = (SequenceFlow) process.next();
l = bpmnModel.getFlowLocationGraphicInfo(graphicInfoList.getId());
} while (l == null);
Iterator graphicInfo = l.iterator();
while (graphicInfo.hasNext()) {
GraphicInfo graphicInfo1 = (GraphicInfo) graphicInfo.next();
if (graphicInfo1.getX() > maxX) {
maxX = graphicInfo1.getX();
}
if (graphicInfo1.getX() < minX) {
minX = graphicInfo1.getX();
}
if (graphicInfo1.getY() > maxY) {
maxY = graphicInfo1.getY();
}
if (graphicInfo1.getY() < minY) {
minY = graphicInfo1.getY();
}
}
}
}
List var25 = gatherAllArtifacts(bpmnModel);
Iterator var27 = var25.iterator();
GraphicInfo var37;
while (var27.hasNext()) {
Artifact var29 = (Artifact) var27.next();
GraphicInfo var31 = bpmnModel.getGraphicInfo(var29.getId());
if (var31 != null) {
if (var31.getX() + var31.getWidth() > maxX) {
maxX = var31.getX() + var31.getWidth();
}
if (var31.getX() < minX) {
minX = var31.getX();
}
if (var31.getY() + var31.getHeight() > maxY) {
maxY = var31.getY() + var31.getHeight();
}
if (var31.getY() < minY) {
minY = var31.getY();
}
}
List var33 = bpmnModel.getFlowLocationGraphicInfo(var29.getId());
if (var33 != null) {
Iterator var35 = var33.iterator();
while (var35.hasNext()) {
var37 = (GraphicInfo) var35.next();
if (var37.getX() > maxX) {
maxX = var37.getX();
}
if (var37.getX() < minX) {
minX = var37.getX();
}
if (var37.getY() > maxY) {
maxY = var37.getY();
}
if (var37.getY() < minY) {
minY = var37.getY();
}
}
}
}
int var28 = 0;
Iterator var30 = bpmnModel.getProcesses().iterator();
while (var30.hasNext()) {
Process var32 = (Process) var30.next();
Iterator var34 = var32.getLanes().iterator();
while (var34.hasNext()) {
Lane var36 = (Lane) var34.next();
++var28;
var37 = bpmnModel.getGraphicInfo(var36.getId());
if (var37.getX() + var37.getWidth() > maxX) {
maxX = var37.getX() + var37.getWidth();
}
if (var37.getX() < minX) {
minX = var37.getX();
}
if (var37.getY() + var37.getHeight() > maxY) {
maxY = var37.getY() + var37.getHeight();
}
if (var37.getY() < minY) {
minY = var37.getY();
}
}
}
if (var23.isEmpty() && bpmnModel.getPools().isEmpty() && var28 == 0) {
minX = 0.0D;
minY = 0.0D;
}
return new CustomProcessDiagramCanvas((int) maxX + 10, (int) maxY + 10, (int) minX, (int) minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
}
private static void drawHighLight(DefaultProcessDiagramCanvas processDiagramCanvas, GraphicInfo graphicInfo) {
processDiagramCanvas.drawHighLight((int) graphicInfo.getX(), (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight());
}
private static void drawHighLightNow(CustomProcessDiagramCanvas processDiagramCanvas, GraphicInfo graphicInfo) {
processDiagramCanvas.drawHighLightNow((int) graphicInfo.getX(), (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight());
}
private static void drawHighLightEnd(CustomProcessDiagramCanvas processDiagramCanvas, GraphicInfo graphicInfo) {
processDiagramCanvas.drawHighLightEnd((int) graphicInfo.getX(), (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight());
}
@Override
protected void drawActivity(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel,
FlowNode flowNode, java.util.List<String> highLightedActivities, java.util.List<String> highLightedFlows, double scaleFactor, Boolean drawSequenceFlowNameWithNoLabelDI) {
DefaultProcessDiagramGenerator.ActivityDrawInstruction drawInstruction = activityDrawInstructions.get(flowNode.getClass());
if (drawInstruction != null) {
drawInstruction.draw(processDiagramCanvas, bpmnModel, flowNode);
// Gather info on the multi instance marker
boolean multiInstanceSequential = false;
boolean multiInstanceParallel = false;
boolean collapsed = false;
if (flowNode instanceof Activity) {
Activity activity = (Activity) flowNode;
MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = activity.getLoopCharacteristics();
if (multiInstanceLoopCharacteristics != null) {
multiInstanceSequential = multiInstanceLoopCharacteristics.isSequential();
multiInstanceParallel = !multiInstanceSequential;
}
}
// Gather info on the collapsed marker
GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId());
if (flowNode instanceof SubProcess) {
collapsed = graphicInfo.getExpanded() != null && !graphicInfo.getExpanded();
} else if (flowNode instanceof CallActivity) {
collapsed = true;
}
if (scaleFactor == 1.0) {
// Actually draw the markers
processDiagramCanvas.drawActivityMarkers((int) graphicInfo.getX(), (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight(),
multiInstanceSequential, multiInstanceParallel, collapsed);
}
// Draw highlighted activities
if (highLightedActivities.contains(flowNode.getId())) {
if (highLightedActivities.get(highLightedActivities.size() - 1).equals(flowNode.getId())
&& !"endenv".equals(flowNode.getId())) {
if ((flowNode.getId().contains("Event_"))) {
drawHighLightEnd((CustomProcessDiagramCanvas) processDiagramCanvas, bpmnModel.getGraphicInfo(flowNode.getId()));
} else {
drawHighLightNow((CustomProcessDiagramCanvas) processDiagramCanvas, bpmnModel.getGraphicInfo(flowNode.getId()));
}
} else {
drawHighLight(processDiagramCanvas, bpmnModel.getGraphicInfo(flowNode.getId()));
}
}
}
// Outgoing transitions of activity
for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) {
boolean highLighted = (highLightedFlows.contains(sequenceFlow.getId()));
String defaultFlow = null;
if (flowNode instanceof Activity) {
defaultFlow = ((Activity) flowNode).getDefaultFlow();
} else if (flowNode instanceof Gateway) {
defaultFlow = ((Gateway) flowNode).getDefaultFlow();
}
boolean isDefault = false;
if (defaultFlow != null && defaultFlow.equalsIgnoreCase(sequenceFlow.getId())) {
isDefault = true;
}
boolean drawConditionalIndicator = sequenceFlow.getConditionExpression() != null && !(flowNode instanceof Gateway);
String sourceRef = sequenceFlow.getSourceRef();
String targetRef = sequenceFlow.getTargetRef();
FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef);
FlowElement targetElement = bpmnModel.getFlowElement(targetRef);
java.util.List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
if (graphicInfoList != null && graphicInfoList.size() > 0) {
graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList);
int xPoints[] = new int[graphicInfoList.size()];
int yPoints[] = new int[graphicInfoList.size()];
for (int i = 1; i < graphicInfoList.size(); i++) {
GraphicInfo graphicInfo = graphicInfoList.get(i);
GraphicInfo previousGraphicInfo = graphicInfoList.get(i - 1);
if (i == 1) {
xPoints[0] = (int) previousGraphicInfo.getX();
yPoints[0] = (int) previousGraphicInfo.getY();
}
xPoints[i] = (int) graphicInfo.getX();
yPoints[i] = (int) graphicInfo.getY();
}
processDiagramCanvas.drawSequenceflow(xPoints, yPoints, drawConditionalIndicator, isDefault, highLighted, scaleFactor);
// Draw sequenceflow label
GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId());
if (labelGraphicInfo != null) {
processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false);
} else {
if (drawSequenceFlowNameWithNoLabelDI) {
GraphicInfo lineCenter = getLineCenter(graphicInfoList);
processDiagramCanvas.drawLabel(sequenceFlow.getName(), lineCenter, false);
}
}
}
}
// Nested elements
if (flowNode instanceof FlowElementsContainer) {
for (FlowElement nestedFlowElement : ((FlowElementsContainer) flowNode).getFlowElements()) {
if (nestedFlowElement instanceof FlowNode && !isPartOfCollapsedSubProcess(nestedFlowElement, bpmnModel)) {
drawActivity(processDiagramCanvas, bpmnModel, (FlowNode) nestedFlowElement,
highLightedActivities, highLightedFlows, scaleFactor, drawSequenceFlowNameWithNoLabelDI);
}
}
}
}
}

View File

@ -0,0 +1,266 @@
package com.ruoyi.flowable.flow;
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;
//import com.greenpineyu.fel.FelEngine;
//import com.greenpineyu.fel.FelEngineImpl;
//import com.greenpineyu.fel.context.FelContext;
//import org.apache.commons.jexl2.JexlContext;
//import org.apache.commons.jexl2.JexlEngine;
//import org.apache.commons.jexl2.MapContext;
//import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.*;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.repository.ProcessDefinition;
import java.util.*;
/**
* @author Tony
* @date 2021/4/19 20:51
*/
public class FindNextNodeUtil {
/**
*
*
* @param repositoryService
* @param map
* @return
*/
public static List<UserTask> getNextUserTasks(RepositoryService repositoryService, org.flowable.task.api.Task task, Map<String, Object> map) {
List<UserTask> data = new ArrayList<>();
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
Process mainProcess = bpmnModel.getMainProcess();
Collection<FlowElement> flowElements = mainProcess.getFlowElements();
String key = task.getTaskDefinitionKey();
FlowElement flowElement = bpmnModel.getFlowElement(key);
next(flowElements, flowElement, map, data);
return data;
}
/**
*
*
* @param repositoryService
* @param map
* @return
*/
public static List<UserTask> getNextUserTasksByStart(RepositoryService repositoryService, ProcessDefinition processDefinition, Map<String, Object> map) {
List<UserTask> data = new ArrayList<>();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
Process mainProcess = bpmnModel.getMainProcess();
Collection<FlowElement> flowElements = mainProcess.getFlowElements();
String key = null;
// 找到开始节点 并获取唯一key
for (FlowElement flowElement : flowElements) {
if (flowElement instanceof StartEvent) {
key = flowElement.getId();
break;
}
}
FlowElement flowElement = bpmnModel.getFlowElement(key);
List<SequenceFlow> sequenceFlows = ((StartEvent)flowElement).getOutgoingFlows();
// 获取出口连线, 此时从开始节点往后,只能是一个出口
if (!sequenceFlows.isEmpty()) {
SequenceFlow sequenceFlow = sequenceFlows.get(0);
FlowElement targetFlowElement = sequenceFlow.getTargetFlowElement();
next(flowElements, targetFlowElement, map, data);
}
return data;
}
/**
*
*
* @param flowElements
* @param flowElement
* @param map
* @param nextUser
*/
public static void next(Collection<FlowElement> flowElements, FlowElement flowElement, Map<String, Object> map, List<UserTask> nextUser) {
//如果是结束节点
if (flowElement instanceof EndEvent) {
//如果是子任务的结束节点
if (getSubProcess(flowElements, flowElement) != null) {
flowElement = getSubProcess(flowElements, flowElement);
}
}
//获取Task的出线信息--可以拥有多个
List<SequenceFlow> outGoingFlows = null;
if (flowElement instanceof Task) {
outGoingFlows = ((Task) flowElement).getOutgoingFlows();
} else if (flowElement instanceof Gateway) {
outGoingFlows = ((Gateway) flowElement).getOutgoingFlows();
} else if (flowElement instanceof StartEvent) {
outGoingFlows = ((StartEvent) flowElement).getOutgoingFlows();
} else if (flowElement instanceof SubProcess) {
outGoingFlows = ((SubProcess) flowElement).getOutgoingFlows();
} else if (flowElement instanceof CallActivity) {
outGoingFlows = ((CallActivity) flowElement).getOutgoingFlows();
}
if (outGoingFlows != null && outGoingFlows.size() > 0) {
//遍历所有的出线--找到可以正确执行的那一条
for (SequenceFlow sequenceFlow : outGoingFlows) {
//1.有表达式且为true
//2.无表达式
String expression = sequenceFlow.getConditionExpression();
if (expression == null ||
expressionResult(map, expression.substring(expression.lastIndexOf("{") + 1, expression.lastIndexOf("}")))) {
//出线的下一节点
String nextFlowElementID = sequenceFlow.getTargetRef();
if (checkSubProcess(nextFlowElementID, flowElements, nextUser)) {
continue;
}
//查询下一节点的信息
FlowElement nextFlowElement = getFlowElementById(nextFlowElementID, flowElements);
//调用流程
if (nextFlowElement instanceof CallActivity) {
CallActivity ca = (CallActivity) nextFlowElement;
if (ca.getLoopCharacteristics() != null) {
UserTask userTask = new UserTask();
userTask.setId(ca.getId());
userTask.setId(ca.getId());
userTask.setLoopCharacteristics(ca.getLoopCharacteristics());
userTask.setName(ca.getName());
nextUser.add(userTask);
}
next(flowElements, nextFlowElement, map, nextUser);
}
//用户任务
if (nextFlowElement instanceof UserTask) {
nextUser.add((UserTask) nextFlowElement);
}
//排他网关
else if (nextFlowElement instanceof ExclusiveGateway) {
next(flowElements, nextFlowElement, map, nextUser);
}
//并行网关
else if (nextFlowElement instanceof ParallelGateway) {
next(flowElements, nextFlowElement, map, nextUser);
}
//接收任务
else if (nextFlowElement instanceof ReceiveTask) {
next(flowElements, nextFlowElement, map, nextUser);
}
//服务任务
else if (nextFlowElement instanceof ServiceTask) {
next(flowElements, nextFlowElement, map, nextUser);
}
//子任务的起点
else if (nextFlowElement instanceof StartEvent) {
next(flowElements, nextFlowElement, map, nextUser);
}
//结束节点
else if (nextFlowElement instanceof EndEvent) {
next(flowElements, nextFlowElement, map, nextUser);
}
}
}
}
}
/**
*
*/
public static boolean checkSubProcess(String id, Collection<FlowElement> flowElements, List<UserTask> nextUser) {
for (FlowElement flowElement1 : flowElements) {
if (flowElement1 instanceof SubProcess && flowElement1.getId().equals(id)) {
SubProcess sp = (SubProcess) flowElement1;
if (sp.getLoopCharacteristics() != null) {
// String inputDataItem = sp.getLoopCharacteristics().getInputDataItem();
UserTask userTask = new UserTask();
userTask.setId(sp.getId());
userTask.setLoopCharacteristics(sp.getLoopCharacteristics());
userTask.setName(sp.getName());
nextUser.add(userTask);
return true;
}
}
}
return false;
}
/**
*
*
* @param flowElements
* @param flowElement
* @return
*/
public static FlowElement getSubProcess(Collection<FlowElement> flowElements, FlowElement flowElement) {
for (FlowElement flowElement1 : flowElements) {
if (flowElement1 instanceof SubProcess) {
for (FlowElement flowElement2 : ((SubProcess) flowElement1).getFlowElements()) {
if (flowElement.equals(flowElement2)) {
return flowElement1;
}
}
}
}
return null;
}
/**
* ID,
*
* @param Id ID
* @param flowElements
* @return
*/
public static FlowElement getFlowElementById(String Id, Collection<FlowElement> flowElements) {
for (FlowElement flowElement : flowElements) {
if (flowElement.getId().equals(Id)) {
//如果是子任务,则查询出子任务的开始节点
if (flowElement instanceof SubProcess) {
return getStartFlowElement(((SubProcess) flowElement).getFlowElements());
}
return flowElement;
}
if (flowElement instanceof SubProcess) {
FlowElement flowElement1 = getFlowElementById(Id, ((SubProcess) flowElement).getFlowElements());
if (flowElement1 != null) {
return flowElement1;
}
}
}
return null;
}
/**
*
*
* @param flowElements
* @description:
*/
public static FlowElement getStartFlowElement(Collection<FlowElement> flowElements) {
for (FlowElement flowElement : flowElements) {
if (flowElement instanceof StartEvent) {
return flowElement;
}
}
return null;
}
/**
* el
*
* @param map
* @param expression
* @return
*/
public static boolean expressionResult(Map<String, Object> map, String expression) {
Expression exp = AviatorEvaluator.compile(expression);
return (Boolean) exp.execute(map);
// return true;
}
}

View File

@ -0,0 +1,702 @@
package com.ruoyi.flowable.flow;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.*;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.task.api.history.HistoricTaskInstance;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author Tony
* @date 2021-04-03 23:57
*/
@Slf4j
public class FlowableUtils {
/**
* 线
*
* @param source
* @return
*/
public static List<SequenceFlow> getElementIncomingFlows(FlowElement source) {
List<SequenceFlow> sequenceFlows = null;
if (source instanceof FlowNode) {
sequenceFlows = ((FlowNode) source).getIncomingFlows();
} else if (source instanceof Gateway) {
sequenceFlows = ((Gateway) source).getIncomingFlows();
} else if (source instanceof SubProcess) {
sequenceFlows = ((SubProcess) source).getIncomingFlows();
} else if (source instanceof StartEvent) {
sequenceFlows = ((StartEvent) source).getIncomingFlows();
} else if (source instanceof EndEvent) {
sequenceFlows = ((EndEvent) source).getIncomingFlows();
}
return sequenceFlows;
}
/**
* 线
*
* @param source
* @return
*/
public static List<SequenceFlow> getElementOutgoingFlows(FlowElement source) {
List<SequenceFlow> sequenceFlows = null;
if (source instanceof FlowNode) {
sequenceFlows = ((FlowNode) source).getOutgoingFlows();
} else if (source instanceof Gateway) {
sequenceFlows = ((Gateway) source).getOutgoingFlows();
} else if (source instanceof SubProcess) {
sequenceFlows = ((SubProcess) source).getOutgoingFlows();
} else if (source instanceof StartEvent) {
sequenceFlows = ((StartEvent) source).getOutgoingFlows();
} else if (source instanceof EndEvent) {
sequenceFlows = ((EndEvent) source).getOutgoingFlows();
}
return sequenceFlows;
}
/**
*
*
* @param flowElements
* @param allElements
* @return
*/
public static Collection<FlowElement> getAllElements(Collection<FlowElement> flowElements, Collection<FlowElement> allElements) {
allElements = allElements == null ? new ArrayList<>() : allElements;
for (FlowElement flowElement : flowElements) {
allElements.add(flowElement);
if (flowElement instanceof SubProcess) {
// 继续深入子流程,进一步获取子流程
allElements = FlowableUtils.getAllElements(((SubProcess) flowElement).getFlowElements(), allElements);
}
}
return allElements;
}
/**
*
*
* @param source
* @param hasSequenceFlow 线 ID线
* @param userTaskList
* @return
*/
public static List<UserTask> iteratorFindParentUserTasks(FlowElement source, Set<String> hasSequenceFlow, List<UserTask> userTaskList) {
userTaskList = userTaskList == null ? new ArrayList<>() : userTaskList;
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (source instanceof StartEvent && source.getSubProcess() != null) {
userTaskList = iteratorFindParentUserTasks(source.getSubProcess(), hasSequenceFlow, userTaskList);
}
// 根据类型,获取入口连线
List<SequenceFlow> sequenceFlows = getElementIncomingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 类型为用户节点,则新增父级节点
if (sequenceFlow.getSourceFlowElement() instanceof UserTask) {
userTaskList.add((UserTask) sequenceFlow.getSourceFlowElement());
continue;
}
// 类型为子流程,则添加子流程开始节点出口处相连的节点
if (sequenceFlow.getSourceFlowElement() instanceof SubProcess) {
// 获取子流程用户任务节点
List<UserTask> childUserTaskList = findChildProcessUserTasks((StartEvent) ((SubProcess) sequenceFlow.getSourceFlowElement()).getFlowElements().toArray()[0], null, null);
// 如果找到节点,则说明该线路找到节点,不继续向下找,反之继续
if (childUserTaskList != null && childUserTaskList.size() > 0) {
userTaskList.addAll(childUserTaskList);
continue;
}
}
// 继续迭代
userTaskList = iteratorFindParentUserTasks(sequenceFlow.getSourceFlowElement(), hasSequenceFlow, userTaskList);
}
}
return userTaskList;
}
/**
*
*
* @param source (退)
* @param runTaskKeyList Key
* @param hasSequenceFlow 线 ID线
* @param userTaskList
* @return
*/
public static List<UserTask> iteratorFindChildUserTasks(FlowElement source, List<String> runTaskKeyList, Set<String> hasSequenceFlow, List<UserTask> userTaskList) {
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
userTaskList = userTaskList == null ? new ArrayList<>() : userTaskList;
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (source instanceof EndEvent && source.getSubProcess() != null) {
userTaskList = iteratorFindChildUserTasks(source.getSubProcess(), runTaskKeyList, hasSequenceFlow, userTaskList);
}
// 根据类型,获取出口连线
List<SequenceFlow> sequenceFlows = getElementOutgoingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 如果为用户任务类型,且任务节点的 Key 正在运行的任务中存在,添加
if (sequenceFlow.getTargetFlowElement() instanceof UserTask && runTaskKeyList.contains((sequenceFlow.getTargetFlowElement()).getId())) {
userTaskList.add((UserTask) sequenceFlow.getTargetFlowElement());
continue;
}
// 如果节点为子流程节点情况,则从节点中的第一个节点开始获取
if (sequenceFlow.getTargetFlowElement() instanceof SubProcess) {
List<UserTask> childUserTaskList = iteratorFindChildUserTasks((FlowElement) (((SubProcess) sequenceFlow.getTargetFlowElement()).getFlowElements().toArray()[0]), runTaskKeyList, hasSequenceFlow, null);
// 如果找到节点,则说明该线路找到节点,不继续向下找,反之继续
if (childUserTaskList != null && childUserTaskList.size() > 0) {
userTaskList.addAll(childUserTaskList);
continue;
}
}
// 继续迭代
userTaskList = iteratorFindChildUserTasks(sequenceFlow.getTargetFlowElement(), runTaskKeyList, hasSequenceFlow, userTaskList);
}
}
return userTaskList;
}
/**
*
*
* @param source
* @param hasSequenceFlow 线 ID线
* @param userTaskList
* @return
*/
public static List<UserTask> findChildProcessUserTasks(FlowElement source, Set<String> hasSequenceFlow, List<UserTask> userTaskList) {
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
userTaskList = userTaskList == null ? new ArrayList<>() : userTaskList;
// 根据类型,获取出口连线
List<SequenceFlow> sequenceFlows = getElementOutgoingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 如果为用户任务类型,且任务节点的 Key 正在运行的任务中存在,添加
if (sequenceFlow.getTargetFlowElement() instanceof UserTask) {
userTaskList.add((UserTask) sequenceFlow.getTargetFlowElement());
continue;
}
// 如果节点为子流程节点情况,则从节点中的第一个节点开始获取
if (sequenceFlow.getTargetFlowElement() instanceof SubProcess) {
List<UserTask> childUserTaskList = findChildProcessUserTasks((FlowElement) (((SubProcess) sequenceFlow.getTargetFlowElement()).getFlowElements().toArray()[0]), hasSequenceFlow, null);
// 如果找到节点,则说明该线路找到节点,不继续向下找,反之继续
if (childUserTaskList != null && childUserTaskList.size() > 0) {
userTaskList.addAll(childUserTaskList);
continue;
}
}
// 继续迭代
userTaskList = findChildProcessUserTasks(sequenceFlow.getTargetFlowElement(), hasSequenceFlow, userTaskList);
}
}
return userTaskList;
}
/**
* 线
*
* @param source
* @param passRoads
* @param hasSequenceFlow 线 ID线
* @param targets 线
* @param dirtyRoads 使 set
* @return
*/
public static Set<String> iteratorFindDirtyRoads(FlowElement source, List<String> passRoads, Set<String> hasSequenceFlow, List<String> targets, Set<String> dirtyRoads) {
passRoads = passRoads == null ? new ArrayList<>() : passRoads;
dirtyRoads = dirtyRoads == null ? new HashSet<>() : dirtyRoads;
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (source instanceof StartEvent && source.getSubProcess() != null) {
dirtyRoads = iteratorFindDirtyRoads(source.getSubProcess(), passRoads, hasSequenceFlow, targets, dirtyRoads);
}
// 根据类型,获取入口连线
List<SequenceFlow> sequenceFlows = getElementIncomingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 新增经过的路线
passRoads.add(sequenceFlow.getSourceFlowElement().getId());
// 如果此点为目标点,确定经过的路线为脏线路,添加点到脏线路中,然后找下个连线
if (targets.contains(sequenceFlow.getSourceFlowElement().getId())) {
dirtyRoads.addAll(passRoads);
continue;
}
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (sequenceFlow.getSourceFlowElement() instanceof SubProcess) {
dirtyRoads = findChildProcessAllDirtyRoad((StartEvent) ((SubProcess) sequenceFlow.getSourceFlowElement()).getFlowElements().toArray()[0], null, dirtyRoads);
// 是否存在子流程上true 是false 否
Boolean isInChildProcess = dirtyTargetInChildProcess((StartEvent) ((SubProcess) sequenceFlow.getSourceFlowElement()).getFlowElements().toArray()[0], null, targets, null);
if (isInChildProcess) {
// 已在子流程上找到,该路线结束
continue;
}
}
// 继续迭代
dirtyRoads = iteratorFindDirtyRoads(sequenceFlow.getSourceFlowElement(), passRoads, hasSequenceFlow, targets, dirtyRoads);
}
}
return dirtyRoads;
}
/**
* 线
* 退退线
*
* @param source
* @param hasSequenceFlow 线 ID线
* @param dirtyRoads 使 set
* @return
*/
public static Set<String> findChildProcessAllDirtyRoad(FlowElement source, Set<String> hasSequenceFlow, Set<String> dirtyRoads) {
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
dirtyRoads = dirtyRoads == null ? new HashSet<>() : dirtyRoads;
// 根据类型,获取出口连线
List<SequenceFlow> sequenceFlows = getElementOutgoingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 添加脏路线
dirtyRoads.add(sequenceFlow.getTargetFlowElement().getId());
// 如果节点为子流程节点情况,则从节点中的第一个节点开始获取
if (sequenceFlow.getTargetFlowElement() instanceof SubProcess) {
dirtyRoads = findChildProcessAllDirtyRoad((FlowElement) (((SubProcess) sequenceFlow.getTargetFlowElement()).getFlowElements().toArray()[0]), hasSequenceFlow, dirtyRoads);
}
// 继续迭代
dirtyRoads = findChildProcessAllDirtyRoad(sequenceFlow.getTargetFlowElement(), hasSequenceFlow, dirtyRoads);
}
}
return dirtyRoads;
}
/**
* 线
*
* @param source
* @param hasSequenceFlow 线 ID线
* @param targets 线线
* @param inChildProcess true false
* @return
*/
public static Boolean dirtyTargetInChildProcess(FlowElement source, Set<String> hasSequenceFlow, List<String> targets, Boolean inChildProcess) {
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
inChildProcess = inChildProcess != null && inChildProcess;
// 根据类型,获取出口连线
List<SequenceFlow> sequenceFlows = getElementOutgoingFlows(source);
if (sequenceFlows != null && !inChildProcess) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 如果发现目标点在子流程上存在,说明只到子流程为止
if (targets.contains(sequenceFlow.getTargetFlowElement().getId())) {
inChildProcess = true;
break;
}
// 如果节点为子流程节点情况,则从节点中的第一个节点开始获取
if (sequenceFlow.getTargetFlowElement() instanceof SubProcess) {
inChildProcess = dirtyTargetInChildProcess((FlowElement) (((SubProcess) sequenceFlow.getTargetFlowElement()).getFlowElements().toArray()[0]), hasSequenceFlow, targets, inChildProcess);
}
// 继续迭代
inChildProcess = dirtyTargetInChildProcess(sequenceFlow.getTargetFlowElement(), hasSequenceFlow, targets, inChildProcess);
}
}
return inChildProcess;
}
/**
*
* 退
*
* @param source
* @param isSequential
* @param hasSequenceFlow 线 ID线
* @param targetKsy
* @return
*/
public static Boolean iteratorCheckSequentialReferTarget(FlowElement source, String targetKsy, Set<String> hasSequenceFlow, Boolean isSequential) {
isSequential = isSequential == null || isSequential;
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (source instanceof StartEvent && source.getSubProcess() != null) {
isSequential = iteratorCheckSequentialReferTarget(source.getSubProcess(), targetKsy, hasSequenceFlow, isSequential);
}
// 根据类型,获取入口连线
List<SequenceFlow> sequenceFlows = getElementIncomingFlows(source);
if (sequenceFlows != null) {
// 循环找到目标元素
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 如果目标节点已被判断为并行,后面都不需要执行,直接返回
if (!isSequential) {
break;
}
// 这条线路存在目标节点,这条线路完成,进入下个线路
if (targetKsy.equals(sequenceFlow.getSourceFlowElement().getId())) {
continue;
}
if (sequenceFlow.getSourceFlowElement() instanceof StartEvent) {
isSequential = false;
break;
}
// 否则就继续迭代
isSequential = iteratorCheckSequentialReferTarget(sequenceFlow.getSourceFlowElement(), targetKsy, hasSequenceFlow, isSequential);
}
}
return isSequential;
}
/**
* 线
* 退退
*
* @param source
* @param passRoads
* @param roads 线
* @return
*/
public static List<List<UserTask>> findRoad(FlowElement source, List<UserTask> passRoads, Set<String> hasSequenceFlow, List<List<UserTask>> roads) {
passRoads = passRoads == null ? new ArrayList<>() : passRoads;
roads = roads == null ? new ArrayList<>() : roads;
hasSequenceFlow = hasSequenceFlow == null ? new HashSet<>() : hasSequenceFlow;
// 如果该节点为开始节点,且存在上级子节点,则顺着上级子节点继续迭代
if (source instanceof StartEvent && source.getSubProcess() != null) {
roads = findRoad(source.getSubProcess(), passRoads, hasSequenceFlow, roads);
}
// 根据类型,获取入口连线
List<SequenceFlow> sequenceFlows = getElementIncomingFlows(source);
if (sequenceFlows != null && sequenceFlows.size() != 0) {
for (SequenceFlow sequenceFlow : sequenceFlows) {
// 如果发现连线重复,说明循环了,跳过这个循环
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
continue;
}
// 添加已经走过的连线
hasSequenceFlow.add(sequenceFlow.getId());
// 添加经过路线
if (sequenceFlow.getSourceFlowElement() instanceof UserTask) {
passRoads.add((UserTask) sequenceFlow.getSourceFlowElement());
}
// 继续迭代
roads = findRoad(sequenceFlow.getSourceFlowElement(), passRoads, hasSequenceFlow, roads);
}
} else {
// 添加路线
roads.add(passRoads);
}
return roads;
}
/**
*
*
* @param allElements
* @param historicTaskInstanceList
* @return
*/
public static List<String> historicTaskInstanceClean(Collection<FlowElement> allElements, List<HistoricTaskInstance> historicTaskInstanceList) {
// 会签节点收集
List<String> multiTask = new ArrayList<>();
allElements.forEach(flowElement -> {
if (flowElement instanceof UserTask) {
// 如果该节点的行为为会签行为,说明该节点为会签节点
if (((UserTask) flowElement).getBehavior() instanceof ParallelMultiInstanceBehavior || ((UserTask) flowElement).getBehavior() instanceof SequentialMultiInstanceBehavior) {
multiTask.add(flowElement.getId());
}
}
});
// 循环放入栈,栈 LIFO后进先出
Stack<HistoricTaskInstance> stack = new Stack<>();
historicTaskInstanceList.forEach(stack::push);
// 清洗后的历史任务实例
List<String> lastHistoricTaskInstanceList = new ArrayList<>();
// 网关存在可能只走了部分分支情况,且还存在跳转废弃数据以及其他分支数据的干扰,因此需要对历史节点数据进行清洗
// 临时用户任务 key
StringBuilder userTaskKey = null;
// 临时被删掉的任务 key存在并行情况
List<String> deleteKeyList = new ArrayList<>();
// 临时脏数据线路
List<Set<String>> dirtyDataLineList = new ArrayList<>();
// 由某个点跳到会签点,此时出现多个会签实例对应 1 个跳转情况,需要把这些连续脏数据都找到
// 会签特殊处理下标
int multiIndex = -1;
// 会签特殊处理 key
StringBuilder multiKey = null;
// 会签特殊处理操作标识
boolean multiOpera = false;
while (!stack.empty()) {
// 从这里开始 userTaskKey 都还是上个栈的 key
// 是否是脏数据线路上的点
final boolean[] isDirtyData = {false};
for (Set<String> oldDirtyDataLine : dirtyDataLineList) {
if (oldDirtyDataLine.contains(stack.peek().getTaskDefinitionKey())) {
isDirtyData[0] = true;
}
}
// 删除原因不为空,说明从这条数据开始回跳或者回退的
// MI_END会签完成后其他未签到节点的删除原因不在处理范围内
if (stack.peek().getDeleteReason() != null && !"MI_END".equals(stack.peek().getDeleteReason())) {
// 可以理解为脏线路起点
String dirtyPoint = "";
if (stack.peek().getDeleteReason().contains("Change activity to ")) {
dirtyPoint = stack.peek().getDeleteReason().replace("Change activity to ", "");
}
// 会签回退删除原因有点不同
if (stack.peek().getDeleteReason().contains("Change parent activity to ")) {
dirtyPoint = stack.peek().getDeleteReason().replace("Change parent activity to ", "");
}
FlowElement dirtyTask = null;
// 获取变更节点的对应的入口处连线
// 如果是网关并行回退情况,会变成两条脏数据路线,效果一样
for (FlowElement flowElement : allElements) {
if (flowElement.getId().equals(stack.peek().getTaskDefinitionKey())) {
dirtyTask = flowElement;
}
}
// 获取脏数据线路
Set<String> dirtyDataLine = FlowableUtils.iteratorFindDirtyRoads(dirtyTask, null, null, Arrays.asList(dirtyPoint.split(",")), null);
// 自己本身也是脏线路上的点,加进去
dirtyDataLine.add(stack.peek().getTaskDefinitionKey());
log.info(stack.peek().getTaskDefinitionKey() + "点脏路线集合:" + dirtyDataLine);
// 是全新的需要添加的脏线路
boolean isNewDirtyData = true;
for (int i = 0; i < dirtyDataLineList.size(); i++) {
// 如果发现他的上个节点在脏线路内,说明这个点可能是并行的节点,或者连续驳回
// 这时,都以之前的脏线路节点为标准,只需合并脏线路即可,也就是路线补全
if (dirtyDataLineList.get(i).contains(userTaskKey.toString())) {
isNewDirtyData = false;
dirtyDataLineList.get(i).addAll(dirtyDataLine);
}
}
// 已确定时全新的脏线路
if (isNewDirtyData) {
// deleteKey 单一路线驳回到并行,这种同时生成多个新实例记录情况,这时 deleteKey 其实是由多个值组成
// 按照逻辑,回退后立刻生成的实例记录就是回退的记录
// 至于驳回所生成的 Key直接从删除原因中获取因为存在驳回到并行的情况
deleteKeyList.add(dirtyPoint + ",");
dirtyDataLineList.add(dirtyDataLine);
}
// 添加后,现在这个点变成脏线路上的点了
isDirtyData[0] = true;
}
// 如果不是脏线路上的点,说明是有效数据,添加历史实例 Key
if (!isDirtyData[0]) {
lastHistoricTaskInstanceList.add(stack.peek().getTaskDefinitionKey());
}
// 校验脏线路是否结束
for (int i = 0; i < deleteKeyList.size(); i++) {
// 如果发现脏数据属于会签,记录下下标与对应 Key以备后续比对会签脏数据范畴开始
if (multiKey == null && multiTask.contains(stack.peek().getTaskDefinitionKey())
&& deleteKeyList.get(i).contains(stack.peek().getTaskDefinitionKey())) {
multiIndex = i;
multiKey = new StringBuilder(stack.peek().getTaskDefinitionKey());
}
// 会签脏数据处理,节点退回会签清空
// 如果在会签脏数据范畴中发现 Key改变说明会签脏数据在上个节点就结束了可以把会签脏数据删掉
if (multiKey != null && !multiKey.toString().equals(stack.peek().getTaskDefinitionKey())) {
deleteKeyList.set(multiIndex, deleteKeyList.get(multiIndex).replace(stack.peek().getTaskDefinitionKey() + ",", ""));
multiKey = null;
// 结束进行下校验删除
multiOpera = true;
}
// 其他脏数据处理
// 发现该路线最后一条脏数据,说明这条脏数据线路处理完了,删除脏数据信息
// 脏数据产生的新实例中是否包含这条数据
if (multiKey == null && deleteKeyList.get(i).contains(stack.peek().getTaskDefinitionKey())) {
// 删除匹配到的部分
deleteKeyList.set(i, deleteKeyList.get(i).replace(stack.peek().getTaskDefinitionKey() + ",", ""));
}
// 如果每组中的元素都以匹配过,说明脏数据结束
if ("".equals(deleteKeyList.get(i))) {
// 同时删除脏数据
deleteKeyList.remove(i);
dirtyDataLineList.remove(i);
break;
}
}
// 会签数据处理需要在循环外处理,否则可能导致溢出
// 会签的数据肯定是之前放进去的所以理论上不会溢出,但还是校验下
if (multiOpera && deleteKeyList.size() > multiIndex && "".equals(deleteKeyList.get(multiIndex))) {
// 同时删除脏数据
deleteKeyList.remove(multiIndex);
dirtyDataLineList.remove(multiIndex);
multiIndex = -1;
multiOpera = false;
}
// pop() 方法与 peek() 方法不同,在返回值的同时,会把值从栈中移除
// 保存新的 userTaskKey 在下个循环中使用
userTaskKey = new StringBuilder(stack.pop().getTaskDefinitionKey());
}
log.info("清洗后的历史节点数据:" + lastHistoricTaskInstanceList);
return lastHistoricTaskInstanceList;
}
/**
* flowElement
*
* @param flowElement
* @param extensionElementName
*/
public static ExtensionElement getExtensionElementFromFlowElementByName(FlowElement flowElement, String extensionElementName) {
if (flowElement == null) {
return null;
}
Map<String, List<ExtensionElement>> extensionElements = flowElement.getExtensionElements();
for (Map.Entry<String, List<ExtensionElement>> stringEntry : extensionElements.entrySet()) {
if (stringEntry.getKey().equals(extensionElementName)) {
for (ExtensionElement extensionElement : stringEntry.getValue()) {
if (extensionElement.getName().equals(extensionElementName)) {
return extensionElement;
}
}
}
}
return null;
}
/**
*
*
* @param repositoryService
* @param task
* @return
*/
public static List<Object> getPropertyElement(RepositoryService repositoryService, org.flowable.task.api.Task task) {
FlowElement flowElement = getCurrentElement(repositoryService, task);
ExtensionElement extensionElement = FlowableUtils.getExtensionElementFromFlowElementByName(flowElement, "properties");
if (extensionElement == null) {
return Collections.emptyList();
}
return getPropertyExtensionElementByName(extensionElement, "property");
}
/**
*
*
* @param repositoryService
* @param task
* @return
*/
public static FlowElement getCurrentElement(RepositoryService repositoryService, org.flowable.task.api.Task task) {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
return bpmnModel.getFlowElement(task.getTaskDefinitionKey());
}
/**
*
*
* @param extensionElement
* @param attributesName
* @return
*/
public static List<Object> getPropertyExtensionElementByName(ExtensionElement extensionElement, String attributesName) {
try {
// 获取名称为attributesName的子元素
return Optional.ofNullable(extensionElement.getChildElements().get(attributesName))
.orElse(Collections.emptyList()) // 如果子元素不存在则返回空集合避免null引用
.stream()
.map(element -> {
// 获取子元素的属性
Map<String, List<ExtensionAttribute>> attributes = element.getAttributes();
Object propertyDto = new Object();
// 获取FlowPropertyDto的所有属性
Arrays.stream(propertyDto.getClass().getDeclaredFields())
.forEach(field -> {
field.setAccessible(true);
// 获取属性名称和值
attributes.getOrDefault(field.getName(), Collections.emptyList())
.stream()
.findFirst()
.ifPresent(attribute -> {
try {
// 反射设置属性值
field.set(propertyDto, attribute.getValue());
} catch (IllegalAccessException e) {
e.printStackTrace();
// 如果反射设置失败则忽略该属性
}
});
});
return propertyDto;
}).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
return Collections.emptyList(); // 如果发生异常则返回空列表
}
}
}

View File

@ -0,0 +1,36 @@
package com.ruoyi.flowable.listener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.Expression;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
/**
*
*
* Java
*
*
*
*
*
*
*
*
* @author Tony
* @date 2022/12/16
*/
@Slf4j
@Component
public class FlowExecutionListener implements ExecutionListener {
/**
*
*/
private Expression param;
@Override
public void notify(DelegateExecution execution) {
log.info("执行监听器:{}", execution);
}
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.flowable.listener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;
/**
*
*
* create:
* assignment
* complete
* deletecompleteTask
*
* @author Tony
* @date 2021/4/20
*/
@Slf4j
@Component
public class FlowTaskListener implements TaskListener{
@Override
public void notify(DelegateTask delegateTask) {
log.info("任务监听器:{}", delegateTask);
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
}
}

View File

@ -0,0 +1,80 @@
package com.ruoyi.flowable.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.FlowProcDefDto;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
/**
* @author Tony
* @date 2021-04-03 14:41
*/
public interface IFlowDefinitionService {
boolean exist(String processDefinitionKey);
/**
*
*
* @param pageNum
* @param pageSize
* @return
*/
Page<FlowProcDefDto> list(String name,Integer pageNum, Integer pageSize);
/**
*
* key1使key
* key1key
* @param name
* @param category
* @param in
*/
void importFile(String name, String category, InputStream in);
/**
* xml
* @param deployId
* @return
*/
AjaxResult readXml(String deployId) throws IOException;
/**
* ID
*
* @param procDefId
* @param variables
* @return
*/
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
/**
*
*
* @param state
* @param deployId ID
*/
void updateState(Integer state, String deployId);
/**
*
*
* @param deployId ID act_ge_bytearray deployment_id
*/
void delete(String deployId);
/**
*
* @param deployId
* @return
*/
InputStream readImage(String deployId);
}

View File

@ -0,0 +1,53 @@
package com.ruoyi.flowable.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import org.flowable.engine.history.HistoricProcessInstance;
import java.util.Map;
/**
* @author Tony
* @date 2021-04-03 14:40
*/
public interface IFlowInstanceService {
/**
*
*
* @param vo
*/
void stopProcessInstance(FlowTaskVo vo);
/**
*
*
* @param state
* @param instanceId ID
*/
void updateState(Integer state, String instanceId);
/**
* ID
*
* @param instanceId ID
* @param deleteReason
*/
void delete(String instanceId, String deleteReason);
/**
* ID
*
* @param processInstanceId
* @return
*/
HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);
/**
* ID
*
* @param procDefId Id
* @param variables
* @return
*/
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
}

View File

@ -0,0 +1,218 @@
package com.ruoyi.flowable.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.flowable.domain.vo.FlowQueryVo;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import org.flowable.task.api.Task;
import java.io.InputStream;
import java.util.List;
/**
* @author Tony
* @date 2021-04-03 14:42
*/
public interface IFlowTaskService {
/**
*
*
* @param task
*/
AjaxResult complete(FlowTaskVo task);
/**
*
*
* @param flowTaskVo
*/
void taskReject(FlowTaskVo flowTaskVo);
/**
* 退
*
* @param flowTaskVo
*/
void taskReturn(FlowTaskVo flowTaskVo);
/**
* 退
*
* @param flowTaskVo
* @return
*/
AjaxResult findReturnTaskList(FlowTaskVo flowTaskVo);
/**
*
*
* @param flowTaskVo
*/
void deleteTask(FlowTaskVo flowTaskVo);
/**
* /
*
* @param flowTaskVo
*/
void claim(FlowTaskVo flowTaskVo);
/**
* /
*
* @param flowTaskVo
*/
void unClaim(FlowTaskVo flowTaskVo);
/**
*
*
* @param flowTaskVo
*/
void delegateTask(FlowTaskVo flowTaskVo);
/**
*
*
* @param flowTaskVo
*/
void resolveTask(FlowTaskVo flowTaskVo);
/**
*
*
* @param flowTaskVo
*/
void assignTask(FlowTaskVo flowTaskVo);
/**
*
* @param flowTaskVo
*/
void addMultiInstanceExecution(FlowTaskVo flowTaskVo);
/**
*
* @param flowTaskVo
*/
void deleteMultiInstanceExecution(FlowTaskVo flowTaskVo);
/**
*
* @param queryVo
* @return
*/
AjaxResult myProcess(FlowQueryVo queryVo);
/**
*
* :
* @param flowTaskVo
* @return
*/
AjaxResult stopProcess(FlowTaskVo flowTaskVo);
/**
*
* @param flowTaskVo
* @return
*/
AjaxResult revokeProcess(FlowTaskVo flowTaskVo);
/**
*
*
* @param queryVo
* @return
*/
AjaxResult todoList(FlowQueryVo queryVo);
/**
*
*
* @param queryVo
* @return
*/
AjaxResult finishedList(FlowQueryVo queryVo);
/**
*
*
* @param procInsId Id
* @return
*/
AjaxResult flowRecord(String procInsId,String deployId);
/**
* ID
*
* @param taskId Id
* @return
*/
AjaxResult getTaskForm(String taskId);
/**
*
* @param processId
* @return
*/
InputStream diagram(String processId);
/**
*
* @param procInsId
* @return
*/
AjaxResult getFlowViewer(String procInsId,String executionId);
/**
*
* @param taskId
* @return
*/
AjaxResult processVariables(String taskId);
/**
*
* @param flowTaskVo
* @return
*/
AjaxResult getNextFlowNode(FlowTaskVo flowTaskVo);
AjaxResult getNextFlowNodeByStart(FlowTaskVo flowTaskVo);
/**
*
* @param deployId
* @return
*/
AjaxResult flowFormData(String deployId);
/**
*
* @param procInsId
* @return
*/
AjaxResult flowXmlAndNode(String procInsId,String deployId);
/**
*
* @param taskId
* @return
*/
AjaxResult flowTaskForm(String taskId) throws Exception;
/**
*
* @param procInsId
* @param elementId
* @return
*/
AjaxResult flowTaskInfo(String procInsId, String elementId);
}

View File

@ -0,0 +1,69 @@
package com.ruoyi.flowable.service;
import java.util.List;
import com.ruoyi.system.domain.SysDeployForm;
import com.ruoyi.system.domain.SysForm;
/**
* Service
*
* @author Tony
* @date 2021-04-03
*/
public interface ISysDeployFormService
{
/**
*
*
* @param id ID
* @return
*/
public SysDeployForm selectSysDeployFormById(Long id);
/**
*
*
* @param sysDeployForm
* @return
*/
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm sysDeployForm);
/**
*
*
* @param sysDeployForm
* @return
*/
public int insertSysDeployForm(SysDeployForm sysDeployForm);
/**
*
*
* @param sysDeployForm
* @return
*/
public int updateSysDeployForm(SysDeployForm sysDeployForm);
/**
*
*
* @param ids ID
* @return
*/
public int deleteSysDeployFormByIds(Long[] ids);
/**
*
*
* @param id ID
* @return
*/
public int deleteSysDeployFormById(Long id);
/**
*
* @param deployId
* @return
*/
SysForm selectSysDeployFormByDeployId(String deployId);
}

View File

@ -0,0 +1,60 @@
package com.ruoyi.flowable.service;
import java.util.List;
import com.ruoyi.system.domain.SysForm;
/**
*
* @author Tony
* @date 2021-04-03
*/
public interface ISysFormService
{
/**
*
*
* @param formId ID
* @return
*/
public SysForm selectSysFormById(Long formId);
/**
*
*
* @param sysForm
* @return
*/
public List<SysForm> selectSysFormList(SysForm sysForm);
/**
*
*
* @param sysForm
* @return
*/
public int insertSysForm(SysForm sysForm);
/**
*
*
* @param sysForm
* @return
*/
public int updateSysForm(SysForm sysForm);
/**
*
*
* @param formIds ID
* @return
*/
public int deleteSysFormByIds(Long[] formIds);
/**
*
*
* @param formId ID
* @return
*/
public int deleteSysFormById(Long formId);
}

View File

@ -0,0 +1,248 @@
package com.ruoyi.flowable.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.flowable.common.enums.FlowComment;
import com.ruoyi.system.domain.FlowProcDefDto;
import com.ruoyi.flowable.factory.FlowServiceFactory;
import com.ruoyi.flowable.service.IFlowDefinitionService;
import com.ruoyi.flowable.service.ISysDeployFormService;
import com.ruoyi.system.domain.SysForm;
import com.ruoyi.system.mapper.FlowDeployMapper;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.repository.ProcessDefinitionQuery;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
import org.flowable.task.api.Task;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
*
*
* @author Tony
* @date 2021-04-03
*/
@Service
@Slf4j
public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFlowDefinitionService {
@Resource
private ISysDeployFormService sysDeployFormService;
@Resource
private ISysUserService sysUserService;
@Resource
private ISysDeptService sysDeptService;
@Resource
private FlowDeployMapper flowDeployMapper;
private static final String BPMN_FILE_SUFFIX = ".bpmn";
@Override
public boolean exist(String processDefinitionKey) {
ProcessDefinitionQuery processDefinitionQuery
= repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey);
long count = processDefinitionQuery.count();
return count > 0 ? true : false;
}
/**
*
*
* @param pageNum
* @param pageSize
* @return
*/
@Override
public Page<FlowProcDefDto> list(String name, Integer pageNum, Integer pageSize) {
Page<FlowProcDefDto> page = new Page<>();
// // 流程定义列表数据查询
// final ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
// if (StringUtils.isNotEmpty(name)) {
// processDefinitionQuery.processDefinitionNameLike(name);
// }
//// processDefinitionQuery.orderByProcessDefinitionKey().asc();
// page.setTotal(processDefinitionQuery.count());
// List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageSize * (pageNum - 1), pageSize);
//
// List<FlowProcDefDto> dataList = new ArrayList<>();
// for (ProcessDefinition processDefinition : processDefinitionList) {
// String deploymentId = processDefinition.getDeploymentId();
// Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
// FlowProcDefDto reProcDef = new FlowProcDefDto();
// BeanUtils.copyProperties(processDefinition, reProcDef);
// SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(deploymentId);
// if (Objects.nonNull(sysForm)) {
// reProcDef.setFormName(sysForm.getFormName());
// reProcDef.setFormId(sysForm.getFormId());
// }
// // 流程定义时间
// reProcDef.setDeploymentTime(deployment.getDeploymentTime());
// dataList.add(reProcDef);
// }
PageHelper.startPage(pageNum, pageSize);
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(name);
// 加载挂表单
for (FlowProcDefDto procDef : dataList) {
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
if (Objects.nonNull(sysForm)) {
procDef.setFormName(sysForm.getFormName());
procDef.setFormId(sysForm.getFormId());
}
}
page.setTotal(new PageInfo(dataList).getTotal());
page.setRecords(dataList);
return page;
}
/**
*
*
* key1使key
* key1key
* @param name
* @param category
* @param in
*/
@Override
public void importFile(String name, String category, InputStream in) {
Deployment deploy = repositoryService.createDeployment().addInputStream(name + BPMN_FILE_SUFFIX, in).name(name).category(category).deploy();
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deploy.getId()).singleResult();
repositoryService.setProcessDefinitionCategory(definition.getId(), category);
}
/**
* xml
*
* @param deployId
* @return
*/
@Override
public AjaxResult readXml(String deployId) throws IOException {
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
InputStream inputStream = repositoryService.getResourceAsStream(definition.getDeploymentId(), definition.getResourceName());
String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8.name());
return AjaxResult.success("", result);
}
/**
* xml
*
* @param deployId
* @return
*/
@Override
public InputStream readImage(String deployId) {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
//获得图片流
DefaultProcessDiagramGenerator diagramGenerator = new DefaultProcessDiagramGenerator();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
//输出为图片
return diagramGenerator.generateDiagram(
bpmnModel,
"png",
Collections.emptyList(),
Collections.emptyList(),
"宋体",
"宋体",
"宋体",
null,
1.0,
false);
}
/**
* ID
*
* @param procDefId ID
* @param variables
* @return
*/
@Override
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
try {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
.latestVersion().singleResult();
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
return AjaxResult.error("流程已被挂起,请先激活流程");
}
// 设置流程发起人Id到流程中
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
// 流程发起时 跳过发起人节点
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
// 给第一步申请人节点设置任务执行人和意见
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
if (Objects.nonNull(task)) {
taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
taskService.complete(task.getId(), variables);
}
return AjaxResult.success("流程启动成功");
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("流程启动错误");
}
}
/**
*
*
* @param state
* @param deployId ID
*/
@Override
public void updateState(Integer state, String deployId) {
ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
// 激活
if (state == 1) {
repositoryService.activateProcessDefinitionById(procDef.getId(), true, null);
}
// 挂起
if (state == 2) {
repositoryService.suspendProcessDefinitionById(procDef.getId(), true, null);
}
}
/**
*
*
* @param deployId ID act_ge_bytearray deployment_id
*/
@Override
public void delete(String deployId) {
// true 允许级联删除 ,不设置会导致数据库外键关联异常
repositoryService.deleteDeployment(deployId, true);
}
}

View File

@ -0,0 +1,122 @@
package com.ruoyi.flowable.service.impl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import com.ruoyi.flowable.factory.FlowServiceFactory;
import com.ruoyi.flowable.service.IFlowInstanceService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.task.api.Task;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Service
@Slf4j
public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlowInstanceService {
/**
*
*
* @param vo
*/
@Override
public void stopProcessInstance(FlowTaskVo vo) {
String taskId = vo.getTaskId();
}
/**
*
*
* @param state
* @param instanceId ID
*/
@Override
public void updateState(Integer state, String instanceId) {
// 激活
if (state == 1) {
runtimeService.activateProcessInstanceById(instanceId);
}
// 挂起
if (state == 2) {
runtimeService.suspendProcessInstanceById(instanceId);
}
}
/**
* ID
*
* @param instanceId ID
* @param deleteReason
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String instanceId, String deleteReason) {
// 查询历史数据
HistoricProcessInstance historicProcessInstance = getHistoricProcessInstanceById(instanceId);
if (historicProcessInstance.getEndTime() != null) {
historyService.deleteHistoricProcessInstance(historicProcessInstance.getId());
return;
}
// 删除流程实例
runtimeService.deleteProcessInstance(instanceId, deleteReason);
// 删除历史流程实例
historyService.deleteHistoricProcessInstance(instanceId);
}
/**
* ID
*
* @param processInstanceId
* @return
*/
@Override
public HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId) {
HistoricProcessInstance historicProcessInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if (Objects.isNull(historicProcessInstance)) {
throw new FlowableObjectNotFoundException("流程实例不存在: " + processInstanceId);
}
return historicProcessInstance;
}
/**
* ID
*
* @param procDefId Id
* @param variables
* @return
*/
@Override
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
try {
// 设置流程发起人Id到流程中
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
// identityService.setAuthenticatedUserId(userId.toString());
variables.put("initiator",userId);
variables.put("_FLOWABLE_SKIP_EXPRESSION_ENABLED", true);
runtimeService.startProcessInstanceById(procDefId, variables);
return AjaxResult.success("流程启动成功");
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("流程启动错误");
}
}
}

View File

@ -0,0 +1,112 @@
package com.ruoyi.flowable.service.impl;
import java.util.List;
import java.util.Objects;
import com.ruoyi.system.domain.SysForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysDeployFormMapper;
import com.ruoyi.system.domain.SysDeployForm;
import com.ruoyi.flowable.service.ISysDeployFormService;
/**
* Service
*
* @author Tony
* @date 2021-04-03
*/
@Service
public class SysDeployFormServiceImpl implements ISysDeployFormService
{
@Autowired
private SysDeployFormMapper sysDeployFormMapper;
/**
*
*
* @param id ID
* @return
*/
@Override
public SysDeployForm selectSysDeployFormById(Long id)
{
return sysDeployFormMapper.selectSysDeployFormById(id);
}
/**
*
*
* @param sysDeployForm
* @return
*/
@Override
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm sysDeployForm)
{
return sysDeployFormMapper.selectSysDeployFormList(sysDeployForm);
}
/**
*
*
* @param sysDeployForm
* @return
*/
@Override
public int insertSysDeployForm(SysDeployForm sysDeployForm)
{
SysForm sysForm = sysDeployFormMapper.selectSysDeployFormByDeployId(sysDeployForm.getDeployId());
if (Objects.isNull(sysForm)) {
return sysDeployFormMapper.insertSysDeployForm(sysDeployForm);
}else {
return 1;
}
}
/**
*
*
* @param sysDeployForm
* @return
*/
@Override
public int updateSysDeployForm(SysDeployForm sysDeployForm)
{
return sysDeployFormMapper.updateSysDeployForm(sysDeployForm);
}
/**
*
*
* @param ids ID
* @return
*/
@Override
public int deleteSysDeployFormByIds(Long[] ids)
{
return sysDeployFormMapper.deleteSysDeployFormByIds(ids);
}
/**
*
*
* @param id ID
* @return
*/
@Override
public int deleteSysDeployFormById(Long id)
{
return sysDeployFormMapper.deleteSysDeployFormById(id);
}
/**
*
*
* @param deployId
* @return
*/
@Override
public SysForm selectSysDeployFormByDeployId(String deployId) {
return sysDeployFormMapper.selectSysDeployFormByDeployId(deployId);
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.flowable.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysFormMapper;
import com.ruoyi.system.domain.SysForm;
import com.ruoyi.flowable.service.ISysFormService;
/**
* Service
*
* @author Tony
* @date 2021-04-03
*/
@Service
public class SysFormServiceImpl implements ISysFormService
{
@Autowired
private SysFormMapper sysFormMapper;
/**
*
*
* @param formId ID
* @return
*/
@Override
public SysForm selectSysFormById(Long formId)
{
return sysFormMapper.selectSysFormById(formId);
}
/**
*
*
* @param sysForm
* @return
*/
@Override
public List<SysForm> selectSysFormList(SysForm sysForm)
{
return sysFormMapper.selectSysFormList(sysForm);
}
/**
*
*
* @param sysForm
* @return
*/
@Override
public int insertSysForm(SysForm sysForm)
{
sysForm.setCreateTime(DateUtils.getNowDate());
return sysFormMapper.insertSysForm(sysForm);
}
/**
*
*
* @param sysForm
* @return
*/
@Override
public int updateSysForm(SysForm sysForm)
{
sysForm.setUpdateTime(DateUtils.getNowDate());
return sysFormMapper.updateSysForm(sysForm);
}
/**
*
*
* @param formIds ID
* @return
*/
@Override
public int deleteSysFormByIds(Long[] formIds)
{
return sysFormMapper.deleteSysFormByIds(formIds);
}
/**
*
*
* @param formId ID
* @return
*/
@Override
public int deleteSysFormById(Long formId)
{
return sysFormMapper.deleteSysFormById(formId);
}
}

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>

View File

@ -0,0 +1,23 @@
//package com.ruoyi.framework.config;
//
//import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
//import com.ruoyi.common.utils.DateUtils;
//import org.apache.commons.lang3.StringUtils;
//
//import java.util.Date;
//
///**
// * 自定义 p6spy sql输出格式
// *
// */
//public class P6spySqlFormatConfig implements MessageFormattingStrategy {
//
// /**
// * 过滤掉定时任务的 SQL
// */
// @Override
// public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
// return StringUtils.isNotBlank(sql) ? DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date())
// + " | 耗时 " + elapsed + " ms | SQL 语句:" + StringUtils.LF + sql.replaceAll("[\\s]+", StringUtils.SPACE) + ";" : "";
// }
//}

View File

@ -1,6 +1,8 @@
package com.ruoyi.framework.web.exception;
import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.exception.NonCaptureException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
@ -142,4 +144,13 @@ public class GlobalExceptionHandler
{
return AjaxResult.error("演示模式,不允许操作");
}
/**
*
*/
@ExceptionHandler(NonCaptureException.class)
public AjaxResult handleNonCaptureException(NonCaptureException e)
{
throw e;
}
}

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<artifactId>SAMS-RF</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.9</version>
</parent>
@ -22,6 +22,16 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -0,0 +1,56 @@
package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* <p><p>
*
* @author Tony
* @date 2021-04-03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("流程定义")
public class FlowProcDefDto implements Serializable {
@ApiModelProperty("流程id")
private String id;
@ApiModelProperty("流程名称")
private String name;
@ApiModelProperty("流程key")
private String flowKey;
@ApiModelProperty("流程分类")
private String category;
@ApiModelProperty("配置表单名称")
private String formName;
@ApiModelProperty("配置表单id")
private Long formId;
@ApiModelProperty("版本")
private int version;
@ApiModelProperty("部署ID")
private String deploymentId;
@ApiModelProperty("流程定义状态: 1:激活 , 2:中止")
private int suspensionState;
@ApiModelProperty("部署时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date deploymentTime;
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_instance_form
*
* @author Tony
* @date 2021-03-30
*/
public class SysDeployForm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 表单主键 */
@Excel(name = "表单主键")
private Long formId;
/** 流程定义主键 */
@Excel(name = "流程定义主键")
private String deployId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFormId(Long formId)
{
this.formId = formId;
}
public Long getFormId()
{
return formId;
}
public String getDeployId() {
return deployId;
}
public void setDeployId(String deployId) {
this.deployId = deployId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("formId", getFormId())
.append("deployId", getDeployId())
.toString();
}
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* sys_expression
*
* @author ruoyi
* @date 2022-12-12
*/
public class SysExpression extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 表单主键 */
private Long id;
/** 表达式名称 */
@Excel(name = "表达式名称")
private String name;
/** 表达式内容 */
@Excel(name = "表达式内容")
private String expression;
/** 表达式类型 */
@Excel(name = "表达式类型")
private String dataType;
/** 状态 */
private Integer status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setExpression(String expression)
{
this.expression = expression;
}
public String getExpression()
{
return expression;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataType() {
return dataType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("expression", getExpression())
.append("dataType", getDataType())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("status", getStatus())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,70 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_task_form
*
* @author Tony
* @date 2021-03-30
*/
public class SysForm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 表单主键 */
private Long formId;
/** 表单名称 */
@Excel(name = "表单名称")
private String formName;
/** 表单内容 */
@Excel(name = "表单内容")
private String formContent;
public void setFormId(Long formId)
{
this.formId = formId;
}
public Long getFormId()
{
return formId;
}
public void setFormName(String formName)
{
this.formName = formName;
}
public String getFormName()
{
return formName;
}
public void setFormContent(String formContent)
{
this.formContent = formContent;
}
public String getFormContent()
{
return formContent;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("formId", getFormId())
.append("formName", getFormName())
.append("formContent", getFormContent())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,126 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* sys_listener
*
* @author Tony
* @date 2022-12-25
*/
public class SysListener extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 表单主键 */
private Long id;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 监听类型 */
@Excel(name = "监听类型")
private String type;
/** 事件类型 */
@Excel(name = "事件类型")
private String eventType;
/** 值类型 */
@Excel(name = "值类型")
private String valueType;
/** 执行内容 */
@Excel(name = "执行内容")
private String value;
/** 状态 */
@Excel(name = "状态")
private Integer status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setEventType(String eventType)
{
this.eventType = eventType;
}
public String getEventType()
{
return eventType;
}
public void setValueType(String valueType)
{
this.valueType = valueType;
}
public String getValueType()
{
return valueType;
}
public void setValue(String value)
{
this.value = value;
}
public String getValue()
{
return value;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("type", getType())
.append("eventType", getEventType())
.append("valueType", getValueType())
.append("value", getValue())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("status", getStatus())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_task_form
*
* @author Tony
* @date 2021-04-03
*/
public class SysTaskForm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 表单主键 */
@Excel(name = "表单主键")
private Long formId;
/** 所属任务 */
@Excel(name = "所属任务")
private String taskId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFormId(Long formId)
{
this.formId = formId;
}
public Long getFormId()
{
return formId;
}
public void setTaskId(String taskId)
{
this.taskId = taskId;
}
public String getTaskId()
{
return taskId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("formId", getFormId())
.append("taskId", getTaskId())
.toString();
}
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.FlowProcDefDto;
import java.util.List;
/**
*
*
* @author Tony
* @email
* @date 2022/1/29 5:44
**/
public interface FlowDeployMapper {
/**
*
* @param name
* @return
*/
List<FlowProcDefDto> selectDeployList(String name);
}

View File

@ -0,0 +1,72 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysDeployForm;
import com.ruoyi.system.domain.SysForm;
import java.util.List;
/**
* Mapper
*
* @author Tony
* @date 2021-03-30
*/
public interface SysDeployFormMapper
{
/**
*
*
* @param id ID
* @return
*/
public SysDeployForm selectSysDeployFormById(Long id);
/**
*
*
* @param SysDeployForm
* @return
*/
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm SysDeployForm);
/**
*
*
* @param SysDeployForm
* @return
*/
public int insertSysDeployForm(SysDeployForm SysDeployForm);
/**
*
*
* @param SysDeployForm
* @return
*/
public int updateSysDeployForm(SysDeployForm SysDeployForm);
/**
*
*
* @param id ID
* @return
*/
public int deleteSysDeployFormById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteSysDeployFormByIds(Long[] ids);
/**
*
* @param deployId
* @return
*/
SysForm selectSysDeployFormByDeployId(String deployId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysExpression;
/**
* Mapper
*
* @author ruoyi
* @date 2022-12-12
*/
public interface SysExpressionMapper
{
/**
*
*
* @param id
* @return
*/
public SysExpression selectSysExpressionById(Long id);
/**
*
*
* @param sysExpression
* @return
*/
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression);
/**
*
*
* @param sysExpression
* @return
*/
public int insertSysExpression(SysExpression sysExpression);
/**
*
*
* @param sysExpression
* @return
*/
public int updateSysExpression(SysExpression sysExpression);
/**
*
*
* @param id
* @return
*/
public int deleteSysExpressionById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSysExpressionByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysForm;
import java.util.List;
/**
* Mapper
*
* @author Tony
* @date 2021-03-30
*/
public interface SysFormMapper
{
/**
*
*
* @param formId ID
* @return
*/
public SysForm selectSysFormById(Long formId);
/**
*
*
* @param sysForm
* @return
*/
public List<SysForm> selectSysFormList(SysForm sysForm);
/**
*
*
* @param sysForm
* @return
*/
public int insertSysForm(SysForm sysForm);
/**
*
*
* @param sysForm
* @return
*/
public int updateSysForm(SysForm sysForm);
/**
*
*
* @param formId ID
* @return
*/
public int deleteSysFormById(Long formId);
/**
*
*
* @param formIds ID
* @return
*/
public int deleteSysFormByIds(Long[] formIds);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysListener;
/**
* Mapper
*
* @author Tony
* @date 2022-12-25
*/
public interface SysListenerMapper
{
/**
*
*
* @param id
* @return
*/
public SysListener selectSysListenerById(Long id);
/**
*
*
* @param sysListener
* @return
*/
public List<SysListener> selectSysListenerList(SysListener sysListener);
/**
*
*
* @param sysListener
* @return
*/
public int insertSysListener(SysListener sysListener);
/**
*
*
* @param sysListener
* @return
*/
public int updateSysListener(SysListener sysListener);
/**
*
*
* @param id
* @return
*/
public int deleteSysListenerById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSysListenerByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysTaskForm;
import java.util.List;
/**
* Mapper
*
* @author Tony
* @date 2021-04-03
*/
public interface SysTaskFormMapper
{
/**
*
*
* @param id ID
* @return
*/
public SysTaskForm selectSysTaskFormById(Long id);
/**
*
*
* @param sysTaskForm
* @return
*/
public List<SysTaskForm> selectSysTaskFormList(SysTaskForm sysTaskForm);
/**
*
*
* @param sysTaskForm
* @return
*/
public int insertSysTaskForm(SysTaskForm sysTaskForm);
/**
*
*
* @param sysTaskForm
* @return
*/
public int updateSysTaskForm(SysTaskForm sysTaskForm);
/**
*
*
* @param id ID
* @return
*/
public int deleteSysTaskFormById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteSysTaskFormByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysExpression;
/**
* Service
*
* @author ruoyi
* @date 2022-12-12
*/
public interface ISysExpressionService
{
/**
*
*
* @param id
* @return
*/
public SysExpression selectSysExpressionById(Long id);
/**
*
*
* @param sysExpression
* @return
*/
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression);
/**
*
*
* @param sysExpression
* @return
*/
public int insertSysExpression(SysExpression sysExpression);
/**
*
*
* @param sysExpression
* @return
*/
public int updateSysExpression(SysExpression sysExpression);
/**
*
*
* @param ids
* @return
*/
public int deleteSysExpressionByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSysExpressionById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysListener;
/**
* Service
*
* @author Tony
* @date 2022-12-25
*/
public interface ISysListenerService
{
/**
*
*
* @param id
* @return
*/
public SysListener selectSysListenerById(Long id);
/**
*
*
* @param sysListener
* @return
*/
public List<SysListener> selectSysListenerList(SysListener sysListener);
/**
*
*
* @param sysListener
* @return
*/
public int insertSysListener(SysListener sysListener);
/**
*
*
* @param sysListener
* @return
*/
public int updateSysListener(SysListener sysListener);
/**
*
*
* @param ids
* @return
*/
public int deleteSysListenerByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSysListenerById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysExpressionMapper;
import com.ruoyi.system.domain.SysExpression;
import com.ruoyi.system.service.ISysExpressionService;
/**
* Service
*
* @author ruoyi
* @date 2022-12-12
*/
@Service
public class SysExpressionServiceImpl implements ISysExpressionService
{
@Autowired
private SysExpressionMapper sysExpressionMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SysExpression selectSysExpressionById(Long id)
{
return sysExpressionMapper.selectSysExpressionById(id);
}
/**
*
*
* @param sysExpression
* @return
*/
@Override
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression)
{
return sysExpressionMapper.selectSysExpressionList(sysExpression);
}
/**
*
*
* @param sysExpression
* @return
*/
@Override
public int insertSysExpression(SysExpression sysExpression)
{
sysExpression.setCreateTime(DateUtils.getNowDate());
return sysExpressionMapper.insertSysExpression(sysExpression);
}
/**
*
*
* @param sysExpression
* @return
*/
@Override
public int updateSysExpression(SysExpression sysExpression)
{
sysExpression.setUpdateTime(DateUtils.getNowDate());
return sysExpressionMapper.updateSysExpression(sysExpression);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSysExpressionByIds(Long[] ids)
{
return sysExpressionMapper.deleteSysExpressionByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSysExpressionById(Long id)
{
return sysExpressionMapper.deleteSysExpressionById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysListenerMapper;
import com.ruoyi.system.domain.SysListener;
import com.ruoyi.system.service.ISysListenerService;
/**
* Service
*
* @author Tony
* @date 2022-12-25
*/
@Service
public class SysListenerServiceImpl implements ISysListenerService
{
@Autowired
private SysListenerMapper sysListenerMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SysListener selectSysListenerById(Long id)
{
return sysListenerMapper.selectSysListenerById(id);
}
/**
*
*
* @param sysListener
* @return
*/
@Override
public List<SysListener> selectSysListenerList(SysListener sysListener)
{
return sysListenerMapper.selectSysListenerList(sysListener);
}
/**
*
*
* @param sysListener
* @return
*/
@Override
public int insertSysListener(SysListener sysListener)
{
sysListener.setCreateTime(DateUtils.getNowDate());
return sysListenerMapper.insertSysListener(sysListener);
}
/**
*
*
* @param sysListener
* @return
*/
@Override
public int updateSysListener(SysListener sysListener)
{
sysListener.setUpdateTime(DateUtils.getNowDate());
return sysListenerMapper.updateSysListener(sysListener);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSysListenerByIds(Long[] ids)
{
return sysListenerMapper.deleteSysListenerByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSysListenerById(Long id)
{
return sysListenerMapper.deleteSysListenerById(id);
}
}

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.FlowDeployMapper">
<select id="selectDeployList" resultType="com.ruoyi.system.domain.FlowProcDefDto">
SELECT
rp.id_ as id,
rp.deployment_id_ as deploymentId,
rd.name_ as name,
rd.category_ as category,
rp.key_ as flowKey,
rp.version_ as version,
rp.suspension_state_ as suspensionState,
rd.deploy_time_ as deploymentTime
FROM
act_re_procdef rp
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
<where>
<if test="name != null and name != ''">
and rd.name_ like concat('%', #{name}, '%')
</if>
</where>
order by rd.deploy_time_ desc
</select>
</mapper>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysTaskFormMapper">
<resultMap type="SysTaskForm" id="SysTaskFormResult">
<result property="id" column="id" />
<result property="formId" column="form_id" />
<result property="taskId" column="task_id" />
</resultMap>
<sql id="selectSysTaskFormVo">
select id, form_id, task_id from sys_task_form
</sql>
<select id="selectSysTaskFormList" parameterType="SysTaskForm" resultMap="SysTaskFormResult">
<include refid="selectSysTaskFormVo"/>
<where>
<if test="formId != null "> and form_id = #{formId}</if>
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
</where>
</select>
<select id="selectSysTaskFormById" parameterType="Long" resultMap="SysTaskFormResult">
<include refid="selectSysTaskFormVo"/>
where id = #{id}
</select>
<insert id="insertSysTaskForm" parameterType="SysTaskForm" useGeneratedKeys="true" keyProperty="id">
insert into sys_task_form
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formId != null">form_id,</if>
<if test="taskId != null">task_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formId != null">#{formId},</if>
<if test="taskId != null">#{taskId},</if>
</trim>
</insert>
<update id="updateSysTaskForm" parameterType="SysTaskForm">
update sys_task_form
<trim prefix="SET" suffixOverrides=",">
<if test="formId != null">form_id = #{formId},</if>
<if test="taskId != null">task_id = #{taskId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysTaskFormById" parameterType="Long">
delete from sys_task_form where id = #{id}
</delete>
<delete id="deleteSysTaskFormByIds" parameterType="String">
delete from sys_task_form where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysDeployFormMapper">
<resultMap type="SysDeployForm" id="SysDeployFormResult">
<result property="id" column="id" />
<result property="formId" column="form_id" />
<result property="deployId" column="deploy_id" />
</resultMap>
<sql id="selectSysDeployFormVo">
select id, form_id, deploy_id from sys_deploy_form
</sql>
<select id="selectSysDeployFormList" parameterType="SysDeployForm" resultMap="SysDeployFormResult">
<include refid="selectSysDeployFormVo"/>
<where>
<if test="formId != null "> and form_id = #{formId}</if>
<if test="deployId != null and deployId != ''"> and deploy_id = #{deployId}</if>
</where>
</select>
<select id="selectSysDeployFormById" parameterType="Long" resultMap="SysDeployFormResult">
<include refid="selectSysDeployFormVo"/>
where id = #{id}
</select>
<select id="selectSysDeployFormByDeployId" resultType="com.ruoyi.system.domain.SysForm">
select t1.form_content as formContent,t1.form_name as formName,t1.form_id as formId from sys_form t1 left join sys_deploy_form t2 on t1.form_id = t2.form_id
where t2.deploy_id = #{deployId} limit 1
</select>
<insert id="insertSysDeployForm" parameterType="SysDeployForm" useGeneratedKeys="true" keyProperty="id">
insert into sys_deploy_form
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formId != null">form_id,</if>
<if test="deployId != null">deploy_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formId != null">#{formId},</if>
<if test="deployId != null">#{deployId},</if>
</trim>
</insert>
<update id="updateSysDeployForm" parameterType="SysDeployForm">
update sys_deploy_form
<trim prefix="SET" suffixOverrides=",">
<if test="formId != null">form_id = #{formId},</if>
<if test="deployId != null">deploy_id = #{deployId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysDeployFormById" parameterType="Long">
delete from sys_deploy_form where id = #{id}
</delete>
<delete id="deleteSysDeployFormByIds" parameterType="String">
delete from sys_deploy_form where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysExpressionMapper">
<resultMap type="SysExpression" id="SysExpressionResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="expression" column="expression" />
<result property="dataType" column="data_type"/>
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="status" column="status" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysExpressionVo">
select id, name, expression, data_type,create_time, update_time, create_by, update_by, status, remark from sys_expression
</sql>
<select id="selectSysExpressionList" parameterType="SysExpression" resultMap="SysExpressionResult">
<include refid="selectSysExpressionVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="expression != null and expression != ''"> and expression = #{expression}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectSysExpressionById" parameterType="Long" resultMap="SysExpressionResult">
<include refid="selectSysExpressionVo"/>
where id = #{id}
</select>
<insert id="insertSysExpression" parameterType="SysExpression" useGeneratedKeys="true" keyProperty="id">
insert into sys_expression
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="expression != null">expression,</if>
<if test="dataType != null">data_type,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="expression != null">#{expression},</if>
<if test="dataType != null">#{dataType},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysExpression" parameterType="SysExpression">
update sys_expression
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="expression != null">expression = #{expression},</if>
<if test="dataType != null">data_type = #{dataType},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysExpressionById" parameterType="Long">
delete from sys_expression where id = #{id}
</delete>
<delete id="deleteSysExpressionByIds" parameterType="String">
delete from sys_expression where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysFormMapper">
<resultMap type="SysForm" id="SysFormResult">
<result property="formId" column="form_id" />
<result property="formName" column="form_name" />
<result property="formContent" column="form_content" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysFormVo">
select form_id, form_name, form_content, create_time, update_time, create_by, update_by, remark from sys_form
</sql>
<select id="selectSysFormList" parameterType="SysForm" resultMap="SysFormResult">
<include refid="selectSysFormVo"/>
<where>
<if test="formName != null and formName != ''"> and form_name like concat('%', #{formName}, '%')</if>
<if test="formContent != null and formContent != ''"> and form_content = #{formContent}</if>
</where>
order by create_time desc
</select>
<select id="selectSysFormById" parameterType="Long" resultMap="SysFormResult">
<include refid="selectSysFormVo"/>
where form_id = #{formId}
</select>
<insert id="insertSysForm" parameterType="SysForm" useGeneratedKeys="true" keyProperty="formId">
insert into sys_form
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formName != null">form_name,</if>
<if test="formContent != null">form_content,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formName != null">#{formName},</if>
<if test="formContent != null">#{formContent},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysForm" parameterType="SysForm">
update sys_form
<trim prefix="SET" suffixOverrides=",">
<if test="formName != null">form_name = #{formName},</if>
<if test="formContent != null">form_content = #{formContent},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where form_id = #{formId}
</update>
<delete id="deleteSysFormById" parameterType="Long">
delete from sys_form where form_id = #{formId}
</delete>
<delete id="deleteSysFormByIds" parameterType="String">
delete from sys_form where form_id in
<foreach item="formId" collection="array" open="(" separator="," close=")">
#{formId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysListenerMapper">
<resultMap type="SysListener" id="SysListenerResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="eventType" column="event_type"/>
<result property="valueType" column="value_type"/>
<result property="value" column="value"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectSysListenerVo">
select id,
name,
type,
event_type,
value_type,
value,
create_time,
update_time,
create_by,
update_by,
status,
remark
from sys_listener
</sql>
<select id="selectSysListenerList" parameterType="SysListener" resultMap="SysListenerResult">
<include refid="selectSysListenerVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="eventType != null and eventType != ''">and event_type = #{eventType}</if>
<if test="valueType != null and valueType != ''">and value_type = #{valueType}</if>
<if test="value != null and value != ''">and value = #{value}</if>
<if test="status != null ">and status = #{status}</if>
</where>
</select>
<select id="selectSysListenerById" parameterType="Long" resultMap="SysListenerResult">
<include refid="selectSysListenerVo"/>
where id = #{id}
</select>
<insert id="insertSysListener" parameterType="SysListener" useGeneratedKeys="true" keyProperty="id">
insert into sys_listener
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="eventType != null">event_type,</if>
<if test="valueType != null">value_type,</if>
<if test="value != null">value,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="eventType != null">#{eventType},</if>
<if test="valueType != null">#{valueType},</if>
<if test="value != null">#{value},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysListener" parameterType="SysListener">
update sys_listener
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="eventType != null">event_type = #{eventType},</if>
<if test="valueType != null">value_type = #{valueType},</if>
<if test="value != null">value = #{value},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysListenerById" parameterType="Long">
delete
from sys_listener
where id = #{id}
</delete>
<delete id="deleteSysListenerByIds" parameterType="String">
delete from sys_listener where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1 @@
node_modules

View File

@ -0,0 +1,39 @@
# bpmnlint-plugin-local
A bpmlint plug-in based on the [bpmnlint plug-in example](https://github.com/bpmn-io/bpmnlint-plugin-example).
## About
This plugin contributes [rules](#add-rules) and [configuration](#add-configuration) under the `local` prefix to bpmnlint.
## Add Rules
The [`./rules`](./rules) folder contains rules that are made available via
this plug-in. Configure them with the `local` prefix in your `.bpmnlintrc`:
```json
{
"rules": {
"local/no-manual-task": "warn"
}
}
```
Checkout [`./test.js`](./test.js) to learn how to test your rules.
## Add Configuration
As part of the [`./index.js`](./index.js) the plug-in exposes configurations
to extend from using `extends` in the bpmnlint configuration:
```json
{
"extends": [
"bpmnlint:recommended",
"plugin:local/recommended"
]
}
```

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="5.0.4">
<process id="Process_1" isExecutable="false">
<userTask id="Task_14wqr7n" />
</process>
<bpmndi:BPMNDiagram id="BpmnDiagram_1">
<bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="UserTask_0xvet6g_di" bpmnElement="Task_14wqr7n">
<omgdc:Bounds x="160" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="5.0.4">
<process id="Process_1" isExecutable="false">
<manualTask id="Task_14wqr7n" />
</process>
<bpmndi:BPMNDiagram id="BpmnDiagram_1">
<bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="ManualTask_0jr4uio_di" bpmnElement="Task_14wqr7n">
<omgdc:Bounds x="160" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@ -0,0 +1,16 @@
# No Manual Task (no-manual-task)
Checks that the diagram does not contain manual tasks that have no execution semantics.
Example of __incorrect__ usage of this rule:
![Incorrect usage example](./examples/no-manual-task-incorrect.png)
Cf. [`no-manual-task-incorrect.bpmn`](./examples/no-manual-task-incorrect.bpmn).
Example of __correct__ usage of this rule:
![Correct usage example](./examples/no-manual-task-correct.png)
Cf. [`no-manual-task-correct.bpmn`](./examples/no-manual-task-correct.bpmn).

View File

@ -0,0 +1,15 @@
module.exports = {
configs: {
recommended: {
rules: {
'target-namespace': 'error'
}
},
all: {
rules: {
'target-namespace': 'warn',
'no-manual-task': 'warn'
}
}
}
}

View File

@ -0,0 +1,26 @@
{
"name": "bpmnlint-plugin-local",
"version": "0.0.0",
"description": "The bpmnlint local plug-in",
"main": "index.js",
"scripts": {
"all": "npm test",
"test": "mocha test.js"
},
"keywords": [
"bpmnlint",
"plugin"
],
"devDependencies": {
"bpmnlint": "^7.2.1",
"chai": "^4.2.0",
"mocha": "^9.1.3"
},
"dependencies": {
"bpmnlint-utils": "^1.0.2"
},
"files": [
"rules",
"index.js"
]
}

View File

@ -0,0 +1,20 @@
const {
is
} = require('bpmnlint-utils');
/**
* Rule that reports manual tasks being used.
*/
module.exports = function() {
function check(node, reporter) {
if (is(node, 'bpmn:ManualTask')) {
reporter.report(node.id, 'Element has disallowed type bpmn:ManualTask');
}
}
return {
check: check
};
};

View File

@ -0,0 +1,20 @@
const {
is
} = require('bpmnlint-utils');
/**
* Rule that reports missing targetNamespace on bpmn:Definitions.
*/
module.exports = function() {
function check(node, reporter) {
if (is(node, 'bpmn:Definitions') && !node.targetNamespace) {
reporter.report(node.id, 'Element is missing targetNamespace');
}
}
return {
check: check
};
};

View File

@ -0,0 +1,55 @@
const { expect } = require('chai');
const { createModdle } = require('bpmnlint/lib/testers/helper');
const RuleTester = require('bpmnlint/lib/testers/rule-tester');
const manualTaskRule = require('./rules/no-manual-task');
const targetNamespaceRule = require('./rules/target-namespace');
RuleTester.verify('no-manual-task', manualTaskRule, {
valid: [
{
moddleElement: createModdle(
'<startEvent xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="startEvent" />',
'bpmn:StartEvent'
)
}
],
invalid: [
{
moddleElement: createModdle(
'<manualTask xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="manualTask" />',
'bpmn:ManualTask'
),
report: {
id: 'manualTask',
message: 'Element has disallowed type bpmn:ManualTask'
}
}
]
});
RuleTester.verify('target-namespace', targetNamespaceRule, {
valid: [
{
moddleElement: createModdle(
'<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="definitions" targetNamespace="http://foo" />',
)
}
],
invalid: [
{
moddleElement: createModdle(
'<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="definitions" />',
),
report: {
id: 'definitions',
message: 'Element is missing targetNamespace'
}
}
]
});

View File

@ -1,90 +1,98 @@
{
"name": "ruoyi",
"version": "3.8.9",
"description": "若依管理系统",
"author": "若依",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.28.1",
"clipboard": "2.0.8",
"core-js": "3.37.1",
"echarts": "5.4.0",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"quill": "2.0.2",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"splitpanes": "2.4.1",
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
"vuex": "3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "4.1.0",
"compression-webpack-plugin": "6.1.2",
"connect": "3.6.6",
"eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"sass": "1.32.13",
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
{
"name": "ruoyi",
"version": "3.8.9",
"description": "若依管理系统",
"author": "若依",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.28.1",
"bpmn-js": "^11.1.0",
"bpmnlint": "^6.4.0",
"bpmn-js-bpmnlint": "^0.15.0",
"bpmnlint-loader": "^0.1.4",
"file-drops": "^0.4.0",
"clipboard": "2.0.8",
"core-js": "3.37.1",
"diagram-js": "^11.4.1",
"echarts": "5.4.0",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"quill": "2.0.2",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"splitpanes": "2.4.1",
"vkbeautify": "^0.99.3",
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
"vuex": "3.6.0"
},
"devDependencies": {
"@babel/parser": "^7.20.5",
"@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "4.1.0",
"compression-webpack-plugin": "6.1.2",
"connect": "3.6.6",
"eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"sass": "1.32.13",
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

View File

@ -1,208 +1,216 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
}
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999;
}
#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 1001;
}
#loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}
#loader:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#loader-wrapper .loader-section.section-left {
left: 0;
}
#loader-wrapper .loader-section.section-right {
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}
.no-js #loader-wrapper {
display: none;
}
.no-js h1 {
color: #222222;
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
font-size: 19px;
width: 100%;
text-align: center;
z-index: 9999999999999;
position: absolute;
top: 60%;
opacity: 1;
line-height: 30px;
}
#loader-wrapper .load_title span {
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
opacity: 0.5;
}
</style>
</head>
<body>
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
}
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999;
}
#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 1001;
}
#loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}
#loader:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#loader-wrapper .loader-section.section-left {
left: 0;
}
#loader-wrapper .loader-section.section-right {
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}
.no-js #loader-wrapper {
display: none;
}
.no-js h1 {
color: #222222;
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
font-size: 19px;
width: 100%;
text-align: center;
z-index: 9999999999999;
position: absolute;
top: 60%;
opacity: 1;
line-height: 30px;
}
#loader-wrapper .load_title span {
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
opacity: 0.5;
}
/* COLOR PICKER */
.djs-popup.color-picker .entry {
margin: 0;
}
.djs-popup.color-picker .djs-popup-group {
display: grid;
grid: auto-flow / 1fr 1fr 1fr;
}
</style>
</head>
<body>
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>form-generator-preview</title>
<link href="https://lib.baomitu.com/element-ui/2.13.2/theme-chalk/index.css" rel="stylesheet">
<script src="https://lib.baomitu.com/vue/2.6.11/vue.min.js"></script>
<script src="https://lib.baomitu.com/vue-router/3.1.3/vue-router.min.js"></script>
<script src="https://lib.baomitu.com/element-ui/2.13.2/index.js"></script>
<style>
body{
margin: 0;
padding: 0;
overflow-x: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
height: calc(100vh - 33px);
padding: 12px;
box-sizing: border-box;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
}
input, textarea{
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
}
</style>
</head>
<body>
<noscript>
<strong>抱歉javascript被禁用请开启后重试。</strong>
</noscript>
<div id="previewApp"></div>
</body>
</html>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询活动审批列表
export function listActivity(query) {
return request({
url: '/ams/activity/list',
method: 'get',
params: query
})
}
// 查询活动审批详细
export function getActivity(activityId) {
return request({
url: '/ams/activity/' + activityId,
method: 'get'
})
}
// 新增活动审批
export function addActivity(data) {
return request({
url: '/ams/activity',
method: 'post',
data: data
})
}
// 修改活动审批
export function updateActivity(data) {
return request({
url: '/ams/activity',
method: 'put',
data: data
})
}
// 删除活动审批
export function delActivity(activityId) {
return request({
url: '/ams/activity/' + activityId,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询评论管理列表
export function listComment(query) {
return request({
url: '/ams/comment/list',
method: 'get',
params: query
})
}
// 查询评论管理详细
export function getComment(commentId) {
return request({
url: '/ams/comment/' + commentId,
method: 'get'
})
}
// 新增评论管理
export function addComment(data) {
return request({
url: '/ams/comment',
method: 'post',
data: data
})
}
// 修改评论管理
export function updateComment(data) {
return request({
url: '/ams/comment',
method: 'put',
data: data
})
}
// 删除评论管理
export function delComment(commentId) {
return request({
url: '/ams/comment/' + commentId,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询活动审批日志列表
export function listLog(query) {
return request({
url: '/ams/log/list',
method: 'get',
params: query
})
}
// 查询活动审批日志详细
export function getLog(logId) {
return request({
url: '/ams/log/' + logId,
method: 'get'
})
}
// 新增活动审批日志
export function addLog(data) {
return request({
url: '/ams/log',
method: 'post',
data: data
})
}
// 修改活动审批日志
export function updateLog(data) {
return request({
url: '/ams/log',
method: 'put',
data: data
})
}
// 删除活动审批日志
export function delLog(logId) {
return request({
url: '/ams/log/' + logId,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询点赞记录列表
export function listReaction(query) {
return request({
url: '/ams/reaction/list',
method: 'get',
params: query
})
}
// 查询点赞记录详细
export function getReaction(reactionId) {
return request({
url: '/ams/reaction/' + reactionId,
method: 'get'
})
}
// 新增点赞记录
export function addReaction(data) {
return request({
url: '/ams/reaction',
method: 'post',
data: data
})
}
// 修改点赞记录
export function updateReaction(data) {
return request({
url: '/ams/reaction',
method: 'put',
data: data
})
}
// 删除点赞记录
export function delReaction(reactionId) {
return request({
url: '/ams/reaction/' + reactionId,
method: 'delete'
})
}

Some files were not shown because too many files have changed in this diff Show More