Commit c9f9a6d6 by fengshuonan

整理了所有的数据库字段,初步修改完成

parent fa60bb4c
......@@ -45,7 +45,7 @@
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-core</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
<dependency>
......
......@@ -4,19 +4,19 @@ CREATE DATABASE IF NOT EXISTS guns DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
USE guns;
/*
Navicat Premium Data Transfer
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50724
Source Server Version : 50723
Source Host : localhost:3306
Source Schema : guns
Target Server Type : MySQL
Target Server Version : 50724
Target Server Version : 50723
File Encoding : 65001
Date: 07/12/2018 20:26:12
Date: 08/12/2018 12:00:20
*/
SET NAMES utf8mb4;
......@@ -26,73 +26,70 @@ SET FOREIGN_KEY_CHECKS = 0;
-- Table structure for code_dbinfo
-- ----------------------------
DROP TABLE IF EXISTS `code_dbinfo`;
CREATE TABLE `code_dbinfo` (
`DB_ID` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
`NAME` varchar(20) DEFAULT NULL COMMENT '别名',
`DB_DRIVER` varchar(100) NOT NULL COMMENT '数据库驱动',
`DB_URL` varchar(200) NOT NULL COMMENT '数据库地址',
`DB_USER_NAME` varchar(100) NOT NULL COMMENT '数据库账户',
`DB_PASSWORD` varchar(100) NOT NULL COMMENT '连接密码',
`DB_TYPE` varchar(32) DEFAULT NULL COMMENT '数据库类型(字典)',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
CREATE TABLE `code_dbinfo` (
`DB_ID` bigint(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '别名',
`DB_DRIVER` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据库驱动',
`DB_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据库地址',
`DB_USER_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据库账户',
`DB_PASSWORD` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '连接密码',
`DB_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '数据库类型(字典)',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建用户',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改用户',
PRIMARY KEY (`DB_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='数据库链接信息';
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据库链接信息' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
CREATE TABLE `sys_dept` (
`DEPT_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`PID` bigint(20) DEFAULT NULL COMMENT '父部门id',
`PIDS` varchar(512) DEFAULT NULL COMMENT '父级ids',
`SIMPLE_NAME` varchar(45) DEFAULT NULL COMMENT '简称',
`FULL_NAME` varchar(255) DEFAULT NULL COMMENT '全称',
`DESCRIPTION` varchar(255) DEFAULT NULL COMMENT '描述',
`PIDS` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '父级ids',
`SIMPLE_NAME` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '简称',
`FULL_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '全称',
`DESCRIPTION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
`VERSION` int(11) DEFAULT NULL COMMENT '版本(乐观锁保留字段)',
`SORT` int(11) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`DEPT_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='部门表';
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_dept
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept` VALUES (24, 0, '[0],', '总公司', '总公司', '', NULL, 1, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dept` VALUES (25, 24, '[0],[24],', '开发部', '开发部', '', NULL, 2, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dept` VALUES (26, 24, '[0],[24],', '运营部', '运营部', '', NULL, 3, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dept` VALUES (27, 24, '[0],[24],', '战略部', '战略部', '', NULL, 4, NULL, NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`DICT_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
CREATE TABLE `sys_dict` (
`DICT_ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id',
`PID` bigint(20) DEFAULT NULL COMMENT '父级字典id',
`NAME` varchar(255) DEFAULT NULL COMMENT '字典名称',
`CODE` varchar(255) DEFAULT NULL COMMENT '字典的编码',
`DESCRIPTION` varchar(255) DEFAULT NULL COMMENT '字典描述',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '字典名称',
`CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '字典的编码',
`DESCRIPTION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '字典描述',
`SORT` int(11) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`DICT_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='字典表';
) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_dict
-- ----------------------------
BEGIN;
INSERT INTO `sys_dict` VALUES (50, 0, '性别', 'SEX', NULL, 0, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` VALUES (51, 50, '男', 'M', NULL, 1, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` VALUES (52, 50, '女', 'F', NULL, 2, NULL, NULL, NULL, NULL);
......@@ -103,188 +100,202 @@ INSERT INTO `sys_dict` VALUES (56, 0, '账号状态', 'ACCOUNT_STATUS', NULL, 0,
INSERT INTO `sys_dict` VALUES (57, 56, '启用', 'ENABLE', NULL, 1, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` VALUES (58, 56, '冻结', 'FREEZE', NULL, 2, NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` VALUES (59, 56, '已删除', 'DELETED', NULL, 3, NULL, NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_file_info
-- ----------------------------
DROP TABLE IF EXISTS `sys_file_info`;
CREATE TABLE `sys_file_info` (
`FILE_ID` varchar(50) NOT NULL COMMENT '主键id',
`FILE_DATA` text COMMENT 'base64编码的文件',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
CREATE TABLE `sys_file_info` (
`FILE_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键id',
`FILE_DATA` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'base64编码的文件',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建用户',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改用户',
PRIMARY KEY (`FILE_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文件信息表\r\n';
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件信息表\r\n' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_file_info
-- ----------------------------
BEGIN;
INSERT INTO `sys_file_info` VALUES ('1', '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCABjAGQDASIAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAkHCAUGCgQD/8QAPBAAAQMDAgMGBAQEBAcAAAAAAQIDBAUGEQAHCBIhCRMUMUFhIjJRcSNygZEVFiRCF0OCoRhSYnODosH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQID/8QAGhEBAQEBAQEBAAAAAAAAAAAAAAECEQMxIf/aAAwDAQACEQMRAD8Aahozo0aA0Z0aXp2jXaFyNmi/sxs1UWzd77eKnU0YUKYhQ+RHp3pHr6aCynETxqbC8NENxF9XQmXW+TmaodN5X5q/pzJyA2PdZHtnS79yu2m3cq0txna3bi37fg5IQ7UlOTpJHocgobH25T99LwrNaq1xVORWq7UpE+fLcLr8iQ4VuOLJySSepOdeLQWorfad8a1alKkDeBUBBJKWYdIhNoT7D8HJ/UnWWsrtVeMi05okVO+4FzR/WLVqTHKD/rZQhz/21Vm0rTrl73JS7Ut2EuTUKxOYp0ZABwXnlhCAT6ZJ/YH6ax9QgyaZOkU6Y2W34rqmXUn+1STgj9xoG88PnbH2Td0+Lbm/FoC1ZUhSWxWKatT0EKPq42rLjY9wV/ppiVAuCh3TR4twW3VotSps5oPRpUV0ONOoPkUqHQ65bghRSVhJKU+Zx0Grb8CfHXd3DPd0W2bknyalt/UnktzILiirwRUcd+zn5SPUeRGgfVo14aHW6XclGhXBRJjcuBUWESYz7ZylxtYykj9Dr3aA0aNGgNGjRoIY4vN94XDtsRcW4TjyE1BLBiUpsnq5LcBCAPt5/prnWr1drV316fcVdmuzajUX1yZL7qsqWtRySTpkfbJbk1m59xrR2OoKHnm6ZEVVZTDYzzvODKTj1AbGdLcpUXvIlRl5GI7KUn/WoJ/+6DKV2iQaZb1ux47KnatVkOTninr+EpXIygD65Q4T906sTuNwiVjafZzbmiVCiO1Ddfd+qpVApyUkqgU9tKcNY9HFuOslR/tSCPrqNrbtG8axvXT27M29n3q5ShBcbp0ZtZQ7iO2oJKkj4RzEn99NR4TNnOIq6t2Le3S4l7DplCh2LRZsa1ozK8uNPy3G+bnSpSlZShLnxE+a/YaDG8PHBLb2y+7G19nOMMzZ1pUGXeFyzwjIl1eQoRoqAT5NtJRL5B9cnzOl+do1sRK2Q4mLiEaGpqhXS8qt0tYThHK8eZxsfkWVJx9ANPmj2vCj3hPvJLqzLqFNiUxaD8qW47shxJHuTKXn7DUGcc/DRZHEZs3Oj3FITTarbrTs+l1QNlSmFhPxIUAMqQrABA9cY0CkNh9gf564O97N0DE7yRQn4HhFFPUBklbnKfcOgH7aqxpunCHUNrLJ4Ern2/uCtIfn1Ryqxqz3DSleBdWFCOZCcZbScIwojGlNv0sNfxEB4K8A73fTqFjnKcg6B3HZL7wPbj8NX8o1OWp6oWROVT/iVlXhnMra/wB+cfoNXb0oLsTrnksbpX9Z/OfDy6E3UOX0Ljb7aAf2cVpvvvoDRo0aA0aNGgpPxe8N1v09zdTidqUtM64pFuJpVvw8ZLSiyhohII6uFWSnl69dLr4LuFJO6+8dT2U3npdwWt46kCoJSuMWJJDSwsYDg8lAEZxpxXEFGqMabZ12Kos2rUW36i7JqDEOC5NcZcU3ysSfDt5W6ltWSQgFWD0+usNtDW27tuKZdFz1WDXajBQI8CqubfzaAthLhwWG5Etai9n1SjHvrOtcS1ru6tY254A+GStXTt3ZjClUeOxGjhQy9MlLUllpch3HMoBRST9ADgDVR+AHtCOIbeXiEgbUX8mn1umXNImTXJCGC0umttRXHAhvBx3fM2gYVk/EepyNMM3R27sveazKttjftNVOo1Ya7qQ2lRSpJB5krSofKpKgFA/UDUacL/A5slwsVipXHYLNWqFaqTJjKqFWkIedZjlQUWm+RCEpBKU5OCTgdcdNYz6S/Vubifqyml58fnaN35w27ntbT7b2zR5MpiLGnTZ89S18vP8AF3QbTjzQU/FzevlphQVkfTVE+O3s55PFFfcLcyyL2gUGt+FRCqDNRZcUxIQjohxKkAqSoJwnHLg4HUa6WyHWHodatLii2pjcXOz1sMUi96GlcW76I2gdzWIoH9VGeSBh08hUtCiM6VrfduRKLbFcuVmGqI3X7lej0+OtHKURGypw4HpyqKUHTxuDrhnp/CltaNvWbiFbqEuUqdUZga7pDjyhjCEEkhIAwCTk+2qubx9mvee/9yKDN6U60qNQnpqmFuw1yV1CZJe7x50JBRyN/KAokk9emszcqXsvKjbsTbOlv7i3/fpbV4SJR2qXzY6d668hwDP5WlabtqpHARswnhZodZ2EuhTLt1yH117+IxwTGqcLKW0qaJwrLZICkqAILgxkddW31tRo0dfro0Bo0ax1w3BSLVoVQuSvTW4dOpkdyVKfcOEttISVKJ/QaDR9/t/tveHLb+ZuDuFUwzHaBRFioIL81/GUtNp9SfU+QHU6Wzsnxkb68anE1JsRNbatm3KhSpjlLpTCOduM8wnvWXVL6KU5zJGVeWCQBjVVONvisuDii3Zm1gynmrWpLq4tCg83wIZBx3pHqteMk++rHdjBt09V94Lo3IeZ/pqBSvBsuY/z3iARn8mdDnTT7KueZWabCjXdTWaDcy0KEmluSW1rKkdFONcqiVtE9UnAOD1AOtxEVLjLjK88riShWFFJwfoR1Go+39f2updiSq3udbbFZiRFIEWL3IckPSVqCGm2PUOKWoJTgjqdR3QrCvanWiu4KZd192TKaZXINDZrCK7yJCeZLaPGoUkKIwOQAAHoDjrrnMSXqXt+tfq/CFdFzzFWjc1Yp0+2WHx4e4pkqVJryoOQUxcKUGkOpGUeKypak4PKF/HqzqYLcCGxCY5i3HbS0jmUVHlAwMk9SdRptVd12Jtar1u8LplV2LGfcciTX4LDCnYiEBQcSGEpSsKByCB19Omomj7k8Q+9VXm2pbF4WrZKnabFrrCI8BybJECSpYaZdf70JadIQSeVGRzApONXWewqeKjd1Dp12wLPiFU2uzh3yorPxGMwPN54/wCWj0Geqj5ZwdYS/wCl7J2RcMHcC6bHDlwLc5o1SptsyJ00rA8lORmVqA/OQNePYw2/bVQnWHVLRXb94JT4ua4/JVLVVk+XiUSl/G8M+YV8Sft114eOPu2uEzc6SVrbcj0CQ60tCyhSVpGUkEEHz1M+ci6t1e1mLJj3Df8AuendKp25PoNEpNKdpdHjVFAbly1vOIW5IW2CS0kBsJSlXxHmJIGBmXdUF7KPiur281jVPai/6y7UbitJtL0SVIXzOyIBIThRPVRQopGT1wofTV+tdCTg0aNGgNLn7YHiOesywKZsPbk4tVG6x4yqltWFJgoVhKD+daTn2SPrpjGueXj/AN0Ht1uKy+ayJPfQqbONIg4OU9xH/DBH35SfudBXbT1ezR2tZ2L4TWrvuNoQ5lx97XpqnBgoYSk90FfZIJ/XSiuE3ZSdv7vza+3kdlSoj8tMmorAyG4jZCnCfbGB+unj8QZbdoNrcPFpLMV27HG4TwZ6GLSGEgvr6eXwp5B7nQaq5eat9dwdk3n6c5Dpk5VRu4xXevOiKhSIqiPoVuMugfbUpbi7rWZtcIzN0TnVT5xIh02EwqRMk48yhpHXA+pwPfWm3HSptp757eVqiUB56lx7fq1Bjojt5Qw8W2nWUqx8qSI5SCfUgay+3Vnt7X2fXd9N2VJmXlNgPVitS1jm/h8ZCC4IbGfkbbQMHHzKCifPQaRS9sw2yKFb+/sy27PqIblxKA0qPHmRWnWkEMB1f4rafXl8xzEamPaTZCwNnaMKTZNIRFbXyqeeUsuvPqAwFOOK6qONQVYZi7v3nAt7f7ZO3o9Svi2l3NSahDe53BExH52HeoUh1sym083qUnHQDUn8OdyVCn0m4dqboqTsur7fVV2lB59WXpEA/iQ3lE+ZLC28q9SDoNqr1q1mp7xWzdSGWm6ZQaZNbLvP8br0gpTyY+iQgHP/AFajTtCHnGuD3cotkjno7iT9j56+m424FT3MviJtptvUH/A0SS3PumrwjzCO22eZMNtQ6KdWR1A8h99eHiwrNH3X4LNyqja8sTGV0KWlOEkKS610UhST1CgQcg6BOvAbvYNieJe1LpmyizSJz/8ACqoc/D4Z/wCAqP15SQr7jXQ6lSVpC0KBSoZBHkRrlfbcW04l1tRSpBCkkehGuibgX3dO9XC/ZN2ypPfVGLCFJqJKsq8RG/DJV7qQELP5tBPejRo0GubkVefQNu7or1KQVzabRZsuMkDJLrbC1IAH3A1zF1eZKqNVmT5ri3JEh9xx1SzlRUVEnOupV1tt5tTLyErQtJSpKhkKB8wRqnlydlJwk3HeRvBVEr0BLjyn3qXDqIRCcUTk5SpBWB18krGgiPsgeHRyy7Dqu/10wgxMuVHh6UXRgtwUE8znXy5j6+oA1ZnaN3/EzcG6t85SVLhuuKt+3Ob+2Cwr8V1I9O8dB6/ROsxv5U2tvtraVtTt3EbhVG53GrZoseOOUR2lJw44APIIbBOfqRrdLPtanWbbNKtKjNhEOlxm4rQAxnlHVR9yck+5Og2alxudRfUCAn5dRvxeyHovC1uu9HJCxZ9VSCPQGMsE/sTqWmGw00lCfQY1q27Vj/4l7XXbt4ZCWf5lok2lB1Q6Nl9lTYUfsVZ/TQRhY7LFb4oqs7FSDEsawaTR2voh6Y++64kf+OPGJ9iNbluDsBYO4lc/mipKq9Mqyo4ivy6RUXIbkpkZ5W3Sg/GBk4PmM9DrXOGPb/ca14NzXduzTodPue6p0Vx6HFlJkIYYiwmIrY7xPQ85ZcdwPLvQPMHU2kZ6aCP7Qsq2Nv6Oi3LSorFNgtEnu2h1Wo+a1qPxLUfVSiSdRNaNCjyqnv5tI+j+imITVI7H9oEyMsr5R+dI1PlQb7uUvHkeuogfUm1eKCizHE4h31b0ilOk9EmTGIdR+pb5hoOeOr052j1abSXx+JCkOR1/mQopP+400zsT90pDzN+7NzJHM2wlm4ILZPy9e5fOPcqY/bVAeK+xpO3HEduDaclotmPXJD6ARgcjyu9Tj2w4NWR7HVNW/wCKyS5AZdVEFtzUzlpB5UNlTfLzH/uBGgdzo0aNAaNGjQV9uUmp8XlKiT/x2aRZzkuC2r5WHnZBQ4tI/wCYpSBk+g1MkQAyG8j10aNBntGjRoDRo0aDEVjo+j3TqEOIImNV9rqmweSUxfNNabdHmlDiilwfZSeh0aNAsXtb6RTYvGAhUaIhsz6DAdklOR3iytxJUffAA/TTK+ArZnbDbHYyjV2xrPh0upXJFbkVWYlS3X5SwTjmW4pSgkdcJBCRkkDro0aCyujRo0H/2Q==', NULL, NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_login_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_login_log`;
CREATE TABLE `sys_login_log` (
CREATE TABLE `sys_login_log` (
`LOGIN_LOG_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`LOG_NAME` varchar(255) DEFAULT NULL COMMENT '日志名称',
`LOG_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志名称',
`USER_ID` bigint(20) DEFAULT NULL COMMENT '管理员id',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`SUCCEED` varchar(255) DEFAULT NULL COMMENT '是否执行成功',
`MESSAGE` text COMMENT '具体消息',
`IP_ADDRESS` varchar(255) DEFAULT NULL COMMENT '登录ip',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`SUCCEED` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否执行成功',
`MESSAGE` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '具体消息',
`IP_ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录ip',
PRIMARY KEY (`LOGIN_LOG_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='登录记录';
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '登录记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_login_log
-- ----------------------------
INSERT INTO `sys_login_log` VALUES (1, '登录失败日志', NULL, '2018-12-08 11:37:15', '成功', '账号:admin,账号被冻结', '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (2, '登录失败日志', NULL, '2018-12-08 11:37:36', '成功', '账号:sn91@qq.com,账号密码错误', '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (3, '登录失败日志', NULL, '2018-12-08 11:42:11', '成功', '账号:admin,账号密码错误', '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (4, '登录日志', 1, '2018-12-08 11:42:18', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (5, '退出日志', 1, '2018-12-08 11:42:33', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (6, '登录日志', 1, '2018-12-08 11:42:37', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (7, '退出日志', 1, '2018-12-08 11:47:42', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (8, '登录日志', 1, '2018-12-08 11:49:01', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (9, '退出日志', 1, '2018-12-08 11:51:16', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (10, '登录日志', 1, '2018-12-08 11:51:22', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (11, '退出日志', 1, '2018-12-08 11:54:17', '成功', NULL, '0:0:0:0:0:0:0:1');
INSERT INTO `sys_login_log` VALUES (12, '登录日志', 1, '2018-12-08 11:57:55', '成功', NULL, '0:0:0:0:0:0:0:1');
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
CREATE TABLE `sys_menu` (
`MENU_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`CODE` varchar(255) DEFAULT NULL COMMENT '菜单编号',
`PCODE` varchar(255) DEFAULT NULL COMMENT '菜单父编号',
`PCODES` varchar(255) DEFAULT NULL COMMENT '当前菜单的所有父菜单编号',
`NAME` varchar(255) DEFAULT NULL COMMENT '菜单名称',
`ICON` varchar(255) DEFAULT NULL COMMENT '菜单图标',
`URL` varchar(255) DEFAULT NULL COMMENT 'url地址',
`CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单编号',
`PCODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单父编号',
`PCODES` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '当前菜单的所有父菜单编号',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单名称',
`ICON` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单图标',
`URL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'url地址',
`SORT` int(65) DEFAULT NULL COMMENT '菜单排序号',
`LEVELS` int(65) DEFAULT NULL COMMENT '菜单层级',
`MENU_FLAG` varchar(32) DEFAULT NULL COMMENT '是否是菜单(字典)',
`DESCRIPTION` varchar(255) DEFAULT NULL COMMENT '备注',
`STATUS` varchar(32) DEFAULT NULL COMMENT '菜单状态(字典)',
`NEW_PAGE_FLAG` varchar(32) DEFAULT NULL COMMENT '是否打开新页面的标识(字典)',
`OPEN_FLAG` varchar(32) DEFAULT NULL COMMENT '是否打开(字典)',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`MENU_FLAG` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否是菜单(字典)',
`DESCRIPTION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
`STATUS` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'ENABLE' COMMENT '菜单状态(字典)',
`NEW_PAGE_FLAG` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否打开新页面的标识(字典)',
`OPEN_FLAG` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否打开(字典)',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`MENU_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=173 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单表';
) ENGINE = InnoDB AUTO_INCREMENT = 173 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES (105, 'system', '0', '[0],', '系统管理', 'fa-user', '#', 30, 1, '1', NULL, '1', NULL, '1', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (106, 'mgr', 'system', '[0],[system],', '用户管理', '', '/mgr', 1, 2, '1', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (107, 'mgr_add', 'mgr', '[0],[system],[mgr],', '添加用户', NULL, '/mgr/add', 1, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (108, 'mgr_edit', 'mgr', '[0],[system],[mgr],', '修改用户', NULL, '/mgr/edit', 2, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (109, 'mgr_delete', 'mgr', '[0],[system],[mgr],', '删除用户', NULL, '/mgr/delete', 3, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (110, 'mgr_reset', 'mgr', '[0],[system],[mgr],', '重置密码', NULL, '/mgr/reset', 4, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (111, 'mgr_freeze', 'mgr', '[0],[system],[mgr],', '冻结用户', NULL, '/mgr/freeze', 5, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (112, 'mgr_unfreeze', 'mgr', '[0],[system],[mgr],', '解除冻结用户', NULL, '/mgr/unfreeze', 6, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (113, 'mgr_setRole', 'mgr', '[0],[system],[mgr],', '分配角色', NULL, '/mgr/setRole', 7, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (114, 'role', 'system', '[0],[system],', '角色管理', NULL, '/role', 2, 2, '1', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (115, 'role_add', 'role', '[0],[system],[role],', '添加角色', NULL, '/role/add', 1, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (116, 'role_edit', 'role', '[0],[system],[role],', '修改角色', NULL, '/role/edit', 2, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (117, 'role_remove', 'role', '[0],[system],[role],', '删除角色', NULL, '/role/remove', 3, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (118, 'role_setAuthority', 'role', '[0],[system],[role],', '配置权限', NULL, '/role/setAuthority', 4, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (119, 'menu', 'system', '[0],[system],', '菜单管理', NULL, '/menu', 4, 2, '1', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (120, 'menu_add', 'menu', '[0],[system],[menu],', '添加菜单', NULL, '/menu/add', 1, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (121, 'menu_edit', 'menu', '[0],[system],[menu],', '修改菜单', NULL, '/menu/edit', 2, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (122, 'menu_remove', 'menu', '[0],[system],[menu],', '删除菜单', NULL, '/menu/remove', 3, 3, '0', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (128, 'log', 'system', '[0],[system],', '业务日志', NULL, '/log', 6, 2, '1', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (130, 'druid', 'system', '[0],[system],', '监控管理', NULL, '/druid', 7, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (131, 'dept', 'system', '[0],[system],', '部门管理', NULL, '/dept', 3, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (132, 'dict', 'system', '[0],[system],', '字典管理', NULL, '/dict', 4, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (133, 'loginLog', 'system', '[0],[system],', '登录日志', NULL, '/loginLog', 6, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (134, 'log_clean', 'log', '[0],[system],[log],', '清空日志', NULL, '/log/delLog', 3, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (135, 'dept_add', 'dept', '[0],[system],[dept],', '添加部门', NULL, '/dept/add', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (136, 'dept_update', 'dept', '[0],[system],[dept],', '修改部门', NULL, '/dept/update', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (137, 'dept_delete', 'dept', '[0],[system],[dept],', '删除部门', NULL, '/dept/delete', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (138, 'dict_add', 'dict', '[0],[system],[dict],', '添加字典', NULL, '/dict/add', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (139, 'dict_update', 'dict', '[0],[system],[dict],', '修改字典', NULL, '/dict/update', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (140, 'dict_delete', 'dict', '[0],[system],[dict],', '删除字典', NULL, '/dict/delete', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (141, 'notice', 'system', '[0],[system],', '通知管理', NULL, '/notice', 9, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (142, 'notice_add', 'notice', '[0],[system],[notice],', '添加通知', NULL, '/notice/add', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (143, 'notice_update', 'notice', '[0],[system],[notice],', '修改通知', NULL, '/notice/update', 2, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (144, 'notice_delete', 'notice', '[0],[system],[notice],', '删除通知', NULL, '/notice/delete', 3, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (145, 'hello', 'system_message', '[0],[system_message],', '系统消息', 'fa-rocket', '/notice/hello', 1, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (148, 'code', 'dev_tools', '[0],[dev_tools],', '代码生成', 'fa-code', '/code', 3, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (149, 'api_mgr', 'dev_tools', '[0],[dev_tools],', '接口文档', 'fa-leaf', '/swagger-ui.html', 2, 2, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (150, 'to_menu_edit', 'menu', '[0],[system],[menu],', '菜单编辑跳转', '', '/menu/menu_edit', 4, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (151, 'menu_list', 'menu', '[0],[system],[menu],', '菜单列表', '', '/menu/list', 5, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (152, 'to_dept_update', 'dept', '[0],[system],[dept],', '修改部门跳转', '', '/dept/dept_update', 4, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (153, 'dept_list', 'dept', '[0],[system],[dept],', '部门列表', '', '/dept/list', 5, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (154, 'dept_detail', 'dept', '[0],[system],[dept],', '部门详情', '', '/dept/detail', 6, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (155, 'to_dict_edit', 'dict', '[0],[system],[dict],', '修改菜单跳转', '', '/dict/dict_edit', 4, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (156, 'dict_list', 'dict', '[0],[system],[dict],', '字典列表', '', '/dict/list', 5, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (157, 'dict_detail', 'dict', '[0],[system],[dict],', '字典详情', '', '/dict/detail', 6, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (158, 'log_list', 'log', '[0],[system],[log],', '日志列表', '', '/log/list', 2, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (159, 'log_detail', 'log', '[0],[system],[log],', '日志详情', '', '/log/detail', 3, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (160, 'del_login_log', 'loginLog', '[0],[system],[loginLog],', '清空登录日志', '', '/loginLog/delLoginLog', 1, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (161, 'login_log_list', 'loginLog', '[0],[system],[loginLog],', '登录日志列表', '', '/loginLog/list', 2, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (162, 'to_role_edit', 'role', '[0],[system],[role],', '修改角色跳转', '', '/role/role_edit', 5, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (163, 'to_role_assign', 'role', '[0],[system],[role],', '角色分配跳转', '', '/role/role_assign', 6, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (164, 'role_list', 'role', '[0],[system],[role],', '角色列表', '', '/role/list', 7, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (165, 'to_assign_role', 'mgr', '[0],[system],[mgr],', '分配角色跳转', '', '/mgr/role_assign', 8, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (166, 'to_user_edit', 'mgr', '[0],[system],[mgr],', '编辑用户跳转', '', '/mgr/user_edit', 9, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (167, 'mgr_list', 'mgr', '[0],[system],[mgr],', '用户列表', '', '/mgr/list', 10, 3, '0', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (171, 'dev_tools', '0', '[0],', '开发工具', 'fa-code', '#', 20, 1, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (172, 'system_message', '0', '[0],', '系统消息', 'fa-rocket', '#', 10, 1, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO `sys_menu` VALUES (105, 'system', '0', '[0],', '系统管理', 'fa-user', '#', 30, 1, 'Y', NULL, '1', NULL, '1', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (106, 'mgr', 'system', '[0],[system],', '用户管理', '', '/mgr', 1, 2, 'Y', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (107, 'mgr_add', 'mgr', '[0],[system],[mgr],', '添加用户', NULL, '/mgr/add', 1, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (108, 'mgr_edit', 'mgr', '[0],[system],[mgr],', '修改用户', NULL, '/mgr/edit', 2, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (109, 'mgr_delete', 'mgr', '[0],[system],[mgr],', '删除用户', NULL, '/mgr/delete', 3, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (110, 'mgr_reset', 'mgr', '[0],[system],[mgr],', '重置密码', NULL, '/mgr/reset', 4, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (111, 'mgr_freeze', 'mgr', '[0],[system],[mgr],', '冻结用户', NULL, '/mgr/freeze', 5, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (112, 'mgr_unfreeze', 'mgr', '[0],[system],[mgr],', '解除冻结用户', NULL, '/mgr/unfreeze', 6, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (113, 'mgr_setRole', 'mgr', '[0],[system],[mgr],', '分配角色', NULL, '/mgr/setRole', 7, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (114, 'role', 'system', '[0],[system],', '角色管理', NULL, '/role', 2, 2, 'Y', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (115, 'role_add', 'role', '[0],[system],[role],', '添加角色', NULL, '/role/add', 1, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (116, 'role_edit', 'role', '[0],[system],[role],', '修改角色', NULL, '/role/edit', 2, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (117, 'role_remove', 'role', '[0],[system],[role],', '删除角色', NULL, '/role/remove', 3, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (118, 'role_setAuthority', 'role', '[0],[system],[role],', '配置权限', NULL, '/role/setAuthority', 4, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (119, 'menu', 'system', '[0],[system],', '菜单管理', NULL, '/menu', 4, 2, 'Y', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (120, 'menu_add', 'menu', '[0],[system],[menu],', '添加菜单', NULL, '/menu/add', 1, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (121, 'menu_edit', 'menu', '[0],[system],[menu],', '修改菜单', NULL, '/menu/edit', 2, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (122, 'menu_remove', 'menu', '[0],[system],[menu],', '删除菜单', NULL, '/menu/remove', 3, 3, 'N', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (128, 'log', 'system', '[0],[system],', '业务日志', NULL, '/log', 6, 2, 'Y', NULL, '1', NULL, '0', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (130, 'druid', 'system', '[0],[system],', '监控管理', NULL, '/druid', 7, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (131, 'dept', 'system', '[0],[system],', '部门管理', NULL, '/dept', 3, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (132, 'dict', 'system', '[0],[system],', '字典管理', NULL, '/dict', 4, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (133, 'loginLog', 'system', '[0],[system],', '登录日志', NULL, '/loginLog', 6, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (134, 'log_clean', 'log', '[0],[system],[log],', '清空日志', NULL, '/log/delLog', 3, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (135, 'dept_add', 'dept', '[0],[system],[dept],', '添加部门', NULL, '/dept/add', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (136, 'dept_update', 'dept', '[0],[system],[dept],', '修改部门', NULL, '/dept/update', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (137, 'dept_delete', 'dept', '[0],[system],[dept],', '删除部门', NULL, '/dept/delete', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (138, 'dict_add', 'dict', '[0],[system],[dict],', '添加字典', NULL, '/dict/add', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (139, 'dict_update', 'dict', '[0],[system],[dict],', '修改字典', NULL, '/dict/update', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (140, 'dict_delete', 'dict', '[0],[system],[dict],', '删除字典', NULL, '/dict/delete', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (141, 'notice', 'system', '[0],[system],', '通知管理', NULL, '/notice', 9, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (142, 'notice_add', 'notice', '[0],[system],[notice],', '添加通知', NULL, '/notice/add', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (143, 'notice_update', 'notice', '[0],[system],[notice],', '修改通知', NULL, '/notice/update', 2, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (144, 'notice_delete', 'notice', '[0],[system],[notice],', '删除通知', NULL, '/notice/delete', 3, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (145, 'hello', 'system_message', '[0],[system_message],', '系统消息', 'fa-rocket', '/notice/hello', 1, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (148, 'code', 'dev_tools', '[0],[dev_tools],', '代码生成', 'fa-code', '/code', 3, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (149, 'api_mgr', 'dev_tools', '[0],[dev_tools],', '接口文档', 'fa-leaf', '/swagger-ui.html', 2, 2, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (150, 'to_menu_edit', 'menu', '[0],[system],[menu],', '菜单编辑跳转', '', '/menu/menu_edit', 4, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (151, 'menu_list', 'menu', '[0],[system],[menu],', '菜单列表', '', '/menu/list', 5, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (152, 'to_dept_update', 'dept', '[0],[system],[dept],', '修改部门跳转', '', '/dept/dept_update', 4, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (153, 'dept_list', 'dept', '[0],[system],[dept],', '部门列表', '', '/dept/list', 5, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (154, 'dept_detail', 'dept', '[0],[system],[dept],', '部门详情', '', '/dept/detail', 6, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (155, 'to_dict_edit', 'dict', '[0],[system],[dict],', '修改菜单跳转', '', '/dict/dict_edit', 4, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (156, 'dict_list', 'dict', '[0],[system],[dict],', '字典列表', '', '/dict/list', 5, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (157, 'dict_detail', 'dict', '[0],[system],[dict],', '字典详情', '', '/dict/detail', 6, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (158, 'log_list', 'log', '[0],[system],[log],', '日志列表', '', '/log/list', 2, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (159, 'log_detail', 'log', '[0],[system],[log],', '日志详情', '', '/log/detail', 3, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (160, 'del_login_log', 'loginLog', '[0],[system],[loginLog],', '清空登录日志', '', '/loginLog/delLoginLog', 1, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (161, 'login_log_list', 'loginLog', '[0],[system],[loginLog],', '登录日志列表', '', '/loginLog/list', 2, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (162, 'to_role_edit', 'role', '[0],[system],[role],', '修改角色跳转', '', '/role/role_edit', 5, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (163, 'to_role_assign', 'role', '[0],[system],[role],', '角色分配跳转', '', '/role/role_assign', 6, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (164, 'role_list', 'role', '[0],[system],[role],', '角色列表', '', '/role/list', 7, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (165, 'to_assign_role', 'mgr', '[0],[system],[mgr],', '分配角色跳转', '', '/mgr/role_assign', 8, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (166, 'to_user_edit', 'mgr', '[0],[system],[mgr],', '编辑用户跳转', '', '/mgr/user_edit', 9, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (167, 'mgr_list', 'mgr', '[0],[system],[mgr],', '用户列表', '', '/mgr/list', 10, 3, 'N', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (171, 'dev_tools', '0', '[0],', '开发工具', 'fa-code', '#', 20, 1, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (172, 'system_message', '0', '[0],', '系统消息', 'fa-rocket', '#', 10, 1, 'Y', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL);
-- ----------------------------
-- Table structure for sys_notice
-- ----------------------------
DROP TABLE IF EXISTS `sys_notice`;
CREATE TABLE `sys_notice` (
CREATE TABLE `sys_notice` (
`NOTICE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`TITLE` varchar(255) DEFAULT NULL COMMENT '标题',
`CONTENT` text COMMENT '内容',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`TITLE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标题',
`CONTENT` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '内容',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`NOTICE_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='通知表';
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '通知表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_notice
-- ----------------------------
BEGIN;
INSERT INTO `sys_notice` VALUES (6, '世界', '欢迎使用Guns管理系统', '2017-01-11 08:53:20', 1, NULL, NULL);
INSERT INTO `sys_notice` VALUES (8, '你好', '你好', '2017-05-10 19:28:57', 1, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_operation_log`;
CREATE TABLE `sys_operation_log` (
CREATE TABLE `sys_operation_log` (
`OPERATION_LOG_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`LOG_TYPE` varchar(32) DEFAULT NULL COMMENT '日志类型(字典)',
`LOG_NAME` varchar(255) DEFAULT NULL COMMENT '日志名称',
`LOG_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志类型(字典)',
`LOG_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志名称',
`USER_ID` bigint(65) DEFAULT NULL COMMENT '用户id',
`CLASS_NAME` varchar(255) DEFAULT NULL COMMENT '类名称',
`METHOD` text COMMENT '方法名称',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`SUCCEED` varchar(32) DEFAULT NULL COMMENT '是否成功(字典)',
`MESSAGE` text COMMENT '备注',
`CLASS_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '类名称',
`METHOD` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '方法名称',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`SUCCEED` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否成功(字典)',
`MESSAGE` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '备注',
PRIMARY KEY (`OPERATION_LOG_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='操作日志';
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_operation_log
-- ----------------------------
INSERT INTO `sys_operation_log` VALUES (1, '异常日志', '', 1, NULL, NULL, '2018-12-08 11:59:58', '失败', 'org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type \'java.lang.String\' to required type \'java.lang.Integer\'; nested exception is java.lang.NumberFormatException: For input string: \"undefined\"\r\n at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:131)\r\n at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:124)\r\n at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)\r\n at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:131)\r\n at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)\r\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)\r\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)\r\n at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\r\n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)\r\n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)\r\n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)\r\n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)\r\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)\r\n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)\r\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)\r\n at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)\r\n at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)\r\n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\r\n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilterT1.call(AbstractShiroFilter.java:365)\r\n at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)\r\n at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)\r\n at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)\r\n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at cn.stylefeng.roses.core.xss.XssFilter.doFilter(XssFilter.java:31)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)\r\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)\r\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)\r\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)\r\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\r\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)\r\n at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)\r\n at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n at org.apache.coyote.AbstractProtocolTConnectionHandler.process(AbstractProtocol.java:790)\r\n at org.apache.tomcat.util.net.NioEndpointTSocketProcessor.doRun(NioEndpoint.java:1459)\r\n at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n at java.util.concurrent.ThreadPoolExecutorTWorker.run(ThreadPoolExecutor.java:624)\r\n at org.apache.tomcat.util.threads.TaskThreadTWrappingRunnable.run(TaskThread.java:61)\r\n at java.lang.Thread.run(Thread.java:748)\r\nCaused by: java.lang.NumberFormatException: For input string: \"undefined\"\r\n at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)\r\n at java.lang.Integer.parseInt(Integer.java:580)\r\n at java.lang.Integer.valueOf(Integer.java:766)\r\n at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:210)\r\n at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)\r\n at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:466)\r\n at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:439)\r\n at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:192)\r\n at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:99)\r\n at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:73)\r\n at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:52)\r\n at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:692)\r\n at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:123)\r\n ... 71 more\r\n');
INSERT INTO `sys_operation_log` VALUES (2, '异常日志', '', 1, NULL, NULL, '2018-12-08 12:00:06', '失败', 'org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type \'java.lang.String\' to required type \'java.lang.Integer\'; nested exception is java.lang.NumberFormatException: For input string: \"undefined\"\r\n at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:131)\r\n at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:124)\r\n at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)\r\n at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:131)\r\n at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)\r\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)\r\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)\r\n at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\r\n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)\r\n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)\r\n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)\r\n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)\r\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)\r\n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)\r\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)\r\n at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)\r\n at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)\r\n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\r\n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilterT1.call(AbstractShiroFilter.java:365)\r\n at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)\r\n at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)\r\n at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)\r\n at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)\r\n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at cn.stylefeng.roses.core.xss.XssFilter.doFilter(XssFilter.java:31)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)\r\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)\r\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)\r\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)\r\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)\r\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\r\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)\r\n at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)\r\n at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n at org.apache.coyote.AbstractProtocolTConnectionHandler.process(AbstractProtocol.java:790)\r\n at org.apache.tomcat.util.net.NioEndpointTSocketProcessor.doRun(NioEndpoint.java:1459)\r\n at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n at java.util.concurrent.ThreadPoolExecutorTWorker.run(ThreadPoolExecutor.java:624)\r\n at org.apache.tomcat.util.threads.TaskThreadTWrappingRunnable.run(TaskThread.java:61)\r\n at java.lang.Thread.run(Thread.java:748)\r\nCaused by: java.lang.NumberFormatException: For input string: \"undefined\"\r\n at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)\r\n at java.lang.Integer.parseInt(Integer.java:580)\r\n at java.lang.Integer.valueOf(Integer.java:766)\r\n at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:210)\r\n at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)\r\n at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:466)\r\n at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:439)\r\n at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:192)\r\n at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:99)\r\n at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:73)\r\n at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:52)\r\n at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:692)\r\n at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:123)\r\n ... 71 more\r\n');
-- ----------------------------
-- Table structure for sys_relation
-- ----------------------------
DROP TABLE IF EXISTS `sys_relation`;
CREATE TABLE `sys_relation` (
CREATE TABLE `sys_relation` (
`RELATION_ID` bigint(20) NOT NULL COMMENT '主键',
`MENU_ID` bigint(20) DEFAULT NULL COMMENT '菜单id',
`ROLE_ID` bigint(20) DEFAULT NULL COMMENT '角色id',
PRIMARY KEY (`RELATION_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色和菜单关联表';
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_relation
-- ----------------------------
BEGIN;
INSERT INTO `sys_relation` VALUES (3377, 105, 5);
INSERT INTO `sys_relation` VALUES (3378, 106, 5);
INSERT INTO `sys_relation` VALUES (3379, 107, 5);
......@@ -362,87 +373,82 @@ INSERT INTO `sys_relation` VALUES (3845, 148, 1);
INSERT INTO `sys_relation` VALUES (3846, 149, 1);
INSERT INTO `sys_relation` VALUES (3847, 172, 1);
INSERT INTO `sys_relation` VALUES (3848, 145, 1);
COMMIT;
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
CREATE TABLE `sys_role` (
`ROLE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`PID` bigint(20) DEFAULT NULL COMMENT '父角色id',
`NAME` varchar(255) DEFAULT NULL COMMENT '角色名称',
`DESCRIPTION` varchar(255) DEFAULT NULL COMMENT '提示',
`NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色名称',
`DESCRIPTION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '提示',
`SORT` int(11) DEFAULT NULL COMMENT '序号',
`VERSION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '修改时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建用户',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改用户',
PRIMARY KEY (`ROLE_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色表';
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES (1, 0, '超级管理员', 'administrator', 1, 1, NULL, NULL, NULL, NULL);
INSERT INTO `sys_role` VALUES (5, 1, '临时', 'temp', 2, NULL, NULL, NULL, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
CREATE TABLE `sys_user` (
`USER_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`AVATAR` varchar(255) DEFAULT NULL COMMENT '头像',
`ACCOUNT` varchar(45) DEFAULT NULL COMMENT '账号',
`PASSWORD` varchar(45) DEFAULT NULL COMMENT '密码',
`SALT` varchar(45) DEFAULT NULL COMMENT 'md5密码盐',
`NAME` varchar(45) DEFAULT NULL COMMENT '名字',
`BIRTHDAY` datetime DEFAULT NULL COMMENT '生日',
`SEX` varchar(32) DEFAULT NULL COMMENT '性别(字典)',
`EMAIL` varchar(45) DEFAULT NULL COMMENT '电子邮件',
`PHONE` varchar(45) DEFAULT NULL COMMENT '电话',
`ROLE_ID` varchar(255) DEFAULT NULL COMMENT '角色id(多个逗号隔开)',
`DEPT_ID` varchar(255) DEFAULT NULL COMMENT '部门id(多个逗号隔开)',
`STATUS` varchar(32) DEFAULT NULL COMMENT '状态(字典)',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`AVATAR` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '头像',
`ACCOUNT` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账号',
`PASSWORD` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码',
`SALT` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'md5密码盐',
`NAME` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '名字',
`BIRTHDAY` datetime(0) DEFAULT NULL COMMENT '生日',
`SEX` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别(字典)',
`EMAIL` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '电子邮件',
`PHONE` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '电话',
`ROLE_ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色id(多个逗号隔开)',
`DEPT_ID` bigint(20) DEFAULT NULL COMMENT '部门id(多个逗号隔开)',
`STATUS` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '状态(字典)',
`CREATE_TIME` datetime(0) DEFAULT NULL COMMENT '创建时间',
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间',
`UPDATE_TIME` datetime(0) DEFAULT NULL COMMENT '更新时间',
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '更新人',
`VERSION` int(11) DEFAULT NULL COMMENT '乐观锁',
PRIMARY KEY (`USER_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='管理员表';
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, '1', 'admin', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (2, '1', 'test1', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (3, '1', 'test2', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (4, '1', 'test3', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (5, '1', 'test4', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (6, '1', 'test5', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (7, '1', 'test6', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (8, '1', 'test7', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (9, '1', 'test8', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (10, '1', 'test9', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (11, '1', 'test10', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (12, '1', 'test11', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (13, '1', 'test12', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (14, '1', 'test13', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (15, '1', 'test14', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (16, '1', 'test15', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (17, '1', 'test16', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (18, '1', 'test17', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (19, '1', 'test18', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (20, '1', 'test19', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (21, '1', 'test20', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (22, '1', 'test21', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (23, '1', 'test22', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', '27', '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
COMMIT;
INSERT INTO `sys_user` VALUES (1, '1', 'admin', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, 'ENABLE', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (2, '1', 'test1', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (3, '1', 'test2', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (4, '1', 'test3', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (5, '1', 'test4', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (6, '1', 'test5', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (7, '1', 'test6', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (8, '1', 'test7', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (9, '1', 'test8', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (10, '1', 'test9', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '2', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (11, '1', 'test10', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (12, '1', 'test11', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (13, '1', 'test12', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (14, '1', 'test13', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (15, '1', 'test14', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (16, '1', 'test15', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (17, '1', 'test16', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (18, '1', 'test17', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (19, '1', 'test18', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (20, '1', 'test19', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (21, '1', 'test20', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (22, '1', 'test21', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
INSERT INTO `sys_user` VALUES (23, '1', 'test22', 'ecfadcde9305f8891bcfe5a1e28c253e', '8pgby', 'stylefeng', '2018-11-16 00:00:00', '1', 'sn93@qq.com', '18200000000', '1', 27, '1', '2016-01-29 08:49:53', NULL, NULL, NULL, 25);
SET FOREIGN_KEY_CHECKS = 1;
......@@ -15,6 +15,7 @@
*/
package cn.stylefeng.guns;
import cn.stylefeng.guns.generator.config.GeneratorAutoConfiguration;
import cn.stylefeng.roses.core.config.WebAutoConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -27,7 +28,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author stylefeng
* @Date 2017/5/21 12:06
*/
@SpringBootApplication(exclude = WebAutoConfiguration.class)
@SpringBootApplication(exclude = {WebAutoConfiguration.class, GeneratorAutoConfiguration.class})
public class GunsApplication {
private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class);
......@@ -35,5 +36,16 @@ public class GunsApplication {
public static void main(String[] args) {
SpringApplication.run(GunsApplication.class, args);
logger.info("GunsApplication is success!");
// GenerateParams generateParams = new GenerateParams();
//
// generateParams.setRemoveTablePrefix(new String[]{"sys_"});
// generateParams.setAuthor("stylefeng");
// generateParams.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/guns?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT");
// generateParams.setGeneratorInterface(false);
// generateParams.setParentPackage("cn.stylefeng.guns.modular.system");
// generateParams.setGeneratorInterface(false);
//
// SimpleGenerator.doGeneration(generateParams);
}
}
......@@ -44,7 +44,7 @@ import java.util.HashMap;
@Configuration
@ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "true")
@EnableTransactionManagement(order = 2, proxyTargetClass = true)
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.dao", "cn.stylefeng.guns.multi.mapper"})
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.mapper", "cn.stylefeng.guns.multi.mapper"})
public class MultiDataSourceConfig {
/**
......
......@@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "false", matchIfMissing = true)
@EnableTransactionManagement
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.dao"})
@MapperScan(basePackages = {"cn.stylefeng.guns.modular.*.mapper"})
public class SingleDataSourceConfig {
/**
......
......@@ -40,12 +40,12 @@ public interface Const {
/**
* 管理员id
*/
Integer ADMIN_ID = 1;
Long ADMIN_ID = 1L;
/**
* 超级管理员角色id
*/
Integer ADMIN_ROLE_ID = 1;
Long ADMIN_ROLE_ID = 1L;
/**
* 接口文档的菜单名
......
......@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.cache.CacheKey;
import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.core.common.constant.state.MenuStatus;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.dao.*;
import cn.stylefeng.guns.modular.system.model.*;
import cn.stylefeng.guns.modular.system.entity.*;
import cn.stylefeng.guns.modular.system.mapper.*;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
......@@ -63,7 +63,7 @@ public class ConstantFactory implements IConstantFactory {
* @Date 2017/5/9 23:41
*/
@Override
public String getUserNameById(Integer userId) {
public String getUserNameById(Long userId) {
User user = userMapper.selectById(userId);
if (user != null) {
return user.getName();
......@@ -79,7 +79,7 @@ public class ConstantFactory implements IConstantFactory {
* @date 2017年5月16日21:55:371
*/
@Override
public String getUserAccountById(Integer userId) {
public String getUserAccountById(Long userId) {
User user = userMapper.selectById(userId);
if (user != null) {
return user.getAccount();
......@@ -113,7 +113,7 @@ public class ConstantFactory implements IConstantFactory {
*/
@Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_NAME + "'+#roleId")
public String getSingleRoleName(Integer roleId) {
public String getSingleRoleName(Long roleId) {
if (0 == roleId) {
return "--";
}
......@@ -129,13 +129,13 @@ public class ConstantFactory implements IConstantFactory {
*/
@Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_TIP + "'+#roleId")
public String getSingleRoleTip(Integer roleId) {
public String getSingleRoleTip(Long roleId) {
if (0 == roleId) {
return "--";
}
Role roleObj = roleMapper.selectById(roleId);
if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) {
return roleObj.getTips();
return roleObj.getDescription();
}
return "";
}
......@@ -145,10 +145,10 @@ public class ConstantFactory implements IConstantFactory {
*/
@Override
@Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.DEPT_NAME + "'+#deptId")
public String getDeptName(Integer deptId) {
public String getDeptName(Long deptId) {
Dept dept = deptMapper.selectById(deptId);
if (ToolUtil.isNotEmpty(dept) && ToolUtil.isNotEmpty(dept.getFullname())) {
return dept.getFullname();
if (ToolUtil.isNotEmpty(dept) && ToolUtil.isNotEmpty(dept.getFullName())) {
return dept.getFullName();
}
return "";
}
......@@ -209,7 +209,7 @@ public class ConstantFactory implements IConstantFactory {
* 获取字典名称
*/
@Override
public String getDictName(Integer dictId) {
public String getDictName(Long dictId) {
if (ToolUtil.isEmpty(dictId)) {
return "";
} else {
......@@ -226,7 +226,7 @@ public class ConstantFactory implements IConstantFactory {
* 获取通知标题
*/
@Override
public String getNoticeTitle(Integer dictId) {
public String getNoticeTitle(Long dictId) {
if (ToolUtil.isEmpty(dictId)) {
return "";
} else {
......@@ -243,7 +243,7 @@ public class ConstantFactory implements IConstantFactory {
* 根据字典名称和字典中的值获取对应的名称
*/
@Override
public String getDictsByName(String name, Integer val) {
public String getDictsByName(String name, String code) {
Dict temp = new Dict();
temp.setName(name);
Dict dict = dictMapper.selectOne(temp);
......@@ -251,10 +251,10 @@ public class ConstantFactory implements IConstantFactory {
return "";
} else {
Wrapper<Dict> wrapper = new EntityWrapper<>();
wrapper = wrapper.eq("pid", dict.getId());
wrapper = wrapper.eq("PID", dict.getDictId());
List<Dict> dicts = dictMapper.selectList(wrapper);
for (Dict item : dicts) {
if (item.getNum() != null && item.getNum().equals(val)) {
if (item.getCode() != null && item.getCode().equals(code)) {
return item.getName();
}
}
......@@ -266,36 +266,36 @@ public class ConstantFactory implements IConstantFactory {
* 获取性别名称
*/
@Override
public String getSexName(Integer sex) {
return getDictsByName("性别", sex);
public String getSexName(String sexCode) {
return getDictsByName("性别", sexCode);
}
/**
* 获取用户登录状态
*/
@Override
public String getStatusName(Integer status) {
return ManagerStatus.valueOf(status);
public String getStatusName(String status) {
return ManagerStatus.getDescription(status);
}
/**
* 获取菜单状态
*/
@Override
public String getMenuStatusName(Integer status) {
return MenuStatus.valueOf(status);
public String getMenuStatusName(String status) {
return MenuStatus.getDescription(status);
}
/**
* 查询字典
*/
@Override
public List<Dict> findInDict(Integer id) {
public List<Dict> findInDict(Long id) {
if (ToolUtil.isEmpty(id)) {
return null;
} else {
EntityWrapper<Dict> wrapper = new EntityWrapper<>();
List<Dict> dicts = dictMapper.selectList(wrapper.eq("pid", id));
List<Dict> dicts = dictMapper.selectList(wrapper.eq("PID", id));
if (dicts == null || dicts.size() == 0) {
return null;
} else {
......@@ -316,16 +316,16 @@ public class ConstantFactory implements IConstantFactory {
* 获取子部门id
*/
@Override
public List<Integer> getSubDeptId(Integer deptid) {
public List<Long> getSubDeptId(Long deptid) {
Wrapper<Dept> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pids", "%[" + deptid + "]%");
wrapper = wrapper.like("PIDS", "%[" + deptid + "]%");
List<Dept> depts = this.deptMapper.selectList(wrapper);
ArrayList<Integer> deptids = new ArrayList<>();
ArrayList<Long> deptids = new ArrayList<>();
if (depts != null && depts.size() > 0) {
for (Dept dept : depts) {
deptids.add(dept.getId());
deptids.add(dept.getDeptId());
}
}
......@@ -336,13 +336,13 @@ public class ConstantFactory implements IConstantFactory {
* 获取所有父部门id
*/
@Override
public List<Integer> getParentDeptIds(Integer deptid) {
public List<Long> getParentDeptIds(Long deptid) {
Dept dept = deptMapper.selectById(deptid);
String pids = dept.getPids();
String[] split = pids.split(",");
ArrayList<Integer> parentDeptIds = new ArrayList<>();
ArrayList<Long> parentDeptIds = new ArrayList<>();
for (String s : split) {
parentDeptIds.add(Integer.valueOf(StrUtil.removeSuffix(StrUtil.removePrefix(s, "["), "]")));
parentDeptIds.add(Long.valueOf(StrUtil.removeSuffix(StrUtil.removePrefix(s, "["), "]")));
}
return parentDeptIds;
}
......
......@@ -15,7 +15,7 @@
*/
package cn.stylefeng.guns.core.common.constant.factory;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.entity.Dict;
import java.util.List;
......@@ -33,7 +33,7 @@ public interface IConstantFactory {
* @author stylefeng
* @Date 2017/5/9 23:41
*/
String getUserNameById(Integer userId);
String getUserNameById(Long userId);
/**
* 根据用户id获取用户账号
......@@ -41,7 +41,7 @@ public interface IConstantFactory {
* @author stylefeng
* @date 2017年5月16日21:55:371
*/
String getUserAccountById(Integer userId);
String getUserAccountById(Long userId);
/**
* 通过角色ids获取角色名称
......@@ -51,17 +51,17 @@ public interface IConstantFactory {
/**
* 通过角色id获取角色名称
*/
String getSingleRoleName(Integer roleId);
String getSingleRoleName(Long roleId);
/**
* 通过角色id获取角色英文名称
*/
String getSingleRoleTip(Integer roleId);
String getSingleRoleTip(Long roleId);
/**
* 获取部门名称
*/
String getDeptName(Integer deptId);
String getDeptName(Long deptId);
/**
* 获取菜单的名称们(多个)
......@@ -81,37 +81,37 @@ public interface IConstantFactory {
/**
* 获取字典名称
*/
String getDictName(Integer dictId);
String getDictName(Long dictId);
/**
* 获取通知标题
*/
String getNoticeTitle(Integer dictId);
String getNoticeTitle(Long dictId);
/**
* 根据字典名称和字典中的值获取对应的名称
*/
String getDictsByName(String name, Integer val);
String getDictsByName(String name, String code);
/**
* 获取性别名称
*/
String getSexName(Integer sex);
String getSexName(String sexCode);
/**
* 获取用户登录状态
*/
String getStatusName(Integer status);
String getStatusName(String status);
/**
* 获取菜单状态
*/
String getMenuStatusName(Integer status);
String getMenuStatusName(String status);
/**
* 查询字典
*/
List<Dict> findInDict(Integer id);
List<Dict> findInDict(Long id);
/**
* 获取被缓存的对象(用户删除业务)
......@@ -121,11 +121,11 @@ public interface IConstantFactory {
/**
* 获取子部门id
*/
List<Integer> getSubDeptId(Integer deptid);
List<Long> getSubDeptId(Long deptid);
/**
* 获取所有父部门id
*/
List<Integer> getParentDeptIds(Integer deptid);
List<Long> getParentDeptIds(Long deptid);
}
......@@ -15,46 +15,33 @@
*/
package cn.stylefeng.guns.core.common.constant.state;
import lombok.Getter;
/**
* 管理员的状态
*
* @author fengshuonan
* @Date 2017年1月10日 下午9:54:13
*/
@Getter
public enum ManagerStatus {
OK(1, "启用"), FREEZED(2, "冻结"), DELETED(3, "被删除");
OK("ENABLE", "启用"), FREEZED("LOCKED", "冻结"), DELETED("DELETED", "被删除");
int code;
String code;
String message;
ManagerStatus(int code, String message) {
ManagerStatus(String code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public static String valueOf(Integer value) {
public static String getDescription(String value) {
if (value == null) {
return "";
} else {
for (ManagerStatus ms : ManagerStatus.values()) {
if (ms.getCode() == value) {
if (ms.getCode().equals(value)) {
return ms.getMessage();
}
}
......
......@@ -15,47 +15,34 @@
*/
package cn.stylefeng.guns.core.common.constant.state;
import lombok.Getter;
/**
* 菜单的状态
*
* @author fengshuonan
* @Date 2017年1月22日 下午12:14:59
*/
@Getter
public enum MenuStatus {
ENABLE(1, "启用"),
DISABLE(0, "禁用");
ENABLE("ENABLE", "启用"),
DISABLE("DISABLE", "禁用");
int code;
String code;
String message;
MenuStatus(int code, String message) {
MenuStatus(String code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public static String valueOf(Integer status) {
public static String getDescription(String status) {
if (status == null) {
return "";
} else {
for (MenuStatus s : MenuStatus.values()) {
if (s.getCode() == status) {
if (s.getCode().equals(status)) {
return s.getMessage();
}
}
......
......@@ -16,6 +16,7 @@
package cn.stylefeng.guns.core.common.node;
import cn.stylefeng.roses.kernel.model.enums.YesOrNotEnum;
import lombok.Data;
import java.io.Serializable;
import java.util.*;
......@@ -25,6 +26,7 @@ import java.util.*;
* @Description 菜单的节点
* @date 2016年12月6日 上午11:34:17
*/
@Data
public class MenuNode implements Comparable, Serializable {
/**
......@@ -48,9 +50,9 @@ public class MenuNode implements Comparable, Serializable {
private Integer levels;
/**
* 按钮级别
* 按钮级别(Y N)
*/
private Integer ismenu;
private String ismenu;
/**
* 按钮的排序
......@@ -75,7 +77,7 @@ public class MenuNode implements Comparable, Serializable {
/**
* 查询子节点时候的临时集合
*/
private List<MenuNode> linkedList = new ArrayList<MenuNode>();
private List<MenuNode> linkedList = new ArrayList<>();
public MenuNode() {
super();
......@@ -87,97 +89,6 @@ public class MenuNode implements Comparable, Serializable {
this.parentId = parentId;
}
public Integer getLevels() {
return levels;
}
public void setLevels(Integer levels) {
this.levels = levels;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public static MenuNode createRoot() {
return new MenuNode(0L, -1L);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<MenuNode> getChildren() {
return children;
}
public void setChildren(List<MenuNode> children) {
this.children = children;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getIsmenu() {
return ismenu;
}
public void setIsmenu(Integer ismenu) {
this.ismenu = ismenu;
}
@Override
public String toString() {
return "MenuNode{" +
"id=" + id +
", parentId=" + parentId +
", name='" + name + '\'' +
", levels=" + levels +
", num=" + num +
", url='" + url + '\'' +
", icon='" + icon + '\'' +
", children=" + children +
", linkedList=" + linkedList +
'}';
}
/**
* 重写排序比较接口,首先根据等级排序,然后更具排序字段排序
*
......@@ -210,8 +121,10 @@ public class MenuNode implements Comparable, Serializable {
if (nodes.size() <= 0) {
return nodes;
}
//剔除非菜单
nodes.removeIf(node -> !node.getIsmenu().equals(YesOrNotEnum.Y.getCode()));
nodes.removeIf(node -> !node.getIsmenu().equals(YesOrNotEnum.Y.name()));
//对菜单排序,返回列表按菜单等级,序号的排序方式排列
Collections.sort(nodes);
return mergeList(nodes, nodes.get(nodes.size() - 1).getLevels(), null);
......
......@@ -17,8 +17,8 @@ package cn.stylefeng.guns.core.log.factory;
import cn.stylefeng.guns.core.common.constant.state.LogSucceed;
import cn.stylefeng.guns.core.common.constant.state.LogType;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.entity.OperationLog;
import java.util.Date;
......@@ -33,14 +33,14 @@ public class LogFactory {
/**
* 创建操作日志
*/
public static OperationLog createOperationLog(LogType logType, Integer userId, String bussinessName, String clazzName, String methodName, String msg, LogSucceed succeed) {
public static OperationLog createOperationLog(LogType logType, Long userId, String bussinessName, String clazzName, String methodName, String msg, LogSucceed succeed) {
OperationLog operationLog = new OperationLog();
operationLog.setLogtype(logType.getMessage());
operationLog.setLogname(bussinessName);
operationLog.setUserid(userId);
operationLog.setClassname(clazzName);
operationLog.setLogType(logType.getMessage());
operationLog.setLogName(bussinessName);
operationLog.setUserId(userId);
operationLog.setClassName(clazzName);
operationLog.setMethod(methodName);
operationLog.setCreatetime(new Date());
operationLog.setCreateTime(new Date());
operationLog.setSucceed(succeed.getMessage());
operationLog.setMessage(msg);
return operationLog;
......@@ -49,13 +49,13 @@ public class LogFactory {
/**
* 创建登录日志
*/
public static LoginLog createLoginLog(LogType logType, Integer userId, String msg, String ip) {
public static LoginLog createLoginLog(LogType logType, Long userId, String msg, String ip) {
LoginLog loginLog = new LoginLog();
loginLog.setLogname(logType.getMessage());
loginLog.setUserid(userId);
loginLog.setCreatetime(new Date());
loginLog.setLogName(logType.getMessage());
loginLog.setUserId(userId);
loginLog.setCreateTime(new Date());
loginLog.setSucceed(LogSucceed.SUCCESS.getMessage());
loginLog.setIp(ip);
loginLog.setIpAddress(ip);
loginLog.setMessage(msg);
return loginLog;
}
......
......@@ -18,10 +18,10 @@ package cn.stylefeng.guns.core.log.factory;
import cn.stylefeng.guns.core.common.constant.state.LogSucceed;
import cn.stylefeng.guns.core.common.constant.state.LogType;
import cn.stylefeng.guns.core.log.LogManager;
import cn.stylefeng.guns.modular.system.dao.LoginLogMapper;
import cn.stylefeng.guns.modular.system.dao.OperationLogMapper;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.entity.OperationLog;
import cn.stylefeng.guns.modular.system.mapper.LoginLogMapper;
import cn.stylefeng.guns.modular.system.mapper.OperationLogMapper;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import cn.stylefeng.roses.core.util.ToolUtil;
import org.slf4j.Logger;
......@@ -41,7 +41,7 @@ public class LogTaskFactory {
private static LoginLogMapper loginLogMapper = SpringContextHolder.getBean(LoginLogMapper.class);
private static OperationLogMapper operationLogMapper = SpringContextHolder.getBean(OperationLogMapper.class);
public static TimerTask loginLog(final Integer userId, final String ip) {
public static TimerTask loginLog(final Long userId, final String ip) {
return new TimerTask() {
@Override
public void run() {
......@@ -70,7 +70,7 @@ public class LogTaskFactory {
};
}
public static TimerTask exitLog(final Integer userId, final String ip) {
public static TimerTask exitLog(final Long userId, final String ip) {
return new TimerTask() {
@Override
public void run() {
......@@ -84,7 +84,7 @@ public class LogTaskFactory {
};
}
public static TimerTask bussinessLog(final Integer userId, final String bussinessName, final String clazzName, final String methodName, final String msg) {
public static TimerTask bussinessLog(final Long userId, final String bussinessName, final String clazzName, final String methodName, final String msg) {
return new TimerTask() {
@Override
public void run() {
......@@ -99,7 +99,7 @@ public class LogTaskFactory {
};
}
public static TimerTask exceptionLog(final Integer userId, final Exception exception) {
public static TimerTask exceptionLog(final Long userId, final Exception exception) {
return new TimerTask() {
@Override
public void run() {
......
......@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro;
import cn.stylefeng.guns.core.shiro.service.UserAuthService;
import cn.stylefeng.guns.core.shiro.service.impl.UserAuthServiceServiceImpl;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.util.ToolUtil;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
......@@ -56,12 +56,12 @@ public class ShiroDbRealm extends AuthorizingRealm {
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
UserAuthService shiroFactory = UserAuthServiceServiceImpl.me();
ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal();
List<Integer> roleList = shiroUser.getRoleList();
List<Long> roleList = shiroUser.getRoleList();
Set<String> permissionSet = new HashSet<>();
Set<String> roleNameSet = new HashSet<>();
for (Integer roleId : roleList) {
for (Long roleId : roleList) {
List<String> permissions = shiroFactory.findPermissionsByRoleId(roleId);
if (permissions != null) {
for (String permission : permissions) {
......
......@@ -17,7 +17,7 @@ package cn.stylefeng.guns.core.shiro;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.util.ToolUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.crypto.hash.Md5Hash;
......@@ -259,9 +259,9 @@ public class ShiroKit {
/**
* 获取当前用户的部门数据范围的集合
*/
public static List<Integer> getDeptDataScope() {
Integer deptId = getUser().getDeptId();
List<Integer> subDeptIds = ConstantFactory.me().getSubDeptId(deptId);
public static List<Long> getDeptDataScope() {
Long deptId = getUser().getDeptId();
List<Long> subDeptIds = ConstantFactory.me().getSubDeptId(deptId);
subDeptIds.add(deptId);
return subDeptIds;
}
......@@ -270,8 +270,8 @@ public class ShiroKit {
* 判断当前用户是否是超级管理员
*/
public static boolean isAdmin() {
List<Integer> roleList = ShiroKit.getUser().getRoleList();
for (Integer integer : roleList) {
List<Long> roleList = ShiroKit.getUser().getRoleList();
for (Long integer : roleList) {
String singleRoleTip = ConstantFactory.me().getSingleRoleTip(integer);
if (singleRoleTip.equals(Const.ADMIN_NAME)) {
return true;
......@@ -290,10 +290,10 @@ public class ShiroKit {
return shiroUser;
}
shiroUser.setId(user.getId());
shiroUser.setId(user.getUserId());
shiroUser.setAccount(user.getAccount());
shiroUser.setDeptId(user.getDeptid());
shiroUser.setDeptName(ConstantFactory.me().getDeptName(user.getDeptid()));
shiroUser.setDeptId(user.getDeptId());
shiroUser.setDeptName(ConstantFactory.me().getDeptName(user.getDeptId()));
shiroUser.setName(user.getName());
shiroUser.setEmail(user.getEmail());
shiroUser.setAvatar(user.getAvatar());
......
......@@ -35,7 +35,7 @@ public class ShiroUser implements Serializable {
/**
* 用户主键ID
*/
private Integer id;
private Long id;
/**
* 账号
......@@ -60,12 +60,12 @@ public class ShiroUser implements Serializable {
/**
* 部门id
*/
private Integer deptId;
private Long deptId;
/**
* 角色集
*/
private List<Integer> roleList;
private List<Long> roleList;
/**
* 部门名称
......
......@@ -16,7 +16,7 @@
package cn.stylefeng.guns.core.shiro.service;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import java.util.List;
......@@ -48,14 +48,14 @@ public interface UserAuthService {
*
* @param roleId 角色id
*/
List<String> findPermissionsByRoleId(Integer roleId);
List<String> findPermissionsByRoleId(Long roleId);
/**
* 根据角色id获取角色名称
*
* @param roleId 角色id
*/
String findRoleNameByRoleId(Integer roleId);
String findRoleNameByRoleId(Long roleId);
/**
* 获取shiro的认证信息
......
......@@ -21,10 +21,10 @@ import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.shiro.service.UserAuthService;
import cn.stylefeng.guns.modular.system.dao.MenuMapper;
import cn.stylefeng.guns.modular.system.dao.UserMapper;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.mapper.MenuMapper;
import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import org.apache.shiro.authc.CredentialsException;
import org.apache.shiro.authc.LockedAccountException;
......@@ -51,7 +51,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
private MenuMapper menuMapper;
@Autowired
private IUserService userService;
private UserService userService;
public static UserAuthService me() {
return SpringContextHolder.getBean(UserAuthService.class);
......@@ -67,7 +67,7 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
throw new CredentialsException();
}
// 账号被冻结
if (user.getStatus() != ManagerStatus.OK.getCode()) {
if (!user.getStatus().equals(ManagerStatus.OK.getCode())) {
throw new LockedAccountException();
}
return user;
......@@ -79,12 +79,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
ShiroUser shiroUser = ShiroKit.createShiroUser(user);
//用户角色数组
Integer[] roleArray = Convert.toIntArray(user.getRoleid());
Long[] roleArray = Convert.toLongArray(user.getRoleId());
//获取用户角色列表
List<Integer> roleList = new ArrayList<>();
List<Long> roleList = new ArrayList<>();
List<String> roleNameList = new ArrayList<>();
for (int roleId : roleArray) {
for (Long roleId : roleArray) {
roleList.add(roleId);
roleNameList.add(ConstantFactory.me().getSingleRoleName(roleId));
}
......@@ -98,12 +98,12 @@ public class UserAuthServiceServiceImpl implements UserAuthService {
}
@Override
public List<String> findPermissionsByRoleId(Integer roleId) {
public List<String> findPermissionsByRoleId(Long roleId) {
return menuMapper.getResUrlsByRoleId(roleId);
}
@Override
public String findRoleNameByRoleId(Integer roleId) {
public String findRoleNameByRoleId(Long roleId) {
return ConstantFactory.me().getSingleRoleTip(roleId);
}
......
......@@ -16,8 +16,8 @@
package cn.stylefeng.guns.core.tag;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.service.IDictService;
import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.guns.modular.system.service.DictService;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import org.beetl.core.Tag;
......@@ -40,7 +40,7 @@ import java.util.Map;
public class DictSelectorTag extends Tag {
@Autowired
IDictService iDictService;
DictService dictService;
@Override
public void render() {
......@@ -79,7 +79,7 @@ public class DictSelectorTag extends Tag {
//searchnum 下拉选项数量达到多少启用搜索,默认10
int searchnum = ToolUtil.isNum(attrs.get("searchnum")) ? Integer.parseInt(attrs.get("searchnum").toString()) : 10;
//根据code查询字典数据
List<Dict> list = iDictService.selectByParentCode(code);
List<Dict> list = dictService.selectByParentCode(code);
StringBuffer html = new StringBuffer();
html.append("<div class=\"form-group\">\r\n");
......
......@@ -18,8 +18,8 @@ package cn.stylefeng.guns.modular.api;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.util.JwtTokenUtil;
import cn.stylefeng.guns.modular.system.dao.UserMapper;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ErrorResponseData;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
......@@ -76,7 +76,7 @@ public class ApiController extends BaseController {
if (passwordTrueFlag) {
HashMap<String, Object> result = new HashMap<>();
result.put("token", JwtTokenUtil.generateToken(String.valueOf(user.getId())));
result.put("token", JwtTokenUtil.generateToken(String.valueOf(user.getUserId())));
return result;
} else {
return new ErrorResponseData(500, "账号密码错误!");
......
......@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.service.IDeptService;
import cn.stylefeng.guns.modular.system.entity.Dept;
import cn.stylefeng.guns.modular.system.service.DeptService;
import cn.stylefeng.guns.modular.system.warpper.DeptWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
......@@ -52,7 +52,7 @@ public class DeptController extends BaseController {
private String PREFIX = "/system/dept/";
@Autowired
private IDeptService deptService;
private DeptService deptService;
/**
* 跳转到部门管理首页
......@@ -75,7 +75,7 @@ public class DeptController extends BaseController {
*/
@Permission
@RequestMapping("/dept_update/{deptId}")
public String deptUpdate(@PathVariable Integer deptId, Model model) {
public String deptUpdate(@PathVariable Long deptId, Model model) {
Dept dept = deptService.selectById(deptId);
model.addAttribute(dept);
model.addAttribute("pName", ConstantFactory.me().getDeptName(dept.getPid()));
......@@ -102,9 +102,10 @@ public class DeptController extends BaseController {
@Permission
@ResponseBody
public Object add(Dept dept) {
if (ToolUtil.isOneEmpty(dept, dept.getSimplename())) {
if (ToolUtil.isOneEmpty(dept, dept.getSimpleName())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
//完善pids,根据pid拿到pid的pids
deptSetPids(dept);
return this.deptService.insert(dept);
......@@ -127,7 +128,7 @@ public class DeptController extends BaseController {
@RequestMapping(value = "/detail/{deptId}")
@Permission
@ResponseBody
public Object detail(@PathVariable("deptId") Integer deptId) {
public Object detail(@PathVariable("deptId") Long deptId) {
return deptService.selectById(deptId);
}
......@@ -139,7 +140,7 @@ public class DeptController extends BaseController {
@Permission
@ResponseBody
public Object update(Dept dept) {
if (ToolUtil.isEmpty(dept) || dept.getId() == null) {
if (ToolUtil.isEmpty(dept) || dept.getDeptId() == null) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
deptSetPids(dept);
......@@ -154,7 +155,7 @@ public class DeptController extends BaseController {
@RequestMapping(value = "/delete")
@Permission
@ResponseBody
public Object delete(@RequestParam Integer deptId) {
public Object delete(@RequestParam Long deptId) {
//缓存被删除的部门名称
LogObjectHolder.me().set(ConstantFactory.me().getDeptName(deptId));
......@@ -165,11 +166,11 @@ public class DeptController extends BaseController {
}
private void deptSetPids(Dept dept) {
if (ToolUtil.isEmpty(dept.getPid()) || dept.getPid().equals(0)) {
dept.setPid(0);
if (ToolUtil.isEmpty(dept.getPid()) || dept.getPid().equals(0L)) {
dept.setPid(0L);
dept.setPids("[0],");
} else {
int pid = dept.getPid();
Long pid = dept.getPid();
Dept temp = deptService.selectById(pid);
String pids = temp.getPids();
dept.setPid(pid);
......
......@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.dictmap.DictMap;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.service.IDictService;
import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.guns.modular.system.service.DictService;
import cn.stylefeng.guns.modular.system.warpper.DictWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
......@@ -53,7 +53,7 @@ public class DictController extends BaseController {
private String PREFIX = "/system/dict/";
@Autowired
private IDictService dictService;
private DictService dictService;
/**
* 跳转到字典管理首页
......@@ -79,7 +79,7 @@ public class DictController extends BaseController {
public String deptUpdate(@PathVariable Integer dictId, Model model) {
Dict dict = dictService.selectById(dictId);
model.addAttribute("dict", dict);
List<Dict> subDicts = dictService.selectList(new EntityWrapper<Dict>().eq("pid", dictId));
List<Dict> subDicts = dictService.selectList(new EntityWrapper<Dict>().eq("PID", dictId));
model.addAttribute("subDicts", subDicts);
LogObjectHolder.me().set(dict);
return PREFIX + "dict_edit.html";
......@@ -130,7 +130,7 @@ public class DictController extends BaseController {
@RequestMapping(value = "/update")
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Object update(Integer dictId, String dictCode, String dictName, String dictTips, String dictValues) {
public Object update(Long dictId, String dictCode, String dictName, String dictTips, String dictValues) {
if (ToolUtil.isOneEmpty(dictId, dictCode, dictName, dictValues)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -145,12 +145,13 @@ public class DictController extends BaseController {
@RequestMapping(value = "/delete")
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Object delete(@RequestParam Integer dictId) {
public Object delete(@RequestParam Long dictId) {
//缓存被删除的名称
LogObjectHolder.me().set(ConstantFactory.me().getDictName(dictId));
this.dictService.delteDict(dictId);
return SUCCESS_TIP;
}
......
......@@ -22,8 +22,8 @@ import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.constant.state.BizLogType;
import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.service.IOperationLogService;
import cn.stylefeng.guns.modular.system.entity.OperationLog;
import cn.stylefeng.guns.modular.system.service.OperationLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
......@@ -51,7 +51,7 @@ public class LogController extends BaseController {
private static String PREFIX = "/system/log/";
@Autowired
private IOperationLogService operationLogService;
private OperationLogService operationLogService;
/**
* 跳转到日志管理的首页
......@@ -80,7 +80,7 @@ public class LogController extends BaseController {
@RequestMapping("/detail/{id}")
@Permission(Const.ADMIN_NAME)
@ResponseBody
public Object detail(@PathVariable Integer id) {
public Object detail(@PathVariable Long id) {
OperationLog operationLog = operationLogService.selectById(id);
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(operationLog);
return super.warpObject(new LogWarpper(stringObjectMap));
......
......@@ -21,7 +21,7 @@ import cn.stylefeng.guns.core.log.factory.LogTaskFactory;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.util.KaptchaUtil;
import cn.stylefeng.guns.modular.system.service.INoticeService;
import cn.stylefeng.guns.modular.system.service.NoticeService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.google.code.kaptcha.Constants;
......@@ -48,7 +48,7 @@ import static cn.stylefeng.roses.core.util.HttpContext.getIp;
public class LoginController extends BaseController {
@Autowired
private INoticeService noticeService;
private NoticeService noticeService;
/**
* 跳转到主页
......@@ -56,7 +56,7 @@ public class LoginController extends BaseController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) {
List<Integer> roleList = ShiroKit.getUser().getRoleList();
List<Long> roleList = ShiroKit.getUser().getRoleList();
if (roleList == null || roleList.size() == 0) {
ShiroKit.getSubject().logout();
model.addAttribute("tips", "该用户没有角色,无法登陆");
......
......@@ -20,8 +20,8 @@ import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.service.ILoginLogService;
import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.service.LoginLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
......@@ -48,7 +48,7 @@ public class LoginLogController extends BaseController {
private static String PREFIX = "/system/log/";
@Autowired
private ILoginLogService loginLogService;
private LoginLogService loginLogService;
/**
* 跳转到日志管理的首页
......
......@@ -25,8 +25,8 @@ import cn.stylefeng.guns.core.common.constant.state.MenuStatus;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import cn.stylefeng.guns.modular.system.entity.Menu;
import cn.stylefeng.guns.modular.system.service.MenuService;
import cn.stylefeng.guns.modular.system.warpper.MenuWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
......@@ -59,7 +59,7 @@ public class MenuController extends BaseController {
private static String PREFIX = "/system/menu/";
@Autowired
private IMenuService menuService;
private MenuService menuService;
/**
* 跳转到菜单列表列表页面
......@@ -98,7 +98,7 @@ public class MenuController extends BaseController {
menu.setPcode("0");
} else {
//设置父级菜单的code为父级菜单的id
menu.setPcode(String.valueOf(pMenu.getId()));
menu.setPcode(String.valueOf(pMenu.getMenuId()));
}
Map<String, Object> menuMap = BeanUtil.beanToMap(menu);
......@@ -220,7 +220,7 @@ public class MenuController extends BaseController {
*/
@RequestMapping(value = "/menuTreeListByRoleId/{roleId}")
@ResponseBody
public List<ZTreeNode> menuTreeListByRoleId(@PathVariable Integer roleId) {
public List<ZTreeNode> menuTreeListByRoleId(@PathVariable Long roleId) {
List<Long> menuIds = this.menuService.getMenuIdsByRoleId(roleId);
if (ToolUtil.isEmpty(menuIds)) {
return this.menuService.menuTreeList();
......
......@@ -21,8 +21,8 @@ import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.modular.system.model.Notice;
import cn.stylefeng.guns.modular.system.service.INoticeService;
import cn.stylefeng.guns.modular.system.entity.Notice;
import cn.stylefeng.guns.modular.system.service.NoticeService;
import cn.stylefeng.guns.modular.system.warpper.NoticeWrapper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
......@@ -52,7 +52,7 @@ public class NoticeController extends BaseController {
private String PREFIX = "/system/notice/";
@Autowired
private INoticeService noticeService;
private NoticeService noticeService;
/**
* 跳转到通知列表首页
......@@ -74,7 +74,7 @@ public class NoticeController extends BaseController {
* 跳转到修改通知
*/
@RequestMapping("/notice_update/{noticeId}")
public String noticeUpdate(@PathVariable Integer noticeId, Model model) {
public String noticeUpdate(@PathVariable Long noticeId, Model model) {
Notice notice = this.noticeService.selectById(noticeId);
model.addAttribute("notice", notice);
LogObjectHolder.me().set(notice);
......@@ -111,9 +111,9 @@ public class NoticeController extends BaseController {
if (ToolUtil.isOneEmpty(notice, notice.getTitle(), notice.getContent())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
notice.setCreater(ShiroKit.getUser().getId());
notice.setCreatetime(new Date());
notice.insert();
notice.setCreateUser(ShiroKit.getUser().getId());
notice.setCreateTime(new Date());
this.noticeService.insert(notice);
return SUCCESS_TIP;
}
......@@ -123,7 +123,7 @@ public class NoticeController extends BaseController {
@RequestMapping(value = "/delete")
@ResponseBody
@BussinessLog(value = "删除通知", key = "noticeId", dict = NoticeMap.class)
public Object delete(@RequestParam Integer noticeId) {
public Object delete(@RequestParam Long noticeId) {
//缓存通知名称
LogObjectHolder.me().set(ConstantFactory.me().getNoticeTitle(noticeId));
......@@ -140,13 +140,13 @@ public class NoticeController extends BaseController {
@ResponseBody
@BussinessLog(value = "修改通知", key = "title", dict = NoticeMap.class)
public Object update(Notice notice) {
if (ToolUtil.isOneEmpty(notice, notice.getId(), notice.getTitle(), notice.getContent())) {
if (ToolUtil.isOneEmpty(notice, notice.getNoticeId(), notice.getTitle(), notice.getContent())) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
Notice old = this.noticeService.selectById(notice.getId());
Notice old = this.noticeService.selectById(notice.getNoticeId());
old.setTitle(notice.getTitle());
old.setContent(notice.getContent());
old.updateById();
this.noticeService.updateById(old);
return SUCCESS_TIP;
}
......
......@@ -26,10 +26,10 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.util.CacheUtil;
import cn.stylefeng.guns.modular.system.model.Role;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IRoleService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.entity.Role;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.service.RoleService;
import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.guns.modular.system.warpper.RoleWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
......@@ -61,10 +61,10 @@ public class RoleController extends BaseController {
private static String PREFIX = "/system/role";
@Autowired
private IUserService userService;
private UserService userService;
@Autowired
private IRoleService roleService;
private RoleService roleService;
/**
* 跳转到角色列表页面
......@@ -94,7 +94,6 @@ public class RoleController extends BaseController {
Role role = this.roleService.selectById(roleId);
model.addAttribute(role);
model.addAttribute("pName", ConstantFactory.me().getSingleRoleName(role.getPid()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(role.getDeptid()));
LogObjectHolder.me().set(role);
return PREFIX + "/role_edit.html";
}
......@@ -104,7 +103,7 @@ public class RoleController extends BaseController {
*/
@Permission
@RequestMapping(value = "/role_assign/{roleId}")
public String roleAssign(@PathVariable("roleId") Integer roleId, Model model) {
public String roleAssign(@PathVariable("roleId") Long roleId, Model model) {
if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -135,7 +134,7 @@ public class RoleController extends BaseController {
if (result.hasErrors()) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
role.setId(null);
role.setRoleId(null);
this.roleService.insert(role);
return SUCCESS_TIP;
}
......@@ -165,7 +164,7 @@ public class RoleController extends BaseController {
@BussinessLog(value = "删除角色", key = "roleId", dict = RoleDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData remove(@RequestParam Integer roleId) {
public ResponseData remove(@RequestParam Long roleId) {
if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -190,20 +189,17 @@ public class RoleController extends BaseController {
*/
@RequestMapping(value = "/view/{roleId}")
@ResponseBody
public ResponseData view(@PathVariable Integer roleId) {
public ResponseData view(@PathVariable Long roleId) {
if (ToolUtil.isEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
Role role = this.roleService.selectById(roleId);
Map<String, Object> roleMap = BeanUtil.beanToMap(role);
Integer pid = role.getPid();
Long pid = role.getPid();
String pName = ConstantFactory.me().getSingleRoleName(pid);
roleMap.put("pName", pName);
String deptName = ConstantFactory.me().getDeptName(role.getDeptid());
roleMap.put("deptName", deptName);
return ResponseData.success(roleMap);
}
......@@ -214,7 +210,7 @@ public class RoleController extends BaseController {
@BussinessLog(value = "配置权限", key = "roleId,ids", dict = RoleDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData setAuthority(@RequestParam("roleId") Integer roleId, @RequestParam("ids") String ids) {
public ResponseData setAuthority(@RequestParam("roleId") Long roleId, @RequestParam("ids") String ids) {
if (ToolUtil.isOneEmpty(roleId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -238,9 +234,9 @@ public class RoleController extends BaseController {
*/
@RequestMapping(value = "/roleTreeListByUserId/{userId}")
@ResponseBody
public List<ZTreeNode> roleTreeListByUserId(@PathVariable Integer userId) {
public List<ZTreeNode> roleTreeListByUserId(@PathVariable Long userId) {
User theUser = this.userService.selectById(userId);
String roleid = theUser.getRoleid();
String roleid = theUser.getRoleId();
if (ToolUtil.isEmpty(roleid)) {
return this.roleService.roleTreeList();
} else {
......
......@@ -21,11 +21,11 @@ import cn.stylefeng.guns.core.common.constant.DefaultAvatar;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.entity.FileInfo;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.factory.UserFactory;
import cn.stylefeng.guns.modular.system.model.FileInfo;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IFileInfoService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.service.FileInfoService;
import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil;
......@@ -61,10 +61,10 @@ public class SystemController extends BaseController {
private String PREFIX = "/common/";
@Autowired
private IUserService userService;
private UserService userService;
@Autowired
private IFileInfoService fileInfoService;
private FileInfoService fileInfoService;
/**
* 通用的树列表选择器
......@@ -132,9 +132,9 @@ public class SystemController extends BaseController {
avatar = DefaultAvatar.BASE_64_AVATAR;
} else {
FileInfo fileInfo = fileInfoService.selectById(avatar);
if(fileInfo == null){
if (fileInfo == null) {
avatar = DefaultAvatar.BASE_64_AVATAR;
}else{
} else {
avatar = fileInfo.getFileData();
}
}
......@@ -169,8 +169,8 @@ public class SystemController extends BaseController {
HashMap<Object, Object> hashMap = CollectionUtil.newHashMap();
hashMap.putAll(map);
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleid()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptid()));
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
return ResponseData.success(hashMap);
}
......
......@@ -28,9 +28,9 @@ import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.factory.UserFactory;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.service.UserService;
import cn.stylefeng.guns.modular.system.transfer.UserDto;
import cn.stylefeng.guns.modular.system.warpper.UserWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
......@@ -70,7 +70,7 @@ public class UserMgrController extends BaseController {
private GunsProperties gunsProperties;
@Autowired
private IUserService userService;
private UserService userService;
/**
* 跳转到查看管理员列表的页面
......@@ -93,11 +93,11 @@ public class UserMgrController extends BaseController {
*/
@Permission
@RequestMapping("/role_assign")
public String roleAssign(@RequestParam Integer userId, Model model) {
public String roleAssign(@RequestParam Long userId, Model model) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
User user = this.userService.selectOne(new EntityWrapper<User>().eq("id", userId));
User user = this.userService.selectOne(new EntityWrapper<User>().eq("USER_ID", userId));
model.addAttribute("userId", userId);
model.addAttribute("userAccount", user.getAccount());
return PREFIX + "user_roleassign.html";
......@@ -122,14 +122,14 @@ public class UserMgrController extends BaseController {
*/
@RequestMapping("/user_info")
public String userInfo(Model model) {
Integer userId = ShiroKit.getUser().getId();
Long userId = ShiroKit.getUser().getId();
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
User user = this.userService.selectById(userId);
model.addAllAttributes(BeanUtil.beanToMap(user));
model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleid()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptid()));
model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
LogObjectHolder.me().set(user);
return PREFIX + "user_view.html";
}
......@@ -147,7 +147,7 @@ public class UserMgrController extends BaseController {
*/
@RequestMapping("/getUserInfo")
@ResponseBody
public Object getUserInfo(@RequestParam Integer userId) {
public Object getUserInfo(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new RequestEmptyException();
}
......@@ -157,8 +157,8 @@ public class UserMgrController extends BaseController {
HashMap<Object, Object> hashMap = CollectionUtil.newHashMap();
hashMap.putAll(map);
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleid()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptid()));
hashMap.put("roleName", ConstantFactory.me().getRoleName(user.getRoleId()));
hashMap.put("deptName", ConstantFactory.me().getDeptName(user.getDeptId()));
return ResponseData.success(hashMap);
}
......@@ -172,13 +172,13 @@ public class UserMgrController extends BaseController {
if (ToolUtil.isOneEmpty(oldPassword, newPassword)) {
throw new RequestEmptyException();
}
Integer userId = ShiroKit.getUser().getId();
Long userId = ShiroKit.getUser().getId();
User user = userService.selectById(userId);
String oldMd5 = ShiroKit.md5(oldPassword, user.getSalt());
if (user.getPassword().equals(oldMd5)) {
String newMd5 = ShiroKit.md5(newPassword, user.getSalt());
user.setPassword(newMd5);
user.updateById();
this.userService.updateById(user);
return SUCCESS_TIP;
} else {
throw new ServiceException(BizExceptionEnum.OLD_PWD_NOT_RIGHT);
......@@ -193,7 +193,7 @@ public class UserMgrController extends BaseController {
@ResponseBody
public Object list(@RequestParam(required = false) String name,
@RequestParam(required = false) String timeLimit,
@RequestParam(required = false) Integer deptid) {
@RequestParam(required = false) Long deptid) {
//拼接查询条件
String beginTime = "";
......@@ -276,7 +276,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "删除管理员", key = "userId", dict = UserDict.class)
@Permission
@ResponseBody
public ResponseData delete(@RequestParam Integer userId) {
public ResponseData delete(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -294,7 +294,7 @@ public class UserMgrController extends BaseController {
*/
@RequestMapping("/view/{userId}")
@ResponseBody
public User view(@PathVariable Integer userId) {
public User view(@PathVariable Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -309,7 +309,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "重置管理员密码", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData reset(@RequestParam Integer userId) {
public ResponseData reset(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -328,7 +328,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "冻结用户", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData freeze(@RequestParam Integer userId) {
public ResponseData freeze(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -348,7 +348,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "解除冻结用户", key = "userId", dict = UserDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData unfreeze(@RequestParam Integer userId) {
public ResponseData unfreeze(@RequestParam Long userId) {
if (ToolUtil.isEmpty(userId)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -364,7 +364,7 @@ public class UserMgrController extends BaseController {
@BussinessLog(value = "分配角色", key = "userId,roleIds", dict = UserDict.class)
@Permission(Const.ADMIN_NAME)
@ResponseBody
public ResponseData setRole(@RequestParam("userId") Integer userId, @RequestParam("roleIds") String roleIds) {
public ResponseData setRole(@RequestParam("userId") Long userId, @RequestParam("roleIds") String roleIds) {
if (ToolUtil.isOneEmpty(userId, roleIds)) {
throw new ServiceException(BizExceptionEnum.REQUEST_NULL);
}
......@@ -397,13 +397,13 @@ public class UserMgrController extends BaseController {
/**
* 判断当前登录的用户是否有操作这个用户的权限
*/
private void assertAuth(Integer userId) {
private void assertAuth(Long userId) {
if (ShiroKit.isAdmin()) {
return;
}
List<Integer> deptDataScope = ShiroKit.getDeptDataScope();
List<Long> deptDataScope = ShiroKit.getDeptDataScope();
User user = this.userService.selectById(userId);
Integer deptid = user.getDeptid();
Long deptid = user.getDeptId();
if (deptDataScope.contains(deptid)) {
return;
} else {
......
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Expense;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 报销表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-12-04
*/
public interface ExpenseMapper extends BaseMapper<Expense> {
}
\ No newline at end of file
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.FileInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 文件信息 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
public interface FileInfoMapper extends BaseMapper<FileInfo> {
}
\ No newline at end of file
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.modular.system.model.Relation;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 角色和菜单关联表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
public interface RelationMapper extends BaseMapper<Relation> {
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.DeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Dept">
<id column="id" property="id"/>
<result column="num" property="num"/>
<result column="pid" property="pid"/>
<result column="pids" property="pids"/>
<result column="simplename" property="simplename"/>
<result column="fullname" property="fullname"/>
<result column="tips" property="tips"/>
<result column="version" property="version"/>
</resultMap>
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select id,pid as pId,simplename as name,
(
CASE
WHEN (pId = 0 OR pId IS NULL) THEN
'true'
ELSE
'false'
END
) as isOpen from sys_dept
</select>
<select id="list" resultType="map">
select * from sys_dept
<if test="condition != null and condition != ''">
where simplename like CONCAT('%',#{condition},'%') or fullname like CONCAT('%',#{condition},'%')
</if>
order by num ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.DictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Dict">
<id column="id" property="id"/>
<result column="num" property="num"/>
<result column="pid" property="pid"/>
<result column="name" property="name"/>
<result column="code" property="code"/>
<result column="tips" property="tips"/>
</resultMap>
<sql id="Base_Column_List">
id, num, pid, name,code,tips
</sql>
<select id="selectByCode" resultType="cn.stylefeng.guns.modular.system.model.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where code = #{code}
</select>
<select id="selectByParentCode" resultType="cn.stylefeng.guns.modular.system.model.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where pid in(select id from sys_dict where code = #{code}) order by num asc
</select>
<select id="list" resultType="map">
select * from sys_dict
where pid = 0
<if test="condition != null and condition != ''">
AND name like CONCAT('%',#{condition},'%')
</if>
order by id ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.NoticeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Notice">
<id column="id" property="id"/>
<result column="title" property="title"/>
<result column="type" property="type"/>
<result column="content" property="content"/>
<result column="createtime" property="createtime"/>
<result column="creater" property="creater"/>
</resultMap>
<select id="list" resultType="map">
select * from sys_notice
<if test="condition != null and condition != ''">
where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%')
</if>
order by createtime DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.RelationMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Relation">
<id column="id" property="id" />
<result column="menuid" property="menuid" />
<result column="roleid" property="roleid" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.User">
<id column="id" property="id" />
<result column="avatar" property="avatar" />
<result column="account" property="account" />
<result column="password" property="password" />
<result column="salt" property="salt" />
<result column="name" property="name" />
<result column="birthday" property="birthday" />
<result column="sex" property="sex" />
<result column="email" property="email" />
<result column="phone" property="phone" />
<result column="roleid" property="roleid" />
<result column="deptid" property="deptid" />
<result column="status" property="status" />
<result column="createtime" property="createtime" />
<result column="version" property="version" />
</resultMap>
<sql id="Base_Column_List">
id, account, name, birthday, sex, email, avatar,
phone, roleid,
deptid, status,
createtime, version
</sql>
<sql id="Base_Column_List_With_Pwd">
id, account, name, birthday,password, sex, email, avatar,
phone, roleid,salt,
deptid, status,
createtime, version
</sql>
<select id="selectUsers" resultType="map">
select
<include refid="Base_Column_List" />
from sys_user
where status != 3
<if test="name != null and name != ''">
and (phone like CONCAT('%',#{name},'%')
or account like CONCAT('%',#{name},'%')
or name like CONCAT('%',#{name},'%'))
</if>
<if test="deptid != null and deptid != 0">
and (deptid = #{deptid} or deptid in ( select id from sys_dept where pids like CONCAT('%[', #{deptid}, ']%') ))
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
</select>
<update id="setStatus">
update sys_user set status = #{status} where id =
#{userId}
</update>
<update id="changePwd">
update sys_user set password = #{pwd} where id =
#{userId}
</update>
<update id="setRoles">
update sys_user set roleid = #{roleIds} where id =
#{userId}
</update>
<select id="getByAccount" resultType="cn.stylefeng.guns.modular.system.model.User">
select
<include refid="Base_Column_List_With_Pwd" />
from sys_user where account = #{account} and status != 3
</select>
</mapper>
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 数据库链接信息
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("code_dbinfo")
public class CodeDbinfo implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "DB_ID", type = IdType.AUTO)
private Long dbId;
/**
* 别名
*/
@TableField("NAME")
private String name;
/**
* 数据库驱动
*/
@TableField("DB_DRIVER")
private String dbDriver;
/**
* 数据库地址
*/
@TableField("DB_URL")
private String dbUrl;
/**
* 数据库账户
*/
@TableField("DB_USER_NAME")
private String dbUserName;
/**
* 连接密码
*/
@TableField("DB_PASSWORD")
private String dbPassword;
/**
* 数据库类型(字典)
*/
@TableField("DB_TYPE")
private String dbType;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建用户
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getDbId() {
return dbId;
}
public void setDbId(Long dbId) {
this.dbId = dbId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDbDriver() {
return dbDriver;
}
public void setDbDriver(String dbDriver) {
this.dbDriver = dbDriver;
}
public String getDbUrl() {
return dbUrl;
}
public void setDbUrl(String dbUrl) {
this.dbUrl = dbUrl;
}
public String getDbUserName() {
return dbUserName;
}
public void setDbUserName(String dbUserName) {
this.dbUserName = dbUserName;
}
public String getDbPassword() {
return dbPassword;
}
public void setDbPassword(String dbPassword) {
this.dbPassword = dbPassword;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "CodeDbinfo{" +
", dbId=" + dbId +
", name=" + name +
", dbDriver=" + dbDriver +
", dbUrl=" + dbUrl +
", dbUserName=" + dbUserName +
", dbPassword=" + dbPassword +
", dbType=" + dbType +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
......@@ -13,69 +15,88 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_dept")
public class Dept extends Model<Dept> {
public class Dept implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 排序
*/
private Integer num;
@TableId(value = "DEPT_ID", type = IdType.AUTO)
private Long deptId;
/**
* 父部门id
*/
private Integer pid;
@TableField("PID")
private Long pid;
/**
* 父级ids
*/
@TableField("PIDS")
private String pids;
/**
* 简称
*/
private String simplename;
@TableField("SIMPLE_NAME")
private String simpleName;
/**
* 全称
*/
private String fullname;
@TableField("FULL_NAME")
private String fullName;
/**
* 提示
* 描述
*/
private String tips;
@TableField("DESCRIPTION")
private String description;
/**
* 版本(乐观锁保留字段)
*/
@TableField("VERSION")
private Integer version;
/**
* 排序
*/
@TableField("SORT")
private Integer sort;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建人
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getNum() {
return num;
public Long getDeptId() {
return deptId;
}
public void setNum(Integer num) {
this.num = num;
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Integer getPid() {
public Long getPid() {
return pid;
}
public void setPid(Integer pid) {
public void setPid(Long pid) {
this.pid = pid;
}
......@@ -87,28 +108,28 @@ public class Dept extends Model<Dept> {
this.pids = pids;
}
public String getSimplename() {
return simplename;
public String getSimpleName() {
return simpleName;
}
public void setSimplename(String simplename) {
this.simplename = simplename;
public void setSimpleName(String simpleName) {
this.simpleName = simpleName;
}
public String getFullname() {
return fullname;
public String getFullName() {
return fullName;
}
public void setFullname(String fullname) {
this.fullname = fullname;
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getTips() {
return tips;
public String getDescription() {
return description;
}
public void setTips(String tips) {
this.tips = tips;
public void setDescription(String description) {
this.description = description;
}
public Integer getVersion() {
......@@ -119,22 +140,61 @@ public class Dept extends Model<Dept> {
this.version = version;
}
@Override
protected Serializable pkVal() {
return this.id;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Dept{" +
"id=" + id +
", num=" + num +
", pid=" + pid +
", pids=" + pids +
", simplename=" + simplename +
", fullname=" + fullname +
", tips=" + tips +
", version=" + version +
"}";
", deptId=" + deptId +
", pid=" + pid +
", pids=" + pids +
", simpleName=" + simpleName +
", fullName=" + fullName +
", description=" + description +
", version=" + version +
", sort=" + sort +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 字典表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_dict")
public class Dict implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "DICT_ID", type = IdType.AUTO)
private Long dictId;
/**
* 父级字典id
*/
@TableField("PID")
private Long pid;
/**
* 字典名称
*/
@TableField("NAME")
private String name;
/**
* 字典的编码
*/
@TableField("CODE")
private String code;
/**
* 字典描述
*/
@TableField("DESCRIPTION")
private String description;
/**
* 排序
*/
@TableField("SORT")
private Integer sort;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建人
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getDictId() {
return dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
public Long getPid() {
return pid;
}
public void setPid(Long pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Dict{" +
", dictId=" + dictId +
", pid=" + pid +
", name=" + name +
", code=" + code +
", description=" + description +
", sort=" + sort +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 文件信息表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_file_info")
public class FileInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId("FILE_ID")
private String fileId;
/**
* base64编码的文件
*/
@TableField("FILE_DATA")
private String fileData;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建用户
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileData() {
return fileData;
}
public void setFileData(String fileData) {
this.fileData = fileData;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "FileInfo{" +
", fileId=" + fileId +
", fileData=" + fileData +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
......@@ -14,74 +15,80 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_login_log")
public class LoginLog extends Model<LoginLog> {
public class LoginLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableId(value = "LOGIN_LOG_ID", type = IdType.AUTO)
private Long loginLogId;
/**
* 日志名称
*/
private String logname;
@TableField("LOG_NAME")
private String logName;
/**
* 管理员id
*/
private Integer userid;
@TableField("USER_ID")
private Long userId;
/**
* 创建时间
*/
private Date createtime;
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 是否执行成功
*/
@TableField("SUCCEED")
private String succeed;
/**
* 具体消息
*/
@TableField("MESSAGE")
private String message;
/**
* 登录ip
*/
private String ip;
@TableField("IP_ADDRESS")
private String ipAddress;
public Integer getId() {
return id;
public Long getLoginLogId() {
return loginLogId;
}
public void setId(Integer id) {
this.id = id;
public void setLoginLogId(Long loginLogId) {
this.loginLogId = loginLogId;
}
public String getLogname() {
return logname;
public String getLogName() {
return logName;
}
public void setLogname(String logname) {
this.logname = logname;
public void setLogName(String logName) {
this.logName = logName;
}
public Integer getUserid() {
return userid;
public Long getUserId() {
return userId;
}
public void setUserid(Integer userid) {
this.userid = userid;
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getCreatetime() {
return createtime;
public Date getCreateTime() {
return createTime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getSucceed() {
......@@ -100,29 +107,24 @@ public class LoginLog extends Model<LoginLog> {
this.message = message;
}
public String getIp() {
return ip;
public String getIpAddress() {
return ipAddress;
}
public void setIp(String ip) {
this.ip = ip;
}
@Override
protected Serializable pkVal() {
return this.id;
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
@Override
public String toString() {
return "LoginLog{" +
"id=" + id +
", logname=" + logname +
", userid=" + userid +
", createtime=" + createtime +
", succeed=" + succeed +
", message=" + message +
", ip=" + ip +
"}";
", loginLogId=" + loginLogId +
", logName=" + logName +
", userId=" + userId +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
", ipAddress=" + ipAddress +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
......@@ -14,76 +15,111 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_menu")
public class Menu extends Model<Menu> {
public class Menu implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableId(value = "MENU_ID", type = IdType.AUTO)
private Long menuId;
/**
* 菜单编号
*/
@TableField("CODE")
private String code;
/**
* 菜单父编号
*/
@TableField("PCODE")
private String pcode;
/**
* 当前菜单的所有父菜单编号
*/
@TableField("PCODES")
private String pcodes;
/**
* 菜单名称
*/
@NotBlank
@TableField("NAME")
private String name;
/**
* 菜单图标
*/
@TableField("ICON")
private String icon;
/**
* url地址
*/
@NotBlank
@TableField("URL")
private String url;
/**
* 菜单排序号
*/
private Integer num;
@TableField("SORT")
private Integer sort;
/**
* 菜单层级
*/
@TableField("LEVELS")
private Integer levels;
/**
* 是否是菜单(1:是 0:不是)
* 是否是菜单(字典)
*/
private Integer ismenu;
@TableField("MENU_FLAG")
private String menuFlag;
/**
* 备注
*/
private String tips;
@TableField("DESCRIPTION")
private String description;
/**
* 菜单状态 : 1:启用 0:不启用
* 菜单状态(字典)
*/
private Integer status;
@TableField("STATUS")
private String status;
/**
* 是否打开: 1:打开 0:不打开
* 是否打开新页面的标识(字典)
*/
private Integer isopen;
@TableField("NEW_PAGE_FLAG")
private String newPageFlag;
/**
* 是否打开(字典)
*/
@TableField("OPEN_FLAG")
private String openFlag;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建人
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Long getId() {
return id;
public Long getMenuId() {
return menuId;
}
public void setId(Long id) {
this.id = id;
public void setMenuId(Long menuId) {
this.menuId = menuId;
}
public String getCode() {
......@@ -134,12 +170,12 @@ public class Menu extends Model<Menu> {
this.url = url;
}
public Integer getNum() {
return num;
public Integer getSort() {
return sort;
}
public void setNum(Integer num) {
this.num = num;
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getLevels() {
......@@ -150,59 +186,99 @@ public class Menu extends Model<Menu> {
this.levels = levels;
}
public Integer getIsmenu() {
return ismenu;
public String getMenuFlag() {
return menuFlag;
}
public void setIsmenu(Integer ismenu) {
this.ismenu = ismenu;
public void setMenuFlag(String menuFlag) {
this.menuFlag = menuFlag;
}
public String getTips() {
return tips;
public String getDescription() {
return description;
}
public void setTips(String tips) {
this.tips = tips;
public void setDescription(String description) {
this.description = description;
}
public Integer getStatus() {
public String getStatus() {
return status;
}
public void setStatus(Integer status) {
public void setStatus(String status) {
this.status = status;
}
public Integer getIsopen() {
return isopen;
public String getNewPageFlag() {
return newPageFlag;
}
public void setIsopen(Integer isopen) {
this.isopen = isopen;
public void setNewPageFlag(String newPageFlag) {
this.newPageFlag = newPageFlag;
}
@Override
protected Serializable pkVal() {
return this.id;
public String getOpenFlag() {
return openFlag;
}
public void setOpenFlag(String openFlag) {
this.openFlag = openFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Menu{" +
"id=" + id +
", code=" + code +
", pcode=" + pcode +
", pcodes=" + pcodes +
", name=" + name +
", icon=" + icon +
", url=" + url +
", num=" + num +
", levels=" + levels +
", ismenu=" + ismenu +
", tips=" + tips +
", status=" + status +
", isopen=" + isopen +
"}";
", menuId=" + menuId +
", code=" + code +
", pcode=" + pcode +
", pcodes=" + pcodes +
", name=" + name +
", icon=" + icon +
", url=" + url +
", sort=" + sort +
", levels=" + levels +
", menuFlag=" + menuFlag +
", description=" + description +
", status=" + status +
", newPageFlag=" + newPageFlag +
", openFlag=" + openFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
......@@ -14,46 +15,56 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_notice")
public class Notice extends Model<Notice> {
public class Notice implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableId(value = "NOTICE_ID", type = IdType.AUTO)
private Long noticeId;
/**
* 标题
*/
@TableField("TITLE")
private String title;
/**
* 类型
*/
private Integer type;
/**
* 内容
*/
@TableField("CONTENT")
private String content;
/**
* 创建时间
*/
private Date createtime;
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 创建人
*/
private Integer creater;
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 修改人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Integer getId() {
return id;
public Long getNoticeId() {
return noticeId;
}
public void setId(Integer id) {
this.id = id;
public void setNoticeId(Long noticeId) {
this.noticeId = noticeId;
}
public String getTitle() {
......@@ -64,14 +75,6 @@ public class Notice extends Model<Notice> {
this.title = title;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getContent() {
return content;
}
......@@ -80,36 +83,48 @@ public class Notice extends Model<Notice> {
this.content = content;
}
public Date getCreatetime() {
return createtime;
public Date getCreateTime() {
return createTime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreater() {
return creater;
public Long getCreateUser() {
return createUser;
}
public void setCreater(Integer creater) {
this.creater = creater;
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
@Override
protected Serializable pkVal() {
return this.id;
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Notice{" +
"id=" + id +
", title=" + title +
", type=" + type +
", content=" + content +
", createtime=" + createtime +
", creater=" + creater +
"}";
", noticeId=" + noticeId +
", title=" + title +
", content=" + content +
", createTime=" + createTime +
", createUser=" + createUser +
", updateTime=" + updateTime +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
......@@ -14,90 +15,98 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_operation_log")
public class OperationLog extends Model<OperationLog> {
public class OperationLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableId(value = "OPERATION_LOG_ID", type = IdType.AUTO)
private Long operationLogId;
/**
* 日志类型
* 日志类型(字典)
*/
private String logtype;
@TableField("LOG_TYPE")
private String logType;
/**
* 日志名称
*/
private String logname;
@TableField("LOG_NAME")
private String logName;
/**
* 用户id
*/
private Integer userid;
@TableField("USER_ID")
private Long userId;
/**
* 类名称
*/
private String classname;
@TableField("CLASS_NAME")
private String className;
/**
* 方法名称
*/
@TableField("METHOD")
private String method;
/**
* 创建时间
*/
private Date createtime;
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 是否成功
* 是否成功(字典)
*/
@TableField("SUCCEED")
private String succeed;
/**
* 备注
*/
@TableField("MESSAGE")
private String message;
public Integer getId() {
return id;
public Long getOperationLogId() {
return operationLogId;
}
public void setId(Integer id) {
this.id = id;
public void setOperationLogId(Long operationLogId) {
this.operationLogId = operationLogId;
}
public String getLogtype() {
return logtype;
public String getLogType() {
return logType;
}
public void setLogtype(String logtype) {
this.logtype = logtype;
public void setLogType(String logType) {
this.logType = logType;
}
public String getLogname() {
return logname;
public String getLogName() {
return logName;
}
public void setLogname(String logname) {
this.logname = logname;
public void setLogName(String logName) {
this.logName = logName;
}
public Integer getUserid() {
return userid;
public Long getUserId() {
return userId;
}
public void setUserid(Integer userid) {
this.userid = userid;
public void setUserId(Long userId) {
this.userId = userId;
}
public String getClassname() {
return classname;
public String getClassName() {
return className;
}
public void setClassname(String classname) {
this.classname = classname;
public void setClassName(String className) {
this.className = className;
}
public String getMethod() {
......@@ -108,12 +117,12 @@ public class OperationLog extends Model<OperationLog> {
this.method = method;
}
public Date getCreatetime() {
return createtime;
public Date getCreateTime() {
return createTime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getSucceed() {
......@@ -133,22 +142,17 @@ public class OperationLog extends Model<OperationLog> {
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "OperationLog{" +
"id=" + id +
", logtype=" + logtype +
", logname=" + logname +
", userid=" + userid +
", classname=" + classname +
", method=" + method +
", createtime=" + createtime +
", succeed=" + succeed +
", message=" + message +
"}";
", operationLogId=" + operationLogId +
", logType=" + logType +
", logName=" + logName +
", userId=" + userId +
", className=" + className +
", method=" + method +
", createTime=" + createTime +
", succeed=" + succeed +
", message=" + message +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
......@@ -13,63 +12,60 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_relation")
public class Relation extends Model<Relation> {
public class Relation implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableId("RELATION_ID")
private Long relationId;
/**
* 菜单id
*/
private Long menuid;
@TableField("MENU_ID")
private Long menuId;
/**
* 角色id
*/
private Integer roleid;
@TableField("ROLE_ID")
private Long roleId;
public Integer getId() {
return id;
public Long getRelationId() {
return relationId;
}
public void setId(Integer id) {
this.id = id;
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Long getMenuid() {
return menuid;
public Long getMenuId() {
return menuId;
}
public void setMenuid(Long menuid) {
this.menuid = menuid;
public void setMenuId(Long menuId) {
this.menuId = menuId;
}
public Integer getRoleid() {
return roleid;
public Long getRoleId() {
return roleId;
}
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
@Override
protected Serializable pkVal() {
return this.id;
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
return "Relation{" +
"id=" + id +
", menuid=" + menuid +
", roleid=" + roleid +
"}";
", relationId=" + relationId +
", menuId=" + menuId +
", roleId=" + roleId +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
......@@ -13,65 +15,78 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
@TableName("sys_role")
public class Role extends Model<Role> {
public class Role implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 序号
*/
private Integer num;
@TableId(value = "ROLE_ID", type = IdType.AUTO)
private Long roleId;
/**
* 父角色id
*/
private Integer pid;
@TableField("PID")
private Long pid;
/**
* 角色名称
*/
@TableField("NAME")
private String name;
/**
* 部门名称
* 提示
*/
private Integer deptid;
@TableField("DESCRIPTION")
private String description;
/**
* 提示
* 序号
*/
private String tips;
@TableField("SORT")
private Integer sort;
/**
* 保留字段(暂时没用)
* 乐观锁
*/
@TableField("VERSION")
private Integer version;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 创建用户
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 修改用户
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
public Long getRoleId() {
return roleId;
}
public Integer getNum() {
return num;
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getPid() {
public Long getPid() {
return pid;
}
public void setPid(Integer pid) {
public void setPid(Long pid) {
this.pid = pid;
}
......@@ -83,20 +98,20 @@ public class Role extends Model<Role> {
this.name = name;
}
public Integer getDeptid() {
return deptid;
public String getDescription() {
return description;
}
public void setDeptid(Integer deptid) {
this.deptid = deptid;
public void setDescription(String description) {
this.description = description;
}
public String getTips() {
return tips;
public Integer getSort() {
return sort;
}
public void setTips(String tips) {
this.tips = tips;
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getVersion() {
......@@ -107,21 +122,51 @@ public class Role extends Model<Role> {
this.version = version;
}
@Override
protected Serializable pkVal() {
return this.id;
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
@Override
public String toString() {
return "Role{" +
"id=" + id +
", num=" + num +
", pid=" + pid +
", name=" + name +
", deptid=" + deptid +
", tips=" + tips +
", version=" + version +
"}";
", roleId=" + roleId +
", pid=" + pid +
", name=" + name +
", description=" + description +
", sort=" + sort +
", version=" + version +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createUser=" + createUser +
", updateUser=" + updateUser +
"}";
}
}
package cn.stylefeng.guns.modular.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 管理员表
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@TableName("sys_user")
@Data
public class User implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "USER_ID", type = IdType.AUTO)
private Long userId;
/**
* 头像
*/
@TableField("AVATAR")
private String avatar;
/**
* 账号
*/
@TableField("ACCOUNT")
private String account;
/**
* 密码
*/
@TableField("PASSWORD")
private String password;
/**
* md5密码盐
*/
@TableField("SALT")
private String salt;
/**
* 名字
*/
@TableField("NAME")
private String name;
/**
* 生日
*/
@TableField("BIRTHDAY")
private Date birthday;
/**
* 性别(字典)
*/
@TableField("SEX")
private String sex;
/**
* 电子邮件
*/
@TableField("EMAIL")
private String email;
/**
* 电话
*/
@TableField("PHONE")
private String phone;
/**
* 角色id(多个逗号隔开)
*/
@TableField("ROLE_ID")
private String roleId;
/**
* 部门id(多个逗号隔开)
*/
@TableField("DEPT_ID")
private Long deptId;
/**
* 状态(字典)
*/
@TableField("STATUS")
private String status;
/**
* 创建时间
*/
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
private Date createTime;
/**
* 创建人
*/
@TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
private Long createUser;
/**
* 更新时间
*/
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 更新人
*/
@TableField(value = "UPDATE_USER", fill = FieldFill.UPDATE)
private Long updateUser;
/**
* 乐观锁
*/
@TableField("VERSION")
private Integer version;
}
......@@ -18,7 +18,7 @@ package cn.stylefeng.guns.modular.system.factory;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.stylefeng.guns.core.common.constant.state.ManagerStatus;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.transfer.UserDto;
import cn.stylefeng.roses.core.util.ToolUtil;
import org.springframework.beans.BeanUtils;
......@@ -44,7 +44,7 @@ public class UserFactory {
} else {
User user = new User();
BeanUtils.copyProperties(userDto, user);
user.setCreatetime(new Date());
user.setCreateTime(new Date());
user.setStatus(ManagerStatus.OK.getCode());
user.setPassword(md5Password);
user.setSalt(salt);
......@@ -69,7 +69,7 @@ public class UserFactory {
oldUser.setBirthday(newUser.getBirthday());
}
if (ToolUtil.isNotEmpty(newUser.getDeptid())) {
oldUser.setDeptid(newUser.getDeptid());
oldUser.setDeptId(newUser.getDeptid());
}
if (ToolUtil.isNotEmpty(newUser.getSex())) {
oldUser.setSex(newUser.getSex());
......
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.CodeDbinfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 数据库链接信息 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface CodeDbinfoMapper extends BaseMapper<CodeDbinfo> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.entity.Dept;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -29,7 +14,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface DeptMapper extends BaseMapper<Dept> {
......@@ -43,4 +28,4 @@ public interface DeptMapper extends BaseMapper<Dept> {
*/
List<Map<String, Object>> list(@Param("condition") String condition);
}
\ No newline at end of file
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.entity.Dict;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -28,7 +13,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface DictMapper extends BaseMapper<Dict> {
......@@ -46,4 +31,5 @@ public interface DictMapper extends BaseMapper<Dict> {
* 根据父类编码获取词典列表
*/
List<Dict> selectByParentCode(@Param("code") String code);
}
\ No newline at end of file
}
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.FileInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 文件信息表
Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface FileInfoMapper extends BaseMapper<FileInfo> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.entity.LoginLog;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;
......@@ -29,7 +14,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface LoginLogMapper extends BaseMapper<LoginLog> {
......@@ -38,5 +23,4 @@ public interface LoginLogMapper extends BaseMapper<LoginLog> {
*/
List<Map<String, Object>> getLoginLogs(@Param("page") Page<LoginLog> page, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("logName") String logName, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc);
}
\ No newline at end of file
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.entity.Menu;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -30,7 +15,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface MenuMapper extends BaseMapper<Menu> {
......@@ -48,7 +33,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return
* @date 2017年2月12日 下午9:14:34
*/
List<Long> getMenuIdsByRoleId(@Param("roleId") Integer roleId);
List<Long> getMenuIdsByRoleId(@Param("roleId") Long roleId);
/**
* 获取菜单列表树
......@@ -82,7 +67,7 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return
* @date 2017年2月19日 下午7:12:38
*/
List<String> getResUrlsByRoleId(Integer roleId);
List<String> getResUrlsByRoleId(Long roleId);
/**
* 根据角色获取菜单
......@@ -91,5 +76,6 @@ public interface MenuMapper extends BaseMapper<Menu> {
* @return
* @date 2017年2月19日 下午10:35:40
*/
List<MenuNode> getMenusByRoleIds(List<Integer> roleIds);
}
\ No newline at end of file
List<MenuNode> getMenusByRoleIds(List<Long> roleIds);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.model.Notice;
import cn.stylefeng.guns.modular.system.entity.Notice;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -28,7 +13,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface NoticeMapper extends BaseMapper<Notice> {
......@@ -37,4 +22,4 @@ public interface NoticeMapper extends BaseMapper<Notice> {
*/
List<Map<String, Object>> list(@Param("condition") String condition);
}
\ No newline at end of file
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.entity.OperationLog;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;
......@@ -29,7 +14,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface OperationLogMapper extends BaseMapper<OperationLog> {
......@@ -38,4 +23,5 @@ public interface OperationLogMapper extends BaseMapper<OperationLog> {
*/
List<Map<String, Object>> getOperationLogs(@Param("page") Page<OperationLog> page, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("logName") String logName, @Param("logType") String logType, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc);
}
\ No newline at end of file
}
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.entity.Relation;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 角色和菜单关联表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface RelationMapper extends BaseMapper<Relation> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Role;
import cn.stylefeng.guns.modular.system.entity.Role;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -29,7 +14,7 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface RoleMapper extends BaseMapper<Role> {
......@@ -48,7 +33,7 @@ public interface RoleMapper extends BaseMapper<Role> {
* @return
* @date 2017年2月13日 下午7:57:51
*/
int deleteRolesById(@Param("roleId") Integer roleId);
int deleteRolesById(@Param("roleId") Long roleId);
/**
* 获取角色列表树
......@@ -65,4 +50,5 @@ public interface RoleMapper extends BaseMapper<Role> {
* @date 2017年2月18日 上午10:32:04
*/
List<ZTreeNode> roleTreeListByRoleId(String[] roleId);
}
\ No newline at end of file
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.dao;
package cn.stylefeng.guns.modular.system.mapper;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -29,32 +14,33 @@ import java.util.Map;
* </p>
*
* @author stylefeng
* @since 2017-07-11
* @since 2018-12-07
*/
public interface UserMapper extends BaseMapper<User> {
/**
* 修改用户状态
*/
int setStatus(@Param("userId") Integer userId, @Param("status") int status);
int setStatus(@Param("userId") Long userId, @Param("status") String status);
/**
* 修改密码
*/
int changePwd(@Param("userId") Integer userId, @Param("pwd") String pwd);
int changePwd(@Param("userId") Long userId, @Param("pwd") String pwd);
/**
* 根据条件查询用户列表
*/
List<Map<String, Object>> selectUsers(@Param("dataScope") DataScope dataScope, @Param("name") String name, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("deptid") Integer deptid);
List<Map<String, Object>> selectUsers(@Param("dataScope") DataScope dataScope, @Param("name") String name, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("deptid") Long deptId);
/**
* 设置用户的角色
*/
int setRoles(@Param("userId") Integer userId, @Param("roleIds") String roleIds);
int setRoles(@Param("userId") Long userId, @Param("roleIds") String roleIds);
/**
* 通过账号获取用户
*/
User getByAccount(@Param("account") String account);
}
\ No newline at end of file
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.CodeDbinfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.CodeDbinfo">
<id column="DB_ID" property="dbId" />
<result column="NAME" property="name" />
<result column="DB_DRIVER" property="dbDriver" />
<result column="DB_URL" property="dbUrl" />
<result column="DB_USER_NAME" property="dbUserName" />
<result column="DB_PASSWORD" property="dbPassword" />
<result column="DB_TYPE" property="dbType" />
<result column="CREATE_TIME" property="createTime" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="CREATE_USER" property="createUser" />
<result column="UPDATE_USER" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DB_ID AS dbId, NAME AS name, DB_DRIVER AS dbDriver, DB_URL AS dbUrl, DB_USER_NAME AS dbUserName, DB_PASSWORD AS dbPassword, DB_TYPE AS dbType, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.DeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Dept">
<id column="DEPT_ID" property="deptId"/>
<result column="PID" property="pid"/>
<result column="PIDS" property="pids"/>
<result column="SIMPLE_NAME" property="simpleName"/>
<result column="FULL_NAME" property="fullName"/>
<result column="DESCRIPTION" property="description"/>
<result column="VERSION" property="version"/>
<result column="SORT" property="sort"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEPT_ID AS deptId, PID AS pid, PIDS AS pids, SIMPLE_NAME AS simpleName, FULL_NAME AS fullName, DESCRIPTION AS description, VERSION AS version, SORT AS sort, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select DEPT_ID AS id, PID as pId, SIMPLE_NAME as name,
(
CASE
WHEN (PID = 0 OR PID IS NULL) THEN
'true'
ELSE
'false'
END
) as isOpen from sys_dept
</select>
<select id="list" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_dept
<if test="condition != null and condition != ''">
where SIMPLE_NAME like CONCAT('%',#{condition},'%') or FULL_NAME like CONCAT('%',#{condition},'%')
</if>
order by SORT ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.DictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Dict">
<id column="DICT_ID" property="dictId"/>
<result column="PID" property="pid"/>
<result column="NAME" property="name"/>
<result column="CODE" property="code"/>
<result column="DESCRIPTION" property="description"/>
<result column="SORT" property="sort"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DICT_ID AS dictId, PID AS pid, NAME AS name, CODE AS code, DESCRIPTION AS description, SORT AS sort, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
<select id="selectByCode" resultType="cn.stylefeng.guns.modular.system.entity.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where CODE = #{code}
</select>
<select id="selectByParentCode" resultType="cn.stylefeng.guns.modular.system.entity.Dict">
select
<include refid="Base_Column_List"/>
from sys_dict
where PID in(select DICT_ID from sys_dict where CODE = #{code}) order by SORT asc
</select>
<select id="list" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_dict
where PID = 0
<if test="condition != null and condition != ''">
AND NAME like CONCAT('%',#{condition},'%')
</if>
order by DICT_ID ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.FileInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.FileInfo">
<id column="FILE_ID" property="fileId" />
<result column="FILE_DATA" property="fileData" />
<result column="CREATE_TIME" property="createTime" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="CREATE_USER" property="createUser" />
<result column="UPDATE_USER" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
FILE_ID AS fileId, FILE_DATA AS fileData, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.LoginLogMapper">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.LoginLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.LoginLog">
<id column="id" property="id" />
<result column="logname" property="logname" />
<result column="userid" property="userid" />
<result column="createtime" property="createtime" />
<result column="succeed" property="succeed" />
<result column="message" property="message" />
<result column="ip" property="ip" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.LoginLog">
<id column="LOGIN_LOG_ID" property="loginLogId"/>
<result column="LOG_NAME" property="logName"/>
<result column="USER_ID" property="userId"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="SUCCEED" property="succeed"/>
<result column="MESSAGE" property="message"/>
<result column="IP_ADDRESS" property="ipAddress"/>
</resultMap>
<select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
select * from sys_login_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and logname like CONCAT('%',#{logName},'%')
</if>
<choose>
<when test="orderByField != null and orderByField !=''">
<choose>
<when test="isAsc == true">
order by ${orderByField} ASC
</when>
<otherwise>
order by ${orderByField} DESC
</otherwise>
</choose>
</when>
<otherwise>
order by createtime DESC
</otherwise>
</choose>
</select>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
LOGIN_LOG_ID AS loginLogId, LOG_NAME AS logName, USER_ID AS userId, CREATE_TIME AS createTime, SUCCEED AS succeed, MESSAGE AS message, IP_ADDRESS AS ipAddress
</sql>
<select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
select
<include refid="Base_Column_List"/>
from sys_login_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and LOG_NAME like CONCAT('%',#{logName},'%')
</if>
<choose>
<when test="orderByField != null and orderByField !=''">
<choose>
<when test="isAsc == true">
order by ${orderByField} ASC
</when>
<otherwise>
order by ${orderByField} DESC
</otherwise>
</choose>
</when>
<otherwise>
order by CREATE_TIME DESC
</otherwise>
</choose>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.MenuMapper">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.MenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Menu">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="pcode" property="pcode" />
<result column="pcodes" property="pcodes" />
<result column="name" property="name" />
<result column="icon" property="icon" />
<result column="url" property="url" />
<result column="num" property="num" />
<result column="levels" property="levels" />
<result column="ismenu" property="ismenu" />
<result column="tips" property="tips" />
<result column="status" property="status" />
<result column="isopen" property="isopen" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Menu">
<id column="MENU_ID" property="menuId"/>
<result column="CODE" property="code"/>
<result column="PCODE" property="pcode"/>
<result column="PCODES" property="pcodes"/>
<result column="NAME" property="name"/>
<result column="ICON" property="icon"/>
<result column="URL" property="url"/>
<result column="SORT" property="sort"/>
<result column="LEVELS" property="levels"/>
<result column="MENU_FLAG" property="menuFlag"/>
<result column="DESCRIPTION" property="description"/>
<result column="STATUS" property="status"/>
<result column="NEW_PAGE_FLAG" property="newPageFlag"/>
<result column="OPEN_FLAG" property="openFlag"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, code, pcode, name, icon, url, num, levels,pcodes,
tips, status,isopen,ismenu
MENU_ID AS menuId, CODE AS code, PCODE AS pcode, PCODES AS pcodes, NAME AS name, ICON AS icon, URL AS url, SORT AS sort, LEVELS AS levels, MENU_FLAG AS menuFlag, DESCRIPTION AS description, STATUS AS status, NEW_PAGE_FLAG AS newPageFlag, OPEN_FLAG AS openFlag, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
<select id="selectMenus" resultType="map">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from sys_menu
where status = 1
where STATUS = 'ENABLE'
<if test="condition != null and condition != ''">
and (name like CONCAT('%',#{condition},'%') or code like CONCAT('%',#{condition},'%'))
and (NAME like CONCAT('%',#{condition},'%') or CODE like CONCAT('%',#{condition},'%'))
</if>
<if test="level != null and level != ''">
and levels = #{level}
and LEVELS = #{level}
</if>
</select>
<select id="getMenuIdsByRoleId" resultType="long">
select menuid from
sys_relation where roleid = #{roleId}
select MENU_ID from
sys_relation where ROLE_ID = #{roleId}
</select>
<select id="menuTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.id AS id,
m1.MENU_ID AS id,
(
CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0
ELSE
m2.id
m2.MENU_ID
END
) AS pId,
m1. NAME
m1.NAME
AS NAME,
(
CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
'true'
ELSE
'false'
......@@ -65,26 +70,26 @@
) as isOpen
FROM
sys_menu m1
LEFT join sys_menu m2 ON m1.pcode = m2. CODE
LEFT join sys_menu m2 ON m1.PCODE = m2.CODE
ORDER BY
m1.id ASC
m1.MENU_ID ASC
</select>
<select id="menuTreeListByMenuIds" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.id AS id,
m1.MENU_ID AS id,
(
CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0
ELSE
m2.id
m2.MENU_ID
END
) AS pId,
m1. NAME AS NAME,
m1.NAME AS name,
(
CASE
WHEN (m2.id = 0 OR m2.id IS
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS
NULL) THEN
'true'
ELSE
......@@ -93,85 +98,85 @@
) as isOpen,
(
CASE
WHEN (m3.ID = 0 OR m3.ID
WHEN (m3.MENU_ID = 0 OR m3.MENU_ID
IS NULL) THEN
'false'
ELSE
'true'
END
) "checked"
) as `checked`
FROM
sys_menu m1
LEFT JOIN
sys_menu m2
ON m1.pcode = m2. CODE
ON m1.PCODE = m2.CODE
left join (
SELECT
ID
MENU_ID
FROM
sys_menu
WHERE
ID IN
MENU_ID IN
<foreach collection="list" index="index" item="i" open="("
separator="," close=")">
#{i}
</foreach>
) m3 on m1.id = m3.id
) m3 on m1.MENU_ID = m3.MENU_ID
ORDER BY
m1.id ASC
m1.MENU_ID ASC
</select>
<delete id="deleteRelationByMenu">
delete from sys_relation where menuid = #{menuId}
delete from sys_relation where MENU_ID = #{menuId}
</delete>
<select id="getResUrlsByRoleId" resultType="string">
select url from
select URL from
sys_relation rel
inner join sys_menu m on rel.menuid = m.id
where rel.roleid = #{roleId}
inner join sys_menu m on rel.MENU_ID = m.MENU_ID
where rel.ROLE_ID = #{roleId}
</select>
<select id="getMenusByRoleIds" resultType="cn.stylefeng.guns.core.common.node.MenuNode">
SELECT
m1.id AS id,
m1.icon AS icon,
m1.MENU_ID AS id,
m1.ICON AS icon,
(
CASE
WHEN (m2.id = 0 OR m2.id IS NULL) THEN
WHEN (m2.MENU_ID = 0 OR m2.MENU_ID IS NULL) THEN
0
ELSE
m2.id
m2.MENU_ID
END
) AS parentId,
m1.NAME as name,
m1.url as url,
m1.levels as levels,
m1.ismenu as ismenu,
m1.num as num
m1.URL as url,
m1.LEVELS as levels,
m1.MENU_FLAG as ismenu,
m1.SORT as num
FROM
sys_menu m1
LEFT join sys_menu m2 ON m1.pcode = m2. CODE
LEFT join sys_menu m2 ON m1.PCODE = m2.CODE
INNER JOIN (
SELECT
ID
MENU_ID
FROM
sys_menu
WHERE
ID IN (
MENU_ID IN (
SELECT
menuid
MENU_ID
FROM
sys_relation rela
WHERE
rela.roleid IN
rela.ROLE_ID IN
<foreach collection="list" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
)
) m3 ON m1.id = m3.id
where m1.ismenu = 1
order by levels,num asc
) m3 ON m1.MENU_ID = m3.MENU_ID
where m1.MENU_FLAG = 'Y'
order by LEVELS,m1.SORT asc
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.NoticeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Notice">
<id column="NOTICE_ID" property="noticeId" />
<result column="TITLE" property="title" />
<result column="CONTENT" property="content" />
<result column="CREATE_TIME" property="createTime" />
<result column="CREATE_USER" property="createUser" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="UPDATE_USER" property="updateUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
NOTICE_ID AS noticeId, TITLE AS title, CONTENT AS content, CREATE_TIME AS createTime, CREATE_USER AS createUser, UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser
</sql>
<select id="list" resultType="map">
select
<include refid="Base_Column_List"></include>
from sys_notice
<if test="condition != null and condition != ''">
where TITLE like CONCAT('%',#{condition},'%') or CONTENT like CONCAT('%',#{condition},'%')
</if>
order by CREATE_TIME DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.OperationLogMapper">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.OperationLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.OperationLog">
<id column="id" property="id" />
<result column="logtype" property="logtype" />
<result column="logname" property="logname" />
<result column="userid" property="userid" />
<result column="classname" property="classname" />
<result column="method" property="method" />
<result column="createtime" property="createtime" />
<result column="succeed" property="succeed" />
<result column="message" property="message" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.OperationLog">
<id column="OPERATION_LOG_ID" property="operationLogId"/>
<result column="LOG_TYPE" property="logType"/>
<result column="LOG_NAME" property="logName"/>
<result column="USER_ID" property="userId"/>
<result column="CLASS_NAME" property="className"/>
<result column="METHOD" property="method"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="SUCCEED" property="succeed"/>
<result column="MESSAGE" property="message"/>
</resultMap>
<select id="getOperationLogs" resultType="map">
select * from sys_operation_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and logname like CONCAT('%',#{logName},'%')
</if>
<if test="logType != null and logType !=''">
and logtype like CONCAT('%',#{logType},'%')
</if>
<choose>
<when test="orderByField != null and orderByField !=''">
<choose>
<when test="isAsc == true">
order by ${orderByField} ASC
</when>
<otherwise>
order by ${orderByField} DESC
</otherwise>
</choose>
</when>
<otherwise>
order by createtime DESC
</otherwise>
</choose>
</select>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
OPERATION_LOG_ID AS operationLogId, LOG_TYPE AS logType, LOG_NAME AS logName, USER_ID AS userId, CLASS_NAME AS className, METHOD AS method, CREATE_TIME AS createTime, SUCCEED AS succeed, MESSAGE AS message
</sql>
<select id="getOperationLogs" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_operation_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and LOG_NAME like CONCAT('%',#{logName},'%')
</if>
<if test="logType != null and logType !=''">
and LOG_TYPE like CONCAT('%',#{logType},'%')
</if>
<choose>
<when test="orderByField != null and orderByField !=''">
<choose>
<when test="isAsc == true">
order by ${orderByField} ASC
</when>
<otherwise>
order by ${orderByField} DESC
</otherwise>
</choose>
</when>
<otherwise>
order by CREATE_TIME DESC
</otherwise>
</choose>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.ExpenseMapper">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.RelationMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Expense">
<id column="id" property="id" />
<result column="money" property="money" />
<result column="desc" property="desc" />
<result column="createtime" property="createtime" />
<result column="state" property="state" />
<result column="userid" property="userid" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Relation">
<id column="RELATION_ID" property="relationId" />
<result column="MENU_ID" property="menuId" />
<result column="ROLE_ID" property="roleId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, money, desc, createtime, state, userid
RELATION_ID AS relationId, MENU_ID AS menuId, ROLE_ID AS roleId
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.dao.RoleMapper">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.RoleMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.model.Role">
<id column="id" property="id" />
<result column="num" property="num" />
<result column="pid" property="pid" />
<result column="name" property="name" />
<result column="deptid" property="deptid" />
<result column="tips" property="tips" />
<result column="version" property="version" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.Role">
<id column="ROLE_ID" property="roleId"/>
<result column="PID" property="pid"/>
<result column="NAME" property="name"/>
<result column="DESCRIPTION" property="description"/>
<result column="SORT" property="sort"/>
<result column="VERSION" property="version"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
</resultMap>
<sql id="Base_Column_List">
id, num, pid, name, deptid, tips, version
</sql>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ROLE_ID AS roleId, PID AS pid, NAME AS name, DESCRIPTION AS description, SORT AS sort, VERSION AS version, CREATE_TIME AS createTime, UPDATE_TIME AS updateTime, CREATE_USER AS createUser, UPDATE_USER AS updateUser
</sql>
<select id="selectRoles" resultType="map">
select
<include refid="Base_Column_List" />
from sys_role
<if test="condition != null">
where name like CONCAT('%',#{condition},'%')
</if>
</select>
<select id="selectRoles" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_role
<if test="condition != null">
where NAME like CONCAT('%',#{condition},'%')
</if>
</select>
<delete id="deleteRolesById">
delete from sys_relation where roleid = #{roleId}
<delete id="deleteRolesById">
delete from sys_relation where ROLE_ID = #{roleId}
</delete>
<select id="roleTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select id "id",pId
"pId",name as "name",(case when (pId=0 or pId is null) then 'true'
else 'false' end) "open" from sys_role
<select id="roleTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select ROLE_ID AS id, PID as pId,
NAME as name, (case when (PID = 0 or PID is null) then 'true'
else 'false' end) as `open` from sys_role
</select>
<select id="roleTreeListByRoleId" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
r.id "id",
pId "pId",
NAME AS "name",
(
CASE
WHEN (pId = 0 OR pId IS NULL) THEN
'true'
ELSE
'false'
END
) "open",
(
CASE
WHEN (r1.ID = 0 OR r1.ID IS NULL) THEN
'false'
ELSE
'true'
END
) "checked"
FROM
sys_role r
LEFT JOIN (
SELECT
ID
FROM
sys_role
WHERE
ID IN
<select id="roleTreeListByRoleId" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
r.ROLE_ID as id,
PID as pId,
NAME AS `name`,
(
CASE
WHEN (PID = 0 OR PID IS NULL) THEN
'true'
ELSE
'false'
END
) as `open`,
(
CASE
WHEN (r1.ROLE_ID = 0 OR r1.ROLE_ID IS NULL) THEN
'false'
ELSE
'true'
END
) as checked
FROM
sys_role r
LEFT JOIN (
SELECT
ROLE_ID
FROM
sys_role
WHERE
ROLE_ID IN
<foreach collection="array" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
<foreach collection="array" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
) r1 ON r.ROLE_ID = r1.ROLE_ID
ORDER BY PID,SORT ASC
</select>
) r1 ON r.ID = r1.ID
ORDER BY
pId,
num ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.guns.modular.system.mapper.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.system.entity.User">
<id column="USER_ID" property="userId"/>
<result column="AVATAR" property="avatar"/>
<result column="ACCOUNT" property="account"/>
<result column="PASSWORD" property="password"/>
<result column="SALT" property="salt"/>
<result column="NAME" property="name"/>
<result column="BIRTHDAY" property="birthday"/>
<result column="SEX" property="sex"/>
<result column="EMAIL" property="email"/>
<result column="PHONE" property="phone"/>
<result column="ROLE_ID" property="roleId"/>
<result column="DEPT_ID" property="deptId"/>
<result column="STATUS" property="status"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="VERSION" property="version"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
USER_ID AS userId, AVATAR AS avatar, ACCOUNT AS account,
NAME AS name, BIRTHDAY AS birthday, SEX AS sex, EMAIL AS email, PHONE AS phone,
ROLE_ID AS roleId, DEPT_ID AS deptId, STATUS AS status, CREATE_TIME AS createTime, CREATE_USER AS createUser,
UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser, VERSION AS version
</sql>
<sql id="Base_Column_List_With_Pwd">
USER_ID AS userId, AVATAR AS avatar, ACCOUNT AS account, PASSWORD AS password,
SALT AS salt, NAME AS name, BIRTHDAY AS birthday, SEX AS sex, EMAIL AS email, PHONE AS phone,
ROLE_ID AS roleId, DEPT_ID AS deptId, STATUS AS status, CREATE_TIME AS createTime, CREATE_USER AS createUser,
UPDATE_TIME AS updateTime, UPDATE_USER AS updateUser, VERSION AS version
</sql>
<select id="selectUsers" resultType="map">
select
<include refid="Base_Column_List"/>
from sys_user
where STATUS != 'DELETED'
<if test="name != null and name != ''">
and (PHONE like CONCAT('%',#{name},'%')
or ACCOUNT like CONCAT('%',#{name},'%')
or NAME like CONCAT('%',#{name},'%'))
</if>
<if test="deptid != null and deptid != 0">
and (DEPT_ID = #{deptid} or DEPT_ID in ( select DEPT_ID from sys_dept where PIDS like CONCAT('%[', #{deptid}, ']%') ))
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and (CREATE_TIME between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
</select>
<update id="setStatus">
update sys_user set STATUS = #{status} where USER_ID = #{userId}
</update>
<update id="changePwd">
update sys_user set PASSWORD = #{pwd} where USER_ID = #{userId}
</update>
<update id="setRoles">
update sys_user set ROLE_ID = #{roleIds} where USER_ID =
#{userId}
</update>
<select id="getByAccount" resultType="cn.stylefeng.guns.modular.system.entity.User">
select
<include refid="Base_Column_List_With_Pwd"/>
from sys_user where ACCOUNT = #{account} and STATUS != 'DELETED'
</select>
</mapper>
package cn.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
/**
* <p>
* 字典表
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
@TableName("sys_dict")
public class Dict extends Model<Dict> {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 排序
*/
private Integer num;
/**
* 父级字典
*/
private Integer pid;
/**
* 名称
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 提示
*/
private String tips;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
@Override
protected Serializable pkVal() {
return this.id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
@Override
public String toString() {
return "Dict{" +
"id=" + id +
", num=" + num +
", pid=" + pid +
", name='" + name + '\'' +
", code='" + code + '\'' +
", tips='" + tips + '\'' +
'}';
}
}
package cn.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 报销表
* </p>
*
* @author stylefeng
* @since 2017-12-05
*/
@TableName("sys_expense")
public class Expense extends Model<Expense> {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 报销金额
*/
private BigDecimal money;
/**
* 描述
*/
private String desc;
private Date createtime;
/**
* 状态: 1.待提交 2:待审核 3.审核通过
*/
private Integer state;
/**
* 用户id
*/
private Integer userid;
/**
* 流程定义id
*/
private String processId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public BigDecimal getMoney() {
return money;
}
public void setMoney(BigDecimal money) {
this.money = money;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "Expense{" +
"id=" + id +
", money=" + money +
", desc=" + desc +
", createtime=" + createtime +
", state=" + state +
", userid=" + userid +
", processId=" + processId +
"}";
}
}
package cn.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
* 字典表
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
@TableName("sys_file_info")
@Data
public class FileInfo extends Model<FileInfo> {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id")
private String id;
@TableField("file_data")
private String fileData;
@Override
protected Serializable pkVal() {
return id;
}
}
package cn.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 管理员表
* </p>
*
* @author stylefeng
* @since 2017-07-11
*/
@TableName("sys_user")
public class User extends Model<User> {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 头像
*/
private String avatar;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* md5密码盐
*/
private String salt;
/**
* 名字
*/
private String name;
/**
* 生日
*/
private Date birthday;
/**
* 性别(1:男 2:女)
*/
private Integer sex;
/**
* 电子邮件
*/
private String email;
/**
* 电话
*/
private String phone;
/**
* 角色id
*/
private String roleid;
/**
* 部门id
*/
private Integer deptid;
/**
* 状态(1:启用 2:冻结 3:删除)
*/
private Integer status;
/**
* 创建时间
*/
private Date createtime;
/**
* 保留字段
*/
private Integer version;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getRoleid() {
return roleid;
}
public void setRoleid(String roleid) {
this.roleid = roleid;
}
public Integer getDeptid() {
return deptid;
}
public void setDeptid(Integer deptid) {
this.deptid = deptid;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", avatar=" + avatar +
", account=" + account +
", password=" + password +
", salt=" + salt +
", name=" + name +
", birthday=" + birthday +
", sex=" + sex +
", email=" + email +
", phone=" + phone +
", roleid=" + roleid +
", deptid=" + deptid +
", status=" + status +
", createtime=" + createtime +
", version=" + version +
"}";
}
}
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.entity.CodeDbinfo;
import cn.stylefeng.guns.modular.system.mapper.CodeDbinfoMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 数据库链接信息 服务实现类
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class CodeDbinfoService extends ServiceImpl<CodeDbinfoMapper, CodeDbinfo> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.DeptMapper;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.service.IDeptService;
import cn.stylefeng.guns.modular.system.entity.Dept;
import cn.stylefeng.guns.modular.system.mapper.DeptMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
......@@ -30,39 +14,48 @@ import java.util.List;
import java.util.Map;
/**
* 部门服务
* <p>
* 部门表 服务实现类
* </p>
*
* @author fengshuonan
* @Date 2018/10/15 下午11:39
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {
public class DeptService extends ServiceImpl<DeptMapper, Dept> {
@Resource
private DeptMapper deptMapper;
@Override
/**
* 删除部门
*/
@Transactional
public void deleteDept(Integer deptId) {
public void deleteDept(Long deptId) {
Dept dept = deptMapper.selectById(deptId);
Wrapper<Dept> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pids", "%[" + dept.getId() + "]%");
wrapper = wrapper.like("PIDS", "%[" + dept.getDeptId() + "]%");
List<Dept> subDepts = deptMapper.selectList(wrapper);
for (Dept temp : subDepts) {
temp.deleteById();
this.deleteById(temp.getDeptId());
}
dept.deleteById();
this.deleteById(dept.getDeptId());
}
@Override
/**
* 获取ztree的节点列表
*/
public List<ZTreeNode> tree() {
return this.baseMapper.tree();
}
@Override
/**
* 获取所有部门列表
*/
public List<Map<String, Object>> list(String condition) {
return this.baseMapper.list(condition);
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.modular.system.dao.DictMapper;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.service.IDictService;
import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.guns.modular.system.mapper.DictMapper;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
......@@ -33,22 +17,27 @@ import java.util.Map;
import static cn.stylefeng.guns.core.common.constant.factory.MutiStrFactory.*;
/**
* 字典服务
* <p>
* 字典表 服务实现类
* </p>
*
* @author fengshuonan
* @Date 2018/10/15 下午11:39
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements IDictService {
public class DictService extends ServiceImpl<DictMapper, Dict> {
@Resource
private DictMapper dictMapper;
@Override
/**
* 添加字典
*/
@Transactional
public void addDict(String dictCode, String dictName, String dictTips, String dictValues) {
public void addDict(String dictCode, String dictName, String dictDescription, String dictValues) {
//判断有没有该字典
List<Dict> dicts = dictMapper.selectList(new EntityWrapper<Dict>().eq("code", dictCode).and().eq("pid", 0));
List<Dict> dicts = dictMapper.selectList(new EntityWrapper<Dict>().eq("CODE", dictCode).and().eq("PID", 0));
if (dicts != null && dicts.size() > 0) {
throw new ServiceException(BizExceptionEnum.DICT_EXISTED);
}
......@@ -60,9 +49,9 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements ID
Dict dict = new Dict();
dict.setName(dictName);
dict.setCode(dictCode);
dict.setTips(dictTips);
dict.setNum(0);
dict.setPid(0);
dict.setDescription(dictDescription);
dict.setSort(0);
dict.setPid(0L);
this.dictMapper.insert(dict);
//添加字典条目
......@@ -71,12 +60,12 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements ID
String name = item.get(MUTI_STR_NAME);
String num = item.get(MUTI_STR_NUM);
Dict itemDict = new Dict();
itemDict.setPid(dict.getId());
itemDict.setPid(dict.getDictId());
itemDict.setCode(code);
itemDict.setName(name);
try {
itemDict.setNum(Integer.valueOf(num));
itemDict.setSort(Integer.valueOf(num));
} catch (NumberFormatException e) {
throw new ServiceException(BizExceptionEnum.DICT_MUST_BE_NUMBER);
}
......@@ -84,9 +73,12 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements ID
}
}
@Override
/**
* 编辑字典
*/
@Transactional
public void editDict(Integer dictId, String dictCode, String dictName, String dictTips, String dicts) {
public void editDict(Long dictId, String dictCode, String dictName, String dictTips, String dicts) {
//删除之前的字典
this.delteDict(dictId);
......@@ -94,30 +86,38 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements ID
this.addDict(dictCode, dictName, dictTips, dicts);
}
@Override
/**
* 删除字典
*/
@Transactional
public void delteDict(Integer dictId) {
public void delteDict(Long dictId) {
//删除这个字典的子词典
Wrapper<Dict> dictEntityWrapper = new EntityWrapper<>();
dictEntityWrapper = dictEntityWrapper.eq("pid", dictId);
dictEntityWrapper = dictEntityWrapper.eq("PID", dictId);
dictMapper.delete(dictEntityWrapper);
//删除这个词典
dictMapper.deleteById(dictId);
}
@Override
/**
* 根据编码获取词典列表
*/
public List<Dict> selectByCode(String code) {
return this.baseMapper.selectByCode(code);
}
@Override
/**
* 根据父类编码获取词典列表
*/
public List<Dict> selectByParentCode(String code) {
return this.baseMapper.selectByParentCode(code);
}
@Override
/**
* 查询字典列表
*/
public List<Map<String, Object>> list(String conditiion) {
return this.baseMapper.list(conditiion);
}
......
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.modular.system.dao.FileInfoMapper;
import cn.stylefeng.guns.modular.system.model.FileInfo;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IFileInfoService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.entity.FileInfo;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.mapper.FileInfoMapper;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import cn.stylefeng.roses.kernel.model.exception.enums.CoreExceptionEnum;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
......@@ -32,19 +15,25 @@ import org.springframework.transaction.annotation.Transactional;
/**
* <p>
* 文件信息 服务实现类
* 文件信息表
* 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> implements IFileInfoService {
public class FileInfoService extends ServiceImpl<FileInfoMapper, FileInfo> {
@Autowired
private IUserService userService;
private UserService userService;
@Override
/**
* 上传头像
*
* @author fengshuonan
* @Date 2018/11/10 4:10 PM
*/
@Transactional(rollbackFor = Exception.class)
public void uploadAvatar(String avatar) {
ShiroUser currentUser = ShiroKit.getUser();
......@@ -56,12 +45,12 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
//保存文件信息
FileInfo fileInfo = new FileInfo();
fileInfo.setId(IdWorker.getIdStr());
fileInfo.setFileId(IdWorker.getIdStr());
fileInfo.setFileData(avatar);
this.insert(fileInfo);
//更新用户的头像
user.setAvatar(fileInfo.getId());
user.setAvatar(fileInfo.getFileId());
userService.updateById(user);
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Dept;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* 部门服务
*
* @author fengshuonan
* @date 2017-04-27 17:00
*/
public interface IDeptService extends IService<Dept> {
/**
* 删除部门
*/
void deleteDept(Integer deptId);
/**
* 获取ztree的节点列表
*/
List<ZTreeNode> tree();
/**
* 获取所有部门列表
*/
List<Map<String, Object>> list(String condition);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.Dict;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* 字典服务
*
* @author fengshuonan
* @date 2017-04-27 17:00
*/
public interface IDictService extends IService<Dict> {
/**
* 添加字典
*/
void addDict(String dictCode, String dictName, String dictTips, String dictValues);
/**
* 编辑字典
*/
void editDict(Integer dictId, String dictCode, String dictName, String dictTips, String dicts);
/**
* 删除字典
*/
void delteDict(Integer dictId);
/**
* 根据编码获取词典列表
*/
List<Dict> selectByCode(String code);
/**
* 根据父类编码获取词典列表
*/
List<Dict> selectByParentCode(String code);
/**
* 查询字典列表
*/
List<Map<String, Object>> list(String conditiion);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.FileInfo;
import com.baomidou.mybatisplus.service.IService;
/**
* <p>
* 文件信息 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface IFileInfoService extends IService<FileInfo> {
/**
* 上传头像
*
* @author fengshuonan
* @Date 2018/11/10 4:10 PM
*/
void uploadAvatar(String avatar);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 登录记录 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface ILoginLogService extends IService<LoginLog> {
/**
* 获取登录日志列表
*/
List<Map<String, Object>> getLoginLogs(Page<LoginLog> page, String beginTime, String endTime, String logName, String orderByField, boolean asc);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.Notice;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 通知表 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface INoticeService extends IService<Notice> {
/**
* 获取通知列表
*/
List<Map<String, Object>> list(String condition);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 操作日志 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface IOperationLogService extends IService<OperationLog> {
/**
* 获取操作日志列表
*/
List<Map<String, Object>> getOperationLogs(Page<OperationLog> page, String beginTime, String endTime, String logName, String s, String orderByField, boolean asc);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.model.Relation;
import com.baomidou.mybatisplus.service.IService;
/**
* <p>
* 角色和菜单关联表 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface IRelationService extends IService<Relation> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 管理员表 服务类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
public interface IUserService extends IService<User> {
/**
* 修改用户状态
*/
int setStatus(Integer userId, int status);
/**
* 修改密码
*/
int changePwd(Integer userId, String pwd);
/**
* 根据条件查询用户列表
*/
List<Map<String, Object>> selectUsers(DataScope dataScope, String name, String beginTime, String endTime, Integer deptid);
/**
* 设置用户的角色
*/
int setRoles(Integer userId, String roleIds);
/**
* 通过账号获取用户
*/
User getByAccount(String account);
/**
* 获取用户菜单列表
*/
List<MenuNode> getUserMenuNodes(List<Integer> roleList);
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.dao.LoginLogMapper;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.service.ILoginLogService;
import cn.stylefeng.guns.modular.system.entity.LoginLog;
import cn.stylefeng.guns.modular.system.mapper.LoginLogMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
......@@ -30,13 +14,15 @@ import java.util.Map;
* 登录记录 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class LoginLogServiceImpl extends ServiceImpl<LoginLogMapper, LoginLog> implements ILoginLogService {
public class LoginLogService extends ServiceImpl<LoginLogMapper, LoginLog> {
@Override
/**
* 获取登录日志列表
*/
public List<Map<String, Object>> getLoginLogs(Page<LoginLog> page, String beginTime, String endTime, String logName, String orderByField, boolean asc) {
return this.baseMapper.getLoginLogs(page, beginTime, endTime, logName, orderByField, asc);
}
......
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Menu;
import com.baomidou.mybatisplus.service.IService;
import cn.stylefeng.guns.modular.system.entity.Menu;
import cn.stylefeng.guns.modular.system.mapper.MenuMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 菜单服务
* <p>
* 菜单表 服务实现类
* </p>
*
* @author fengshuonan
* @date 2017-05-05 22:19
* @author stylefeng
* @since 2018-12-07
*/
public interface IMenuService extends IService<Menu> {
@Service
public class MenuService extends ServiceImpl<MenuMapper, Menu> {
@Resource
private MenuMapper menuMapper;
/**
* 删除菜单
......@@ -37,7 +34,15 @@ public interface IMenuService extends IService<Menu> {
* @author stylefeng
* @Date 2017/5/5 22:20
*/
void delMenu(Long menuId);
@Transactional
public void delMenu(Long menuId) {
//删除菜单
this.menuMapper.deleteById(menuId);
//删除关联的relation
this.menuMapper.deleteRelationByMenu(menuId);
}
/**
* 删除菜单包含所有子菜单
......@@ -45,7 +50,22 @@ public interface IMenuService extends IService<Menu> {
* @author stylefeng
* @Date 2017/6/13 22:02
*/
void delMenuContainSubMenus(Long menuId);
@Transactional
public void delMenuContainSubMenus(Long menuId) {
Menu menu = menuMapper.selectById(menuId);
//删除当前菜单
delMenu(menuId);
//删除所有子菜单
Wrapper<Menu> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("PCODES", "%[" + menu.getCode() + "]%");
List<Menu> menus = menuMapper.selectList(wrapper);
for (Menu temp : menus) {
delMenu(temp.getMenuId());
}
}
/**
* 根据条件查询菜单
......@@ -53,7 +73,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月12日 下午9:14:34
*/
List<Map<String, Object>> selectMenus(String condition, String level);
public List<Map<String, Object>> selectMenus(String condition, String level) {
return this.baseMapper.selectMenus(condition, level);
}
/**
* 根据条件查询菜单
......@@ -61,7 +83,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月12日 下午9:14:34
*/
List<Long> getMenuIdsByRoleId(Integer roleId);
public List<Long> getMenuIdsByRoleId(Long roleId) {
return this.baseMapper.getMenuIdsByRoleId(roleId);
}
/**
* 获取菜单列表树
......@@ -69,7 +93,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月19日 下午1:33:51
*/
List<ZTreeNode> menuTreeList();
public List<ZTreeNode> menuTreeList() {
return this.baseMapper.menuTreeList();
}
/**
* 获取菜单列表树
......@@ -77,7 +103,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月19日 下午1:33:51
*/
List<ZTreeNode> menuTreeListByMenuIds(List<Long> menuIds);
public List<ZTreeNode> menuTreeListByMenuIds(List<Long> menuIds) {
return this.baseMapper.menuTreeListByMenuIds(menuIds);
}
/**
* 删除menu关联的relation
......@@ -86,7 +114,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月19日 下午4:10:59
*/
int deleteRelationByMenu(Long menuId);
public int deleteRelationByMenu(Long menuId) {
return this.baseMapper.deleteRelationByMenu(menuId);
}
/**
* 获取资源url通过角色id
......@@ -95,7 +125,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月19日 下午7:12:38
*/
List<String> getResUrlsByRoleId(Integer roleId);
public List<String> getResUrlsByRoleId(Long roleId) {
return this.baseMapper.getResUrlsByRoleId(roleId);
}
/**
* 根据角色获取菜单
......@@ -104,5 +136,9 @@ public interface IMenuService extends IService<Menu> {
* @return
* @date 2017年2月19日 下午10:35:40
*/
List<MenuNode> getMenusByRoleIds(List<Integer> roleIds);
public List<MenuNode> getMenusByRoleIds(List<Long> roleIds) {
return this.baseMapper.getMenusByRoleIds(roleIds);
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.dao.NoticeMapper;
import cn.stylefeng.guns.modular.system.model.Notice;
import cn.stylefeng.guns.modular.system.service.INoticeService;
import cn.stylefeng.guns.modular.system.entity.Notice;
import cn.stylefeng.guns.modular.system.mapper.NoticeMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
......@@ -29,13 +13,15 @@ import java.util.Map;
* 通知表 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements INoticeService {
public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {
@Override
/**
* 获取通知列表
*/
public List<Map<String, Object>> list(String condition) {
return this.baseMapper.list(condition);
}
......
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.dao.OperationLogMapper;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.service.IOperationLogService;
import cn.stylefeng.guns.modular.system.entity.OperationLog;
import cn.stylefeng.guns.modular.system.mapper.OperationLogMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
......@@ -30,14 +14,17 @@ import java.util.Map;
* 操作日志 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService {
public class OperationLogService extends ServiceImpl<OperationLogMapper, OperationLog> {
@Override
/**
* 获取操作日志列表
*/
public List<Map<String, Object>> getOperationLogs(Page<OperationLog> page, String beginTime, String endTime, String logName, String s, String orderByField, boolean asc) {
return this.baseMapper.getOperationLogs(page, beginTime, endTime, logName, s, orderByField, asc);
}
}
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.modular.system.entity.Relation;
import cn.stylefeng.guns.modular.system.mapper.RelationMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 角色和菜单关联表 服务实现类
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class RelationService extends ServiceImpl<RelationMapper, Relation> {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service;
import cn.hutool.core.convert.Convert;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Role;
import com.baomidou.mybatisplus.service.IService;
import cn.stylefeng.guns.modular.system.entity.Relation;
import cn.stylefeng.guns.modular.system.entity.Role;
import cn.stylefeng.guns.modular.system.mapper.RelationMapper;
import cn.stylefeng.guns.modular.system.mapper.RoleMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 角色相关业务
* <p>
* 角色表 服务实现类
* </p>
*
* @author fengshuonan
* @Date 2017年1月10日 下午9:11:57
* @author stylefeng
* @since 2018-12-07
*/
public interface IRoleService extends IService<Role> {
@Service
public class RoleService extends ServiceImpl<RoleMapper, Role> {
@Resource
private RoleMapper roleMapper;
@Resource
private RelationMapper relationMapper;
/**
* 设置某个角色的权限
......@@ -37,7 +38,20 @@ public interface IRoleService extends IService<Role> {
* @param ids 权限的id
* @date 2017年2月13日 下午8:26:53
*/
void setAuthority(Integer roleId, String ids);
@Transactional
public void setAuthority(Long roleId, String ids) {
// 删除该角色所有的权限
this.roleMapper.deleteRolesById(roleId);
// 添加新的权限
for (Long id : Convert.toLongArray(ids.split(","))) {
Relation relation = new Relation();
relation.setRoleId(roleId);
relation.setMenuId(id);
this.relationMapper.insert(relation);
}
}
/**
* 删除角色
......@@ -45,7 +59,14 @@ public interface IRoleService extends IService<Role> {
* @author stylefeng
* @Date 2017/5/5 22:24
*/
void delRoleById(Integer roleId);
@Transactional
public void delRoleById(Long roleId) {
//删除角色
this.roleMapper.deleteById(roleId);
// 删除该角色所有的权限
this.roleMapper.deleteRolesById(roleId);
}
/**
* 根据条件查询角色列表
......@@ -53,7 +74,9 @@ public interface IRoleService extends IService<Role> {
* @return
* @date 2017年2月12日 下午9:14:34
*/
List<Map<String, Object>> selectRoles(String condition);
public List<Map<String, Object>> selectRoles(String condition) {
return this.baseMapper.selectRoles(condition);
}
/**
* 删除某个角色的所有权限
......@@ -62,7 +85,9 @@ public interface IRoleService extends IService<Role> {
* @return
* @date 2017年2月13日 下午7:57:51
*/
int deleteRolesById(Integer roleId);
public int deleteRolesById(Long roleId) {
return this.baseMapper.deleteRolesById(roleId);
}
/**
* 获取角色列表树
......@@ -70,7 +95,9 @@ public interface IRoleService extends IService<Role> {
* @return
* @date 2017年2月18日 上午10:32:04
*/
List<ZTreeNode> roleTreeList();
public List<ZTreeNode> roleTreeList() {
return this.baseMapper.roleTreeList();
}
/**
* 获取角色列表树
......@@ -78,5 +105,8 @@ public interface IRoleService extends IService<Role> {
* @return
* @date 2017年2月18日 上午10:32:04
*/
List<ZTreeNode> roleTreeListByRoleId(String[] roleId);
public List<ZTreeNode> roleTreeListByRoleId(String[] roleId) {
return this.baseMapper.roleTreeListByRoleId(roleId);
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.util.ApiMenuFilter;
import cn.stylefeng.guns.modular.system.dao.UserMapper;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.entity.User;
import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,42 +18,54 @@ import java.util.Map;
* 管理员表 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
* @author stylefeng
* @since 2018-12-07
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
public class UserService extends ServiceImpl<UserMapper, User> {
@Autowired
private IMenuService menuService;
private MenuService menuService;
@Override
public int setStatus(Integer userId, int status) {
/**
* 修改用户状态
*/
public int setStatus(Long userId, String status) {
return this.baseMapper.setStatus(userId, status);
}
@Override
public int changePwd(Integer userId, String pwd) {
/**
* 修改密码
*/
public int changePwd(Long userId, String pwd) {
return this.baseMapper.changePwd(userId, pwd);
}
@Override
public List<Map<String, Object>> selectUsers(DataScope dataScope, String name, String beginTime, String endTime, Integer deptid) {
return this.baseMapper.selectUsers(dataScope, name, beginTime, endTime, deptid);
/**
* 根据条件查询用户列表
*/
public List<Map<String, Object>> selectUsers(DataScope dataScope, String name, String beginTime, String endTime, Long deptId) {
return this.baseMapper.selectUsers(dataScope, name, beginTime, endTime, deptId);
}
@Override
public int setRoles(Integer userId, String roleIds) {
/**
* 设置用户的角色
*/
public int setRoles(Long userId, String roleIds) {
return this.baseMapper.setRoles(userId, roleIds);
}
@Override
/**
* 通过账号获取用户
*/
public User getByAccount(String account) {
return this.baseMapper.getByAccount(account);
}
@Override
public List<MenuNode> getUserMenuNodes(List<Integer> roleList) {
/**
* 获取用户菜单列表
*/
public List<MenuNode> getUserMenuNodes(List<Long> roleList) {
if (roleList == null || roleList.size() == 0) {
return new ArrayList<>();
} else {
......@@ -80,4 +75,5 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
}
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.MenuMapper;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 菜单服务
*
* @author fengshuonan
* @date 2017-05-05 22:20
*/
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
@Resource
private MenuMapper menuMapper;
@Override
@Transactional
public void delMenu(Long menuId) {
//删除菜单
this.menuMapper.deleteById(menuId);
//删除关联的relation
this.menuMapper.deleteRelationByMenu(menuId);
}
@Override
@Transactional
public void delMenuContainSubMenus(Long menuId) {
Menu menu = menuMapper.selectById(menuId);
//删除当前菜单
delMenu(menuId);
//删除所有子菜单
Wrapper<Menu> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pcodes", "%[" + menu.getCode() + "]%");
List<Menu> menus = menuMapper.selectList(wrapper);
for (Menu temp : menus) {
delMenu(temp.getId());
}
}
@Override
public List<Map<String, Object>> selectMenus(String condition, String level) {
return this.baseMapper.selectMenus(condition, level);
}
@Override
public List<Long> getMenuIdsByRoleId(Integer roleId) {
return this.baseMapper.getMenuIdsByRoleId(roleId);
}
@Override
public List<ZTreeNode> menuTreeList() {
return this.baseMapper.menuTreeList();
}
@Override
public List<ZTreeNode> menuTreeListByMenuIds(List<Long> menuIds) {
return this.baseMapper.menuTreeListByMenuIds(menuIds);
}
@Override
public int deleteRelationByMenu(Long menuId) {
return this.baseMapper.deleteRelationByMenu(menuId);
}
@Override
public List<String> getResUrlsByRoleId(Integer roleId) {
return this.baseMapper.getResUrlsByRoleId(roleId);
}
@Override
public List<MenuNode> getMenusByRoleIds(List<Integer> roleIds) {
return this.baseMapper.getMenusByRoleIds(roleIds);
}
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
import cn.stylefeng.guns.modular.system.dao.RelationMapper;
import cn.stylefeng.guns.modular.system.model.Relation;
import cn.stylefeng.guns.modular.system.service.IRelationService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 角色和菜单关联表 服务实现类
* </p>
*
* @author stylefeng123
* @since 2018-02-22
*/
@Service
public class RelationServiceImpl extends ServiceImpl<RelationMapper, Relation> implements IRelationService {
}
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.modular.system.service.impl;
import cn.hutool.core.convert.Convert;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.RelationMapper;
import cn.stylefeng.guns.modular.system.dao.RoleMapper;
import cn.stylefeng.guns.modular.system.model.Relation;
import cn.stylefeng.guns.modular.system.model.Role;
import cn.stylefeng.guns.modular.system.service.IRoleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 角色服务
*
* @author fengshuonan
* @Date 2018/10/15 下午11:40
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
@Resource
private RoleMapper roleMapper;
@Resource
private RelationMapper relationMapper;
@Override
@Transactional
public void setAuthority(Integer roleId, String ids) {
// 删除该角色所有的权限
this.roleMapper.deleteRolesById(roleId);
// 添加新的权限
for (Long id : Convert.toLongArray(ids.split(","))) {
Relation relation = new Relation();
relation.setRoleid(roleId);
relation.setMenuid(id);
this.relationMapper.insert(relation);
}
}
@Override
@Transactional
public void delRoleById(Integer roleId) {
//删除角色
this.roleMapper.deleteById(roleId);
// 删除该角色所有的权限
this.roleMapper.deleteRolesById(roleId);
}
@Override
public List<Map<String, Object>> selectRoles(String condition) {
return this.baseMapper.selectRoles(condition);
}
@Override
public int deleteRolesById(Integer roleId) {
return this.baseMapper.deleteRolesById(roleId);
}
@Override
public List<ZTreeNode> roleTreeList() {
return this.baseMapper.roleTreeList();
}
@Override
public List<ZTreeNode> roleTreeListByRoleId(String[] roleId) {
return this.baseMapper.roleTreeListByRoleId(roleId);
}
}
......@@ -29,19 +29,19 @@ import java.util.Date;
@Data
public class UserDto {
private Integer id;
private Long id;
private String account;
private String password;
private String name;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
private Integer sex;
private String sex;
private String email;
private String phone;
private String roleid;
private Integer deptid;
private Integer status;
private Long deptid;
private String status;
private String avatar;
}
......@@ -50,7 +50,7 @@ public class DeptWarpper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
Integer pid = (Integer) map.get("pid");
Long pid = (Long) map.get("pid");
if (ToolUtil.isEmpty(pid) || pid.equals(0)) {
map.put("pName", "--");
......
......@@ -17,7 +17,7 @@ package cn.stylefeng.guns.modular.system.warpper;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.modular.system.model.Dict;
import cn.stylefeng.guns.modular.system.entity.Dict;
import cn.stylefeng.roses.core.base.warpper.BaseControllerWrapper;
import cn.stylefeng.roses.kernel.model.page.PageResult;
import com.baomidou.mybatisplus.plugins.Page;
......@@ -52,7 +52,7 @@ public class DictWarpper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
StringBuffer detail = new StringBuffer();
Integer id = Integer.valueOf(map.get("id").toString());
Long id = Long.valueOf(map.get("id").toString());
List<Dict> dicts = ConstantFactory.me().findInDict(id);
if (dicts != null) {
for (Dict dict : dicts) {
......
......@@ -53,7 +53,7 @@ public class LogWarpper extends BaseControllerWrapper {
protected void wrapTheMap(Map<String, Object> map) {
String message = (String) map.get("message");
Integer userid = (Integer) map.get("userid");
Long userid = (Long) map.get("userid");
map.put("userName", ConstantFactory.me().getUserNameById(userid));
//如果信息过长,则只截取前100位字符串
......
......@@ -50,7 +50,7 @@ public class MenuWarpper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
map.put("statusName", ConstantFactory.me().getMenuStatusName((Integer) map.get("status")));
map.put("statusName", ConstantFactory.me().getMenuStatusName((String) map.get("status")));
map.put("isMenuName", YesOrNotEnum.valueOf((Integer) map.get("ismenu")));
}
......
......@@ -49,7 +49,7 @@ public class NoticeWrapper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
Integer creater = (Integer) map.get("creater");
Long creater = (Long) map.get("creater");
map.put("createrName", ConstantFactory.me().getUserNameById(creater));
}
}
......@@ -49,8 +49,8 @@ public class RoleWarpper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
map.put("pName", ConstantFactory.me().getSingleRoleName((Integer) map.get("pid")));
map.put("deptName", ConstantFactory.me().getDeptName((Integer) map.get("deptid")));
map.put("pName", ConstantFactory.me().getSingleRoleName((Long) map.get("pid")));
map.put("deptName", ConstantFactory.me().getDeptName((Long) map.get("deptid")));
}
}
......@@ -49,10 +49,10 @@ public class UserWarpper extends BaseControllerWrapper {
@Override
protected void wrapTheMap(Map<String, Object> map) {
map.put("sexName", ConstantFactory.me().getSexName((Integer) map.get("sex")));
map.put("sexName", ConstantFactory.me().getSexName((String) map.get("sex")));
map.put("roleName", ConstantFactory.me().getRoleName((String) map.get("roleid")));
map.put("deptName", ConstantFactory.me().getDeptName((Integer) map.get("deptid")));
map.put("statusName", ConstantFactory.me().getStatusName((Integer) map.get("status")));
map.put("deptName", ConstantFactory.me().getDeptName((Long) map.get("deptid")));
map.put("statusName", ConstantFactory.me().getStatusName((String) map.get("status")));
}
}
package cn.stylefeng.guns.system;
import cn.stylefeng.guns.base.BaseJunit;
import cn.stylefeng.guns.modular.system.dao.NoticeMapper;
import cn.stylefeng.guns.modular.system.mapper.NoticeMapper;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
......
package cn.stylefeng.guns.system;
import cn.stylefeng.guns.base.BaseJunit;
import cn.stylefeng.guns.modular.system.dao.DeptMapper;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.entity.Dept;
import cn.stylefeng.guns.modular.system.mapper.DeptMapper;
import org.junit.Test;
import javax.annotation.Resource;
......@@ -26,11 +26,11 @@ public class DeptTest extends BaseJunit {
@Test
public void addDeptTest() {
Dept dept = new Dept();
dept.setFullname("测试fullname");
dept.setNum(5);
dept.setPid(1);
dept.setSimplename("测试");
dept.setTips("测试tips");
dept.setFullName("测试fullname");
dept.setSort(5);
dept.setPid(1L);
dept.setSimpleName("测试");
dept.setDescription("测试tips");
dept.setVersion(1);
Integer insert = deptMapper.insert(dept);
assertEquals(insert, new Integer(1));
......@@ -39,9 +39,8 @@ public class DeptTest extends BaseJunit {
@Test
public void updateTest() {
Dept dept = this.deptMapper.selectById(24);
dept.setTips("哈哈");
boolean flag = dept.updateById();
assertTrue(flag);
dept.setDescription("哈哈");
deptMapper.updateById(dept);
}
@Test
......
package cn.stylefeng.guns.system;
import cn.stylefeng.guns.base.BaseJunit;
import cn.stylefeng.guns.modular.system.dao.DictMapper;
import cn.stylefeng.guns.modular.system.service.IDictService;
import cn.stylefeng.guns.modular.system.mapper.DictMapper;
import cn.stylefeng.guns.modular.system.service.DictService;
import org.junit.Assert;
import org.junit.Test;
......@@ -19,7 +19,7 @@ import java.util.Map;
public class DictTest extends BaseJunit {
@Resource
IDictService dictService;
DictService dictService;
@Resource
DictMapper dictMapper;
......@@ -35,12 +35,12 @@ public class DictTest extends BaseJunit {
@Test
public void editTest() {
dictService.editDict(16, "tes", "测试", "备注", "1:测试1:1;2:测试2:2");
dictService.editDict(16L, "tes", "测试", "备注", "1:测试1:1;2:测试2:2");
}
@Test
public void deleteTest() {
this.dictService.delteDict(16);
this.dictService.delteDict(16L);
}
@Test
......
package cn.stylefeng.guns.system;
import cn.stylefeng.guns.base.BaseJunit;
import cn.stylefeng.guns.modular.system.dao.MenuMapper;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.entity.Menu;
import cn.stylefeng.guns.modular.system.mapper.MenuMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.junit.Test;
......@@ -54,13 +54,13 @@ public class MenuTest extends BaseJunit {
menu.setPcodes(sb.toString());
}
menu.updateById();
menuMapper.updateById(menu);
}
}
private Menu getParentMenu(String code) {
Wrapper<Menu> wrapper = new EntityWrapper<Menu>();
wrapper = wrapper.eq("code", code);
wrapper = wrapper.eq("CODE", code);
List<Menu> menus = menuMapper.selectList(wrapper);
if (menus == null || menus.size() == 0) {
return new Menu();
......
package cn.stylefeng.guns.system;
import cn.stylefeng.guns.base.BaseJunit;
import cn.stylefeng.guns.modular.system.dao.UserMapper;
import cn.stylefeng.guns.modular.system.mapper.UserMapper;
import org.junit.Test;
import javax.annotation.Resource;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment