mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-12 13:39:01 +08:00
Merge branch 'leng_dev'
# Conflicts: # README.md
This commit is contained in:
commit
2b6d1233f0
105 files changed
+1410
-623
No files matched your search
@@ -1,3 +1,4 @@
|
||||
# 开发组IDE 编辑器标准 V2.1.0
|
||||
root = true
|
||||
|
||||
[*.{adoc, bat, groovy, html, java, js, jsp, kt, kts, md, properties, py, rb, sh, sql, svg, txt, xml, xsd}]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 忽略匹配下列规则的Git 提交 V2.1.0
|
||||
### gradle ###
|
||||
.gradle
|
||||
/build/
|
||||
|
||||
@@ -14,4 +14,8 @@ pigX并非一个开源软件,作者保留全部的权利。
|
||||
将本项目的部分或全部代码和资源进行任何形式的再发行(尤其上传GitHub、Gitee )
|
||||
利用本项目的部分或全部代码和资源进行任何商业行为
|
||||
|
||||
免责声明
|
||||
|
||||
PigX 未对任何组织、团队,书面授权商业使用。如若出现任何商业后果、纠纷和本人无关,特此声明
|
||||
|
||||
Author: lengleng (wangiegie@gmail.com)
|
||||
@@ -1,7 +1,9 @@
|
||||
## pigx 2.0
|
||||
[pigx 2.0 部署文档](doc/md/deploy.md)
|
||||
[pigx 2.0 新特性说明 ](https://www.bilibili.com/video/av37786337)
|
||||
[pigx 2.0 从检出到启动](https://www.bilibili.com/video/av37695530)
|
||||
## 当前版本
|
||||
V2.1.0
|
||||
## pigx pro
|
||||
[pigx pro 部署文档](doc/md/deploy.md)
|
||||
[pigx pro 新特性说明 ](https://www.bilibili.com/video/av37786337)
|
||||
[pigx pro 从检出到启动](https://www.bilibili.com/video/av37695530)
|
||||
[pigx pro新建微服务模块(一)](https://www.bilibili.com/video/av37737139)
|
||||
[pigx pro新建微服务模块(二)](https://www.bilibili.com/video/av37740030)
|
||||
[pigx pro新建微服务模块(三)](https://www.bilibili.com/video/av37743341)
|
||||
@@ -10,20 +12,23 @@
|
||||
|
||||
## 协议和授权
|
||||
|
||||
pigX并非一个开源软件,作者保留全部的权利。
|
||||
|
||||
pigX并非一个开源软件,作者保留全部的权利。
|
||||
擅自窃用,即属严重侵权行为,与盗窃无异。产生的一切任何后果责任由侵权者自负。
|
||||
|
||||
### 🌹权益
|
||||
|
||||
个人使用学习、毕设
|
||||
1. 个人使用
|
||||
2. 允许用于学习、毕设等。
|
||||
|
||||
### 🚫禁止
|
||||
|
||||
1. 将本项目的部分或全部代码和资源进行任何形式的再发行(尤其上传GitHub、Gitee )
|
||||
|
||||
2. 利用本项目的部分或全部代码和资源进行`任何商业行为`
|
||||
|
||||
### 免责声明
|
||||
|
||||
PigX 未对任何组织、团队,书面授权商业使用。如若出现任何商业后果、纠纷和本人无关,特此声明
|
||||
|
||||
## 贡献代码
|
||||
|
||||
pigX并非一个开源项目,也不是社区共同创造,其全部功能由作者独立完成。
|
||||
|
||||
+11
-24
@@ -11,7 +11,7 @@
|
||||
Target Server Version : 50723
|
||||
File Encoding : utf-8
|
||||
|
||||
Date: 12/10/2018 21:57:20 PM
|
||||
Date: 01/09/2019 11:08:30 AM
|
||||
*/
|
||||
USE pigxx;
|
||||
|
||||
@@ -37,13 +37,6 @@ CREATE TABLE `job_execution_log` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务日志表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `job_execution_log`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `job_execution_log` VALUES ('071eab5d-cf95-4d4e-9346-5570e5a9303b', 'spring-dataflow-job', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '2', 'NORMAL_TRIGGER', null, '1', '2018-11-30 13:00:00', '2018-11-30 13:00:00'), ('0ac3bde4-f47e-4632-a03a-2c40e99ddb93', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@24646', 'lengleng', '192.168.0.58', '2', 'NORMAL_TRIGGER', null, '1', '2018-12-03 17:00:01', '2018-12-03 17:00:01'), ('0ce99951-d056-4224-8f73-73cdcc93faf2', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-12-03 15:00:00', '2018-12-03 15:00:00'), ('171a4207-afac-43be-ba81-7a584c906caa', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-12-03 15:00:00', '2018-12-03 15:00:00'), ('18d59cb5-e897-4aca-bea1-6b7e108446d3', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-11-30 13:00:00', '2018-11-30 13:00:00'), ('1b1c5846-1552-4a8e-91bd-e6d3de5d94c1', 'spring-dataflow-job', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-11-30 14:00:00', '2018-11-30 14:00:00'), ('1b1fcad5-4c7f-41d3-b1f8-1d3860f026b4', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '2', 'NORMAL_TRIGGER', null, '1', '2018-12-03 15:00:00', '2018-12-03 15:00:00'), ('266ab0de-1874-479a-885c-e9781abd9b9e', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-12-03 15:00:00', '2018-12-03 15:00:00'), ('2a27c1a5-d3ad-44ed-a2ab-148819373e85', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-11-30 12:00:01', '2018-11-30 12:00:01'), ('3faf189f-5314-4e0e-8d6a-c928aebcb38b', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-12-03 14:00:00', '2018-12-03 14:00:00'), ('438f7c31-8259-4958-8c90-100aed490b49', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-11-30 12:00:01', '2018-11-30 12:00:01'), ('504febd1-b31a-4d38-a170-efd3db6bea2f', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-12-03 14:00:00', '2018-12-03 14:00:00'), ('51fe65cf-0737-4e48-9eb2-44ea13e32ed0', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-12-03 16:00:00', '2018-12-03 16:00:00'), ('53109268-cd42-4907-a8c5-19fa09f37415', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '2', 'NORMAL_TRIGGER', null, '1', '2018-12-03 14:00:00', '2018-12-03 14:00:00'), ('55619ab3-c175-4715-9b04-d113b36fe22c', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '0', 'NORMAL_TRIGGER', null, '1', '2018-11-30 15:00:00', '2018-11-30 15:00:00'), ('57178f63-87ca-40eb-9c20-aa8354e38c9d', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-11-30 15:00:00', '2018-11-30 15:00:00'), ('596d2c37-a0a3-4b41-9116-47698ae0db4a', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-12-03 14:00:00', '2018-12-03 14:00:00'), ('59d0d17f-7123-442b-97ce-f204efbcaf0a', 'spring-dataflow-job', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-12-03 14:00:00', '2018-12-03 14:00:00'), ('5c142495-165e-44f9-b474-62a073ffc2e4', 'spring-dataflow-job', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-11-30 12:00:01', '2018-11-30 12:00:01'), ('5c354343-2ec4-4a6e-8b2b-e155a9579ebf', 'spring-simple-job', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@24646', 'lengleng', '192.168.0.58', '1', 'NORMAL_TRIGGER', null, '1', '2018-12-03 17:00:01', '2018-12-03 17:00:01'), ('60c7c895-530f-4b11-9951-ceb62420d9a0', 'spring-simple-job2', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@59736', 'lengleng', '192.168.0.58', '2', 'NORMAL_TRIGGER', null, '1', '2018-11-30 12:00:01', '2018-11-30 12:00:01'), ('691621ca-ad2b-4488-9c05-467c06b488d4', 'spring-simple-job2', 'spring-simple-jLine truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `job_status_trace_log`
|
||||
-- ----------------------------
|
||||
@@ -60,17 +53,9 @@ CREATE TABLE `job_status_trace_log` (
|
||||
`state` varchar(20) NOT NULL,
|
||||
`message` varchar(4000) DEFAULT NULL,
|
||||
`creation_time` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `TASK_ID_STATE_INDEX` (`task_id`,`state`) USING BTREE
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务轨迹表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `job_status_trace_log`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `job_status_trace_log` VALUES ('04212978-c410-45ed-8c4f-e68387d0fd05', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-simple-job2\' execute begin.', '2018-11-30 13:00:00'), ('06429f8d-84d0-4a44-83a0-d058a2925ac7', 'spring-simple-job', '', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-simple-job\' execute begin.', '2018-11-30 15:00:00'), ('09c1eda3-3384-4fc5-af62-33e39cc9df48', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-11-30 15:00:00'), ('0aedb2f8-3b7d-47ad-b76b-1065d71daca6', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-11-30 13:00:00'), ('0c0c9168-29c8-4b51-b78a-c97066fdf3ea', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-11-30 14:00:00'), ('130f458d-a6e9-41f7-9415-b5d051924ef6', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-12-03 14:00:00'), ('1b6fdc3a-819c-4dc2-970d-8aa01a4b879c', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-dataflow-job\' execute begin.', '2018-12-03 15:00:00'), ('20f69404-609a-47ed-b1af-d0dae2e24594', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-11-30 13:00:00'), ('21705123-1fd9-4e4a-b7d3-63b7c16bf5ff', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-dataflow-job\' execute begin.', '2018-11-30 15:00:00'), ('24dde237-c186-44c2-b93a-81edd6a9c1b8', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-11-30 12:00:01'), ('2f5fd775-0c73-439e-ad1a-14853890a210', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@24646', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-12-03 17:00:01'), ('3066d315-36a3-4ae4-9e78-b8ea683bbd3a', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-12-03 14:00:00'), ('31efd4c7-c6f1-406b-a07c-ab39b128b3f2', 'spring-simple-job', '', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-11-30 12:00:01'), ('35f60634-3beb-466e-b236-7348984b96a8', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-12-03 16:00:00'), ('402b0c76-e256-44cb-b554-358a1f0dd68b', 'spring-simple-job', '', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_RUNNING', '', '2018-12-03 14:00:00'), ('4d951975-e4e2-46ba-b59f-719989ece5a1', 'spring-simple-job2', '', 'spring-simple-job2@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-12-03 15:00:00'), ('4d95fa7d-c47d-48d4-b910-744469ce2e01', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-11-30 15:00:00'), ('4dc571c7-7785-4631-b5ab-e5b9d78f5a7e', 'spring-simple-job', '', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-simple-job\' execute begin.', '2018-11-30 14:00:00'), ('4f6a9f13-4cd6-431f-959c-7c117fea3702', 'spring-simple-job', '', 'spring-simple-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_FINISHED', '', '2018-11-30 12:00:01'), ('59d0b4c8-f58f-4f4a-91be-5602dd202631', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@59736', '192.168.0.58', 'LITE_EXECUTOR', 'READY', '[0, 1, 2]', 'TASK_STAGING', 'Job \'spring-dataflow-job\' execute begin.', '2018-11-30 13:00:00'), ('5db6982f-146e-400b-b8bd-ab9c7dee4b24', 'spring-dataflow-job', '', 'spring-dataflow-job@-@0,1,2@-@READY@-@192.168.0.58@-@20168', '192.168.0.58', 'LITE_EXECLine truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `sys_dept`
|
||||
-- ----------------------------
|
||||
@@ -91,7 +76,7 @@ CREATE TABLE `sys_dept` (
|
||||
-- Records of `sys_dept`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_dept` VALUES ('1', '山东农信', null, '2018-01-22 19:00:23', '2018-09-13 01:46:29', '0', '0', '1'), ('2', '沙县国际', null, '2018-01-22 19:00:38', '2018-09-13 01:46:30', '0', '0', '1'), ('3', '潍坊农信', null, '2018-01-22 19:00:44', '2018-09-13 01:46:31', '0', '1', '1'), ('4', '高新农信', null, '2018-01-22 19:00:52', '2018-10-06 10:41:52', '0', '3', '1'), ('5', '院校农信', null, '2018-01-22 19:00:57', '2018-10-06 10:42:51', '0', '4', '1'), ('6', '潍坊学院农信', null, '2018-01-22 19:01:06', '2018-09-13 03:29:10', '1', '5', '1'), ('7', '山东沙县', null, '2018-01-22 19:01:57', '2018-09-13 01:46:42', '0', '2', '1'), ('8', '潍坊沙县', null, '2018-01-22 19:02:03', '2018-09-13 01:46:43', '0', '7', '1'), ('9', '高新沙县', null, '2018-01-22 19:02:14', '2018-09-13 01:46:44', '1', '8', '1'), ('10', '租户2', null, '2018-11-18 13:27:11', '2018-11-18 13:42:19', '0', '0', '2'), ('11', '院校沙县', null, '2018-12-10 21:19:26', null, '0', '8', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('1', '山东农信', null, '2018-01-22 19:00:23', '2018-09-13 01:46:29', '0', '0', '1'), ('2', '沙县国际', null, '2018-01-22 19:00:38', '2018-09-13 01:46:30', '0', '0', '1'), ('3', '潍坊农信', null, '2018-01-22 19:00:44', '2018-09-13 01:46:31', '0', '1', '1'), ('4', '高新农信', null, '2018-01-22 19:00:52', '2018-10-06 10:41:52', '0', '3', '1'), ('5', '院校农信', null, '2018-01-22 19:00:57', '2018-10-06 10:42:51', '0', '4', '1'), ('6', '潍院农信', null, '2018-01-22 19:01:06', '2019-01-09 10:58:18', '1', '5', '1'), ('7', '山东沙县', null, '2018-01-22 19:01:57', '2018-09-13 01:46:42', '0', '2', '1'), ('8', '潍坊沙县', null, '2018-01-22 19:02:03', '2018-09-13 01:46:43', '0', '7', '1'), ('9', '高新沙县', null, '2018-01-22 19:02:14', '2018-09-13 01:46:44', '1', '8', '1'), ('10', '租户2', null, '2018-11-18 13:27:11', '2018-11-18 13:42:19', '0', '0', '2'), ('11', '院校沙县', null, '2018-12-10 21:19:26', null, '0', '8', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -196,7 +181,7 @@ CREATE TABLE `sys_menu` (
|
||||
-- Records of `sys_menu`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_menu` VALUES ('1000', '权限管理', null, '/upms', '-1', 'icon-quanxianguanli', 'Layout', '0', '0', '0', '2018-09-28 08:29:53', '2018-09-28 08:53:01', '0', '1'), ('1100', '用户管理', null, 'user', '1000', 'icon-yonghuguanli', 'views/admin/user/index', '1', '0', '0', '2017-11-02 22:24:37', '2018-09-28 09:00:41', '0', '1'), ('1101', '用户新增', 'sys_user_add', null, '1100', null, null, null, '0', '1', '2017-11-08 09:52:09', '2018-09-28 09:06:34', '0', '1'), ('1102', '用户修改', 'sys_user_edit', null, '1100', null, null, null, '0', '1', '2017-11-08 09:52:48', '2018-09-28 09:06:37', '0', '1'), ('1103', '用户删除', 'sys_user_del', null, '1100', null, null, null, '0', '1', '2017-11-08 09:54:01', '2018-09-28 09:06:42', '0', '1'), ('1200', '菜单管理', null, 'menu', '1000', 'icon-caidanguanli', 'views/admin/menu/index', '2', '0', '0', '2017-11-08 09:57:27', '2018-09-28 09:00:45', '0', '1'), ('1201', '菜单新增', 'sys_menu_add', null, '1200', null, null, null, '0', '1', '2017-11-08 10:15:53', '2018-09-28 09:07:16', '0', '1'), ('1202', '菜单修改', 'sys_menu_edit', null, '1200', null, null, null, '0', '1', '2017-11-08 10:16:23', '2018-09-28 09:07:18', '0', '1'), ('1203', '菜单删除', 'sys_menu_del', null, '1200', null, null, null, '0', '1', '2017-11-08 10:16:43', '2018-09-28 09:07:22', '0', '1'), ('1300', '角色管理', null, 'role', '1000', 'icon-jiaoseguanli', 'views/admin/role/index', '3', '0', '0', '2017-11-08 10:13:37', '2018-09-28 09:00:48', '0', '1'), ('1301', '角色新增', 'sys_role_add', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:18', '2018-09-28 09:07:46', '0', '1'), ('1302', '角色修改', 'sys_role_edit', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:41', '2018-09-28 09:07:49', '0', '1'), ('1303', '角色删除', 'sys_role_del', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:59', '2018-09-28 09:07:53', '0', '1'), ('1304', '分配权限', 'sys_role_perm', null, '1300', null, null, null, '0', '1', '2018-04-20 07:22:55', '2018-09-28 09:13:23', '0', '1'), ('1400', '部门管理', null, 'dept', '1000', 'icon-web-icon-', 'views/admin/dept/index', '4', '0', '0', '2018-01-20 13:17:19', '2018-12-09 16:35:12', '0', '1'), ('1401', '部门新增', 'sys_dept_add', null, '1400', null, null, null, '0', '1', '2018-01-20 14:56:16', '2018-09-28 09:08:13', '0', '1'), ('1402', '部门修改', 'sys_dept_edit', null, '1400', null, null, null, '0', '1', '2018-01-20 14:56:59', '2018-09-28 09:08:16', '0', '1'), ('1403', '部门删除', 'sys_dept_del', null, '1400', null, null, null, '0', '1', '2018-01-20 14:57:28', '2018-09-28 09:08:18', '0', '1'), ('2000', '系统管理', null, '/admin', '-1', 'icon-xitongguanli', 'Layout', '1', '0', '0', '2017-11-07 20:56:00', '2018-09-28 08:53:18', '0', '1'), ('2100', '日志管理', null, 'log', '2000', 'icon-rizhiguanli', 'views/admin/log/index', '5', '0', '0', '2017-11-20 14:06:22', '2018-09-28 09:01:52', '0', '1'), ('2101', '日志删除', 'sys_log_del', null, '2100', null, null, null, '0', '1', '2017-11-20 20:37:37', '2018-09-28 09:08:44', '0', '1'), ('2200', '字典管理', null, 'dict', '2000', 'icon-navicon-zdgl', 'views/admin/dict/index', '6', '0', '0', '2017-11-29 11:30:52', '2018-09-28 09:01:47', '0', '1'), ('2201', '字典删除', 'sys_dict_del', null, '2200', null, null, null, '0', '1', '2017-11-29 11:30:11', '2018-09-28 09:09:10', '0', '1'), ('2202', '字典新增', 'sys_dict_add', null, '2200', null, null, null, '0', '1', '2018-05-11 22:34:55', '2018-09-28 09:09:12', '0', '1'), ('2203', '字典修改', 'sys_dict_edit', null, '2200', null, null, null, '0', '1', '2018-05-11 22:36:03', '2018-09-28 09:09:16', '0', '1'), ('2300', '代码生成', '', 'gen', '2000', 'icon-weibiaoti46', 'views/gen/index', '8', '0', '0', '2018-01-20 13:17:19', '2018-11-24 05:21:01', '0', '1'), ('2400', '终端管理', '', 'client', '2000', 'icon-shouji', 'views/admin/client/index', '9', '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:01:43', '0', '1'), ('2401', '客户端新增', 'sys_client_add', null, '2400', '1', null, null, '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:10:25', '0', '1'), ('2402', '客户端修改', 'sys_client_edit', null, '2400', null, null, null, '0', '1', '2018-05-15 21:37:06', '2018-09-28 09:10:27', '0', '1'), ('2403', '客户端删除', 'sys_client_del', null, '2400', null, null, null, '0', '1', '2018-05-15 21:39:16', '2018-09-28 09:10:30', '0', '1'), ('2500', '密钥管理', '', 'social', '2000', 'icon-miyue', 'views/admin/social/index', '10', '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:01:41', '0', '1'), ('2501', '密钥新增', 'generator_syssocialdetails_add', null, '2500', '1', null, '0', '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:11:02', '0', '1'), ('2502', '密钥修改', 'generator_syssocialdetails_edit', null, '2500', '1', null, '1', '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:11:04', '0', '1'), ('2503', '密钥删除', 'generator_syssocialdetails_del', null, 'Line truncated
|
||||
INSERT INTO `sys_menu` VALUES ('1000', '权限管理', null, '/upms', '-1', 'icon-quanxianguanli', 'Layout', '0', '0', '0', '2018-09-28 08:29:53', '2018-09-28 08:53:01', '0', '1'), ('1100', '用户管理', null, 'user', '1000', 'icon-yonghuguanli', 'views/admin/user/index', '1', '0', '0', '2017-11-02 22:24:37', '2018-09-28 09:00:41', '0', '1'), ('1101', '用户新增', 'sys_user_add', null, '1100', null, null, null, '0', '1', '2017-11-08 09:52:09', '2018-09-28 09:06:34', '0', '1'), ('1102', '用户修改', 'sys_user_edit', null, '1100', null, null, null, '0', '1', '2017-11-08 09:52:48', '2018-09-28 09:06:37', '0', '1'), ('1103', '用户删除', 'sys_user_del', null, '1100', null, null, null, '0', '1', '2017-11-08 09:54:01', '2018-09-28 09:06:42', '0', '1'), ('1200', '菜单管理', null, 'menu', '1000', 'icon-caidanguanli', 'views/admin/menu/index', '2', '0', '0', '2017-11-08 09:57:27', '2018-09-28 09:00:45', '0', '1'), ('1201', '菜单新增', 'sys_menu_add', null, '1200', null, null, null, '0', '1', '2017-11-08 10:15:53', '2018-09-28 09:07:16', '0', '1'), ('1202', '菜单修改', 'sys_menu_edit', null, '1200', null, null, null, '0', '1', '2017-11-08 10:16:23', '2018-09-28 09:07:18', '0', '1'), ('1203', '菜单删除', 'sys_menu_del', null, '1200', null, null, null, '0', '1', '2017-11-08 10:16:43', '2018-09-28 09:07:22', '0', '1'), ('1300', '角色管理', null, 'role', '1000', 'icon-jiaoseguanli', 'views/admin/role/index', '3', '0', '0', '2017-11-08 10:13:37', '2018-09-28 09:00:48', '0', '1'), ('1301', '角色新增', 'sys_role_add', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:18', '2018-09-28 09:07:46', '0', '1'), ('1302', '角色修改', 'sys_role_edit', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:41', '2018-09-28 09:07:49', '0', '1'), ('1303', '角色删除', 'sys_role_del', null, '1300', null, null, null, '0', '1', '2017-11-08 10:14:59', '2018-09-28 09:07:53', '0', '1'), ('1304', '分配权限', 'sys_role_perm', null, '1300', null, null, null, '0', '1', '2018-04-20 07:22:55', '2018-09-28 09:13:23', '0', '1'), ('1400', '部门管理', null, 'dept', '1000', 'icon-web-icon-', 'views/admin/dept/index', '4', '0', '0', '2018-01-20 13:17:19', '2018-12-09 16:35:12', '0', '1'), ('1401', '部门新增', 'sys_dept_add', null, '1400', null, null, null, '0', '1', '2018-01-20 14:56:16', '2018-09-28 09:08:13', '0', '1'), ('1402', '部门修改', 'sys_dept_edit', null, '1400', null, null, null, '0', '1', '2018-01-20 14:56:59', '2018-09-28 09:08:16', '0', '1'), ('1403', '部门删除', 'sys_dept_del', null, '1400', null, null, null, '0', '1', '2018-01-20 14:57:28', '2018-09-28 09:08:18', '0', '1'), ('2000', '系统管理', null, '/admin', '-1', 'icon-xitongguanli', 'Layout', '1', '0', '0', '2017-11-07 20:56:00', '2018-09-28 08:53:18', '0', '1'), ('2100', '日志管理', null, 'log', '2000', 'icon-rizhiguanli', 'views/admin/log/index', '5', '0', '0', '2017-11-20 14:06:22', '2018-09-28 09:01:52', '0', '1'), ('2101', '日志删除', 'sys_log_del', null, '2100', null, null, null, '0', '1', '2017-11-20 20:37:37', '2018-09-28 09:08:44', '0', '1'), ('2200', '字典管理', null, 'dict', '2000', 'icon-navicon-zdgl', 'views/admin/dict/index', '6', '0', '0', '2017-11-29 11:30:52', '2018-09-28 09:01:47', '0', '1'), ('2201', '字典删除', 'sys_dict_del', null, '2200', null, null, null, '0', '1', '2017-11-29 11:30:11', '2018-09-28 09:09:10', '0', '1'), ('2202', '字典新增', 'sys_dict_add', null, '2200', null, null, null, '0', '1', '2018-05-11 22:34:55', '2018-09-28 09:09:12', '0', '1'), ('2203', '字典修改', 'sys_dict_edit', null, '2200', null, null, null, '0', '1', '2018-05-11 22:36:03', '2018-09-28 09:09:16', '0', '1'), ('2300', '代码生成', '', 'gen', '2000', 'icon-weibiaoti46', 'views/gen/index', '8', '0', '0', '2018-01-20 13:17:19', '2018-11-24 05:21:01', '0', '1'), ('2400', '终端管理', '', 'client', '2000', 'icon-shouji', 'views/admin/client/index', '9', '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:01:43', '0', '1'), ('2401', '客户端新增', 'sys_client_add', null, '2400', '1', null, null, '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:10:25', '0', '1'), ('2402', '客户端修改', 'sys_client_edit', null, '2400', null, null, null, '0', '1', '2018-05-15 21:37:06', '2018-09-28 09:10:27', '0', '1'), ('2403', '客户端删除', 'sys_client_del', null, '2400', null, null, null, '0', '1', '2018-05-15 21:39:16', '2018-09-28 09:10:30', '0', '1'), ('2500', '密钥管理', '', 'social', '2000', 'icon-miyue', 'views/admin/social/index', '10', '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:01:41', '0', '1'), ('2501', '密钥新增', 'generator_syssocialdetails_add', null, '2500', '1', null, '0', '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:11:02', '0', '1'), ('2502', '密钥修改', 'generator_syssocialdetails_edit', null, '2500', '1', null, '1', '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:11:04', '0', '1'), ('2503', '密钥删除', 'generator_syssocialdetails_del', null, 'Line truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -235,19 +220,21 @@ CREATE TABLE `sys_role` (
|
||||
`role_name` varchar(64) COLLATE utf8mb4_bin NOT NULL,
|
||||
`role_code` varchar(64) COLLATE utf8mb4_bin NOT NULL,
|
||||
`role_desc` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
|
||||
`ds_type` char(1) COLLATE utf8mb4_bin NOT NULL DEFAULT '2' COMMENT '数据权限类型',
|
||||
`ds_scope` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '数据权限范围',
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '删除标识(0-正常,1-删除)',
|
||||
`tenant_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`role_id`) USING BTREE,
|
||||
UNIQUE KEY `role_idx1_role_code` (`role_code`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='系统角色表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='系统角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `sys_role`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_role` VALUES ('1', 'admin', 'ROLE_ADMIN', '超级管理员', '2017-10-29 15:45:51', '2018-09-13 01:46:01', '0', '1'), ('2', 'ROLE_CQQ', 'ROLE_CQQ', 'ROLE_CQQ', '2018-11-11 19:42:26', '2018-11-11 20:26:01', '0', '2');
|
||||
INSERT INTO `sys_role` VALUES ('1', '管理员', 'ROLE_ADMIN', '管理员', '2', '2', '2017-10-29 15:45:51', '2018-12-26 14:09:11', '0', '1'), ('2', 'ROLE_CQQ', 'ROLE_CQQ', 'ROLE_CQQ', '2', null, '2018-11-11 19:42:26', '2018-12-26 14:09:07', '0', '2');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -264,7 +251,7 @@ CREATE TABLE `sys_role_menu` (
|
||||
-- Records of `sys_role_menu`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_role_menu` VALUES ('1', '1000'), ('1', '1100'), ('1', '1101'), ('1', '1102'), ('1', '1103'), ('1', '1200'), ('1', '1201'), ('1', '1202'), ('1', '1203'), ('1', '1300'), ('1', '1301'), ('1', '1302'), ('1', '1303'), ('1', '1304'), ('1', '1400'), ('1', '1401'), ('1', '1402'), ('1', '1403'), ('1', '2000'), ('1', '2100'), ('1', '2101'), ('1', '2200'), ('1', '2201'), ('1', '2202'), ('1', '2203'), ('1', '2300'), ('1', '2400'), ('1', '2401'), ('1', '2402'), ('1', '2403'), ('1', '2500'), ('1', '2501'), ('1', '2502'), ('1', '2503'), ('1', '2600'), ('1', '2601'), ('1', '2700'), ('1', '3000'), ('1', '3100'), ('1', '3200'), ('1', '3300'), ('1', '3400'), ('1', '3500'), ('1', '3600'), ('1', '3601'), ('1', '3700'), ('1', '3800'), ('1', '3900'), ('1', '3901'), ('1', '4000'), ('1', '4100'), ('1', '4101'), ('1', '4200'), ('1', '4201'), ('1', '4300'), ('1', '4301'), ('1', '4302'), ('1', '4303'), ('1', '4400'), ('1', '4401'), ('2', '1000'), ('2', '1100'), ('2', '1101'), ('2', '1102'), ('2', '1103'), ('2', '1200'), ('2', '1201'), ('2', '1202'), ('2', '1203'), ('2', '1300'), ('2', '1301'), ('2', '1302'), ('2', '1303'), ('2', '1304'), ('2', '1400'), ('2', '1401'), ('2', '1402'), ('2', '1403');
|
||||
INSERT INTO `sys_role_menu` VALUES ('1', '1000'), ('1', '1100'), ('1', '1101'), ('1', '1102'), ('1', '1103'), ('1', '1200'), ('1', '1201'), ('1', '1202'), ('1', '1203'), ('1', '1300'), ('1', '1301'), ('1', '1302'), ('1', '1303'), ('1', '1304'), ('1', '1400'), ('1', '1401'), ('1', '1402'), ('1', '1403'), ('1', '2000'), ('1', '2100'), ('1', '2101'), ('1', '2200'), ('1', '2201'), ('1', '2202'), ('1', '2203'), ('1', '2300'), ('1', '2400'), ('1', '2401'), ('1', '2402'), ('1', '2403'), ('1', '2500'), ('1', '2501'), ('1', '2502'), ('1', '2503'), ('1', '2600'), ('1', '2601'), ('1', '2700'), ('1', '3000'), ('1', '3100'), ('1', '3200'), ('1', '3300'), ('1', '3400'), ('1', '3500'), ('1', '3600'), ('1', '3601'), ('1', '3700'), ('1', '3800'), ('1', '4000'), ('1', '4100'), ('1', '4101'), ('1', '4200'), ('1', '4201'), ('1', '4300'), ('1', '4301'), ('1', '4302'), ('1', '4303'), ('1', '4400'), ('1', '4401'), ('2', '1000'), ('2', '1100'), ('2', '1101'), ('2', '1102'), ('2', '1103'), ('2', '1200'), ('2', '1201'), ('2', '1202'), ('2', '1203'), ('2', '1300'), ('2', '1301'), ('2', '1302'), ('2', '1303'), ('2', '1304'), ('2', '1400'), ('2', '1401'), ('2', '1402'), ('2', '1403');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -340,13 +327,13 @@ CREATE TABLE `sys_user` (
|
||||
KEY `user_wx_openid` (`wx_openid`) USING BTREE,
|
||||
KEY `user_qq_openid` (`qq_openid`) USING BTREE,
|
||||
KEY `user_idx1_username` (`username`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='用户表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `sys_user`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_user` VALUES ('1', 'admin', '$2a$10$RpFJjxYiXdEsAGnWp/8fsOetMuOON96Ntk/Ym2M/RKRyU0GZseaDC', null, '17034642888', null, '1', '2018-04-20 07:15:18', '2018-11-16 23:31:30', '0', '0', 'o_0FT0uyg_H1vVy2H0JpSwlVGhWQ', null, '1'), ('2', 'admin', '$2a$10$RpFJjxYiXdEsAGnWp/8fsOetMuOON96Ntk/Ym2M/RKRyU0GZseaDC', null, '17034642888', null, '10', '2018-04-20 07:15:18', '2018-11-18 13:43:03', '0', '0', 'o_0FT0uyg_H1vVy2H0JpSwlVGhWQ', null, '2');
|
||||
INSERT INTO `sys_user` VALUES ('1', 'admin', '$2a$10$QOfWxxFyAMmEEmnuw9UI/..1s4B4eF/u9PzE2ZaGO.ij9YfmcUy.u', null, '17034642888', 'lengleng-oxjkuoy361p6x5snlogo.png', '1', '2018-04-20 07:15:18', '2019-01-05 17:11:20', '0', '0', 'o_0FT0uyg_H1vVy2H0JpSwlVGhWQ', null, '1'), ('2', 'admin', '$2a$10$RpFJjxYiXdEsAGnWp/8fsOetMuOON96Ntk/Ym2M/RKRyU0GZseaDC', null, '17034642887', null, '10', '2018-04-20 07:15:18', '2019-01-09 11:06:24', '0', '0', 'o_0FT0uyg_H1vVy2H0JpSwlVGhWQ', null, '2');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
||||
+36
-16
@@ -11,7 +11,7 @@
|
||||
Target Server Version : 50723
|
||||
File Encoding : utf-8
|
||||
|
||||
Date: 12/11/2018 21:39:50 PM
|
||||
Date: 01/09/2019 11:09:48 AM
|
||||
*/
|
||||
USE pigxx_ac;
|
||||
|
||||
@@ -58,8 +58,7 @@ CREATE TABLE `ACT_GE_BYTEARRAY` (
|
||||
-- Records of `ACT_GE_BYTEARRAY`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_GE_BYTEARRAY` VALUES ('12510', '1', '请教流程.bpmn20.xml', '12509', 0x3c3f786d6c2076657273696f6e3d27312e302720656e636f64696e673d275554462d38273f3e0a3c646566696e6974696f6e7320786d6c6e733d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f4d4f44454c2220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e63652220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a61637469766974693d22687474703a2f2f61637469766974692e6f72672f62706d6e2220786d6c6e733a62706d6e64693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f44492220786d6c6e733a6f6d6764633d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44432220786d6c6e733a6f6d6764693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44492220747970654c616e67756167653d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61222065787072657373696f6e4c616e67756167653d22687474703a2f2f7777772e77332e6f72672f313939392f585061746822207461726765744e616d6573706163653d22687474703a2f2f7777772e61637469766974692e6f72672f70726f63657373646566223e0a20203c70726f636573732069643d224c6561766542696c6c22206e616d653d224c6561766542696c6c2220697345786563757461626c653d2274727565223e0a202020203c73746172744576656e742069643d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422206e616d653d22e68f90e4baa4222f3e0a202020203c757365725461736b2069643d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122206e616d653d22e794a8e688b7e68f90e4baa4223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c757365725461736b2069643d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522206e616d653d22e7bb84e995bfe5aea1e689b9223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c656e644576656e742069643d227369642d30353539313044422d314445362d344243342d423532372d32334641373139444532363522206e616d653d22e7bb93e69d9f222f3e0a202020203c73657175656e6365466c6f772069643d227369642d32424346433631362d374438412d343134312d414633462d3841433138454131303044462220736f757263655265663d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441222f3e0a202020203c73657175656e6365466c6f772069643d227369642d45464334383546312d414543392d343536392d423430312d44313644453538463637333722206e616d653d22e5aea1e689b92220736f757263655265663d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122207461726765745265663d227369642d33354144463030362d353743302d343745302d394235422d414634323445304137453445222f3e0a202020203c73657175656e6365466c6f772069643d227369642d38344242323430352d384530322d344442392d384632392d45394242423033324330443922206e616d653d22e9a9b3e59b9e2220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441223e0a2020202020203c636f6e646974696f6e45787072657373696f6e207873693a747970653d2274466f726d616c45787072657373696f6e223e3c215b43444154415b247b666c61672e657175616c732827e9a9b3e59b9e27297d5d5d3e3c2f636f6e646974696f6e45787072657373696f6e3e0a202020203c2f73657175656e6365466c6f773e0a202020203c73657175656e6365466c6f772069643d227369642d36393830363236352d423636302d344239322d423744392d38444532413535433530373922206e616d653d22e5aea1e689b92220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d30353539313044422d314445362d344243342d423532372d323346413731394445323635222f3e0a20203c2f70726f636573733e0a20203c62706d6e64693a42504d4e4469616772616d2069643d2242504d4e4469616772616d5f4c6561766542696c6c223e0a202020203c62706d6e64693a42504d4e506c616e652062706d6e456c656d656e743d224c6561766542696c6c222069643d2242504d4e506c616e655f4c6561766542696c6c223e0a2020202020203c62706d6e64693a42504d4e53686170652062706d6e456c656d656e743d227369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144222069643d2242504d4e53686170655f7369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144223e0a20202020202020203c6f6d6764633a42Line truncated
|
||||
INSERT INTO `ACT_GE_BYTEARRAY` VALUES ('3', '1', 'source-extra', null, '', null);
|
||||
INSERT INTO `ACT_GE_BYTEARRAY` VALUES ('12510', '1', '请教流程.bpmn20.xml', '12509', 0x3c3f786d6c2076657273696f6e3d27312e302720656e636f64696e673d275554462d38273f3e0a3c646566696e6974696f6e7320786d6c6e733d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f4d4f44454c2220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e63652220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a61637469766974693d22687474703a2f2f61637469766974692e6f72672f62706d6e2220786d6c6e733a62706d6e64693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f44492220786d6c6e733a6f6d6764633d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44432220786d6c6e733a6f6d6764693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44492220747970654c616e67756167653d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61222065787072657373696f6e4c616e67756167653d22687474703a2f2f7777772e77332e6f72672f313939392f585061746822207461726765744e616d6573706163653d22687474703a2f2f7777772e61637469766974692e6f72672f70726f63657373646566223e0a20203c70726f636573732069643d224c6561766542696c6c22206e616d653d224c6561766542696c6c2220697345786563757461626c653d2274727565223e0a202020203c73746172744576656e742069643d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422206e616d653d22e68f90e4baa4222f3e0a202020203c757365725461736b2069643d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122206e616d653d22e794a8e688b7e68f90e4baa4223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c757365725461736b2069643d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522206e616d653d22e7bb84e995bfe5aea1e689b9223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c656e644576656e742069643d227369642d30353539313044422d314445362d344243342d423532372d32334641373139444532363522206e616d653d22e7bb93e69d9f222f3e0a202020203c73657175656e6365466c6f772069643d227369642d32424346433631362d374438412d343134312d414633462d3841433138454131303044462220736f757263655265663d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441222f3e0a202020203c73657175656e6365466c6f772069643d227369642d45464334383546312d414543392d343536392d423430312d44313644453538463637333722206e616d653d22e5aea1e689b92220736f757263655265663d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122207461726765745265663d227369642d33354144463030362d353743302d343745302d394235422d414634323445304137453445222f3e0a202020203c73657175656e6365466c6f772069643d227369642d38344242323430352d384530322d344442392d384632392d45394242423033324330443922206e616d653d22e9a9b3e59b9e2220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441223e0a2020202020203c636f6e646974696f6e45787072657373696f6e207873693a747970653d2274466f726d616c45787072657373696f6e223e3c215b43444154415b247b666c61672e657175616c732827e9a9b3e59b9e27297d5d5d3e3c2f636f6e646974696f6e45787072657373696f6e3e0a202020203c2f73657175656e6365466c6f773e0a202020203c73657175656e6365466c6f772069643d227369642d36393830363236352d423636302d344239322d423744392d38444532413535433530373922206e616d653d22e5aea1e689b92220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d30353539313044422d314445362d344243342d423532372d323346413731394445323635222f3e0a20203c2f70726f636573733e0a20203c62706d6e64693a42504d4e4469616772616d2069643d2242504d4e4469616772616d5f4c6561766542696c6c223e0a202020203c62706d6e64693a42504d4e506c616e652062706d6e456c656d656e743d224c6561766542696c6c222069643d2242504d4e506c616e655f4c6561766542696c6c223e0a2020202020203c62706d6e64693a42504d4e53686170652062706d6e456c656d656e743d227369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144222069643d2242504d4e53686170655f7369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144223e0a20202020202020203c6f6d6764633a42Line truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -77,7 +76,7 @@ CREATE TABLE `ACT_GE_PROPERTY` (
|
||||
-- Records of `ACT_GE_PROPERTY`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_GE_PROPERTY` VALUES ('next.dbid', '30001', '13'), ('schema.history', 'create(5.22.0.0)', '1'), ('schema.version', '5.22.0.0', '1');
|
||||
INSERT INTO `ACT_GE_PROPERTY` VALUES ('next.dbid', '32501', '14'), ('schema.history', 'create(5.22.0.0)', '1'), ('schema.version', '5.22.0.0', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -110,7 +109,7 @@ CREATE TABLE `ACT_HI_ACTINST` (
|
||||
-- Records of `ACT_HI_ACTINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_ACTINST` VALUES ('25006', 'LeaveBill:1:25004', '25005', '25005', 'start', null, null, '开始', 'startEvent', null, '2018-12-03 23:52:38.725', '2018-12-03 23:52:38.746', '21', '1'), ('25007', 'LeaveBill:1:25004', '25005', '25005', 'user', '25008', null, '用户提交', 'userTask', null, '2018-12-03 23:52:38.748', '2018-12-03 23:53:40.532', '61784', '1'), ('25014', 'LeaveBill:1:25004', '25005', '25005', 'pm', '25015', null, '组长审批', 'userTask', null, '2018-12-03 23:53:40.532', '2018-12-03 23:54:09.373', '28841', '1'), ('25018', 'LeaveBill:1:25004', '25005', '25005', 'sid-7D3BA0CC-0E14-401A-997B-E5B57798D600', null, null, null, 'exclusiveGateway', null, '2018-12-03 23:54:09.373', '2018-12-03 23:54:09.384', '11', '1'), ('25019', 'LeaveBill:1:25004', '25005', '25005', 'sid-A13A9AA8-CC8F-4B33-8166-EF7757F6ABDB', '25020', null, '人力报备', 'userTask', null, '2018-12-03 23:54:09.384', null, null, '1'), ('25023', 'LeaveBill:1:25004', '25022', '25022', 'start', null, null, '开始', 'startEvent', null, '2018-12-03 23:57:55.883', '2018-12-03 23:57:55.885', '2', '1'), ('25024', 'LeaveBill:1:25004', '25022', '25022', 'user', '25025', null, '用户提交', 'userTask', null, '2018-12-03 23:57:55.885', '2018-12-03 23:58:06.820', '10935', '1'), ('25031', 'LeaveBill:1:25004', '25022', '25022', 'pm', '25032', null, '组长审批', 'userTask', null, '2018-12-03 23:58:06.820', '2018-12-03 23:58:14.514', '7694', '1'), ('25035', 'LeaveBill:1:25004', '25022', '25022', 'sid-7D3BA0CC-0E14-401A-997B-E5B57798D600', null, null, null, 'exclusiveGateway', null, '2018-12-03 23:58:14.514', '2018-12-03 23:58:14.515', '1', '1'), ('25036', 'LeaveBill:1:25004', '25022', '25022', 'sid-D191DB7D-10B8-4AE7-8284-E0931287237C', '25037', null, '经理审批', 'userTask', null, '2018-12-03 23:58:14.515', null, null, '1'), ('27502', 'LeaveBill:1:25004', '27501', '27501', 'start', null, null, '开始', 'startEvent', null, '2018-12-11 13:44:16.165', '2018-12-11 13:44:16.228', '63', '1'), ('27503', 'LeaveBill:1:25004', '27501', '27501', 'user', '27504', null, '用户提交', 'userTask', null, '2018-12-11 13:44:16.230', '2018-12-11 13:45:15.552', '59322', '1'), ('27510', 'LeaveBill:1:25004', '27501', '27501', 'pm', '27511', null, '组长审批', 'userTask', null, '2018-12-11 13:45:15.552', '2018-12-11 13:45:25.721', '10169', '1'), ('27514', 'LeaveBill:1:25004', '27501', '27501', 'sid-7D3BA0CC-0E14-401A-997B-E5B57798D600', null, null, null, 'exclusiveGateway', null, '2018-12-11 13:45:25.721', '2018-12-11 13:45:25.730', '9', '1'), ('27515', 'LeaveBill:1:25004', '27501', '27501', 'sid-A13A9AA8-CC8F-4B33-8166-EF7757F6ABDB', '27516', null, '人力报备', 'userTask', null, '2018-12-11 13:45:25.730', '2018-12-11 13:46:08.285', '42555', '1'), ('27519', 'LeaveBill:1:25004', '27501', '27501', 'sid-BA76EC1F-B75E-4F28-B898-FE0666B681BF', null, null, null, 'endEvent', null, '2018-12-11 13:46:08.285', '2018-12-11 13:46:08.285', '0', '1');
|
||||
INSERT INTO `ACT_HI_ACTINST` VALUES ('30106', 'LeaveBill:1:30104', '30105', '30105', 'start', null, null, '开始', 'startEvent', null, '2018-12-18 22:51:52.599', '2018-12-18 22:51:52.600', '1', '1'), ('30107', 'LeaveBill:1:30104', '30105', '30105', 'user', '30108', null, '用户提交', 'userTask', null, '2018-12-18 22:51:52.600', '2018-12-18 22:52:05.817', '13217', '1'), ('30114', 'LeaveBill:1:30104', '30105', '30105', 'pm', '30115', null, '组长审批', 'userTask', null, '2018-12-18 22:52:05.817', '2018-12-18 22:52:11.607', '5790', '1'), ('30118', 'LeaveBill:1:30104', '30105', '30105', 'user', '30119', null, '用户提交', 'userTask', null, '2018-12-18 22:52:11.607', null, null, '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -153,7 +152,7 @@ CREATE TABLE `ACT_HI_COMMENT` (
|
||||
-- Records of `ACT_HI_COMMENT`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_COMMENT` VALUES ('25011', 'comment', '2018-12-03 23:53:40.481', 'admin', '25008', '25005', 'AddComment', '组长同意', 0xe7bb84e995bfe5908ce6848f), ('25017', 'comment', '2018-12-03 23:54:09.341', 'admin', '25015', '25005', 'AddComment', '组长审批通过', 0xe7bb84e995bfe5aea1e689b9e9809ae8bf87), ('25028', 'comment', '2018-12-03 23:58:06.803', 'admin', '25025', '25022', 'AddComment', '审批', 0xe5aea1e689b9), ('25034', 'comment', '2018-12-03 23:58:14.496', 'admin', '25032', '25022', 'AddComment', '组长同意', 0xe7bb84e995bfe5908ce6848f), ('27507', 'comment', '2018-12-11 13:45:15.210', 'admin', '27504', '27501', 'AddComment', '11111', 0x3131313131), ('27513', 'comment', '2018-12-11 13:45:25.284', 'admin', '27511', '27501', 'AddComment', '2222', 0x32323232), ('27518', 'comment', '2018-12-11 13:46:02.740', 'admin', '27516', '27501', 'AddComment', '3333', 0x33333333);
|
||||
INSERT INTO `ACT_HI_COMMENT` VALUES ('30111', 'comment', '2018-12-18 22:52:05.805', 'admin', '30108', '30105', 'AddComment', '1', 0x31), ('30117', 'comment', '2018-12-18 22:52:11.589', 'admin', '30115', '30105', 'AddComment', '2', 0x32);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -205,7 +204,7 @@ CREATE TABLE `ACT_HI_IDENTITYLINK` (
|
||||
-- Records of `ACT_HI_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_IDENTITYLINK` VALUES ('25009', null, 'candidate', 'admin', '25008', null), ('25010', null, 'participant', 'admin', null, '25005'), ('25016', null, 'candidate', 'admin', '25015', null), ('25021', null, 'candidate', 'admin', '25020', null), ('25026', null, 'candidate', 'admin', '25025', null), ('25027', null, 'participant', 'admin', null, '25022'), ('25033', null, 'candidate', 'admin', '25032', null), ('25038', null, 'candidate', 'admin', '25037', null), ('27505', null, 'candidate', 'admin', '27504', null), ('27506', null, 'participant', 'admin', null, '27501'), ('27512', null, 'candidate', 'admin', '27511', null), ('27517', null, 'candidate', 'admin', '27516', null);
|
||||
INSERT INTO `ACT_HI_IDENTITYLINK` VALUES ('30109', null, 'candidate', 'admin', '30108', null), ('30110', null, 'participant', 'admin', null, '30105'), ('30116', null, 'candidate', 'admin', '30115', null), ('30120', null, 'candidate', 'admin', '30119', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -237,7 +236,7 @@ CREATE TABLE `ACT_HI_PROCINST` (
|
||||
-- Records of `ACT_HI_PROCINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_PROCINST` VALUES ('25005', '25005', 'LeaveBill_17', 'LeaveBill:1:25004', '2018-12-03 23:52:38.725', null, null, null, 'start', null, null, null, '1', null), ('25022', '25022', 'LeaveBill_18', 'LeaveBill:1:25004', '2018-12-03 23:57:55.883', null, null, null, 'start', null, null, null, '1', null), ('27501', '27501', 'LeaveBill_1', 'LeaveBill:1:25004', '2018-12-11 13:44:16.163', '2018-12-11 13:46:08.311', '112148', null, 'start', 'sid-BA76EC1F-B75E-4F28-B898-FE0666B681BF', null, null, '1', null);
|
||||
INSERT INTO `ACT_HI_PROCINST` VALUES ('30105', '30105', 'LeaveBill_6', 'LeaveBill:1:30104', '2018-12-18 22:51:52.599', null, null, null, 'start', null, null, null, '1', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -273,7 +272,7 @@ CREATE TABLE `ACT_HI_TASKINST` (
|
||||
-- Records of `ACT_HI_TASKINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_TASKINST` VALUES ('25008', 'LeaveBill:1:25004', 'user', '25005', '25005', '用户提交', null, null, null, null, '2018-12-03 23:52:38.756', null, '2018-12-03 23:53:40.525', '61769', 'completed', '50', null, null, null, '1'), ('25015', 'LeaveBill:1:25004', 'pm', '25005', '25005', '组长审批', null, null, null, null, '2018-12-03 23:53:40.532', null, '2018-12-03 23:54:09.356', '28824', 'completed', '50', null, null, null, '1'), ('25020', 'LeaveBill:1:25004', 'sid-A13A9AA8-CC8F-4B33-8166-EF7757F6ABDB', '25005', '25005', '人力报备', null, null, null, null, '2018-12-03 23:54:09.384', null, null, null, null, '50', null, null, null, '1'), ('25025', 'LeaveBill:1:25004', 'user', '25022', '25022', '用户提交', null, null, null, null, '2018-12-03 23:57:55.886', null, '2018-12-03 23:58:06.818', '10932', 'completed', '50', null, null, null, '1'), ('25032', 'LeaveBill:1:25004', 'pm', '25022', '25022', '组长审批', null, null, null, null, '2018-12-03 23:58:06.820', null, '2018-12-03 23:58:14.507', '7687', 'completed', '50', null, null, null, '1'), ('25037', 'LeaveBill:1:25004', 'sid-D191DB7D-10B8-4AE7-8284-E0931287237C', '25022', '25022', '经理审批', null, null, null, null, '2018-12-03 23:58:14.515', null, null, null, null, '50', null, null, null, '1'), ('27504', 'LeaveBill:1:25004', 'user', '27501', '27501', '用户提交', null, null, null, null, '2018-12-11 13:44:16.257', null, '2018-12-11 13:45:15.530', '59273', 'completed', '50', null, null, null, '1'), ('27511', 'LeaveBill:1:25004', 'pm', '27501', '27501', '组长审批', null, null, null, null, '2018-12-11 13:45:15.552', null, '2018-12-11 13:45:25.685', '10133', 'completed', '50', null, null, null, '1'), ('27516', 'LeaveBill:1:25004', 'sid-A13A9AA8-CC8F-4B33-8166-EF7757F6ABDB', '27501', '27501', '人力报备', null, null, null, null, '2018-12-11 13:45:25.730', null, '2018-12-11 13:46:08.268', '42538', 'completed', '50', null, null, null, '1');
|
||||
INSERT INTO `ACT_HI_TASKINST` VALUES ('30108', 'LeaveBill:1:30104', 'user', '30105', '30105', '用户提交', null, null, null, null, '2018-12-18 22:51:52.601', null, '2018-12-18 22:52:05.815', '13214', 'completed', '50', null, null, null, '1'), ('30115', 'LeaveBill:1:30104', 'pm', '30105', '30105', '组长审批', null, null, null, null, '2018-12-18 22:52:05.817', null, '2018-12-18 22:52:11.603', '5786', 'completed', '50', null, null, null, '1'), ('30119', 'LeaveBill:1:30104', 'user', '30105', '30105', '用户提交', null, null, null, null, '2018-12-18 22:52:11.607', null, null, null, null, '50', null, null, null, '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -305,7 +304,7 @@ CREATE TABLE `ACT_HI_VARINST` (
|
||||
-- Records of `ACT_HI_VARINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_VARINST` VALUES ('25012', '25005', '25005', null, 'days', 'integer', '1', null, null, '3', '3', null, '2018-12-03 23:53:40.516', '2018-12-03 23:54:09.351'), ('25013', '25005', '25005', null, 'flag', 'string', '1', null, null, null, '审批', null, '2018-12-03 23:53:40.517', '2018-12-03 23:54:09.352'), ('25029', '25022', '25022', null, 'days', 'integer', '1', null, null, '15', '15', null, '2018-12-03 23:58:06.813', '2018-12-03 23:58:14.504'), ('25030', '25022', '25022', null, 'flag', 'string', '1', null, null, null, '审批', null, '2018-12-03 23:58:06.813', '2018-12-03 23:58:14.505'), ('27508', '27501', '27501', null, 'days', 'integer', '2', null, null, '7', '7', null, '2018-12-11 13:45:15.411', '2018-12-11 13:46:08.313'), ('27509', '27501', '27501', null, 'flag', 'string', '2', null, null, null, '审批', null, '2018-12-11 13:45:15.412', '2018-12-11 13:46:08.311');
|
||||
INSERT INTO `ACT_HI_VARINST` VALUES ('30112', '30105', '30105', null, 'days', 'integer', '1', null, null, '11', '11', null, '2018-12-18 22:52:05.813', '2018-12-18 22:52:11.598'), ('30113', '30105', '30105', null, 'flag', 'string', '1', null, null, null, '驳回', null, '2018-12-18 22:52:05.813', '2018-12-18 22:52:11.600');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -398,7 +397,7 @@ CREATE TABLE `ACT_RE_DEPLOYMENT` (
|
||||
-- Records of `ACT_RE_DEPLOYMENT`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_DEPLOYMENT` VALUES ('12509', '请教流程', null, '1', '2018-11-11 01:47:50.296'), ('25001', '请假流程', null, '1', '2018-12-03 23:51:57.877');
|
||||
INSERT INTO `ACT_RE_DEPLOYMENT` VALUES ('12509', '请教流程', null, '1', '2018-11-11 01:47:50.296'), ('30101', '请假流程', null, '1', '2018-12-18 22:50:23.963');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -432,7 +431,7 @@ CREATE TABLE `ACT_RE_MODEL` (
|
||||
-- Records of `ACT_RE_MODEL`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_MODEL` VALUES ('1', '11', '请假流程', 'LeaveBill', 'LeaveBill', '2018-11-10 22:52:35.569', '2018-12-03 23:45:57.654', '1', '{\"name\":\"请假流程\",\"revision\":1,\"description\":\"内置请假流程。\"}', null, '2', '3', '1');
|
||||
INSERT INTO `ACT_RE_MODEL` VALUES ('1', '13', '请假流程', 'LeaveBill', 'LeaveBill', '2018-11-10 22:52:35.569', '2018-12-18 22:47:07.638', '1', '{\"name\":\"请假流程\",\"revision\":1,\"description\":\"内置请假流程。\"}', null, '2', '3', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -462,7 +461,7 @@ CREATE TABLE `ACT_RE_PROCDEF` (
|
||||
-- Records of `ACT_RE_PROCDEF`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_PROCDEF` VALUES ('LeaveBill:1:25004', '2', 'LeaveBill', 'LeaveBill', 'LeaveBill', '1', '25001', '请假流程.bpmn20.xml', '请假流程.LeaveBill.png', null, '0', '1', '1', '1');
|
||||
INSERT INTO `ACT_RE_PROCDEF` VALUES ('LeaveBill:1:30104', '2', 'LeaveBill', 'LeaveBill', 'LeaveBill', '1', '30101', '请假流程.bpmn20.xml', '请假流程.LeaveBill.png', null, '0', '1', '1', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -525,7 +524,7 @@ CREATE TABLE `ACT_RU_EXECUTION` (
|
||||
-- Records of `ACT_RU_EXECUTION`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_EXECUTION` VALUES ('25005', '3', '25005', 'LeaveBill_17', null, 'LeaveBill:1:25004', null, 'sid-A13A9AA8-CC8F-4B33-8166-EF7757F6ABDB', '1', '0', '1', '0', '1', '2', '1', null, null), ('25022', '3', '25022', 'LeaveBill_18', null, 'LeaveBill:1:25004', null, 'sid-D191DB7D-10B8-4AE7-8284-E0931287237C', '1', '0', '1', '0', '1', '2', '1', null, null);
|
||||
INSERT INTO `ACT_RU_EXECUTION` VALUES ('30105', '3', '30105', 'LeaveBill_6', null, 'LeaveBill:1:30104', null, 'user', '1', '0', '1', '0', '1', '2', '1', null, null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -552,6 +551,13 @@ CREATE TABLE `ACT_RU_IDENTITYLINK` (
|
||||
CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `ACT_RU_TASK` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_IDENTITYLINK` VALUES ('30110', '1', null, 'participant', 'admin', null, '30105', null), ('30120', '1', null, 'candidate', 'admin', '30119', null, null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_JOB`
|
||||
-- ----------------------------
|
||||
@@ -613,6 +619,13 @@ CREATE TABLE `ACT_RU_TASK` (
|
||||
CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_TASK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_TASK` VALUES ('30119', '1', '30105', '30105', 'LeaveBill:1:30104', '用户提交', null, null, 'user', null, null, null, '50', '2018-12-18 22:52:11.607', null, null, '1', '1', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_VARIABLE`
|
||||
-- ----------------------------
|
||||
@@ -644,7 +657,7 @@ CREATE TABLE `ACT_RU_VARIABLE` (
|
||||
-- Records of `ACT_RU_VARIABLE`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_VARIABLE` VALUES ('25012', '1', 'integer', 'days', '25005', '25005', null, null, null, '3', '3', null), ('25013', '1', 'string', 'flag', '25005', '25005', null, null, null, null, '审批', null), ('25029', '1', 'integer', 'days', '25022', '25022', null, null, null, '15', '15', null), ('25030', '1', 'string', 'flag', '25022', '25022', null, null, null, null, '审批', null);
|
||||
INSERT INTO `ACT_RU_VARIABLE` VALUES ('30112', '1', 'integer', 'days', '30105', '30105', null, null, null, '11', '11', null), ('30113', '2', 'string', 'flag', '30105', '30105', null, null, null, null, '驳回', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -663,6 +676,13 @@ CREATE TABLE `oa_leave_bill` (
|
||||
`del_flag` char(50) DEFAULT '0' COMMENT '删除标识',
|
||||
`tenant_id` int(11) NOT NULL COMMENT '所属租户',
|
||||
PRIMARY KEY (`leave_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `oa_leave_bill`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `oa_leave_bill` VALUES ('2', 'admin', '16', '2018-12-19 12:00', '1', '2018-12-19 12:00:00', '2018-12-18 22:35:45', '2018-12-18 22:37:13', '0', '1'), ('3', 'admin', '20', '2018-12-22 12:00', '1', '2018-12-22 12:00:00', '2018-12-18 22:41:11', '2018-12-18 22:41:27', '0', '1'), ('4', 'admin', '22', '111', '1', '2018-12-03 12:00:00', '2018-12-18 22:42:45', '2018-12-18 22:42:50', '0', '1'), ('5', 'admin', '20', '11111', '1', '2018-12-12 12:00:00', '2018-12-18 22:45:30', '2018-12-18 22:45:34', '0', '1'), ('6', 'admin', '11', '12', '1', '2018-12-04 12:00:00', '2018-12-18 22:51:19', '2018-12-18 22:51:52', '0', '1');
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+4
-4
@@ -40,19 +40,19 @@ v 1.4.0 提供了代码图形化生成功能。
|
||||
|
||||
1. 代码生成模块
|
||||
|
||||

|
||||

|
||||
|
||||
2. 选择要生成的表
|
||||
|
||||
> 以下为空则从**pigx-codegen/generator.properties** 获取
|
||||
|
||||

|
||||

|
||||
|
||||
3. 解压下载的**pigx_code_gen.zip**
|
||||
|
||||
> 生成代码结构,安装前后端 maven 、vue-cli 目录生成,可以覆盖到指定业务模块
|
||||
|
||||

|
||||

|
||||
|
||||
4. **重点讲解生成的SQL使用**
|
||||
|
||||
@@ -72,7 +72,7 @@ v 1.4.0 提供了代码图形化生成功能。
|
||||
├── 14
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
5. **配置路由**
|
||||
前端 index.js
|
||||
|
||||
+2
-1
@@ -5,9 +5,10 @@ pigx
|
||||
├── pigx-auth -- 授权服务提供[3000]
|
||||
├── pigx-common -- 系统公共模块
|
||||
├ ├── pigx-common-core -- 公共工具类核心包
|
||||
├ ├── pigx-common-cache -- 缓存
|
||||
├ ├── pigx-common-data -- 数据相关
|
||||
├ ├── pigx-common-job -- 定时任务
|
||||
├ ├── pigx-common-log -- 日志服务
|
||||
├ ├── pigx-common-minio -- 文件系统
|
||||
├ └── pigx-common-security -- 安全工具类
|
||||
├ └── pigx-common-swagger -- Swagger Api文档生成
|
||||
├ └── pigx-common-transaction -- 分布式事务工具包
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@
|
||||
|
||||
1. 修改为80
|
||||
|
||||

|
||||

|
||||
|
||||
2. 使用mac 的同学,nginx 代理一下
|
||||
|
||||
@@ -30,11 +30,11 @@ http://daoweicloud.com
|
||||
|
||||
1. 首先使用账号密码登录系统绑定微信
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
2. 绑定后使用退出,使用社交等 选择微信登录即可。
|
||||
|
||||
@@ -46,8 +46,8 @@ http://daoweicloud.com
|
||||
|
||||
1. 选择社交登录 提示回调地址错误。 请使用 http://daoweicloud.com 访问
|
||||
|
||||

|
||||

|
||||
|
||||
1. 选择微信登录提示: 未绑定账户,请使用密码登录后绑定,需要先登录后绑定微信,才可以使用微信
|
||||
|
||||

|
||||

|
||||
+44
-3
@@ -114,7 +114,7 @@ swagger:
|
||||
|
||||
- 通过界面的形式
|
||||
|
||||

|
||||

|
||||
|
||||
- 直接操作**sys_oauth_client_details**表
|
||||
|
||||
@@ -159,9 +159,50 @@ ignore:
|
||||
- test
|
||||
```
|
||||
|
||||
#### 访问swagger-ui页面
|
||||
|
||||
从```1.6.3```版本开始,要求通过```hosts```进行访问,在pigx的默认配置下,可以访问```http://pigx-gateway:9999/swagger-ui.html```打开swagger页面。
|
||||
|
||||
#### 填写客户端信息
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### Swagger FAQ
|
||||
|
||||
- 为何要进行认证的操作?
|
||||
|
||||
认证后Spring Security的上下文对象中才会有值,很多操作如获取当前用户信息都依赖于Spring Security上下文。
|
||||
|
||||
- 刷新页面后认证失效?
|
||||
|
||||
官方UI比较蠢萌,虽然提供了Oauth2.0的认证功能,但是没有存储的措施,所以刷新页面后相关参数就会丢失。解决办法暴力一点的措施是修改官方UI添加存储措施,但是这个我肯定不会了。目前比较可行的就是修改代码进行swagger全局参数配置。
|
||||
|
||||
- 切换swagger分组文档页面报错
|
||||
|
||||

|
||||
|
||||
出现这个问题要么是你对应的服务没有启动,要么是你访问的服务还没有启动完毕,如果还没启动完毕的话,不妨等个十几二十秒再进行访问,最新的master-mp3分支支持在```pigx-gateway-dev.yml```中配置ignore.swagger-providers属性来屏蔽掉不希望生成swaager文档的微服务。
|
||||
|
||||
- 认证过程中出现```Auth ErrorError: Upgrade Required```?
|
||||
|
||||
这个不用怀疑,原因一般不外乎三个。
|
||||
|
||||
一、用户名或密码错误
|
||||
|
||||
可以打开谷歌开发者工具,观察request详情和response详情以及返回的状态码,如果是426的话,就证明获取用户信息的时候失败了,可以判断是作为缓存中间件的redis并没有启动,那么只要启动redis,另一个原因是redis中有脏数据,这个时候清空redis即可。清空的具体步骤如下:
|
||||
|
||||
windows平台下可以打开redis-cli.exe,然后执行```flushdb```或者```flushall```命令即可。
|
||||
|
||||
二、使用了需要验证码的客户端
|
||||
|
||||
除了上面的原因,还有可能返回428的状态码,而会出现这个问题就是使用了需要验证码的客户端。
|
||||
|
||||
三、跨域
|
||||
|
||||
排除所有不可能,剩下的那个不管多不可思议,都是事实真相。除开这两个原因,还有可能会出问题的,只有一种情况,那就是出现了跨域问题。
|
||||
|
||||
如果本地启动出现了问题,可以观察请求头里是否存在跨域,如果是OPTIONS请求基本就是跨域了。
|
||||
|
||||
在目前的项目机制下,开发时解决跨域的最简单的一个方案就是不要通过```http://localhost:9999/swagger-ui.html```或者```http://127.0.0.1:9999/swagger-ui.html```去访问网关上的swagger,而是直接通过```http://pigx-gateway:9999/swagger-ui.html```去访问,这样就能避免跨域的问题。
|
||||
@@ -1,3 +1,8 @@
|
||||
# 使用说明 V2.1.0
|
||||
# 1. 使用docker-compose 宿主机不需要配置host来发现
|
||||
# 2. 无需修改源码,根目录 docker-compose up 即可
|
||||
# 3. 静静等待服务启动
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
pigx-mysql:
|
||||
|
||||
+15
-15
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-auth</artifactId>
|
||||
@@ -42,13 +42,25 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--security-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mysql 驱动-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.connector.version}</version>
|
||||
</dependency>
|
||||
<!--缓存操作-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--JDBC相关-->
|
||||
<dependency>
|
||||
@@ -60,12 +72,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
<!--缓存操作相关-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-cache</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<!--spring security 、oauth、jwt依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -83,12 +89,6 @@
|
||||
<artifactId>spring-security-oauth2</artifactId>
|
||||
<version>${security.oauth.version}</version>
|
||||
</dependency>
|
||||
<!--数据库-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.connector.version}</version>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
+25
-10
@@ -20,8 +20,10 @@
|
||||
package com.pig4cloud.pigx.auth.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.component.PigxWebResponseExceptionTranslator;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxClientDetailsService;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUserDetailsService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -35,6 +37,8 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.A
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.token.DefaultAuthenticationKeyGenerator;
|
||||
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
||||
@@ -68,20 +72,20 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
|
||||
@Override
|
||||
public void configure(AuthorizationServerSecurityConfigurer oauthServer) {
|
||||
oauthServer
|
||||
.allowFormAuthenticationForClients()
|
||||
.checkTokenAccess("isAuthenticated()");
|
||||
.allowFormAuthenticationForClients()
|
||||
.checkTokenAccess("isAuthenticated()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
|
||||
endpoints
|
||||
.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST)
|
||||
.tokenStore(tokenStore())
|
||||
.tokenEnhancer(tokenEnhancer())
|
||||
.userDetailsService(pigxUserDetailsService)
|
||||
.authenticationManager(authenticationManager)
|
||||
.reuseRefreshTokens(false)
|
||||
.exceptionTranslator(new PigxWebResponseExceptionTranslator());
|
||||
.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST)
|
||||
.tokenStore(tokenStore())
|
||||
.tokenEnhancer(tokenEnhancer())
|
||||
.userDetailsService(pigxUserDetailsService)
|
||||
.authenticationManager(authenticationManager)
|
||||
.reuseRefreshTokens(false)
|
||||
.exceptionTranslator(new PigxWebResponseExceptionTranslator());
|
||||
}
|
||||
|
||||
|
||||
@@ -89,13 +93,24 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
|
||||
public TokenStore tokenStore() {
|
||||
RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
|
||||
tokenStore.setPrefix(SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX);
|
||||
tokenStore.setAuthenticationKeyGenerator(new DefaultAuthenticationKeyGenerator() {
|
||||
@Override
|
||||
public String extractKey(OAuth2Authentication authentication) {
|
||||
return super.extractKey(authentication) + ":" + TenantContextHolder.getTenantId();
|
||||
}
|
||||
});
|
||||
return tokenStore;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TokenEnhancer tokenEnhancer() {
|
||||
return (accessToken, authentication) -> {
|
||||
final Map<String, Object> additionalInfo = new HashMap<>(1);
|
||||
final Map<String, Object> additionalInfo = new HashMap<>(8);
|
||||
PigxUser pigxUser = (PigxUser) authentication.getUserAuthentication().getPrincipal();
|
||||
additionalInfo.put("user_id", pigxUser.getId());
|
||||
additionalInfo.put("username", pigxUser.getUsername());
|
||||
additionalInfo.put("dept_id", pigxUser.getDeptId());
|
||||
additionalInfo.put("tenant_id", pigxUser.getTenantId());
|
||||
additionalInfo.put("license", SecurityConstants.PIGX_LICENSE);
|
||||
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
|
||||
return accessToken;
|
||||
|
||||
@@ -22,30 +22,29 @@ package com.pig4cloud.pigx.auth.endpoint;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.data.redis.core.ConvertingCursor;
|
||||
import org.springframework.data.redis.core.Cursor;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ScanOptions;
|
||||
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -58,7 +57,8 @@ import java.util.Map;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/token")
|
||||
public class PigxTokenEndpoint {
|
||||
private static final String PIGX_OAUTH_ACCESS = SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX + "access:";
|
||||
private static final String PIGX_OAUTH_ACCESS = SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX + "auth_to_access:";
|
||||
private static final String PIGX__ACCESS = SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX + "access:";
|
||||
private final TokenStore tokenStore;
|
||||
private final RedisTemplate redisTemplate;
|
||||
private final CacheManager cacheManager;
|
||||
@@ -79,20 +79,26 @@ public class PigxTokenEndpoint {
|
||||
* @param authHeader Authorization
|
||||
*/
|
||||
@DeleteMapping("/logout")
|
||||
public R<Boolean> logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader) {
|
||||
public R logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader) {
|
||||
if (StrUtil.isBlank(authHeader)) {
|
||||
return new R<>(false, "退出失败,token 为空");
|
||||
return R.builder()
|
||||
.code(CommonConstants.FAIL)
|
||||
.data(Boolean.FALSE)
|
||||
.msg("退出失败,token 为空").build();
|
||||
}
|
||||
|
||||
String tokenValue = authHeader.replace("Bearer", "").trim();
|
||||
OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
|
||||
if (accessToken == null || StrUtil.isBlank(accessToken.getValue())) {
|
||||
return new R<>(false, "退出失败,token 无效");
|
||||
return R.builder()
|
||||
.code(CommonConstants.FAIL)
|
||||
.data(Boolean.FALSE)
|
||||
.msg("退出失败,token 无效").build();
|
||||
}
|
||||
|
||||
OAuth2Authentication auth2Authentication = tokenStore.readAuthentication(accessToken);
|
||||
cacheManager.getCache("user_details")
|
||||
.evict(auth2Authentication.getName());
|
||||
.evict(auth2Authentication.getName());
|
||||
tokenStore.removeAccessToken(accessToken);
|
||||
return new R<>(Boolean.TRUE);
|
||||
}
|
||||
@@ -101,15 +107,14 @@ public class PigxTokenEndpoint {
|
||||
* 令牌管理调用
|
||||
*
|
||||
* @param token token
|
||||
* @param from 内部调用标志
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@DeleteMapping("/{token}")
|
||||
public R<Boolean> delToken(@PathVariable("token") String token, @RequestHeader(required = false) String from) {
|
||||
if (StrUtil.isBlank(from)) {
|
||||
return null;
|
||||
}
|
||||
return new R<>(redisTemplate.delete(PIGX_OAUTH_ACCESS + token));
|
||||
public R<Boolean> delToken(@PathVariable("token") String token) {
|
||||
OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(token);
|
||||
tokenStore.removeAccessToken(oAuth2AccessToken);
|
||||
return new R<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,68 +122,24 @@ public class PigxTokenEndpoint {
|
||||
* 查询token
|
||||
*
|
||||
* @param params 分页参数
|
||||
* @param from 标志
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/page")
|
||||
public R<Page> tokenList(@RequestBody Map<String, Object> params, @RequestHeader(required = false) String from) {
|
||||
if (StrUtil.isBlank(from)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
public R<Page> tokenList(@RequestBody Map<String, Object> params) {
|
||||
//根据分页参数获取对应数据
|
||||
List<String> pages = findKeysForPage(PIGX_OAUTH_ACCESS + "*", MapUtil.getInt(params, PaginationConstants.CURRENT), MapUtil.getInt(params, PaginationConstants.SIZE));
|
||||
|
||||
for (String page : pages) {
|
||||
String accessToken = StrUtil.subAfter(page, PIGX_OAUTH_ACCESS, true);
|
||||
OAuth2AccessToken token = tokenStore.readAccessToken(accessToken);
|
||||
Map<String, String> map = new HashMap<>(8);
|
||||
|
||||
|
||||
map.put("token_type", token.getTokenType());
|
||||
map.put("token_value", token.getValue());
|
||||
map.put("expires_in", token.getExpiresIn() + "");
|
||||
|
||||
|
||||
OAuth2Authentication oAuth2Auth = tokenStore.readAuthentication(token);
|
||||
Authentication authentication = oAuth2Auth.getUserAuthentication();
|
||||
|
||||
map.put("client_id", oAuth2Auth.getOAuth2Request().getClientId());
|
||||
map.put("grant_type", oAuth2Auth.getOAuth2Request().getGrantType());
|
||||
|
||||
if (authentication instanceof UsernamePasswordAuthenticationToken) {
|
||||
UsernamePasswordAuthenticationToken authenticationToken = (UsernamePasswordAuthenticationToken) authentication;
|
||||
if (extractToken(map, authenticationToken.getPrincipal())) {
|
||||
continue;
|
||||
}
|
||||
} else if (authentication instanceof PreAuthenticatedAuthenticationToken) {
|
||||
//刷新token方式
|
||||
PreAuthenticatedAuthenticationToken authenticationToken = (PreAuthenticatedAuthenticationToken) authentication;
|
||||
if (extractToken(map, authenticationToken.getPrincipal())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.add(map);
|
||||
}
|
||||
String key = String.format("%s*:%s", PIGX_OAUTH_ACCESS, TenantContextHolder.getTenantId());
|
||||
List<String> pages = findKeysForPage(key, MapUtil.getInt(params, PaginationConstants.CURRENT)
|
||||
, MapUtil.getInt(params, PaginationConstants.SIZE));
|
||||
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
|
||||
Page result = new Page(MapUtil.getInt(params, PaginationConstants.CURRENT), MapUtil.getInt(params, PaginationConstants.SIZE));
|
||||
result.setRecords(list);
|
||||
result.setTotal(Long.valueOf(redisTemplate.keys(PIGX_OAUTH_ACCESS + "*").size()));
|
||||
result.setRecords(redisTemplate.opsForValue().multiGet(pages));
|
||||
result.setTotal(Long.valueOf(redisTemplate.keys(key).size()));
|
||||
return new R<>(result);
|
||||
}
|
||||
|
||||
private boolean extractToken(Map<String, String> map, Object principal) {
|
||||
if (principal instanceof PigxUser) {
|
||||
PigxUser user = (PigxUser) principal;
|
||||
if (!user.getTenantId().equals(TenantContextHolder.getTenantId())) {
|
||||
return true;
|
||||
}
|
||||
map.put("user_id", user.getId() + "");
|
||||
map.put("user_name", user.getUsername() + "");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<String> findKeysForPage(String patternKey, int pageNum, int pageSize) {
|
||||
ScanOptions options = ScanOptions.scanOptions().match(patternKey).build();
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.pigx.common.cache.RedisTemplateConfig,\
|
||||
com.pig4cloud.pigx.common.cache.RedisCacheManagerConfig,\
|
||||
com.pig4cloud.pigx.common.cache.RedisCacheAutoConfiguration
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
@@ -50,12 +50,6 @@
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
|
||||
+7
-2
@@ -80,9 +80,14 @@ public interface CommonConstants {
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
Integer SUCCESS=0;
|
||||
Integer SUCCESS = 0;
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
Integer FAIL=1;
|
||||
Integer FAIL = 1;
|
||||
|
||||
/**
|
||||
* 默认存储bucket
|
||||
*/
|
||||
String BUCKET_NAME = "lengleng";
|
||||
}
|
||||
+8
-4
@@ -24,6 +24,10 @@ package com.pig4cloud.pigx.common.core.constant;
|
||||
* @date 2017-12-18
|
||||
*/
|
||||
public interface SecurityConstants {
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
String REFRESH_TOKEN = "refresh_token";
|
||||
/**
|
||||
* 验证码有效期
|
||||
*/
|
||||
@@ -82,7 +86,7 @@ public interface SecurityConstants {
|
||||
* 微信获取OPENID
|
||||
*/
|
||||
String WX_AUTHORIZATION_CODE_URL = "https://api.weixin.qq.com/sns/oauth2/access_token" +
|
||||
"?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
|
||||
"?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
|
||||
|
||||
/**
|
||||
* {bcrypt} 加密的特征码
|
||||
@@ -92,14 +96,14 @@ public interface SecurityConstants {
|
||||
* sys_oauth_client_details 表的字段,不包括client_id、client_secret
|
||||
*/
|
||||
String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
|
||||
+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
|
||||
+ "refresh_token_validity, additional_information, autoapprove";
|
||||
+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
|
||||
+ "refresh_token_validity, additional_information, autoapprove";
|
||||
|
||||
/**
|
||||
* JdbcClientDetailsService 查询语句
|
||||
*/
|
||||
String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS
|
||||
+ " from sys_oauth_client_details";
|
||||
+ " from sys_oauth_client_details";
|
||||
|
||||
/**
|
||||
* 默认的查询语句
|
||||
|
||||
@@ -24,21 +24,33 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-cache</artifactId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 缓存工具类</description>
|
||||
<description>pigx 数据操作相关</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!--工具类核心包 要从线程中获取租户ID-->
|
||||
<!--工具类核心包-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<!--安全依赖获取上下文信息-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--缓存依赖-->
|
||||
<dependency>
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.cache;
|
||||
package com.pig4cloud.pigx.common.data.cache;
|
||||
|
||||
import org.springframework.dao.PessimisticLockingFailureException;
|
||||
import org.springframework.data.redis.cache.RedisCacheWriter;
|
||||
+7
-6
@@ -15,10 +15,10 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.cache;
|
||||
package com.pig4cloud.pigx.common.data.cache;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.data.redis.cache.RedisCache;
|
||||
@@ -53,20 +53,21 @@ public class RedisAutoCacheManager extends RedisCacheManager {
|
||||
if (StrUtil.isBlank(name) || !name.contains(SPLIT_FLAG)) {
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
|
||||
String[] cacheArray = name.split(SPLIT_FLAG);
|
||||
if (cacheArray.length < CACHE_LENGTH) {
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
String cacheName = cacheArray[0] + ":" + TenantContextHolder.getTenantId();
|
||||
|
||||
if (cacheConfig != null) {
|
||||
long cacheAge = Long.getLong(cacheArray[1], -1);
|
||||
long cacheAge = Long.parseLong(cacheArray[1]);
|
||||
cacheConfig = cacheConfig.entryTtl(Duration.ofSeconds(cacheAge));
|
||||
}
|
||||
return super.createRedisCache(cacheName, cacheConfig);
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cache getCache(String name) {
|
||||
return super.getCache(name + ":" + TenantContextHolder.getTenantId());
|
||||
return super.getCache(name + SPLIT_FLAG + TenantContextHolder.getTenantId());
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.cache;
|
||||
package com.pig4cloud.pigx.common.data.cache;
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
@@ -75,11 +75,9 @@ public class RedisCacheAutoConfiguration {
|
||||
cacheNames.forEach(it -> cacheConfigMap.put(it, cacheConfiguration));
|
||||
initialCaches.putAll(cacheConfigMap);
|
||||
}
|
||||
boolean allowInFlightCacheCreation = true;
|
||||
boolean enableTransactions = false;
|
||||
RedisAutoCacheManager cacheManager = new RedisAutoCacheManager(redisCacheWriter, cacheConfiguration,
|
||||
initialCaches, allowInFlightCacheCreation);
|
||||
cacheManager.setTransactionAware(enableTransactions);
|
||||
initialCaches, true);
|
||||
cacheManager.setTransactionAware(false);
|
||||
return this.customizerInvoker.customize(cacheManager);
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.cache;
|
||||
package com.pig4cloud.pigx.common.data.cache;
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer;
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.cache;
|
||||
package com.pig4cloud.pigx.common.data.cache;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
+3
-2
@@ -15,11 +15,12 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.core.datascope;
|
||||
package com.pig4cloud.pigx.common.data.datascope;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,7 +40,7 @@ public class DataScope extends HashMap {
|
||||
/**
|
||||
* 具体的数据范围
|
||||
*/
|
||||
private List<Integer> deptIds;
|
||||
private List<Integer> deptIds = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 是否只查询本部门
|
||||
+66
-17
@@ -15,12 +15,20 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.core.datascope;
|
||||
package com.pig4cloud.pigx.common.data.datascope;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.Db;
|
||||
import cn.hutool.db.Entity;
|
||||
import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
|
||||
import com.baomidou.mybatisplus.extension.handlers.AbstractSqlParserHandler;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.exception.CheckedException;
|
||||
import com.pig4cloud.pigx.common.data.enums.DataScopeTypeEnum;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.executor.statement.StatementHandler;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
@@ -29,26 +37,29 @@ import org.apache.ibatis.mapping.SqlCommandType;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.apache.ibatis.reflection.SystemMetaObject;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/8/30
|
||||
* @date 2018/12/26
|
||||
* <p>
|
||||
* mybatis 数据权限拦截器
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})})
|
||||
public class DataScopeInterceptor extends AbstractSqlParserHandler implements Interceptor {
|
||||
private final DataSource dataSource;
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
StatementHandler statementHandler = (StatementHandler) PluginUtils.realTarget(invocation.getTarget());
|
||||
StatementHandler statementHandler = PluginUtils.realTarget(invocation.getTarget());
|
||||
MetaObject metaObject = SystemMetaObject.forObject(statementHandler);
|
||||
this.sqlParser(metaObject);
|
||||
// 先判断是不是SELECT操作
|
||||
@@ -63,19 +74,57 @@ public class DataScopeInterceptor extends AbstractSqlParserHandler implements In
|
||||
|
||||
//查找参数中包含DataScope类型的参数
|
||||
DataScope dataScope = findDataScopeObject(parameterObject);
|
||||
|
||||
if (dataScope == null) {
|
||||
return invocation.proceed();
|
||||
} else {
|
||||
String scopeName = dataScope.getScopeName();
|
||||
List<Integer> deptIds = dataScope.getDeptIds();
|
||||
if (StrUtil.isNotBlank(scopeName) && CollectionUtil.isNotEmpty(deptIds)) {
|
||||
String join = CollectionUtil.join(deptIds, ",");
|
||||
originalSql = "select * from (" + originalSql + ") temp_data_scope where temp_data_scope." + scopeName + " in (" + join + ")";
|
||||
metaObject.setValue("delegate.boundSql.sql", originalSql);
|
||||
}
|
||||
return invocation.proceed();
|
||||
}
|
||||
|
||||
String scopeName = dataScope.getScopeName();
|
||||
List<Integer> deptIds = dataScope.getDeptIds();
|
||||
// 优先获取赋值数据
|
||||
if (CollUtil.isEmpty(deptIds)) {
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
if (user == null) {
|
||||
throw new CheckedException("auto datascope, set up security details true");
|
||||
}
|
||||
|
||||
List<String> roleIdList = user.getAuthorities()
|
||||
.stream().map(GrantedAuthority::getAuthority)
|
||||
.filter(authority -> authority.startsWith(SecurityConstants.ROLE))
|
||||
.map(authority -> authority.split("_")[1])
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Entity query = Db.use(dataSource)
|
||||
.query("SELECT * FROM sys_role where role_id IN (" + CollUtil.join(roleIdList, ",") + ")")
|
||||
.stream().min(Comparator.comparingInt(o -> o.getInt("ds_type"))).get();
|
||||
|
||||
Integer dsType = query.getInt("ds_type");
|
||||
// 查询全部
|
||||
if (DataScopeTypeEnum.ALL.getType() == dsType) {
|
||||
return invocation.proceed();
|
||||
}
|
||||
// 自定义
|
||||
if (DataScopeTypeEnum.CUSTOM.getType() == dsType) {
|
||||
String dsScope = query.getStr("ds_scope");
|
||||
deptIds.addAll(Arrays.stream(dsScope.split(","))
|
||||
.map(Integer::parseInt).collect(Collectors.toList()));
|
||||
}
|
||||
// 查询本级及其下级
|
||||
if (DataScopeTypeEnum.OWN_CHILD_LEVEL.getType() == dsType) {
|
||||
List<Integer> deptIdList = Db.use(dataSource)
|
||||
.findBy("sys_dept_relation", "ancestor", user.getDeptId())
|
||||
.stream().map(entity -> entity.getInt("descendant"))
|
||||
.collect(Collectors.toList());
|
||||
deptIds.addAll(deptIdList);
|
||||
}
|
||||
// 只查询本级
|
||||
if (DataScopeTypeEnum.OWN_LEVEL.getType() == dsType) {
|
||||
deptIds.add(user.getDeptId());
|
||||
}
|
||||
}
|
||||
String join = CollectionUtil.join(deptIds, ",");
|
||||
originalSql = "select * from (" + originalSql + ") temp_data_scope where temp_data_scope." + scopeName + " in (" + join + ")";
|
||||
metaObject.setValue("delegate.boundSql.sql", originalSql);
|
||||
return invocation.proceed();
|
||||
}
|
||||
|
||||
/**
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.data.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/12/26
|
||||
* <p>
|
||||
* 数据权限类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DataScopeTypeEnum {
|
||||
/**
|
||||
* 查询全部数据
|
||||
*/
|
||||
ALL(0, "全部"),
|
||||
|
||||
/**
|
||||
* 自定义
|
||||
*/
|
||||
CUSTOM(1, "自定义"),
|
||||
|
||||
/**
|
||||
* 本级及子级
|
||||
*/
|
||||
OWN_CHILD_LEVEL(2, "本级及子级"),
|
||||
|
||||
/**
|
||||
* 本级
|
||||
*/
|
||||
OWN_LEVEL(3, "本级");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final int type;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
}
|
||||
+24
-29
@@ -15,73 +15,68 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.act.config;
|
||||
package com.pig4cloud.pigx.common.data.mybatis;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.core.parser.ISqlParser;
|
||||
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.LongValue;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScopeInterceptor;
|
||||
import com.pig4cloud.pigx.common.data.tenant.PigxTenantHandler;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/9/27
|
||||
* mybatis-plus 配置
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@MapperScan("com.pig4cloud.pigx.act.mapper")
|
||||
public class MybatisPlusConfigurer {
|
||||
@MapperScan("com.pig4cloud.pigx.*.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 分页插件
|
||||
*
|
||||
* @return PaginationInterceptor
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
|
||||
List<ISqlParser> sqlParserList = new ArrayList<>();
|
||||
TenantSqlParser tenantSqlParser = new TenantSqlParser();
|
||||
tenantSqlParser.setTenantHandler(new TenantHandler() {
|
||||
@Override
|
||||
public Expression getTenantId() {
|
||||
Integer tenantId = TenantContextHolder.getTenantId();
|
||||
log.debug("当前租户为 >> {}", tenantId);
|
||||
return new LongValue(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTenantIdColumn() {
|
||||
return "tenant_id";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doTableFilter(String tableName) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
tenantSqlParser.setTenantHandler(new PigxTenantHandler());
|
||||
sqlParserList.add(tenantSqlParser);
|
||||
paginationInterceptor.setSqlParserList(sqlParserList);
|
||||
return paginationInterceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限插件
|
||||
*
|
||||
* @param dataSource 数据源
|
||||
* @return DataScopeInterceptor
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public DataScopeInterceptor dataScopeInterceptor(DataSource dataSource) {
|
||||
return new DataScopeInterceptor(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除插件
|
||||
*
|
||||
* @return LogicSqlInjector
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public ISqlInjector sqlInjector() {
|
||||
return new LogicSqlInjector();
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.security.feign;
|
||||
package com.pig4cloud.pigx.common.data.tenant;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
+1
-2
@@ -15,10 +15,9 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.security.feign;
|
||||
package com.pig4cloud.pigx.common.data.tenant;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.data.tenant;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.LongValue;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018-12-26
|
||||
* <p>
|
||||
* 租户维护处理器
|
||||
*/
|
||||
@Slf4j
|
||||
public class PigxTenantHandler implements TenantHandler {
|
||||
private static final String[] TENANT_TABLES = new String[]{"sys_user", "sys_role", "sys_dept",
|
||||
"sys_log", "sys_social_details", "sys_dict", "sys_log", "oa_leave_bill"};
|
||||
|
||||
/**
|
||||
* 获取租户值
|
||||
*
|
||||
* @return 租户值
|
||||
*/
|
||||
@Override
|
||||
public Expression getTenantId() {
|
||||
Integer tenantId = TenantContextHolder.getTenantId();
|
||||
log.debug("当前租户为 >> {}", tenantId);
|
||||
return new LongValue(tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户字段名
|
||||
*
|
||||
* @return 租户字段名
|
||||
*/
|
||||
@Override
|
||||
public String getTenantIdColumn() {
|
||||
return "tenant_id";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表名判断是否进行过滤
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @return 是否进行过滤
|
||||
*/
|
||||
@Override
|
||||
public boolean doTableFilter(String tableName) {
|
||||
return !ArrayUtil.contains(TENANT_TABLES, tableName);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.core.util;
|
||||
package com.pig4cloud.pigx.common.data.tenant;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import lombok.experimental.UtilityClass;
|
||||
+1
-2
@@ -15,11 +15,10 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.security.filter;
|
||||
package com.pig4cloud.pigx.common.data.tenant;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
@@ -0,0 +1,7 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.pigx.common.data.cache.RedisTemplateConfig,\
|
||||
com.pig4cloud.pigx.common.data.cache.RedisCacheManagerConfig,\
|
||||
com.pig4cloud.pigx.common.data.cache.RedisCacheAutoConfiguration,\
|
||||
com.pig4cloud.pigx.common.data.tenant.TenantContextHolderFilter,\
|
||||
com.pig4cloud.pigx.common.data.tenant.PigxFeignTenantConfiguration,\
|
||||
com.pig4cloud.pigx.common.data.mybatis.MybatisPlusConfig
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-gateway</artifactId>
|
||||
@@ -36,7 +36,7 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
+4
@@ -26,6 +26,7 @@ import org.springframework.cloud.gateway.route.RouteDefinition;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
@@ -51,6 +52,7 @@ public class RedisRouteDefinitionWriter implements RouteDefinitionRepository {
|
||||
RouteDefinitionVo vo = new RouteDefinitionVo();
|
||||
BeanUtils.copyProperties(r, vo);
|
||||
log.info("保存路由信息{}", vo);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.opsForHash().put(CommonConstants.ROUTE_KEY, r.getId(), vo);
|
||||
return Mono.empty();
|
||||
});
|
||||
@@ -60,6 +62,7 @@ public class RedisRouteDefinitionWriter implements RouteDefinitionRepository {
|
||||
public Mono<Void> delete(Mono<String> routeId) {
|
||||
routeId.subscribe(id -> {
|
||||
log.info("删除路由信息{}", id);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.opsForHash().delete(CommonConstants.ROUTE_KEY, id);
|
||||
});
|
||||
return Mono.empty();
|
||||
@@ -73,6 +76,7 @@ public class RedisRouteDefinitionWriter implements RouteDefinitionRepository {
|
||||
*/
|
||||
@Override
|
||||
public Flux<RouteDefinition> getRouteDefinitions() {
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashValueSerializer(new Jackson2JsonRedisSerializer<>(RouteDefinitionVo.class));
|
||||
List<RouteDefinitionVo> values = redisTemplate.opsForHash().values(CommonConstants.ROUTE_KEY);
|
||||
List<RouteDefinition> definitionList = new ArrayList<>();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-job</artifactId>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
@@ -38,13 +38,13 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--UPMS接口模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--安全依赖获取上下文信息-->
|
||||
<dependency>
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-minio</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 文件系统依赖</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+21
-26
@@ -15,39 +15,34 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.codegen.config;
|
||||
package com.pig4cloud.common.minio;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import com.pig4cloud.common.minio.service.MinioTemplate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* minio 自动配置类
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan("com.pig4cloud.pigx.codegen.mapper")
|
||||
public class MybatisPlusConfigurer {
|
||||
/**
|
||||
* 分页插件
|
||||
*
|
||||
* @return PaginationInterceptor
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@EnableConfigurationProperties({MinioProperties.class})
|
||||
public class MinioAutoConfiguration {
|
||||
private final MinioProperties properties;
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
@ConditionalOnMissingBean(MinioTemplate.class)
|
||||
@ConditionalOnProperty(name = "minio.url")
|
||||
MinioTemplate template() {
|
||||
return new MinioTemplate(
|
||||
properties.getUrl(),
|
||||
properties.getAccessKey(),
|
||||
properties.getSecretKey()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除插件
|
||||
*
|
||||
* @return LogicSqlInjector
|
||||
*/
|
||||
@Bean
|
||||
public ISqlInjector sqlInjector() {
|
||||
return new LogicSqlInjector();
|
||||
}
|
||||
}
|
||||
+18
-23
@@ -15,39 +15,34 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.daemon.config;
|
||||
package com.pig4cloud.common.minio;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* minio 配置信息
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@MapperScan("com.pig4cloud.pigx.daemon.mapper")
|
||||
public class MybatisPlusConfigurer {
|
||||
@ConfigurationProperties(prefix = "minio")
|
||||
public class MinioProperties {
|
||||
/**
|
||||
* 分页插件
|
||||
*
|
||||
* @return PaginationInterceptor
|
||||
* minio 服务地址 http://ip:port
|
||||
*/
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 逻辑删除插件
|
||||
*
|
||||
* @return LogicSqlInjector
|
||||
* 用户名
|
||||
*/
|
||||
@Bean
|
||||
public ISqlInjector sqlInjector() {
|
||||
return new LogicSqlInjector();
|
||||
}
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
}
|
||||
Executable
+122
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.common.minio.http;
|
||||
|
||||
import com.pig4cloud.common.minio.service.MinioTemplate;
|
||||
import com.pig4cloud.common.minio.vo.MinioItem;
|
||||
import com.pig4cloud.common.minio.vo.MinioObject;
|
||||
import io.minio.messages.Bucket;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* minio 对外提供服务端点
|
||||
*
|
||||
* @author lengleng
|
||||
* <p>
|
||||
* minio.endpoint.enable
|
||||
*/
|
||||
@ConditionalOnProperty(name = "minio.endpoint.enable", havingValue = "true")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("${minio.endpoint.name:/minio}")
|
||||
public class MinioEndpoint {
|
||||
private final MinioTemplate template;
|
||||
|
||||
/**
|
||||
* Bucket Endpoints
|
||||
*/
|
||||
@PostMapping("/bucket/{bucketName}")
|
||||
public Bucket createBucker(@PathVariable String bucketName) throws Exception {
|
||||
|
||||
template.createBucket(bucketName);
|
||||
return template.getBucket(bucketName).get();
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/bucket")
|
||||
public List<Bucket> getBuckets() throws Exception {
|
||||
return template.getAllBuckets();
|
||||
}
|
||||
|
||||
@GetMapping("/bucket/{bucketName}")
|
||||
public Bucket getBucket(@PathVariable String bucketName) throws Exception {
|
||||
return template.getBucket(bucketName).orElseThrow(() -> new IllegalArgumentException("Bucket Name not found!"));
|
||||
}
|
||||
|
||||
@DeleteMapping("/bucket/{bucketName}")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
public void deleteBucket(@PathVariable String bucketName) throws Exception {
|
||||
|
||||
template.removeBucket(bucketName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Object Endpoints
|
||||
*/
|
||||
|
||||
@PostMapping("/object/{bucketName}")
|
||||
public MinioObject createObject(@RequestBody MultipartFile object, @PathVariable String bucketName) throws Exception {
|
||||
String name = object.getOriginalFilename();
|
||||
template.putObject(bucketName, name, object.getInputStream(), object.getSize(), object.getContentType());
|
||||
return new MinioObject(template.getObjectInfo(bucketName, name));
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/object/{bucketName}/{objectName}")
|
||||
public MinioObject createObject(@RequestBody MultipartFile object, @PathVariable String bucketName, @PathVariable String objectName) throws Exception {
|
||||
template.putObject(bucketName, objectName, object.getInputStream(), object.getSize(), object.getContentType());
|
||||
return new MinioObject(template.getObjectInfo(bucketName, objectName));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/object/{bucketName}/{objectName}")
|
||||
public List<MinioItem> filterObject(@PathVariable String bucketName, @PathVariable String objectName) throws Exception {
|
||||
|
||||
return template.getAllObjectsByPrefix(bucketName, objectName, true);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/object/{bucketName}/{objectName}/{expires}")
|
||||
public Map<String, Object> getObject(@PathVariable String bucketName, @PathVariable String objectName, @PathVariable Integer expires) throws Exception {
|
||||
Map<String, Object> responseBody = new HashMap<>(8);
|
||||
// Put Object info
|
||||
responseBody.put("bucket", bucketName);
|
||||
responseBody.put("object", objectName);
|
||||
responseBody.put("url", template.getObjectURL(bucketName, objectName, expires));
|
||||
responseBody.put("expires", expires);
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
@DeleteMapping("/object/{bucketName}/{objectName}/")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
public void deleteObject(@PathVariable String bucketName, @PathVariable String objectName) throws Exception {
|
||||
|
||||
template.removeObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Executable
+189
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.common.minio.service;
|
||||
|
||||
import com.pig4cloud.common.minio.vo.MinioItem;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.ObjectStat;
|
||||
import io.minio.Result;
|
||||
import io.minio.messages.Bucket;
|
||||
import io.minio.messages.Item;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* minio 交互类
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MinioTemplate {
|
||||
|
||||
private String endpoint;
|
||||
private String accessKey;
|
||||
private String secretKey;
|
||||
|
||||
|
||||
/**
|
||||
* 创建bucket
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#makeBucket
|
||||
*/
|
||||
public void createBucket(String bucketName) throws Exception {
|
||||
MinioClient client = getMinioClient();
|
||||
if (!client.bucketExists(bucketName)) {
|
||||
client.makeBucket(bucketName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部bucket
|
||||
* <p>
|
||||
* https://docs.minio.io/cn/java-client-api-reference.html#listBuckets
|
||||
*/
|
||||
public List<Bucket> getAllBuckets() throws Exception {
|
||||
return getMinioClient().listBuckets();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bucketName bucket名称
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#listBuckets
|
||||
*/
|
||||
public Optional<Bucket> getBucket(String bucketName) throws Exception {
|
||||
return getMinioClient().listBuckets().stream().filter(b -> b.name().equals(bucketName)).findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bucketName bucket名称
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#removeBucket
|
||||
*/
|
||||
public void removeBucket(String bucketName) throws Exception {
|
||||
getMinioClient().removeBucket(bucketName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件前置查询文件
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param prefix 前缀
|
||||
* @param recursive 是否递归查询
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<MinioItem> getAllObjectsByPrefix(String bucketName, String prefix, boolean recursive) throws Exception {
|
||||
List objectList = new ArrayList();
|
||||
Iterable<Result<Item>> objectsIterator = getMinioClient()
|
||||
.listObjects(bucketName, prefix, recursive);
|
||||
|
||||
while (objectsIterator.iterator().hasNext()) {
|
||||
objectList.add(objectsIterator.iterator().next().get());
|
||||
}
|
||||
return objectList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件外链
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @param expires 过期时间 <=7
|
||||
* @return url
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#getObject
|
||||
*/
|
||||
public String getObjectURL(String bucketName, String objectName, Integer expires) throws Exception {
|
||||
return getMinioClient().presignedGetObject(bucketName, objectName, expires);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @return 二进制流
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#getObject
|
||||
*/
|
||||
public InputStream getObject(String bucketName, String objectName) throws Exception {
|
||||
return getMinioClient().getObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @param stream 文件流
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#putObject
|
||||
*/
|
||||
public void putObject(String bucketName, String objectName, InputStream stream) throws Exception {
|
||||
getMinioClient().putObject(bucketName, objectName, stream, stream.available(), "application/octet-stream");
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @param stream 文件流
|
||||
* @param size 大小
|
||||
* @param contextType 类型
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#putObject
|
||||
*/
|
||||
public void putObject(String bucketName, String objectName, InputStream stream, long size, String contextType) throws Exception {
|
||||
getMinioClient().putObject(bucketName, objectName, stream, size, contextType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件信息
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#statObject
|
||||
*/
|
||||
public ObjectStat getObjectInfo(String bucketName, String objectName) throws Exception {
|
||||
return getMinioClient().statObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param bucketName bucket名称
|
||||
* @param objectName 文件名称
|
||||
* @throws Exception https://docs.minio.io/cn/java-client-api-reference.html#removeObject
|
||||
*/
|
||||
public void removeObject(String bucketName, String objectName) throws Exception {
|
||||
getMinioClient().removeObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取minio 原生客户端
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public MinioClient getMinioClient() throws Exception {
|
||||
return new MinioClient(endpoint, accessKey, secretKey);
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.common.minio.vo;
|
||||
|
||||
import io.minio.messages.Item;
|
||||
import io.minio.messages.Owner;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* minio 桶中的对象信息
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MinioItem {
|
||||
|
||||
private String objectName;
|
||||
private Date lastModified;
|
||||
private String etag;
|
||||
private Long size;
|
||||
private String storageClass;
|
||||
private Owner owner;
|
||||
private String type;
|
||||
|
||||
public MinioItem(Item item) {
|
||||
this.objectName = item.objectName();
|
||||
this.lastModified = item.lastModified();
|
||||
this.etag = item.etag();
|
||||
this.size = (long) item.size();
|
||||
this.storageClass = item.storageClass();
|
||||
this.owner = item.owner();
|
||||
this.type = item.isDir() ? "directory" : "file";
|
||||
}
|
||||
}
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.common.minio.vo;
|
||||
|
||||
import io.minio.ObjectStat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 存储对象的元数据
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MinioObject {
|
||||
private String bucketName;
|
||||
private String name;
|
||||
private Date createdTime;
|
||||
private Long length;
|
||||
private String etag;
|
||||
private String contentType;
|
||||
private String matDesc;
|
||||
|
||||
public MinioObject(ObjectStat os) {
|
||||
this.bucketName = os.bucketName();
|
||||
this.name = os.name();
|
||||
this.createdTime = os.createdTime();
|
||||
this.length = os.length();
|
||||
this.etag = os.etag();
|
||||
this.contentType = os.contentType();
|
||||
this.matDesc = os.matDesc();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.common.minio.MinioAutoConfiguration
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
@@ -38,7 +38,7 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--安全模块-->
|
||||
<dependency>
|
||||
@@ -49,7 +49,7 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.security.component;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
import org.springframework.security.authentication.AccountExpiredException;
|
||||
import org.springframework.security.authentication.DisabledException;
|
||||
import org.springframework.security.authentication.LockedException;
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsChecker;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019-01-02
|
||||
*/
|
||||
@Slf4j
|
||||
public class PigxPreAuthenticationChecks implements UserDetailsChecker {
|
||||
private MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
||||
|
||||
@Override
|
||||
public void check(UserDetails user) {
|
||||
if (!user.isAccountNonLocked()) {
|
||||
log.debug("User account is locked");
|
||||
|
||||
throw new LockedException(messages.getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.locked",
|
||||
"User account is locked"));
|
||||
}
|
||||
|
||||
if (!user.isEnabled()) {
|
||||
log.debug("User account is disabled");
|
||||
|
||||
throw new DisabledException(messages.getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.disabled",
|
||||
"User is disabled"));
|
||||
}
|
||||
|
||||
if (!user.isAccountNonExpired()) {
|
||||
log.debug("User account is expired");
|
||||
|
||||
throw new AccountExpiredException(messages.getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.expired",
|
||||
"User account has expired"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -51,9 +51,9 @@ public class ResourceAuthExceptionEntryPoint implements AuthenticationEntryPoint
|
||||
response.setCharacterEncoding(CommonConstants.UTF8);
|
||||
response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
R<String> result = new R<>();
|
||||
result.setCode(HttpStatus.HTTP_UNAUTHORIZED);
|
||||
result.setCode(CommonConstants.FAIL);
|
||||
if (authException != null) {
|
||||
result.setMsg("error");
|
||||
result.setMsg(authException.getMessage());
|
||||
result.setData(authException.getMessage());
|
||||
}
|
||||
response.setStatus(HttpStatus.HTTP_UNAUTHORIZED);
|
||||
|
||||
-1
@@ -86,7 +86,6 @@ public class MobileAuthenticationFilter extends AbstractAuthenticationProcessing
|
||||
authResult = this.getAuthenticationManager().authenticate(mobileAuthenticationToken);
|
||||
|
||||
logger.debug("Authentication success: " + authResult);
|
||||
eventPublisher.publishAuthenticationSuccess(authResult);
|
||||
SecurityContextHolder.getContext().setAuthentication(authResult);
|
||||
|
||||
} catch (Exception failed) {
|
||||
|
||||
+9
-3
@@ -17,6 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.common.security.mobile;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.component.PigxPreAuthenticationChecks;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUserDetailsService;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -28,6 +29,7 @@ import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsChecker;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
@@ -38,6 +40,8 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
@Slf4j
|
||||
public class MobileAuthenticationProvider implements AuthenticationProvider {
|
||||
private MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
||||
private UserDetailsChecker detailsChecker = new PigxPreAuthenticationChecks();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private PigxUserDetailsService userDetailsService;
|
||||
@@ -52,11 +56,13 @@ public class MobileAuthenticationProvider implements AuthenticationProvider {
|
||||
log.debug("Authentication failed: no credentials provided");
|
||||
|
||||
throw new BadCredentialsException(messages.getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.noopBindAccount",
|
||||
"Noop Bind Account"));
|
||||
|
||||
"AbstractUserDetailsAuthenticationProvider.noopBindAccount",
|
||||
"Noop Bind Account"));
|
||||
}
|
||||
|
||||
// 检查账号状态
|
||||
detailsChecker.check(userDetails);
|
||||
|
||||
MobileAuthenticationToken authenticationToken = new MobileAuthenticationToken(userDetails, userDetails.getAuthorities());
|
||||
authenticationToken.setDetails(mobileAuthenticationToken.getDetails());
|
||||
return authenticationToken;
|
||||
|
||||
+14
-4
@@ -27,6 +27,8 @@ import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@@ -48,6 +50,7 @@ import java.util.Set;
|
||||
@AllArgsConstructor
|
||||
public class PigxUserDetailsServiceImpl implements PigxUserDetailsService {
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
/**
|
||||
* 用户密码登录
|
||||
@@ -58,8 +61,15 @@ public class PigxUserDetailsServiceImpl implements PigxUserDetailsService {
|
||||
*/
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
Cache cache = cacheManager.getCache("user_details");
|
||||
if (cache != null && cache.get(username) != null) {
|
||||
return (PigxUser) cache.get(username).get();
|
||||
}
|
||||
|
||||
R<UserInfo> result = remoteUserService.info(username, SecurityConstants.FROM_IN);
|
||||
return getUserDetails(result);
|
||||
UserDetails userDetails = getUserDetails(result);
|
||||
cache.put(username, userDetails);
|
||||
return userDetails;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,12 +106,12 @@ public class PigxUserDetailsServiceImpl implements PigxUserDetailsService {
|
||||
|
||||
}
|
||||
Collection<? extends GrantedAuthority> authorities
|
||||
= AuthorityUtils.createAuthorityList(dbAuthsSet.toArray(new String[0]));
|
||||
= AuthorityUtils.createAuthorityList(dbAuthsSet.toArray(new String[0]));
|
||||
SysUser user = info.getSysUser();
|
||||
boolean enabled = StrUtil.equals(user.getDelFlag(), CommonConstants.STATUS_NORMAL);
|
||||
boolean enabled = StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL);
|
||||
// 构造security用户
|
||||
|
||||
return new PigxUser(user.getUserId(), user.getDeptId(), user.getTenantId(), user.getUsername(), SecurityConstants.BCRYPT + user.getPassword(), enabled,
|
||||
true, true, !CommonConstants.STATUS_LOCK.equals(user.getLockFlag()), authorities);
|
||||
true, true, !CommonConstants.STATUS_LOCK.equals(user.getLockFlag()), authorities);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.pigx.common.security.filter.TenantContextHolderFilter,\
|
||||
com.pig4cloud.pigx.common.security.feign.PigxFeignClientConfiguration,\
|
||||
com.pig4cloud.pigx.common.security.feign.PigxFeignTenantConfiguration,\
|
||||
com.pig4cloud.pigx.common.security.service.PigxUserDetailsServiceImpl
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-transaction</artifactId>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--lcn 模块端控制依赖-->
|
||||
<dependency>
|
||||
|
||||
+3
-2
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common</artifactId>
|
||||
@@ -33,11 +33,12 @@
|
||||
<description>pigx 公共聚合模块</description>
|
||||
|
||||
<modules>
|
||||
<module>pigx-common-cache</module>
|
||||
<module>pigx-common-core</module>
|
||||
<module>pigx-common-data</module>
|
||||
<module>pigx-common-gateway</module>
|
||||
<module>pigx-common-job</module>
|
||||
<module>pigx-common-log</module>
|
||||
<module>pigx-common-minio</module>
|
||||
<module>pigx-common-security</module>
|
||||
<module>pigx-common-swagger</module>
|
||||
<module>pigx-common-transaction</module>
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-config</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@ spring:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
url: jdbc:mysql://pigx-mysql:3306/pigxx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||
url: jdbc:mysql://pigx-mysql:3306/pigxx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
|
||||
freemarker:
|
||||
allow-request-override: false
|
||||
allow-session-override: false
|
||||
|
||||
@@ -33,6 +33,13 @@ swagger:
|
||||
description: 'read all'
|
||||
- scope: 'write'
|
||||
description: 'access all'
|
||||
|
||||
# 文件系统
|
||||
minio:
|
||||
url: http://139.224.200.249:9090
|
||||
access-key: lengleng
|
||||
secret-key: lengleng
|
||||
|
||||
# Logger Config
|
||||
logging:
|
||||
level:
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-eureka</artifactId>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-gateway</artifactId>
|
||||
@@ -46,7 +46,7 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gateway</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--配置中心客户端-->
|
||||
<dependency>
|
||||
@@ -63,13 +63,12 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--缓存-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-cache</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<!--接口文档-->
|
||||
<dependency>
|
||||
|
||||
+5
-5
@@ -61,13 +61,13 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
|
||||
// 终端设置不校验, 直接向下执行(1. 从请求参数中获取 2.从header取)
|
||||
String clientId = request.getQueryParams().getFirst("client_id");
|
||||
if (StrUtil.isNotBlank(clientId)
|
||||
&& filterIgnorePropertiesConfig.getClients().contains(clientId)) {
|
||||
// 刷新token,直接向下执行
|
||||
String grantType = request.getQueryParams().getFirst("grant_type");
|
||||
if (StrUtil.equals(SecurityConstants.REFRESH_TOKEN, grantType)) {
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
|
||||
// 终端设置不校验, 直接向下执行
|
||||
try {
|
||||
String[] clientInfos = WebUtils.getClientId(request);
|
||||
if (filterIgnorePropertiesConfig.getClients().contains(clientInfos[0])) {
|
||||
@@ -83,7 +83,7 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
|
||||
return response.writeWith(Mono.just(response.bufferFactory()
|
||||
.wrap(objectMapper.writeValueAsBytes(
|
||||
R.builder().msg(e.getMessage())
|
||||
.code(CommonConstant.FAIL).build()))));
|
||||
.code(CommonConstants.FAIL).build()))));
|
||||
} catch (JsonProcessingException e1) {
|
||||
log.error("对象输出异常", e1);
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.gateway.handler;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstant;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -51,7 +51,7 @@ public class HystrixFallbackHandler implements HandlerFunction<ServerResponse> {
|
||||
.contentType(MediaType.APPLICATION_JSON_UTF8)
|
||||
.body(BodyInserters.fromObject(R.builder()
|
||||
.msg("服务异常")
|
||||
.code(CommonConstant.FAIL)
|
||||
.code(CommonConstants.FAIL)
|
||||
.build()));
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
@@ -38,7 +38,13 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -21,7 +21,6 @@ package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -58,6 +59,11 @@ public class SysRole extends Model<SysRole> {
|
||||
@NotBlank(message = "角色描述 不能为空")
|
||||
private String roleDesc;
|
||||
|
||||
@NotNull(message = "数据权限类型 不能为空")
|
||||
private Integer dsType;
|
||||
|
||||
private String dsScope;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
|
||||
+2
-4
@@ -37,19 +37,17 @@ public interface RemoteTokenService {
|
||||
* 分页查询token 信息
|
||||
*
|
||||
* @param params 分页参数
|
||||
* @param from 内部调用标志
|
||||
* @return page
|
||||
*/
|
||||
@PostMapping("/token/page")
|
||||
R<Page> getTokenPage(@RequestBody Map<String, Object> params, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
R<Page> getTokenPage(@RequestBody Map<String, Object> params,@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
*
|
||||
* @param token token
|
||||
* @param from 调用标志
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/token/{token}")
|
||||
R<Boolean> removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
R<Boolean> removeTokenById(@PathVariable("token") String token,@RequestHeader(SecurityConstants.FROM) String from);
|
||||
}
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class RemoteTokenServiceFallbackImpl implements RemoteTokenService {
|
||||
* 删除token
|
||||
*
|
||||
* @param token
|
||||
* @param from
|
||||
* @param from 内部调用标志
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-upms-biz</artifactId>
|
||||
@@ -37,25 +37,36 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--日志处理-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--数据库操作-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.connector.version}</version>
|
||||
</dependency>
|
||||
<!--缓存依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-cache</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--swagger-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--文件系统-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-minio</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--eureka 客户端-->
|
||||
<dependency>
|
||||
@@ -71,13 +82,13 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--支持动态路由配置 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gateway</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.config;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.core.parser.ISqlParser;
|
||||
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
|
||||
import com.pig4cloud.pigx.common.core.datascope.DataScopeInterceptor;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.LongValue;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@MapperScan("com.pig4cloud.pigx.admin.mapper")
|
||||
public class MybatisPlusConfigurer {
|
||||
private static final String[] IGNORETABLES = new String[]{"sys_dept_relation", "sys_role_dept", "sys_role_menu", "sys_user_role", "sys_route_conf", "sys_menu"};
|
||||
|
||||
/**
|
||||
* 分页插件
|
||||
*
|
||||
* @return PaginationInterceptor
|
||||
*/
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
|
||||
List<ISqlParser> sqlParserList = new ArrayList<>();
|
||||
TenantSqlParser tenantSqlParser = new TenantSqlParser();
|
||||
tenantSqlParser.setTenantHandler(new TenantHandler() {
|
||||
@Override
|
||||
public Expression getTenantId() {
|
||||
Integer tenantId = TenantContextHolder.getTenantId();
|
||||
log.debug("当前租户为 >> {}", tenantId);
|
||||
return new LongValue(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTenantIdColumn() {
|
||||
return "tenant_id";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doTableFilter(String tableName) {
|
||||
return ArrayUtil.contains(IGNORETABLES, tableName);
|
||||
}
|
||||
});
|
||||
sqlParserList.add(tenantSqlParser);
|
||||
paginationInterceptor.setSqlParserList(sqlParserList);
|
||||
return paginationInterceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限插件
|
||||
*
|
||||
* @return DataScopeInterceptor
|
||||
*/
|
||||
@Bean
|
||||
public DataScopeInterceptor dataScopeInterceptor() {
|
||||
return new DataScopeInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除插件
|
||||
*
|
||||
* @return LogicSqlInjector
|
||||
*/
|
||||
@Bean
|
||||
public ISqlInjector sqlInjector() {
|
||||
return new LogicSqlInjector();
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.common.minio.service.MinioTemplate;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018-12-30
|
||||
* <p>
|
||||
* 文件管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/file")
|
||||
public class FileController {
|
||||
private final MinioTemplate minioTemplate;
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
|
||||
* @param file 资源
|
||||
* @return R(bucketName, filename)
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public R upload(@RequestParam("file") MultipartFile file) {
|
||||
String fileName = IdUtil.simpleUUID()+StrUtil.DOT+ FileUtil.extName(file.getOriginalFilename());
|
||||
Map<String, String> resultMap = new HashMap<>(4);
|
||||
resultMap.put("bucketName", CommonConstants.BUCKET_NAME);
|
||||
resultMap.put("fileName", fileName);
|
||||
|
||||
try {
|
||||
minioTemplate.putObject(CommonConstants.BUCKET_NAME, fileName, file.getInputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("上传失败", e);
|
||||
return R.builder().code(CommonConstants.FAIL)
|
||||
.msg(e.getLocalizedMessage()).build();
|
||||
}
|
||||
return R.builder().data(resultMap).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件
|
||||
*
|
||||
* @param fileName 文件空间/名称
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{fileName}")
|
||||
public void file(@PathVariable String fileName, HttpServletResponse response) {
|
||||
String[] nameArray = StrUtil.split(fileName, StrUtil.DASHED);
|
||||
|
||||
try (InputStream inputStream = minioTemplate.getObject(nameArray[0], nameArray[1])) {
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IoUtil.copy(inputStream, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("文件读取异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -62,12 +62,12 @@ public class MenuController {
|
||||
// 获取符合条件的菜单
|
||||
Set<MenuVO> all = new HashSet<>();
|
||||
SecurityUtils.getRoles()
|
||||
.forEach(roleId -> all.addAll(sysMenuService.findMenuByRoleId(roleId)));
|
||||
.forEach(roleId -> all.addAll(sysMenuService.findMenuByRoleId(roleId)));
|
||||
List<MenuTree> menuTreeList = all.stream()
|
||||
.filter(menuVo -> CommonConstants.MENU.equals(menuVo.getType()))
|
||||
.map(MenuTree::new)
|
||||
.sorted(Comparator.comparingInt(MenuTree::getSort))
|
||||
.collect(Collectors.toList());
|
||||
.filter(menuVo -> CommonConstants.MENU.equals(menuVo.getType()))
|
||||
.map(MenuTree::new)
|
||||
.sorted(Comparator.comparingInt(MenuTree::getSort))
|
||||
.collect(Collectors.toList());
|
||||
return new R<>(TreeUtil.bulid(menuTreeList, -1));
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ public class MenuController {
|
||||
@GetMapping("/tree/{roleId}")
|
||||
public List getRoleTree(@PathVariable Integer roleId) {
|
||||
return sysMenuService.findMenuByRoleId(roleId)
|
||||
.stream()
|
||||
.map(MenuVO::getMenuId)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.map(MenuVO::getMenuId)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ public class MenuController {
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_del')")
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return new R<>(sysMenuService.removeMenuById(id));
|
||||
return sysMenuService.removeMenuById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-2
@@ -31,6 +31,8 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/11/5
|
||||
@@ -63,7 +65,7 @@ public class RoleController {
|
||||
@SysLog("添加角色")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_add')")
|
||||
public R save(@RequestBody SysRole sysRole) {
|
||||
public R save(@Valid @RequestBody SysRole sysRole) {
|
||||
return new R<>(sysRoleService.save(sysRole));
|
||||
}
|
||||
|
||||
@@ -76,7 +78,7 @@ public class RoleController {
|
||||
@SysLog("修改角色")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_edit')")
|
||||
public R update(@RequestBody SysRole sysRole) {
|
||||
public R update(@Valid @RequestBody SysRole sysRole) {
|
||||
return new R<>(sysRoleService.updateById(sysRole));
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -40,7 +40,7 @@ import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/10/28
|
||||
* @date 2018/12/16
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@@ -57,12 +57,12 @@ public class UserController {
|
||||
@GetMapping(value = {"/info"})
|
||||
public R info() {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
SysUser sysUser = userService.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getUsername, username));
|
||||
if (sysUser == null) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return new R<>(Boolean.FALSE, "获取当前用户信息失败");
|
||||
}
|
||||
return new R<>(userService.findUserInfo(sysUser));
|
||||
return new R<>(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ public class UserController {
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getUsername, username));
|
||||
.lambda().eq(SysUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return new R<>(Boolean.FALSE, String.format("用户信息为空 %s", username));
|
||||
}
|
||||
|
||||
+5
-5
@@ -55,14 +55,14 @@ public class SmsLoginHandler extends AbstractLoginHandler {
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String identify) {
|
||||
SysUser sysUser = sysUserService
|
||||
.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getPhone, identify));
|
||||
SysUser user = sysUserService
|
||||
.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getPhone, identify));
|
||||
|
||||
if (sysUser == null) {
|
||||
if (user == null) {
|
||||
log.info("手机号未注册:{}", identify);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(sysUser);
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -75,14 +75,14 @@ public class WeChatLoginHandler extends AbstractLoginHandler {
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String openId) {
|
||||
SysUser sysUser = sysUserService
|
||||
SysUser user = sysUserService
|
||||
.getOne(Wrappers.<SysUser>query()
|
||||
.lambda().eq(SysUser::getWxOpenid, openId));
|
||||
|
||||
if (sysUser == null) {
|
||||
if (user == null) {
|
||||
log.info("微信未绑定:{}", openId);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(sysUser);
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -25,7 +25,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserDTO;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.vo.UserVO;
|
||||
import com.pig4cloud.pigx.common.core.datascope.DataScope;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScope;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ package com.pig4cloud.pigx.admin.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.admin.api.vo.MenuVO;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -49,7 +50,7 @@ public interface SysMenuService extends IService<SysMenu> {
|
||||
* @param id 菜单ID
|
||||
* @return 成功、失败
|
||||
*/
|
||||
Boolean removeMenuById(Integer id);
|
||||
R removeMenuById(Integer id);
|
||||
|
||||
/**
|
||||
* 更新菜单信息
|
||||
|
||||
+16
-12
@@ -19,6 +19,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
@@ -27,6 +28,8 @@ import com.pig4cloud.pigx.admin.api.vo.MenuVO;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysMenuMapper;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysRoleMenuMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysMenuService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -34,7 +37,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -58,20 +60,22 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value = "menu_details", allEntries = true)
|
||||
public Boolean removeMenuById(Integer id) {
|
||||
public R removeMenuById(Integer id) {
|
||||
// 查询父节点为当前节点的节点
|
||||
List<Integer> menuIdList = this.list(Wrappers.<SysMenu>query()
|
||||
.lambda().eq(SysMenu::getParentId, id))
|
||||
.stream().map(SysMenu::getMenuId)
|
||||
.collect(Collectors.toList());
|
||||
List<SysMenu> menuList = this.list(Wrappers.<SysMenu>query()
|
||||
.lambda().eq(SysMenu::getParentId, id));
|
||||
if (CollUtil.isNotEmpty(menuList)) {
|
||||
return R.builder()
|
||||
.code(CommonConstants.FAIL)
|
||||
.msg("菜单含有下级不能删除").build();
|
||||
}
|
||||
|
||||
sysRoleMenuMapper
|
||||
.delete(Wrappers.<SysRoleMenu>query()
|
||||
.lambda().eq(SysRoleMenu::getMenuId, id));
|
||||
|
||||
//删除关联ROLE_MENU 数据
|
||||
menuIdList.add(id);
|
||||
menuIdList.forEach(menu -> sysRoleMenuMapper
|
||||
.delete(Wrappers.<SysRoleMenu>query()
|
||||
.lambda().eq(SysRoleMenu::getMenuId, menu)));
|
||||
//删除当前菜单及其子菜单
|
||||
return this.removeByIds(menuIdList);
|
||||
return new R(this.removeById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+24
-34
@@ -33,15 +33,14 @@ import com.pig4cloud.pigx.admin.api.vo.UserVO;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysUserMapper;
|
||||
import com.pig4cloud.pigx.admin.service.*;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.datascope.DataScope;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScope;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -83,12 +82,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
sysUser.setPassword(ENCODER.encode(userDto.getPassword()));
|
||||
baseMapper.insert(sysUser);
|
||||
List<SysUserRole> userRoleList = userDto.getRole()
|
||||
.stream().map(roleId -> {
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setUserId(sysUser.getUserId());
|
||||
userRole.setRoleId(roleId);
|
||||
return userRole;
|
||||
}).collect(Collectors.toList());
|
||||
.stream().map(roleId -> {
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setUserId(sysUser.getUserId());
|
||||
userRole.setRoleId(roleId);
|
||||
return userRole;
|
||||
}).collect(Collectors.toList());
|
||||
return sysUserRoleService.saveBatch(userRoleList);
|
||||
}
|
||||
|
||||
@@ -99,29 +98,24 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(value = "user_details", key = "#sysUser.username", unless = "#result == null")
|
||||
public UserInfo findUserInfo(SysUser sysUser) {
|
||||
if (sysUser == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setSysUser(sysUser);
|
||||
//设置角色列表 (ID)
|
||||
List<Integer> roleIds = sysRoleService.findRolesByUserId(sysUser.getUserId())
|
||||
.stream()
|
||||
.map(SysRole::getRoleId)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.map(SysRole::getRoleId)
|
||||
.collect(Collectors.toList());
|
||||
userInfo.setRoles(ArrayUtil.toArray(roleIds, Integer.class));
|
||||
|
||||
//设置权限列表(menu.permission)
|
||||
Set<String> permissions = new HashSet<>();
|
||||
roleIds.forEach(roleId -> {
|
||||
List<String> permissionList = sysMenuService.findMenuByRoleId(roleId)
|
||||
.stream()
|
||||
.filter(menuVo -> StringUtils.isNotEmpty(menuVo.getPermission()))
|
||||
.map(MenuVO::getPermission)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.filter(menuVo -> StringUtils.isNotEmpty(menuVo.getPermission()))
|
||||
.map(MenuVO::getPermission)
|
||||
.collect(Collectors.toList());
|
||||
permissions.addAll(permissionList);
|
||||
});
|
||||
userInfo.setPermissions(ArrayUtil.toArray(permissions, String.class));
|
||||
@@ -137,11 +131,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
*/
|
||||
@Override
|
||||
public IPage getUsersWithRolePage(Page page, UserDTO userDTO) {
|
||||
DataScope dataScope = new DataScope();
|
||||
dataScope.setScopeName("deptId");
|
||||
dataScope.setIsOnly(true);
|
||||
dataScope.setDeptIds(getChildDepts());
|
||||
return baseMapper.getUserVosPage(page, userDTO, dataScope);
|
||||
return baseMapper.getUserVosPage(page, userDTO, new DataScope());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +165,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername());
|
||||
SysUser sysUser = new SysUser();
|
||||
if (StrUtil.isNotBlank(userDto.getPassword())
|
||||
&& StrUtil.isNotBlank(userDto.getNewpassword1())) {
|
||||
&& StrUtil.isNotBlank(userDto.getNewpassword1())) {
|
||||
if (ENCODER.matches(userDto.getPassword(), userVO.getPassword())) {
|
||||
sysUser.setPassword(ENCODER.encode(userDto.getNewpassword1()));
|
||||
} else {
|
||||
@@ -202,7 +192,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
this.updateById(sysUser);
|
||||
|
||||
sysUserRoleService.remove(Wrappers.<SysUserRole>update().lambda()
|
||||
.eq(SysUserRole::getUserId, userDto.getUserId()));
|
||||
.eq(SysUserRole::getUserId, userDto.getUserId()));
|
||||
userDto.getRole().forEach(roleId -> {
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setUserId(sysUser.getUserId());
|
||||
@@ -221,7 +211,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
@Override
|
||||
public List<SysUser> listAncestorUsers(String username) {
|
||||
SysUser sysUser = this.getOne(Wrappers.<SysUser>query().lambda()
|
||||
.eq(SysUser::getUsername, username));
|
||||
.eq(SysUser::getUsername, username));
|
||||
|
||||
SysDept sysDept = sysDeptService.getById(sysUser.getDeptId());
|
||||
if (sysDept == null) {
|
||||
@@ -230,7 +220,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
|
||||
Integer parentId = sysDept.getParentId();
|
||||
return this.list(Wrappers.<SysUser>query().lambda()
|
||||
.eq(SysUser::getDeptId, parentId));
|
||||
.eq(SysUser::getDeptId, parentId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,11 +232,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
Integer deptId = SecurityUtils.getUser().getDeptId();
|
||||
//获取当前部门的子部门
|
||||
return sysDeptRelationService
|
||||
.list(Wrappers.<SysDeptRelation>query().lambda()
|
||||
.eq(SysDeptRelation::getAncestor, deptId))
|
||||
.stream()
|
||||
.map(SysDeptRelation::getDescendant)
|
||||
.collect(Collectors.toList());
|
||||
.list(Wrappers.<SysDeptRelation>query().lambda()
|
||||
.eq(SysDeptRelation::getAncestor, deptId))
|
||||
.stream()
|
||||
.map(SysDeptRelation::getDescendant)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
<result column="component" property="component"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="keepalive" property="keepalive"/>
|
||||
<result column="keep_alive" property="keepAlive"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
@@ -47,7 +47,7 @@
|
||||
<result column="path" property="path"/>
|
||||
<result column="component" property="component"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="keepalive" property="keepalive"/>
|
||||
<result column="keep_alive" property="keepAlive"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
<result column="role_name" property="roleName"/>
|
||||
<result column="role_code" property="roleCode"/>
|
||||
<result column="role_desc" property="roleDesc"/>
|
||||
<result column="ds_type" property="dsType"/>
|
||||
<result column="ds_scope" property="dsScope"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.generator.mapper.SysRouteConfMapper">
|
||||
<mapper namespace="com.pig4cloud.pigx.admin.mapper.SysRouteConfMapper">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.pig4cloud.pigx.admin.api.entity.SysRouteConf" id="sysRouteConfMap">
|
||||
|
||||
@@ -21,21 +21,25 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pig4cloud.pigx.admin.mapper.SysUserMapper">
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="baseResultMap" type="com.pig4cloud.pigx.admin.api.entity.SysUser">
|
||||
<resultMap id="baseResultMap" type="com.pig4cloud.pigx.admin.api.vo.UserVO">
|
||||
<id column="user_id" property="userId"/>
|
||||
<result column="username" property="username"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="salt" property="salt"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="avatar" property="avatar"/>
|
||||
<result column="salt" property="salt"/>
|
||||
<result column="dept_id" property="deptId"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="wx_openid" property="wxOpenid"/>
|
||||
<result column="qq_openid" property="qqOpenid"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="ucreate_time" property="createTime"/>
|
||||
<result column="uupdate_time" property="updateTime"/>
|
||||
<result column="lock_flag" property="lockFlag"/>
|
||||
<result column="udel_flag" property="delFlag"/>
|
||||
<result column="deptId" property="deptId"/>
|
||||
<result column="tenantId" property="tenantId"/>
|
||||
<result column="deptName" property="deptName"/>
|
||||
<collection property="roleList" ofType="com.pig4cloud.pigx.admin.api.entity.SysRole"
|
||||
select="com.pig4cloud.pigx.admin.mapper.SysRoleMapper.listRolesByUserId" column="user_id">
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- userVo结果集 -->
|
||||
@@ -135,22 +139,34 @@
|
||||
`user`.user_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getUserVosPage" resultMap="userVoResultMap">
|
||||
<select id="getUserVosPage" resultMap="baseResultMap">
|
||||
SELECT
|
||||
<include refid="userRoleSql"/>
|
||||
`user`.user_id,
|
||||
`user`.username,
|
||||
`user`.`password`,
|
||||
`user`.salt,
|
||||
`user`.phone,
|
||||
`user`.avatar,
|
||||
`user`.wx_openid,
|
||||
`user`.qq_openid,
|
||||
`user`.dept_id,
|
||||
`user`.create_time AS ucreate_time,
|
||||
`user`.update_time AS uupdate_time,
|
||||
`user`.del_flag AS udel_flag,
|
||||
`user`.lock_flag AS lock_flag,
|
||||
`user`.dept_id AS deptId,
|
||||
`user`.tenant_id AS tenantId
|
||||
FROM
|
||||
sys_user AS `user`
|
||||
LEFT JOIN sys_user_role AS ur ON ur.user_id = `user`.user_id
|
||||
LEFT JOIN sys_role AS r ON r.role_id = ur.role_id
|
||||
LEFT JOIN sys_dept AS d ON d.dept_id = `user`.dept_id
|
||||
WHERE
|
||||
r.del_flag = 0
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and `user`.username LIKE CONCAT('%',#{query.username},'%')
|
||||
</if>
|
||||
<if test="query.deptId != null and query.deptId != ''">
|
||||
and `user`.dept_id = #{query.deptId}
|
||||
</if>
|
||||
<where>
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and `user`.username LIKE CONCAT('%',#{query.username},'%')
|
||||
</if>
|
||||
<if test="query.deptId != null and query.deptId != ''">
|
||||
and `user`.dept_id = #{query.deptId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY `user`.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-upms</artifactId>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-visual</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-activiti</artifactId>
|
||||
@@ -41,22 +41,18 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--数据依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.connector.version}</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
@@ -64,13 +60,28 @@
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!-- activiti -->
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter-basic</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.connector.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-modeler</artifactId>
|
||||
@@ -117,12 +128,12 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--undertow容器-->
|
||||
<dependency>
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.pig4cloud.pigx.act.mapper.LeaveBillMapper;
|
||||
import com.pig4cloud.pigx.act.service.ActTaskService;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.TaskStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import cn.hutool.core.util.CharsetUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.pig4cloud.pigx.act.service.EditorService;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
|
||||
+12
-12
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.pig4cloud.pigx.act.service.ModelService;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
@@ -82,8 +82,8 @@ public class ModelServiceImpl implements ModelService {
|
||||
model.setName(name);
|
||||
model.setCategory(category);
|
||||
model.setVersion(Integer.parseInt(
|
||||
String.valueOf(repositoryService.createModelQuery()
|
||||
.modelKey(model.getKey()).count() + 1)));
|
||||
String.valueOf(repositoryService.createModelQuery()
|
||||
.modelKey(model.getKey()).count() + 1)));
|
||||
|
||||
ObjectNode modelObjectNode = objectMapper.createObjectNode();
|
||||
modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, name);
|
||||
@@ -110,8 +110,8 @@ public class ModelServiceImpl implements ModelService {
|
||||
@Override
|
||||
public IPage<Model> getModelPage(Map<String, Object> params) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery()
|
||||
.modelTenantId(String.valueOf(TenantContextHolder.getTenantId()))
|
||||
.latestVersion().orderByLastUpdateTime().desc();
|
||||
.modelTenantId(String.valueOf(TenantContextHolder.getTenantId()))
|
||||
.latestVersion().orderByLastUpdateTime().desc();
|
||||
String category = (String) params.get("category");
|
||||
if (StrUtil.isNotBlank(category)) {
|
||||
modelQuery.modelCategory(category);
|
||||
@@ -158,18 +158,18 @@ public class ModelServiceImpl implements ModelService {
|
||||
}
|
||||
// 部署流程
|
||||
Deployment deployment = repositoryService
|
||||
.createDeployment().name(model.getName())
|
||||
.addBpmnModel(processName, bpmnModel)
|
||||
.tenantId(String.valueOf(TenantContextHolder.getTenantId()))
|
||||
.deploy();
|
||||
.createDeployment().name(model.getName())
|
||||
.addBpmnModel(processName, bpmnModel)
|
||||
.tenantId(String.valueOf(TenantContextHolder.getTenantId()))
|
||||
.deploy();
|
||||
|
||||
// 设置流程分类
|
||||
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery()
|
||||
.deploymentId(deployment.getId())
|
||||
.list();
|
||||
.deploymentId(deployment.getId())
|
||||
.list();
|
||||
|
||||
list.stream().forEach(processDefinition ->
|
||||
repositoryService.setProcessDefinitionCategory(processDefinition.getId(), model.getCategory()));
|
||||
repositoryService.setProcessDefinitionCategory(processDefinition.getId(), model.getCategory()));
|
||||
} catch (Exception e) {
|
||||
log.error("部署失败,异常", e);
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.pig4cloud.pigx.common.core.constant.PaginationConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.ProcessStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.ResourceTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.TaskStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-visual</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-codegen</artifactId>
|
||||
@@ -20,6 +20,12 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-config</artifactId>
|
||||
</dependency>
|
||||
<!--数据操作-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
@@ -35,19 +41,19 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--swagger-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--安全模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--代码生成模板引擎-->
|
||||
<dependency>
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
package ${package}.${moduleName}.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
@@ -26,8 +25,6 @@ import ${package}.${moduleName}.service.${className}Service;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* ${comments}
|
||||
|
||||
@@ -34,8 +34,8 @@ import java.time.LocalDateTime;
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("${tableName}")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ${className} extends Model<${className}> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -17,10 +17,7 @@
|
||||
package ${package}.${moduleName}.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import ${package}.${moduleName}.entity.${className};
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* ${comments}
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
package ${package}.${moduleName}.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import ${package}.${moduleName}.entity.${className};
|
||||
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
*/
|
||||
package ${package}.${moduleName}.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import ${package}.${moduleName}.entity.${className};
|
||||
import ${package}.${moduleName}.mapper.${className}Mapper;
|
||||
import ${package}.${moduleName}.service.${className}Service;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -29,7 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Service("${classname}Service")
|
||||
@Service
|
||||
public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${className}> implements ${className}Service {
|
||||
|
||||
}
|
||||
@@ -25,7 +25,6 @@ export const tableOption = {
|
||||
editBtn: false,
|
||||
delBtn: false,
|
||||
addBtn: false,
|
||||
dic: [],
|
||||
column: [
|
||||
#foreach ($column in $columns)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
-- 该脚本不要执行,请完善 ID 对应关系,注意层级关系 !!!!
|
||||
|
||||
-- 菜单SQL
|
||||
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
values ( '父菜单ID', 'views/${moduleName}/${pathName}/index', '', '0', '${pathName}', 'icon-bangzhushouji', '菜单ID', '0', '2018-01-20 13:17:19', '8', '2018-07-29 13:38:19', '${comments}管理');
|
||||
|
||||
-- 菜单对应按钮SQL
|
||||
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
values ( '菜单ID', null, '${moduleName}_${pathName}_add', '1', null, '1', '子按钮ID1', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '${comments}新增');
|
||||
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
values ( '菜单ID', null, '${moduleName}_${pathName}_edit', '1', null, '1', '子按钮ID2', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改');
|
||||
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
|
||||
values ( '菜单ID', null, '${moduleName}_${pathName}_del', '1', null, '1', '子按钮ID3', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除');
|
||||
@@ -23,7 +23,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-visual</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-daemon</artifactId>
|
||||
@@ -41,12 +41,18 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-job</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--数据库-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
@@ -74,13 +80,13 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!-- 安全模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-visual</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-monitor</artifactId>
|
||||
@@ -36,12 +36,11 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-cache</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<!--监控服务端-->
|
||||
<dependency>
|
||||
|
||||
Loaded 100 of 105 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user