Compare commits

...

210 Commits

Author SHA1 Message Date
1801250516 yudao-spring-boot-starter-data-permission 和 yudao-spring-boot-starter-tenant 调整为 biz 组件 2021-12-15 10:18:29 +08:00
a55c0cfca5 Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
 Conflicts:
	yudao-core-service/pom.xml
	yudao-dependencies/pom.xml
	yudao-framework/pom.xml
2021-12-15 10:07:21 +08:00
9d97c0ccb4 yudao-spring-boot-starter-data-permission 和 yudao-spring-boot-starter-tenant 调整为 biz 组件 2021-12-15 10:06:02 +08:00
a7254e0f05 !59 新增用户的社交登陆 API
Merge pull request !59 from 芋道源码/feature/user-social
2021-12-15 01:46:50 +00:00
52631a0af8 合并 master 代码
修复单测报错的问题
2021-12-15 09:45:37 +08:00
712067979c Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/user-social
 Conflicts:
	yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/impl/SysAuthServiceImpl.java
	yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/SysAuthServiceImplTest.java
	yudao-dependencies/pom.xml
	yudao-framework/pom.xml
	yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/auth/impl/SysAuthServiceImpl.java
2021-12-15 09:26:47 +08:00
91e98a5e62 code review 用户社交登陆的逻辑
增加测试页面的 README.md
2021-12-15 09:21:37 +08:00
b365b40273 code review 用户社交登陆的逻辑
增加测试页面的 README.md
2021-12-15 09:18:15 +08:00
62ca36dede Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro 2021-12-14 23:14:25 +08:00
72dc28a639 同步最新的 SQL 脚本 2021-12-14 23:04:36 +08:00
ac1ced7459 !58 新增多租户、数据权限
Merge pull request !58 from 芋道源码/feature/user-register
2021-12-14 14:57:47 +00:00
098c5b4723 1. 管理后台,增加租户管理
2. 修复大量因为租户报错的单元测试
2021-12-14 22:39:43 +08:00
a582a6e726 Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/user-register
 Conflicts:
	更新日志.md
2021-12-14 09:58:41 +08:00
fba230c2b2 完善 SysPermissionServiceImpl 数据权限相关的单元测试 2021-12-14 09:36:54 +08:00
619a7b73c3 增加 DeptDataPermissionRuleTest 单元测试 2021-12-14 00:34:42 +08:00
8278b65777 重构 Dept 数据权限逻辑,统一收到 yudao-spring-boot-starter-data-permission 包下 2021-12-13 09:27:46 +08:00
986cb72421 基于部门的数据权限 2021-12-13 00:28:20 +08:00
b0855cc626 实现 DataPermissionRuleFactoryImpl,并增加相关单测 2021-12-12 11:55:30 +08:00
f9b15fe70d 1. 增加数据权限的自动配置 DataPermissionAutoConfiguration
2. 增加数据权限的 AOP DataPermissionAnnotationInterceptor
3. 重命名 DataPermissionDatabaseInterceptor
2021-12-12 00:56:16 +08:00
2334e177c5 1. 引入 mockito-inline
2. 优化【数据权限】的单元测试
2021-12-11 15:38:20 +08:00
3fbd394653 完善数据权限的单元测试 2021-12-11 13:17:02 +08:00
0f792c64e7 通过 MyBatis Plus 数据权限的单测 2021-12-11 11:16:45 +08:00
e9385219c2 数据权限的逻辑处理,暂未测试 2021-12-11 08:54:49 +08:00
eda2b11dad 增加数据权限的 SQL 重写的上下文 2021-12-10 10:08:29 +08:00
e9ba4ac705 初始化 DataPermission 的模型 2021-12-08 10:15:48 +08:00
450ca8f907 完成剩下的公众号登录功能修改 2021-12-08 00:17:01 +08:00
c99115abe7 初始化数据权限模块 2021-12-07 21:28:16 +08:00
814c2db65c 初始化数据权限模块 2021-12-07 21:19:23 +08:00
4b95146c98 设置实体继承多租户的 DO 2021-12-07 13:31:59 +08:00
8795a4cdeb 增加 Tenant Security 的实现 2021-12-06 13:25:33 +08:00
df9b06843f 增加 Tenant Redis 的实现 2021-12-06 10:18:36 +08:00
1ce2c09f47 增加 Tenant MQ 的支持 2021-12-06 01:32:41 +08:00
a231582637 增强 mq starter 组件,支持 interceptor 拦截器机制 2021-12-05 23:50:17 +08:00
d29b0beb9b 优化 mq starter 组件,增加 RedisMQTemplate 模板类 2021-12-05 23:00:41 +08:00
ade55d89a4 多租户,接入 Spring Async 机制 2021-12-05 17:59:58 +08:00
cc78025f80 修改本地不开 Job,dev 开启 Job 2021-12-05 17:35:53 +08:00
6cd9b3bf7e 1. 增加 Job 的多租户的能力 2021-12-05 10:44:17 +08:00
535d3c9c01 登陆界面,优化成输入租户名 2021-12-05 00:12:54 +08:00
0cb4823b5b 1. 前端登陆界面,接入租户 2021-12-04 23:27:39 +08:00
7c8fe2fc50 1. 增加 yudao-spring-boot-starter-tenant 租户的组件
2. 改造 UserDO,接入多租户
2021-12-04 21:09:49 +08:00
ccb56b3b99 使用 uview 重构实际登陆 2021-11-28 20:48:41 +08:00
0d8f10cf1f 使用 uview 重构实际登陆 2021-11-27 23:45:09 +08:00
002aea34ae 引入 uview 组件 2021-11-27 20:09:13 +08:00
e8a65d45c6 update 更新日志.md. 2021-11-26 01:51:15 +00:00
e9b93ffe80 !57 代码生成工具问题修复
Merge pull request !57 from chaocloud/master
2021-11-26 01:50:25 +00:00
2da6a746e4 增加个人信息的加载 2021-11-26 09:47:23 +08:00
86ef156de4 调整 request 的封装 2021-11-26 07:21:47 +08:00
11936dee44 封装 request 请求 2021-11-25 22:33:28 +08:00
07fe12483a 优化登陆界面,增加手机密码的登陆方式 2021-11-25 09:58:14 +08:00
55ee2fcad7 增加登陆界面 2021-11-25 07:57:23 +08:00
d12912080e 提交个人中心页面 2021-11-25 06:57:32 +08:00
6c4908e70e 初始化 uniapp 小程序 2021-11-24 23:33:06 +08:00
b66d845354 代码自动生成工具,当表注释为空时,根据SQL导入失败问题修复 2021-11-24 15:08:01 +08:00
7991d68586 代码自动生成工具java文件路径修复 2021-11-24 15:05:04 +08:00
e2b76ee0e5 code review 修改密码等的单元测试 2021-11-21 12:05:34 +08:00
42ce5c75fd Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/user-register 2021-11-21 11:18:41 +08:00
d405f4df25 修复单元测试报错的问题 2021-11-21 11:12:47 +08:00
6a7761313e [updaate] 拆分修改密码与重置密码请求实体 2021-11-17 15:12:59 +08:00
8e0569ee54 update 新增接口:修改手机,修改密码,忘记密码 2021-11-17 10:15:22 +08:00
c84e19e14e !55 修复基于建表SQL生成代码 列名没有COMMENT注释报错的问题
Merge pull request !55 from 夜丶点缀了一个人的落寞/hotfix-tool-codegen
2021-11-08 08:33:49 +00:00
2fc1ef519d 修复基于建表SQL生成代码 列名没有COMMENT注释报错的问题 2021-11-08 13:27:34 +08:00
13a9405082 增加注释,优化代码 2021-11-05 23:14:51 +08:00
b369b363b6 动态表单 命名规范 2021-11-04 17:35:01 +08:00
b7a90c2c12 code review 动态表单 2021-11-04 09:03:05 +08:00
08d72fe9ca Merge remote-tracking branch 'origin/master' into master 2021-11-04 08:56:13 +08:00
592f706cd8 update 更新日志.md. 2021-11-04 00:54:27 +00:00
bba5ea7a42 !53 修复字典查询和通知查询权限问题
Merge pull request !53 from classyex/master
2021-11-04 00:29:02 +00:00
9d8cdb2670 动态表单 后端代码 2021-11-03 10:26:01 +08:00
yex
4cfa959d98 fix: 修复通知和字典查询权限bug 2021-11-02 12:25:41 +08:00
65abc667b0 code review 社交登陆相关的代码 2021-11-02 08:12:37 +08:00
a4948d27d2 update yudao-admin-server/src/main/resources/application-local.yaml. 2021-11-01 02:04:26 +00:00
8aa45406fd 拓展授权登录抽取成单独的starter,拓展配置和默认配置齐平 2021-10-31 13:09:55 +08:00
ae9e9b3de0 Merge remote-tracking branch 'origin/master' 2021-10-31 11:06:35 +08:00
83ce39f700 增加 .gitattributes 文件,避免识别项目类型出错 2021-10-31 11:06:27 +08:00
e82c37f2c5 !52 工作流的部分实现
Merge pull request !52 from 芋道源码/feature/activiti
2021-10-30 05:51:21 +00:00
742125ed99 code review 工作流的代码
合并最新的 SQL
2021-10-30 13:46:39 +08:00
31c4a52858 Merge branch 'feature/activiti' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/activiti 2021-10-30 11:07:13 +08:00
0050b1e46d Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/activiti
 Conflicts:
	yudao-dependencies/pom.xml
	yudao-framework/pom.xml
2021-10-30 10:24:58 +08:00
8cead0869e !51 用户前台的社交登陆的部分实现
Merge pull request !51 from 芋道源码/feature/user-social
2021-10-30 02:17:55 +00:00
8dbd6143bf 增加微信小程序的登陆的测试代码 2021-10-30 10:09:31 +08:00
038c0b87b9 增加微信登陆的测试页 2021-10-30 09:43:26 +08:00
c3aa2acddf Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/user-social
 Conflicts:
	yudao-admin-server/pom.xml
	yudao-dependencies/pom.xml
	yudao-user-server/src/main/resources/application-dev.yaml
	yudao-user-server/src/main/resources/application-local.yaml
2021-10-30 09:30:18 +08:00
b336655a51 !50 支付系统的部分实现
Merge pull request !50 from 芋道源码/pay_extension
2021-10-30 01:27:08 +00:00
cba9c609d7 code review 社交登陆的代码 2021-10-30 09:12:17 +08:00
de21034186 增加小程序授权登录 2021-10-29 23:48:06 +08:00
0e209d9cfc 同步最新的表结构 2021-10-29 08:22:13 +08:00
68c98db147 code review 用户前台的社交登陆 2021-10-28 08:50:50 +08:00
55e5ca4644 code review 用户前台的社交登陆 2021-10-28 08:46:51 +08:00
30ad7c43b8 Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/user-social
 Conflicts:
	yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/system/enums/SysErrorCodeConstants.java
2021-10-28 08:30:24 +08:00
d16185f87d 修改表单为外置表单 2021-10-28 00:51:57 +08:00
7da46d1cfb Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into pay_extension 2021-10-28 00:03:42 +08:00
93351e1716 1. 修复 File 单元测试报错
2. 修复 mvn package 报错问题
2021-10-28 00:01:21 +08:00
c89accbf06 完成支付通知的逻辑 2021-10-27 13:22:49 +08:00
2df46a7c2d Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into pay_extension
 Conflicts:
	更新日志.md
2021-10-27 12:32:57 +08:00
65843d55a0 修改版本号为 1.2.0-snapshot 2021-10-27 10:17:42 +08:00
dd2d8a2ba9 优化支付通知的逻辑,解决并发的问题。
同时,收到支付结果时,立马回调业务,避免延迟
2021-10-27 10:06:49 +08:00
a19f92ff2c !49 [update] 新增修改昵称,修改头像,查询昵称与头像接口
Merge pull request !49 from 宋天/user-register
2021-10-27 01:38:31 +00:00
1a9440824c 添加注释 2021-10-26 22:26:33 +08:00
fcf1c228c5 初步完成微信公众号登录 2021-10-26 21:35:06 +08:00
72b64dc526 同步最新的支付表结构 2021-10-26 09:53:17 +08:00
4acada62d3 完成支付回调的逻辑 2021-10-26 09:50:18 +08:00
75633aa84b 增加微信公众号的支付回调接口 2021-10-25 23:29:42 +08:00
bac30d47b7 增加支付回调地址的配置 2021-10-25 10:04:11 +08:00
20628987c9 增加支付回调地址的配置 2021-10-25 09:56:49 +08:00
1b0aaec9ab 完成微信支付的支付流程,美滋滋 2021-10-25 08:58:30 +08:00
72438ed5f6 增加 pay.html 前端,对接微信 JS SDK 2021-10-24 23:46:53 +08:00
60f5898c9a 增加 pay.html 前端,对接微信 JS SDK 2021-10-24 23:02:34 +08:00
f4a5a139b5 [update]user server模块新增测试,修改部分接口规范问题 2021-10-24 22:33:32 +08:00
44f357cea4 接入 weixin-mp-java ,编写相关示例。 2021-10-24 11:53:42 +08:00
3a77cc239b yudao-user-server 接入支付模块 2021-10-24 00:34:40 +08:00
ab19228ca6 完成支付的下单和提交订单的逻辑 2021-10-23 20:14:13 +08:00
436781507e merge master change 2021-10-23 19:16:00 +08:00
6dc65234ef 增加支付相关表的 SQL,调整相关的实体 2021-10-23 17:47:27 +08:00
6e3aa8a752 完善 PayClientFactoryImpl 的实现,增加创建 PayClient 的方法 2021-10-23 14:00:02 +08:00
1ed6656bbb 完成对微信公众号支付的封装 2021-10-23 11:00:36 +08:00
5193de7c56 [fix]修复错误内容 2021-10-20 18:51:51 +08:00
79da36ac04 [update]更新代码规范 2021-10-20 16:59:47 +08:00
23d8da7479 完善 AbstractPayClient 的实现 2021-10-20 13:20:09 +08:00
6690b9b120 完善支付宝的 AlipayPayClient 的实现 2021-10-20 08:27:44 +08:00
c06d6e53f6 [update] 新增修改昵称,修改头像,查询昵称与头像接口 2021-10-19 22:16:42 +08:00
7ca756a234 引入支付宝的支付功能 2021-10-19 09:26:49 +08:00
24f4fd4fee 完成支付单的单体轮廓 2021-10-19 07:41:45 +08:00
81126b2b4b 1. 引入 IJPay 组件
2. 增加创建支付单的 Service 实现
2021-10-18 09:41:38 +08:00
d194e14780 修改maven模块名称 2021-10-15 21:16:10 +08:00
711a074059 支付系统的实体的初始化 2021-10-14 09:05:09 +08:00
ee8dcd0888 1.实现了工作流引擎 中 请假流程demo(定义在 resources/leave.bpmn)
2.增加一个一级菜单 OA 办公 下面两个菜单: 请假申请,待办任务
3.暂时不知如何找部门领导, 暂时写死为 admin
4.activity 用户组使用 用户岗位来代替。
5.新增一个用户 hradmin, 密码 123456  岗位是 人力资源
6.演示流程。
  a. admin 登陆 申请请假
  b. admin 待办任务(审批)
  c. hradmin 登陆 待办任务(审批)
  d. admin 登陆 待办任务 (确认)
2021-10-13 23:43:03 +08:00
5133cd0fdf Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into pay_extension 2021-10-12 21:25:03 +08:00
ceef984d15 Merge remote-tracking branch 'origin/master' 2021-10-12 21:22:31 +08:00
4909342d7e 同步最新的 SQL 脚本 2021-10-12 21:22:22 +08:00
0effbc513c 支付表结构 2021-10-12 14:57:40 +08:00
60b528e80e 支付核心 2021-10-12 10:42:17 +08:00
8070afc807 支付核心 2021-10-12 10:41:34 +08:00
468dbc663a !46 前台用户,增加登录、注册、退出等功能
Merge pull request !46 from 芋道源码/feature/user-register
2021-10-12 01:25:57 +00:00
043c05a083 修复阿里云短信,无法发送的问题 2021-10-12 09:24:58 +08:00
d68ced8de4 前台用户,接入发送短信验证码 2021-10-12 08:44:24 +08:00
8e2388d52d 短信发送的逻辑,迁移到 yudao-core-service 模块下 2021-10-12 08:18:44 +08:00
d6040214b8 1. 自动登出时,记录的日志,增加 user_id 和 user_type 字段 2021-10-11 07:51:33 +08:00
024d44cea1 1. 增加前台用户的 token 刷新
2. 增加前台用户的 logout 退出
2021-10-10 22:52:20 +08:00
71b9104a13 增加短信验证码的功能 2021-10-10 21:57:18 +08:00
d784b113af 将 login_log、error_log 迁移到 yudao-core-service 项目中 2021-10-10 18:49:39 +08:00
028c99aa10 完成 user-admin-server 的用户手机 + 密码登录 2021-10-10 16:56:22 +08:00
03ef1fc764 将 dict 和 login log 迁移到共享库里 2021-10-10 02:38:38 +08:00
5b723d02b2 增加 yudao-core-service 模块,提供共享逻辑 2021-10-10 01:34:31 +08:00
e999cc31c6 初始化 c 端的登录逻辑 2021-10-09 09:18:53 +08:00
28fdc8e42e 初始化 c 端的登录逻辑 2021-10-09 08:24:17 +08:00
53bda604b0 !45 增加管理后台的企业微信、钉钉的社交登陆方式
Merge pull request !45 from 芋道源码/admin-social-auth
2021-10-09 00:04:10 +00:00
4e93efdb9b 完成 SysSocialServiceTest 的绑定用户的单测 2021-10-09 08:02:14 +08:00
90d5c22cb6 Merge remote-tracking branch 'origin/admin-social-auth' into admin-social-auth 2021-10-08 22:34:38 +08:00
8d9d678464 初始化 SysSocialServiceTest 单元测试类 2021-10-08 22:34:32 +08:00
b139107717 初始化 c 端的用户相关的表 2021-10-08 08:30:28 +08:00
6686ded18b 修复 admin 服务的全局登录的拦截 2021-10-07 22:26:03 +08:00
cd205a6061 前端接入绑定社交平台的逻辑 2021-10-07 19:30:12 +08:00
4a23a696f4 1. 修复“登陆”=》“登录”
2. 增加社交平台的绑定与解绑
2021-10-06 09:33:21 +08:00
e8e6024a2b 修复头像的 bug 2021-10-06 01:21:18 +08:00
79f9f7b93d 优化登陆日志,增加 userId、userType,更多的 loginType 2021-10-06 01:03:54 +08:00
0d6df43c9c 1. 优化三方登陆的代码
2. 使用 redis 存储 state
2021-10-05 23:47:37 +08:00
a0a5d3a357 1. 优化前端的社交登陆的枚举
2. 将三方登陆,统一改成社交登陆
2021-10-05 00:36:04 +08:00
7b3a283074 增加三方登陆相关的表结构 2021-10-03 00:35:57 +08:00
9be00d6035 完整完成钉钉的三方接入 2021-10-02 23:55:41 +08:00
e05d90590e 接入 dingtalk 钉钉的三方登陆,流程未接入 2021-10-02 18:31:05 +08:00
a56b4a7c9c 增加三方登陆的 redirect uri 2021-10-02 00:06:54 +08:00
23888c5a49 合并 master 最新代码 2021-09-28 09:55:04 +08:00
5f80333232 Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into oauth2
 Conflicts:
	yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java
2021-09-28 09:33:55 +08:00
b39086b062 !42 接入第三方登录(已接入Gitee[理论justAuth支持都可以接入]
Merge pull request !42 from weir/oauth2
2021-09-28 01:29:18 +00:00
27592d3df2 Merge branch 'master' of https://github.com/YunaiV/ruoyi-vue-pro 2021-09-28 09:23:33 +08:00
98761ef1d3 !44 增加 yudao-user-server 服务
Merge pull request !44 from 芋道源码/feature/user-admin-server
2021-09-28 01:22:11 +00:00
cf4a27f4ca 修改 issue#I463ML 的 bug,pageNum 改成 pageNo 2021-09-28 09:20:58 +08:00
689171c18d 增加 @PreAuthenticated 注解,实现登陆的拦截 2021-09-28 09:18:51 +08:00
0439a5505a 初始化数据字典 2021-09-27 09:47:37 +08:00
15e2c0945d 初始化访问日志、异常日志的插入 2021-09-27 09:12:43 +08:00
1bb10d007e 增加流程模型实体激活或挂起后端逻辑 2021-09-07 23:40:18 +08:00
e8b3f355e6 增加配置参数注释 2021-09-05 23:12:32 +08:00
b8ff47e832 增加配置参数注释 2021-09-05 22:57:38 +08:00
00e15a5c2c 1、集成Activiti7版本,yudao-dependencies模块新增activiti依赖包;
2、流程文件上传部署API后端逻辑实现;
2021-09-05 22:46:01 +08:00
df3cd34b30 扩展组件 2021-08-31 19:39:09 +08:00
c81c275a97 搭建 yudao-user-server 项目 2021-08-29 16:44:06 +08:00
1a17e5ecb8 !39 生成代码类名称不以模块名开头simpleClassName为空
Merge pull request !39 from 夜丶点缀了一个人的落寞/protection-lxm
2021-08-28 08:12:05 +00:00
384b4a5cf1 接入第三方登录--前端页面兼容多个第三方登录 2021-08-14 21:16:20 +08:00
133cb49c42 接入第三方登录(已接入Gitee[理论justAuth支持都可以接入]--抢先预览版 2021-08-13 23:44:52 +08:00
de31664917 修改className移除前缀方法 2021-08-06 07:27:17 +08:00
c588a4d975 测试部署并修改端口 2021-07-30 23:42:29 +08:00
2bcc55053b !38 添加 Jenkinsfile;用于支持Jenkins的部署
Merge pull request !38 from weir/devops
2021-07-27 17:44:49 +00:00
91baf4185e 二级部署 2021-07-27 21:42:08 +08:00
cb1fa73a4b 修改路径 2021-07-25 23:31:13 +08:00
51a22da644 修改路径 2021-07-25 20:45:54 +08:00
25a82f07c7 修改路径 2021-07-25 19:43:31 +08:00
03b52bfb2e 修改bug 2021-07-25 19:08:01 +08:00
9482b3b220 1. 修改日志 2.回退提交测试代码 3. 修改配置 2021-07-25 18:59:20 +08:00
d5997c4dc0 修改前端部署路径 2021-07-25 16:24:45 +08:00
b5695494c2 Jenkinsfile 提交 2021-07-25 11:38:18 +08:00
919eca95f9 添加Jenkinsfile 2021-07-25 01:24:50 +08:00
b4f2e6b12a 修改日志 2021-07-24 14:43:09 +08:00
3fc6be2e32 调整部署脚本 2021-07-24 13:56:24 +08:00
92a05a715c 1. 升级Lombok插件(mvn package 报错 )
2. 初版Jenkins文件导入
2021-07-23 00:26:40 +08:00
dcfed9f06d !37 指定sourceEncoding为utf8
Merge pull request !37 from classyex/feature/source-encode
2021-07-14 10:47:46 +00:00
yex
83d8a48d00 指定编译编码为utf8 2021-07-14 10:32:13 +08:00
a26a3a5699 !36 项目启动服务保障模块组件未注入的问题
Merge pull request !36 from 夜丶点缀了一个人的落寞/protection-lxm
2021-07-07 00:50:28 +00:00
6143930a96 修改服务保障模块配置类加载顺序 2021-07-06 14:29:35 +08:00
c53a7a9917 修改服务保障模块.factories文件位置错误的问题 2021-07-06 14:26:19 +08:00
758bd515e1 sping->spring 2021-06-28 22:13:18 +08:00
b0dbf45499 update 优化 jackson 自动配置 改为使用 BeanPostProcessor 匿名处理 2021-06-13 15:19:38 +08:00
98b2052824 Merge pull request #21 from fourcows/master
fix: updateUserStatus方法的注释有误
2021-05-29 22:37:51 +08:00
3a5da7d0a3 fix: updateUserStatus方法的注释有误 2021-05-26 22:08:21 +08:00
33120e1dce fix 修改字典工具类方法调用错误 issues#I3SI43 2021-05-23 16:09:22 +08:00
937d08db65 fix 修改字典数据模块.factories指定的配置类 2021-05-23 11:59:26 +08:00
11ad956883 去除mq重复依赖 2021-05-23 00:56:04 +08:00
d7710a868b 🔧 添加 spring-boot-configuration-processor,以便生成 spring-configuration-meta.json 2021-05-17 10:54:30 +08:00
930cdfe2b2 创建 yudao-user-server 2021-05-07 00:19:07 +08:00
d0a7c0593f 修改 README 的图片资源地址,转到 CDN 下。
= = 博客小水管,下载速度太慢
2021-05-04 10:50:07 +08:00
400c481244 修改 README 的图片资源地址,转到 CDN 下。
= = 博客小水管,下载速度太慢
2021-05-04 10:46:55 +08:00
1184 changed files with 77914 additions and 3855 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.sql linguist-language=java

60
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,60 @@
#!groovy
pipeline {
agent any
parameters {
string(name: 'TAG_NAME', defaultValue: '', description: '')
}
environment {
// DockerHub 凭证 ID(登录您的 DockerHub)
DOCKER_CREDENTIAL_ID = 'dockerhub-id'
// GitHub 凭证 ID (推送 tag 到 GitHub 仓库)
GITHUB_CREDENTIAL_ID = 'github-id'
// kubeconfig 凭证 ID (访问接入正在运行的 Kubernetes 集群)
KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig'
// 镜像的推送
REGISTRY = 'docker.io'
// DockerHub 账号名
DOCKERHUB_NAMESPACE = 'docker_username'
// GitHub 账号名
GITHUB_ACCOUNT = 'https://gitee.com/zhijiantianya/ruoyi-vue-pro'
// 应用名称
APP_NAME = 'yudao-admin-server'
// 应用部署路径
APP_DEPLOY_BASE_DIR = '/media/pi/KINGTON/data/work/projects/'
}
stages {
stage('检出') {
steps {
git url: "https://gitee.com/will-we/ruoyi-vue-pro.git",
branch: "devops"
}
}
stage('构建') {
steps {
// TODO 解决多环境链接、密码不同配置临时方案
sh 'if [ ! -d "' + "${env.HOME}" + '/resources" ];then\n' +
' echo "配置文件不存在无需修改"\n' +
'else\n' +
' cp -rf ' + "${env.HOME}" + '/resources/*.yaml ' + "${env.APP_NAME}" + '/src/main/resources\n' +
' echo "配置文件替换"\n' +
'fi'
sh 'mvn clean package -Dmaven.test.skip=true'
}
}
stage('部署') {
steps {
sh 'cp -f ' + ' bin/deploy.sh ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}"
sh 'cp -f ' + "${env.APP_NAME}" + '/target/*.jar ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" +'/build/'
archiveArtifacts "${env.APP_NAME}" + '/target/*.jar'
sh 'chmod +x ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" + '/deploy.sh'
sh 'bash ' + "${env.APP_DEPLOY_BASE_DIR}" + "${env.APP_NAME}" + '/deploy.sh'
}
}
}
}

View File

@ -33,6 +33,7 @@
| | 菜单管理 | 配置系统菜单,操作权限,按钮权限标识等 |
| | 部门管理 | 配置系统组织机构(公司、部门、小组),树结构展现支持数据权限 |
| | 岗位管理 | 配置系统用户所属担任职务 |
| | 租户管理 | 配置系统租户,支持 SaaS 场景下的多租户功能 |
| | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 |
| 🚀 | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、云片等主流短信平台 |
| 🚀 | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 |
@ -88,6 +89,9 @@
| `yudao-admin-ui` | 管理后台的 UI 界面 |
| `yudao-user-server` | 用户前台的服务端 |
| `yudao-user-ui` | 用户前台的 UI 界面 |
| `yudao-core-service` | 公共服务,提供共享逻辑 |
> 友情提示:`yudao-admin-server` 和 `yudao-user-server` 会存在需要复用的逻辑,通过 `yudao-core-service` 实现。
### 后端
@ -127,28 +131,28 @@
| 模块 | biu | biu | biu |
| --- | --- | --- | --- |
| 登 & 首页 | ![登录](http://www.iocoder.cn/images/ruoyi-vue-pro/登录.jpg) | ![首页](http://www.iocoder.cn/images/ruoyi-vue-pro/首页.jpg) | ![个人中心](http://www.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg) |
| 用户 | ![用户管理](http://www.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg) | ![在线用户](http://www.iocoder.cn/images/ruoyi-vue-pro/在线用户.jpg) | - |
| 部门 & 岗位 | ![部门管理](http://www.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg) | ![岗位管理](http://www.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg) | - |
| 菜单 & 角色 | ![菜单管理](http://www.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg) | ![角色管理](http://www.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg) | - |
| 审计日志 | ![操作日志](http://www.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg) | ![日志](http://www.iocoder.cn/images/ruoyi-vue-pro/登日志.jpg) | - |
| 短信 | ![短信渠道](http://www.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg) | ![短信模板](http://www.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg) | ![短信日志](http://www.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg) |
| 字典 | ![字典类型](http://www.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg) | ![字典数据](http://www.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg) | - |
| 错误码 & 通知 | ![错误码管理](http://www.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg) | ![通知公告](http://www.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg) | - |
| 登 & 首页 | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg) | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg) | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg) |
| 用户 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg) | ![在线用户](https://static.iocoder.cn/images/ruoyi-vue-pro/在线用户.jpg) | - |
| 部门 & 岗位 | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg) | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg) | - |
| 菜单 & 角色 | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg) | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg) | - |
| 审计日志 | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg) | ![日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登日志.jpg) | - |
| 短信 | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg) | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg) |
| 字典 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg) | - |
| 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg) | - |
### 基础设施
| 模块 | biu | biu | biu |
| --- | --- | --- | --- |
| 文件 & 配置 | ![文件管理](http://www.iocoder.cn/images/ruoyi-vue-pro/文件管理.jpg) | ![配置管理](http://www.iocoder.cn/images/ruoyi-vue-pro/配置管理.jpg) | - |
| 定时任务 | ![定时任务](http://www.iocoder.cn/images/ruoyi-vue-pro/定时任务.jpg) | ![任务日志](http://www.iocoder.cn/images/ruoyi-vue-pro/任务日志.jpg) | - |
| API 日志 | ![访问日志](http://www.iocoder.cn/images/ruoyi-vue-pro/访问日志.jpg) | ![错误日志](http://www.iocoder.cn/images/ruoyi-vue-pro/错误日志.jpg) | - |
| MySQL & Redis | ![MySQL](http://www.iocoder.cn/images/ruoyi-vue-pro/MySQL.jpg) | ![Redis](http://www.iocoder.cn/images/ruoyi-vue-pro/Redis.jpg) | - |
| 监控平台 | ![Java监控](http://www.iocoder.cn/images/ruoyi-vue-pro/Java监控.jpg) | ![链路追踪](http://www.iocoder.cn/images/ruoyi-vue-pro/链路追踪.jpg) | ![日志中心](http://www.iocoder.cn/images/ruoyi-vue-pro/日志中心.jpg) |
| 文件 & 配置 | ![文件管理](https://static.iocoder.cn/images/ruoyi-vue-pro/文件管理.jpg) | ![配置管理](https://static.iocoder.cn/images/ruoyi-vue-pro/配置管理.jpg) | - |
| 定时任务 | ![定时任务](https://static.iocoder.cn/images/ruoyi-vue-pro/定时任务.jpg) | ![任务日志](https://static.iocoder.cn/images/ruoyi-vue-pro/任务日志.jpg) | - |
| API 日志 | ![访问日志](https://static.iocoder.cn/images/ruoyi-vue-pro/访问日志.jpg) | ![错误日志](https://static.iocoder.cn/images/ruoyi-vue-pro/错误日志.jpg) | - |
| MySQL & Redis | ![MySQL](https://static.iocoder.cn/images/ruoyi-vue-pro/MySQL.jpg) | ![Redis](https://static.iocoder.cn/images/ruoyi-vue-pro/Redis.jpg) | - |
| 监控平台 | ![Java监控](https://static.iocoder.cn/images/ruoyi-vue-pro/Java监控.jpg) | ![链路追踪](https://static.iocoder.cn/images/ruoyi-vue-pro/链路追踪.jpg) | ![日志中心](https://static.iocoder.cn/images/ruoyi-vue-pro/日志中心.jpg) |
### 研发工具
| 模块 | biu | biu | biu |
| --- | --- | --- | --- |
| 代码生成 | ![代码生成](http://www.iocoder.cn/images/ruoyi-vue-pro/代码生成.jpg) | ![生成效果](http://www.iocoder.cn/images/ruoyi-vue-pro/生成效果.jpg) | ![表单构建](http://www.iocoder.cn/images/ruoyi-vue-pro/表单构建.jpg) |
| 文档 | ![系统接口](http://www.iocoder.cn/images/ruoyi-vue-pro/系统接口.jpg) | ![数据库文档](http://www.iocoder.cn/images/ruoyi-vue-pro/数据库文档.jpg) | - |
| 代码生成 | ![代码生成](https://static.iocoder.cn/images/ruoyi-vue-pro/代码生成.jpg) | ![生成效果](https://static.iocoder.cn/images/ruoyi-vue-pro/生成效果.jpg) | ![表单构建](https://static.iocoder.cn/images/ruoyi-vue-pro/表单构建.jpg) |
| 文档 | ![系统接口](https://static.iocoder.cn/images/ruoyi-vue-pro/系统接口.jpg) | ![数据库文档](https://static.iocoder.cn/images/ruoyi-vue-pro/数据库文档.jpg) | - |

View File

@ -8,7 +8,7 @@ set -e
DATE=$(date +%Y%m%d%H%M)
# 基础路径
BASE_PATH=/work/projects/yudao-admin-server
BASE_PATH=/media/pi/KINGTON/data/work/projects/yudao-admin-server
# 编译后 jar 的地址。部署时Jenkins 会上传 jar 包到该目录下
SOURCE_PATH=$BASE_PATH/build
# 服务名称。同时约定部署服务的 jar 包名字也为它。
@ -24,11 +24,11 @@ HEAP_ERROR_PATH=$BASE_PATH/heapError
JAVA_OPS="-Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$HEAP_ERROR_PATH"
# SkyWalking Agent 配置
export SW_AGENT_NAME=$SERVER_NAME
export SW_AGENT_COLLECTOR_BACKEND_SERVICES=192.168.0.84:11800
export SW_GRPC_LOG_SERVER_HOST=192.168.0.84
export SW_AGENT_TRACE_IGNORE_PATH="Redisson/PING,/actuator/**,/admin/**"
export JAVA_AGENT=-javaagent:/work/skywalking/apache-skywalking-apm-bin/agent/skywalking-agent.jar
#export SW_AGENT_NAME=$SERVER_NAME
#export SW_AGENT_COLLECTOR_BACKEND_SERVICES=192.168.0.84:11800
#export SW_GRPC_LOG_SERVER_HOST=192.168.0.84
#export SW_AGENT_TRACE_IGNORE_PATH="Redisson/PING,/actuator/**,/admin/**"
#export JAVA_AGENT=-javaagent:/work/skywalking/apache-skywalking-apm-bin/agent/skywalking-agent.jar
# 备份
function backup() {
@ -159,7 +159,7 @@ function deploy() {
# 启动 Java 服务
start
# 健康检查
healthCheck
# healthCheck
}
deploy

View File

@ -1,6 +1,7 @@
{
"local": {
"baseUrl": "http://127.0.0.1:48080/api",
"userServerUrl": "http://127.0.0.1:28080/api",
"token": "test1"
}
}

BIN
img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

31
mini-program-test/.eslintrc.js Executable file
View File

@ -0,0 +1,31 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

View File

@ -0,0 +1 @@
临时项目,作为测试微信小程序登陆之用

19
mini-program-test/app.js Executable file
View File

@ -0,0 +1,19 @@
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})

14
mini-program-test/app.json Executable file
View File

@ -0,0 +1,14 @@
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

10
mini-program-test/app.wxss Executable file
View File

@ -0,0 +1,10 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}

View File

@ -0,0 +1,91 @@
// index.js
const common=require('../../utils/common.js')
// 获取应用实例
const app = getApp()
Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
canIUseGetUserProfile: false,
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName'), // 如需尝试获取用户信息可改为false
holderText: 'to be auth'
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad() {
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息开发者每次通过该接口获取用户个人信息均需用户确认开发者妥善保管用户快速填写的头像昵称避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息预计自2021年4月13日起getUserInfo将不再弹出弹窗并直接返回匿名的用户个人信息
console.log(e)
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
// 小程序登录 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html
wxLogin(e){
let page=this;
wx.login({
success (res) {
console.log("res:")
console.log(res)
if (res.code) {
//发起网络请求
console.log('发起网络请求'+common.baseurl)
wx.request({
url: common.baseurl+'/api/social-login2',
method: "POST",
data: {
code: res.code,
state: 'empty',
type: 33,
username: '15601691300',
password: 'admin123'
},
header: {
'content-type': 'application/json' // 默认值
},
success: function(res) {
console.log(res.data)
let holder="auth success, token:"+res.data.data.token
page.setData({holderText: holder})
},
fail: function(data){
console.error("请求出错");
console.error(data)
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,29 @@
<!--index.wxml-->
<view class="container">
<view class="userinfo">
<block wx:if="{{canIUseOpenData}}">
</block>
<block wx:elif="{{!hasUserInfo}}">
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
<button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<view wx:else> 请使用1.4.4及以上版本基础库 </view>
</block>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="usermotto">
</view>
<text style="position: relative; left: 1rpx; top: -476rpx">授权登录测试1024</text>
<button style="position: relative; left: 0rpx; top: -361rpx" type="primary" id="login-button" bindtap="wxLogin">点击授权登录</button>
<text style="position: relative; left: 1rpx; top: -272rpx" id="login-user-id">{{holderText}}</text>
</view>

View File

@ -0,0 +1,19 @@
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.usermotto {
margin-top: 200px;
}

View File

@ -0,0 +1,18 @@
// logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return {
date: util.formatTime(new Date(log)),
timeStamp: log
}
})
})
}
})

View File

@ -0,0 +1,4 @@
{
"navigationBarTitleText": "查看启动日志",
"usingComponents": {}
}

View File

@ -0,0 +1,6 @@
<!--logs.wxml-->
<view class="container log-list">
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log.date}}</text>
</block>
</view>

View File

@ -0,0 +1,8 @@
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}

View File

@ -0,0 +1,75 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": [
{
"type": "file",
"value": ".eslintrc.js"
}
]
},
"setting": {
"bundle": false,
"userConfirmedBundleSwitch": false,
"urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
"es6": true,
"postcss": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"minified": true,
"autoAudits": false,
"newFeature": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"useIsolateContext": true,
"nodeModules": false,
"enhance": true,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"enableEngineNative": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wx44d047d87e6284d8",
"appid1": "wx63c280fe3248a3e7",
"projectname": "mini-program-test",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}

7
mini-program-test/sitemap.json Executable file
View File

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

View File

@ -0,0 +1,3 @@
module.exports = {
baseurl: "http://127.0.0.1:28080"
}

19
mini-program-test/utils/util.js Executable file
View File

@ -0,0 +1,19 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : `0${n}`
}
module.exports = {
formatTime
}

View File

@ -11,6 +11,8 @@
<module>yudao-dependencies</module>
<module>yudao-framework</module>
<module>yudao-admin-server</module>
<module>yudao-user-server</module>
<module>yudao-core-service</module>
</modules>
<name>${artifactId}</name>
@ -18,12 +20,13 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<revision>1.0.0</revision>
<revision>1.2.0-snapshot</revision>
<!-- Maven 相关 -->
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>

View File

@ -1,17 +1,17 @@
/*
Navicat Premium Data Transfer
Source Server : local-mysql001
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50718
Source Server Version : 80026
Source Host : localhost:3306
Source Schema : ruoyi-vue-pro
Target Server Type : MySQL
Target Server Version : 50718
Target Server Version : 80026
File Encoding : 65001
Date: 03/05/2021 12:01:37
Date: 30/10/2021 13:46:03
*/
SET NAMES utf8mb4;
@ -29,7 +29,7 @@ CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_BLOB_TRIGGERS
@ -46,7 +46,7 @@ CREATE TABLE `QRTZ_CALENDARS` (
`CALENDAR_NAME` varchar(190) NOT NULL,
`CALENDAR` blob NOT NULL,
PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_CALENDARS
@ -66,12 +66,13 @@ CREATE TABLE `QRTZ_CRON_TRIGGERS` (
`TIME_ZONE_ID` varchar(80) DEFAULT NULL,
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_CRON_TRIGGERS
-- ----------------------------
BEGIN;
INSERT INTO `QRTZ_CRON_TRIGGERS` VALUES ('schedulerName', 'payNotifyJob', 'DEFAULT', '* * * * * ?', 'Asia/Shanghai');
INSERT INTO `QRTZ_CRON_TRIGGERS` VALUES ('schedulerName', 'sysUserSessionTimeoutJob', 'DEFAULT', '0 * * * * ? *', 'Asia/Shanghai');
COMMIT;
@ -85,9 +86,9 @@ CREATE TABLE `QRTZ_FIRED_TRIGGERS` (
`TRIGGER_NAME` varchar(190) NOT NULL,
`TRIGGER_GROUP` varchar(190) NOT NULL,
`INSTANCE_NAME` varchar(190) NOT NULL,
`FIRED_TIME` bigint(13) NOT NULL,
`SCHED_TIME` bigint(13) NOT NULL,
`PRIORITY` int(11) NOT NULL,
`FIRED_TIME` bigint NOT NULL,
`SCHED_TIME` bigint NOT NULL,
`PRIORITY` int NOT NULL,
`STATE` varchar(16) NOT NULL,
`JOB_NAME` varchar(190) DEFAULT NULL,
`JOB_GROUP` varchar(190) DEFAULT NULL,
@ -100,7 +101,7 @@ CREATE TABLE `QRTZ_FIRED_TRIGGERS` (
KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`),
KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_FIRED_TRIGGERS
@ -126,12 +127,13 @@ CREATE TABLE `QRTZ_JOB_DETAILS` (
PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`),
KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_JOB_DETAILS
-- ----------------------------
BEGIN;
INSERT INTO `QRTZ_JOB_DETAILS` VALUES ('schedulerName', 'payNotifyJob', 'DEFAULT', NULL, 'cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker', '0', '1', '1', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000027400064A4F425F49447372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000000000057400104A4F425F48414E444C45525F4E414D4574000C7061794E6F746966794A6F627800);
INSERT INTO `QRTZ_JOB_DETAILS` VALUES ('schedulerName', 'sysUserSessionTimeoutJob', 'DEFAULT', NULL, 'cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker', '0', '1', '1', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000027400064A4F425F49447372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000000000037400104A4F425F48414E444C45525F4E414D457400187379735573657253657373696F6E54696D656F75744A6F627800);
COMMIT;
@ -143,7 +145,7 @@ CREATE TABLE `QRTZ_LOCKS` (
`SCHED_NAME` varchar(120) NOT NULL,
`LOCK_NAME` varchar(40) NOT NULL,
PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_LOCKS
@ -161,7 +163,7 @@ CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` (
`SCHED_NAME` varchar(120) NOT NULL,
`TRIGGER_GROUP` varchar(190) NOT NULL,
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_PAUSED_TRIGGER_GRPS
@ -176,16 +178,16 @@ DROP TABLE IF EXISTS `QRTZ_SCHEDULER_STATE`;
CREATE TABLE `QRTZ_SCHEDULER_STATE` (
`SCHED_NAME` varchar(120) NOT NULL,
`INSTANCE_NAME` varchar(190) NOT NULL,
`LAST_CHECKIN_TIME` bigint(13) NOT NULL,
`CHECKIN_INTERVAL` bigint(13) NOT NULL,
`LAST_CHECKIN_TIME` bigint NOT NULL,
`CHECKIN_INTERVAL` bigint NOT NULL,
PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_SCHEDULER_STATE
-- ----------------------------
BEGIN;
INSERT INTO `QRTZ_SCHEDULER_STATE` VALUES ('schedulerName', 'Yunai1620010117445', 1620010210071, 15000);
INSERT INTO `QRTZ_SCHEDULER_STATE` VALUES ('schedulerName', 'Yunai.local1635571630493', 1635572537879, 15000);
COMMIT;
-- ----------------------------
@ -196,12 +198,12 @@ CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` (
`SCHED_NAME` varchar(120) NOT NULL,
`TRIGGER_NAME` varchar(190) NOT NULL,
`TRIGGER_GROUP` varchar(190) NOT NULL,
`REPEAT_COUNT` bigint(7) NOT NULL,
`REPEAT_INTERVAL` bigint(12) NOT NULL,
`TIMES_TRIGGERED` bigint(10) NOT NULL,
`REPEAT_COUNT` bigint NOT NULL,
`REPEAT_INTERVAL` bigint NOT NULL,
`TIMES_TRIGGERED` bigint NOT NULL,
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_SIMPLE_TRIGGERS
@ -220,17 +222,17 @@ CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` (
`STR_PROP_1` varchar(512) DEFAULT NULL,
`STR_PROP_2` varchar(512) DEFAULT NULL,
`STR_PROP_3` varchar(512) DEFAULT NULL,
`INT_PROP_1` int(11) DEFAULT NULL,
`INT_PROP_2` int(11) DEFAULT NULL,
`LONG_PROP_1` bigint(20) DEFAULT NULL,
`LONG_PROP_2` bigint(20) DEFAULT NULL,
`INT_PROP_1` int DEFAULT NULL,
`INT_PROP_2` int DEFAULT NULL,
`LONG_PROP_1` bigint DEFAULT NULL,
`LONG_PROP_2` bigint DEFAULT NULL,
`DEC_PROP_1` decimal(13,4) DEFAULT NULL,
`DEC_PROP_2` decimal(13,4) DEFAULT NULL,
`BOOL_PROP_1` varchar(1) DEFAULT NULL,
`BOOL_PROP_2` varchar(1) DEFAULT NULL,
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_SIMPROP_TRIGGERS
@ -249,15 +251,15 @@ CREATE TABLE `QRTZ_TRIGGERS` (
`JOB_NAME` varchar(190) NOT NULL,
`JOB_GROUP` varchar(190) NOT NULL,
`DESCRIPTION` varchar(250) DEFAULT NULL,
`NEXT_FIRE_TIME` bigint(13) DEFAULT NULL,
`PREV_FIRE_TIME` bigint(13) DEFAULT NULL,
`PRIORITY` int(11) DEFAULT NULL,
`NEXT_FIRE_TIME` bigint DEFAULT NULL,
`PREV_FIRE_TIME` bigint DEFAULT NULL,
`PRIORITY` int DEFAULT NULL,
`TRIGGER_STATE` varchar(16) NOT NULL,
`TRIGGER_TYPE` varchar(8) NOT NULL,
`START_TIME` bigint(13) NOT NULL,
`END_TIME` bigint(13) DEFAULT NULL,
`START_TIME` bigint NOT NULL,
`END_TIME` bigint DEFAULT NULL,
`CALENDAR_NAME` varchar(190) DEFAULT NULL,
`MISFIRE_INSTR` smallint(2) DEFAULT NULL,
`MISFIRE_INSTR` smallint DEFAULT NULL,
`JOB_DATA` blob,
PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
@ -273,13 +275,14 @@ CREATE TABLE `QRTZ_TRIGGERS` (
KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`),
KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of QRTZ_TRIGGERS
-- ----------------------------
BEGIN;
INSERT INTO `QRTZ_TRIGGERS` VALUES ('schedulerName', 'sysUserSessionTimeoutJob', 'DEFAULT', 'sysUserSessionTimeoutJob', 'DEFAULT', NULL, 1620010260000, 1620010200000, 5, 'WAITING', 'CRON', 1613649236000, 0, NULL, 0, 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000037400114A4F425F48414E444C45525F504152414D707400124A4F425F52455452595F494E54455256414C737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000007D074000F4A4F425F52455452595F434F554E547371007E0009000000037800);
INSERT INTO `QRTZ_TRIGGERS` VALUES ('schedulerName', 'payNotifyJob', 'DEFAULT', 'payNotifyJob', 'DEFAULT', NULL, 1635572540000, 1635572539000, 5, 'WAITING', 'CRON', 1635294882000, 0, NULL, 0, 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000037400114A4F425F48414E444C45525F504152414D707400124A4F425F52455452595F494E54455256414C737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000074000F4A4F425F52455452595F434F554E5471007E000B7800);
INSERT INTO `QRTZ_TRIGGERS` VALUES ('schedulerName', 'sysUserSessionTimeoutJob', 'DEFAULT', 'sysUserSessionTimeoutJob', 'DEFAULT', NULL, 1635572580000, 1635572520000, 5, 'WAITING', 'CRON', 1613649236000, 0, NULL, 0, 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C770800000010000000037400114A4F425F48414E444C45525F504152414D707400124A4F425F52455452595F494E54455256414C737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000007D074000F4A4F425F52455452595F434F554E547371007E0009000000037800);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,11 @@
<dependencies>
<!-- 业务组件 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-core-service</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
@ -30,12 +35,31 @@
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-sms</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-activiti</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-web</artifactId>
</dependency>
<!-- spring boot 配置所需依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
@ -110,11 +134,13 @@
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId> <!-- 实现数据库文档 -->
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-mq</artifactId>
</dependency>
<!-- 三方云服务相关 -->
<dependency>
<groupId>com.xkcoding.justauth</groupId>
<artifactId>justauth-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -3,7 +3,8 @@ package cn.iocoder.yudao.adminserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} 和 ${yudao.core-service.base-package}
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}", "${yudao.core-service.base-package}"})
public class AdminServerApplication {
public static void main(String[] args) {

View File

@ -1,9 +0,0 @@
package cn.iocoder.yudao.adminserver.framework.async.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@EnableAsync
public class AsyncConfiguration {
}

View File

@ -1,4 +0,0 @@
/**
* 异步执行,基于 Spring @Async 实现
*/
package cn.iocoder.yudao.adminserver.framework.async;

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.adminserver.framework.security;
import cn.iocoder.yudao.framework.web.config.WebProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import javax.annotation.Resource;
@Configuration
public class SecurityConfiguration {
@Resource
private WebProperties webProperties;
@Value("${spring.boot.admin.context-path:''}")
private String adminSeverContextPath;
@Bean
public Customizer<ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry> authorizeRequestsCustomizer() {
return registry -> {
// 验证码的接口
registry.antMatchers(api("/system/captcha/**")).anonymous();
// 获得租户编号的接口
registry.antMatchers(api("/system/tenant/get-id-by-name")).anonymous();
// Spring Boot Admin Server 的安全配置
registry.antMatchers(adminSeverContextPath).anonymous()
.antMatchers(adminSeverContextPath + "/**").anonymous();
// 短信回调 API
registry.antMatchers(api("/system/sms/callback/**")).anonymous();
};
}
private String api(String url) {
return webProperties.getApiPrefix() + url;
}
}

View File

@ -0,0 +1,100 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*;
import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
// TODO @风里雾里: Os=》Wf/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的
@Api(tags = "动态表单")
@RestController
@RequestMapping("/wl/form")
@Validated
public class WlFormController {
@Resource
private WfFormService formService;
@PostMapping("/create")
@ApiOperation("创建动态表单")
@PreAuthorize("@ss.hasPermission('os:form:create')")
public CommonResult<Long> createForm(@Valid @RequestBody WfFormCreateReqVO createReqVO) {
return success(formService.createForm(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新动态表单")
@PreAuthorize("@ss.hasPermission('os:form:update')")
public CommonResult<Boolean> updateForm(@Valid @RequestBody WfFormUpdateReqVO updateReqVO) {
formService.updateForm(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@ApiOperation("删除动态表单")
@ApiImplicitParam(name = "id", value = "编号", required = true)
@PreAuthorize("@ss.hasPermission('os:form:delete')")
public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) {
formService.deleteForm(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得动态表单")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('os:form:query')")
public CommonResult<WfFormRespVO> getForm(@RequestParam("id") Long id) {
WfForm form = formService.getForm(id);
return success(WfFormConvert.INSTANCE.convert(form));
}
@GetMapping("/list")
@ApiOperation("获得动态表单列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('os:form:query')")
public CommonResult<List<WfFormRespVO>> getFormList(@RequestParam("ids") Collection<Long> ids) {
List<WfForm> list = formService.getFormList(ids);
return success(WfFormConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得动态表单分页")
@PreAuthorize("@ss.hasPermission('os:form:query')")
public CommonResult<PageResult<WfFormRespVO>> getFormPage(@Valid WfFormPageReqVO pageVO) {
PageResult<WfForm> pageResult = formService.getFormPage(pageVO);
return success(WfFormConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出动态表单 Excel")
@PreAuthorize("@ss.hasPermission('os:form:export')")
@OperateLog(type = EXPORT)
public void exportFormExcel(@Valid WfFormExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<WfForm> list = formService.getFormList(exportReqVO);
// 导出 Excel
List<WfFormExcelVO> datas = WfFormConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "动态表单.xls", "数据", WfFormExcelVO.class, datas);
}
}

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
/**
* 动态表单 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class WfFormBaseVO {
@ApiModelProperty(value = "表单名称", required = true)
@NotNull(message = "表单名称不能为空")
private String name;
@ApiModelProperty(value = "商户状态", required = true)
@NotNull(message = "商户状态不能为空")
private Integer status;
@ApiModelProperty(value = "表单JSON")
private String formJson;
@ApiModelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,12 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import io.swagger.annotations.*;
@ApiModel("动态表单创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WfFormCreateReqVO extends WfFormBaseVO {
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 动态表单 Excel VO
*
* @author 芋艿
*/
@Data
public class WfFormExcelVO {
@ExcelProperty("表单编号")
private Long id;
@ExcelProperty("表单名称")
private String name;
@ExcelProperty("商户状态")
private Integer status;
@ExcelProperty("表单JSON")
private String formJson;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的")
@Data
public class WfFormExportReqVO {
@ApiModelProperty(value = "表单名称")
private String name;
@ApiModelProperty(value = "商户状态")
private Integer status;
@ApiModelProperty(value = "表单JSON")
private String formJson;
@ApiModelProperty(value = "备注")
private String remark;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -0,0 +1,36 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("动态表单分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WfFormPageReqVO extends PageParam {
@ApiModelProperty(value = "表单名称")
private String name;
@ApiModelProperty(value = "商户状态")
private Integer status;
@ApiModelProperty(value = "表单JSON")
private String formJson;
@ApiModelProperty(value = "备注")
private String remark;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
@ApiModel("动态表单 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WfFormRespVO extends WfFormBaseVO {
@ApiModelProperty(value = "表单编号", required = true)
private Long id;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("动态表单更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WfFormUpdateReqVO extends WfFormBaseVO {
@ApiModelProperty(value = "表单编号", required = true)
@NotNull(message = "表单编号不能为空")
private Long id;
}

View File

@ -0,0 +1,114 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
import cn.iocoder.yudao.adminserver.modules.activiti.convert.oa.OaLeaveConvert;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
import cn.iocoder.yudao.adminserver.modules.activiti.service.oa.OaLeaveService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
// TODO @jasonOa=》OA 会不会好点,名词缩写哈
@Api(tags = "请假申请")
@RestController
@RequestMapping("/oa/leave")
@Validated
public class OaLeaveController {
@Resource
private OaLeaveService leaveService;
@PostMapping("/create")
@ApiOperation("创建请假申请")
@PreAuthorize("@ss.hasPermission('oa:leave:create')")
public CommonResult<Long> createLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) {
// TODO @芋艿processKey 自己去理解下。不过得把 leave 变成枚举
createReqVO.setProcessKey("leave");
return success(leaveService.createLeave(createReqVO));
}
@PostMapping("/form-key/create")
@ApiOperation("创建外置请假申请")
public CommonResult<Long> createFormKeyLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) {
// TODO @芋艿processKey 自己去理解下。不过得把 formkey 变成枚举
createReqVO.setProcessKey("leave-formkey");
return success(leaveService.createLeave(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新请假申请")
@PreAuthorize("@ss.hasPermission('oa:leave:update')")
public CommonResult<Boolean> updateLeave(@Valid @RequestBody OaLeaveUpdateReqVO updateReqVO) {
leaveService.updateLeave(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@ApiOperation("删除请假申请")
@ApiImplicitParam(name = "id", value = "编号", required = true)
@PreAuthorize("@ss.hasPermission('oa:leave:delete')")
public CommonResult<Boolean> deleteLeave(@RequestParam("id") Long id) {
leaveService.deleteLeave(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得请假申请")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
public CommonResult<OaLeaveRespVO> getLeave(@RequestParam("id") Long id) {
OaLeaveDO leave = leaveService.getLeave(id);
return success(OaLeaveConvert.INSTANCE.convert(leave));
}
@GetMapping("/list")
@ApiOperation("获得请假申请列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
public CommonResult<List<OaLeaveRespVO>> getLeaveList(@RequestParam("ids") Collection<Long> ids) {
List<OaLeaveDO> list = leaveService.getLeaveList(ids);
return success(OaLeaveConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得请假申请分页")
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
public CommonResult<PageResult<OaLeaveRespVO>> getLeavePage(@Valid OaLeavePageReqVO pageVO) {
//值查询自己申请请假
// TODO @芋艿:这里的传值,到底前端搞,还是后端搞。
pageVO.setUserId(SecurityFrameworkUtils.getLoginUser().getUsername());
PageResult<OaLeaveDO> pageResult = leaveService.getLeavePage(pageVO);
return success(OaLeaveConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出请假申请 Excel")
@PreAuthorize("@ss.hasPermission('oa:leave:export')")
@OperateLog(type = EXPORT)
public void exportLeaveExcel(@Valid OaLeaveExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<OaLeaveDO> list = leaveService.getLeaveList(exportReqVO);
// 导出 Excel
List<OaLeaveExcelVO> datas = OaLeaveConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "请假申请.xls", "数据", OaLeaveExcelVO.class, datas);
}
}

View File

@ -0,0 +1,48 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 请假申请 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class OaLeaveBaseVO {
@ApiModelProperty(value = "流程id")
private String processInstanceId;
@ApiModelProperty(value = "状态", required = true)
private Integer status;
@ApiModelProperty(value = "申请人id", required = true)
private String userId;
@ApiModelProperty(value = "开始时间", required = true)
@NotNull(message = "开始时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date startTime;
@ApiModelProperty(value = "结束时间", required = true)
@NotNull(message = "结束时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime;
@ApiModelProperty(value = "请假类型")
private String leaveType;
@ApiModelProperty(value = "原因")
private String reason;
@ApiModelProperty(value = "申请时间", required = true)
@NotNull(message = "申请时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date applyTime;
}

View File

@ -0,0 +1,15 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("请假申请创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OaLeaveCreateReqVO extends OaLeaveBaseVO {
private String processKey;
}

View File

@ -0,0 +1,44 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 请假申请 Excel VO
*
* @author 芋艿
*/
@Data
public class OaLeaveExcelVO {
@ExcelProperty("请假表单主键")
private Long id;
@ExcelProperty("流程id")
private String processInstanceId;
@ExcelProperty("状态")
private Integer status;
@ExcelProperty("申请人id")
private String userId;
@ExcelProperty("开始时间")
private Date startTime;
@ExcelProperty("结束时间")
private Date endTime;
@ExcelProperty("请假类型")
private String leaveType;
@ExcelProperty("原因")
private String reason;
@ExcelProperty("申请时间")
private Date applyTime;
}

View File

@ -0,0 +1,54 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "请假申请 Excel 导出 Request VO", description = "参数和 OaLeavePageReqVO 是一致的")
@Data
public class OaLeaveExportReqVO {
@ApiModelProperty(value = "流程id")
private String processInstanceId;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "申请人id")
private String userId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始开始时间")
private Date beginStartTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束开始时间")
private Date endStartTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始结束时间")
private Date beginEndTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束结束时间")
private Date endEndTime;
@ApiModelProperty(value = "请假类型")
private String leaveType;
@ApiModelProperty(value = "原因")
private String reason;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始申请时间")
private Date beginApplyTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束申请时间")
private Date endApplyTime;
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("请假申请分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OaLeavePageReqVO extends PageParam {
@ApiModelProperty(value = "流程id")
private String processInstanceId;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "申请人id")
private String userId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始开始时间")
private Date beginStartTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束开始时间")
private Date endStartTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始结束时间")
private Date beginEndTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束结束时间")
private Date endEndTime;
@ApiModelProperty(value = "请假类型")
private String leaveType;
@ApiModelProperty(value = "原因")
private String reason;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始申请时间")
private Date beginApplyTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束申请时间")
private Date endApplyTime;
}

View File

@ -0,0 +1,16 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
@ApiModel("请假申请 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OaLeaveRespVO extends OaLeaveBaseVO {
@ApiModelProperty(value = "请假表单主键", required = true)
private Long id;
}

View File

@ -0,0 +1,32 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.util.Map;
@ApiModel("请假申请更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OaLeaveUpdateReqVO extends OaLeaveBaseVO {
@ApiModelProperty(value = "请假表单主键", required = true)
@NotNull(message = "请假表单主键不能为空")
private Long id;
// TODO @jsonswagger 和 validator 的注解要加哈。
private String taskId;
private String comment;
private Map<String,Object> variables;
// TODO @芋艿variables 的作用是啥。
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import org.activiti.api.process.runtime.ProcessRuntime;
import org.activiti.engine.RepositoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
// TODO @jsonswagger 和 validation 的注解,后续要补全下哈。可以等 workflow 基本写的差不多之后
@RestController
@RequestMapping("/workflow/process/definition")
public class ProcessDefinitionController {
@Resource
private RepositoryService repositoryService;
@Resource
private ProcessRuntime processRuntime;
@GetMapping(value = "/getStartForm")
public CommonResult<String> getStartForm(@RequestParam("processKey") String processKey){
//这样查似乎有问题??, 暂时写死
// final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().
// processDefinitionKey(processKey).latestVersion().singleResult();
// processRuntime.processDefinition(processDefinition.getId()).getFormKey();
return CommonResult.success("/flow/leave/apply");
}
}

View File

@ -0,0 +1,60 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
import cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.TaskService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
// TODO @jsonswagger 和 validation 的注解,后续要补全下哈。可以等 workflow 基本写的差不多之后
@Api(tags = "工作流待办任务")
@RestController
@RequestMapping("/workflow/task")
public class TaskController {
@Resource
private TaskService taskService;
@GetMapping("/todo/page")
@ApiOperation("获取待办任务分页")
public CommonResult<PageResult<TodoTaskRespVO>> getTodoTaskPage(@Valid TodoTaskPageReqVO pageVO) {
return success(taskService.getTodoTaskPage(pageVO));
}
@GetMapping("/claim")
@ApiOperation("签收任务")
public CommonResult<Boolean> claimTask(@RequestParam("id") String taskId) {
taskService.claimTask(taskId);
return success(true);
}
@PostMapping("/task-steps")
public CommonResult<TaskHandleVO> getTaskSteps(@RequestBody TaskQueryReqVO taskQuery) {
return success(taskService.getTaskSteps(taskQuery));
}
@PostMapping("/formKey")
public CommonResult<TodoTaskRespVO> getTaskFormKey(@RequestBody TaskQueryReqVO taskQuery) {
return success(taskService.getTaskFormKey(taskQuery));
}
@PostMapping("/complete")
public CommonResult<Boolean> complete(@RequestBody TaskReqVO taskReq) {
taskService.completeTask(taskReq);
return success(true);
}
@GetMapping("/process/history-steps")
public CommonResult<List<TaskStepVO>> getHistorySteps(@RequestParam("id") String processInstanceId) {
return success(taskService.getHistorySteps(processInstanceId));
}
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import lombok.Data;
import lombok.ToString;
import java.util.List;
@Data
@ToString
public class TaskHandleVO {
private Object formObject;
private List<TaskStepVO> historyTask;
private String taskVariable;
}

View File

@ -0,0 +1,15 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class TaskQueryReqVO {
private String processKey;
private String taskId;
private String businessKey;
}

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import lombok.Data;
import lombok.ToString;
import java.util.Map;
@Data
@ToString
public class TaskReqVO {
private String taskId;
private Map<String,Object> variables;
private String comment;
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import lombok.Data;
import lombok.ToString;
import java.util.Date;
@Data
@ToString
public class TaskStepVO {
private String stepName;
private Date startTime;
private Date endTime;
private String assignee;
private String comment;
private Integer status;
}

View File

@ -0,0 +1,16 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ApiModel("待办任务申请分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TodoTaskPageReqVO extends PageParam {
private String assignee;
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ApiModel("待办任务 Response VO")
@Data
@ToString
public class TodoTaskRespVO {
private String id;
/**
* 1:未签收
* 2:已签收
*/
private Integer status;
private String processName;
private String processKey;
private String businessKey;
private String formKey;
}

View File

@ -0,0 +1,36 @@
package cn.iocoder.yudao.adminserver.modules.activiti.convert.form;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExcelVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormRespVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 动态表单 Convert
*
* @author 芋艿
*/
@Mapper
public interface WfFormConvert {
WfFormConvert INSTANCE = Mappers.getMapper(WfFormConvert.class);
WfForm convert(WfFormCreateReqVO bean);
WfForm convert(WfFormUpdateReqVO bean);
WfFormRespVO convert(WfForm bean);
List<WfFormRespVO> convertList(List<WfForm> list);
PageResult<WfFormRespVO> convertPage(PageResult<WfForm> page);
List<WfFormExcelVO> convertList02(List<WfForm> list);
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.adminserver.modules.activiti.convert.oa;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
/**
* 请假申请 Convert
*
* @author 芋艿
*/
@Mapper
public interface OaLeaveConvert {
OaLeaveConvert INSTANCE = Mappers.getMapper(OaLeaveConvert.class);
OaLeaveDO convert(OaLeaveCreateReqVO bean);
OaLeaveDO convert(OaLeaveUpdateReqVO bean);
OaLeaveRespVO convert(OaLeaveDO bean);
List<OaLeaveRespVO> convertList(List<OaLeaveDO> list);
PageResult<OaLeaveRespVO> convertPage(PageResult<OaLeaveDO> page);
List<OaLeaveExcelVO> convertList02(List<OaLeaveDO> list);
}

View File

@ -0,0 +1,9 @@
package cn.iocoder.yudao.adminserver.modules.activiti.convert.workflow;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface TodoTaskConvert {
TodoTaskConvert INSTANCE = Mappers.getMapper(TodoTaskConvert.class);
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import java.util.List;
/**
* 工作流的表单定义
* 用于工作流的申请表单,需要动态配置的场景
*
* @author 芋道源码
*/
@TableName(value = "wf_form", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WfForm extends BaseDO {
/**
* 编号
*/
@TableId
private Long id;
/**
* 表单名
*/
private String name;
/**
* 状态
*/
private Integer status;
/**
* 表单JSON
*/
private String formJson;
/**
* 表单配置
*
* 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存
* 定义https://github.com/JakHuang/form-generator/issues/46
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<String> fields;
/**
* 备注
*/
private String remark;
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import java.util.List;
import java.util.Map;
/**
* 工作流的表单结果
* 用户每次填写工作流的申请表单时,会保存一条记录到该表】
*
* @author 芋道源码
*/
@TableName(value = "wf_form", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WfFormData extends BaseDO {
/**
* 编号
*/
private Long id;
/**
* 表单编号
*
* 关联 {@link WfForm#getId()}
*/
private Long formId;
/**
* 状态
*/
private Integer status;
/**
* 表单配置
*
* 冗余 {@link WfForm#getFields()}
* 主要考虑,表单是可以修改的
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<String> fields;
/**
* 表单值
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private Map<String, Object> values;
}

View File

@ -0,0 +1,60 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 请假申请 DO
*
* @author 芋艿
*/
@TableName("oa_leave")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OaLeaveDO extends BaseDO {
/**
* 请假表单主键
*/
@TableId
private Long id;
/**
* 流程id
*/
private String processInstanceId;
/**
* 状态
*/
private Integer status;
/**
* 申请人id
*/
private String userId;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 请假类型
*/
private String leaveType;
/**
* 原因
*/
private String reason;
/**
* 申请时间
*/
private Date applyTime;
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.process;
/**
* 流程模型实体类 映射 activiti ProcessDefinition接口
*
* @author ZJQ
* @date 2021/9/7 23:23
*/
public class ProcessDefinitionDO {
private String id;
private String category;
private String key;
private String name;
private String version;
private String resourceName;
private String deploymentId;
private String diagramResourceName;
private boolean suspended;
}

View File

@ -0,0 +1,43 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 动态表单 Mapper
*
* @author 风里雾里
*/
@Mapper
public interface WfFormMapper extends BaseMapperX<WfForm> {
default PageResult<WfForm> selectPage(WfFormPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<WfForm>()
.likeIfPresent("name", reqVO.getName())
.eqIfPresent("status", reqVO.getStatus())
.eqIfPresent("form_json", reqVO.getFormJson())
.eqIfPresent("remark", reqVO.getRemark())
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc("id") );
}
default List<WfForm> selectList(WfFormExportReqVO reqVO) {
return selectList(new QueryWrapperX<WfForm>()
.likeIfPresent("name", reqVO.getName())
.eqIfPresent("status", reqVO.getStatus())
.eqIfPresent("form_json", reqVO.getFormJson())
.eqIfPresent("remark", reqVO.getRemark())
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc("id") );
}
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
/**
* 请假申请 Mapper
*
* @author 芋艿
*/
@Mapper
public interface OaLeaveMapper extends BaseMapperX<OaLeaveDO> {
default PageResult<OaLeaveDO> selectPage(OaLeavePageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<OaLeaveDO>()
.eqIfPresent("process_instance_id", reqVO.getProcessInstanceId())
.eqIfPresent("status", reqVO.getStatus())
.eqIfPresent("user_id", reqVO.getUserId())
.betweenIfPresent("start_time", reqVO.getBeginStartTime(), reqVO.getEndStartTime())
.betweenIfPresent("end_time", reqVO.getBeginEndTime(), reqVO.getEndEndTime())
.eqIfPresent("leave_type", reqVO.getLeaveType())
.eqIfPresent("reason", reqVO.getReason())
.betweenIfPresent("apply_time", reqVO.getBeginApplyTime(), reqVO.getEndApplyTime())
.orderByDesc("id") );
}
default List<OaLeaveDO> selectList(OaLeaveExportReqVO reqVO) {
return selectList(new QueryWrapperX<OaLeaveDO>()
.eqIfPresent("process_instance_id", reqVO.getProcessInstanceId())
.eqIfPresent("status", reqVO.getStatus())
.eqIfPresent("user_id", reqVO.getUserId())
.betweenIfPresent("start_time", reqVO.getBeginStartTime(), reqVO.getEndStartTime())
.betweenIfPresent("end_time", reqVO.getBeginEndTime(), reqVO.getEndEndTime())
.eqIfPresent("leave_type", reqVO.getLeaveType())
.eqIfPresent("reason", reqVO.getReason())
.betweenIfPresent("apply_time", reqVO.getBeginApplyTime(), reqVO.getEndApplyTime())
.orderByDesc("id") );
}
}

View File

@ -0,0 +1,13 @@
package cn.iocoder.yudao.adminserver.modules.activiti.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* activiti 系统 错误码枚举类
*
* 003 activiti
* 001 oa
* activiti 系统,使用 1-003-000-000 段
*/
public interface OaErrorCodeConstants {
ErrorCode LEAVE_NOT_EXISTS = new ErrorCode(1003001001, "请假申请不存在");
}

View File

@ -0,0 +1,14 @@
package cn.iocoder.yudao.adminserver.modules.activiti.enums.form;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* activiti 系统 错误码枚举类
*
* 003 activiti
* 001 oa
* activiti 系统,使用 1-003-000-000 段
*/
public interface WfFormErrorCodeConstants {
ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在");
}

View File

@ -0,0 +1,2 @@
// TODO @芋艿:思考下 activiti、oa 的定位,边界,模块的拆分
package cn.iocoder.yudao.adminserver.modules.activiti;

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.config;
import cn.iocoder.yudao.adminserver.modules.system.service.dept.SysPostService;
import cn.iocoder.yudao.adminserver.modules.system.service.permission.SysPermissionService;
import cn.iocoder.yudao.adminserver.modules.system.service.user.SysUserService;
import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import org.activiti.api.runtime.shared.identity.UserGroupManager;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static java.util.Collections.singleton;
@Service
public class UserGroupManagerService implements UserGroupManager {
@Resource
private UserDetailsService userDetailsService;
@Resource
private SysUserService userService;
@Resource
private SysPostService sysPostService;
/**
* 暂时使用岗位来代替
* @param userId
* @return
*/
@Override
public List<String> getUserGroups(String userId) {
// final LoginUser loginUser = (LoginUser) userDetailsService.loadUserByUsername(userId);
// final Long id = loginUser.getId();
final SysUserDO user = userService.getUserByUsername(userId);
return sysPostService.getPosts(user.getPostIds()).stream().map(post -> post.getCode()).collect(Collectors.toList());
}
@Override
public List<String> getUserRoles(String userId) {
return Arrays.asList("ROLE_ACTIVITI_USER");
}
@Override
public List<String> getGroups() {
throw new UnsupportedOperationException("getGroups is now un supported");
}
@Override
public List<String> getUsers() {
throw new UnsupportedOperationException("getGroups is now un supported");
}
}

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.config;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import org.activiti.api.runtime.shared.security.PrincipalGroupsProvider;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;
import java.security.Principal;
import java.util.Collections;
import java.util.List;
@Service
public class UserGroupsProvider implements PrincipalGroupsProvider {
@Override
public List<String> getGroups(Principal principal) {
if(principal instanceof Authentication){
Authentication authentication = (Authentication) principal;
final Object user = authentication.getPrincipal();
if( user instanceof LoginUser){
return ((LoginUser) user).getGroups();
}else{
return Collections.emptyList();
}
}else{
return Collections.emptyList();
}
}
}

View File

@ -0,0 +1,75 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.form;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.*;
import javax.validation.*;
/**
* 动态表单 Service 接口
*
* TODO @风里雾里
*/
public interface WfFormService {
/**
* 创建动态表单
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createForm(@Valid WfFormCreateReqVO createReqVO);
/**
* 更新动态表单
*
* @param updateReqVO 更新信息
*/
void updateForm(@Valid WfFormUpdateReqVO updateReqVO);
/**
* 删除动态表单
*
* @param id 编号
*/
void deleteForm(Long id);
/**
* 获得动态表单
*
* @param id 编号
* @return 动态表单
*/
WfForm getForm(Long id);
/**
* 获得动态表单列表
*
* @param ids 编号
* @return 动态表单列表
*/
List<WfForm> getFormList(Collection<Long> ids);
/**
* 获得动态表单分页
*
* @param pageReqVO 分页查询
* @return 动态表单分页
*/
PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO);
/**
* 获得动态表单列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 动态表单列表
*/
List<WfForm> getFormList(WfFormExportReqVO exportReqVO);
}

View File

@ -0,0 +1,86 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.WfFormMapper;
import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.WfFormErrorCodeConstants.FORM_NOT_EXISTS;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 动态表单 Service 实现类
*
* TODO @风里雾里
*/
@Service
@Validated
public class WfFormServiceImpl implements WfFormService {
@Resource
private WfFormMapper formMapper;
@Override
public Long createForm(WfFormCreateReqVO createReqVO) {
// 插入
WfForm form = WfFormConvert.INSTANCE.convert(createReqVO);
formMapper.insert(form);
// 返回
return form.getId();
}
@Override
public void updateForm(WfFormUpdateReqVO updateReqVO) {
// 校验存在
this.validateFormExists(updateReqVO.getId());
// 更新
WfForm updateObj = WfFormConvert.INSTANCE.convert(updateReqVO);
formMapper.updateById(updateObj);
}
@Override
public void deleteForm(Long id) {
// 校验存在
this.validateFormExists(id);
// 删除
formMapper.deleteById(id);
}
private void validateFormExists(Long id) {
if (formMapper.selectById(id) == null) {
throw exception(FORM_NOT_EXISTS);
}
}
@Override
public WfForm getForm(Long id) {
return formMapper.selectById(id);
}
@Override
public List<WfForm> getFormList(Collection<Long> ids) {
return formMapper.selectBatchIds(ids);
}
@Override
public PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO) {
return formMapper.selectPage(pageReqVO);
}
@Override
public List<WfForm> getFormList(WfFormExportReqVO exportReqVO) {
return formMapper.selectList(exportReqVO);
}
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveExportReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeavePageReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/**
* 请假申请 Service 接口
*
* @author 芋艿
*/
public interface OaLeaveService {
/**
* 创建请假申请
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createLeave(@Valid OaLeaveCreateReqVO createReqVO);
/**
* 更新请假申请
*
* @param updateReqVO 更新信息
*/
void updateLeave(@Valid OaLeaveUpdateReqVO updateReqVO);
/**
* 删除请假申请
*
* @param id 编号
*/
void deleteLeave(Long id);
/**
* 获得请假申请
*
* @param id 编号
* @return 请假申请
*/
OaLeaveDO getLeave(Long id);
/**
* 获得请假申请列表
*
* @param ids 编号
* @return 请假申请列表
*/
List<OaLeaveDO> getLeaveList(Collection<Long> ids);
/**
* 获得请假申请分页
*
* @param pageReqVO 分页查询
* @return 请假申请分页
*/
PageResult<OaLeaveDO> getLeavePage(OaLeavePageReqVO pageReqVO);
/**
* 获得请假申请列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 请假申请列表
*/
List<OaLeaveDO> getLeaveList(OaLeaveExportReqVO exportReqVO);
}

View File

@ -0,0 +1,43 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Component
public class ReportBackEndProcessor implements ExecutionListener {
@Resource
private OaLeaveMapper leaveMapper;
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void notify(DelegateTask delegateTask) {
// final String businessKey = delegateTask.getExecution().getProcessInstanceBusinessKey();
// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id", Long.valueOf(businessKey));
// OaLeaveDO updateDo = new OaLeaveDO();
// updateDo.setStatus(2);
// leaveMapper.update(updateDo, updateWrapper);
// }
@Override
@Transactional(rollbackFor = Exception.class)
public void notify(DelegateExecution delegateExecution) {
final String businessKey = delegateExecution.getProcessInstanceBusinessKey();
// TODO @jsonservice 不要出现 dao 的元素,例如说 UpdateWrapper。这里我们可以调用 updateById 方法
UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", Long.valueOf(businessKey));
OaLeaveDO updateDo = new OaLeaveDO();
updateDo.setStatus(2); // TODO @jsonstatus 要枚举起来,不要出现 magic number
leaveMapper.update(updateDo, updateWrapper);
}
}

View File

@ -0,0 +1,141 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa.impl;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveExportReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeavePageReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.activiti.convert.oa.OaLeaveConvert;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
import cn.iocoder.yudao.adminserver.modules.activiti.service.oa.OaLeaveService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.activiti.api.task.model.Task;
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
import org.activiti.api.task.runtime.TaskRuntime;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.adminserver.modules.activiti.enums.OaErrorCodeConstants.LEAVE_NOT_EXISTS;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 请假申请 Service 实现类
*
* @author 芋艿
*/
@Service
@Validated
public class OaLeaveServiceImpl implements OaLeaveService {
@Resource
private OaLeaveMapper leaveMapper;
@Resource
private RuntimeService runtimeService;
@Resource
private org.activiti.engine.TaskService activitiTaskService;
@Resource
private TaskRuntime taskRuntime;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createLeave(OaLeaveCreateReqVO createReqVO) {
// 插入 OA 请假单
OaLeaveDO leave = OaLeaveConvert.INSTANCE.convert(createReqVO);
leave.setStatus(1);
leave.setUserId(SecurityFrameworkUtils.getLoginUser().getUsername());
leaveMapper.insert(leave);
// 创建工作流
Map<String, Object> variables = new HashMap<>();
// 如何得到部门领导人,暂时写死
variables.put("deptLeader", "admin"); // TODO @芋艿:需要部门的负责人
Long id = leave.getId();
String businessKey = String.valueOf(id);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(createReqVO.getProcessKey(), businessKey, variables);
String processInstanceId = processInstance.getProcessInstanceId();
// TODO @jsonservice 不要出现 dao 的元素,例如说 UpdateWrapper。这里我们可以调用 updateById 方法
// 将工作流的编号,更新到 OA 请假单中
UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
OaLeaveDO updateDo = new OaLeaveDO();
updateDo.setProcessInstanceId(processInstanceId);
leaveMapper.update(updateDo, updateWrapper);
return id;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateLeave(OaLeaveUpdateReqVO updateReqVO) {
// 校验存在
this.validateLeaveExists(updateReqVO.getId());
final Task task = taskRuntime.task(updateReqVO.getTaskId());
activitiTaskService.addComment(task.getId(), task.getProcessInstanceId(), updateReqVO.getComment());
Map<String, Object> variables = updateReqVO.getVariables();
//如何得到部门领导人, 暂时写死
variables.put("deptLeader", "admin");
taskRuntime.complete(TaskPayloadBuilder.complete().withTaskId(task.getId())
.withVariables(variables)
.build());
// TODO @jason不需要加 final 哈。虽然是不变,但是代码比较少这么去写
final Object reApply = variables.get("reApply");
// TODO @jason直接使用 Objects.equals(reApply, true) 就可以
if((reApply instanceof Boolean) && (Boolean)reApply){
// 更新 表单
OaLeaveDO updateObj = OaLeaveConvert.INSTANCE.convert(updateReqVO);
leaveMapper.updateById(updateObj);
}
}
@Override
public void deleteLeave(Long id) {
// 校验存在
this.validateLeaveExists(id);
// 删除
leaveMapper.deleteById(id);
// TODO @jason需要调用 runtimeService 的 delete 方法,删除???
}
private void validateLeaveExists(Long id) {
if (leaveMapper.selectById(id) == null) {
throw exception(LEAVE_NOT_EXISTS);
}
}
@Override
public OaLeaveDO getLeave(Long id) {
return leaveMapper.selectById(id);
}
@Override
public List<OaLeaveDO> getLeaveList(Collection<Long> ids) {
return leaveMapper.selectBatchIds(ids);
}
@Override
public PageResult<OaLeaveDO> getLeavePage(OaLeavePageReqVO pageReqVO) {
return leaveMapper.selectPage(pageReqVO);
}
@Override
public List<OaLeaveDO> getLeaveList(OaLeaveExportReqVO exportReqVO) {
return leaveMapper.selectList(exportReqVO);
}
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.process;
import org.springframework.web.multipart.MultipartFile;
/**
* 流程基础管理
*
* @author ZJQ
* @date 2021/9/5 21:00
*/
public interface ProcessService {
/**
* 上传流程文件,进行流程模型部署
* @param multipartFile 上传文件
*/
void deployProcess(MultipartFile multipartFile);
/**
* 激活或者挂起流程模型实体
* @param processDefinitionId 流程模型实体id
* @param type 类型
* @return 状态
*/
String setActivOrHang(String processDefinitionId,String type);
}

View File

@ -0,0 +1,109 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.process.impl;
import cn.iocoder.yudao.adminserver.modules.activiti.service.process.ProcessService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.apache.commons.io.FilenameUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.zip.ZipInputStream;
import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.FILE_UPLOAD_FAILED;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 流程基础管理
*
* @author ZJQ
* @date 2021/9/5 21:04
*/
@Service
@Slf4j
public class ProcessServiceImpl implements ProcessService {
private static final String BPMN20_XML = "bpmn20.xml";
@Resource
private RepositoryService repositoryService;
/**
* 上传流程文件,进行流程部署
* @param multipartFile 上传文件
*/
@Override
public void deployProcess(MultipartFile multipartFile) {
String fileName = multipartFile.getOriginalFilename();
try (InputStream inputStream = multipartFile.getInputStream()){
Deployment deployment = getDeplymentByType(inputStream,fileName);
//获取部署成功的流程模型
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
processDefinitions.forEach((processDefinition)->{
//设置线上部署流程模型名字
String proDefId = processDefinition.getId();
repositoryService.setProcessDefinitionCategory(proDefId,fileName);
log.info("流程文件部署成功流程ID="+proDefId);
});
} catch (IOException e) {
log.error("流程部署出现异常"+e);
}
}
/**
* 激活或者挂起流程模型实体
* @param processDefinitionId 流程模型实体id
* @param type 类型
* @return 提示
*/
@Override
public String setActivOrHang(String processDefinitionId, String type) {
String result = "无操作";
switch (type){
case "active":
repositoryService.activateProcessDefinitionById(processDefinitionId,true,null);
result = "已激活ID为【"+processDefinitionId+"】的流程模型实例";
break;
case "suspend":
repositoryService.suspendProcessDefinitionById(processDefinitionId,true,null);
result = "已挂起ID为【"+processDefinitionId+"】的流程模型实例";
break;
default:
break;
}
return result;
}
/**
* 根据上传文件类型对应实现不同方式的流程部署
* @param inputStream 文件输入流
* @param fileName 文件名
* @return 文件部署流程
*/
public Deployment getDeplymentByType(InputStream inputStream,String fileName){
Deployment deployment;
String type = FilenameUtils.getExtension(fileName);
switch (type){
case "bpmn":
String baseName = FilenameUtils.getBaseName(fileName);
deployment = repositoryService.createDeployment().addInputStream(baseName+"."+BPMN20_XML,inputStream).deploy();
break;
case "png":
deployment = repositoryService.createDeployment().addInputStream(fileName,inputStream).deploy();
break;
case "zip":
case "bar":
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
deployment = repositoryService.createDeployment().addZipInputStream(zipInputStream).deploy();
break;
default:
throw exception(FILE_UPLOAD_FAILED);
}
return deployment;
}
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.workflow;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.List;
// TODO @芋艿:前缀,注释
public interface TaskService {
PageResult<TodoTaskRespVO> getTodoTaskPage(TodoTaskPageReqVO pageReqVO);
void claimTask(String taskId);
void getTaskHistory(String taskId);
void completeTask(TaskReqVO taskReq);
// void flowImage(String taskId, HttpServletResponse response);
TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery);
List<TaskStepVO> getHistorySteps(String processInstanceId);
TodoTaskRespVO getTaskFormKey(TaskQueryReqVO taskQuery);
}

View File

@ -0,0 +1,266 @@
package cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.impl;
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
import cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.TaskService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import com.google.common.collect.ImmutableMap;
import org.activiti.api.runtime.shared.query.Page;
import org.activiti.api.runtime.shared.query.Pageable;
import org.activiti.api.task.model.Task;
import org.activiti.api.task.model.builders.ClaimTaskPayloadBuilder;
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
import org.activiti.api.task.runtime.TaskRuntime;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Comment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
public class TaskServiceImpl implements TaskService {
@Resource
private TaskRuntime taskRuntime;
@Resource
private org.activiti.engine.TaskService activitiTaskService;
@Resource
private HistoryService historyService;
@Resource
private RepositoryService repositoryService;
@Resource
private OaLeaveMapper leaveMapper;
private static Map<String,String> taskVariable = ImmutableMap.<String,String>builder()
.put("deptLeaderVerify","deptLeaderApproved")
.put("hrVerify","hrApproved")
.build();
public TaskServiceImpl() {
}
@Override
public PageResult<TodoTaskRespVO> getTodoTaskPage(TodoTaskPageReqVO pageReqVO) {
final LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
// TODO @jason封装一个方法用于转换成 activiti 的分页对象
final Pageable pageable = Pageable.of((pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize(), pageReqVO.getPageSize());
Page<Task> pageTasks = taskRuntime.tasks(pageable);
// TODO @jasonconvert 里转换
List<Task> tasks = pageTasks.getContent();
int totalItems = pageTasks.getTotalItems();
final List<TodoTaskRespVO> respVOList = tasks.stream().map(task -> {
TodoTaskRespVO respVO = new TodoTaskRespVO();
respVO.setId(task.getId());
final ProcessDefinition definition = repositoryService.getProcessDefinition(task.getProcessDefinitionId());
respVO.setProcessName(definition.getName());
respVO.setProcessKey(definition.getKey());
respVO.setBusinessKey(task.getBusinessKey());
respVO.setStatus(task.getAssignee() == null ? 1 : 2);
return respVO;
}).collect(Collectors.toList());
// TODO @jason要注意泛型哈。
return new PageResult(respVOList, Long.valueOf(totalItems)); // TODO @jason(long) 转换即可
}
@Override
public void claimTask(String taskId) {
taskRuntime.claim(new ClaimTaskPayloadBuilder()
.withTaskId(taskId)
.withAssignee(SecurityFrameworkUtils.getLoginUser().getUsername())
.build());
}
@Override
public void getTaskHistory(String taskId) {
final List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery().
processInstanceId("8e2801fc-1a38-11ec-98ce-74867a13730f").list();
}
// TODO @jason一个方法里会有多个方法的调用最好写下对应的注释。这样容易理解
@Override
@Transactional
public void completeTask(TaskReqVO taskReq) {
final Task task = taskRuntime.task(taskReq.getTaskId());
final Map<String, Object> variables = taskReq.getVariables();
activitiTaskService.addComment(taskReq.getTaskId(), task.getProcessInstanceId(), taskReq.getComment());
taskRuntime.complete(TaskPayloadBuilder.complete().withTaskId(taskReq.getTaskId())
.withVariables(taskReq.getVariables())
.build());
// if(variables.containsValue(Boolean.FALSE)){
// final String businessKey = task.getBusinessKey();
// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id", Long.valueOf(businessKey));
// OaLeaveDO updateDo = new OaLeaveDO();
// updateDo.setStatus(2);
// leaveMapper.update(updateDo, updateWrapper);
// }
}
// @Override
// public void flowImage(String taskId, HttpServletResponse response) {
//
// final Task task = taskRuntime.task(taskId);
// BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
// final Process process = bpmnModel.getMainProcess();
// ProcessDefinitionEntity processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
// List<String> activeActivityIds = runtimeService.getActiveActivityIds(executionId);
// List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstance.getId());
// ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
// InputStream imageStream =diagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds, highLightedFlows);
//
// // 输出资源内容到相应对象
// byte[] b = new byte[1024];
// int len;
// while ((len = imageStream.read(b, 0, 1024)) != -1) {
// response.getOutputStream().write(b, 0, len);
// }
// }
@Override
public TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery) {
TaskHandleVO handleVO = new TaskHandleVO();
// String processKey = taskQuery.getProcessKey();
// if ("leave".equals(processKey)) {
// String businessKey = taskQuery.getBusinessKey();
// final OaLeaveDO leave = leaveMapper.selectById(Long.valueOf(businessKey));
// handleVO.setFormObject( OaLeaveConvert.INSTANCE.convert(leave));
// }
//
// final String taskDefKey = task.getTaskDefinitionKey();
// final String variableName = Optional.ofNullable(taskVariable.get(taskDefKey)).orElse("");
// handleVO.setTaskVariable(variableName);
final Task task = taskRuntime.task(taskQuery.getTaskId());
List<TaskStepVO> steps = getTaskSteps(task.getProcessInstanceId());
handleVO.setHistoryTask(steps);
return handleVO;
}
private List<TaskStepVO> getTaskSteps(String processInstanceId) {
// 获得已完成的活动
List<HistoricActivityInstance> finished = historyService.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.activityType("userTask")
.finished()
.orderByHistoricActivityInstanceStartTime().asc().list();
// 获得对应的步骤
List<TaskStepVO> steps = new ArrayList<>();
finished.forEach(instance -> {
// TODO @jason放到 convert 里
TaskStepVO step = new TaskStepVO();
step.setStepName(instance.getActivityName());
step.setStartTime(instance.getStartTime());
step.setEndTime(instance.getEndTime());
step.setAssignee(instance.getAssignee());
step.setStatus(1);
// TODO @jason一般判数组为空使用 CollUtil.isEmpty 会好点哈。另外null 时候,不用填写 "" 的哈
List<Comment> comments = activitiTaskService.getTaskComments(instance.getTaskId());
if (comments.size() > 0) {
step.setComment(comments.get(0).getFullMessage());
} else {
step.setComment("");
}
steps.add(step);
});
// 获得未完成的活动
List<HistoricActivityInstance> unfinished = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.activityType("userTask")
.unfinished().list();
// 获得对应的步骤
// TODO @json其实已完成和未完成它们的 convert 的逻辑,是一致的
for (HistoricActivityInstance instance : unfinished) {
TaskStepVO step = new TaskStepVO();
step.setStepName(instance.getActivityName());
step.setStartTime(instance.getStartTime());
step.setEndTime(instance.getEndTime());
step.setAssignee(Optional.ofNullable(instance.getAssignee()).orElse(""));
step.setComment("");
step.setStatus(0);
steps.add(step);
}
return steps;
}
@Override
public List<TaskStepVO> getHistorySteps(String processInstanceId) {
return getTaskSteps(processInstanceId);
}
@Override
public TodoTaskRespVO getTaskFormKey(TaskQueryReqVO taskQuery) {
final Task task = taskRuntime.task(taskQuery.getTaskId());
// 转换结果
TodoTaskRespVO respVO = new TodoTaskRespVO();
respVO.setFormKey(task.getFormKey());
respVO.setBusinessKey(task.getBusinessKey());
respVO.setId(task.getId());
return respVO;
}
// private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) {
//
// List<String> highLightedFlows = new ArrayList<String>();
// List<HistoricActivityInstance> historicActivityInstances = historyService
// .createHistoricActivityInstanceQuery()
// .processInstanceId(processInstanceId)
// .orderByHistoricActivityInstanceStartTime().asc().list();
//
// List<String> historicActivityInstanceList = new ArrayList<String>();
// for (HistoricActivityInstance hai : historicActivityInstances) {
// historicActivityInstanceList.add(hai.getActivityId());
// }
// // add current activities to list
// List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
// historicActivityInstanceList.addAll(highLightedActivities);
// activities and their sequence-flows
// for (ActivityImpl activity : processDefinition.getActivities()) {
// int index = historicActivityInstanceList.indexOf(activity.getId());
//
// if (index >= 0 && index + 1 < historicActivityInstanceList.size()) {
// List<PvmTransition> pvmTransitionList = activity
// .getOutgoingTransitions();
// for (PvmTransition pvmTransition : pvmTransitionList) {
// String destinationFlowId = pvmTransition.getDestination().getId();
// if (destinationFlowId.equals(historicActivityInstanceList.get(index + 1))) {
// highLightedFlows.add(pvmTransition.getId());
// }
// }
// }
// }
// return highLightedFlows;
// }
}

View File

@ -1,12 +1,12 @@
package cn.iocoder.yudao.adminserver.modules.infra.controller.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.*;
import cn.iocoder.yudao.adminserver.modules.infra.convert.config.InfConfigConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.config.InfConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;

View File

@ -1,13 +1,14 @@
package cn.iocoder.yudao.adminserver.modules.infra.controller.file;
import cn.hutool.core.io.IoUtil;
import cn.iocoder.yudao.adminserver.modules.infra.service.file.InfFileService;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.convert.file.InfFileConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.file.InfFileService;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -36,16 +37,18 @@ public class InfFileController {
@Resource
private InfFileService fileService;
@Resource
private InfFileCoreService fileCoreService;
@PostMapping("/upload")
@ApiOperation("上传文件")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件附件", required = true, dataTypeClass = MultipartFile.class),
@ApiImplicitParam(name = "path", value = "文件路径", required = false, example = "yudaoyuanma.png", dataTypeClass = String.class)
@ApiImplicitParam(name = "path", value = "文件路径", example = "yudaoyuanma.png", dataTypeClass = String.class)
})
public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file,
@RequestParam("path") String path) throws IOException {
return success(fileService.createFile(path, IoUtil.readBytes(file.getInputStream())));
return success(fileCoreService.createFile(path, IoUtil.readBytes(file.getInputStream())));
}
@DeleteMapping("/delete")
@ -53,7 +56,7 @@ public class InfFileController {
@ApiImplicitParam(name = "id", value = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:file:delete')")
public CommonResult<Boolean> deleteFile(@RequestParam("id") String id) {
fileService.deleteFile(id);
fileCoreService.deleteFile(id);
return success(true);
}
@ -61,7 +64,7 @@ public class InfFileController {
@ApiOperation("下载文件")
@ApiImplicitParam(name = "path", value = "文件附件", required = true, dataTypeClass = MultipartFile.class)
public void getFile(HttpServletResponse response, @PathVariable("path") String path) throws IOException {
InfFileDO file = fileService.getFile(path);
InfFileDO file = fileCoreService.getFile(path);
if (file == null) {
log.warn("[getFile][path({}) 文件不存在]", path);
response.setStatus(HttpStatus.NOT_FOUND.value());

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.adminserver.modules.infra.controller.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
@ -9,7 +10,6 @@ import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccess
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.convert.logger.InfApiAccessLogConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.logger.InfApiAccessLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.adminserver.modules.infra.controller.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
@ -9,7 +10,6 @@ import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorl
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.convert.logger.InfApiErrorLogConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.logger.InfApiErrorLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.adminserver.modules.infra.convert.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigExcelVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.config.InfConfigDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.adminserver.modules.infra.convert.file;
import cn.iocoder.yudao.coreservice.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFileRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

View File

@ -1,10 +1,9 @@
package cn.iocoder.yudao.adminserver.modules.infra.convert.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateDTO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogExcelVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@ -20,8 +19,6 @@ public interface InfApiAccessLogConvert {
InfApiAccessLogConvert INSTANCE = Mappers.getMapper(InfApiAccessLogConvert.class);
InfApiAccessLogDO convert(ApiAccessLogCreateDTO bean);
InfApiAccessLogRespVO convert(InfApiAccessLogDO bean);
List<InfApiAccessLogRespVO> convertList(List<InfApiAccessLogDO> list);

View File

@ -1,10 +1,9 @@
package cn.iocoder.yudao.adminserver.modules.infra.convert.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateDTO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogExcelVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogRespVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@ -20,8 +19,6 @@ public interface InfApiErrorLogConvert {
InfApiErrorLogConvert INSTANCE = Mappers.getMapper(InfApiErrorLogConvert.class);
InfApiErrorLogDO convert(ApiErrorLogCreateDTO bean);
InfApiErrorLogRespVO convert(InfApiErrorLogDO bean);
PageResult<InfApiErrorLogRespVO> convertPage(PageResult<InfApiErrorLogDO> page);

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.config.InfConfigDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.ibatis.annotations.Mapper;

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.file;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
import org.apache.ibatis.annotations.Mapper;
/**
* admin 文件操作 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface InfFileMapper extends BaseMapperX<InfFileDO> {
default Integer selectCountById(String id) {
return selectCount("id", id);
}
default PageResult<InfFileDO> selectPage(InfFilePageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<InfFileDO>()
.likeIfPresent("id", reqVO.getId())
@ -21,5 +21,4 @@ public interface InfFileMapper extends BaseMapperX<InfFileDO> {
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc("create_time"));
}
}

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.logger;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.logger;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

View File

@ -27,7 +27,4 @@ public interface InfErrorCodeConstants {
ErrorCode API_ERROR_LOG_NOT_FOUND = new ErrorCode(1001002000, "API 错误日志不存在");
ErrorCode API_ERROR_LOG_PROCESSED = new ErrorCode(1001002001, "API 错误日志已处理");
// ========== 文件 1001003000 ==========
ErrorCode FILE_NOT_EXISTS = new ErrorCode(1001003000, "文件不存在");
}

View File

@ -1,13 +1,13 @@
package cn.iocoder.yudao.adminserver.modules.infra.mq.message.config;
import cn.iocoder.yudao.framework.mq.core.pubsub.ChannelMessage;
import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage;
import lombok.Data;
/**
* 配置数据刷新 Message
*/
@Data
public class InfConfigRefreshMessage implements ChannelMessage {
public class InfConfigRefreshMessage extends AbstractChannelMessage {
@Override
public String getChannel() {

View File

@ -1,8 +1,7 @@
package cn.iocoder.yudao.adminserver.modules.infra.mq.producer.config;
import cn.iocoder.yudao.adminserver.modules.infra.mq.message.config.InfConfigRefreshMessage;
import cn.iocoder.yudao.framework.mq.core.util.RedisMessageUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -14,14 +13,14 @@ import javax.annotation.Resource;
public class InfConfigProducer {
@Resource
private StringRedisTemplate stringRedisTemplate;
private RedisMQTemplate redisMQTemplate;
/**
* 发送 {@link InfConfigRefreshMessage} 消息
*/
public void sendConfigRefreshMessage() {
InfConfigRefreshMessage message = new InfConfigRefreshMessage();
RedisMessageUtils.sendChannelMessage(stringRedisTemplate, message);
redisMQTemplate.send(message);
}
}

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.config;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.config.InfConfigDO;
import javax.validation.Valid;
import java.util.List;

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.config.impl;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigCreateReqVO;
@ -8,7 +9,6 @@ import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfig
import cn.iocoder.yudao.adminserver.modules.infra.controller.config.vo.InfConfigUpdateReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.convert.config.InfConfigConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.config.InfConfigMapper;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.config.InfConfigDO;
import cn.iocoder.yudao.adminserver.modules.infra.enums.config.InfConfigTypeEnum;
import cn.iocoder.yudao.adminserver.modules.infra.mq.producer.config.InfConfigProducer;
import cn.iocoder.yudao.adminserver.modules.infra.service.config.InfConfigService;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.file;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 文件 Service 接口
@ -11,30 +11,6 @@ import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
*/
public interface InfFileService {
/**
* 保存文件,并返回文件的访问路径
*
* @param path 文件路径
* @param content 文件内容
* @return 文件路径
*/
String createFile(String path, byte[] content);
/**
* 删除文件
*
* @param id 编号
*/
void deleteFile(String id);
/**
* 获得文件
*
* @param path 文件路径
* @return 文件
*/
InfFileDO getFile(String path);
/**
* 获得文件分页
*

View File

@ -1,20 +1,14 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.file.impl;
import cn.hutool.core.io.FileTypeUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.infra.framework.file.config.FileProperties;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.file.InfFileMapper;
import cn.iocoder.yudao.adminserver.modules.infra.service.file.InfFileService;
import cn.iocoder.yudao.adminserver.modules.infra.controller.file.vo.InfFilePageReqVO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.file.InfFileDO;
import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants.FILE_NOT_EXISTS;
import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.FILE_PATH_EXISTS;
/**
* 文件 Service 实现类
@ -27,43 +21,6 @@ public class InfFileServiceImpl implements InfFileService {
@Resource
private InfFileMapper fileMapper;
@Resource
private FileProperties fileProperties;
@Override
public String createFile(String path, byte[] content) {
if (fileMapper.selectCountById(path) > 0) {
throw exception(FILE_PATH_EXISTS);
}
// 保存到数据库
InfFileDO file = new InfFileDO();
file.setId(path);
file.setType(FileTypeUtil.getType(new ByteArrayInputStream(content)));
file.setContent(content);
fileMapper.insert(file);
// 拼接路径返回
return fileProperties.getBasePath() + path;
}
@Override
public void deleteFile(String id) {
// 校验存在
this.validateFileExists(id);
// 更新
fileMapper.deleteById(id);
}
private void validateFileExists(String id) {
if (fileMapper.selectById(id) == null) {
throw exception(FILE_NOT_EXISTS);
}
}
@Override
public InfFileDO getFile(String path) {
return fileMapper.selectById(path);
}
@Override
public PageResult<InfFileDO> getFilePage(InfFilePageReqVO pageReqVO) {
return fileMapper.selectPage(pageReqVO);

View File

@ -1,10 +1,9 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.logger;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.List;
@ -13,7 +12,7 @@ import java.util.List;
*
* @author 芋道源码
*/
public interface InfApiAccessLogService extends ApiAccessLogFrameworkService {
public interface InfApiAccessLogService {
/**
* 获得 API 访问日志分页

View File

@ -1,10 +1,9 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.logger;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apierrorlog.InfApiErrorLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiErrorLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.List;
@ -13,7 +12,7 @@ import java.util.List;
*
* @author 芋道源码
*/
public interface InfApiErrorLogService extends ApiErrorLogFrameworkService {
public interface InfApiErrorLogService {
/**
* 获得 API 错误日志分页

View File

@ -1,21 +1,16 @@
package cn.iocoder.yudao.adminserver.modules.infra.service.logger.impl;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateDTO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogExportReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.controller.logger.vo.apiaccesslog.InfApiAccessLogPageReqVO;
import cn.iocoder.yudao.adminserver.modules.infra.convert.logger.InfApiAccessLogConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.adminserver.modules.infra.dal.mysql.logger.InfApiAccessLogMapper;
import cn.iocoder.yudao.adminserver.modules.infra.service.logger.InfApiAccessLogService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import cn.iocoder.yudao.coreservice.modules.infra.dal.dataobject.logger.InfApiAccessLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.Future;
/**
* API 访问日志 Service 实现类
@ -29,15 +24,6 @@ public class InfApiAccessLogServiceImpl implements InfApiAccessLogService {
@Resource
private InfApiAccessLogMapper apiAccessLogMapper;
@Override
@Async
public Future<Boolean> createApiAccessLogAsync(ApiAccessLogCreateDTO createDTO) {
// 插入
InfApiAccessLogDO apiAccessLog = InfApiAccessLogConvert.INSTANCE.convert(createDTO);
int insert = apiAccessLogMapper.insert(apiAccessLog);
return new AsyncResult<>(insert == 1);
}
@Override
public PageResult<InfApiAccessLogDO> getApiAccessLogPage(InfApiAccessLogPageReqVO pageReqVO) {
return apiAccessLogMapper.selectPage(pageReqVO);

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