!61 工作流的动态表单、流程模型、流程定义的提交
Merge pull request !61 from 芋道源码/feature/activiti
This commit is contained in:
commit
2a90038080
|
@ -11,12 +11,66 @@
|
|||
Target Server Version : 80026
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 15/12/2021 13:07:09
|
||||
Date: 02/01/2022 19:25:42
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for bpm_form
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `bpm_form`;
|
||||
CREATE TABLE `bpm_form` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单名',
|
||||
`status` tinyint NOT NULL COMMENT '开启状态',
|
||||
`fields` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单项的数组',
|
||||
`conf` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单的配置',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='工作流的表单定义\n';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of bpm_form
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `bpm_form` VALUES (7, '啊1', 1, '[\"{\\\"label\\\":\\\"密码\\\",\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"password\\\",\\\"placeholder\\\":\\\"请输入密码\\\",\\\"span\\\":24,\\\"show-password\\\":true,\\\"labelWidth\\\":null,\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\",\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"formId\\\":102,\\\"renderKey\\\":1640930414772,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field102\\\",\\\"defaultValue\\\":\\\"admin123\\\"}\",\"{\\\"label\\\":\\\"级联选择\\\",\\\"tag\\\":\\\"el-cascader\\\",\\\"tagIcon\\\":\\\"cascader\\\",\\\"placeholder\\\":\\\"请选择级联选择级联选择级联选择\\\",\\\"defaultValue\\\":[],\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"props\\\":{\\\"props\\\":{\\\"multiple\\\":false}},\\\"show-all-levels\\\":true,\\\"disabled\\\":false,\\\"clearable\\\":true,\\\"filterable\\\":false,\\\"required\\\":true,\\\"options\\\":[{\\\"id\\\":1,\\\"value\\\":1,\\\"label\\\":\\\"选项1\\\",\\\"children\\\":[{\\\"id\\\":2,\\\"value\\\":2,\\\"label\\\":\\\"选项1-1\\\"}]}],\\\"dataType\\\":\\\"dynamic\\\",\\\"labelKey\\\":\\\"label\\\",\\\"valueKey\\\":\\\"value\\\",\\\"childrenKey\\\":\\\"children\\\",\\\"separator\\\":\\\"/\\\",\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/cascader\\\",\\\"formId\\\":101,\\\"renderKey\\\":1640960350991,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field101\\\"}\",\"{\\\"label\\\":\\\"生活\\\",\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"input\\\",\\\"placeholder\\\":\\\"请输入生活生活生活\\\",\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\",\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"formId\\\":101,\\\"renderKey\\\":1640930388977,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field101\\\",\\\"defaultValue\\\":\\\"admin\\\"}\"]', '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '哈哈哈哈biu', '1', '2021-12-31 10:10:13', '1', '2021-12-31 14:27:22', b'1');
|
||||
INSERT INTO `bpm_form` VALUES (8, '啊哈哈', 0, '[]', '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '哈哈哈哈', '1', '2021-12-31 10:17:26', '1', '2021-12-31 14:27:20', b'1');
|
||||
INSERT INTO `bpm_form` VALUES (9, '新增', 0, '[\"{\\\"label\\\":\\\"单行文本\\\",\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"input\\\",\\\"placeholder\\\":\\\"请输入单行文本\\\",\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\",\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"formId\\\":101,\\\"renderKey\\\":1640959561705,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field101\\\"}\",\"{\\\"label\\\":\\\"单选框组\\\",\\\"tag\\\":\\\"el-radio-group\\\",\\\"tagIcon\\\":\\\"radio\\\",\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"style\\\":{},\\\"optionType\\\":\\\"default\\\",\\\"border\\\":false,\\\"size\\\":\\\"medium\\\",\\\"disabled\\\":false,\\\"required\\\":true,\\\"options\\\":[{\\\"label\\\":\\\"选项一\\\",\\\"value\\\":1},{\\\"label\\\":\\\"选项二\\\",\\\"value\\\":2}],\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/radio\\\",\\\"formId\\\":102,\\\"renderKey\\\":1640959563240,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field102\\\"}\"]', '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '哈哈哈', '1', '2021-12-31 22:06:11', '1', '2021-12-31 14:27:19', b'1');
|
||||
INSERT INTO `bpm_form` VALUES (10, '11333', 1, '[\"{\\\"label\\\":\\\"多行文本\\\",\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"textarea\\\",\\\"type\\\":\\\"textarea\\\",\\\"placeholder\\\":\\\"请输入多行文本多行文本多行文本\\\",\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"autosize\\\":{\\\"minRows\\\":4,\\\"maxRows\\\":4},\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"formId\\\":101,\\\"renderKey\\\":1640959720587,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field101\\\",\\\"defaultValue\\\":\\\"1111\\\"}\",\"{\\\"label\\\":\\\"滑块\\\",\\\"tag\\\":\\\"el-slider\\\",\\\"tagIcon\\\":\\\"slider\\\",\\\"defaultValue\\\":0,\\\"span\\\":24,\\\"labelWidth\\\":null,\\\"disabled\\\":false,\\\"required\\\":true,\\\"min\\\":0,\\\"max\\\":100,\\\"step\\\":1,\\\"show-stops\\\":false,\\\"range\\\":false,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/slider\\\",\\\"formId\\\":101,\\\"renderKey\\\":1640959732257,\\\"layout\\\":\\\"colFormItem\\\",\\\"vModel\\\":\\\"field101\\\"}\"]', '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"left\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '222211', '1', '2021-12-31 22:08:45', '1', '2021-12-31 14:27:17', b'1');
|
||||
INSERT INTO `bpm_form` VALUES (11, 'biubiu', 0, '[\"{\\\"__config__\\\":{\\\"label\\\":\\\"级联选择\\\",\\\"url\\\":\\\"https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList\\\",\\\"method\\\":\\\"get\\\",\\\"dataPath\\\":\\\"list\\\",\\\"dataConsumer\\\":\\\"options\\\",\\\"showLabel\\\":true,\\\"labelWidth\\\":null,\\\"tag\\\":\\\"el-cascader\\\",\\\"tagIcon\\\":\\\"cascader\\\",\\\"layout\\\":\\\"colFormItem\\\",\\\"defaultValue\\\":[1,2],\\\"dataType\\\":\\\"dynamic\\\",\\\"span\\\":24,\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/cascader\\\",\\\"formId\\\":121,\\\"renderKey\\\":\\\"1211641097528784\\\"},\\\"options\\\":[{\\\"id\\\":1,\\\"value\\\":1,\\\"label\\\":\\\"动态选项1\\\",\\\"children\\\":[{\\\"id\\\":2,\\\"value\\\":2,\\\"label\\\":\\\"动态选项1-1\\\"}]}],\\\"placeholder\\\":\\\"请选择级联选择\\\",\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"props\\\":{\\\"props\\\":{\\\"multiple\\\":false,\\\"label\\\":\\\"label\\\",\\\"value\\\":\\\"value\\\",\\\"children\\\":\\\"children\\\"}},\\\"show-all-levels\\\":true,\\\"disabled\\\":false,\\\"clearable\\\":true,\\\"filterable\\\":false,\\\"separator\\\":\\\"/\\\",\\\"__vModel__\\\":\\\"field121\\\"}\",\"{\\\"__config__\\\":{\\\"label\\\":\\\"多选框组\\\",\\\"tag\\\":\\\"el-checkbox-group\\\",\\\"tagIcon\\\":\\\"checkbox\\\",\\\"defaultValue\\\":[],\\\"span\\\":24,\\\"showLabel\\\":true,\\\"labelWidth\\\":null,\\\"layout\\\":\\\"colFormItem\\\",\\\"optionType\\\":\\\"default\\\",\\\"required\\\":true,\\\"regList\\\":[],\\\"changeTag\\\":true,\\\"border\\\":false,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/checkbox\\\",\\\"formId\\\":122,\\\"renderKey\\\":\\\"1221641097529857\\\"},\\\"__slot__\\\":{\\\"options\\\":[{\\\"label\\\":\\\"选项一\\\",\\\"value\\\":1},{\\\"label\\\":\\\"选项二\\\",\\\"value\\\":2}]},\\\"style\\\":{},\\\"size\\\":\\\"medium\\\",\\\"disabled\\\":false,\\\"__vModel__\\\":\\\"field122\\\"}\"]', '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '嘿嘿', '1', '2022-01-02 12:25:55', '1', '2022-01-02 04:46:41', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for bpm_process_definition
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `bpm_process_definition`;
|
||||
CREATE TABLE `bpm_process_definition` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
`process_definition_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程定义的编号',
|
||||
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
|
||||
`form_id` bigint DEFAULT NULL COMMENT '表单编号',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Bpm 流程定义的拓展表\n';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of bpm_process_definition
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `bpm_process_definition` VALUES (12, 'process1641042089407:5:6d9a655c-6b0b-11ec-bfb7-cacd34981f8e', '', 11, '1', '2022-01-01 22:02:17', '1', '2022-01-01 22:02:17', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for inf_api_access_log
|
||||
-- ----------------------------
|
||||
|
@ -44,7 +98,7 @@ CREATE TABLE `inf_api_access_log` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3282 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='API 访问日志表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7244 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='API 访问日志表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of inf_api_access_log
|
||||
|
@ -86,7 +140,7 @@ CREATE TABLE `inf_api_error_log` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统异常日志';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统异常日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of inf_api_error_log
|
||||
|
@ -119,7 +173,7 @@ CREATE TABLE `inf_config` (
|
|||
-- Records of inf_config
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `inf_config` VALUES (1, 'ui', 1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', b'0', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 'admin', '2021-01-05 17:03:48', '', '2021-01-05 17:03:48', b'0');
|
||||
INSERT INTO `inf_config` VALUES (1, 'ui', 1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', b'0', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 'admin', '2021-01-05 17:03:48', '1', '2021-12-16 07:42:36', b'0');
|
||||
INSERT INTO `inf_config` VALUES (2, 'biz', 1, '用户管理-账号初始密码', 'sys.user.init-password', '123456', b'0', '初始化密码 123456', 'admin', '2021-01-05 17:03:48', '', '2021-04-13 03:48:02', b'0');
|
||||
INSERT INTO `inf_config` VALUES (3, 'ui', 1, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', b'0', '深色主题theme-dark,浅色主题theme-light', 'admin', '2021-01-05 17:03:48', '', '2021-01-19 03:05:21', b'0');
|
||||
INSERT INTO `inf_config` VALUES (4, '1', 2, 'xxx', 'demo.test', '10', b'0', '5', '', '2021-01-19 03:10:26', '', '2021-01-20 09:25:55', b'0');
|
||||
|
@ -714,6 +768,51 @@ INSERT INTO `pay_order_extension` VALUES (99, '20211027131909520645', 120, 9, 'w
|
|||
INSERT INTO `pay_order_extension` VALUES (100, '20211027132205235959', 121, 9, 'wx_pub', '101.82.233.75', 10, '{\"openid\":\"ockUAwIZ-0OeMZl9ogcZ4ILrGba0\"}', '<xml><appid><![CDATA[wx041349c6f39b268b]]></appid>\n<bank_type><![CDATA[OTHERS]]></bank_type>\n<cash_fee><![CDATA[1]]></cash_fee>\n<fee_type><![CDATA[CNY]]></fee_type>\n<is_subscribe><![CDATA[Y]]></is_subscribe>\n<mch_id><![CDATA[1545083881]]></mch_id>\n<nonce_str><![CDATA[1635312125614]]></nonce_str>\n<openid><![CDATA[ockUAwIZ-0OeMZl9ogcZ4ILrGba0]]></openid>\n<out_trade_no><![CDATA[20211027132205235959]]></out_trade_no>\n<result_code><![CDATA[SUCCESS]]></result_code>\n<return_code><![CDATA[SUCCESS]]></return_code>\n<sign><![CDATA[2520FC59696D66565E6B66B62B17FF68]]></sign>\n<time_end><![CDATA[20211027132215]]></time_end>\n<total_fee>1</total_fee>\n<trade_type><![CDATA[JSAPI]]></trade_type>\n<transaction_id><![CDATA[4200001174202110278060590766]]></transaction_id>\n</xml>', NULL, '2021-10-27 13:22:06', NULL, '2021-10-27 13:22:16', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_refund
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_refund`;
|
||||
CREATE TABLE `pay_refund` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '支付退款编号',
|
||||
`req_no` varchar(64) NOT NULL COMMENT '退款单请求号',
|
||||
`merchant_id` bigint NOT NULL COMMENT '商户编号',
|
||||
`app_id` bigint NOT NULL COMMENT '应用编号',
|
||||
`channel_id` bigint NOT NULL COMMENT '渠道编号',
|
||||
`channel_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '渠道编码',
|
||||
`order_id` bigint NOT NULL COMMENT '支付订单编号 pay_order 表id',
|
||||
`trade_no` varchar(64) NOT NULL COMMENT '交易订单号 pay_extension 表no 字段',
|
||||
`merchant_order_id` varchar(64) NOT NULL COMMENT '商户订单编号(商户系统生成)',
|
||||
`merchant_refund_no` varchar(64) NOT NULL COMMENT '商户退款订单号(商户系统生成)',
|
||||
`notify_url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '异步通知商户地址',
|
||||
`notify_status` tinyint NOT NULL COMMENT '通知商户退款结果的回调状态',
|
||||
`status` tinyint NOT NULL COMMENT '退款状态',
|
||||
`type` tinyint NOT NULL COMMENT '退款类型(部分退款,全部退款)',
|
||||
`pay_amount` bigint NOT NULL COMMENT '支付金额,单位分',
|
||||
`refund_amount` bigint NOT NULL COMMENT '退款金额,单位分',
|
||||
`reason` varchar(256) NOT NULL COMMENT '退款原因',
|
||||
`user_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户 IP',
|
||||
`channel_order_no` varchar(64) NOT NULL COMMENT '渠道订单号,pay_order 中的channel_order_no 对应',
|
||||
`channel_refund_no` varchar(64) DEFAULT NULL COMMENT '渠道退款单号,渠道返回',
|
||||
`channel_error_code` varchar(128) DEFAULT NULL COMMENT '渠道调用报错时,错误码',
|
||||
`channel_error_msg` varchar(256) DEFAULT NULL COMMENT '渠道调用报错时,错误信息',
|
||||
`channel_extras` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支付渠道的额外参数',
|
||||
`expire_time` datetime DEFAULT NULL COMMENT '退款失效时间',
|
||||
`success_time` datetime DEFAULT NULL COMMENT '退款成功时间',
|
||||
`notify_time` datetime DEFAULT NULL COMMENT '退款通知时间',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='退款订单';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_refund
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_dept
|
||||
-- ----------------------------
|
||||
|
@ -770,7 +869,7 @@ CREATE TABLE `sys_dict_data` (
|
|||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典数据表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1127 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典数据表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict_data
|
||||
|
@ -857,14 +956,39 @@ INSERT INTO `sys_dict_data` VALUES (88, 2, '婚假', '3', 'oa_leave_type', 0, NU
|
|||
INSERT INTO `sys_dict_data` VALUES (89, 0, '处理中', '1', 'oa_leave_status', 0, NULL, '1', '2021-09-21 22:46:46', '1', '2021-10-12 22:12:20', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (90, 1, '流程结束', '2', 'oa_leave_status', 0, NULL, '1', '2021-09-21 22:47:03', '1', '2021-10-12 22:12:58', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (91, 2, '完成', '3', 'oa_leave_status', 0, NULL, '1', '2021-09-21 22:47:25', '1', '2021-10-12 14:13:06', b'1');
|
||||
INSERT INTO `sys_dict_data` VALUES (92, 1, '启用', '0', 'pay_merchant_status', 0, '商户启用', '1', '2021-11-03 11:30:52', '1', '2021-11-03 11:31:15', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (93, 2, '停用', '1', 'pay_merchant_status', 0, '商户停用', '1', '2021-11-03 11:31:05', '1', '2021-11-03 11:31:05', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (94, 1, '开启', '0', 'pay_app_status', 0, NULL, '1', '2021-11-06 19:42:10', '1', '2021-11-06 19:42:10', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (95, 2, '关闭', '1', 'pay_app_status', 0, NULL, '1', '2021-11-06 19:42:17', '1', '2021-11-06 19:42:17', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (96, 1, '开启', '0', 'pay_channel_status', 0, '开启', '1', '2021-11-08 16:47:45', '1', '2021-11-08 16:47:45', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (97, 2, '关闭', '1', 'pay_channel_status', 0, '关闭', '1', '2021-11-08 16:47:52', '1', '2021-11-08 16:47:52', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (98, 1, 'v2', 'v2', 'pay_channel_wechat_version', 0, 'v2版本', '1', '2021-11-08 17:00:58', '1', '2021-11-08 17:00:58', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (99, 2, 'v3', 'v3', 'pay_channel_wechat_version', 0, 'v3版本', '1', '2021-11-08 17:01:07', '1', '2021-11-08 17:01:07', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (108, 1, 'RSA2', 'RSA2', 'pay_channel_alipay_sign_type', 0, 'RSA2', '1', '2021-11-18 15:39:29', '1', '2021-11-18 15:39:29', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (109, 1, '公钥模式', '1', 'pay_channel_alipay_mode', 0, '公钥模式:privateKey + alipayPublicKey', '1', '2021-11-18 15:45:23', '1', '2021-11-18 15:45:23', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (110, 2, '证书模式', '2', 'pay_channel_alipay_mode', 0, '证书模式:appCertContent + alipayPublicCertContent + rootCertContent', '1', '2021-11-18 15:45:40', '1', '2021-11-18 15:45:40', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (111, 1, '线上', 'https://openapi.alipay.com/gateway.do', 'pay_channel_alipay_server_type', 0, '网关地址 - 线上', '1', '2021-11-18 16:59:32', '1', '2021-11-21 17:37:29', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (112, 2, '沙箱', 'https://openapi.alipaydev.com/gateway.do', 'pay_channel_alipay_server_type', 0, '网关地址 - 沙箱', '1', '2021-11-18 16:59:48', '1', '2021-11-21 17:37:39', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (113, 1, '微信 JSAPI 支付', 'wx_pub', 'pay_channel_code_type', 0, '微信 JSAPI(公众号) 支付', '1', '2021-12-03 10:40:24', '1', '2021-12-04 16:41:00', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (114, 2, '微信小程序支付', 'wx_lite', 'pay_channel_code_type', 0, '微信小程序支付', '1', '2021-12-03 10:41:06', '1', '2021-12-03 10:41:06', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (115, 3, '微信 App 支付', 'wx_app', 'pay_channel_code_type', 0, '微信 App 支付', '1', '2021-12-03 10:41:20', '1', '2021-12-03 10:41:20', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (116, 4, '支付宝 PC 网站支付', 'alipay_pc', 'pay_channel_code_type', 0, '支付宝 PC 网站支付', '1', '2021-12-03 10:42:09', '1', '2021-12-03 10:42:09', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (117, 5, '支付宝 Wap 网站支付', 'alipay_wap', 'pay_channel_code_type', 0, '支付宝 Wap 网站支付', '1', '2021-12-03 10:42:26', '1', '2021-12-03 10:42:26', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (118, 6, '支付宝App 支付', 'alipay_app', 'pay_channel_code_type', 0, '支付宝App 支付', '1', '2021-12-03 10:42:55', '1', '2021-12-03 10:42:55', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (119, 7, '支付宝扫码支付', 'alipay_qr', 'pay_channel_code_type', 0, '支付宝扫码支付', '1', '2021-12-03 10:43:10', '1', '2021-12-03 10:43:10', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (120, 1, '通知成功', '10', 'pay_order_notify_status', 0, '通知成功', '1', '2021-12-03 11:02:41', '1', '2021-12-03 11:02:41', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (121, 2, '通知失败', '20', 'pay_order_notify_status', 0, '通知失败', '1', '2021-12-03 11:02:59', '1', '2021-12-03 11:02:59', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (122, 3, '未通知', '0', 'pay_order_notify_status', 0, '未通知', '1', '2021-12-03 11:03:10', '1', '2021-12-03 11:03:10', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (123, 1, '支付成功', '10', 'pay_order_status', 0, '支付成功', '1', '2021-12-03 11:18:29', '1', '2021-12-03 11:28:32', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (124, 2, '支付关闭', '20', 'pay_order_status', 0, '支付关闭', '1', '2021-12-03 11:18:42', '1', '2021-12-03 11:28:34', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (125, 3, '未支付', '0', 'pay_order_status', 0, '未支付', '1', '2021-12-03 11:18:18', '1', '2021-12-03 11:28:36', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (126, 1, '未退款', '0', 'pay_order_refund_status', 0, '未退款', '1', '2021-12-03 11:30:35', '1', '2021-12-03 11:34:05', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (127, 2, '部分退款', '10', 'pay_order_refund_status', 0, '部分退款', '1', '2021-12-03 11:30:44', '1', '2021-12-03 11:34:10', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (128, 3, '全部退款', '20', 'pay_order_refund_status', 0, '全部退款', '1', '2021-12-03 11:30:52', '1', '2021-12-03 11:34:14', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1117, 1, '退款订单生成', '0', 'pay_refund_order_status', 0, '退款订单生成', '1', '2021-12-10 16:44:44', '1', '2021-12-10 16:44:44', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1118, 2, '退款成功', '1', 'pay_refund_order_status', 0, '退款成功', '1', '2021-12-10 16:44:59', '1', '2021-12-10 16:44:59', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1119, 3, '退款失败', '2', 'pay_refund_order_status', 0, '退款失败', '1', '2021-12-10 16:45:10', '1', '2021-12-10 16:45:10', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1120, 4, '退款中, 渠道通知结果', '3', 'pay_refund_order_status', 0, '退款中, 渠道通知结果', '1', '2021-12-10 16:45:32', '1', '2021-12-10 16:45:32', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1121, 5, '退款中, 系统查询结果', '4', 'pay_refund_order_status', 0, '退款中, 系统查询结果', '1', '2021-12-10 16:45:48', '1', '2021-12-10 16:45:48', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1122, 6, '状态未知,需要重试', '5', 'pay_refund_order_status', 0, '状态未知,需要重试', '1', '2021-12-10 16:46:03', '1', '2021-12-10 16:46:03', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1123, 7, '状态未知,系统查询结果', '6', 'pay_refund_order_status', 0, '状态未知,系统查询结果', '1', '2021-12-10 16:46:13', '1', '2021-12-10 16:46:13', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1124, 8, '退款关闭', '99', 'pay_refund_order_status', 0, '退款关闭', '1', '2021-12-10 16:46:26', '1', '2021-12-10 16:46:26', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1125, 0, '默认', '1', 'bpm_model_category', 0, '流程分类 - 默认', '1', '2022-01-02 08:41:11', '1', '2022-01-02 08:41:11', b'0');
|
||||
INSERT INTO `sys_dict_data` VALUES (1126, 0, 'OA', '2', 'bpm_model_category', 0, '流程分类 - OA', '1', '2022-01-02 08:41:22', '1', '2022-01-02 08:41:22', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -884,7 +1008,7 @@ CREATE TABLE `sys_dict_type` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `dict_type` (`type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典类型表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典类型表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict_type
|
||||
|
@ -915,10 +1039,18 @@ INSERT INTO `sys_dict_type` VALUES (115, '错误码的类型', 'sys_error_code_t
|
|||
INSERT INTO `sys_dict_type` VALUES (116, '登陆日志的类型', 'sys_login_type', 0, '登陆日志的类型', '1', '2021-10-06 00:50:46', '1', '2021-10-06 00:50:46', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (117, '请假类型', 'oa_leave_type', 0, NULL, '1', '2021-09-21 22:34:33', '1', '2021-09-21 15:00:38', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (118, '请假流程状态', 'oa_leave_status', 0, NULL, '1', '2021-09-21 22:46:04', '1', '2021-09-21 15:00:38', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (119, '商户状态', 'pay_merchant_status', 0, '商户的启用于停用状态', '1', '2021-11-03 11:29:04', '1', '2021-11-03 11:29:04', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (120, '支付应用状态', 'pay_app_status', 0, '支付应用的启停状态', '1', '2021-11-06 19:41:50', '1', '2021-11-06 19:41:50', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (121, '支付渠道状态', 'pay_channel_status', 0, '支付渠道的启停状态', '1', '2021-11-08 16:47:21', '1', '2021-11-08 16:47:21', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (122, '支付渠道微信版本', 'pay_channel_wechat_version', 0, '支付渠道微信版本', '1', '2021-11-08 17:00:26', '1', '2021-11-08 17:00:26', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (127, '支付渠道支付宝算法类型', 'pay_channel_alipay_sign_type', 0, '支付渠道支付宝算法类型', '1', '2021-11-18 15:39:09', '1', '2021-11-18 15:39:09', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (128, '支付渠道支付宝公钥类型', 'pay_channel_alipay_mode', 0, '支付渠道支付宝公钥类型', '1', '2021-11-18 15:44:28', '1', '2021-11-18 15:44:28', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (129, '支付宝网关地址', 'pay_channel_alipay_server_type', 0, '支付宝网关地址', '1', '2021-11-18 16:58:55', '1', '2021-11-18 17:01:34', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (130, '支付渠道编码类型', 'pay_channel_code_type', 0, '支付渠道的编码', '1', '2021-12-03 10:35:08', '1', '2021-12-03 10:35:08', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (131, '支付订单回调状态', 'pay_order_notify_status', 0, '支付订单回调状态', '1', '2021-12-03 10:53:29', '1', '2021-12-03 10:53:29', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (132, '支付订单状态', 'pay_order_status', 0, '支付订单状态', '1', '2021-12-03 11:17:50', '1', '2021-12-03 11:17:50', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (133, '支付订单退款状态', 'pay_order_refund_status', 0, '支付订单退款状态', '1', '2021-12-03 11:27:31', '1', '2021-12-03 11:27:31', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (134, '退款订单状态', 'pay_refund_order_status', 0, '退款订单状态', '1', '2021-12-10 16:42:50', '1', '2021-12-10 16:42:50', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (135, '退款订单类别', 'pay_refund_order_type', 0, '退款订单类别', '1', '2021-12-10 17:14:53', '1', '2021-12-10 17:14:53', b'0');
|
||||
INSERT INTO `sys_dict_type` VALUES (137, '流程分类', '流程分类', 0, '流程分类', '1', '2022-01-02 08:40:17', '1', '2022-01-02 00:40:34', b'1');
|
||||
INSERT INTO `sys_dict_type` VALUES (138, '流程分类', 'bpm_model_category', 0, '流程分类', '1', '2022-01-02 08:40:45', '1', '2022-01-02 08:40:45', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -938,93 +1070,12 @@ CREATE TABLE `sys_error_code` (
|
|||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4020 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='错误码表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4049 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='错误码表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_error_code
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_error_code` VALUES (3939, 2, 'dashboard', 1001000001, '参数配置不存在', 'ceshi', NULL, '2021-04-20 23:52:56', '1', '2021-04-21 23:44:15', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3940, 1, 'dashboard', 1001000002, '参数配置 key 重复', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3941, 1, 'dashboard', 1001000003, '不能删除类型为系统内置的参数配置', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3942, 1, 'dashboard', 1001000004, '不允许获取敏感配置到前端', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3943, 1, 'dashboard', 1001001000, '定时任务不存在', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3944, 1, 'dashboard', 1001001001, '定时任务的处理器已经存在', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3945, 1, 'dashboard', 1001001002, '只允许修改为开启或者关闭状态', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3946, 1, 'dashboard', 1001001003, '定时任务已经处于该状态,无需修改', '', NULL, '2021-04-20 23:52:56', NULL, '2021-04-20 23:52:56', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3947, 1, 'dashboard', 1001001004, '只有开启状态的任务,才可以修改', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3948, 1, 'dashboard', 1001001005, 'CRON 表达式不正确', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3949, 2, 'dashboard', 1001002000, 'API 错误日志不存在', '', NULL, '2021-04-20 23:52:57', '1', '2021-04-13 21:55:55', b'1');
|
||||
INSERT INTO `sys_error_code` VALUES (3950, 1, 'dashboard', 1001002001, 'API 错误日志已处理', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3951, 1, 'dashboard', 1001003000, '文件不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3952, 1, 'dashboard', 1002000000, '登录失败,账号密码不正确', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3953, 1, 'dashboard', 1002000001, '登录失败,账号被禁用', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3954, 1, 'dashboard', 1002000002, '登录失败', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3955, 1, 'dashboard', 1002000003, '验证码不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3956, 1, 'dashboard', 1002000004, '验证码不正确', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3957, 1, 'dashboard', 1002001000, 'Token 已经过期', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3958, 1, 'dashboard', 1002001001, 'Token 解析失败', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3959, 1, 'dashboard', 1002002000, '已经存在该名字的菜单', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3960, 1, 'dashboard', 1002002001, '父菜单不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3961, 1, 'dashboard', 1002002002, '不能设置自己为父菜单', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3962, 1, 'dashboard', 1002002003, '菜单不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3963, 1, 'dashboard', 1002002004, '存在子菜单,无法删除', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3964, 1, 'dashboard', 1002002005, '父菜单的类型必须是目录或者菜单', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3965, 1, 'dashboard', 1002003000, '角色不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3966, 1, 'dashboard', 1002003001, '已经存在名为【{}】的角色', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3967, 1, 'dashboard', 1002003002, '已经存在编码为【{}】的角色', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3968, 1, 'dashboard', 1002003004, '不能操作类型为系统内置的角色', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3969, 1, 'dashboard', 1002004000, '用户账号已经存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3970, 1, 'dashboard', 1002004001, '已经存在该名字的部门', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3971, 1, 'dashboard', 1002004002, '父级部门不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3972, 1, 'dashboard', 1002004003, '用户不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3973, 1, 'dashboard', 1002004004, '存在子部门,无法删除', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3974, 1, 'dashboard', 1002004005, '不能设置自己为父部门', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3975, 1, 'dashboard', 1002004001, '已经存在该名字的部门', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3976, 1, 'dashboard', 1002004002, '父级部门不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3977, 1, 'dashboard', 1002004003, '当前部门不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3978, 1, 'dashboard', 1002004004, '存在子部门,无法删除', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3979, 1, 'dashboard', 1002004005, '不能设置自己为父部门', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3980, 1, 'dashboard', 1002004006, '部门中存在员工,无法删除', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3981, 1, 'dashboard', 1002004007, '部门不处于开启状态,不允许选择', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3982, 1, 'dashboard', 1002004008, '不能设置自己的子部门为父部门', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3983, 1, 'dashboard', 1002005001, '已经存在该标识的岗位', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3984, 1, 'dashboard', 1002005002, '岗位({}) 不处于开启状态,不允许选择', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3985, 1, 'dashboard', 1002005001, '已经存在该名字的岗位', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3986, 1, 'dashboard', 1002005001, '已经存在该标识的岗位', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3987, 1, 'dashboard', 1002006001, '当前字典类型不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3988, 1, 'dashboard', 1002006002, '字典类型不处于开启状态,不允许选择', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3989, 1, 'dashboard', 1002006003, '已经存在该名字的字典类型', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3990, 1, 'dashboard', 1002006004, '无法删除,该字典类型还有字典数据', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3991, 1, 'dashboard', 1002006004, '无法删除,该字典类型还有字典数据', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3992, 1, 'dashboard', 1002007001, '当前字典数据不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3993, 1, 'dashboard', 1002007002, '字典数据不处于开启状态,不允许选择', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3994, 1, 'dashboard', 1002007003, '已经存在该值的字典数据', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3995, 1, 'dashboard', 1002008001, '当前通知公告不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3996, 1, 'dashboard', 1002009001, '文件路径已经存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-21 00:03:20', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3997, 1, 'dashboard', 1002009002, '文件上传失败', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3998, 1, 'dashboard', 1002009003, '文件为空', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (3999, 1, 'dashboard', 1002011000, '短信模板不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4000, 1, 'dashboard', 1002011001, '已经存在编码为【{}】的短信模板', '', NULL, '2021-04-20 23:52:57', NULL, '2021-05-02 23:18:32', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4001, 2, 'dashboard', 1002011002, '无法删除,该短信渠道还有短信模板', '', NULL, '2021-04-20 23:52:57', '1', '2021-04-22 00:06:52', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4002, 1, 'dashboard', 1002011000, '短信模板不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4003, 1, 'dashboard', 1002011001, '已经存在编码为【{}】的短信模板', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4004, 1, 'dashboard', 1002012000, '手机号不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4005, 1, 'dashboard', 1002012001, '模板参数({})缺失', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4006, 1, 'dashboard', 1002009000, '错误码不存在', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4007, 1, 'dashboard', 1002009001, '已经存在编码为【{}}】的错误码', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4008, 1, 'dashboard', 1002004003, '不能修改类型为系统内置的错误码', '', NULL, '2021-04-20 23:52:57', NULL, '2021-04-20 23:52:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4009, 1, 'dashboard', 1001004000, '错误码不存在', '', NULL, '2021-04-21 00:38:01', NULL, '2021-04-21 00:38:01', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4010, 1, 'dashboard', 1001004001, '已经存在编码为【{}】的错误码', '', NULL, '2021-04-21 00:38:01', NULL, '2021-04-21 23:48:44', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4011, 1, 'dashboard', 1001004002, '不能修改类型为系统内置的错误码', '', NULL, '2021-04-21 00:38:01', NULL, '2021-04-21 00:38:01', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4012, 2, 'dashboard', 1201002000, '啦啦啦啦', 'biubiub', '1', '2021-04-21 23:46:02', '1', '2021-04-21 23:46:02', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4013, 1, 'dashboard', 1001002000, 'API 错误日志不存在', '', NULL, '2021-04-21 23:48:44', NULL, '2021-04-21 23:48:44', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4014, 1, 'dashboard', 1002013000, '错误码不存在', '', NULL, '2021-04-22 00:04:06', NULL, '2021-04-22 00:04:06', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4015, 1, 'dashboard', 1002013001, '已经存在编码为【{}】的错误码', '', NULL, '2021-04-22 00:04:06', NULL, '2021-04-22 00:04:06', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4016, 1, 'yudao-admin-server', 1002000005, '未绑定账号,需要进行绑定', '', NULL, '2021-10-02 22:14:57', NULL, '2021-10-02 22:14:57', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4017, 1, 'yudao-admin-server', 1002000006, 'Token 已经过期', '', NULL, '2021-10-02 22:14:57', NULL, '2021-10-10 22:47:27', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4018, 1, 'yudao-admin-server', 1002014000, '社交授权失败,原因是:{}', '', NULL, '2021-10-05 23:23:10', NULL, '2021-10-05 23:23:10', b'0');
|
||||
INSERT INTO `sys_error_code` VALUES (4019, 1, 'yudao-admin-server', 1002014001, '社交解绑失败,非当前用户绑定', '', NULL, '2021-10-06 09:31:54', NULL, '2021-10-06 09:31:54', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1048,7 +1099,7 @@ CREATE TABLE `sys_login_log` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=474 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统访问记录';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=513 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统访问记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_login_log
|
||||
|
@ -1078,17 +1129,17 @@ CREATE TABLE `sys_menu` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1144 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单权限表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1194 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单权限表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_menu
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_menu` VALUES (1, '系统管理', '', 1, 1, 0, '/system', 'system', NULL, 0, 'admin', '2021-01-05 17:03:48', '1', '2021-12-05 22:51:03', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (2, '基础设施', '', 1, 2, 0, '/infra', 'monitor', NULL, 0, 'admin', '2021-01-05 17:03:48', '', '2021-01-20 14:18:35', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (3, '研发工具', '', 1, 3, 0, '/tool', 'tool', NULL, 0, 'admin', '2021-01-05 17:03:48', '', '2021-02-06 12:44:42', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1, '系统管理', '', 1, 10, 0, '/system', 'system', NULL, 0, 'admin', '2021-01-05 17:03:48', '1', '2021-12-25 16:43:08', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (2, '基础设施', '', 1, 20, 0, '/infra', 'monitor', NULL, 0, 'admin', '2021-01-05 17:03:48', '1', '2021-12-25 16:43:18', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (3, '研发工具', '', 1, 30, 0, '/tool', 'tool', NULL, 0, 'admin', '2021-01-05 17:03:48', '1', '2021-12-25 16:43:13', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (4, '若依官网', '', 1, 4, 0, 'http://ruoyi.vip', 'guide', NULL, 0, 'admin', '2021-01-05 17:03:48', '', '2021-01-20 21:54:28', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (5, 'OA 办公', '', 1, 4, 0, '/oa', 'people', NULL, 0, 'admin', '2021-09-20 16:26:19', '1', '2021-09-20 13:55:54', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (5, 'OA 办公', '', 1, 40, 0, '/oa', 'people', NULL, 0, 'admin', '2021-09-20 16:26:19', '1', '2021-12-25 16:43:22', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (100, '用户管理', 'system:user:list', 2, 1, 1, 'user', 'user', 'system/user/index', 0, 'admin', '2021-01-05 17:03:48', '', '2021-01-05 22:36:45', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (101, '角色管理', '', 2, 2, 1, 'role', 'peoples', 'system/role/index', 0, 'admin', '2021-01-05 17:03:48', '1', '2021-03-14 22:04:49', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (102, '菜单管理', '', 2, 3, 1, 'menu', 'tree-table', 'system/menu/index', 0, 'admin', '2021-01-05 17:03:48', '1', '2021-03-14 22:04:28', b'0', 0);
|
||||
|
@ -1217,6 +1268,7 @@ INSERT INTO `sys_menu` VALUES (1113, '错误码更新', 'system:error-code:updat
|
|||
INSERT INTO `sys_menu` VALUES (1114, '错误码删除', 'system:error-code:delete', 3, 4, 1110, '', '', '', 0, '', '2021-04-13 21:46:42', '', '2021-04-13 22:09:51', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1115, '错误码导出', 'system:error-code:export', 3, 5, 1110, '', '', '', 0, '', '2021-04-13 21:46:42', '', '2021-04-13 22:09:55', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1116, '日志中心', '', 2, 8, 2, 'log-center', 'log', 'infra/skywalking/log', 0, '1', '2021-04-26 22:35:45', '1', '2021-04-26 22:37:25', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1117, '支付管理', '', 1, 11, 0, '/pay', 'money', NULL, 0, '1', '2021-12-25 16:43:41', '1', '2021-12-25 16:46:40', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1118, '请假查询', '', 2, 0, 5, 'oa/leave', 'user', 'oa/leave/index', 0, '', '2021-09-20 08:51:03', '1', '2021-10-12 22:19:02', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1119, '请假申请查询', 'oa:leave:query', 3, 1, 1118, '', '', '', 0, '', '2021-09-20 08:51:03', '', '2021-09-20 08:51:03', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1120, '请假申请创建', 'oa:leave:create', 3, 2, 1118, '', '', '', 0, '', '2021-09-20 08:51:03', '', '2021-09-20 08:51:03', b'0', 0);
|
||||
|
@ -1225,7 +1277,7 @@ INSERT INTO `sys_menu` VALUES (1122, '请假申请删除', 'oa:leave:delete', 3,
|
|||
INSERT INTO `sys_menu` VALUES (1123, '请假申请导出', 'oa:leave:export', 3, 5, 1118, '', '', '', 0, '', '2021-09-20 08:51:03', '', '2021-09-20 08:51:03', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1124, '待办任务', '', 2, 2, 5, 'todo', 'edit', 'oa/todo/index', 0, '1', '2021-09-20 22:10:09', '1', '2021-09-21 23:17:12', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1125, '流程申请', '', 2, 3, 5, 'flow', 'form', 'oa/flow/index', 0, '1', '2021-10-23 22:10:09', '1', '2021-10-23 23:17:12', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1126, '支付应用信息管理', '', 2, 0, 1117, 'app', '', 'pay/app/index', 0, '', '2021-11-10 01:13:30', '', '2021-11-10 01:13:30', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1126, '应用信息', '', 2, 1, 1117, 'app', 'table', 'pay/app/index', 0, '', '2021-11-10 01:13:30', '1', '2021-12-25 16:56:41', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1127, '支付应用信息查询', 'pay:app:query', 3, 1, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1128, '支付应用信息创建', 'pay:app:create', 3, 2, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1129, '支付应用信息更新', 'pay:app:update', 3, 3, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0', 0);
|
||||
|
@ -1243,6 +1295,45 @@ INSERT INTO `sys_menu` VALUES (1140, '租户创建', 'system:tenant:create', 3,
|
|||
INSERT INTO `sys_menu` VALUES (1141, '租户更新', 'system:tenant:update', 3, 3, 1138, '', '', '', 0, '', '2021-12-14 12:31:44', '', '2021-12-14 12:31:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1142, '租户删除', 'system:tenant:delete', 3, 4, 1138, '', '', '', 0, '', '2021-12-14 12:31:44', '', '2021-12-14 12:31:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1143, '租户导出', 'system:tenant:export', 3, 5, 1138, '', '', '', 0, '', '2021-12-14 12:31:44', '', '2021-12-14 12:31:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1144, '支付应用信息管理', '', 2, 0, 1117, 'app', '', 'pay/app/index', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:48:05', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1145, '支付应用信息查询', 'pay:app:query', 3, 1, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:53', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1146, '支付应用信息创建', 'pay:app:create', 3, 2, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:51', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1147, '支付应用信息更新', 'pay:app:update', 3, 3, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:48', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1148, '支付应用信息删除', 'pay:app:delete', 3, 4, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:46', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1149, '支付应用信息导出', 'pay:app:export', 3, 5, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:43', b'1', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1150, '秘钥解析', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '2021-11-08 15:15:47', '1', '2021-11-08 15:15:47', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1156, '支付订单查询', 'pay:order:query', 3, 1, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2021-12-25 08:29:01', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1157, '支付订单创建', 'pay:order:create', 3, 2, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2021-12-25 08:29:01', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1158, '支付订单更新', 'pay:order:update', 3, 3, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2021-12-25 08:29:01', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1159, '支付订单删除', 'pay:order:delete', 3, 4, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2021-12-25 08:29:01', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1160, '支付订单导出', 'pay:order:export', 3, 5, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2021-12-25 08:29:01', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1161, '退款订单', '', 2, 3, 1117, 'refund', 'order', 'pay/refund/index', 0, '', '2021-12-25 08:29:07', '1', '2021-12-25 19:30:22', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1162, '退款订单查询', 'pay:refund:query', 3, 1, 1161, '', '', '', 0, '', '2021-12-25 08:29:07', '', '2021-12-25 08:29:07', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1163, '退款订单创建', 'pay:refund:create', 3, 2, 1161, '', '', '', 0, '', '2021-12-25 08:29:07', '', '2021-12-25 08:29:07', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1164, '退款订单更新', 'pay:refund:update', 3, 3, 1161, '', '', '', 0, '', '2021-12-25 08:29:07', '', '2021-12-25 08:29:07', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1165, '退款订单删除', 'pay:refund:delete', 3, 4, 1161, '', '', '', 0, '', '2021-12-25 08:29:07', '', '2021-12-25 08:29:07', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1166, '退款订单导出', 'pay:refund:export', 3, 5, 1161, '', '', '', 0, '', '2021-12-25 08:29:07', '', '2021-12-25 08:29:07', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1173, '支付订单', '', 2, 2, 1117, 'order', 'pay', 'pay/order/index', 0, '', '2021-12-25 08:49:43', '1', '2021-12-25 19:29:54', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1174, '支付订单查询', 'pay:order:query', 3, 1, 1173, '', '', '', 0, '', '2021-12-25 08:49:43', '', '2021-12-25 08:49:43', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1175, '支付订单创建', 'pay:order:create', 3, 2, 1173, '', '', '', 0, '', '2021-12-25 08:49:43', '', '2021-12-25 08:49:43', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1176, '支付订单更新', 'pay:order:update', 3, 3, 1173, '', '', '', 0, '', '2021-12-25 08:49:43', '', '2021-12-25 08:49:43', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1177, '支付订单删除', 'pay:order:delete', 3, 4, 1173, '', '', '', 0, '', '2021-12-25 08:49:43', '', '2021-12-25 08:49:43', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1178, '支付订单导出', 'pay:order:export', 3, 5, 1173, '', '', '', 0, '', '2021-12-25 08:49:43', '', '2021-12-25 08:49:43', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1179, '商户信息', '', 2, 0, 1117, 'merchant', 'merchant', 'pay/merchant/index', 0, '', '2021-12-25 09:01:44', '1', '2021-12-25 17:02:13', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1180, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1179, '', '', '', 0, '', '2021-12-25 09:01:44', '', '2021-12-25 09:01:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1181, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1179, '', '', '', 0, '', '2021-12-25 09:01:44', '', '2021-12-25 09:01:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1182, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1179, '', '', '', 0, '', '2021-12-25 09:01:44', '', '2021-12-25 09:01:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1183, '支付商户信息删除', 'pay:merchant:delete', 3, 4, 1179, '', '', '', 0, '', '2021-12-25 09:01:44', '', '2021-12-25 09:01:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1184, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1179, '', '', '', 0, '', '2021-12-25 09:01:44', '', '2021-12-25 09:01:44', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1185, '工作流', '', 1, 50, 0, '/bpm', 'tool', NULL, 0, '1', '2021-12-30 20:26:36', '1', '2021-12-30 20:26:36', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1186, '流程管理', '', 1, 10, 1185, 'manager', 'nested', NULL, 0, '1', '2021-12-30 20:28:30', '1', '2021-12-30 20:28:57', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1187, '流程表单', '', 2, 0, 1186, 'form', 'form', 'bpm/form/index', 0, '', '2021-12-30 12:38:22', '1', '2021-12-31 23:20:38', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1188, '流程表单的查询', 'bpm:form:query', 3, 1, 1187, '', '', '', 0, '', '2021-12-30 12:38:22', '1', '2021-12-30 20:38:56', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1189, '流程表单的创建', 'bpm:form:create', 3, 2, 1187, '', '', '', 0, '', '2021-12-30 12:38:22', '1', '2021-12-30 20:39:00', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1190, '流程表单的更新', 'bpm:form:update', 3, 3, 1187, '', '', '', 0, '', '2021-12-30 12:38:22', '1', '2021-12-30 20:39:04', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1191, '流程表单的删除', 'bpm:form:delete', 3, 4, 1187, '', '', '', 0, '', '2021-12-30 12:38:22', '1', '2021-12-30 20:39:08', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1192, '流程表单的导出', 'bpm:form:export', 3, 5, 1187, '', '', '', 0, '', '2021-12-30 12:38:22', '1', '2021-12-30 20:39:13', b'0', 0);
|
||||
INSERT INTO `sys_menu` VALUES (1193, '流程定义', '', 2, 1, 1186, 'model', 'guide', 'bpm/model/index', 0, '1', '2021-12-31 23:24:58', '1', '2021-12-31 23:24:58', b'0', 0);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1304,7 +1395,7 @@ CREATE TABLE `sys_operate_log` (
|
|||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志记录';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=245 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_operate_log
|
||||
|
@ -1371,7 +1462,7 @@ CREATE TABLE `sys_role` (
|
|||
BEGIN;
|
||||
INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, 1, '', 0, 1, '超级管理员', 'admin', '2021-01-05 17:03:48', '', '2021-12-15 04:52:44', b'0');
|
||||
INSERT INTO `sys_role` VALUES (2, '普通角色', 'common', 2, 2, '', 0, 1, '普通角色', 'admin', '2021-01-05 17:03:48', '', '2021-01-06 11:46:58', b'0');
|
||||
INSERT INTO `sys_role` VALUES (101, '测试账号', 'test', 0, 2, '[104]', 0, 2, '132', '', '2021-01-06 13:49:35', '1', '2021-03-14 22:17:20', b'0');
|
||||
INSERT INTO `sys_role` VALUES (101, '测试账号', 'test', 0, 2, '[102,108,109]', 0, 2, '132', '', '2021-01-06 13:49:35', '1', '2021-12-16 09:27:01', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1388,7 +1479,7 @@ CREATE TABLE `sys_role_menu` (
|
|||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和菜单关联表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=253 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和菜单关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_role_menu
|
||||
|
@ -1548,6 +1639,20 @@ INSERT INTO `sys_role_menu` VALUES (235, 101, 101, '', '2021-01-21 03:23:27', ''
|
|||
INSERT INTO `sys_role_menu` VALUES (236, 101, 1063, '', '2021-01-21 03:23:27', '', '2021-01-21 03:23:27', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (237, 101, 1064, '', '2021-01-21 03:23:27', '', '2021-01-21 03:23:27', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (238, 101, 1065, '', '2021-01-21 03:23:27', '', '2021-01-21 03:23:27', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (239, 101, 100, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (240, 101, 1001, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (241, 101, 1002, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (242, 101, 1003, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (243, 101, 1004, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (244, 101, 1005, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (245, 101, 1006, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (246, 101, 1007, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (247, 101, 1138, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (248, 101, 1139, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (249, 101, 1140, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (250, 101, 1141, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (251, 101, 1142, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
INSERT INTO `sys_role_menu` VALUES (252, 101, 1143, '1', '2021-12-15 22:47:51', '1', '2021-12-15 22:47:51', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1798,13 +1903,13 @@ CREATE TABLE `sys_user` (
|
|||
-- Records of sys_user
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/api/infra/file/get/7e7ed694-2242-46cf-9ac9-0709debcc22f', 0, '127.0.0.1', '2021-12-15 12:33:21', 'admin', '2021-01-05 17:03:47', NULL, '2021-12-15 12:33:21', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/api/infra/file/get/7e7ed694-2242-46cf-9ac9-0709debcc22f', 0, '127.0.0.1', '2022-01-02 17:02:50', 'admin', '2021-01-05 17:03:47', NULL, '2022-01-02 17:02:50', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (2, 'ry', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '若依', '测试员', 103, '[2]', 'ry@qq.com', '15666666666', 1, '', 0, '127.0.0.1', '2021-01-05 17:03:47', 'admin', '2021-01-05 17:03:47', '', '2021-12-13 01:26:34', b'1', 1);
|
||||
INSERT INTO `sys_user` VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 103, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '', NULL, '', '2021-01-07 09:07:17', '1', '2021-12-13 01:26:55', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (103, 'yuanma', '', '源码', NULL, 100, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '', NULL, '', '2021-01-13 23:50:35', '', '2021-12-05 02:22:01', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (104, 'test', '$2a$10$.TOFpaIiI3PzEwkGrNq0Eu6Cc3rOqJMxTb1DqeSEM8StxaGPBRKoi', '测试号', NULL, 100, '[]', '', '15601691200', 1, '', 0, '127.0.0.1', '2021-12-13 07:41:55', '', '2021-01-21 02:13:53', NULL, '2021-12-13 07:41:55', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (105, 'hradmin', '$2a$10$JEhJOL25X1eMnFfR3PILo.MoAljf29YukpL2w6H9GvVGjmqOCuh.O', 'hr-mgr', 'hr 管理员', 100, '[3]', '', '', 1, '', 0, '127.0.0.1', '2021-10-30 21:19:36', '1', '2021-09-25 16:50:41', NULL, '2021-12-05 02:22:03', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (106, 'zhijiantianya', '$2a$10$Y0hSfV2udA8quqMeWukhTuHEoKpQ5tDhclG8WUWSOH7o/MGw185Ti', '芋道源码', '', NULL, NULL, '', '', 3, 'https://portrait.gitee.com/uploads/avatars/user/0/176_zhijiantianya_1578913741.png', 0, '', NULL, NULL, '2021-09-28 09:40:59', NULL, '2021-12-05 02:22:04', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '', NULL, '', '2021-01-07 09:07:17', '104', '2021-12-16 09:26:10', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (103, 'yuanma', '', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '', NULL, '', '2021-01-13 23:50:35', '104', '2021-12-16 09:26:05', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (104, 'test', '$2a$10$CkyM2xvzUhSWsh.JqGcSju.KjlPsaX1A76wO8O/mYtkpQvcp2jWTW', '测试号', NULL, 107, '[]', '', '15601691200', 1, '', 0, '127.0.0.1', '2021-12-16 09:27:08', '', '2021-01-21 02:13:53', NULL, '2021-12-16 09:27:08', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (105, 'hradmin', '$2a$10$JEhJOL25X1eMnFfR3PILo.MoAljf29YukpL2w6H9GvVGjmqOCuh.O', 'hr-mgr', 'hr 管理员', 109, '[3]', '', '18818260000', 1, '', 0, '127.0.0.1', '2021-10-30 21:19:36', '1', '2021-09-25 16:50:41', '1', '2021-12-16 09:26:41', b'0', 1);
|
||||
INSERT INTO `sys_user` VALUES (106, 'zhijiantianya', '$2a$10$Y0hSfV2udA8quqMeWukhTuHEoKpQ5tDhclG8WUWSOH7o/MGw185Ti', '芋道源码', '', NULL, NULL, '', '', 3, 'https://portrait.gitee.com/uploads/avatars/user/0/176_zhijiantianya_1578913741.png', 0, '', NULL, NULL, '2021-09-28 09:40:59', NULL, '2021-12-15 14:44:47', b'1', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1835,7 +1940,7 @@ INSERT INTO `sys_user_role` VALUES (4, 100, 101, '', NULL, '', NULL, b'0', 0);
|
|||
INSERT INTO `sys_user_role` VALUES (5, 100, 1, '', NULL, '', NULL, b'0', 0);
|
||||
INSERT INTO `sys_user_role` VALUES (6, 100, 2, '', NULL, '', NULL, b'0', 0);
|
||||
INSERT INTO `sys_user_role` VALUES (7, 104, 101, '', NULL, '', NULL, b'0', 0);
|
||||
INSERT INTO `sys_user_role` VALUES (8, 106, 1, NULL, '2021-09-28 09:40:59', NULL, '2021-09-28 09:40:59', b'0', 0);
|
||||
INSERT INTO `sys_user_role` VALUES (8, 106, 1, NULL, '2021-09-28 09:40:59', NULL, '2021-09-28 09:40:59', b'1', 0);
|
||||
INSERT INTO `sys_user_role` VALUES (9, 105, 1, '1', '2021-10-30 13:40:48', '1', '2021-10-30 13:40:48', b'0', 0);
|
||||
COMMIT;
|
||||
|
||||
|
@ -1864,6 +1969,39 @@ CREATE TABLE `sys_user_session` (
|
|||
-- Records of sys_user_session
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_user_session` VALUES ('0180929bb4b244b891253885e86ad9d1', 1, 2, '2021-12-16 09:37:48', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 09:07:48', NULL, '2021-12-16 09:07:48', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('01b7469337864db7a9b65747f38fa928', 1, 2, '2021-12-31 14:29:42', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-31 13:49:05', NULL, '2021-12-31 13:59:42', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('09c26e452a6c44129a2d495478b40d27', 1, 2, '2022-01-02 13:25:15', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-02 12:06:51', NULL, '2022-01-02 12:55:15', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('0b8545465544481da4d162a3a74a552e', 1, 2, '2021-12-15 23:48:37', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-15 22:44:07', NULL, '2021-12-15 23:18:37', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('1995595036aa4652bb887c43cfd35ba8', 1, 2, '2022-01-01 00:18:24', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-31 22:57:57', NULL, '2021-12-31 23:48:24', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('1b6154299e1a470ebf80d2eaef72b0e2', 1, 2, '2022-01-02 11:59:52', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-02 09:30:29', NULL, '2022-01-02 11:29:52', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('1b848d99cde6448097dcedc83fda4c0a', 1, 2, '2021-12-31 10:45:09', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-31 08:35:36', NULL, '2021-12-31 10:15:09', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('1bc6ad0827fe48099bcbdb9a206818ac', 104, 2, '2021-12-15 23:48:59', 'test', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-15 23:18:59', NULL, '2021-12-15 23:18:59', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('28d90f7da308407296fface4ca68d732', 1, 2, '2022-01-01 21:54:30', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 21:01:18', NULL, '2022-01-01 21:24:30', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('2d920ad234a442cd98f5f517d50d6b60', 1, 2, '2022-01-02 16:47:41', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-02 14:34:30', NULL, '2022-01-02 16:17:41', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('2ec1ca2d0053415599fa18e6bddf710e', 104, 2, '2021-12-16 10:08:04', 'test', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 09:27:08', NULL, '2021-12-16 09:38:04', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('345ad9af8d0c46c8ad285b57cabfd060', 1, 2, '2021-12-25 19:57:51', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-25 19:15:06', NULL, '2021-12-25 19:27:51', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('47949a90a88d4c49823d70995d980ee9', 1, 2, '2021-12-16 10:04:30', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 09:20:41', NULL, '2021-12-16 09:34:30', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('495da339c78846609991d9bc66e17dcf', 1, 2, '2021-12-31 22:54:24', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-31 21:47:55', NULL, '2021-12-31 22:24:24', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('4e00d142b22e4826938de31c221b6b32', 104, 2, '2021-12-16 09:54:24', 'test', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 09:24:24', NULL, '2021-12-16 01:27:04', b'1', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('5921e2838860430b80d02c2dc5bc9b14', 1, 2, '2022-01-01 18:38:17', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 17:19:06', NULL, '2022-01-01 18:08:17', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('64f51e60527349d6b4a0a74f3d8eca97', 104, 2, '2021-12-16 07:37:54', 'test', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 07:07:54', NULL, '2021-12-16 07:07:54', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('79924bcc8d594452a8ee8406d312b2c2', 1, 2, '2022-01-01 23:37:34', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 22:02:06', NULL, '2022-01-01 23:07:34', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('9122b55409a94388a7b277ad808a127c', 1, 2, '2022-01-01 17:18:53', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 16:20:04', NULL, '2022-01-01 16:48:53', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('91b94971b7f044c8b68420e6ef7377af', 1, 2, '2022-01-02 17:32:50', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-02 17:02:50', NULL, '2022-01-02 17:02:50', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('945e4bb19f4d4c28ba7135218ee3abe3', 1, 2, '2021-12-16 08:28:54', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 07:42:25', NULL, '2021-12-16 07:58:54', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('9526809b303f489b8aab0c05e6b483dd', 1, 2, '2022-01-01 00:51:19', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 00:21:19', NULL, '2022-01-01 00:21:19', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('9ee1349d7d3043759cb742a0fa5a3163', 1, 2, '2021-12-25 19:08:33', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-25 18:38:33', NULL, '2021-12-25 18:38:33', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('a155e6dfe4b74fbaa69fcca239facc40', 1, 2, '2021-12-16 07:37:39', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-16 07:07:39', NULL, '2021-12-16 07:07:39', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('a55b31ff9e6a41fcb931d2244b4240a8', 1, 2, '2021-12-30 22:32:56', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-30 20:04:02', NULL, '2021-12-30 22:02:56', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('ab449ce8f2ea456591d23515c188c242', 1, 2, '2021-12-25 17:55:45', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-25 16:42:42', NULL, '2021-12-25 17:25:45', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('b12325b8930245c09b75aa100dc1124d', 1, 2, '2022-01-01 09:12:53', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 08:09:05', NULL, '2022-01-01 08:42:53', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('bd655254904748f79c0ad47dfb49d457', 1, 2, '2022-01-01 08:05:32', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 07:35:32', NULL, '2022-01-01 07:35:32', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('c09baa895d79468db63417f60c65573c', 1, 2, '2022-01-01 11:33:44', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 10:13:48', NULL, '2022-01-01 11:03:44', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('da04f99dc14a4f28a8a77178861cb3ed', 104, 2, '2021-12-15 23:37:58', 'test', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-15 22:47:31', NULL, '2021-12-15 15:11:55', b'1', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('e290aebda5f34c379d0cf3e013cbcc8b', 1, 2, '2022-01-02 09:27:23', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-02 08:32:23', NULL, '2022-01-02 08:57:23', b'0', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('fe82f6ecb17449b595c7d6bd4bc1d371', 1, 2, '2021-12-15 23:16:49', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2021-12-15 22:46:49', NULL, '2021-12-15 14:46:53', b'1', 1);
|
||||
INSERT INTO `sys_user_session` VALUES ('ffeae9ee4b8649b6b9ececaa502a934d', 1, 2, '2022-01-01 19:56:49', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', NULL, '2022-01-01 18:47:31', NULL, '2022-01-01 19:26:49', b'0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -1896,25 +2034,25 @@ CREATE TABLE `tool_codegen_column` (
|
|||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=479 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表字段定义';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=489 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表字段定义';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_codegen_column
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `tool_codegen_column` VALUES (243, 21, 'id', 'int(5)', '参数主键', b'0', b'1', '1', 1, 'Integer', 'id', '', NULL, b'0', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (244, 21, 'group', 'varchar(50)', '参数分组', b'0', b'0', '0', 2, 'String', 'group', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-03-06 02:20:02', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (245, 21, 'type', 'tinyint(4)', '参数类型', b'0', b'0', '0', 3, 'Integer', 'type', '', NULL, b'1', b'1', b'1', '=', b'1', 'select', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (246, 21, 'name', 'varchar(100)', '参数名称', b'0', b'0', '0', 4, 'String', 'name', '', NULL, b'1', b'1', b'1', 'LIKE', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (247, 21, 'key', 'varchar(100)', '参数键名', b'0', b'0', '0', 5, 'String', 'key', '', NULL, b'1', b'1', b'1', '=', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (248, 21, 'value', 'varchar(500)', '参数键值', b'0', b'0', '0', 6, 'String', 'value', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-03-06 02:20:02', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (249, 21, 'sensitive', 'bit(1)', '是否敏感', b'0', b'0', '0', 7, 'Boolean', 'sensitive', '', NULL, b'1', b'1', b'0', '=', b'1', 'radio', '', '2021-02-06 19:51:35', '', '2021-03-06 02:20:02', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (250, 21, 'remark', 'varchar(500)', '备注', b'1', b'0', '0', 8, 'String', 'remark', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '', '2021-03-06 02:20:02', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (251, 21, 'creator', 'varchar(64)', '创建者', b'1', b'0', '0', 9, 'String', 'createBy', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (252, 21, 'create_time', 'datetime', '创建时间', b'0', b'0', '0', 10, 'Date', 'createTime', '', NULL, b'0', b'0', b'1', 'BETWEEN', b'1', 'datetime', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (253, 21, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 11, 'String', 'updateBy', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (254, 21, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 12, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (255, 21, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 13, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (243, 21, 'id', 'int(5)', '参数主键', b'0', b'1', '1', 1, 'Integer', 'id', '', NULL, b'0', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (244, 21, 'group', 'varchar(50)', '参数分组', b'0', b'0', '0', 2, 'String', 'group', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (245, 21, 'type', 'tinyint(4)', '参数类型', b'0', b'0', '0', 3, 'Integer', 'type', '', NULL, b'1', b'1', b'1', '=', b'1', 'select', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (246, 21, 'name', 'varchar(100)', '参数名称', b'0', b'0', '0', 4, 'String', 'name', '', NULL, b'1', b'1', b'1', 'LIKE', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (247, 21, 'key', 'varchar(100)', '参数键名', b'0', b'0', '0', 5, 'String', 'key', '', NULL, b'1', b'1', b'1', '=', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (248, 21, 'value', 'varchar(500)', '参数键值', b'0', b'0', '0', 6, 'String', 'value', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (249, 21, 'sensitive', 'bit(1)', '是否敏感', b'0', b'0', '0', 7, 'Boolean', 'sensitive', '', NULL, b'1', b'1', b'0', '=', b'1', 'radio', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (250, 21, 'remark', 'varchar(500)', '备注', b'1', b'0', '0', 8, 'String', 'remark', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (251, 21, 'creator', 'varchar(64)', '创建者', b'1', b'0', '0', 9, 'String', 'createBy', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (252, 21, 'create_time', 'datetime', '创建时间', b'0', b'0', '0', 10, 'Date', 'createTime', '', NULL, b'0', b'0', b'1', 'BETWEEN', b'1', 'datetime', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (253, 21, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 11, 'String', 'updateBy', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (254, 21, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 12, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (255, 21, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 13, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (269, 24, 'id', 'bigint(20)', '任务编号', b'0', b'1', '1', 1, 'Long', 'id', '', '1024', b'0', b'1', b'0', '=', b'1', 'input', '', '2021-02-07 06:39:34', '', '2021-02-07 06:44:19', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (270, 24, 'name', 'varchar(32)', '任务名称', b'0', b'0', '0', 2, 'String', 'name', '', '测试任务', b'1', b'1', b'1', 'LIKE', b'1', 'input', '', '2021-02-07 06:39:34', '', '2021-02-07 06:44:19', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (271, 24, 'status', 'tinyint(4)', '任务状态', b'0', b'0', '0', 3, 'Integer', 'status', 'inf_job_status', '1', b'0', b'0', b'1', '=', b'1', 'radio', '', '2021-02-07 06:39:34', '', '2021-02-07 07:55:17', b'0');
|
||||
|
@ -2114,6 +2252,16 @@ INSERT INTO `tool_codegen_column` VALUES (475, 39, 'create_time', 'datetime', '
|
|||
INSERT INTO `tool_codegen_column` VALUES (476, 39, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 8, 'String', 'updater', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (477, 39, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 9, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (478, 39, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 10, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (479, 40, 'id', 'bigint', '编号', b'0', b'1', '1', 1, 'Long', 'id', '', NULL, b'0', b'1', b'0', '=', b'1', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (480, 40, 'name', 'varchar(64)', '表单名', b'0', b'0', '0', 2, 'String', 'name', '', NULL, b'1', b'1', b'1', 'LIKE', b'1', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (481, 40, 'status', 'tinyint', '开启状态', b'0', b'0', '0', 3, 'Integer', 'status', 'sys_common_status', NULL, b'1', b'1', b'0', '=', b'1', 'radio', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (482, 40, 'fields', 'varchar(1024)', '表单配置', b'0', b'0', '0', 4, 'String', 'fields', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (483, 40, 'remark', 'varchar(255)', '备注', b'1', b'0', '0', 5, 'String', 'remark', '', NULL, b'1', b'1', b'0', '=', b'1', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (484, 40, 'creator', 'varchar(64)', '创建者', b'1', b'0', '0', 6, 'String', 'creator', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (485, 40, 'create_time', 'datetime', '创建时间', b'0', b'0', '0', 7, 'Date', 'createTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'1', 'datetime', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (486, 40, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 8, 'String', 'updater', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (487, 40, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 9, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
INSERT INTO `tool_codegen_column` VALUES (488, 40, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 10, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '1', '2021-12-30 20:33:27', '1', '2021-12-30 20:37:58', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
@ -2139,13 +2287,13 @@ CREATE TABLE `tool_codegen_table` (
|
|||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表定义';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表定义';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_codegen_table
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `tool_codegen_table` VALUES (21, 1, 'inf_config', '参数配置表', NULL, 'infra', 'config', 'InfConfig', '参数配置', '芋艿', 1, NULL, '', '2021-02-06 19:51:35', '', '2021-02-06 19:51:35', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (21, 1, 'inf_config', '参数配置表', NULL, 'infra', 'config', 'InfConfig', '参数配置', '芋艿', 1, NULL, '', '2021-02-06 19:51:35', '1', '2021-12-31 22:06:46', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (22, 2, 'sys_file', '文件表\n', NULL, 'system', 'file', 'SysFile', '文件', '芋艿', 1, NULL, '', '2021-02-06 20:28:34', '', '2021-02-06 20:28:34', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (24, 1, 'inf_job', '定时任务表', NULL, 'infra', 'job', 'InfJob', '定时任务', '芋道源码', 1, NULL, '', '2021-02-07 06:39:34', '', '2021-02-07 06:46:56', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (25, 1, 'inf_job_log', '定时任务日志表', NULL, 'infra', 'jobLog', 'InfJobLog', '定时任务', '芋艿', 1, NULL, '', '2021-02-08 04:58:41', '', '2021-02-08 10:09:52', b'0');
|
||||
|
@ -2160,6 +2308,7 @@ INSERT INTO `tool_codegen_table` VALUES (36, 1, 'sys_sms_log', '短信日志', N
|
|||
INSERT INTO `tool_codegen_table` VALUES (37, 1, 'inf_error_code', '错误码表', NULL, 'infra', 'errorcode', 'InfErrorCode', '错误码', '芋道源码', 1, 2, '1', '2021-04-20 15:27:45', '1', '2021-04-21 00:55:37', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (38, 1, 'tool_test_demo', '字典类型表', NULL, 'tool', 'test', 'ToolTestDemo', '字典类型', '芋艿', 1, NULL, '1', '2021-04-26 12:25:51', '1', '2021-05-03 00:45:45', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (39, 1, 'sys_tenant', '租户表', NULL, 'system', 'tenant', 'SysTenant', '租户', '芋道源码', 1, 1, '1', '2021-12-05 01:04:21', '1', '2021-12-14 10:02:12', b'0');
|
||||
INSERT INTO `tool_codegen_table` VALUES (40, 1, 'bpm_form', '工作流的表单定义', NULL, 'bpm', 'form', 'BpmForm', '工作流的', '芋道源码', 1, 1186, '1', '2021-12-30 12:32:54', '1', '2021-12-30 20:37:58', b'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
// TODO @风里雾里: Os=》Wf,/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的
|
||||
@Api(tags = "动态表单")
|
||||
@RestController
|
||||
@RequestMapping("/wl/form")
|
||||
@Validated
|
||||
public class WlFormController {
|
||||
|
||||
@Resource
|
||||
private WfFormService formService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建动态表单")
|
||||
@PreAuthorize("@ss.hasPermission('os:form:create')")
|
||||
public CommonResult<Long> createForm(@Valid @RequestBody WfFormCreateReqVO createReqVO) {
|
||||
return success(formService.createForm(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新动态表单")
|
||||
@PreAuthorize("@ss.hasPermission('os:form:update')")
|
||||
public CommonResult<Boolean> updateForm(@Valid @RequestBody WfFormUpdateReqVO updateReqVO) {
|
||||
formService.updateForm(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除动态表单")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('os:form:delete')")
|
||||
public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) {
|
||||
formService.deleteForm(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得动态表单")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('os:form:query')")
|
||||
public CommonResult<WfFormRespVO> getForm(@RequestParam("id") Long id) {
|
||||
WfForm form = formService.getForm(id);
|
||||
return success(WfFormConvert.INSTANCE.convert(form));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得动态表单列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('os:form:query')")
|
||||
public CommonResult<List<WfFormRespVO>> getFormList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<WfForm> list = formService.getFormList(ids);
|
||||
return success(WfFormConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得动态表单分页")
|
||||
@PreAuthorize("@ss.hasPermission('os:form:query')")
|
||||
public CommonResult<PageResult<WfFormRespVO>> getFormPage(@Valid WfFormPageReqVO pageVO) {
|
||||
PageResult<WfForm> pageResult = formService.getFormPage(pageVO);
|
||||
return success(WfFormConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出动态表单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('os:form:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFormExcel(@Valid WfFormExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<WfForm> list = formService.getFormList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<WfFormExcelVO> datas = WfFormConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "动态表单.xls", "数据", WfFormExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 动态表单 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class WfFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单名称", required = true)
|
||||
@NotNull(message = "表单名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商户状态", required = true)
|
||||
@NotNull(message = "商户状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "表单JSON")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("动态表单创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WfFormCreateReqVO extends WfFormBaseVO {
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 动态表单 Excel VO
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Data
|
||||
public class WfFormExcelVO {
|
||||
|
||||
@ExcelProperty("表单编号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("表单名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("商户状态")
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("表单JSON")
|
||||
private String formJson;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的")
|
||||
@Data
|
||||
public class WfFormExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "表单名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商户状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "表单JSON")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
private Date beginCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("动态表单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WfFormPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "表单名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商户状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "表单JSON")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
private Date beginCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("动态表单 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WfFormRespVO extends WfFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单编号", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("动态表单更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WfFormUpdateReqVO extends WfFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单编号", required = true)
|
||||
@NotNull(message = "表单编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("请假申请创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OaLeaveCreateReqVO extends OaLeaveBaseVO {
|
||||
|
||||
private String processKey;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import org.activiti.api.process.runtime.ProcessRuntime;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
// TODO @json:swagger 和 validation 的注解,后续要补全下哈。可以等 workflow 基本写的差不多之后
|
||||
@RestController
|
||||
@RequestMapping("/workflow/process/definition")
|
||||
public class ProcessDefinitionController {
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
@Resource
|
||||
private ProcessRuntime processRuntime;
|
||||
|
||||
|
||||
@GetMapping(value = "/getStartForm")
|
||||
public CommonResult<String> getStartForm(@RequestParam("processKey") String processKey){
|
||||
//这样查似乎有问题??, 暂时写死
|
||||
// final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().
|
||||
// processDefinitionKey(processKey).latestVersion().singleResult();
|
||||
// processRuntime.processDefinition(processDefinition.getId()).getFormKey();
|
||||
return CommonResult.success("/flow/leave/apply");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.convert.form;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExcelVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态表单 Convert
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfFormConvert {
|
||||
|
||||
WfFormConvert INSTANCE = Mappers.getMapper(WfFormConvert.class);
|
||||
|
||||
WfForm convert(WfFormCreateReqVO bean);
|
||||
|
||||
WfForm convert(WfFormUpdateReqVO bean);
|
||||
|
||||
WfFormRespVO convert(WfForm bean);
|
||||
|
||||
List<WfFormRespVO> convertList(List<WfForm> list);
|
||||
|
||||
PageResult<WfFormRespVO> convertPage(PageResult<WfForm> page);
|
||||
|
||||
List<WfFormExcelVO> convertList02(List<WfForm> list);
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.convert.oa;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
|
||||
/**
|
||||
* 请假申请 Convert
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Mapper
|
||||
public interface OaLeaveConvert {
|
||||
|
||||
OaLeaveConvert INSTANCE = Mappers.getMapper(OaLeaveConvert.class);
|
||||
|
||||
OaLeaveDO convert(OaLeaveCreateReqVO bean);
|
||||
|
||||
OaLeaveDO convert(OaLeaveUpdateReqVO bean);
|
||||
|
||||
OaLeaveRespVO convert(OaLeaveDO bean);
|
||||
|
||||
List<OaLeaveRespVO> convertList(List<OaLeaveDO> list);
|
||||
|
||||
PageResult<OaLeaveRespVO> convertPage(PageResult<OaLeaveDO> page);
|
||||
|
||||
List<OaLeaveExcelVO> convertList02(List<OaLeaveDO> list);
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.convert.workflow;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface TodoTaskConvert {
|
||||
TodoTaskConvert INSTANCE = Mappers.getMapper(TodoTaskConvert.class);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.process;
|
||||
|
||||
/**
|
||||
* 流程模型实体类 映射 activiti ProcessDefinition接口
|
||||
*
|
||||
* @author ZJQ
|
||||
* @date 2021/9/7 23:23
|
||||
*/
|
||||
public class ProcessDefinitionDO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String category;
|
||||
|
||||
private String key;
|
||||
|
||||
private String name;
|
||||
|
||||
private String version;
|
||||
|
||||
private String resourceName;
|
||||
|
||||
private String deploymentId;
|
||||
|
||||
private String diagramResourceName;
|
||||
|
||||
private boolean suspended;
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form;
|
||||
|
||||
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态表单 Mapper
|
||||
*
|
||||
* @author 风里雾里
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfFormMapper extends BaseMapperX<WfForm> {
|
||||
|
||||
default PageResult<WfForm> selectPage(WfFormPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<WfForm>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.eqIfPresent("status", reqVO.getStatus())
|
||||
.eqIfPresent("form_json", reqVO.getFormJson())
|
||||
.eqIfPresent("remark", reqVO.getRemark())
|
||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc("id") );
|
||||
}
|
||||
|
||||
default List<WfForm> selectList(WfFormExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<WfForm>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.eqIfPresent("status", reqVO.getStatus())
|
||||
.eqIfPresent("form_json", reqVO.getFormJson())
|
||||
.eqIfPresent("remark", reqVO.getRemark())
|
||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc("id") );
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
/**
|
||||
* activiti 系统 错误码枚举类
|
||||
*
|
||||
* 003 activiti
|
||||
* 001 oa
|
||||
* activiti 系统,使用 1-003-000-000 段
|
||||
*/
|
||||
public interface OaErrorCodeConstants {
|
||||
ErrorCode LEAVE_NOT_EXISTS = new ErrorCode(1003001001, "请假申请不存在");
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.enums.form;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* activiti 系统 错误码枚举类
|
||||
*
|
||||
* 003 activiti
|
||||
* 001 oa
|
||||
* activiti 系统,使用 1-003-000-000 段
|
||||
*/
|
||||
public interface WfFormErrorCodeConstants {
|
||||
ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在");
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
// TODO @芋艿:思考下 activiti、oa 的定位,边界,模块的拆分
|
||||
package cn.iocoder.yudao.adminserver.modules.activiti;
|
|
@ -1,75 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.form;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 动态表单 Service 接口
|
||||
*
|
||||
* TODO @风里雾里
|
||||
*/
|
||||
public interface WfFormService {
|
||||
|
||||
/**
|
||||
* 创建动态表单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createForm(@Valid WfFormCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新动态表单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateForm(@Valid WfFormUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除动态表单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得动态表单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 动态表单
|
||||
*/
|
||||
WfForm getForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得动态表单列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 动态表单列表
|
||||
*/
|
||||
List<WfForm> getFormList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得动态表单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 动态表单分页
|
||||
*/
|
||||
PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得动态表单列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 动态表单列表
|
||||
*/
|
||||
List<WfForm> getFormList(WfFormExportReqVO exportReqVO);
|
||||
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.WfFormMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.WfFormErrorCodeConstants.FORM_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 动态表单 Service 实现类
|
||||
*
|
||||
* TODO @风里雾里
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class WfFormServiceImpl implements WfFormService {
|
||||
|
||||
@Resource
|
||||
private WfFormMapper formMapper;
|
||||
|
||||
@Override
|
||||
public Long createForm(WfFormCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
WfForm form = WfFormConvert.INSTANCE.convert(createReqVO);
|
||||
formMapper.insert(form);
|
||||
// 返回
|
||||
return form.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateForm(WfFormUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
this.validateFormExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WfForm updateObj = WfFormConvert.INSTANCE.convert(updateReqVO);
|
||||
formMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteForm(Long id) {
|
||||
// 校验存在
|
||||
this.validateFormExists(id);
|
||||
// 删除
|
||||
formMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFormExists(Long id) {
|
||||
if (formMapper.selectById(id) == null) {
|
||||
throw exception(FORM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WfForm getForm(Long id) {
|
||||
return formMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WfForm> getFormList(Collection<Long> ids) {
|
||||
return formMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO) {
|
||||
return formMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WfForm> getFormList(WfFormExportReqVO exportReqVO) {
|
||||
return formMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class ReportBackEndProcessor implements ExecutionListener {
|
||||
|
||||
@Resource
|
||||
private OaLeaveMapper leaveMapper;
|
||||
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void notify(DelegateTask delegateTask) {
|
||||
// final String businessKey = delegateTask.getExecution().getProcessInstanceBusinessKey();
|
||||
// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
|
||||
// updateWrapper.eq("id", Long.valueOf(businessKey));
|
||||
// OaLeaveDO updateDo = new OaLeaveDO();
|
||||
// updateDo.setStatus(2);
|
||||
// leaveMapper.update(updateDo, updateWrapper);
|
||||
// }
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
final String businessKey = delegateExecution.getProcessInstanceBusinessKey();
|
||||
// TODO @json:service 不要出现 dao 的元素,例如说 UpdateWrapper。这里,我们可以调用 updateById 方法
|
||||
UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", Long.valueOf(businessKey));
|
||||
OaLeaveDO updateDo = new OaLeaveDO();
|
||||
updateDo.setStatus(2); // TODO @json:status 要枚举起来,不要出现 magic number
|
||||
leaveMapper.update(updateDo, updateWrapper);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa.impl;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeavePageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.convert.oa.OaLeaveConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.oa.OaLeaveService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
|
||||
import org.activiti.api.task.runtime.TaskRuntime;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.adminserver.modules.activiti.enums.OaErrorCodeConstants.LEAVE_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 请假申请 Service 实现类
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OaLeaveServiceImpl implements OaLeaveService {
|
||||
|
||||
@Resource
|
||||
private OaLeaveMapper leaveMapper;
|
||||
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
@Resource
|
||||
private org.activiti.engine.TaskService activitiTaskService;
|
||||
|
||||
@Resource
|
||||
private TaskRuntime taskRuntime;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createLeave(OaLeaveCreateReqVO createReqVO) {
|
||||
// 插入 OA 请假单
|
||||
OaLeaveDO leave = OaLeaveConvert.INSTANCE.convert(createReqVO);
|
||||
leave.setStatus(1);
|
||||
leave.setUserId(SecurityFrameworkUtils.getLoginUser().getUsername());
|
||||
leaveMapper.insert(leave);
|
||||
|
||||
// 创建工作流
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
// 如何得到部门领导人,暂时写死
|
||||
variables.put("deptLeader", "admin"); // TODO @芋艿:需要部门的负责人
|
||||
Long id = leave.getId();
|
||||
String businessKey = String.valueOf(id);
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(createReqVO.getProcessKey(), businessKey, variables);
|
||||
String processInstanceId = processInstance.getProcessInstanceId();
|
||||
|
||||
// TODO @json:service 不要出现 dao 的元素,例如说 UpdateWrapper。这里,我们可以调用 updateById 方法
|
||||
// 将工作流的编号,更新到 OA 请假单中
|
||||
UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", id);
|
||||
OaLeaveDO updateDo = new OaLeaveDO();
|
||||
updateDo.setProcessInstanceId(processInstanceId);
|
||||
leaveMapper.update(updateDo, updateWrapper);
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateLeave(OaLeaveUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
this.validateLeaveExists(updateReqVO.getId());
|
||||
|
||||
final Task task = taskRuntime.task(updateReqVO.getTaskId());
|
||||
activitiTaskService.addComment(task.getId(), task.getProcessInstanceId(), updateReqVO.getComment());
|
||||
Map<String, Object> variables = updateReqVO.getVariables();
|
||||
|
||||
//如何得到部门领导人, 暂时写死
|
||||
variables.put("deptLeader", "admin");
|
||||
taskRuntime.complete(TaskPayloadBuilder.complete().withTaskId(task.getId())
|
||||
.withVariables(variables)
|
||||
.build());
|
||||
// TODO @jason:不需要加 final 哈。虽然是不变,但是代码比较少这么去写
|
||||
final Object reApply = variables.get("reApply");
|
||||
// TODO @jason:直接使用 Objects.equals(reApply, true) 就可以
|
||||
if((reApply instanceof Boolean) && (Boolean)reApply){
|
||||
// 更新 表单
|
||||
OaLeaveDO updateObj = OaLeaveConvert.INSTANCE.convert(updateReqVO);
|
||||
leaveMapper.updateById(updateObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLeave(Long id) {
|
||||
// 校验存在
|
||||
this.validateLeaveExists(id);
|
||||
// 删除
|
||||
leaveMapper.deleteById(id);
|
||||
// TODO @jason:需要调用 runtimeService 的 delete 方法,删除???
|
||||
}
|
||||
|
||||
private void validateLeaveExists(Long id) {
|
||||
if (leaveMapper.selectById(id) == null) {
|
||||
throw exception(LEAVE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OaLeaveDO getLeave(Long id) {
|
||||
return leaveMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaLeaveDO> getLeaveList(Collection<Long> ids) {
|
||||
return leaveMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OaLeaveDO> getLeavePage(OaLeavePageReqVO pageReqVO) {
|
||||
return leaveMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaLeaveDO> getLeaveList(OaLeaveExportReqVO exportReqVO) {
|
||||
return leaveMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.process;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 流程基础管理
|
||||
*
|
||||
* @author ZJQ
|
||||
* @date 2021/9/5 21:00
|
||||
*/
|
||||
public interface ProcessService {
|
||||
|
||||
/**
|
||||
* 上传流程文件,进行流程模型部署
|
||||
* @param multipartFile 上传文件
|
||||
*/
|
||||
void deployProcess(MultipartFile multipartFile);
|
||||
|
||||
|
||||
/**
|
||||
* 激活或者挂起流程模型实体
|
||||
* @param processDefinitionId 流程模型实体id
|
||||
* @param type 类型
|
||||
* @return 状态
|
||||
*/
|
||||
String setActivOrHang(String processDefinitionId,String type);
|
||||
|
||||
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.process.impl;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.process.ProcessService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.FILE_UPLOAD_FAILED;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 流程基础管理
|
||||
*
|
||||
* @author ZJQ
|
||||
* @date 2021/9/5 21:04
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ProcessServiceImpl implements ProcessService {
|
||||
|
||||
private static final String BPMN20_XML = "bpmn20.xml";
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
/**
|
||||
* 上传流程文件,进行流程部署
|
||||
* @param multipartFile 上传文件
|
||||
*/
|
||||
@Override
|
||||
public void deployProcess(MultipartFile multipartFile) {
|
||||
String fileName = multipartFile.getOriginalFilename();
|
||||
try (InputStream inputStream = multipartFile.getInputStream()){
|
||||
Deployment deployment = getDeplymentByType(inputStream,fileName);
|
||||
//获取部署成功的流程模型
|
||||
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list();
|
||||
processDefinitions.forEach((processDefinition)->{
|
||||
//设置线上部署流程模型名字
|
||||
String proDefId = processDefinition.getId();
|
||||
repositoryService.setProcessDefinitionCategory(proDefId,fileName);
|
||||
log.info("流程文件部署成功,流程ID="+proDefId);
|
||||
});
|
||||
} catch (IOException e) {
|
||||
log.error("流程部署出现异常"+e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活或者挂起流程模型实体
|
||||
* @param processDefinitionId 流程模型实体id
|
||||
* @param type 类型
|
||||
* @return 提示
|
||||
*/
|
||||
@Override
|
||||
public String setActivOrHang(String processDefinitionId, String type) {
|
||||
String result = "无操作";
|
||||
switch (type){
|
||||
case "active":
|
||||
repositoryService.activateProcessDefinitionById(processDefinitionId,true,null);
|
||||
result = "已激活ID为【"+processDefinitionId+"】的流程模型实例";
|
||||
break;
|
||||
case "suspend":
|
||||
repositoryService.suspendProcessDefinitionById(processDefinitionId,true,null);
|
||||
result = "已挂起ID为【"+processDefinitionId+"】的流程模型实例";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据上传文件类型对应实现不同方式的流程部署
|
||||
* @param inputStream 文件输入流
|
||||
* @param fileName 文件名
|
||||
* @return 文件部署流程
|
||||
*/
|
||||
public Deployment getDeplymentByType(InputStream inputStream,String fileName){
|
||||
Deployment deployment;
|
||||
String type = FilenameUtils.getExtension(fileName);
|
||||
switch (type){
|
||||
case "bpmn":
|
||||
String baseName = FilenameUtils.getBaseName(fileName);
|
||||
deployment = repositoryService.createDeployment().addInputStream(baseName+"."+BPMN20_XML,inputStream).deploy();
|
||||
break;
|
||||
case "png":
|
||||
deployment = repositoryService.createDeployment().addInputStream(fileName,inputStream).deploy();
|
||||
break;
|
||||
case "zip":
|
||||
case "bar":
|
||||
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
|
||||
deployment = repositoryService.createDeployment().addZipInputStream(zipInputStream).deploy();
|
||||
break;
|
||||
default:
|
||||
throw exception(FILE_UPLOAD_FAILED);
|
||||
}
|
||||
return deployment;
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.workflow;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// TODO @芋艿:前缀,注释
|
||||
public interface TaskService {
|
||||
|
||||
PageResult<TodoTaskRespVO> getTodoTaskPage(TodoTaskPageReqVO pageReqVO);
|
||||
|
||||
void claimTask(String taskId);
|
||||
|
||||
void getTaskHistory(String taskId);
|
||||
|
||||
void completeTask(TaskReqVO taskReq);
|
||||
|
||||
// void flowImage(String taskId, HttpServletResponse response);
|
||||
TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery);
|
||||
|
||||
List<TaskStepVO> getHistorySteps(String processInstanceId);
|
||||
|
||||
TodoTaskRespVO getTaskFormKey(TaskQueryReqVO taskQuery);
|
||||
|
||||
}
|
|
@ -1,266 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.impl;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.TaskService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.activiti.api.runtime.shared.query.Page;
|
||||
import org.activiti.api.runtime.shared.query.Pageable;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import org.activiti.api.task.model.builders.ClaimTaskPayloadBuilder;
|
||||
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
|
||||
import org.activiti.api.task.runtime.TaskRuntime;
|
||||
import org.activiti.engine.HistoryService;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.history.HistoricActivityInstance;
|
||||
import org.activiti.engine.history.HistoricProcessInstance;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.task.Comment;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class TaskServiceImpl implements TaskService {
|
||||
|
||||
@Resource
|
||||
private TaskRuntime taskRuntime;
|
||||
|
||||
@Resource
|
||||
private org.activiti.engine.TaskService activitiTaskService;
|
||||
|
||||
@Resource
|
||||
private HistoryService historyService;
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
@Resource
|
||||
private OaLeaveMapper leaveMapper;
|
||||
|
||||
private static Map<String,String> taskVariable = ImmutableMap.<String,String>builder()
|
||||
.put("deptLeaderVerify","deptLeaderApproved")
|
||||
.put("hrVerify","hrApproved")
|
||||
.build();
|
||||
|
||||
public TaskServiceImpl() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<TodoTaskRespVO> getTodoTaskPage(TodoTaskPageReqVO pageReqVO) {
|
||||
final LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
// TODO @jason:封装一个方法,用于转换成 activiti 的分页对象
|
||||
final Pageable pageable = Pageable.of((pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize(), pageReqVO.getPageSize());
|
||||
Page<Task> pageTasks = taskRuntime.tasks(pageable);
|
||||
// TODO @jason:convert 里转换
|
||||
List<Task> tasks = pageTasks.getContent();
|
||||
int totalItems = pageTasks.getTotalItems();
|
||||
final List<TodoTaskRespVO> respVOList = tasks.stream().map(task -> {
|
||||
TodoTaskRespVO respVO = new TodoTaskRespVO();
|
||||
respVO.setId(task.getId());
|
||||
final ProcessDefinition definition = repositoryService.getProcessDefinition(task.getProcessDefinitionId());
|
||||
respVO.setProcessName(definition.getName());
|
||||
respVO.setProcessKey(definition.getKey());
|
||||
respVO.setBusinessKey(task.getBusinessKey());
|
||||
respVO.setStatus(task.getAssignee() == null ? 1 : 2);
|
||||
return respVO;
|
||||
}).collect(Collectors.toList());
|
||||
// TODO @jason:要注意泛型哈。
|
||||
return new PageResult(respVOList, Long.valueOf(totalItems)); // TODO @jason:(long) 转换即可
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void claimTask(String taskId) {
|
||||
taskRuntime.claim(new ClaimTaskPayloadBuilder()
|
||||
.withTaskId(taskId)
|
||||
.withAssignee(SecurityFrameworkUtils.getLoginUser().getUsername())
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTaskHistory(String taskId) {
|
||||
final List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery().
|
||||
processInstanceId("8e2801fc-1a38-11ec-98ce-74867a13730f").list();
|
||||
}
|
||||
|
||||
// TODO @jason:一个方法里,会有多个方法的调用,最好写下对应的注释。这样容易理解
|
||||
@Override
|
||||
@Transactional
|
||||
public void completeTask(TaskReqVO taskReq) {
|
||||
final Task task = taskRuntime.task(taskReq.getTaskId());
|
||||
|
||||
final Map<String, Object> variables = taskReq.getVariables();
|
||||
|
||||
activitiTaskService.addComment(taskReq.getTaskId(), task.getProcessInstanceId(), taskReq.getComment());
|
||||
|
||||
taskRuntime.complete(TaskPayloadBuilder.complete().withTaskId(taskReq.getTaskId())
|
||||
.withVariables(taskReq.getVariables())
|
||||
.build());
|
||||
|
||||
// if(variables.containsValue(Boolean.FALSE)){
|
||||
// final String businessKey = task.getBusinessKey();
|
||||
// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>();
|
||||
// updateWrapper.eq("id", Long.valueOf(businessKey));
|
||||
// OaLeaveDO updateDo = new OaLeaveDO();
|
||||
// updateDo.setStatus(2);
|
||||
// leaveMapper.update(updateDo, updateWrapper);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void flowImage(String taskId, HttpServletResponse response) {
|
||||
//
|
||||
// final Task task = taskRuntime.task(taskId);
|
||||
// BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
|
||||
// final Process process = bpmnModel.getMainProcess();
|
||||
// ProcessDefinitionEntity processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
|
||||
// List<String> activeActivityIds = runtimeService.getActiveActivityIds(executionId);
|
||||
// List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstance.getId());
|
||||
// ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
|
||||
// InputStream imageStream =diagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds, highLightedFlows);
|
||||
//
|
||||
// // 输出资源内容到相应对象
|
||||
// byte[] b = new byte[1024];
|
||||
// int len;
|
||||
// while ((len = imageStream.read(b, 0, 1024)) != -1) {
|
||||
// response.getOutputStream().write(b, 0, len);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery) {
|
||||
TaskHandleVO handleVO = new TaskHandleVO();
|
||||
|
||||
// String processKey = taskQuery.getProcessKey();
|
||||
// if ("leave".equals(processKey)) {
|
||||
// String businessKey = taskQuery.getBusinessKey();
|
||||
// final OaLeaveDO leave = leaveMapper.selectById(Long.valueOf(businessKey));
|
||||
// handleVO.setFormObject( OaLeaveConvert.INSTANCE.convert(leave));
|
||||
// }
|
||||
|
||||
//
|
||||
// final String taskDefKey = task.getTaskDefinitionKey();
|
||||
// final String variableName = Optional.ofNullable(taskVariable.get(taskDefKey)).orElse("");
|
||||
// handleVO.setTaskVariable(variableName);
|
||||
final Task task = taskRuntime.task(taskQuery.getTaskId());
|
||||
|
||||
List<TaskStepVO> steps = getTaskSteps(task.getProcessInstanceId());
|
||||
|
||||
handleVO.setHistoryTask(steps);
|
||||
return handleVO;
|
||||
}
|
||||
|
||||
|
||||
private List<TaskStepVO> getTaskSteps(String processInstanceId) {
|
||||
// 获得已完成的活动
|
||||
List<HistoricActivityInstance> finished = historyService.createHistoricActivityInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.activityType("userTask")
|
||||
.finished()
|
||||
.orderByHistoricActivityInstanceStartTime().asc().list();
|
||||
// 获得对应的步骤
|
||||
List<TaskStepVO> steps = new ArrayList<>();
|
||||
finished.forEach(instance -> {
|
||||
// TODO @jason:放到 convert 里
|
||||
TaskStepVO step = new TaskStepVO();
|
||||
step.setStepName(instance.getActivityName());
|
||||
step.setStartTime(instance.getStartTime());
|
||||
step.setEndTime(instance.getEndTime());
|
||||
step.setAssignee(instance.getAssignee());
|
||||
step.setStatus(1);
|
||||
// TODO @jason:一般判数组为空,使用 CollUtil.isEmpty 会好点哈。另外,null 时候,不用填写 "" 的哈
|
||||
List<Comment> comments = activitiTaskService.getTaskComments(instance.getTaskId());
|
||||
if (comments.size() > 0) {
|
||||
step.setComment(comments.get(0).getFullMessage());
|
||||
} else {
|
||||
step.setComment("");
|
||||
}
|
||||
steps.add(step);
|
||||
});
|
||||
|
||||
// 获得未完成的活动
|
||||
List<HistoricActivityInstance> unfinished = historyService
|
||||
.createHistoricActivityInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.activityType("userTask")
|
||||
.unfinished().list();
|
||||
// 获得对应的步骤
|
||||
// TODO @json:其实已完成和未完成,它们的 convert 的逻辑,是一致的
|
||||
for (HistoricActivityInstance instance : unfinished) {
|
||||
TaskStepVO step = new TaskStepVO();
|
||||
step.setStepName(instance.getActivityName());
|
||||
step.setStartTime(instance.getStartTime());
|
||||
step.setEndTime(instance.getEndTime());
|
||||
step.setAssignee(Optional.ofNullable(instance.getAssignee()).orElse(""));
|
||||
step.setComment("");
|
||||
step.setStatus(0);
|
||||
steps.add(step);
|
||||
}
|
||||
return steps;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaskStepVO> getHistorySteps(String processInstanceId) {
|
||||
return getTaskSteps(processInstanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TodoTaskRespVO getTaskFormKey(TaskQueryReqVO taskQuery) {
|
||||
final Task task = taskRuntime.task(taskQuery.getTaskId());
|
||||
// 转换结果
|
||||
TodoTaskRespVO respVO = new TodoTaskRespVO();
|
||||
respVO.setFormKey(task.getFormKey());
|
||||
respVO.setBusinessKey(task.getBusinessKey());
|
||||
respVO.setId(task.getId());
|
||||
return respVO;
|
||||
}
|
||||
|
||||
// private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) {
|
||||
//
|
||||
// List<String> highLightedFlows = new ArrayList<String>();
|
||||
// List<HistoricActivityInstance> historicActivityInstances = historyService
|
||||
// .createHistoricActivityInstanceQuery()
|
||||
// .processInstanceId(processInstanceId)
|
||||
// .orderByHistoricActivityInstanceStartTime().asc().list();
|
||||
//
|
||||
// List<String> historicActivityInstanceList = new ArrayList<String>();
|
||||
// for (HistoricActivityInstance hai : historicActivityInstances) {
|
||||
// historicActivityInstanceList.add(hai.getActivityId());
|
||||
// }
|
||||
|
||||
// // add current activities to list
|
||||
// List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
|
||||
// historicActivityInstanceList.addAll(highLightedActivities);
|
||||
|
||||
// activities and their sequence-flows
|
||||
// for (ActivityImpl activity : processDefinition.getActivities()) {
|
||||
// int index = historicActivityInstanceList.indexOf(activity.getId());
|
||||
//
|
||||
// if (index >= 0 && index + 1 < historicActivityInstanceList.size()) {
|
||||
// List<PvmTransition> pvmTransitionList = activity
|
||||
// .getOutgoingTransitions();
|
||||
// for (PvmTransition pvmTransition : pvmTransitionList) {
|
||||
// String destinationFlowId = pvmTransition.getDestination().getId();
|
||||
// if (destinationFlowId.equals(historicActivityInstanceList.get(index + 1))) {
|
||||
// highLightedFlows.add(pvmTransition.getId());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return highLightedFlows;
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "流程定义")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/process-definition")
|
||||
@Validated
|
||||
public class BpmProcessDefinitionController {
|
||||
|
||||
@Resource
|
||||
private BpmProcessDefinitionService bpmDefinitionService;
|
||||
|
||||
@GetMapping ("/page")
|
||||
@ApiOperation(value = "获得流程定义分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识
|
||||
public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage(
|
||||
BpmProcessDefinitionPageReqVO pageReqVO) {
|
||||
return success(bpmDefinitionService.getProcessDefinitionPage(pageReqVO));
|
||||
}
|
||||
|
||||
// TODO 芋艿:需要重写该方法
|
||||
@GetMapping(value = "/getStartForm")
|
||||
public CommonResult<String> getStartForm(@RequestParam("processKey") String processKey){
|
||||
// final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().
|
||||
// processDefinitionKey(processKey).latestVersion().singleResult();
|
||||
// processRuntime.processDefinition(processDefinition.getId()).getFormKey();
|
||||
// TODO 这样查似乎有问题??, 暂时写死
|
||||
return success("/flow/leave/apply");
|
||||
}
|
||||
|
||||
@GetMapping ("/get-bpmn-xml")
|
||||
@ApiOperation(value = "获得流程定义的 BPMN XML")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识
|
||||
public CommonResult<String> getProcessDefinitionBpmnXML(@RequestParam("id") String id) {
|
||||
String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id);
|
||||
return success(bpmnXML);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("流程定义的分页的每一项 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO {
|
||||
|
||||
@ApiModelProperty(value = "表单名字", example = "请假表单")
|
||||
private String formName;
|
||||
|
||||
@ApiModelProperty(value = "部署时间", required = true)
|
||||
private Date deploymentTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("流程定义分页 Request VO")
|
||||
public class BpmProcessDefinitionPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配")
|
||||
private String key;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("流程定义 Response VO")
|
||||
@Data
|
||||
public class BpmProcessDefinitionRespVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "版本", required = true, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "流程名称", required = true, example = "芋道")
|
||||
@NotEmpty(message = "流程名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "流程描述", example = "我是描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
|
||||
@NotEmpty(message = "流程分类不能为空")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "表单编号", example = "1024")
|
||||
private Long formId;
|
||||
|
||||
@ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
|
||||
private Integer suspensionState;
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.form.BpmFormConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "动态表单")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/form")
|
||||
@Validated
|
||||
public class BpmFormController {
|
||||
|
||||
@Resource
|
||||
private BpmFormService formService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建动态表单")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:form:create')")
|
||||
public CommonResult<Long> createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) {
|
||||
return success(formService.createForm(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新动态表单")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:form:update')")
|
||||
public CommonResult<Boolean> updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) {
|
||||
formService.updateForm(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除动态表单")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:form:delete')")
|
||||
public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) {
|
||||
formService.deleteForm(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得动态表单")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:form:query')")
|
||||
public CommonResult<BpmFormRespVO> getForm(@RequestParam("id") Long id) {
|
||||
BpmFormDO form = formService.getForm(id);
|
||||
return success(BpmFormConvert.INSTANCE.convert(form));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得动态表单的精简列表", notes = "用于表单下拉框")
|
||||
public CommonResult<List<BpmFormSimpleRespVO>> getSimpleForms() {
|
||||
List<BpmFormDO> list = formService.getFormList();
|
||||
return success(BpmFormConvert.INSTANCE.convertList2(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得动态表单分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:form:query')")
|
||||
public CommonResult<PageResult<BpmFormRespVO>> getFormPage(@Valid BpmFormPageReqVO pageVO) {
|
||||
PageResult<BpmFormDO> pageResult = formService.getFormPage(pageVO);
|
||||
return success(BpmFormConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 动态表单 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class BpmFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单名称", required = true, example = "芋道")
|
||||
@NotNull(message = "表单名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "表单状态", required = true, notes = "参见 CommonStatusEnum 枚举", example = "1")
|
||||
@NotNull(message = "表单状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("动态表单创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmFormCreateReqVO extends BpmFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串")
|
||||
@NotNull(message = "表单的配置不能为空")
|
||||
private String conf;
|
||||
|
||||
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组")
|
||||
@NotNull(message = "表单项的数组不能为空")
|
||||
private List<String> fields;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("动态表单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmFormPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "表单名称", example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("动态表单 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmFormRespVO extends BpmFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串")
|
||||
@NotNull(message = "表单的配置不能为空")
|
||||
private String conf;
|
||||
|
||||
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组")
|
||||
@NotNull(message = "表单项的数组不能为空")
|
||||
private List<String> fields;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("流程表单精简 Response VO")
|
||||
@Data
|
||||
public class BpmFormSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "表单编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "表单名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("动态表单更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmFormUpdateReqVO extends BpmFormBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表单编号", required = true, example = "1024")
|
||||
@NotNull(message = "表单编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串")
|
||||
@NotNull(message = "表单的配置不能为空")
|
||||
private String conf;
|
||||
|
||||
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组")
|
||||
@NotNull(message = "表单项的数组不能为空")
|
||||
private List<String> fields;
|
||||
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.model.BpmModelConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.model.BpmModelService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.io.IoUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "流程模型")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/model")
|
||||
@Validated
|
||||
public class BpmModelController {
|
||||
|
||||
@Resource
|
||||
private BpmModelService bpmModelService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation(value = "获得模型分页")
|
||||
public CommonResult<PageResult<BpmModelPageItemRespVO>> getModelPage(ModelPageReqVO pageVO) {
|
||||
return success(bpmModelService.getModelPage(pageVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得模型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:query')")
|
||||
public CommonResult<BpmModelRespVO> getModel(@RequestParam("id") String id) {
|
||||
BpmModelRespVO model = bpmModelService.getModel(id);
|
||||
return success(model);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation(value = "新建模型")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:create')")
|
||||
public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) {
|
||||
return success(bpmModelService.createModel(createRetVO));
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@ApiOperation(value = "导入模型")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:import')")
|
||||
public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException {
|
||||
BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO);
|
||||
// 读取文件
|
||||
createReqVO.setBpmnXml(IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false));
|
||||
return success(bpmModelService.createModel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation(value = "修改模型")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:update')")
|
||||
public CommonResult<Boolean> updateModel(@Valid @RequestBody BpmModelUpdateReqVO modelVO) {
|
||||
bpmModelService.updateModel(modelVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除模型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:delete')")
|
||||
public CommonResult<Boolean> deleteModel(@RequestParam("id") String id) {
|
||||
bpmModelService.deleteModel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/deploy")
|
||||
@ApiOperation(value = "部署模型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:deploy')")
|
||||
public CommonResult<Boolean> deployModel(@RequestParam("id") String id) {
|
||||
bpmModelService.deployModel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-state")
|
||||
@ApiOperation(value = "修改模型的状态", notes = "实际更新的部署的流程定义的状态")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:update')")
|
||||
public CommonResult<Boolean> updateModelState(@Valid @RequestBody BpmModelUpdateStateReqVO reqVO) {
|
||||
bpmModelService.updateModelState(reqVO.getId(), reqVO.getState());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("流程模型的导入 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModeImportReqVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "BPMN 文件", required = true)
|
||||
@NotNull(message = "BPMN 文件不能为空")
|
||||
private MultipartFile bpmnFile;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 流程模型 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "流程标识", required = true, example = "process_yudao")
|
||||
@NotEmpty(message = "流程标识不能为空")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "流程名称", required = true, example = "芋道")
|
||||
@NotEmpty(message = "流程名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "流程描述", example = "我是描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
|
||||
@NotEmpty(message = "流程分类不能为空")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "表单编号", example = "1024")
|
||||
private Long formId;
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("流程模型的创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelCreateReqVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "BPMN XML", required = true)
|
||||
@NotEmpty(message = "BPMN XML 不能为空")
|
||||
private String bpmnXml;
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("流程模型的分页的每一项 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelPageItemRespVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "表单名字", example = "请假表单")
|
||||
private String formName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最新部署的流程定义
|
||||
*/
|
||||
private ProcessDefinition processDefinition;
|
||||
|
||||
@ApiModel("流程定义")
|
||||
@Data
|
||||
public static class ProcessDefinition {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "版本", required = true, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "部署时间", required = true)
|
||||
private Date deploymentTime;
|
||||
|
||||
@ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
|
||||
private Integer suspensionState;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("流程模型的创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelRespVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "BPMN XML", required = true)
|
||||
private String bpmnXml;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("流程模型的更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelUpdateReqVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
@NotEmpty(message = "编号不能为空")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "BPMN XML", required = true)
|
||||
@NotEmpty(message = "BPMN XML 不能为空")
|
||||
private String bpmnXml;
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("流程模型更新状态 Request VO")
|
||||
@Data
|
||||
public class BpmModelUpdateStateReqVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SuspensionState 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer state;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
|
||||
@ApiModel("流程模型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ModelPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
|
||||
private String category;
|
||||
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.convert.oa.OaLeaveConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.oa.OaLeaveService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.oa.OALeaveConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.oa.OALeaveService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
@ -26,37 +26,35 @@ import java.util.List;
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
// TODO @jason:Oa=》OA 会不会好点,名词缩写哈
|
||||
|
||||
@Api(tags = "请假申请")
|
||||
@RestController
|
||||
@RequestMapping("/oa/leave")
|
||||
@Validated
|
||||
public class OaLeaveController {
|
||||
public class OALeaveController {
|
||||
|
||||
@Resource
|
||||
private OaLeaveService leaveService;
|
||||
private OALeaveService leaveService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建请假申请")
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:create')")
|
||||
public CommonResult<Long> createLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) {
|
||||
// TODO @芋艿:processKey 自己去理解下。不过得把 leave 变成枚举
|
||||
createReqVO.setProcessKey("leave");
|
||||
return success(leaveService.createLeave(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/form-key/create")
|
||||
@ApiOperation("创建外置请假申请")
|
||||
public CommonResult<Long> createFormKeyLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) {
|
||||
// TODO @芋艿:processKey 自己去理解下。不过得把 formkey 变成枚举
|
||||
createReqVO.setProcessKey("leave-formkey");
|
||||
public CommonResult<Long> createFormKeyLeave(@Valid @RequestBody OALeaveCreateReqVO createReqVO) {
|
||||
// processKey 前台传入
|
||||
return success(leaveService.createLeave(createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/getLeaveApplyMembers")
|
||||
@ApiOperation("获取本人请假申请流程中审批人员,可先检查这些人员是否存在")
|
||||
public CommonResult<OALeaveApplyMembersVO> getLeaveApplyMembers() {
|
||||
return success(leaveService.getLeaveApplyMembers());
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新请假申请")
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:update')")
|
||||
public CommonResult<Boolean> updateLeave(@Valid @RequestBody OaLeaveUpdateReqVO updateReqVO) {
|
||||
public CommonResult<Boolean> updateLeave(@Valid @RequestBody OALeaveUpdateReqVO updateReqVO) {
|
||||
leaveService.updateLeave(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
@ -74,41 +72,41 @@ public class OaLeaveController {
|
|||
@ApiOperation("获得请假申请")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
|
||||
public CommonResult<OaLeaveRespVO> getLeave(@RequestParam("id") Long id) {
|
||||
OaLeaveDO leave = leaveService.getLeave(id);
|
||||
return success(OaLeaveConvert.INSTANCE.convert(leave));
|
||||
public CommonResult<OALeaveRespVO> getLeave(@RequestParam("id") Long id) {
|
||||
OALeaveDO leave = leaveService.getLeave(id);
|
||||
return success(OALeaveConvert.INSTANCE.convert(leave));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得请假申请列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
|
||||
public CommonResult<List<OaLeaveRespVO>> getLeaveList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<OaLeaveDO> list = leaveService.getLeaveList(ids);
|
||||
return success(OaLeaveConvert.INSTANCE.convertList(list));
|
||||
public CommonResult<List<OALeaveRespVO>> getLeaveList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<OALeaveDO> list = leaveService.getLeaveList(ids);
|
||||
return success(OALeaveConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得请假申请分页")
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:query')")
|
||||
public CommonResult<PageResult<OaLeaveRespVO>> getLeavePage(@Valid OaLeavePageReqVO pageVO) {
|
||||
public CommonResult<PageResult<OALeaveRespVO>> getLeavePage(@Valid OALeavePageReqVO pageVO) {
|
||||
//值查询自己申请请假
|
||||
// TODO @芋艿:这里的传值,到底前端搞,还是后端搞。
|
||||
pageVO.setUserId(SecurityFrameworkUtils.getLoginUser().getUsername());
|
||||
PageResult<OaLeaveDO> pageResult = leaveService.getLeavePage(pageVO);
|
||||
return success(OaLeaveConvert.INSTANCE.convertPage(pageResult));
|
||||
PageResult<OALeaveDO> pageResult = leaveService.getLeavePage(pageVO);
|
||||
return success(OALeaveConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出请假申请 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('oa:leave:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportLeaveExcel(@Valid OaLeaveExportReqVO exportReqVO,
|
||||
public void exportLeaveExcel(@Valid OALeaveExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<OaLeaveDO> list = leaveService.getLeaveList(exportReqVO);
|
||||
List<OALeaveDO> list = leaveService.getLeaveList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<OaLeaveExcelVO> datas = OaLeaveConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "请假申请.xls", "数据", OaLeaveExcelVO.class, datas);
|
||||
List<OALeaveExcelVO> datas = OALeaveConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "请假申请.xls", "数据", OALeaveExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("请假申请审批人员 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@EqualsAndHashCode
|
||||
@ToString
|
||||
public class OALeaveApplyMembersVO {
|
||||
|
||||
@ApiModelProperty(value = "部门的hr")
|
||||
private String hr;
|
||||
|
||||
@ApiModelProperty(value = "部门的项目经理")
|
||||
private String pm;
|
||||
|
||||
@ApiModelProperty(value = "部门的部门经理")
|
||||
private String bm;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
@ -13,7 +13,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class OaLeaveBaseVO {
|
||||
public class OALeaveBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "流程id")
|
||||
private String processInstanceId;
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("请假申请创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OALeaveCreateReqVO extends OALeaveBaseVO {
|
||||
|
||||
/**
|
||||
* 对应 bpmn 文件 <process> 的 id
|
||||
*/
|
||||
@ApiModelProperty(value = "流程key")
|
||||
private String processKey;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "流程用户任务的变量")
|
||||
private Map<String,Object> taskVariables;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
|||
* @author 芋艿
|
||||
*/
|
||||
@Data
|
||||
public class OaLeaveExcelVO {
|
||||
public class OALeaveExcelVO {
|
||||
|
||||
@ExcelProperty("请假表单主键")
|
||||
private Long id;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
@ -10,7 +10,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@ApiModel(value = "请假申请 Excel 导出 Request VO", description = "参数和 OaLeavePageReqVO 是一致的")
|
||||
@Data
|
||||
public class OaLeaveExportReqVO {
|
||||
public class OALeaveExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "流程id")
|
||||
private String processInstanceId;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
@ -12,7 +12,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OaLeavePageReqVO extends PageParam {
|
||||
public class OALeavePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "流程id")
|
||||
private String processInstanceId;
|
|
@ -1,14 +1,13 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("请假申请 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OaLeaveRespVO extends OaLeaveBaseVO {
|
||||
public class OALeaveRespVO extends OALeaveBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "请假表单主键", required = true)
|
||||
private Long id;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -13,7 +13,7 @@ import java.util.Map;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OaLeaveUpdateReqVO extends OaLeaveBaseVO {
|
||||
public class OALeaveUpdateReqVO extends OALeaveBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "请假表单主键", required = true)
|
||||
@NotNull(message = "请假表单主键不能为空")
|
|
@ -0,0 +1,13 @@
|
|||
### 请求 /login 接口 => 成功
|
||||
POST {{baseUrl}}/bpm/process-instance/create
|
||||
Content-Type: application/json
|
||||
tenant-id: 1
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"processDefinitionId": "leave:7:20ada39c-6c95-11ec-88b1-cacd34981f8e",
|
||||
"variables": {
|
||||
"a": 1,
|
||||
"b": "2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.task;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.BpmProcessInstanceCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Api(tags = "流程实例") // 流程实例,通过流程定义创建的一次“申请”
|
||||
@RestController
|
||||
@RequestMapping("/bpm/process-instance")
|
||||
@Validated
|
||||
public class BpmProcessInstanceController {
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("新建流程实例")
|
||||
public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) {
|
||||
return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("流程实例的创建 Request VO")
|
||||
@Data
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
//@ToString(callSuper = true)
|
||||
public class BpmProcessInstanceCreateReqVO {
|
||||
|
||||
@ApiModelProperty(value = "流程定义的编号", required = true, example = "1024")
|
||||
@NotEmpty(message = "流程定义编号不能为空")
|
||||
private String processDefinitionId;
|
||||
|
||||
@ApiModelProperty(value = "变量实例")
|
||||
private Map<String, Object> variables;
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
public class BpmProcessInstanceMyPageReqVO extends PageParam {
|
||||
}
|
|
@ -1,15 +1,18 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.TaskService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
@ -21,40 +24,50 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|||
public class TaskController {
|
||||
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
private BpmTaskService bpmTaskService;
|
||||
|
||||
@GetMapping("/todo/page")
|
||||
@ApiOperation("获取待办任务分页")
|
||||
public CommonResult<PageResult<TodoTaskRespVO>> getTodoTaskPage(@Valid TodoTaskPageReqVO pageVO) {
|
||||
return success(taskService.getTodoTaskPage(pageVO));
|
||||
return success(bpmTaskService.getTodoTaskPage(pageVO));
|
||||
}
|
||||
|
||||
@GetMapping("/claim")
|
||||
@ApiOperation("签收任务")
|
||||
public CommonResult<Boolean> claimTask(@RequestParam("id") String taskId) {
|
||||
taskService.claimTask(taskId);
|
||||
bpmTaskService.claimTask(taskId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/task-steps")
|
||||
public CommonResult<TaskHandleVO> getTaskSteps(@RequestBody TaskQueryReqVO taskQuery) {
|
||||
return success(taskService.getTaskSteps(taskQuery));
|
||||
return success(bpmTaskService.getTaskSteps(taskQuery));
|
||||
}
|
||||
|
||||
@PostMapping("/formKey")
|
||||
public CommonResult<TodoTaskRespVO> getTaskFormKey(@RequestBody TaskQueryReqVO taskQuery) {
|
||||
return success(taskService.getTaskFormKey(taskQuery));
|
||||
return success(bpmTaskService.getTaskFormKey(taskQuery));
|
||||
}
|
||||
|
||||
@PostMapping("/complete")
|
||||
public CommonResult<Boolean> complete(@RequestBody TaskReqVO taskReq) {
|
||||
taskService.completeTask(taskReq);
|
||||
bpmTaskService.completeTask(taskReq);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/process/history-steps")
|
||||
public CommonResult<List<TaskStepVO>> getHistorySteps(@RequestParam("id") String processInstanceId) {
|
||||
return success(taskService.getHistorySteps(processInstanceId));
|
||||
return success(bpmTaskService.getHistorySteps(processInstanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回高亮的流转图SVG
|
||||
* @param processInstanceId 流程Id
|
||||
*/
|
||||
@GetMapping("/process/highlight-img")
|
||||
public void getHighlightImg(@RequestParam String processInstanceId, HttpServletResponse response) throws IOException {
|
||||
FileResp fileResp = bpmTaskService.getHighlightImg(processInstanceId);
|
||||
ServletUtils.writeAttachment(response, fileResp.getFileName(), fileResp.getFileByte());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @Li:1)改成 HighlightImgRespVO 吧。2)swagger 注解要补充;3)fileByte => fileContent
|
||||
/**
|
||||
* 文件输出类
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Data
|
||||
public class FileResp {
|
||||
|
||||
/**
|
||||
* 文件名字
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件输出流
|
||||
*/
|
||||
private byte[] fileByte;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
|
@ -1,8 +1,7 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("待办任务 Response VO")
|
||||
|
@ -10,8 +9,13 @@ import lombok.ToString;
|
|||
@ToString
|
||||
public class TodoTaskRespVO {
|
||||
|
||||
// TODO @jason:swagger 注解。这样接口文档才完整哈
|
||||
|
||||
private String id;
|
||||
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 1:未签收
|
||||
* 2:已签收
|
|
@ -0,0 +1,58 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.definition;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import org.activiti.engine.impl.persistence.entity.SuspensionState;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Bpm 流程定义的 Convert
|
||||
*
|
||||
* @author yunlong.li
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmDefinitionConvert {
|
||||
|
||||
BpmDefinitionConvert INSTANCE = Mappers.getMapper(BpmDefinitionConvert.class);
|
||||
|
||||
default List<BpmProcessDefinitionPageItemRespVO> convertList(List<ProcessDefinition> list, Map<String, Deployment> deploymentMap,
|
||||
Map<String, BpmProcessDefinitionDO> processDefinitionDOMap, Map<Long, BpmFormDO> formMap) {
|
||||
return CollectionUtils.convertList(list, definition -> {
|
||||
Deployment deployment = definition.getDeploymentId() != null ? deploymentMap.get(definition.getDeploymentId()) : null;
|
||||
BpmProcessDefinitionDO definitionDO = processDefinitionDOMap.get(definition.getId());
|
||||
BpmFormDO form = definitionDO != null ? formMap.get(definitionDO.getFormId()) : null;
|
||||
return convert(definition, deployment, definitionDO, form);
|
||||
});
|
||||
}
|
||||
|
||||
default BpmProcessDefinitionPageItemRespVO convert(ProcessDefinition bean, Deployment deployment,
|
||||
BpmProcessDefinitionDO processDefinitionDO, BpmFormDO form) {
|
||||
BpmProcessDefinitionPageItemRespVO respVO = convert(bean);
|
||||
respVO.setSuspensionState(bean.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
|
||||
if (deployment != null) {
|
||||
respVO.setDeploymentTime(deployment.getDeploymentTime());
|
||||
}
|
||||
if (form != null) {
|
||||
respVO.setFormId(form.getId());
|
||||
respVO.setFormName(form.getName());
|
||||
}
|
||||
if (processDefinitionDO != null) {
|
||||
respVO.setDescription(processDefinitionDO.getDescription());
|
||||
}
|
||||
return respVO;
|
||||
}
|
||||
|
||||
BpmProcessDefinitionPageItemRespVO convert(ProcessDefinition bean);
|
||||
|
||||
BpmProcessDefinitionDO convert2(BpmDefinitionCreateReqDTO bean);
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.form;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormSimpleRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态表单 Convert
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmFormConvert {
|
||||
|
||||
BpmFormConvert INSTANCE = Mappers.getMapper(BpmFormConvert.class);
|
||||
|
||||
BpmFormDO convert(BpmFormCreateReqVO bean);
|
||||
|
||||
BpmFormDO convert(BpmFormUpdateReqVO bean);
|
||||
|
||||
BpmFormRespVO convert(BpmFormDO bean);
|
||||
|
||||
List<BpmFormSimpleRespVO> convertList2(List<BpmFormDO> list);
|
||||
|
||||
PageResult<BpmFormRespVO> convertPage(PageResult<BpmFormDO> page);
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.model;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.model.dto.BpmModelMetaInfoRespDTO;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import org.activiti.engine.impl.persistence.entity.SuspensionState;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 流程定义 Convert
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmModelConvert {
|
||||
|
||||
BpmModelConvert INSTANCE = Mappers.getMapper(BpmModelConvert.class);
|
||||
|
||||
default List<BpmModelPageItemRespVO> convertList(List<Model> list, Map<Long, BpmFormDO> formMap,
|
||||
Map<String, Deployment> deploymentMap,
|
||||
Map<String, ProcessDefinition> processDefinitionMap) {
|
||||
return CollectionUtils.convertList(list, model -> {
|
||||
BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
|
||||
BpmFormDO form = metaInfo != null ? formMap.get(metaInfo.getFormId()) : null;
|
||||
Deployment deployment = model.getDeploymentId() != null ? deploymentMap.get(model.getDeploymentId()) : null;
|
||||
ProcessDefinition processDefinition = model.getDeploymentId() != null ? processDefinitionMap.get(model.getDeploymentId()) : null;
|
||||
return convert(model, form, deployment, processDefinition);
|
||||
});
|
||||
}
|
||||
|
||||
default BpmModelPageItemRespVO convert(Model model, BpmFormDO form, Deployment deployment, ProcessDefinition processDefinition) {
|
||||
BpmModelPageItemRespVO modelRespVO = new BpmModelPageItemRespVO();
|
||||
modelRespVO.setId(model.getId());
|
||||
modelRespVO.setName(model.getName());
|
||||
modelRespVO.setKey(model.getKey());
|
||||
modelRespVO.setCategory(model.getCategory());
|
||||
modelRespVO.setCreateTime(model.getCreateTime());
|
||||
BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
|
||||
if (metaInfo != null) {
|
||||
modelRespVO.setDescription(metaInfo.getDescription());
|
||||
}
|
||||
if (form != null) {
|
||||
modelRespVO.setFormId(form.getId());
|
||||
modelRespVO.setFormName(form.getName());
|
||||
}
|
||||
modelRespVO.setProcessDefinition(this.convert(processDefinition));
|
||||
if (modelRespVO.getProcessDefinition() != null) {
|
||||
modelRespVO.getProcessDefinition().setSuspensionState(processDefinition.isSuspended() ?
|
||||
SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
|
||||
modelRespVO.getProcessDefinition().setDeploymentTime(deployment.getDeploymentTime());
|
||||
}
|
||||
return modelRespVO;
|
||||
}
|
||||
|
||||
default BpmModelRespVO convert(Model model) {
|
||||
BpmModelRespVO modelRespVO = new BpmModelRespVO();
|
||||
modelRespVO.setId(model.getId());
|
||||
modelRespVO.setName(model.getName());
|
||||
modelRespVO.setKey(model.getKey());
|
||||
modelRespVO.setCategory(model.getCategory());
|
||||
modelRespVO.setCreateTime(model.getCreateTime());
|
||||
BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
|
||||
if (metaInfo != null) {
|
||||
modelRespVO.setFormId(metaInfo.getFormId());
|
||||
modelRespVO.setDescription(metaInfo.getDescription());
|
||||
}
|
||||
return modelRespVO;
|
||||
}
|
||||
|
||||
default BpmDefinitionCreateReqDTO convert2(Model model) {
|
||||
BpmDefinitionCreateReqDTO createReqDTO = new BpmDefinitionCreateReqDTO();
|
||||
createReqDTO.setName(model.getName());
|
||||
createReqDTO.setKey(model.getKey());
|
||||
createReqDTO.setCategory(model.getCategory());
|
||||
BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
|
||||
if (metaInfo != null) {
|
||||
createReqDTO.setDescription(metaInfo.getDescription());
|
||||
createReqDTO.setFormId(metaInfo.getFormId());
|
||||
}
|
||||
return createReqDTO;
|
||||
}
|
||||
|
||||
default void copy(Model model, BpmModelCreateReqVO bean) {
|
||||
model.setName(bean.getName());
|
||||
model.setKey(bean.getKey());
|
||||
model.setCategory(bean.getCategory());
|
||||
model.setMetaInfo(JsonUtils.toJsonString(this.buildMetaInfo(bean.getDescription(), bean.getFormId())));
|
||||
}
|
||||
|
||||
default void copy(Model model, BpmModelUpdateReqVO bean) {
|
||||
model.setName(bean.getName());
|
||||
model.setCategory(bean.getCategory());
|
||||
model.setMetaInfo(JsonUtils.toJsonString(this.buildMetaInfo(bean.getDescription(), bean.getFormId())));
|
||||
}
|
||||
|
||||
default BpmModelMetaInfoRespDTO buildMetaInfo(String description, Long formId) {
|
||||
BpmModelMetaInfoRespDTO metaInfo = new BpmModelMetaInfoRespDTO();
|
||||
metaInfo.setDescription(description);
|
||||
metaInfo.setFormId(formId);
|
||||
return metaInfo;
|
||||
}
|
||||
|
||||
BpmModelPageItemRespVO.ProcessDefinition convert(ProcessDefinition bean);
|
||||
|
||||
BpmModelCreateReqVO convert(BpmModeImportReqVO bean);
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.oa;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveExcelVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveUpdateReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 请假申请 Convert
|
||||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
@Mapper
|
||||
public interface OALeaveConvert {
|
||||
|
||||
OALeaveConvert INSTANCE = Mappers.getMapper(OALeaveConvert.class);
|
||||
|
||||
OALeaveDO convert(OALeaveCreateReqVO bean);
|
||||
|
||||
OALeaveDO convert(OALeaveUpdateReqVO bean);
|
||||
|
||||
OALeaveRespVO convert(OALeaveDO bean);
|
||||
|
||||
List<OALeaveRespVO> convertList(List<OALeaveDO> list);
|
||||
|
||||
PageResult<OALeaveRespVO> convertPage(PageResult<OALeaveDO> page);
|
||||
|
||||
List<OALeaveExcelVO> convertList02(List<OALeaveDO> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* 提供 POJO 类的实体转换
|
||||
*
|
||||
* 目前使用 MapStruct 框架
|
||||
*/
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.convert;
|
|
@ -0,0 +1,44 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.workflow;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.TaskStepVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.TodoTaskRespVO;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import org.activiti.engine.history.HistoricActivityInstance;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.Named;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface TaskConvert {
|
||||
TaskConvert INSTANCE = Mappers.getMapper(TaskConvert.class);
|
||||
|
||||
@Mappings(value = {
|
||||
@Mapping(source = "task.id", target = "id"),
|
||||
@Mapping(source = "task.businessKey", target = "businessKey"),
|
||||
@Mapping(source = "task.assignee", target = "status",qualifiedByName = "convertAssigneeToStatus"),
|
||||
@Mapping(source = "definition.name", target = "processName"),
|
||||
@Mapping(source = "definition.key", target = "processKey"),
|
||||
@Mapping(source = "definition.id", target = "processInstanceId")
|
||||
})
|
||||
TodoTaskRespVO convert(Task task, ProcessDefinition definition);
|
||||
|
||||
@Mappings(value = {
|
||||
@Mapping(source = "assignee", target = "status",qualifiedByName = "convertAssigneeToStatus")
|
||||
})
|
||||
TodoTaskRespVO convert(Task task);
|
||||
|
||||
@Named("convertAssigneeToStatus")
|
||||
default Integer convertAssigneeToStatus(String assignee) {
|
||||
//TODO 不应该通过 assignee 定义状态 需要定义更多的状态
|
||||
return assignee == null ? 1 : 2;
|
||||
}
|
||||
|
||||
@Mappings(value = {
|
||||
@Mapping(source = "activityName", target = "stepName"),
|
||||
@Mapping(source = "assignee", target = "assignee")
|
||||
})
|
||||
TaskStepVO convert(HistoricActivityInstance instance);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao>
|
|
@ -0,0 +1,47 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
|
||||
/**
|
||||
* Bpm 流程定义的拓展表
|
||||
* 主要解决 主要进行 Activiti {@link ProcessDefinition} 不支持拓展字段,所以新建拓展表
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName(value = "bpm_process_definition", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmProcessDefinitionDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 流程定义的编号
|
||||
*
|
||||
* 关联 {@link ProcessDefinition#getId()}
|
||||
*/
|
||||
private String processDefinitionId;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 表单编号
|
||||
*
|
||||
* 关联 {@link BpmFormDO#getId()}
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
@ -15,14 +15,14 @@ import java.util.List;
|
|||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName(value = "wf_form", autoResultMap = true)
|
||||
@TableName(value = "bpm_form", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WfForm extends BaseDO {
|
||||
public class BpmFormDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
|
@ -38,11 +38,11 @@ public class WfForm extends BaseDO {
|
|||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 表单JSON
|
||||
* 表单的配置
|
||||
*/
|
||||
private String formJson;
|
||||
private String conf;
|
||||
/**
|
||||
* 表单配置
|
||||
* 表单项的数组
|
||||
*
|
||||
* 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存
|
||||
* 定义:https://github.com/JakHuang/form-generator/issues/46
|
||||
|
@ -54,4 +54,4 @@ public class WfForm extends BaseDO {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
@ -15,14 +15,14 @@ import java.util.Map;
|
|||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName(value = "wf_form", autoResultMap = true)
|
||||
@TableName(value = "bpm_form_data", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WfFormData extends BaseDO {
|
||||
public class BpmFormDataDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
|
@ -31,7 +31,7 @@ public class WfFormData extends BaseDO {
|
|||
/**
|
||||
* 表单编号
|
||||
*
|
||||
* 关联 {@link WfForm#getId()}
|
||||
* 关联 {@link BpmFormDO#getId()}
|
||||
*/
|
||||
private Long formId;
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ public class WfFormData extends BaseDO {
|
|||
/**
|
||||
* 表单配置
|
||||
*
|
||||
* 冗余 {@link WfForm#getFields()}
|
||||
* 冗余 {@link BpmFormDO#getFields()}
|
||||
* 主要考虑,表单是可以修改的
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
@ -17,7 +17,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OaLeaveDO extends BaseDO {
|
||||
public class OALeaveDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 请假表单主键
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* TODO 芋艿:实现请假流程,接入工作流
|
||||
*/
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave;
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* TODO 芋艿:工作流创建后的定义
|
||||
*/
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.task;
|
|
@ -0,0 +1,18 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BpmProcessDefinitionMapper extends BaseMapper<BpmProcessDefinitionDO> {
|
||||
|
||||
default List<BpmProcessDefinitionDO> selectListByProcessDefinitionIds(Collection<String> processDefinitionIds) {
|
||||
return selectList(new QueryWrapper<BpmProcessDefinitionDO>().in("process_definition_id", processDefinitionIds));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.form;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 动态表单 Mapper
|
||||
*
|
||||
* @author 风里雾里
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmFormMapper extends BaseMapperX<BpmFormDO> {
|
||||
|
||||
default PageResult<BpmFormDO> selectPage(BpmFormPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<BpmFormDO>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.orderByDesc("id"));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.oa;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeavePageReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
|
||||
|
||||
/**
|
||||
* 请假申请 Mapper
|
||||
|
@ -15,10 +16,10 @@ import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.*;
|
|||
* @author 芋艿
|
||||
*/
|
||||
@Mapper
|
||||
public interface OaLeaveMapper extends BaseMapperX<OaLeaveDO> {
|
||||
public interface OALeaveMapper extends BaseMapperX<OALeaveDO> {
|
||||
|
||||
default PageResult<OaLeaveDO> selectPage(OaLeavePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<OaLeaveDO>()
|
||||
default PageResult<OALeaveDO> selectPage(OALeavePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<OALeaveDO>()
|
||||
.eqIfPresent("process_instance_id", reqVO.getProcessInstanceId())
|
||||
.eqIfPresent("status", reqVO.getStatus())
|
||||
.eqIfPresent("user_id", reqVO.getUserId())
|
||||
|
@ -30,8 +31,8 @@ public interface OaLeaveMapper extends BaseMapperX<OaLeaveDO> {
|
|||
.orderByDesc("id") );
|
||||
}
|
||||
|
||||
default List<OaLeaveDO> selectList(OaLeaveExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<OaLeaveDO>()
|
||||
default List<OALeaveDO> selectList(OALeaveExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<OALeaveDO>()
|
||||
.eqIfPresent("process_instance_id", reqVO.getProcessInstanceId())
|
||||
.eqIfPresent("status", reqVO.getStatus())
|
||||
.eqIfPresent("user_id", reqVO.getUserId())
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* 工作流 错误码枚举类
|
||||
*
|
||||
* 工作流系统,使用 1-009-000-000 段
|
||||
*/
|
||||
public interface BpmErrorCodeConstants {
|
||||
|
||||
// ========== 通用流程处理 模块 1-009-000-000 ==========
|
||||
ErrorCode PROCESS_INSTANCE_NOT_EXISTS = new ErrorCode(1009000001, "流程实例不存在");
|
||||
ErrorCode HIGHLIGHT_IMG_ERROR = new ErrorCode(1009000002, "获取高亮流程图异常");
|
||||
|
||||
// ========== OA 流程模块 1-009-001-000 ==========
|
||||
ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1009001001, "请假申请不存在");
|
||||
ErrorCode OA_PM_POST_NOT_EXISTS = new ErrorCode(1009001002, "项目经理岗位未设置");
|
||||
ErrorCode OA_DEPART_PM_POST_NOT_EXISTS = new ErrorCode(1009001009, "部门的项目经理不存在");
|
||||
ErrorCode OA_BM_POST_NOT_EXISTS = new ErrorCode(1009001004, "部门经理岗位未设置");
|
||||
ErrorCode OA_DEPART_BM_POST_NOT_EXISTS = new ErrorCode(1009001005, "部门的部门经理不存在");
|
||||
ErrorCode OA_HR_POST_NOT_EXISTS = new ErrorCode(1009001006, "HR岗位未设置");
|
||||
ErrorCode OA_DAY_LEAVE_ERROR = new ErrorCode(1009001007, "请假天数必须>=1");
|
||||
|
||||
// ========== 流程模型 1-009-002-000 ==========
|
||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1009002000, "已经存在流程标识为【{}】的流程");
|
||||
ErrorCode MODEL_NOT_EXISTS = new ErrorCode(1009002001, "流程模型不存在");
|
||||
ErrorCode MODEL_KEY_VALID = new ErrorCode(1009002002, "流程标识格式不正确,需要以字母或下划线开头,后接任意字母、数字、中划线、下划线、句点!");
|
||||
|
||||
// ========== 流程定义 1-009-003-000 ==========
|
||||
ErrorCode PROCESS_DEFINITION_KEY_NOT_MATCH = new ErrorCode(1009003000, "流程定义的标识期望是({}),当前是({}),请修改 BPMN 流程图");
|
||||
ErrorCode PROCESS_DEFINITION_NAME_NOT_MATCH = new ErrorCode(1009003001, "流程定义的名字期望是({}),当前是({}),请修改 BPMN 流程图");
|
||||
ErrorCode PROCESS_DEFINITION_NOT_EXISTS = new ErrorCode(1009003002, "流程定义不存在");
|
||||
ErrorCode PROCESS_DEFINITION_IS_SUSPENDED = new ErrorCode(1009003002, "流程定义处于挂起状态");
|
||||
|
||||
// ========== 流程实例 1-009-004-000 ==========
|
||||
|
||||
|
||||
// ========== 动态表单模块 1-009-010-000 ==========
|
||||
ErrorCode FORM_NOT_EXISTS = new ErrorCode(1009010000, "动态表单不存在");
|
||||
ErrorCode FORM_FIELD_REPEAT = new ErrorCode(1009010000, "表单项({}) 和 ({}) 使用了相同的字段名({})");
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FlowStatusEnum {
|
||||
|
||||
HANDLE(1, "处理中"),
|
||||
|
||||
PASS(2, "审批通过"),
|
||||
|
||||
REJECTED(3, "审批不通过");
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String desc;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* bpm 包下,业务流程管理(Business Process Management),我们放工作流的功能,基于 activiti 7 版本实现。
|
||||
* 例如说:流程定义、表单配置、审核中心(我的申请、我的待办、我的已办)等等
|
||||
*
|
||||
* bpm 解释:https://baike.baidu.com/item/BPM/1933
|
||||
*
|
||||
* 缩写:bpm
|
||||
*/
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.config;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.service.config;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.system.service.dept.SysPostService;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.config;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.service.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import org.activiti.api.runtime.shared.security.PrincipalGroupsProvider;
|
|
@ -0,0 +1,115 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.definition;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 流程定义接口
|
||||
*
|
||||
* @author yunlong.li
|
||||
* @author ZJQ
|
||||
*/
|
||||
public interface BpmProcessDefinitionService {
|
||||
|
||||
/**
|
||||
* 获得流程定义分页
|
||||
*
|
||||
* @param pageReqVO 分页入参
|
||||
* @return 流程定义 Page
|
||||
*/
|
||||
PageResult<BpmProcessDefinitionPageItemRespVO> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得流程定义对应的 BPMN XML
|
||||
*
|
||||
* @param id 流程定义编号
|
||||
* @return BPMN XML
|
||||
*/
|
||||
String getProcessDefinitionBpmnXML(String id);
|
||||
|
||||
/**
|
||||
* 获得 Bpmn 模型
|
||||
*
|
||||
* @param processDefinitionId 流程定义的编号
|
||||
* @return Bpmn 模型
|
||||
*/
|
||||
BpmnModel getBpmnModel(String processDefinitionId);
|
||||
|
||||
/**
|
||||
* 获得编号对应的 ProcessDefinition
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 流程定义
|
||||
*/
|
||||
ProcessDefinition getProcessDefinition(String id);
|
||||
|
||||
/**
|
||||
* 获得 id 对应的 Deployment
|
||||
*
|
||||
* @param id 部署编号
|
||||
* @return 流程部署
|
||||
*/
|
||||
Deployment getDeployment(String id);
|
||||
|
||||
/**
|
||||
* 获得 ids 对应的 Deployment 数组
|
||||
*
|
||||
* @param ids 部署编号的数组
|
||||
* @return 流程部署的数组
|
||||
*/
|
||||
List<Deployment> getDeployments(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 获得 ids 对应的 Deployment Map
|
||||
*
|
||||
* @param ids 部署编号的数组
|
||||
* @return 流程部署 Map
|
||||
*/
|
||||
default Map<String, Deployment> getDeploymentMap(Set<String> ids) {
|
||||
return CollectionUtils.convertMap(getDeployments(ids), Deployment::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得 deploymentId 对应的 ProcessDefinition
|
||||
*
|
||||
* @param deploymentId 部署编号
|
||||
* @return 流程定义
|
||||
*/
|
||||
ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId);
|
||||
|
||||
/**
|
||||
* 获得 deploymentIds 对应的 ProcessDefinition 数组
|
||||
*
|
||||
* @param deploymentIds 部署编号的数组
|
||||
* @return 流程定义的数组
|
||||
*/
|
||||
List<ProcessDefinition> getProcessDefinitionListByDeploymentIds(Set<String> deploymentIds);
|
||||
|
||||
/**
|
||||
* 创建流程定义
|
||||
*
|
||||
* @param createReqDTO 创建信息
|
||||
* @return 流程编号
|
||||
*/
|
||||
String createProcessDefinition(@Valid BpmDefinitionCreateReqDTO createReqDTO);
|
||||
|
||||
/**
|
||||
* 更新流程定义的挂起状态
|
||||
*
|
||||
* @param id 流程定义的编号
|
||||
* @param state 挂起状态 {@link org.activiti.engine.impl.persistence.entity.SuspensionState}
|
||||
*/
|
||||
void updateProcessDefinitionState(String id, Integer state);
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 流程定义创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
public class BpmDefinitionCreateReqDTO {
|
||||
|
||||
/**
|
||||
* 流程标识
|
||||
*/
|
||||
@NotEmpty(message = "流程标识不能为空")
|
||||
private String key;
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@NotEmpty(message = "流程名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 流程分类
|
||||
* 参见 bpm_model_category 数据字典
|
||||
*/
|
||||
@NotEmpty(message = "流程分类不能为空")
|
||||
private String category;
|
||||
/**
|
||||
* BPMN XML
|
||||
*/
|
||||
@NotEmpty(message = "BPMN XML 不能为空")
|
||||
private String bpmnXml;
|
||||
/**
|
||||
* 动态表单编号,允许空
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmDefinitionConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition.BpmProcessDefinitionMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.PageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.bpmn.converter.BpmnXMLConverter;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.impl.persistence.entity.SuspensionState;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.repository.ProcessDefinitionQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_KEY_NOT_MATCH;
|
||||
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_NAME_NOT_MATCH;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
/**
|
||||
* 流程定义实现
|
||||
* 主要进行 Activiti {@link ProcessDefinition} 和 {@link Deployment} 的维护
|
||||
*
|
||||
* @author yunlongn
|
||||
* @author ZJQ
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionService {
|
||||
|
||||
private static final String BPMN_FILE_SUFFIX = ".bpmn";
|
||||
|
||||
private static final BpmnXMLConverter BPMN_XML_CONVERTER = new BpmnXMLConverter();
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
@Resource
|
||||
private BpmFormService bpmFormService;
|
||||
|
||||
@Resource
|
||||
private BpmProcessDefinitionMapper processDefinitionMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<BpmProcessDefinitionPageItemRespVO> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) {
|
||||
ProcessDefinitionQuery definitionQuery = repositoryService.createProcessDefinitionQuery();
|
||||
if (StrUtil.isNotBlank(pageVO.getKey())) {
|
||||
definitionQuery.processDefinitionKey(pageVO.getKey());
|
||||
}
|
||||
// 执行查询
|
||||
List<ProcessDefinition> processDefinitions = definitionQuery.orderByProcessDefinitionId().desc()
|
||||
.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
|
||||
if (CollUtil.isEmpty(processDefinitions)) {
|
||||
return new PageResult<>(Collections.emptyList(), definitionQuery.count());
|
||||
}
|
||||
|
||||
// 获得 Deployment Map
|
||||
Set<String> deploymentIds = new HashSet<>();
|
||||
processDefinitions.forEach(definition -> CollectionUtils.addIfNotNull(deploymentIds, definition.getDeploymentId()));
|
||||
Map<String, Deployment> deploymentMap = getDeploymentMap(deploymentIds);
|
||||
|
||||
// 获得 BpmProcessDefinitionDO Map
|
||||
List<BpmProcessDefinitionDO> processDefinitionDOs = Collections.emptyList();
|
||||
processDefinitionDOs = processDefinitionMapper.selectListByProcessDefinitionIds(
|
||||
convertList(processDefinitions, ProcessDefinition::getId));
|
||||
Map<String, BpmProcessDefinitionDO> processDefinitionDOMap = CollectionUtils.convertMap(processDefinitionDOs,
|
||||
BpmProcessDefinitionDO::getProcessDefinitionId);
|
||||
|
||||
// 获得 Form Map
|
||||
Set<Long> formIds = CollectionUtils.convertSet(processDefinitionDOs, BpmProcessDefinitionDO::getFormId);
|
||||
Map<Long, BpmFormDO> formMap = bpmFormService.getFormMap(formIds);
|
||||
|
||||
// 拼接结果
|
||||
long definitionCount = definitionQuery.count();
|
||||
return new PageResult<>(BpmDefinitionConvert.INSTANCE.convertList(processDefinitions, deploymentMap,
|
||||
processDefinitionDOMap, formMap), definitionCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessDefinitionBpmnXML(String id) {
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(id);
|
||||
if (bpmnModel == null) {
|
||||
return null;
|
||||
}
|
||||
byte[] bpmnBytes = BPMN_XML_CONVERTER.convertToXML(bpmnModel);
|
||||
return StrUtil.utf8Str(bpmnBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmnModel getBpmnModel(String processDefinitionId) {
|
||||
return repositoryService.getBpmnModel(processDefinitionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessDefinition getProcessDefinition(String id) {
|
||||
return repositoryService.getProcessDefinition(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Deployment getDeployment(String id) {
|
||||
if (StrUtil.isEmpty(id)) {
|
||||
return null;
|
||||
}
|
||||
return repositoryService.createDeploymentQuery().deploymentId(id).singleResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Deployment> getDeployments(Set<String> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Deployment> list = new ArrayList<>(ids.size());
|
||||
for (String id : ids) {
|
||||
CollectionUtils.addIfNotNull(list, getDeployment(id));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId) {
|
||||
return repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessDefinition> getProcessDefinitionListByDeploymentIds(Set<String> deploymentIds) {
|
||||
if (CollUtil.isEmpty(deploymentIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return repositoryService.createProcessDefinitionQuery().deploymentIds(deploymentIds).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务
|
||||
public String createProcessDefinition(BpmDefinitionCreateReqDTO createReqDTO) {
|
||||
// 创建 Deployment 部署
|
||||
Deployment deploy = repositoryService.createDeployment()
|
||||
.key(createReqDTO.getKey()).name(createReqDTO.getName()).category(createReqDTO.getCategory())
|
||||
.addString(createReqDTO.getName() + BPMN_FILE_SUFFIX, createReqDTO.getBpmnXml())
|
||||
.deploy();
|
||||
|
||||
// 设置 ProcessDefinition 的 category 分类
|
||||
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deploy.getId()).singleResult();
|
||||
repositoryService.setProcessDefinitionCategory(definition.getId(), createReqDTO.getCategory());
|
||||
// 注意 1,ProcessDefinition 的 key 和 name 是通过 BPMN 中的 <bpmn2:process /> 的 id 和 name 决定
|
||||
// 注意 2,目前该项目的设计上,需要保证 Model、Deployment、ProcessDefinition 使用相同的 key,保证关联性。
|
||||
// 否则,会导致 ProcessDefinition 的分页无法查询到。
|
||||
if (!Objects.equals(definition.getKey(), createReqDTO.getKey())) {
|
||||
throw exception(PROCESS_DEFINITION_KEY_NOT_MATCH, createReqDTO.getKey(), definition.getKey());
|
||||
}
|
||||
if (!Objects.equals(definition.getName(), createReqDTO.getName())) {
|
||||
throw exception(PROCESS_DEFINITION_NAME_NOT_MATCH, createReqDTO.getName(), definition.getName());
|
||||
}
|
||||
|
||||
// 插入拓展表
|
||||
BpmProcessDefinitionDO definitionDO = BpmDefinitionConvert.INSTANCE.convert2(createReqDTO)
|
||||
.setProcessDefinitionId(definition.getId());
|
||||
processDefinitionMapper.insert(definitionDO);
|
||||
return definition.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessDefinitionState(String id, Integer state) {
|
||||
// 激活
|
||||
if (Objects.equals(SuspensionState.ACTIVE.getStateCode(), state)) {
|
||||
repositoryService.activateProcessDefinitionById(id, true, null);
|
||||
return;
|
||||
}
|
||||
// 挂起
|
||||
if (Objects.equals(SuspensionState.SUSPENDED.getStateCode(), state)) {
|
||||
repositoryService.suspendProcessDefinitionById(id, true, null);
|
||||
return;
|
||||
}
|
||||
log.error("[updateProcessDefinitionState][流程定义({}) 修改未知状态({})]", id, state);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.form;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import org.activiti.engine.repository.Model;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 动态表单 Service 接口
|
||||
*
|
||||
* @author @风里雾里
|
||||
*/
|
||||
public interface BpmFormService {
|
||||
|
||||
/**
|
||||
* 创建动态表单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createForm(@Valid BpmFormCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新动态表单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateForm(@Valid BpmFormUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除动态表单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得动态表单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 动态表单
|
||||
*/
|
||||
BpmFormDO getForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得动态表单列表
|
||||
*
|
||||
* @return 动态表单列表
|
||||
*/
|
||||
List<BpmFormDO> getFormList();
|
||||
|
||||
/**
|
||||
* 获得动态表单列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 动态表单列表
|
||||
*/
|
||||
List<BpmFormDO> getFormList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得动态表单 Map
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 动态表单 Map
|
||||
*/
|
||||
default Map<Long, BpmFormDO> getFormMap(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
return CollectionUtils.convertMap(this.getFormList(ids), BpmFormDO::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得动态表单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 动态表单分页
|
||||
*/
|
||||
PageResult<BpmFormDO> getFormPage(BpmFormPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.form.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Bpm 表单的 Field 表单项 Response DTO
|
||||
* 字段的定义,可见 https://github.com/JakHuang/form-generator/issues/46 文档
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class BpmFormFieldRespDTO {
|
||||
|
||||
/**
|
||||
* 表单标题
|
||||
*/
|
||||
private String label;
|
||||
/**
|
||||
* 表单字段的属性名,可自定义
|
||||
*/
|
||||
@JsonProperty(value = "vModel")
|
||||
private String vModel;
|
||||
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.form.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.form.BpmFormConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.form.BpmFormMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.form.dto.BpmFormFieldRespDTO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.FORM_FIELD_REPEAT;
|
||||
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.FORM_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 动态表单 Service 实现类
|
||||
*
|
||||
* @author 风里雾里
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmFormServiceImpl implements BpmFormService {
|
||||
|
||||
@Resource
|
||||
private BpmFormMapper formMapper;
|
||||
|
||||
@Override
|
||||
public Long createForm(BpmFormCreateReqVO createReqVO) {
|
||||
this.checkFields(createReqVO.getFields());
|
||||
// 插入
|
||||
BpmFormDO form = BpmFormConvert.INSTANCE.convert(createReqVO);
|
||||
formMapper.insert(form);
|
||||
// 返回
|
||||
return form.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateForm(BpmFormUpdateReqVO updateReqVO) {
|
||||
this.checkFields(updateReqVO.getFields());
|
||||
// 校验存在
|
||||
this.validateFormExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BpmFormDO updateObj = BpmFormConvert.INSTANCE.convert(updateReqVO);
|
||||
formMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteForm(Long id) {
|
||||
// 校验存在
|
||||
this.validateFormExists(id);
|
||||
// 删除
|
||||
formMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFormExists(Long id) {
|
||||
if (formMapper.selectById(id) == null) {
|
||||
throw exception(FORM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmFormDO getForm(Long id) {
|
||||
return formMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmFormDO> getFormList() {
|
||||
return formMapper.selectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmFormDO> getFormList(Collection<Long> ids) {
|
||||
return formMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BpmFormDO> getFormPage(BpmFormPageReqVO pageReqVO) {
|
||||
return formMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验 Field,避免 field 重复
|
||||
*
|
||||
* @param fields field 数组
|
||||
*/
|
||||
private void checkFields(List<String> fields) {
|
||||
Map<String, String> fieldMap = new HashMap<>(); // key 是 vModel,value 是 label
|
||||
for (String field : fields) {
|
||||
BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class);
|
||||
Assert.notNull(fieldDTO);
|
||||
String oldLabel = fieldMap.put(fieldDTO.getVModel(), fieldDTO.getLabel());
|
||||
// 如果不存在,则直接返回
|
||||
if (oldLabel == null) {
|
||||
continue;
|
||||
}
|
||||
// 如果存在,则报错
|
||||
throw exception(FORM_FIELD_REPEAT, oldLabel, fieldDTO.getLabel(), fieldDTO.getVModel());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.model;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 流程模型接口
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
public interface BpmModelService {
|
||||
|
||||
/**
|
||||
* 获得流程模型分页
|
||||
*
|
||||
* @param pageVO 分页查询
|
||||
* @return 流程模型分页
|
||||
*/
|
||||
PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO);
|
||||
|
||||
/**
|
||||
* 获得流程模块
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 流程模型
|
||||
*/
|
||||
BpmModelRespVO getModel(String id);
|
||||
|
||||
/**
|
||||
* 创建流程模型
|
||||
*
|
||||
* @param modelVO 创建信息
|
||||
* @return 创建的流程模型的编号
|
||||
*/
|
||||
String createModel(@Valid BpmModelCreateReqVO modelVO);
|
||||
|
||||
/**
|
||||
* 修改流程模型
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateModel(@Valid BpmModelUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 将流程模型,部署成一个流程定义
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deployModel(String id);
|
||||
|
||||
/**
|
||||
* 删除模型
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteModel(String id);
|
||||
|
||||
/**
|
||||
* 修改模型的状态,实际更新的部署的流程定义的状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param state 状态 {@link org.activiti.engine.impl.persistence.entity.SuspensionState}
|
||||
*/
|
||||
void updateModelState(String id, Integer state);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* BPM 流程 MetaInfo Response DTO
|
||||
* 主要用于 {@link org.activiti.engine.repository.Model#setMetaInfo(String)} 的存储
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class BpmModelMetaInfoRespDTO {
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
}
|
|
@ -0,0 +1,214 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.model.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.convert.model.BpmModelConvert;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.model.BpmModelService;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.model.dto.BpmModelMetaInfoRespDTO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.PageUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.impl.persistence.entity.SuspensionState;
|
||||
import org.activiti.engine.repository.Deployment;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.activiti.engine.repository.ModelQuery;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
|
||||
/**
|
||||
* 流程定义实现
|
||||
* 主要进行 Activiti {@link Model} 的维护
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class BpmModelServiceImpl implements BpmModelService {
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
@Resource
|
||||
private BpmFormService bpmFormService;
|
||||
@Resource
|
||||
private BpmProcessDefinitionService bpmProcessDefinitionService;
|
||||
|
||||
@Override
|
||||
public PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery();
|
||||
if (StrUtil.isNotBlank(pageVO.getKey())) {
|
||||
modelQuery.modelKey(pageVO.getKey());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageVO.getName())) {
|
||||
modelQuery.modelNameLike("%" + pageVO.getName() + "%"); // 模糊匹配
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageVO.getCategory())) {
|
||||
modelQuery.modelCategory(pageVO.getCategory());
|
||||
}
|
||||
// 执行查询
|
||||
List<Model> models = modelQuery.orderByCreateTime().desc()
|
||||
.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
|
||||
|
||||
// 获得 Form Map
|
||||
Set<Long> formIds = CollectionUtils.convertSet(models, model -> {
|
||||
BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
|
||||
return metaInfo != null ? metaInfo.getFormId() : null;
|
||||
});
|
||||
Map<Long, BpmFormDO> formMap = bpmFormService.getFormMap(formIds);
|
||||
|
||||
// 获得 Deployment Map
|
||||
Set<String> deploymentIds = new HashSet<>();
|
||||
models.forEach(model -> CollectionUtils.addIfNotNull(deploymentIds, model.getDeploymentId()));
|
||||
Map<String, Deployment> deploymentMap = bpmProcessDefinitionService.getDeploymentMap(deploymentIds);
|
||||
// 获得 ProcessDefinition Map
|
||||
List<ProcessDefinition> processDefinitions = bpmProcessDefinitionService.getProcessDefinitionListByDeploymentIds(deploymentIds);
|
||||
Map<String, ProcessDefinition> processDefinitionMap = convertMap(processDefinitions, ProcessDefinition::getDeploymentId);
|
||||
|
||||
// 拼接结果
|
||||
long modelCount = modelQuery.count();
|
||||
return new PageResult<>(BpmModelConvert.INSTANCE.convertList(models, formMap, deploymentMap, processDefinitionMap), modelCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmModelRespVO getModel(String id) {
|
||||
Model model = repositoryService.getModel(id);
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
BpmModelRespVO modelRespVO = BpmModelConvert.INSTANCE.convert(model);
|
||||
// 拼接 bpmn XML
|
||||
byte[] bpmnBytes = repositoryService.getModelEditorSource(id);
|
||||
modelRespVO.setBpmnXml(StrUtil.utf8Str(bpmnBytes));
|
||||
return modelRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务
|
||||
public String createModel(BpmModelCreateReqVO createReqVO) {
|
||||
checkKeyNCName(createReqVO.getKey());
|
||||
// 校验流程标识已经存在
|
||||
Model keyModel = this.getModelByKey(createReqVO.getKey());
|
||||
if (keyModel != null) {
|
||||
throw exception(MODEL_KEY_EXISTS, createReqVO.getKey());
|
||||
}
|
||||
|
||||
// 创建流程定义
|
||||
Model model = repositoryService.newModel();
|
||||
BpmModelConvert.INSTANCE.copy(model, createReqVO);
|
||||
// 保存流程定义
|
||||
repositoryService.saveModel(model);
|
||||
// 添加 BPMN XML
|
||||
repositoryService.addModelEditorSource(model.getId(), StrUtil.utf8Bytes(createReqVO.getBpmnXml()));
|
||||
return model.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务
|
||||
public void updateModel(BpmModelUpdateReqVO updateReqVO) {
|
||||
checkKeyNCName(updateReqVO.getKey());
|
||||
// 校验流程模型存在
|
||||
Model model = repositoryService.getModel(updateReqVO.getId());
|
||||
if (model == null) {
|
||||
throw exception(MODEL_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 修改流程定义
|
||||
BpmModelConvert.INSTANCE.copy(model, updateReqVO);
|
||||
// 更新模型
|
||||
repositoryService.saveModel(model);
|
||||
// 更新 BPMN XML
|
||||
repositoryService.addModelEditorSource(model.getId(), StrUtil.utf8Bytes(updateReqVO.getBpmnXml()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务
|
||||
public void deployModel(String id) {
|
||||
// 校验流程模型存在
|
||||
Model model = repositoryService.getModel(id);
|
||||
if (ObjectUtils.isEmpty(model)) {
|
||||
throw exception(MODEL_NOT_EXISTS);
|
||||
}
|
||||
byte[] bpmnBytes = repositoryService.getModelEditorSource(model.getId());
|
||||
if (bpmnBytes == null) {
|
||||
throw exception(MODEL_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 创建流程定义
|
||||
BpmDefinitionCreateReqDTO definitionCreateReqDTO = BpmModelConvert.INSTANCE.convert2(model)
|
||||
.setBpmnXml(StrUtil.utf8Str(bpmnBytes));
|
||||
String definitionId = bpmProcessDefinitionService.createProcessDefinition(definitionCreateReqDTO);
|
||||
|
||||
// 将老的流程定义进行挂起。也就是说,只有最新部署的流程定义,才可以发起任务。
|
||||
if (StrUtil.isNotEmpty(model.getDeploymentId())) {
|
||||
ProcessDefinition oldDefinition = bpmProcessDefinitionService.getProcessDefinitionByDeploymentId(model.getDeploymentId());
|
||||
if (oldDefinition != null) {
|
||||
bpmProcessDefinitionService.updateProcessDefinitionState(oldDefinition.getId(), SuspensionState.SUSPENDED.getStateCode());
|
||||
}
|
||||
}
|
||||
|
||||
// 更新 model 的 deploymentId,进行关联
|
||||
ProcessDefinition definition = bpmProcessDefinitionService.getProcessDefinition(definitionId);
|
||||
model.setDeploymentId(definition.getDeploymentId());
|
||||
repositoryService.saveModel(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteModel(String id) {
|
||||
// 校验流程模型存在
|
||||
Model model = repositoryService.getModel(id);
|
||||
if (model == null) {
|
||||
throw exception(MODEL_NOT_EXISTS);
|
||||
}
|
||||
// 执行删除
|
||||
repositoryService.deleteModel(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateModelState(String id, Integer state) {
|
||||
// 校验流程模型存在
|
||||
Model model = repositoryService.getModel(id);
|
||||
if (model == null) {
|
||||
throw exception(MODEL_NOT_EXISTS);
|
||||
}
|
||||
// 校验流程定义存在
|
||||
ProcessDefinition definition = bpmProcessDefinitionService.getProcessDefinitionByDeploymentId(model.getDeploymentId());
|
||||
if (definition == null) {
|
||||
throw exception(PROCESS_DEFINITION_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 更新状态
|
||||
bpmProcessDefinitionService.updateProcessDefinitionState(definition.getId(), state);
|
||||
}
|
||||
|
||||
private Model getModelByKey(String key) {
|
||||
return repositoryService.createModelQuery().modelKey(key).singleResult();
|
||||
}
|
||||
|
||||
private void checkKeyNCName(String key) {
|
||||
if (!ValidationUtils.isXmlNCName(key)) {
|
||||
throw exception(MODEL_KEY_VALID);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.oa.OALeaveMapper;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.enums.FlowStatusEnum;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 请假流程结束流程监听处理服务, 根据请假申请审批通过,还是未通过, 更新请假表单
|
||||
*/
|
||||
@Component
|
||||
public class LeaveApplyEndProcessor implements ExecutionListener {
|
||||
|
||||
@Resource
|
||||
private OALeaveMapper leaveMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
final String businessKey = delegateExecution.getProcessInstanceBusinessKey();
|
||||
final Object approved = delegateExecution.getVariable("approved");
|
||||
OALeaveDO updateDo = new OALeaveDO();
|
||||
updateDo.setId(Long.valueOf(businessKey));
|
||||
if (Objects.equals(approved, true)) {
|
||||
updateDo.setStatus(FlowStatusEnum.PASS.getStatus());
|
||||
} else {
|
||||
updateDo.setStatus(FlowStatusEnum.REJECTED.getStatus());
|
||||
}
|
||||
|
||||
leaveMapper.updateById(updateDo);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.activiti.service.oa;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.service.oa;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveExportReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeavePageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.controller.oa.vo.OaLeaveUpdateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.*;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
@ -17,7 +14,7 @@ import java.util.List;
|
|||
*
|
||||
* @author 芋艿
|
||||
*/
|
||||
public interface OaLeaveService {
|
||||
public interface OALeaveService {
|
||||
|
||||
/**
|
||||
* 创建请假申请
|
||||
|
@ -25,14 +22,14 @@ public interface OaLeaveService {
|
|||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createLeave(@Valid OaLeaveCreateReqVO createReqVO);
|
||||
Long createLeave(@Valid OALeaveCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新请假申请
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateLeave(@Valid OaLeaveUpdateReqVO updateReqVO);
|
||||
void updateLeave(@Valid OALeaveUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除请假申请
|
||||
|
@ -47,7 +44,7 @@ public interface OaLeaveService {
|
|||
* @param id 编号
|
||||
* @return 请假申请
|
||||
*/
|
||||
OaLeaveDO getLeave(Long id);
|
||||
OALeaveDO getLeave(Long id);
|
||||
|
||||
/**
|
||||
* 获得请假申请列表
|
||||
|
@ -55,7 +52,7 @@ public interface OaLeaveService {
|
|||
* @param ids 编号
|
||||
* @return 请假申请列表
|
||||
*/
|
||||
List<OaLeaveDO> getLeaveList(Collection<Long> ids);
|
||||
List<OALeaveDO> getLeaveList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得请假申请分页
|
||||
|
@ -63,7 +60,7 @@ public interface OaLeaveService {
|
|||
* @param pageReqVO 分页查询
|
||||
* @return 请假申请分页
|
||||
*/
|
||||
PageResult<OaLeaveDO> getLeavePage(OaLeavePageReqVO pageReqVO);
|
||||
PageResult<OALeaveDO> getLeavePage(OALeavePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得请假申请列表, 用于 Excel 导出
|
||||
|
@ -71,6 +68,13 @@ public interface OaLeaveService {
|
|||
* @param exportReqVO 查询条件
|
||||
* @return 请假申请列表
|
||||
*/
|
||||
List<OaLeaveDO> getLeaveList(OaLeaveExportReqVO exportReqVO);
|
||||
List<OALeaveDO> getLeaveList(OALeaveExportReqVO exportReqVO);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取本人请假申请流程中审批人员
|
||||
* @return 包括,本人部门的项目经理, 部门经理, HR
|
||||
*/
|
||||
OALeaveApplyMembersVO getLeaveApplyMembers();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue