zq940222 2 months ago
commit
b436c560e8
100 changed files with 13617 additions and 0 deletions
  1. 10 0
      .gitignore
  2. 24 0
      72crm.bat
  3. 46 0
      72crm.sh
  4. 361 0
      DB/nacos.sql
  5. 56 0
      DB/seata.sql
  6. 17 0
      DB/update/v11.1.0.sql
  7. 206 0
      DB/update/v11.2.0/V11.2.0.sql
  8. BIN
      DB/update/v11.2.0/update-V11.2.0.jar
  9. 2 0
      DB/update/v11.2.0/需先执行sql脚本,再执行jar.txt
  10. 124 0
      DB/update/v11.3.1.sql
  11. 233 0
      DB/update/v11.3.2.sql
  12. 6482 0
      DB/wk_crm_single.sql
  13. 719 0
      DB/wk_hrm_single.sql
  14. 176 0
      DB/xxl_job.sql
  15. 78 0
      LICENSE.txt
  16. 36 0
      README.en.md
  17. 280 0
      README.md
  18. 139 0
      admin/pom.xml
  19. 29 0
      admin/src/main/java/com/kakarote/admin/AdminApplication.java
  20. 73 0
      admin/src/main/java/com/kakarote/admin/common/AdminCodeEnum.java
  21. 24 0
      admin/src/main/java/com/kakarote/admin/common/AdminConst.java
  22. 86 0
      admin/src/main/java/com/kakarote/admin/common/AdminModuleEnum.java
  23. 47 0
      admin/src/main/java/com/kakarote/admin/common/AdminRoleTypeEnum.java
  24. 23 0
      admin/src/main/java/com/kakarote/admin/common/AdminThreadPoolConfig.java
  25. 33 0
      admin/src/main/java/com/kakarote/admin/common/AuthPasswordUtil.java
  26. 25 0
      admin/src/main/java/com/kakarote/admin/common/log/AdminConfigLog.java
  27. 15 0
      admin/src/main/java/com/kakarote/admin/common/log/AdminDeptLog.java
  28. 26 0
      admin/src/main/java/com/kakarote/admin/common/log/AdminRoleLog.java
  29. 46 0
      admin/src/main/java/com/kakarote/admin/common/log/AdminUserLog.java
  30. 334 0
      admin/src/main/java/com/kakarote/admin/controller/AdminConfigController.java
  31. 93 0
      admin/src/main/java/com/kakarote/admin/controller/AdminDeptController.java
  32. 177 0
      admin/src/main/java/com/kakarote/admin/controller/AdminFileController.java
  33. 98 0
      admin/src/main/java/com/kakarote/admin/controller/AdminLanguagePackController.java
  34. 55 0
      admin/src/main/java/com/kakarote/admin/controller/AdminMenuController.java
  35. 195 0
      admin/src/main/java/com/kakarote/admin/controller/AdminMessageController.java
  36. 256 0
      admin/src/main/java/com/kakarote/admin/controller/AdminRoleController.java
  37. 447 0
      admin/src/main/java/com/kakarote/admin/controller/AdminUserController.java
  38. 38 0
      admin/src/main/java/com/kakarote/admin/controller/AdminUserHisTableController.java
  39. 147 0
      admin/src/main/java/com/kakarote/admin/controller/SysLogController.java
  40. 29 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminCompanyBO.java
  41. 15 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeleteByBatchIdBO.java
  42. 33 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeptBO.java
  43. 22 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeptQueryBO.java
  44. 24 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminInitDataBO.java
  45. 24 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminLanguagePackBO.java
  46. 23 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminMessageQueryBO.java
  47. 24 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminRoleBO.java
  48. 51 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminUserBO.java
  49. 28 0
      admin/src/main/java/com/kakarote/admin/entity/BO/AdminUserStatusBO.java
  50. 15 0
      admin/src/main/java/com/kakarote/admin/entity/BO/DeptUserListByHrmBO.java
  51. 17 0
      admin/src/main/java/com/kakarote/admin/entity/BO/DeptUserListVO.java
  52. 32 0
      admin/src/main/java/com/kakarote/admin/entity/BO/DeptVO.java
  53. 29 0
      admin/src/main/java/com/kakarote/admin/entity/BO/HrmAddUserBO.java
  54. 29 0
      admin/src/main/java/com/kakarote/admin/entity/BO/LogWelcomeSpeechBO.java
  55. 34 0
      admin/src/main/java/com/kakarote/admin/entity/BO/ModuleSettingBO.java
  56. 31 0
      admin/src/main/java/com/kakarote/admin/entity/BO/QuerySysLogBO.java
  57. 16 0
      admin/src/main/java/com/kakarote/admin/entity/BO/RenameFileBO.java
  58. 27 0
      admin/src/main/java/com/kakarote/admin/entity/BO/SystemUserBO.java
  59. 30 0
      admin/src/main/java/com/kakarote/admin/entity/BO/UserBookBO.java
  60. 39 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminAttention.java
  61. 48 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminConfig.java
  62. 55 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminDept.java
  63. 67 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminFile.java
  64. 51 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminLanguagePack.java
  65. 78 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminMenu.java
  66. 76 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminMessage.java
  67. 51 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminModelSort.java
  68. 59 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminOfficialImg.java
  69. 68 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminRole.java
  70. 45 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminRoleAuth.java
  71. 42 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminRoleMenu.java
  72. 55 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminSystemLog.java
  73. 95 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminUser.java
  74. 54 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserConfig.java
  75. 44 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserHisTable.java
  76. 42 0
      admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserRole.java
  77. 65 0
      admin/src/main/java/com/kakarote/admin/entity/PO/LoginLog.java
  78. 76 0
      admin/src/main/java/com/kakarote/admin/entity/PO/SysLog.java
  79. 70 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminDeptVO.java
  80. 42 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminLanguagePackVO.java
  81. 42 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminMenuVO.java
  82. 42 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminMessageVO.java
  83. 28 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminRoleVO.java
  84. 15 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminSuperUserVo.java
  85. 84 0
      admin/src/main/java/com/kakarote/admin/entity/VO/AdminUserVO.java
  86. 31 0
      admin/src/main/java/com/kakarote/admin/entity/VO/CloudConfigVO.java
  87. 25 0
      admin/src/main/java/com/kakarote/admin/entity/VO/CpSignatureVO.java
  88. 36 0
      admin/src/main/java/com/kakarote/admin/entity/VO/HrmSimpleUserVO.java
  89. 31 0
      admin/src/main/java/com/kakarote/admin/entity/VO/ModuleSettingVO.java
  90. 70 0
      admin/src/main/java/com/kakarote/admin/entity/VO/UserBookVO.java
  91. 16 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminAttentionMapper.java
  92. 17 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminConfigMapper.java
  93. 22 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminDeptMapper.java
  94. 16 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminFileMapper.java
  95. 24 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminLanguagePackMapper.java
  96. 16 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminLoginLogMapper.java
  97. 37 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminMenuMapper.java
  98. 22 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminMessageMapper.java
  99. 16 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminModelSortMapper.java
  100. 16 0
      admin/src/main/java/com/kakarote/admin/mapper/AdminOfficialImgMapper.java

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+.DS_Store
+.idea/
+*.iml
+logs/**
+test
+target
+*/target/**
+rebel.xml
+rebel-remote.xml
+

+ 24 - 0
72crm.bat

@@ -0,0 +1,24 @@
+@echo off
+title ${project.artifactId}
+rem -------------------------------------------------------------------------
+rem
+rem 使用说明:
+rem
+rem 1: 打包时默认使用application-test.yml配置文件,如需要更改,直接更改下面的命令即可,如 -Dspring.profiles.include=core,prod
+rem
+rem -------------------------------------------------------------------------
+
+setlocal & pushd
+
+set JAVA_OPTS=-Dspring.profiles.include=core,test
+if "${project.artifactId}" == "gateway" (
+    set JAVA_OPTS =
+)
+rem -Xms分配堆最小内存,默认为物理内存的1/64;-Xmx分配最大内存,默认为物理内存的1/4 如果程序会崩溃请将此值调高
+java -Xms128m -Xmx512m -jar %JAVA_OPTS% ${project.artifactId}-${project.version}.jar
+
+endlocal & popd
+pause
+
+
+

+ 46 - 0
72crm.sh

@@ -0,0 +1,46 @@
+#!/bin/bash
+
+COMMAND="$1"
+
+if [[ "$COMMAND" != "start" ]] && [[ "$COMMAND" != "stop" ]] && [[ "$COMMAND" != "restart" ]]; then
+	echo "Usage: $0 start | stop | restart"
+	exit 0
+fi
+
+APP_BASE_PATH=$(cd `dirname $0`; pwd)
+
+function start()
+{
+    JAVA_OPTS=-Dspring.profiles.include=core,test
+    if [[ "${project.artifactId}" == "wk_gateway" ]]; then
+    	JAVA_OPTS=
+    fi
+    # -Xms分配堆最小内存,默认为物理内存的1/64;-Xmx分配最大内存,默认为物理内存的1/4 如果程序会崩溃请将此值调高
+    nohup java -Xms128m -Xmx512m -jar ${JAVA_OPTS} ${project.artifactId}-${project.version}.jar >> /dev/null 2>&1 &
+    echo "--------项目启动成功--------"
+    echo "--------欢迎使用悟空CRM ^_^--------"
+}
+
+function stop()
+{
+    P_ID=`ps -ef | grep -w ${project.artifactId}-${project.version}.jar | grep -v "grep" | awk '{print $2}'`
+    kill $P_ID
+    echo "项目已关闭"
+}
+
+function restart()
+{
+    P_ID=`ps -ef | grep -w ${project.artifactId}-${project.version}.jar | grep -v "grep" | awk '{print $2}'`
+    start
+    sleep 25s
+    kill $P_ID
+    echo "项目重启成功"
+}
+
+if [[ "$COMMAND" == "start" ]]; then
+	start
+elif [[ "$COMMAND" == "stop" ]]; then
+    stop
+else
+    restart
+fi

+ 361 - 0
DB/nacos.sql

@@ -0,0 +1,361 @@
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for config_info
+-- ----------------------------
+DROP TABLE IF EXISTS `config_info`;
+CREATE TABLE `config_info`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
+  `group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
+  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
+  `src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
+  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
+  `c_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `c_use` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `effect` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `c_schema` text CHARACTER SET utf8 COLLATE utf8_bin NULL,
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_configinfo_datagrouptenant`(`data_id`, `group_id`, `tenant_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_info
+-- ----------------------------
+INSERT INTO `config_info` VALUES (1, 'service.vgroupMapping.crm_tx_group', 'SEATA_GROUP', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:10:53', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (2, 'service.vgroupMapping.admin_tx_group', 'SEATA_GROUP', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (3, 'store.mode', 'SEATA_GROUP', 'db', 'd77d5e503ad1439f585ac494268b351b', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (4, 'store.db.datasource', 'SEATA_GROUP', 'druid', '3d650fb8a5df01600281d48c47c9fa60', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (5, 'store.db.dbType', 'SEATA_GROUP', 'mysql', '81c3b080dad537de7e10e0987a4bf52e', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (6, 'store.db.driverClassName', 'SEATA_GROUP', 'com.mysql.jdbc.Driver', '683cf0c3a5a56cec94dfac94ca16d760', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (7, 'store.db.url', 'SEATA_GROUP', 'jdbc:mysql://mysql:3306/seata?useUnicode=true', '3c0c8ba10c3daee50a2db1dd0f397282', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (8, 'store.db.user', 'SEATA_GROUP', 'root', '63a9f0ea7bb98050796b649e85481845', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (9, 'store.db.password', 'SEATA_GROUP', 'password', '5f4dcc3b5aa765d61d8327deb882cf99', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (10, 'store.db.minConn', 'SEATA_GROUP', '5', 'e4da3b7fbbce2345d7772b0674a318d5', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (11, 'store.db.maxConn', 'SEATA_GROUP', '30', '34173cb38f07f89ddbebc2ac9128303f', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (12, 'store.db.globalTable', 'SEATA_GROUP', 'global_table', '8b28fb6bb4c4f984df2709381f8eba2b', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (13, 'store.db.branchTable', 'SEATA_GROUP', 'branch_table', '54bcdac38cf62e103fe115bcf46a660c', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (14, 'store.db.queryLimit', 'SEATA_GROUP', '100', 'f899139df5e1059396431415e770c6dd', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (15, 'store.db.lockTable', 'SEATA_GROUP', 'lock_table', '55e0cae3b6dc6696b768db90098b8f2f', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (16, 'store.db.maxWait', 'SEATA_GROUP', '5000', 'a35fe7f7fe8217b4369a0af4244d1fca', '2020-10-12 09:06:44', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (17, 'service.vgroupMapping.oa_tx_group', 'SEATA_GROUP', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (18, 'service.vgroupMapping.examine_tx_group', 'SEATA_GROUP', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `config_info` VALUES (19, 'service.vgroupMapping.hrm_tx_group', 'SEATA_GROUP', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:10:54', NULL, '127.0.0.1', '', '', NULL, NULL, NULL, NULL, NULL);
+
+-- ----------------------------
+-- Table structure for config_info_aggr
+-- ----------------------------
+DROP TABLE IF EXISTS `config_info_aggr`;
+CREATE TABLE `config_info_aggr`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
+  `group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
+  `datum_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'datum_id',
+  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '内容',
+  `gmt_modified` datetime(0) NOT NULL COMMENT '修改时间',
+  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_configinfoaggr_datagrouptenantdatum`(`data_id`, `group_id`, `tenant_id`, `datum_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '增加租户字段' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_info_aggr
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for config_info_beta
+-- ----------------------------
+DROP TABLE IF EXISTS `config_info_beta`;
+CREATE TABLE `config_info_beta`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
+  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
+  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
+  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
+  `beta_ips` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'betaIps',
+  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
+  `src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_configinfobeta_datagrouptenant`(`data_id`, `group_id`, `tenant_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info_beta' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_info_beta
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for config_info_route
+-- ----------------------------
+DROP TABLE IF EXISTS `config_info_route`;
+CREATE TABLE `config_info_route`  (
+  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `route_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '路由id',
+  `uri` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'uri路径',
+  `predicates` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '判定器',
+  `filters` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '过滤器',
+  `orders` int(11) NULL DEFAULT NULL COMMENT '排序',
+  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
+  `intercept` int(1) NOT NULL DEFAULT 1 COMMENT '是否拦截 1 是 0 否',
+  `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:Y-有效,N-无效',
+  `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '更新时间',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `ux_gateway_routes_uri`(`uri`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 120 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网关路由表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_info_route
+-- ----------------------------
+INSERT INTO `config_info_route` VALUES (101, 'authorization', 'lb://authorization', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/authorization*/**\"}}]', '[]', 100, '用户认证相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (102, 'admin', 'lb://admin', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/admin*/**\"}}]', '[]', 100, '系统管理相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (103, 'login', 'lb://authorization/login', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/login\"}}]', '[]', 100, '用户登录相关接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (104, 'logout', 'lb://authorization/logout', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/logout\"}}]', '[]', 100, '用户退出相关接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (105, 'reLogin', 'lb://authorization/reLogin', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/reLogin\"}}]', '[]', 100, '用户重新登录相关接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (106, 'crm', 'lb://crm', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/crm*/**\"}}]', '[]', 100, '客户管理相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (107, 'hrm', 'lb://hrm', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/hrm*/**\"}}]', '[]', 100, '人力资源相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (108, 'jxc', 'lb://jxc', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/jxc*/**\"}}]', '[]', 100, '进销存相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (109, 'work', 'lb://work', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/work*/**\"}}]', '[]', 100, '项目管理相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (113, 'oa', 'lb://oa', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/oa*/**\"}}]', '[]', 100, 'OA相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (114, 'email', 'lb://email', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/email*/**\"}}]', '[]', 100, '邮箱相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (115, 'km', 'lb://km', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/km*/**\"}}]', '[]', 100, '知识库相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (116, 'bi', 'lb://bi', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/bi*/**\"}}]', '[]', 100, '商业智能相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (117, 'file', 'http://127.0.0.1:8012/onlinePreview', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/onlinePreview\"}}]', '[]', 100, '文件预览相关接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (118, 'queryShareUrl', 'lb://km', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/documentShare/queryShareUrl/*\"}}]', '[]', 100, '知识库分享接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (119, 'crmCallUpload', 'lb://crmCall/upload', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"crmCall/upload/*\"}}]', '[]', 100, '呼叫中心上传接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (123, 'permission', 'lb://authorization/permission', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/permission\"}}]', '[]', 100, '用户权限验证接口', 0, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+INSERT INTO `config_info_route` VALUES (124, 'examine', 'lb://examine', '[{\"name\":\"Path\",\"args\":{\"pattern\":\"/examine*/**\"}}]', '[]', 100, '审批相关接口', 1, 1, '2020-04-21 17:00:32', '2020-04-21 17:00:32');
+
+
+-- ----------------------------
+-- Table structure for config_info_tag
+-- ----------------------------
+DROP TABLE IF EXISTS `config_info_tag`;
+CREATE TABLE `config_info_tag`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
+  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
+  `tag_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_id',
+  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
+  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
+  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'md5',
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'source user',
+  `src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'source ip',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_configinfotag_datagrouptenanttag`(`data_id`, `group_id`, `tenant_id`, `tag_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_info_tag' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_info_tag
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for config_tags_relation
+-- ----------------------------
+DROP TABLE IF EXISTS `config_tags_relation`;
+CREATE TABLE `config_tags_relation`  (
+  `id` bigint(20) NOT NULL COMMENT 'id',
+  `tag_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_name',
+  `tag_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'tag_type',
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
+  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
+  `nid` bigint(20) NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`nid`) USING BTREE,
+  UNIQUE INDEX `uk_configtagrelation_configidtag`(`id`, `tag_name`, `tag_type`) USING BTREE,
+  INDEX `idx_tenant_id`(`tenant_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'config_tag_relation' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of config_tags_relation
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for group_capacity
+-- ----------------------------
+DROP TABLE IF EXISTS `group_capacity`;
+CREATE TABLE `group_capacity`  (
+  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
+  `quota` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '配额,0表示使用默认值',
+  `usage` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用量',
+  `max_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
+  `max_aggr_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '聚合子配置最大个数,,0表示使用默认值',
+  `max_aggr_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
+  `max_history_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大变更历史数量',
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_group_id`(`group_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '集群、各Group容量信息表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of group_capacity
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for his_config_info
+-- ----------------------------
+DROP TABLE IF EXISTS `his_config_info`;
+CREATE TABLE `his_config_info`  (
+  `id` bigint(64) UNSIGNED NOT NULL,
+  `nid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'app_name',
+  `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
+  `src_user` text CHARACTER SET utf8 COLLATE utf8_bin NULL,
+  `src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `op_type` char(10) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '租户字段',
+  PRIMARY KEY (`nid`) USING BTREE,
+  INDEX `idx_gmt_create`(`gmt_create`) USING BTREE,
+  INDEX `idx_gmt_modified`(`gmt_modified`) USING BTREE,
+  INDEX `idx_did`(`data_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '多租户改造' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of his_config_info
+-- ----------------------------
+INSERT INTO `his_config_info` VALUES (0, 1, 'service.vgroupMapping.crm_tx_group', 'SEATA_GROUP', '', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 2, 'service.vgroupMapping.admin_tx_group', 'SEATA_GROUP', '', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 3, 'store.mode', 'SEATA_GROUP', '', 'db', 'd77d5e503ad1439f585ac494268b351b', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 4, 'store.db.datasource', 'SEATA_GROUP', '', 'druid', '3d650fb8a5df01600281d48c47c9fa60', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 5, 'store.db.dbType', 'SEATA_GROUP', '', 'mysql', '81c3b080dad537de7e10e0987a4bf52e', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 6, 'store.db.driverClassName', 'SEATA_GROUP', '', 'com.mysql.jdbc.Driver', '683cf0c3a5a56cec94dfac94ca16d760', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 7, 'store.db.url', 'SEATA_GROUP', '', 'jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true', 'cbb3bd573704f125fb4f2489208abaec', '2020-10-12 09:06:43', '2020-10-12 09:06:43', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 8, 'store.db.user', 'SEATA_GROUP', '', 'root', '63a9f0ea7bb98050796b649e85481845', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 9, 'store.db.password', 'SEATA_GROUP', '', 'password', '5f4dcc3b5aa765d61d8327deb882cf99', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 10, 'store.db.minConn', 'SEATA_GROUP', '', '5', 'e4da3b7fbbce2345d7772b0674a318d5', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 11, 'store.db.maxConn', 'SEATA_GROUP', '', '30', '34173cb38f07f89ddbebc2ac9128303f', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 12, 'store.db.globalTable', 'SEATA_GROUP', '', 'global_table', '8b28fb6bb4c4f984df2709381f8eba2b', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 13, 'store.db.branchTable', 'SEATA_GROUP', '', 'branch_table', '54bcdac38cf62e103fe115bcf46a660c', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 14, 'store.db.queryLimit', 'SEATA_GROUP', '', '100', 'f899139df5e1059396431415e770c6dd', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 15, 'store.db.lockTable', 'SEATA_GROUP', '', 'lock_table', '55e0cae3b6dc6696b768db90098b8f2f', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (0, 16, 'store.db.maxWait', 'SEATA_GROUP', '', '5000', 'a35fe7f7fe8217b4369a0af4244d1fca', '2020-10-12 09:06:43', '2020-10-12 09:06:44', NULL, '127.0.0.1', 'I', '');
+INSERT INTO `his_config_info` VALUES (1, 17, 'service.vgroupMapping.crm_tx_group', 'SEATA_GROUP', '', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:10:53', '2020-10-12 09:10:53', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (2, 18, 'service.vgroupMapping.admin_tx_group', 'SEATA_GROUP', '', 'default', 'c21f969b5f03d33d43e04f8f136e7682', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (3, 19, 'store.mode', 'SEATA_GROUP', '', 'db', 'd77d5e503ad1439f585ac494268b351b', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (4, 20, 'store.db.datasource', 'SEATA_GROUP', '', 'druid', '3d650fb8a5df01600281d48c47c9fa60', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (5, 21, 'store.db.dbType', 'SEATA_GROUP', '', 'mysql', '81c3b080dad537de7e10e0987a4bf52e', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (6, 22, 'store.db.driverClassName', 'SEATA_GROUP', '', 'com.mysql.jdbc.Driver', '683cf0c3a5a56cec94dfac94ca16d760', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (7, 23, 'store.db.url', 'SEATA_GROUP', '', 'jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true', 'cbb3bd573704f125fb4f2489208abaec', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (8, 24, 'store.db.user', 'SEATA_GROUP', '', 'root', '63a9f0ea7bb98050796b649e85481845', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (9, 25, 'store.db.password', 'SEATA_GROUP', '', 'password', '5f4dcc3b5aa765d61d8327deb882cf99', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (10, 26, 'store.db.minConn', 'SEATA_GROUP', '', '5', 'e4da3b7fbbce2345d7772b0674a318d5', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (11, 27, 'store.db.maxConn', 'SEATA_GROUP', '', '30', '34173cb38f07f89ddbebc2ac9128303f', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (12, 28, 'store.db.globalTable', 'SEATA_GROUP', '', 'global_table', '8b28fb6bb4c4f984df2709381f8eba2b', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (13, 29, 'store.db.branchTable', 'SEATA_GROUP', '', 'branch_table', '54bcdac38cf62e103fe115bcf46a660c', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (14, 30, 'store.db.queryLimit', 'SEATA_GROUP', '', '100', 'f899139df5e1059396431415e770c6dd', '2020-10-12 09:10:53', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (15, 31, 'store.db.lockTable', 'SEATA_GROUP', '', 'lock_table', '55e0cae3b6dc6696b768db90098b8f2f', '2020-10-12 09:10:54', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+INSERT INTO `his_config_info` VALUES (16, 32, 'store.db.maxWait', 'SEATA_GROUP', '', '5000', 'a35fe7f7fe8217b4369a0af4244d1fca', '2020-10-12 09:10:54', '2020-10-12 09:10:54', NULL, '127.0.0.1', 'U', '');
+
+-- ----------------------------
+-- Table structure for permissions
+-- ----------------------------
+DROP TABLE IF EXISTS `permissions`;
+CREATE TABLE `permissions`  (
+  `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `resource` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `action` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  UNIQUE INDEX `uk_role_permission`(`role`, `resource`, `action`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of permissions
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for roles
+-- ----------------------------
+DROP TABLE IF EXISTS `roles`;
+CREATE TABLE `roles`  (
+  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  UNIQUE INDEX `idx_user_role`(`username`, `role`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of roles
+-- ----------------------------
+INSERT INTO `roles` VALUES ('nacos', 'ROLE_ADMIN');
+
+-- ----------------------------
+-- Table structure for tenant_capacity
+-- ----------------------------
+DROP TABLE IF EXISTS `tenant_capacity`;
+CREATE TABLE `tenant_capacity`  (
+  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
+  `quota` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '配额,0表示使用默认值',
+  `usage` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用量',
+  `max_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
+  `max_aggr_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '聚合子配置最大个数',
+  `max_aggr_size` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
+  `max_history_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最大变更历史数量',
+  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
+  `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_tenant_id`(`tenant_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '租户容量信息表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of tenant_capacity
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for tenant_info
+-- ----------------------------
+DROP TABLE IF EXISTS `tenant_info`;
+CREATE TABLE `tenant_info`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `kp` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'kp',
+  `tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_id',
+  `tenant_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT 'tenant_name',
+  `tenant_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'tenant_desc',
+  `create_source` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'create_source',
+  `gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
+  `gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `uk_tenant_info_kptenantid`(`kp`, `tenant_id`) USING BTREE,
+  INDEX `idx_tenant_id`(`tenant_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = 'tenant_info' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of tenant_info
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for users
+-- ----------------------------
+DROP TABLE IF EXISTS `users`;
+CREATE TABLE `users`  (
+  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `password` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `enabled` tinyint(1) NOT NULL,
+  PRIMARY KEY (`username`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of users
+-- ----------------------------
+INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1);
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 56 - 0
DB/seata.sql

@@ -0,0 +1,56 @@
+-- -------------------------------- The script used when storeMode is 'db' --------------------------------
+-- the table to store GlobalSession data
+CREATE TABLE IF NOT EXISTS `global_table`
+(
+    `xid`                       VARCHAR(128) NOT NULL,
+    `transaction_id`            BIGINT,
+    `status`                    TINYINT      NOT NULL,
+    `application_id`            VARCHAR(32),
+    `transaction_service_group` VARCHAR(32),
+    `transaction_name`          VARCHAR(128),
+    `timeout`                   INT,
+    `begin_time`                BIGINT,
+    `application_data`          VARCHAR(2000),
+    `gmt_create`                DATETIME,
+    `gmt_modified`              DATETIME,
+    PRIMARY KEY (`xid`),
+    KEY `idx_gmt_modified_status` (`gmt_modified`, `status`),
+    KEY `idx_transaction_id` (`transaction_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- the table to store BranchSession data
+CREATE TABLE IF NOT EXISTS `branch_table`
+(
+    `branch_id`         BIGINT       NOT NULL,
+    `xid`               VARCHAR(128) NOT NULL,
+    `transaction_id`    BIGINT,
+    `resource_group_id` VARCHAR(32),
+    `resource_id`       VARCHAR(256),
+    `branch_type`       VARCHAR(8),
+    `status`            TINYINT,
+    `client_id`         VARCHAR(64),
+    `application_data`  VARCHAR(2000),
+    `gmt_create`        DATETIME(6),
+    `gmt_modified`      DATETIME(6),
+    PRIMARY KEY (`branch_id`),
+    KEY `idx_xid` (`xid`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- the table to store lock data
+CREATE TABLE IF NOT EXISTS `lock_table`
+(
+    `row_key`        VARCHAR(128) NOT NULL,
+    `xid`            VARCHAR(96),
+    `transaction_id` BIGINT,
+    `branch_id`      BIGINT       NOT NULL,
+    `resource_id`    VARCHAR(256),
+    `table_name`     VARCHAR(32),
+    `pk`             VARCHAR(36),
+    `gmt_create`     DATETIME,
+    `gmt_modified`   DATETIME,
+    PRIMARY KEY (`row_key`),
+    KEY `idx_branch_id` (`branch_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;

+ 17 - 0
DB/update/v11.1.0.sql

@@ -0,0 +1,17 @@
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+DROP TABLE IF EXISTS `wk_oa_examine_sort`;
+CREATE TABLE `wk_oa_examine_sort`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `category_id` int(11) NULL DEFAULT NULL COMMENT '审批类型id',
+  `sort` int(6) NULL DEFAULT NULL COMMENT '排序',
+  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '审批类型排序' ROW_FORMAT = Dynamic;
+
+
+ALTER TABLE `wk_work` ADD COLUMN `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `owner_user_id`;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 206 - 0
DB/update/v11.2.0/V11.2.0.sql

@@ -0,0 +1,206 @@
+SET FOREIGN_KEY_CHECKS=0;
+
+ALTER TABLE `wk_crm_business` MODIFY COLUMN `customer_id` int(11) NULL DEFAULT NULL COMMENT '客户ID' AFTER `next_time`;
+
+CREATE TABLE `wk_crm_marketing_field`  (
+  `field_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `field_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自定义字段英文标识',
+  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段名称',
+  `type` int(2) NOT NULL DEFAULT 1 COMMENT '字段类型 1 单行文本 2 多行文本 3 单选 4日期 5 数字 6 小数 7 手机  8 文件 9 多选 10 人员 11 附件 12 部门 13 日期时间 14 邮箱 15客户 16 商机 17 联系人 18 地图 19 产品类型 20 合同 21 回款计划',
+  `remark` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段说明',
+  `input_tips` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '输入提示',
+  `max_length` int(12) NULL DEFAULT NULL COMMENT '最大长度',
+  `default_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '默认值',
+  `is_unique` int(1) NULL DEFAULT 0 COMMENT '是否唯一 1 是 0 否',
+  `is_null` int(1) NULL DEFAULT 0 COMMENT '是否必填 1 是 0 否',
+  `sorting` int(5) NULL DEFAULT 1 COMMENT '排序 从小到大',
+  `options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '如果类型是选项,此处不能为空,多个选项以,隔开',
+  `operating` int(1) NULL DEFAULT 0 COMMENT '是否可以删除修改 0 改删 1 改 2 删 3 无',
+  `is_hidden` int(1) NOT NULL DEFAULT 0 COMMENT '是否隐藏  0不隐藏 1隐藏',
+  `update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
+  `form_id` int(11) NULL DEFAULT NULL COMMENT '表单Id',
+  `field_type` int(2) NOT NULL DEFAULT 0 COMMENT '字段来源  0.自定义 1.原始固定 2原始字段但值存在扩展表中',
+  PRIMARY KEY (`field_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '市场活动字段表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_crm_marketing_form`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
+  `remarks` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
+  `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
+  `status` int(1) NULL DEFAULT 1 COMMENT '1启用,0禁用',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+  `is_deleted` int(1) NULL DEFAULT 0 COMMENT '1已删除',
+  `delete_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
+  `delete_user_id` bigint(20) NULL DEFAULT NULL COMMENT '删除人ID',
+  `update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '市场活动表单信息' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine`  (
+  `examine_id` bigint(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '审批ID',
+  `label` int(2) UNSIGNED NULL DEFAULT NULL COMMENT '0 OA 1 合同 2 回款 3发票 4薪资 5 采购审核 6采购退货审核 7销售审核 8 销售退货审核 9付款单审核10 回款单审核11盘点审核12调拨审核',
+  `examine_icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '图标',
+  `examine_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '审批名称',
+  `recheck_type` int(1) NULL DEFAULT NULL COMMENT '撤回之后重新审核操作 1 从第一层开始 2 从拒绝的层级开始',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+  `status` int(1) NULL DEFAULT NULL COMMENT '1 正常 2 停用 3 删除 ',
+  `batch_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
+  `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  `update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+  `user_ids` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '可见范围(员工)',
+  `dept_ids` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '可见范围(部门)',
+  `oa_type` int(1) NULL DEFAULT 0 COMMENT '1 普通审批 2 请假审批 3 出差审批 4 加班审批 5 差旅报销 6 借款申请 0 自定义审批',
+  PRIMARY KEY (`examine_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_condition`  (
+  `condition_id` int(11) NOT NULL AUTO_INCREMENT,
+  `condition_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '条件名称',
+  `flow_id` int(11) NOT NULL COMMENT '审批流程ID',
+  `priority` int(4) NOT NULL COMMENT '优先级 数字越低优先级越高',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
+  `batch_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`condition_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批条件表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_condition_data`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `condition_id` int(11) NOT NULL COMMENT '条件ID',
+  `flow_id` int(11) NOT NULL COMMENT '审批流程ID',
+  `field_id` int(11) NULL DEFAULT NULL COMMENT '字段ID',
+  `field_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '字段名称',
+  `condition_type` int(2) NULL DEFAULT NULL COMMENT '连接条件 1 等于 2 大于 3 小于 4 大于等于 5 小于等于 6 两者之间 7 包含 8 员工 9 部门 10 角色',
+  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '值,json数组格式',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '字段中文名称',
+  `type` int(2) NULL DEFAULT NULL COMMENT '字段类型 1 单行文本 2 多行文本 3 单选 4日期 5 数字 6 小数 7 手机  8 文件 9 多选 10 人员 11 附件 12 部门 13 日期时间 14 邮箱 15客户 16 商机 17 联系人 18 地图 19 产品类型 20 合同 21 回款计划',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批条件扩展字段表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow`  (
+  `flow_id` int(10) NOT NULL AUTO_INCREMENT COMMENT '审核流程ID',
+  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称',
+  `examine_id` bigint(10) UNSIGNED NULL DEFAULT NULL COMMENT '审批ID',
+  `examine_type` int(2) NOT NULL COMMENT '0 条件 1 指定成员 2 主管 3 角色 4 发起人自选 5 连续多级主管',
+  `examine_error_handling` int(1) NOT NULL DEFAULT 1 COMMENT '审批找不到用户或者条件均不满足时怎么处理 1 自动通过 2 管理员审批',
+  `condition_id` int(11) NOT NULL DEFAULT 0 COMMENT '条件ID',
+  `sort` int(11) NOT NULL COMMENT '执行顺序,不可为空',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
+  `batch_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`flow_id`) USING BTREE,
+  INDEX `examine_id`(`examine_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow_continuous_superior`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `flow_id` int(11) NOT NULL COMMENT '审批流程ID',
+  `role_id` int(11) NULL DEFAULT NULL COMMENT '角色ID',
+  `max_level` int(2) NULL DEFAULT NULL COMMENT '角色审批的最高级别或者组织架构的第N级',
+  `type` int(1) NULL DEFAULT NULL COMMENT '1 指定角色 2 组织架构的最上级',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程连续多级主管审批记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow_member`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `flow_id` int(11) NOT NULL COMMENT '审批流程ID',
+  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '审批人ID',
+  `type` int(1) NULL DEFAULT NULL COMMENT '1 依次审批 2 会签 3 或签',
+  `sort` int(1) NOT NULL DEFAULT 0 COMMENT '排序规则',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程指定成员记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow_optional`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `flow_id` int(11) NOT NULL COMMENT '审核流程ID',
+  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '审批人ID',
+  `role_id` int(11) NULL DEFAULT NULL COMMENT '角色ID',
+  `choose_type` int(1) NULL DEFAULT NULL COMMENT '选择类型 1 自选一人 2 自选多人',
+  `type` int(1) NULL DEFAULT NULL COMMENT '1 依次审批 2 会签 3 或签',
+  `sort` int(1) NOT NULL DEFAULT 0 COMMENT '排序规则',
+  `batch_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  `range_type` int(1) NULL DEFAULT NULL COMMENT '选择范围 1 全公司 2 指定成员 3 指定角色 ',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `flow_id`(`flow_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程自选成员记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow_role`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `flow_id` int(11) NOT NULL COMMENT '审核流程ID',
+  `role_id` int(11) NULL DEFAULT NULL COMMENT '角色ID',
+  `type` int(1) NULL DEFAULT NULL COMMENT '2 会签 3 或签',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程角色审批记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_flow_superior`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `flow_id` int(11) NOT NULL COMMENT '审核流程ID',
+  `parent_level` int(2) NULL DEFAULT NULL COMMENT '直属上级级别 1 代表直属上级 2 代表 直属上级的上级',
+  `type` int(1) NULL DEFAULT NULL COMMENT '找不到上级时,是否由上一级上级代审批 0 否 1 是',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '批次ID',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批流程主管审批记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_manager_user`  (
+  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `examine_id` bigint(10) UNSIGNED NOT NULL COMMENT '审批ID',
+  `user_id` bigint(20) NOT NULL COMMENT '管理员ID',
+  `sort` int(5) NOT NULL DEFAULT 0 COMMENT '从小到大',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `examine_id`(`examine_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审批管理员设置表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_record`  (
+  `record_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '审核记录ID',
+  `examine_id` bigint(11) NOT NULL COMMENT '审核ID',
+  `label` int(1) NULL DEFAULT NULL COMMENT '业务类型',
+  `flow_id` int(11) NOT NULL COMMENT '流程ID',
+  `type_id` int(11) NULL DEFAULT NULL COMMENT '关联业务主键ID',
+  `examine_status` int(1) NULL DEFAULT NULL COMMENT '审核状态 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回',
+  `create_time` datetime(0) NOT NULL COMMENT '创建时间',
+  `create_user_id` bigint(20) NOT NULL COMMENT '创建人',
+  `update_time` datetime(0) NOT NULL COMMENT '修改时间',
+  `update_user_id` bigint(20) NOT NULL COMMENT '修改人',
+  PRIMARY KEY (`record_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审核记录表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_record_log`  (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `examine_id` bigint(11) NOT NULL COMMENT '审批ID',
+  `flow_id` int(11) NOT NULL COMMENT '审批流程ID',
+  `record_id` int(11) NOT NULL COMMENT '审批记录ID',
+  `type` int(1) NULL DEFAULT NULL COMMENT '1 依次审批 2 会签 3 或签',
+  `sort` int(6) NULL DEFAULT NULL COMMENT '排序',
+  `examine_status` int(1) NOT NULL COMMENT '审核状态0待审核、1通过、2拒绝、3审核中 4:撤回 5 未提交 6 创建 7 已删除 8 作废',
+  `examine_user_id` bigint(20) NULL DEFAULT 0 COMMENT '审核人ID',
+  `examine_role_id` int(11) NULL DEFAULT 0 COMMENT '审核角色ID',
+  `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+  `batch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '批次ID',
+  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核备注',
+  PRIMARY KEY (`log_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审核日志表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `wk_examine_record_optional`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `flow_id` int(11) NOT NULL COMMENT '流程ID',
+  `record_id` int(11) NOT NULL COMMENT '审核记录ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `sort` int(2) NOT NULL DEFAULT 1 COMMENT '排序。从小到大',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '审核自选成员选择成员表' ROW_FORMAT = Dynamic;
+
+ALTER TABLE `wk_oa_examine` ADD COLUMN `examine_record_id` int(11) NULL DEFAULT NULL COMMENT '审核记录ID' AFTER `batch_id`;
+
+ALTER TABLE `wk_oa_examine` ADD COLUMN `examine_status` int(1) NULL DEFAULT NULL COMMENT '审核状态 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回' AFTER `examine_record_id`;
+
+SET FOREIGN_KEY_CHECKS=1;

BIN
DB/update/v11.2.0/update-V11.2.0.jar


+ 2 - 0
DB/update/v11.2.0/需先执行sql脚本,再执行jar.txt

@@ -0,0 +1,2 @@
+先在wk_crm_single数据库执行v11.2.0.sql
+再执行 java -jar update-V11.2.0.jar即可

+ 124 - 0
DB/update/v11.3.1.sql

@@ -0,0 +1,124 @@
+SET FOREIGN_KEY_CHECKS=0;
+
+ALTER TABLE `wk_crm_field` ADD COLUMN `style_percent` int(3) NULL DEFAULT 50 COMMENT '样式百分比%';
+ALTER TABLE `wk_crm_field` ADD COLUMN `precisions` int(2) NULL COMMENT '精度,允许的最大小数位' AFTER `style_percent`;
+ALTER TABLE `wk_crm_field` ADD COLUMN `form_position` varchar(10) NULL COMMENT '表单定位 坐标格式: 1,1' AFTER `precisions`;
+ALTER TABLE `wk_crm_field` ADD COLUMN `max_num_restrict` varchar(20) NULL COMMENT '限制的最大数值' AFTER `form_position`;
+ALTER TABLE `wk_crm_field` ADD COLUMN `min_num_restrict` varchar(20) NULL COMMENT '限制的最小数值' AFTER `max_num_restrict`;
+
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `style_percent` int(3) NULL DEFAULT 50 COMMENT '样式百分比%';
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `precisions` int(2) NULL COMMENT '精度,允许的最大小数位' AFTER `style_percent`;
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `form_position` varchar(10) NULL COMMENT '表单定位 坐标格式: 1,1' AFTER `precisions`;
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `max_num_restrict` varchar(20) NULL COMMENT '限制的最大数值' AFTER `form_position`;
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `min_num_restrict` varchar(20) NULL COMMENT '限制的最小数值' AFTER `max_num_restrict`;
+
+ALTER TABLE `wk_crm_field` MODIFY COLUMN `default_value` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '默认值' AFTER `max_length`;
+
+ALTER TABLE `wk_oa_examine_field` MODIFY COLUMN `default_value` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '默认值' AFTER `max_length`;
+
+ALTER TABLE `wk_admin_user` ADD COLUMN `is_del` int(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0 未删除 1 已删除';
+
+ALTER TABLE `wk_admin_dept` ADD COLUMN `owner_user_id` bigint(20) NULL COMMENT '部门负责人' AFTER `remark`;
+
+INSERT INTO `wk_admin_menu`(`menu_id`, `parent_id`, `menu_name`, `realm`, `realm_url`, `realm_module`, `menu_type`, `sort`, `status`, `remarks`) VALUES (928, 440, '导入', 'excelimport', '/crmInstrument/importRecordList', NULL, 3, 5, 1, NULL);
+INSERT INTO `wk_admin_menu`(`menu_id`, `parent_id`, `menu_name`, `realm`, `realm_url`, `realm_module`, `menu_type`, `sort`, `status`, `remarks`) VALUES (929, 440, '导出', 'excelexport', '/crmInstrument/exportRecordList', NULL, 3, 6, 1, NULL);
+
+
+
+UPDATE `wk_admin_menu` SET `parent_id` = 440, `menu_name` = '查看', `realm` = 'read', `realm_url` = '/crmInstrument/queryRecordList', `realm_module` = NULL, `menu_type` = 3, `sort` = 1, `status` = 1, `remarks` = NULL WHERE `menu_id` = 441;
+UPDATE `wk_admin_menu` SET `parent_id` = 440, `menu_name` = '新建', `realm` = 'save', `realm_url` = '/crmActivity/addCrmActivityRecord', `realm_module` = NULL, `menu_type` = 3, `sort` = 2, `status` = 1, `remarks` = NULL WHERE `menu_id` = 442;
+UPDATE `wk_admin_menu` SET `parent_id` = 440, `menu_name` = '编辑', `realm` = 'update', `realm_url` = '/crmActivity/updateActivityRecord', `realm_module` = NULL, `menu_type` = 3, `sort` = 3, `status` = 1, `remarks` = NULL WHERE `menu_id` = 443;
+UPDATE `wk_admin_menu` SET `parent_id` = 440, `menu_name` = '删除', `realm` = 'delete', `realm_url` = '/crmActivity/deleteCrmActivityRecord/*', `realm_module` = NULL, `menu_type` = 3, `sort` = 4, `status` = 1, `remarks` = NULL WHERE `menu_id` = 444;
+
+
+ALTER TABLE `wk_oa_examine_field` 
+MODIFY COLUMN `operating` int(1) NULL DEFAULT 255 COMMENT '是否可以删除修改' AFTER `options`;
+
+ALTER TABLE `wk_crm_field` 
+MODIFY COLUMN `operating` int(1) NULL DEFAULT 255 COMMENT '是否可以删除修改' AFTER `options`;
+UPDATE `wk_crm_field` SET `style_percent` = 50;
+
+UPDATE `wk_crm_field` SET `operating` = 255 WHERE field_type='0';
+UPDATE `wk_crm_field` SET `operating` = 189 WHERE label='1' and field_name='leads_name';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='source';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='mobile';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='telephone';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='email';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='industry';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='level';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='address';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='1' and field_name='remark';
+UPDATE `wk_crm_field` SET `operating` = 63 WHERE label='1' and field_name='next_time';
+
+
+UPDATE `wk_crm_field` SET `operating` = 189 WHERE label='2' and field_name='customer_name';
+UPDATE `wk_crm_field` SET `operating` = 63 WHERE label='2' and field_name='level';
+UPDATE `wk_crm_field` SET `operating` = 63 WHERE label='2' and field_name='next_time';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='industry';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='source';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='mobile';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='website';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='email';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='remark';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='2' and field_name='telephone';
+
+
+
+
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='3' and field_name='name';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='3' and field_name='customer_id';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='post';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='sex';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='mobile';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='telephone';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='email';
+UPDATE `wk_crm_field` SET `operating` = 190 WHERE label='3' and field_name='policymakers';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='address';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='next_time';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='3' and field_name='remark';
+
+UPDATE `wk_crm_field` SET `operating` = 177 WHERE label='4' and field_name='name';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='4' and field_name='unit';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='4' and field_name='num';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='4' and field_name='description';
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='4' and field_name='price';
+
+
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='5' and field_name='business_name';
+UPDATE `wk_crm_field` SET `operating` = 149 WHERE label='5' and field_name='customer_id';
+UPDATE `wk_crm_field` SET `operating` = 189 WHERE label='5' and field_name='money';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='5' and field_name='deal_date';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='5' and field_name='remark';
+
+
+UPDATE `wk_crm_field` SET `operating` = 177 WHERE label='6' and field_name='num';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='6' and field_name='name';
+UPDATE `wk_crm_field` SET `operating` = 149 WHERE label='6' and field_name='customer_id';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='6' and field_name='business_id';
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='6' and field_name='order_date';
+UPDATE `wk_crm_field` SET `operating` = 189 WHERE label='6' and field_name='money';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='6' and field_name='start_time';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='6' and field_name='end_time';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='6' and field_name='contacts_id';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='6' and field_name='company_user_id';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='6' and field_name='remark';
+
+UPDATE `wk_crm_field` SET `operating` = 177 WHERE label='7' and field_name='number';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='7' and field_name='contract_id';
+UPDATE `wk_crm_field` SET `operating` = 149 WHERE label='7' and field_name='customer_id';
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='7' and field_name='return_time';
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='7' and field_name='money';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='7' and field_name='return_type';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='7' and field_name='remark';
+
+UPDATE `wk_crm_field` SET `operating` = 177 WHERE label='17' and field_name='visit_number';
+UPDATE `wk_crm_field` SET `operating` = 181 WHERE label='17' and field_name='visit_time';
+UPDATE `wk_crm_field` SET `operating` = 149 WHERE label='17' and field_name='owner_user_id';
+UPDATE `wk_crm_field` SET `operating` = 149 WHERE label='17' and field_name='customer_id';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='17' and field_name='contacts_id';
+UPDATE `wk_crm_field` SET `operating` = 159 WHERE label='17' and field_name='contract_id';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='17' and field_name='return_visit_type';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='17' and field_name='satisficing';
+UPDATE `wk_crm_field` SET `operating` = 191 WHERE label='17' and field_name='flied_itvzix';
+
+SET FOREIGN_KEY_CHECKS=1;

+ 233 - 0
DB/update/v11.3.2.sql

@@ -0,0 +1,233 @@
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP TABLE IF EXISTS `wk_oa_log_user_favour`;
+CREATE TABLE `wk_oa_log_user_favour`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `user_id` bigint(20) NOT NULL COMMENT '用户id',
+  `log_id` int(11) NOT NULL COMMENT '日志id',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `user_id`(`user_id`, `log_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户点赞日志关系表 ' ROW_FORMAT = Dynamic;
+
+ALTER TABLE `wk_crm_field` ADD COLUMN `form_assist_id` int(12) NULL COMMENT '表单辅助id,前端生成' AFTER `min_num_restrict`;
+
+ALTER TABLE `wk_oa_examine_field` ADD COLUMN `form_assist_id` int(12) NULL COMMENT '表单辅助id,前端生成' AFTER `min_num_restrict`;
+
+
+DROP TABLE IF EXISTS `wk_crm_field_extend`;
+CREATE TABLE `wk_crm_field_extend`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `parent_field_id` int(11) NOT NULL COMMENT '对应主字段id',
+  `field_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自定义字段英文标识',
+  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段名称',
+  `type` int(2) NOT NULL DEFAULT 1 COMMENT '字段类型 1 单行文本 2 多行文本 3 单选 4日期 5 数字 6 小数 7 手机  8 文件 9 多选 10 人员 11 附件 12 部门 13 日期时间 14 邮箱 15客户 16 商机 17 联系人 18 地图 19 产品类型 20 合同 21 回款计划',
+  `remark` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段说明',
+  `input_tips` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '输入提示',
+  `max_length` int(12) NULL DEFAULT NULL COMMENT '最大长度',
+  `default_value` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '默认值',
+  `is_unique` int(1) NULL DEFAULT 0 COMMENT '是否唯一 1 是 0 否',
+  `is_null` int(1) NULL DEFAULT 0 COMMENT '是否必填 1 是 0 否',
+  `sorting` int(5) NULL DEFAULT 1 COMMENT '排序 从小到大',
+  `options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '如果类型是选项,此处不能为空,多个选项以,隔开',
+  `operating` int(1) NULL DEFAULT 255 COMMENT '是否允许编辑',
+  `is_hidden` int(1) NOT NULL DEFAULT 0 COMMENT '是否隐藏  0不隐藏 1隐藏',
+  `update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
+  `field_type` int(2) NOT NULL DEFAULT 0 COMMENT '字段来源  0.自定义 1.原始固定 2原始字段但值存在扩展表中',
+  `style_percent` int(3) NULL DEFAULT 50 COMMENT '样式百分比%',
+  `precisions` int(2) NULL DEFAULT NULL COMMENT '精度,允许的最大小数位',
+  `form_position` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单定位 坐标格式: 1,1',
+  `max_num_restrict` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限制的最大数值',
+  `min_num_restrict` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限制的最小数值',
+  `form_assist_id` int(12) NULL DEFAULT NULL COMMENT '表单辅助id,前端生成',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `update_time`(`update_time`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 12231 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '自定义字段表' ROW_FORMAT = Dynamic;
+
+
+DROP TABLE IF EXISTS `wk_oa_examine_field_extend`;
+CREATE TABLE `wk_oa_examine_field_extend`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `parent_field_id` int(11) NOT NULL COMMENT '对应主字段id',
+  `field_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自定义字段英文标识',
+  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字段名称',
+  `type` int(2) NOT NULL DEFAULT 1 COMMENT '字段类型 1 单行文本 2 多行文本 3 单选 4日期 5 数字 6 小数 7 手机  8 文件 9 多选 10 人员 11 附件 12 部门 13 日期时间 14 邮箱 15客户 16 商机 17 联系人 18 地图 19 产品类型 20 合同 21 回款计划',
+  `remark` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段说明',
+  `input_tips` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '输入提示',
+  `max_length` int(12) NULL DEFAULT NULL COMMENT '最大长度',
+  `default_value` varchar(3000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '默认值',
+  `is_unique` int(1) NULL DEFAULT 0 COMMENT '是否唯一 1 是 0 否',
+  `is_null` int(1) NULL DEFAULT 0 COMMENT '是否必填 1 是 0 否',
+  `sorting` int(5) NULL DEFAULT 1 COMMENT '排序 从小到大',
+  `options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '如果类型是选项,此处不能为空,多个选项以,隔开',
+  `operating` int(1) NULL DEFAULT 255 COMMENT '是否可以删除修改',
+  `is_hidden` int(1) NOT NULL DEFAULT 0 COMMENT '是否隐藏  0不隐藏 1隐藏',
+  `update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
+  `field_type` int(2) NOT NULL DEFAULT 0 COMMENT '字段来源  0.自定义 1.原始固定 2原始字段但值存在扩展表中',
+  `style_percent` int(3) NULL DEFAULT 50 COMMENT '样式百分比%',
+  `precisions` int(2) NULL DEFAULT NULL COMMENT '精度,允许的最大小数位',
+  `form_position` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单定位 坐标格式: 1,1',
+  `max_num_restrict` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限制的最大数值',
+  `min_num_restrict` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限制的最小数值',
+  `form_assist_id` int(12) NULL DEFAULT NULL COMMENT '表单辅助id,前端生成',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 5645 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '自定义字段表' ROW_FORMAT = Dynamic;
+
+
+DELETE FROM `wk_crm_field` WHERE label ='18';
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'invoice_apply_number' AS field_name,'发票申请编号' AS NAME,1 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,1 AS is_unique,1 AS is_null,0 AS sorting,NULL AS OPTIONS,176 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'0,0' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field LIMIT 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'customer_id' AS field_name,'客户名称' AS NAME,15 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,1 AS is_null,1 AS sorting,NULL AS OPTIONS,148 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'0,1' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field LIMIT 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'contract_id' AS field_name,'合同编号' AS NAME,20 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,1 AS is_null,2 AS sorting,NULL AS OPTIONS,148 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'1,0' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'contract_money' AS field_name,'合同金额' AS NAME,6 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,0 AS is_null,3 AS sorting,NULL AS OPTIONS,144 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,2 AS precisions,'1,1' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'invoice_money' AS field_name,'开票金额' AS NAME,6 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,1 AS is_null,4 AS sorting,NULL AS OPTIONS,148 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,2 AS precisions,'2,0' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'invoice_date' AS field_name,'开票日期' AS NAME,13 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,0 AS is_null,5 AS sorting,NULL AS OPTIONS,190 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'2,1' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'invoice_type' AS field_name,'开票类型' AS NAME,3 AS type,18 AS label,NULL AS remark,NULL AS input_tips,NULL AS max_length,'' AS default_value,0 AS is_unique,1 AS is_null,6 AS sorting,'增值税专用发票,增值税普通发票,国税通用机打发票,地税通用机打发票,收据' AS OPTIONS,158 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'3,0' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+INSERT INTO `wk_crm_field` (
+SELECT NULL AS field_id,'remark' AS field_name,'备注' AS NAME,2 AS type,18 AS label,NULL AS remark,NULL AS input_tips,255 AS max_length,'' AS default_value,0 AS is_unique,0 AS is_null,7 AS sorting,null AS OPTIONS,190 AS operating,0 AS is_hidden,now() AS update_time,1 AS field_type,NULL AS relevant,50 AS style_percent,NULL AS precisions,'3,1' AS form_position,NULL AS max_num_restrict,NULL AS min_num_restrict,NULL AS form_assist_id FROM wk_crm_field limit 1);
+
+UPDATE `wk_oa_examine_field` SET `precisions` = 2 WHERE  `field_type` = '1' AND `type` = '6';
+
+UPDATE `wk_crm_field` SET `precisions` = 2 WHERE  `field_type` = '1' AND `type` = '6';
+
+UPDATE `wk_admin_menu` SET `realm_url` = null WHERE `menu_id` = 164;
+
+INSERT INTO `wk_admin_menu` ( `menu_id`, `parent_id`, `menu_name`, `realm`, `realm_url`, `realm_module`, `menu_type`, `sort`, `status`, `remarks` ) VALUES ( 933, 11, '编辑团队成员', 'teamsave', '/crmContacts/addMembers,/crmContacts/updateMembers,/crmContacts/exitTeam', NULL, 3, 1, 1, NULL );
+
+INSERT INTO `wk_admin_menu` ( `menu_id`, `parent_id`, `menu_name`, `realm`, `realm_url`, `realm_module`, `menu_type`, `sort`, `status`, `remarks` ) VALUES ( 934, 14, '编辑团队成员', 'teamsave', '/crmReceivables/addMembers,/crmReceivables/updateMembers,/crmReceivables/exitTeam', NULL, 3, 1, 1, NULL );
+
+INSERT INTO `wk_admin_menu`( `menu_id`,`parent_id`, `menu_name`, `realm`, `menu_type`, `sort`) VALUES (935,166, '角色权限查看', 'read', 3, 8);
+
+INSERT INTO `wk_admin_menu`(`menu_id`, `parent_id`, `menu_name`, `realm`, `realm_url`, `realm_module`, `menu_type`, `sort`, `status`, `remarks`) VALUES (932, 420, '导出', 'excelexport', '/crmInvoice/allExportExcel', NULL, 3, 1, 1, NULL);
+
+UPDATE `wk_crm_field` SET `is_unique` = 0 WHERE label='18' and field_name in('contract_id','customer_id');
+
+DELETE FROM wk_crm_role_field WHERE field_id in (SELECT field_id from wk_crm_field WHERE type='50');
+
+
+INSERT INTO `wk_km_auth_user`
+SELECT NULL AS r_id,auth_id,create_user_id AS user_id,1 AS auth,now() AS create_time,create_user_id AS create_user_id FROM (
+SELECT (
+SELECT COUNT(1) FROM wk_km_auth_user WHERE auth_id=a.auth_id) AS num,create_user_id,auth_id FROM wk_km_folder AS a) AS a WHERE a.num='0';
+
+
+INSERT INTO `wk_km_auth_user`
+SELECT NULL AS r_id,auth_id,create_user_id AS user_id,1 AS auth,now() AS create_time,create_user_id AS create_user_id FROM (
+SELECT (
+SELECT COUNT(1) FROM wk_km_auth_user WHERE auth_id=a.auth_id) AS num,create_user_id,auth_id FROM wk_km_document AS a) AS a WHERE a.num='0';
+
+ALTER TABLE `wk_examine` 
+ADD COLUMN `examine_init_id` bigint(20) NULL COMMENT '审批初始化Id' AFTER `examine_id`;
+
+UPDATE `wk_examine` SET `examine_init_id` = examine_id;
+
+DELETE FROM `wk_crm_scene` WHERE is_system='1' and name ='我参与的客户';
+
+DELETE FROM `wk_crm_scene` WHERE is_system='1' and name ='我参与的合同';
+
+DELETE FROM `wk_crm_scene` WHERE is_system='1' and name ='我参与的商机';
+
+CREATE TABLE `wk_crm_team_members` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `type` int(1) NOT NULL COMMENT '类型,同crm类型',
+  `type_id` int(11) NOT NULL COMMENT '对应类型主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `power` int(1) DEFAULT NULL COMMENT '1 只读 2 读写 3 负责人',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `expires_time` datetime DEFAULT NULL COMMENT '过期时间',
+  PRIMARY KEY (`id`),
+  KEY `type` (`type`,`type_id`),
+  KEY `user_id` (`user_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=348 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='crm团队成员表';
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 2 AS type,a.type_id,user_id,2 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.customer_id AS type_id,substring_index(substring_index(a.rw_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_customer AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.rw_user_id)-length(
+REPLACE (a.rw_user_id,',',''))+1) WHERE a.rw_user_id !=',') AS a WHERE a.user_id !='';
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 2 AS type,a.type_id,user_id,1 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.customer_id AS type_id,substring_index(substring_index(a.ro_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_customer AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.ro_user_id)-length(
+REPLACE (a.ro_user_id,',',''))+1) WHERE a.ro_user_id !=',') AS a WHERE a.user_id !='';
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 6 AS type,a.type_id,user_id,2 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.contract_id AS type_id,substring_index(substring_index(a.rw_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_contract AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.rw_user_id)-length(
+REPLACE (a.rw_user_id,',',''))+1) WHERE a.rw_user_id !=',') AS a WHERE a.user_id !='';
+
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 6 AS type,a.type_id,user_id,1 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.contract_id AS type_id,substring_index(substring_index(a.ro_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_contract AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.ro_user_id)-length(
+REPLACE (a.ro_user_id,',',''))+1) WHERE a.ro_user_id !=',') AS a WHERE a.user_id !='';
+
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 5 AS type,a.type_id,user_id,2 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.business_id AS type_id,substring_index(substring_index(a.rw_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_business AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.rw_user_id)-length(
+REPLACE (a.rw_user_id,',',''))+1) WHERE a.rw_user_id !=',') AS a WHERE a.user_id !='';
+
+INSERT INTO `wk_crm_team_members` (`type`,`type_id`,`user_id`,`power`,`create_time`,`expires_time`)
+SELECT 5 AS type,a.type_id,user_id,1 AS power,now() AS create_time,NULL AS expires_time FROM (
+SELECT a.business_id AS type_id,substring_index(substring_index(a.ro_user_id,',',b.help_topic_id+1),',',-1) AS user_id FROM wk_crm_business AS a JOIN mysql.help_topic b ON b.help_topic_id< (length(a.ro_user_id)-length(
+REPLACE (a.ro_user_id,',',''))+1) WHERE a.ro_user_id !=',') AS a WHERE a.user_id !='';
+
+CREATE TABLE `wk_admin_role_auth` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `role_id` int(11) NOT NULL COMMENT '角色ID',
+  `menu_id` int(11) NOT NULL COMMENT '菜单ID',
+  `auth_role_id` int(11) DEFAULT NULL COMMENT '能查询的角色ID',
+  `remark` varchar(100) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`) USING BTREE,
+  KEY `role_type` (`auth_role_id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=5449 DEFAULT CHARSET=utf8 COMMENT='角色表';
+
+CREATE TABLE `wk_crm_invoice_data` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `field_id` int(11) NOT NULL,
+  `name` varchar(255) NOT NULL COMMENT '字段名称',
+  `value` longtext,
+  `create_time` datetime NOT NULL,
+  `batch_id` varchar(32) NOT NULL,
+  PRIMARY KEY (`id`) USING BTREE,
+  KEY `batch_id` (`batch_id`) USING BTREE,
+  KEY `name` (`name`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=2250 DEFAULT CHARSET=utf8mb4 COMMENT='发票扩展字段数据表';
+
+
+INSERT INTO `wk_crm_field_sort` 
+SELECT null as id,null as field_id,'teamMemberIds' as field_name,'相关团队' as name,2 as label,10 as type,100 as style,24 as sort,user_id,0 as is_hide FROM wk_crm_field_sort WHERE label ='2' GROUP BY user_id;
+
+INSERT INTO `wk_crm_field_sort` 
+SELECT null as id,null as field_id,'teamMemberIds' as field_name,'相关团队' as name,3 as label,10 as type,100 as style,24 as sort,user_id,0 as is_hide FROM wk_crm_field_sort WHERE label ='3' GROUP BY user_id;
+
+INSERT INTO `wk_crm_field_sort` 
+SELECT null as id,null as field_id,'teamMemberIds' as field_name,'相关团队' as name,5 as label,10 as type,100 as style,24 as sort,user_id,0 as is_hide FROM wk_crm_field_sort WHERE label ='5' GROUP BY user_id;
+
+INSERT INTO `wk_crm_field_sort` 
+SELECT null as id,null as field_id,'teamMemberIds' as field_name,'相关团队' as name,6 as label,10 as type,100 as style,24 as sort,user_id,0 as is_hide FROM wk_crm_field_sort WHERE label ='6' GROUP BY user_id;
+
+INSERT INTO `wk_crm_field_sort` 
+SELECT null as id,null as field_id,'teamMemberIds' as field_name,'相关团队' as name,7 as label,10 as type,100 as style,24 as sort,user_id,0 as is_hide FROM wk_crm_field_sort WHERE label ='7' GROUP BY user_id;
+
+
+ALTER TABLE `wk_crm_business` 
+MODIFY COLUMN `ro_user_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '只读权限' AFTER `batch_id`,
+MODIFY COLUMN `rw_user_id` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '读写权限' AFTER `ro_user_id`;
+
+SET FOREIGN_KEY_CHECKS = 1;

File diff suppressed because it is too large
+ 6482 - 0
DB/wk_crm_single.sql


File diff suppressed because it is too large
+ 719 - 0
DB/wk_hrm_single.sql


+ 176 - 0
DB/xxl_job.sql

@@ -0,0 +1,176 @@
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for xxl_job_group
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_group`;
+CREATE TABLE `xxl_job_group`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `app_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '执行器AppName',
+  `title` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '执行器名称',
+  `order` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
+  `address_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '执行器地址类型:0=自动注册、1=手动录入',
+  `address_list` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器地址列表,多地址逗号分隔',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_group
+-- ----------------------------
+INSERT INTO `xxl_job_group` VALUES (3, 'wk-job', '悟空crm调度中心', 2, 0, null);
+
+-- ----------------------------
+-- Table structure for xxl_job_info
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_info`;
+CREATE TABLE `xxl_job_info`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
+  `job_cron` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务执行CRON',
+  `job_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `add_time` datetime(0) NULL DEFAULT NULL,
+  `update_time` datetime(0) NULL DEFAULT NULL,
+  `author` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作者',
+  `alarm_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '报警邮件',
+  `executor_route_strategy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器路由策略',
+  `executor_handler` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器任务handler',
+  `executor_param` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器任务参数',
+  `executor_block_strategy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '阻塞处理策略',
+  `executor_timeout` int(11) NOT NULL DEFAULT 0 COMMENT '任务执行超时时间,单位秒',
+  `executor_fail_retry_count` int(11) NOT NULL DEFAULT 0 COMMENT '失败重试次数',
+  `glue_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'GLUE类型',
+  `glue_source` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'GLUE源代码',
+  `glue_remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'GLUE备注',
+  `glue_updatetime` datetime(0) NULL DEFAULT NULL COMMENT 'GLUE更新时间',
+  `child_jobid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
+  `trigger_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '调度状态:0-停止,1-运行',
+  `trigger_last_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '上次调度时间',
+  `trigger_next_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '下次调度时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_info
+-- ----------------------------
+INSERT INTO `xxl_job_info` VALUES (11, 3, '0 0 2 * * ?', '定时放入公海', '2020-08-21 14:56:42', '2020-09-26 16:06:42', 'admin', '', 'LAST', 'CrmCustomerJob', '', 'SERIAL_EXECUTION', 7200, 0, 'BEAN', '', 'GLUE代码初始化', '2020-08-21 14:56:42', '', 1, 1601402400000, 1601488800000);
+INSERT INTO `xxl_job_info` VALUES (12, 3, '0 0 0 * * ?', '日程通知', '2020-08-24 14:43:08', '2020-09-26 16:06:35', 'admin', '', 'FIRST', 'EventNoticeJob', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2020-08-24 14:43:08', '', 1, 1601395200000, 1601481600000);
+INSERT INTO `xxl_job_info` VALUES (13, 3, '0 0 1 * * ?', '任务设置延期', '2020-08-24 14:43:43', '2020-09-26 16:06:27', 'admin', '', 'FIRST', 'TaskJob', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2020-08-24 14:43:43', '', 1, 1601398800000, 1601485200000);
+
+-- ----------------------------
+-- Table structure for xxl_job_lock
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_lock`;
+CREATE TABLE `xxl_job_lock`  (
+  `lock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '锁名称',
+  PRIMARY KEY (`lock_name`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_lock
+-- ----------------------------
+INSERT INTO `xxl_job_lock` VALUES ('schedule_lock');
+
+-- ----------------------------
+-- Table structure for xxl_job_log
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_log`;
+CREATE TABLE `xxl_job_log`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
+  `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
+  `executor_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
+  `executor_handler` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器任务handler',
+  `executor_param` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器任务参数',
+  `executor_sharding_param` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
+  `executor_fail_retry_count` int(11) NOT NULL DEFAULT 0 COMMENT '失败重试次数',
+  `trigger_time` datetime(0) NULL DEFAULT NULL COMMENT '调度-时间',
+  `trigger_code` int(11) NOT NULL COMMENT '调度-结果',
+  `trigger_msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '调度-日志',
+  `handle_time` datetime(0) NULL DEFAULT NULL COMMENT '执行-时间',
+  `handle_code` int(11) NOT NULL COMMENT '执行-状态',
+  `handle_msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '执行-日志',
+  `alarm_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `I_trigger_time`(`trigger_time`) USING BTREE,
+  INDEX `I_handle_code`(`handle_code`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_log
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for xxl_job_log_report
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_log_report`;
+CREATE TABLE `xxl_job_log_report`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `trigger_day` datetime(0) NULL DEFAULT NULL COMMENT '调度-时间',
+  `running_count` int(11) NOT NULL DEFAULT 0 COMMENT '运行中-日志数量',
+  `suc_count` int(11) NOT NULL DEFAULT 0 COMMENT '执行成功-日志数量',
+  `fail_count` int(11) NOT NULL DEFAULT 0 COMMENT '执行失败-日志数量',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `i_trigger_day`(`trigger_day`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_log_report
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for xxl_job_logglue
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_logglue`;
+CREATE TABLE `xxl_job_logglue`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
+  `glue_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'GLUE类型',
+  `glue_source` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'GLUE源代码',
+  `glue_remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'GLUE备注',
+  `add_time` datetime(0) NULL DEFAULT NULL,
+  `update_time` datetime(0) NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_logglue
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for xxl_job_registry
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_registry`;
+CREATE TABLE `xxl_job_registry`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `registry_group` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `registry_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `registry_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `update_time` datetime(0) NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `i_g_k_v`(`registry_group`, `registry_key`, `registry_value`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_registry
+-- ----------------------------
+-- ----------------------------
+-- Table structure for xxl_job_user
+-- ----------------------------
+DROP TABLE IF EXISTS `xxl_job_user`;
+CREATE TABLE `xxl_job_user`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账号',
+  `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
+  `role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
+  `permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `i_username`(`username`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of xxl_job_user
+-- ----------------------------
+INSERT INTO `xxl_job_user` VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 78 - 0
LICENSE.txt

@@ -0,0 +1,78 @@
+悟空CRM开源版使用协议
+
+悟空CRM(CustomerRelationshipManagement)即:悟空客户关系管理软件(以
+下简称悟空CRM)由郑州卡卡罗特软件科技有限公司(以下简称卡卡罗特)开发。卡卡罗特
+依法拥有悟空CRM的所有版权和所有权益。本着共享开放的角度,卡卡罗特以开放源代码的
+形式发布悟空CRM,您可以在遵守该协议的前提下使用悟空CRM。
+
+自您安装悟空CRM开始,您和卡卡罗特之间的合同关系自动成立,成为卡卡罗特用户
+(以下简称为用户)。除非您停止使用悟空CRM或与卡卡罗特有签署额外合同,您须认真遵
+循该用户协议约定的每一项条款。
+
+官方地址:www.5kcrm.com/www.72crm.com
+官方电话:400-0812-558
+官方邮箱:service@5kcrm.com
+官方社区:bbs.72crm.net
+官方社群:悟空CRM交流10群(486745026)
+
+一、协议中提到的名词约定
+
+1.1下述条款中所指悟空CRM的标志包括如下方面:
+悟空CRM源代码及文档中关于悟空CRM的版权提示、文字、图片和链接。
+悟空CRM运行时界面上呈现出来的有关悟空CRM的文字、图片和链接。
+
+1.2不包括如下方面:
+悟空CRM提供的演示数据中关于悟空CRM的文字、图片和链接。
+
+二、免责声明
+
+2.1用户出于自愿而使用本软件,必须了解使用本软件的风险,在尚未购买产品技术服务或
+商业授权之前,我们不承诺对免费用户提供任何形式的技术支持、使用担保,也不承担任何因
+使用本软件而产生问题的相关责任。
+
+2.2电子文本形式的使用协议如同双方书面签署的协议一样,具有完全的和等同的法律效力。
+您一旦开始确认本协议并安装悟空CRM,即被视为完全理解并接受本协议的各项条款,在享
+有以下条款授予的权力的同时,受到相关的约束和限制。
+
+2.3协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,
+责令停止损害,并保留追究相关责任的权利。
+
+三、协议许可的权利
+
+3.1如果您以学习或研究为目的使用悟空CRM,卡卡罗特不对您做任何限制。
+
+3.2您可以在您个人任意数量的电脑上运行悟空CRM,卡卡罗特不对电脑的数量做任何限
+制。
+
+3.3您可以对悟空CRM源代码进行修改以适应您个人学习研究的要求,您做的改动无需对
+外发布。
+
+3.4卡卡罗特依法拥有悟空CRM的所有版权和软件权益,未经商业授权,您无任何版权及
+软件相关权益。
+
+四、协议规定的约束和限制
+
+4.1当您开始将悟空CRM用于企业内部管理使用,意味着已经商用,需购买相应的商业授
+权
+
+4.2未获得商业授权之前,不得将本软件用于商业用途(包括但不限于企业内部使用、二次
+开发后进行销售、以营利为目的或实现盈利等形式)。
+
+4.3未经官方许可,禁止在悟空CRM的整体或任何部分基础上发展任何派生版本、修改版
+本或第三方版本用于重新分发,包括但不限于基于悟空CRM开发SAAS平台等相关服务。
+
+4.4如果您未能遵守本协议的条款,您的授权将被终止,所被许可的权利将被收回,并承担
+相应法律责任。
+
+4.5您使用悟空CRM时,必须保留悟空CRM的所有标志,不得以任何方式隐藏或遮掩任
+一标志。
+
+五、未尽事项
+
+如果上述条款无法满足您使用悟空CRM的要求,可联系卡卡罗特签署额外的合同以获得
+更灵活的授权许可。
+
+六、合同约束
+
+如果您违反了该协议的任一条款,该用户协议将自动终止,您必须停止使用,卡卡罗特保
+留通过法律手段追究责任的权利。

+ 36 - 0
README.en.md

@@ -0,0 +1,36 @@
+# 72CRM-PRO
+
+#### Description
+{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
+
+#### Software Architecture
+Software architecture description
+
+#### Installation
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### Instructions
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### Contribution
+
+1.  Fork the repository
+2.  Create Feat_xxx branch
+3.  Commit your code
+4.  Create Pull Request
+
+
+#### Gitee Feature
+
+1.  You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
+2.  Gitee blog [blog.gitee.com](https://blog.gitee.com)
+3.  Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
+4.  The most valuable open source project [GVP](https://gitee.com/gvp)
+5.  The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
+6.  The most popular members  [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

+ 280 - 0
README.md

@@ -0,0 +1,280 @@
+# 悟空CRM-11.0
+
+
+ **最新资讯: :collision: 悟空CRM云服务免费试用。悟空云正式上线,包含客户关系管理系统(CRM)人力资源管理系统(CRM)、财务管理系统(FS)、无代码平台、SCRM** 
+
+体验地址:[https://www.72crm.com](http://www.72crm.com)
+
+## 悟空CRM介绍
+
+
+悟空CRM在中国的开源管理软件行业有较高的知名度。目前软件已达到千万级的用户量,开源系统下载量达到200多万次,已覆盖设计制造业、服务业、金融业、政府机构等多种行业。与阿里巴巴、腾讯、OPPO、航天信息、CCTV等多家知名企业达成战略合作。
+
+公司先后获得河南省高新技术企业、国家3A信用企业、IOS9001、IOS27001软件产品认证等20多项荣誉奖项。拥有50余项软件著作权。 获得20余家国内媒体报道。公司自成立以来,以高科技为起点,以技术为核心、 以完善的售后服务为后盾,秉承稳固与发展、求实与创新的精神,已为国内外上万家企业提供了服务。 在为实现企业价值最大化的过程中, 实现了自身的价值的提升,取得了最大程度的双赢合作,并获得了社会各界的广泛赞誉和认同。
+
+官网地址:[http://www.5kcrm.com](http://www.5kcrm.com/)
+
+演示地址:(https://demo10.72crm.com/#/crm)  
+帐号:18688888888   密码:123456a
+
+Github下载地址:[https://github.com/72wukong](https://github.com/72wukong)  
+
+QQ群交流群群:[259359511](https://qm.qq.com/cgi-bin/qm/qr?k=G9T2audQqbZBR_HG0aTP9E-8fE7oMeb8&jump_from=webapi)
+
+
+扫码添加小悟官方客服微信,邀您加入千人微信交流群:
+
+<img src="https://images.gitee.com/uploads/images/2019/1231/115927_f9c580c8_345098.png" width="200">
+
+关注悟空CRM公众号,了解更多悟空资讯
+
+<img src="https://images.gitee.com/uploads/images/2019/1202/135713_d3566c6a_345098.jpeg" width="200">
+
+
+
+
+
+ :boom:  :boom:  :boom: 注:悟空CRM采用全新的前后端分离模式,本仓库代码中已集成前端vue打包后文件,  **可免去打包操作,无需运行前端** 。如需调整前端代码,请单独下载前端代码
+
+
+(<a href="https://gitee.com/wukongcrm/W72crm_web" target="_blank">点击下载前端代码</a>) 
+
+
+
+## 悟空CRM目录结构
+
+``` lua
+wk_crm
+├── admin         -- 系统管理模块和用户管理模块
+├── authorization -- 鉴权模块,目前仅用于登录鉴权,后期可能有更改
+├── bi            -- 商业智能模块
+├── core          -- 通用的代码和工具类
+├── crm           -- 客户管理模块
+├── examine       -- 审批模块
+├── gateway       -- 网关模块
+├── job           -- 定时任务模块
+├── oa            -- OA模块
+└── work          -- 项目管理模块
+└── hrm           -- 人力资源管理模块
+
+```
+### 核心功能模块
+
+CRM/OA功能:<br/>
+客户管理:客户数据录入,支持数据查重,数据转移<br/>
+线索管理:支持线索转化客户<br/>
+客户池管理:可配置多个客户池,根据成交等多种条件设置回收规则<br/>
+商机管理:支持设置多个商机,商机阶段自定义配置<br/>
+合同管理:合同审批流配置<br/>
+回款管理:回款审核、审批流配置<br/>
+办公审批:支持配置审批流(请假、报销、借款、出差等自定义配置)<br/>
+日程/任务:支持任务分配、任务<br/><br/>
+
+人力资源功能:<br/>
+
+招聘管理:支持候选人添加、筛选、面试管理<br/>
+人员管理:多维度组织架构配置<br/>
+薪酬管理:可以灵活配置薪酬类型<br/>
+社保管理:支持全国不同地区社保配置<br/>
+绩效考核:灵活配置绩效考核流程,支持OKR和KPI绩效考核模板<br/><br/>
+
+员工端:<br/>
+员工自助查询个人信息、薪酬信息、社保信息、绩效考核信息<br/><br/>
+
+系统配置:<br/>
+系统自定义字段配置<br/>
+审批流配置<br/>
+员工组织架构配置<br/>
+角色权限配置(精确到字段权限)<br/>
+日志配置<br/>
+公海规则配置<br/>
+业务参数配置<br/>
+初始化数据配置<br/>
+其他配置<br/>
+
+
+
+## 悟空CRM使用的主要技术栈
+
+| 名称                  | 版本                        | 说明 |
+|---------------------|---------------------------|----|
+| spring-cloud-alibaba| 2.2.1.RELEASE(Hoxton.SR3) |  核心框架  |
+| swagger             | 2.9.2                     |  接口文档  |
+| mybatis-plus        | 3.3.0                     |  ORM框架  |
+| sentinel            | 2.2.1.RELEASE             |  断路器以及限流  |
+| nacos               | 1.2.1.RELEASE             |  注册中心以及分布式配置管理  |
+| seata               | 1.2.0                     |  分布式事务 |
+| elasticsearch       | 2.2.5.RELEASE(6.8.6)      |  搜索引擎中间件  |
+| jetcache            | 2.6.0                     |  分布式缓存框架  |
+| xxl-job             | 2.1.2                     |  分布式定时任务框架  |
+| gateway             | 2.2.2.RELEASE             |  微服务网关        |
+| feign               | 2.2.2.RELEASE             |  服务调用        |
+
+
+## 悟空CRM项目架构图
+
+
+<img src="https://images.gitee.com/uploads/images/2020/0910/094237_e7cb3bca_1096736.jpeg" width="650">
+
+## 使用说明
+
+### 一、前置环境
+- Jdk1.8
+- Maven3.5.0+   
+- Mysql5.7.20 (<a href="https://gitee.com/wukongcrm/crm_pro/wikis/mysql配置说明" target="_blank">数据库安装注意事项</a>)
+- Redis(版本不限)
+- Elasticsearch 6.8.6 (<a href="https://gitee.com/wukongcrm/crm_pro/wikis/elasticsearch配置说明" target="_blank">环境配置注意事项</a>)
+- Seata(1.2.0)(<a href="https://gitee.com/wukongcrm/crm_pro/wikis/seata" target="_blank">配置说明</a>)
+- Sentinel(1.7.2)(项目中sentinel使用8079端口)
+- Nacos(1.2.1)
+
+### 安装
+
+### 一键安装说明
+
+本项目支持Docker一键安装(建议配置 4核16G以以上),[查看具体安装方法](https://gitee.com/wukongcrm/crm_pro/wikis/Docker一键安装教程?sort_id=3033975)
+
+ **CentOS7手动安装教程参考**  [wiki](https://gitee.com/wukongcrm/crm_pro/wikis/CentOS7安装悟空CRM教程)
+
+### 常见问题
+
+<a href="https://bbs.72crm.com/portal.php?fid=44" target="_blank">常见问题以及解决方案</a>
+
+
+
+### 手动安装说明
+     
+#### 1. 导入初始化sql,目前项目下gateway模块使用的独立数据库,其他模块使用同一数据库
+      
+
+- 安装nacos,新建数据库 `nacos` 在`nacos`数据库中运行` DB/nacos.sql`<br/>
+  修改nacos安装目录/conf/application.properties文件,修改数据持久化类型为mysql,添加mysql数据源的url、用户名和密码,配置如下。<br/>
+   
+```
+   spring.datasource.platform=mysql
+   db.num=1
+   db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
+   db.user=root
+   db.password=password
+```
+
+- 修改gateway模块数据库配置为`nacos`数据库
+- 初始化其余模块数据库:新建数据库 `wk_crm_single` 在`wk_crm_single`数据库中运行 `DB/wk_crm_single.sql`
+- 初始化定时任务模块数据库:新建数据库 `xxl_job` 在`xxl_job`数据库中运行 `DB/xxl_job.sql`
+- 初始化seata数据库:新建数据库 `seata` 在`seata`数据库中运行 `DB/seata.sql`
+
+
+#### 2.在项目根目录执行`mvn install`
+
+
+
+#### 3.在各个模块下resource目录配置数据库帐号信息以及redis帐号信息`(默认使用的是application-dev.yml配置文件,打包后启动脚本默认使用的application-test.yml配置文件)`
+
+
+
+#### 4.在`crm\src\main\resources\application-dev.yml`里面修改elasticsearch配置
+
+        
+```
+spring.elasticsearch.rest.uris = elasticsearch地址 例:127.0.0.1:9200
+spring.elasticsearch.rest.username = elasticsearch用户名 例:elastic 无密码可留空
+spring.elasticsearch.rest.password = elasticsearch密码 例: password 无密码可留空
+
+```
+
+注意:elasticsearch [配置注意点](https://gitee.com/wukongcrm/crm_pro/wikis/elasticsearch配置说明?sort_id=2927431)
+
+#### 5.(可选)修改系统中文件上传地址,默认为本地配置,本地上传还需配置公网地址,指向服务器网关
+
+```
+crm.upload.config:1                文件上传配置 1:本地 2:阿里云OSS 
+crm.upload.oss                     oss上传文件所需配置内容 
+crm.upload.oss.bucketName        需要配置两个bucket,0为登录才可访问文件上传地址,1为完全公开文件上传地址
+crm.upload.local                   本地上传文件所需配置内容 
+crm.upload.local.uploadPath      需要配置两个地址0为登录才可访问文件上传地址,1为完全公开文件上传地址
+```
+
+#### 6.(可选)修改jetcache缓存配置详见 <a href="https://github.com/alibaba/jetcache/wiki" target="_blank">官方文档</a> 
+
+
+#### 7.(可选)项目日志文件在`core\src\main\resources\logback-spring.xml`修改
+            
+
+#### 8. 项目打包部署
+
+
+```
+·在项目根目录下执行 mvn clean -Dmaven.test.skip=true package
+·然后把对应模块下target文件夹下
+·${name}-${version}-SNAPSHOT.zip/tar.gz上传到服务器,例:admin-0.0.1-SNAPSHOT.zip 并将压缩文件解压,检查对应配置文件。
+
+```
+
+
+#### 9. 项目启动 <br/>
+
+
+```
+先启动nacos,seata,sentinel, elasticsearch,mysql,redis等基础服务
+在第八步解压的文件模块下通过执行`sh 72crm.sh start`(windows下直接运行72crm.bat)启动各个模块服务。
+其中项目基础模块:gateway,authorization,admin必须启动,其他模块可按需启动。
+启动完成后,在浏览器中访问:http://localhost:8443/即可登录系统
+
+```
+#### 10. 初始化用户信息(序列号)<br/>
+
+
+```
+访问http://localhost:8443/  
+按照提示初始化超级管理员账号和密码信息,其中序列号填写,成功之后使用初始化后的管理员账户登录系统添加其他员工,分配权限等
+激活序列号:
+6EA74C261C4BA344BC716FCD68295694BABFE016F5B7FA4890E4E29B0F52A5D965EE4A1AF633633D4573A2559630986F976D8F2920D688686CB60967F6FFB9FDADE6AC6DFD39416DE175D0DE01699C816244C16EE4E533A959E3ED0653143A7363E5B98E62126A78CDC5578636F456D29FD2B063FCBED837D50B10450C6FFBF0290DB782C8D4525864A96A98C37C0106FB5D8392A7E828F0BEFA86B4CD28BEBE83628A59BB23F60B7799A22C8D7B2039ED30F05492E9D2A2E2A03D7AC0199EA2CE529D561AE622B3C0DECC50D8A223BC5DA03E3AFF1150F0F217B0BE0400835369329DB74454870D5314DBA7C24B98CCE5600CBDAF264A21974FA3C85E7EAF0A
+
+```
+
+#### 11. 升级说明以及注意事项<br/>
+
+```
+1、后端代码更新直接下载全量代码替换即可
+2、数据库更新请下载 DB/update/V11.x.x.sql,增量执行即可(比如当前版本为V11.0.1,升级为V11.1.0需执行 V11.0.2.sql,V11.1.0.sql)
+3、docker更新请使用在线更新或手动将数据库数据备份后执行增量升级SQL,再备份至本地,然后下载新版docker镜像,将增量升级后SQL恢复至新版数据库
+
+```
+
+
+### 三、其他说明
+
+#### 1.代码生成器及接口文档<br/>
+
+
+```
+代码生成器地址:core\src\test\com\kakarote\generator\Generator.java
+接口文档地址`http://localhost:8443/doc.html`
+```
+
+
+#### 2.模块依赖关系 <br/>
+
+```
+- 除网关外,其余项目均依赖于admin模块,用于获取当前登录人的信息
+- oa模块的任务依赖于work模块,其余一些关联业务功能依赖于crm模块,examine模块
+- 商业智能依赖crm,oa模块
+
+```
+#### 3.更新日志<br/>
+<a href="https://www.72crm.com/upgrade_log" target="_blank">点击查看更新日志</a> 
+<br/>
+### 四、悟空CRM功能模块预览
+
+
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172541_efed65bd_345098.png "01.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172557_c001d047_345098.png "02.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172612_97363074_345098.png "03.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172625_47a2798b_345098.png "04.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172636_ae5cad59_345098.png "05.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172648_c7928c60_345098.png "06.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172704_ac4c3308_345098.png "07.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172714_84b7ee29_345098.png "08.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172726_4552bddb_345098.png "10.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172736_da77deec_345098.png "11.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0928/172745_e22b7a4a_345098.png "12.png")

+ 139 - 0
admin/pom.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<packaging>jar</packaging>
+	<parent>
+		<groupId>com.kakarote</groupId>
+		<artifactId>wkcrm</artifactId>
+		<version>0.0.1-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>wk_admin</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<name>admin</name>
+	<description>系统管理</description>
+
+
+	<dependencies>
+		<dependency>
+			<groupId>com.kakarote</groupId>
+			<artifactId>core</artifactId>
+			<version>${core.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>io.seata</groupId>
+			<artifactId>seata-spring-boot-starter</artifactId>
+		</dependency>
+		<!-- elasticsearch 版本为6.8.6-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<resources>
+			<resource>
+				<!-- xml放在java目录下-->
+				<directory>src/main/java/com/kakarote/${name}/</directory>
+				<includes>
+					<include>**/*.xml</include>
+				</includes>
+			</resource>
+			<!--解决idea不识别resources的问题-->
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<plugins>
+
+			<!--打包jar-->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<!--MANIFEST.MF 中 Class-Path 加入前缀-->
+							<classpathPrefix>lib/</classpathPrefix>
+							<!--jar包不包含唯一版本标识-->
+							<useUniqueVersions>false</useUniqueVersions>
+							<!--指定入口类-->
+							<mainClass>com.kakarote.admin.AdminApplication</mainClass>
+						</manifest>
+						<manifestEntries>
+							<!--MANIFEST.MF 中 Class-Path 加入资源文件目录-->
+							<Class-Path>./config/</Class-Path>
+						</manifestEntries>
+					</archive>
+					<outputDirectory>${project.build.directory}</outputDirectory>
+				</configuration>
+			</plugin>
+
+			<!--拷贝依赖 copy-dependencies-->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>
+								${project.build.directory}/lib/
+							</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+			<!--拷贝资源文件 copy-resources-->
+			<plugin>
+				<artifactId>maven-resources-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-resources</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<resources>
+								<resource>
+									<directory>src/main/resources/</directory>
+								</resource>
+							</resources>
+							<outputDirectory>${project.build.directory}/config</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<finalName>${name}</finalName>
+					<appendAssemblyId>false</appendAssemblyId>
+					<descriptors>
+						<descriptor>../assembly.xml</descriptor>
+					</descriptors>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id>
+						<phase>package</phase>
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 29 - 0
admin/src/main/java/com/kakarote/admin/AdminApplication.java

@@ -0,0 +1,29 @@
+package com.kakarote.admin;
+
+import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
+import com.alicp.jetcache.anno.config.EnableMethodCache;
+import com.kakarote.core.CoreApplication;
+import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+
+/**
+ * @author zhangzhiwei
+ */
+@SpringBootApplication
+@EnableAutoDataSourceProxy
+@EnableDiscoveryClient
+@EnableFeignClients(basePackageClasses = {CoreApplication.class, AdminApplication.class})
+@ComponentScan(basePackageClasses = {CoreApplication.class, AdminApplication.class})
+@MapperScan(basePackages = "com.kakarote.admin.mapper")
+@EnableMethodCache(basePackages = "com.kakarote.admin",order = -9999)
+@EnableCreateCacheAnnotation
+public class AdminApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(AdminApplication.class, args);
+    }
+}

+ 73 - 0
admin/src/main/java/com/kakarote/admin/common/AdminCodeEnum.java

@@ -0,0 +1,73 @@
+package com.kakarote.admin.common;
+
+import com.kakarote.core.common.ResultCode;
+
+/**
+ * @author zhangzhiwei
+ * 管理后台响应错误代码枚举类
+ */
+
+public enum AdminCodeEnum implements ResultCode {
+    //客户模块管理
+    ADMIN_MODULE_CLOSE_ERROR(1101, "客户管理模块不能关闭"),
+    ADMIN_DATA_EXIST_ERROR(1102, "数据不存在"),
+    ADMIN_PASSWORD_INTENSITY_ERROR(1106, "密码必须由 6-20位字母、数字组成"),
+    ADMIN_USER_EXIST_ERROR(1107, "用户已存在!"),
+    ADMIN_PARENT_USER_ERROR(1109, "这个用户的下属不能设置为直属上级!"),
+    ADMIN_PARENT_DEPT_ERROR(1110, "这个部门的下属不能设置为直属部门!"),
+    ADMIN_DEPT_REMOVE_EXIST_USER_ERROR(1111, "这个部门下有员工,不能删除!"),
+    ADMIN_DEPT_REMOVE_EXIST_DEPT_ERROR(1112, "这个部门下有下级部门,不能删除!"),
+    ADMIN_USER_NOT_ROLE_ERROR(1113, "请先给用户设置角色"),
+    ADMIN_USER_NOT_DEPT_ERROR(1114, "请先给用户设置部门"),
+    ADMIN_SUPER_USER_DISABLED_ERROR(1116, "超级管理员用户不可禁用"),
+    ADMIN_ROLE_NAME_EXIST_ERROR(1117, "角色名称已存在"),
+    ADMIN_PHONE_CODE_ERROR(1118, "手机验证码出错!"),
+    ADMIN_PHONE_REGISTER_ERROR(1119, "手机号已被注册!"),
+    ADMIN_PHONE_VERIFY_ERROR(1120, "手机号校验出错!"),
+    ADMIN_PHONE_EXIST_ERROR(1121, "手机号不存在!"),
+    ADMIN_SMS_SEND_FREQUENCY_ERROR(1122, "短信发送频率过高,请稍候再试!"),
+    ADMIN_SMS_SEND_ERROR(1123, "发送验证码失败,请稍候再试!"),
+    ADMIN_MANAGE_UPDATE_ERROR(1124, "超级管理员账号需要到悟空个人中心修改手机号信息!"),
+    ADMIN_USER_NOT_EXIST_ERROR(1125, "用户不存在!"),
+    ADMIN_ACCOUNT_ERROR(1126, "账号不能和原账号相同!"),
+    ADMIN_PASSWORD_ERROR(1127, "密码输入错误!"),
+    ADMIN_USERNAME_EDIT_ERROR(1128, "用户名不可修改!"),
+    ADMIN_USER_HIS_TABLE_ERROR(1129, "开通人数已达上限!"),
+    ADMIN_PARENT_USER_ERROR1(1130, "直属上级不能为自己!"),
+    ADMIN_PRODUCT_DATA_ERROR(1131, "产品不存在!"),
+    ADMIN_MARKETING_DATA_ERROR(1132, "积分不足!"),
+    ADMIN_USER_NEEDS_AT_LEAST_ONE_ROLE(1133, "用户至少需要一个角色!"),
+    ADMIN_PASSWORD_EXPIRE_ERROR(1134, "密码验证已过期,请重新进行验证!"),
+    ADMIN_PASSWORD_INVALID_ERROR(1135, "无效的密码!"),
+    ADMIN_ROLE_NOT_EXIST_ERROR(1136, "请先关联角色!"),
+    ADMIN_LANGUAGE_PACK_NAME_ERROR(1137, "语言包名称有误!"),
+    ADMIN_LANGUAGE_PACK_EXIST_USER_ERROR(1138, "这个语言包有用户正在使用,不可删!"),
+    ADMIN_LANGUAGE_PACK_CHOINESE_ERROR(1139, "缺少中文语言包!"),
+    ADMIN_DEFAULT_ROLE_CANNOT_BE_DELETED(1140, "默认角色不能删除!"),
+    ADMIN_USER_REAL_NAME_EXIST_ERROR(1141, "用户姓名重复!"),
+    ADMIN_DEPT_NOT_EXIST_ERROR(1142, "部门已不存在!"),
+    /**
+     * 企业微信错误code从1200开始
+     */
+    ADMIN_CP_ERROR(1200, "%s!"),
+    ADMIN_CP_DOES_NOT_EXIST(1201, "企业不存在,请先绑定应用!"),
+    ;
+
+    AdminCodeEnum(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    private int code;
+    private String msg;
+
+    @Override
+    public int getCode() {
+        return code;
+    }
+
+    @Override
+    public String getMsg() {
+        return msg;
+    }
+}

+ 24 - 0
admin/src/main/java/com/kakarote/admin/common/AdminConst.java

@@ -0,0 +1,24 @@
+package com.kakarote.admin.common;
+
+import com.kakarote.core.common.Const;
+
+/**
+ * @author zhangzhiwei
+ * 系统管理模块的常量
+ */
+public class AdminConst extends Const {
+    /**
+     * 默认的权限缓存KEY
+     */
+    public static final String DEFAULT_AUTH_CACHE_NAME = "CRM:AUTH";
+
+    /**
+     * 默认的密码强度正则
+     */
+    public static final String DEFAULT_PASSWORD_INTENSITY = "^(?=.*[a-zA-Z])(?=.*\\d).{6,20}$";
+
+    /**
+     * 用户加密公钥
+     */
+    public static final String userPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkqKFcAQtIp4rlkB5LOMnViyVY/hhA6x0R9ftwtEXsAFu4hBZrm9txdEvxSrDCUsx3Zwv/gdimeOzTtfSKffdoE/DwllNP9Zu6nsr2kGRgPrRwjtlO+j2FOM0b9UY1SQ/bWE+a9oQL2jL9xMSbtX1xG/+HcMo1bT+pa6FNQzs3egmvMt75/jaxINPSraj4kgNFawSBk7qDBEqDYiQwtPTuaNW1YZIs++/gZHsCRgGs/JrAbxNpl7+v/+Z503I3I2rs/8eUM5d16NXR8M7vtobUDCTIiQOgRahO8WMadgFlwavyVCYhy/TBXyj5RUfWaS26LrEN3vkj4TjoJu5m9LQ5QIDAQAB";
+}

+ 86 - 0
admin/src/main/java/com/kakarote/admin/common/AdminModuleEnum.java

@@ -0,0 +1,86 @@
+package com.kakarote.admin.common;
+
+/**
+ * @author zhangzhiwei
+ * 模块的枚举
+ */
+
+public enum AdminModuleEnum {
+
+    /**
+     * 任务审批
+     */
+    TASK_EXAMINE("taskExamine"),
+    /**
+     * crm模块
+     */
+    CRM("crm"),
+    /**
+     * 项目管理
+     */
+    PROJECT("project"),
+    /**
+     * 日志模块
+     */
+    LOG("log"),
+    /**
+     * 通讯录模块
+     */
+    BOOK("book"),
+    /**
+     * 办公模块
+     */
+    OA("oa"),
+    /**
+     * 商业智能模块
+     */
+    BI("bi"),
+    /**
+     * 邮箱模块
+     */
+    EMAIL("email"),
+    /**
+     * 日历模块
+     */
+    CALENDAR("calendar"),
+    /**
+     * 知识库
+     */
+    KNOWLEDGE("knowledge"),
+    /**
+     * 呼叫中心
+     */
+    CALL("call"),
+
+    HRM("hrm"),
+
+    JXC("jxc");
+
+    private AdminModuleEnum(String value) {
+        this.value = value;
+    }
+
+    private String value;
+
+    public String getValue() {
+        return this.value;
+    }
+
+    public static String[] getValues() {
+        String[] values = new String[values().length];
+        for (int i = 0; i < values().length; i++) {
+            values[i] = values()[i].getValue();
+        }
+        return values;
+    }
+
+    public static AdminModuleEnum parse(String module) {
+        for (AdminModuleEnum adminModuleEnum : AdminModuleEnum.values()){
+            if (adminModuleEnum.getValue().equals(module)){
+                return adminModuleEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 47 - 0
admin/src/main/java/com/kakarote/admin/common/AdminRoleTypeEnum.java

@@ -0,0 +1,47 @@
+package com.kakarote.admin.common;
+
+/**
+ * 角色类型枚举
+ *
+ * @author zhangzhiwei
+ */
+public enum AdminRoleTypeEnum {
+    /**
+     * 自定义
+     */
+    CUSTOM(0),
+    MANAGER(1),
+    CUSTOMER_MANAGER(2),
+    PERSONNEL(3),
+    FINANCE(4),
+    WORK(5),
+    OA(7),
+    PROJECT(8),
+    HRM(9),
+    JXC(10)
+    ;
+
+    AdminRoleTypeEnum(Integer type) {
+        this.type = type;
+    }
+
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public static AdminRoleTypeEnum parse(Integer type) {
+        for (AdminRoleTypeEnum typeEnum : values()) {
+            if (typeEnum.getType().equals(type)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 23 - 0
admin/src/main/java/com/kakarote/admin/common/AdminThreadPoolConfig.java

@@ -0,0 +1,23 @@
+package com.kakarote.admin.common;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Configuration
+public class AdminThreadPoolConfig {
+
+    @Bean(name = "adminThreadPoolExecutor")
+    public ThreadPoolTaskExecutor adminThreadPoolExecutor(){
+        ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
+        threadPoolTaskExecutor.setCorePoolSize(20);
+        threadPoolTaskExecutor.setMaxPoolSize(80);
+        threadPoolTaskExecutor.setKeepAliveSeconds(30);
+        threadPoolTaskExecutor.setQueueCapacity(200);
+        threadPoolTaskExecutor.setThreadNamePrefix("ADMIN_");
+        threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        return threadPoolTaskExecutor;
+    }
+}

+ 33 - 0
admin/src/main/java/com/kakarote/admin/common/AuthPasswordUtil.java

@@ -0,0 +1,33 @@
+package com.kakarote.admin.common;
+
+import cn.hutool.crypto.SecureUtil;
+
+/**
+ * @author z
+ * 密码加密工具
+ */
+public class AuthPasswordUtil {
+
+    /**
+     * 验证签名是否正确
+     *
+     * @param key  key
+     * @param salt 盐
+     * @param sign 签名
+     * @return 是否正确 true为正确
+     */
+    public static boolean verify(String key, String salt, String sign) {
+        return sign.equals(sign(key, salt));
+    }
+
+    /**
+     * 签名数据
+     *
+     * @param key  key
+     * @param salt 盐
+     * @return 加密后的字符串
+     */
+    public static String sign(String key, String salt) {
+        return SecureUtil.md5(key.concat("erp").concat(salt));
+    }
+}

+ 25 - 0
admin/src/main/java/com/kakarote/admin/common/log/AdminConfigLog.java

@@ -0,0 +1,25 @@
+package com.kakarote.admin.common.log;
+
+import com.kakarote.admin.entity.BO.ModuleSettingBO;
+import com.kakarote.admin.entity.PO.AdminConfig;
+import com.kakarote.admin.service.IAdminConfigService;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.Content;
+import com.kakarote.core.servlet.ApplicationContextHolder;
+
+public class AdminConfigLog {
+
+    private IAdminConfigService adminConfigService = ApplicationContextHolder.getBean(IAdminConfigService.class);
+
+    public Content setModuleSetting(ModuleSettingBO moduleSetting) {
+        AdminConfig adminConfig = adminConfigService.getById(moduleSetting.getSettingId());
+        String detail;
+        if (moduleSetting.getStatus()== 0){
+            detail = "停用了";
+        }else {
+            detail = "启用了";
+        }
+        detail += adminConfig.getName();
+        return new Content(adminConfig.getName(),detail, BehaviorEnum.UPDATE);
+    }
+}

+ 15 - 0
admin/src/main/java/com/kakarote/admin/common/log/AdminDeptLog.java

@@ -0,0 +1,15 @@
+package com.kakarote.admin.common.log;
+
+import com.kakarote.admin.service.IAdminDeptService;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.Content;
+import com.kakarote.core.servlet.ApplicationContextHolder;
+
+public class AdminDeptLog {
+    private IAdminDeptService adminDeptService = ApplicationContextHolder.getBean(IAdminDeptService.class);
+
+    public Content deleteDept(Integer deptId) {
+        String deptName = adminDeptService.getNameByDeptId(deptId);
+        return new Content(deptName,"删除了部门:"+deptName, BehaviorEnum.DELETE);
+    }
+}

+ 26 - 0
admin/src/main/java/com/kakarote/admin/common/log/AdminRoleLog.java

@@ -0,0 +1,26 @@
+package com.kakarote.admin.common.log;
+
+import com.kakarote.admin.entity.PO.AdminRole;
+import com.kakarote.admin.service.IAdminRoleService;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.Content;
+import com.kakarote.core.servlet.ApplicationContextHolder;
+
+public class AdminRoleLog {
+    private IAdminRoleService adminRoleService = ApplicationContextHolder.getBean(IAdminRoleService.class);
+
+    public Content delete(Integer roleId) {
+        AdminRole adminRole = adminRoleService.getById(roleId);
+        return new Content(adminRole.getRoleName(),"删除了角色:"+adminRole.getRoleName(), BehaviorEnum.DELETE);
+    }
+
+    public Content copy(Integer roleId) {
+        AdminRole adminRole = adminRoleService.getById(roleId);
+        return new Content(adminRole.getRoleName(),"复制了角色:"+adminRole.getRoleName(), BehaviorEnum.COPY);
+    }
+
+    public Content deleteWorkRole(Integer roleId) {
+        AdminRole adminRole = adminRoleService.getById(roleId);
+        return new Content(adminRole.getRoleName(),"删除了项目角色:"+adminRole.getRoleName(), BehaviorEnum.DELETE);
+    }
+}

+ 46 - 0
admin/src/main/java/com/kakarote/admin/common/log/AdminUserLog.java

@@ -0,0 +1,46 @@
+package com.kakarote.admin.common.log;
+
+import com.kakarote.admin.entity.BO.AdminUserStatusBO;
+import com.kakarote.admin.entity.PO.AdminUser;
+import com.kakarote.admin.service.IAdminUserService;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.Content;
+import com.kakarote.core.servlet.ApplicationContextHolder;
+import com.kakarote.core.utils.UserCacheUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AdminUserLog {
+
+    private IAdminUserService adminUserService = ApplicationContextHolder.getBean(IAdminUserService.class);
+
+    public Content usernameEdit(Integer id, String username, String password) {
+        AdminUser adminUser = adminUserService.getById(id);
+        return new Content(adminUser.getRealname(),"重置账号密码:"+adminUser.getRealname());
+    }
+
+    public List<Content> setUserStatus(AdminUserStatusBO adminUserStatusBO) {
+        List<Content> contentList = new ArrayList<>();
+        String detail;
+        if (adminUserStatusBO.getStatus() == 1){
+            detail = "启用了";
+        }else {
+            detail = "禁用了";
+        }
+        for (Long id : adminUserStatusBO.getIds()) {
+            String userName = UserCacheUtil.getUserName(id);
+            contentList.add(new Content(userName,detail+userName, BehaviorEnum.UPDATE));
+        }
+        return contentList;
+    }
+
+    public List<Content> resetPassword(AdminUserStatusBO adminUserStatusBO) {
+        List<Content> contentList = new ArrayList<>();
+        for (Long id : adminUserStatusBO.getIds()) {
+            String userName = UserCacheUtil.getUserName(id);
+            contentList.add(new Content(userName,"重置了密码:"+userName, BehaviorEnum.UPDATE));
+        }
+        return contentList;
+    }
+}

+ 334 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminConfigController.java

@@ -0,0 +1,334 @@
+package com.kakarote.admin.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.kakarote.admin.common.AdminCodeEnum;
+import com.kakarote.admin.common.AdminConst;
+import com.kakarote.admin.common.AdminModuleEnum;
+import com.kakarote.admin.common.log.AdminConfigLog;
+import com.kakarote.admin.entity.BO.AdminCompanyBO;
+import com.kakarote.admin.entity.BO.AdminInitDataBO;
+import com.kakarote.admin.entity.BO.LogWelcomeSpeechBO;
+import com.kakarote.admin.entity.BO.ModuleSettingBO;
+import com.kakarote.admin.entity.PO.AdminConfig;
+import com.kakarote.admin.entity.PO.AdminModelSort;
+import com.kakarote.admin.entity.PO.AdminUserConfig;
+import com.kakarote.admin.entity.VO.ModuleSettingVO;
+import com.kakarote.admin.service.IAdminConfigService;
+import com.kakarote.admin.service.IAdminModelSortService;
+import com.kakarote.admin.service.IAdminUserConfigService;
+import com.kakarote.core.common.*;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.SysLog;
+import com.kakarote.core.common.log.SysLogHandler;
+import com.kakarote.core.utils.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * <p>
+ * 客户规则 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminConfig")
+@Api(tags = "系统配置接口")
+@SysLog(logClass = AdminConfigLog.class)
+public class AdminConfigController {
+
+    @Autowired
+    private IAdminConfigService adminConfigService;
+
+
+    @Autowired
+    private IAdminUserConfigService adminUserConfigService;
+
+    @Autowired
+    private IAdminModelSortService adminModelSortService;
+
+
+    /**
+     * 设置系统配置
+     */
+    @ApiOperation(value = "设置企业配置")
+    @PostMapping("/setAdminConfig")
+    @SysLogHandler(subModel = SubModelType.ADMIN_COMPANY_HOME,behavior = BehaviorEnum.UPDATE,object = "企业首页配置",detail = "'企业首页配置:'+#adminCompanyBO.companyName")
+    public Result setAdminConfig(@RequestBody AdminCompanyBO adminCompanyBO) {
+        adminConfigService.setAdminConfig(adminCompanyBO);
+        return Result.ok();
+    }
+
+    /**
+     * 查询企业配置
+     *
+     * @return Result
+     * @author zhangzhiwei
+     */
+    @ApiOperation(value = "查询企业配置")
+    @PostMapping("/queryAdminConfig")
+    public Result<AdminCompanyBO> queryAdminConfig() {
+        return R.ok(adminConfigService.queryAdminConfig());
+    }
+
+
+    @ApiOperation(value = "头部设置")
+    @PostMapping("/queryHeaderModelSort")
+    public Result<List<String>> queryHeaderModelSort() {
+        List<AdminModelSort> list = adminModelSortService.lambdaQuery().select(AdminModelSort::getModel)
+                .eq(AdminModelSort::getType, 1)
+                .eq(AdminModelSort::getUserId, UserUtil.getUserId())
+                .list();
+        return Result.ok(list.stream().map(AdminModelSort::getModel).collect(Collectors.toList()));
+    }
+
+    @ApiOperation(value = "头部设置")
+    @PostMapping("/setHeaderModelSort")
+    public Result setHeaderModelSort(@RequestBody List<String> list) {
+        List<AdminModelSort> modelSortList = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            AdminModelSort adminModelSort = new AdminModelSort();
+            adminModelSort.setType(1).setModel(list.get(i)).setSort(i).setIsHidden(0).setUserId(UserUtil.getUserId());
+            modelSortList.add(adminModelSort);
+        }
+        LambdaQueryWrapper<AdminModelSort> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(AdminModelSort::getType, 1).eq(AdminModelSort::getUserId, UserUtil.getUserId());
+        adminModelSortService.remove(wrapper);
+        adminModelSortService.saveBatch(modelSortList, Const.BATCH_SAVE_SIZE);
+        return R.ok();
+    }
+
+    @ApiOperation(value = "设置活动咨询状态")
+    @PostMapping("/setMarketing")
+    @SysLogHandler(applicationName = "admin",subModel = SubModelType.ADMIN_OTHER_SETTINGS,behavior = BehaviorEnum.UPDATE,object = "活动咨询设置",detail = "活动咨询设置")
+    public Result setMarketing(@RequestParam("status") Integer status) {
+       adminConfigService.setMarketing(status);
+       return R.ok();
+    }
+
+
+    @ApiOperation(value = "查询活动咨询状态")
+    @PostMapping("/queryMarketing")
+    public Result queryMarketing() {
+        return R.ok(adminConfigService.queryMarketing());
+    }
+
+    /**
+     * 查询企业模块配置
+     *
+     * @author zhangzhiwei
+     */
+    @ApiOperation(value = "查询企业模块配置")
+    @PostMapping("/queryModuleSetting")
+    public Result<List<ModuleSettingVO>> queryModuleSetting() {
+        return R.ok(adminConfigService.queryModuleSetting());
+    }
+
+    /**
+     * 设置企业模块
+     *
+     * @param moduleSetting data
+     */
+    @ApiOperation(value = "设置企业模块")
+    @PostMapping("/setModuleSetting")
+    @SysLogHandler(subModel = SubModelType.ADMIN_OTHER_SETTINGS,behavior = BehaviorEnum.UPDATE)
+    public Result setModuleSetting(@Valid @RequestBody ModuleSettingBO moduleSetting) {
+        AdminConfig adminConfig = adminConfigService.getById(moduleSetting.getSettingId());
+        if (AdminModuleEnum.CRM.getValue().equals(adminConfig.getName())) {
+            return R.error(AdminCodeEnum.ADMIN_MODULE_CLOSE_ERROR);
+        }
+        adminConfig.setStatus(moduleSetting.getStatus());
+        adminConfigService.setModuleSetting(adminConfig);
+        return Result.ok();
+    }
+
+    @ApiOperation(value = "设置日志欢迎语")
+    @PostMapping("/setLogWelcomeSpeech")
+    @SysLogHandler(subModel = SubModelType.ADMIN_OTHER_SETTINGS,behavior = BehaviorEnum.UPDATE,object = "设置日志欢迎语",detail = "设置日志欢迎语")
+    public Result setLogWelcomeSpeech(@Valid @RequestBody List<String> stringList) {
+        adminConfigService.setLogWelcomeSpeech(stringList);
+        return Result.ok();
+    }
+
+    /**
+     * 获取日志欢迎语列表
+     */
+    @ApiOperation(value = "获取日志欢迎语")
+    @PostMapping("/getLogWelcomeSpeechList")
+    public Result<List<LogWelcomeSpeechBO>> getLogWelcomeSpeechList() {
+        List<LogWelcomeSpeechBO> adminConfigs = adminConfigService.getLogWelcomeSpeechList();
+        return R.ok(adminConfigs);
+    }
+
+    /**
+     * 删除配置数据
+     */
+    @ApiOperation(value = "删除配置数据")
+    @PostMapping("/deleteConfigById")
+    public Result deleteConfigById(@RequestBody @ApiParam(name = "settingId", value = "主键ID", required = true) Integer settingId) {
+        if (settingId == null) {
+            return R.error(AdminCodeEnum.ADMIN_DATA_EXIST_ERROR);
+        }
+        adminConfigService.removeById(settingId);
+        return R.ok();
+    }
+
+    /**
+     * 查询呼叫中心设置
+     */
+    @ApiOperation(value = "查询手机端模块设置")
+    @PostMapping("/queryCallModuleSetting")
+    public Result<ModuleSettingVO> queryCallModuleSetting() {
+        ModuleSettingVO moduleSettingVO = adminConfigService.queryCallModuleSetting();
+        return R.ok(moduleSettingVO);
+    }
+
+    @ApiOperation(value = "查询自定义配置")
+    @PostMapping("/queryCustomSetting/{customKey}")
+    public Result<JSONArray> queryCustomSetting(@PathVariable("customKey") String customKey) {
+        AdminUserConfig userConfig = adminUserConfigService.queryUserConfigByName(customKey);
+        if (userConfig == null) {
+            return Result.ok(new JSONArray());
+        }
+        return Result.ok(JSON.parseArray(userConfig.getValue()));
+    }
+
+    /**
+     * 修改手机端模块设置
+     */
+
+    @ApiOperation(value = "修改自定义配置")
+    @PostMapping("/setCustomSetting/{customKey}")
+    public Result queryCustomSetting(@RequestBody JSONArray json,@PathVariable("customKey") String customKey) {
+        AdminUserConfig userConfig = adminUserConfigService.queryUserConfigByName(customKey);
+        if (userConfig != null) {
+            userConfig.setValue(json.toJSONString());
+            adminUserConfigService.updateById(userConfig);
+        } else {
+            userConfig = new AdminUserConfig();
+            userConfig.setStatus(1);
+            userConfig.setName(customKey);
+            userConfig.setValue(json.toJSONString());
+            userConfig.setUserId(UserUtil.getUserId());
+            userConfig.setDescription("用户自定义参数设置");
+            adminUserConfigService.save(userConfig);
+        }
+        return R.ok();
+    }
+
+    @ApiOperation(value = "设置跟进记录常用语")
+    @PostMapping("/setActivityPhrase")
+    public Result setActivityPhrase(@RequestBody List<String> stringList) {
+        String name = "ActivityPhrase";
+        Long userId = UserUtil.getUserId();
+        String description = "跟进记录常用语";
+        adminUserConfigService.deleteUserConfigByName(name);
+        List<AdminUserConfig> adminUserConfigList = new ArrayList<>(stringList.size());
+        stringList.forEach(str -> {
+            AdminUserConfig userConfig = new AdminUserConfig();
+            userConfig.setStatus(1);
+            userConfig.setName(name);
+            userConfig.setValue(str);
+            userConfig.setUserId(userId);
+            userConfig.setDescription(description);
+            adminUserConfigList.add(userConfig);
+        });
+        adminUserConfigService.saveBatch(adminUserConfigList, AdminConst.BATCH_SAVE_SIZE);
+        return R.ok();
+    }
+
+    @ApiOperation(value = "设置跟进记录类型")
+    @PostMapping("/setRecordOptions")
+    @SysLogHandler(subModel = SubModelType.ADMIN_OTHER_SETTINGS,behavior = BehaviorEnum.UPDATE,object = "设置跟进记录类型",detail = "设置跟进记录类型")
+    public Result setRecordOptions(@RequestBody List<String> stringList) {
+        String name = "followRecordOption";
+        String description = "跟进记录选项";
+        adminConfigService.removeByMap(new JSONObject().fluentPut("name", name));
+        List<AdminConfig> adminUserConfigList = new ArrayList<>(stringList.size());
+        stringList.forEach(str -> {
+            AdminConfig userConfig = new AdminConfig();
+            userConfig.setStatus(1);
+            userConfig.setName(name);
+            userConfig.setValue(str);
+            userConfig.setDescription(description);
+            adminUserConfigList.add(userConfig);
+        });
+        adminConfigService.saveBatch(adminUserConfigList, AdminConst.BATCH_SAVE_SIZE);
+        return R.ok();
+    }
+
+
+    /**
+     * 查询跟进记录常用语
+     */
+    @ApiOperation(value = "查询跟进记录常用语")
+    @PostMapping("/queryActivityPhrase")
+    public Result<List<String>> queryActivityPhrase() {
+        String name = "ActivityPhrase";
+        List<AdminUserConfig> adminConfigList = adminUserConfigService.queryUserConfigListByName(name);
+        return Result.ok(adminConfigList.stream().map(AdminUserConfig::getValue).collect(Collectors.toList()));
+    }
+
+    @ApiExplain(value = "查询config配置")
+    @RequestMapping("/queryConfigByName")
+    public Result<List<com.kakarote.core.feign.admin.entity.AdminConfig>> queryConfigByName(@RequestParam("name") String name) {
+        List<AdminConfig> adminConfigs = adminConfigService.queryConfigListByName(name);
+        return Result.ok(adminConfigs.stream().map(config -> BeanUtil.copyProperties(config, com.kakarote.core.feign.admin.entity.AdminConfig.class)).collect(Collectors.toList()));
+    }
+
+    @ApiExplain(value = "查询config配置")
+    @RequestMapping("/queryFirstConfigByName")
+    public Result<com.kakarote.core.feign.admin.entity.AdminConfig> queryFirstConfigByName(@RequestParam("name") String name, HttpServletRequest request) {
+        AdminConfig config = adminConfigService.queryConfigByName(name);
+        return Result.ok(BeanUtil.copyProperties(config, com.kakarote.core.feign.admin.entity.AdminConfig.class));
+    }
+
+    @ApiExplain(value = "修改config配置")
+    @PostMapping("/updateAdminConfig")
+    public Result updateAdminConfig(@RequestBody AdminConfig adminConfig) {
+        adminConfigService.updateAdminConfig(adminConfig);
+        return R.ok();
+    }
+
+    @ApiExplain(value = "查询config配置")
+    @RequestMapping("/queryFirstConfigByNameAndValue")
+    public Result<com.kakarote.core.feign.admin.entity.AdminConfig> queryFirstConfigByNameAndValue(@RequestParam("name") String name, @RequestParam("value") String value) {
+        AdminConfig config = adminConfigService.queryFirstConfigByNameAndValue(name, value);
+        return Result.ok(BeanUtil.copyProperties(config, com.kakarote.core.feign.admin.entity.AdminConfig.class));
+    }
+
+    /**
+     * 查询跟进记录常用语
+     */
+    @ApiOperation(value = "验证密码")
+    @PostMapping("/verifyPassword")
+    public Result<String> verifyPassword(@RequestBody AdminInitDataBO adminInitDataBO) {
+        return Result.ok(adminConfigService.verifyPassword(adminInitDataBO));
+    }
+
+
+    /**
+     * 查询跟进记录常用语
+     */
+    @ApiOperation(value = "模块初始化")
+    @PostMapping("/moduleInitData")
+    public Result<Boolean> moduleInitData(@RequestBody AdminInitDataBO adminInitDataBO) {
+        return Result.ok(adminConfigService.moduleInitData(adminInitDataBO));
+    }
+}
+

+ 93 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminDeptController.java

@@ -0,0 +1,93 @@
+package com.kakarote.admin.controller;
+
+
+import com.kakarote.admin.common.log.AdminDeptLog;
+import com.kakarote.admin.entity.BO.AdminDeptBO;
+import com.kakarote.admin.entity.BO.AdminDeptQueryBO;
+import com.kakarote.admin.entity.VO.AdminDeptVO;
+import com.kakarote.admin.service.IAdminDeptService;
+import com.kakarote.core.common.ApiExplain;
+import com.kakarote.core.common.R;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.common.SubModelType;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.SysLog;
+import com.kakarote.core.common.log.SysLogHandler;
+import com.kakarote.core.feign.admin.entity.SimpleDept;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * <p>
+ * 部门表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminDept")
+@Api(tags = "部门管理相关接口")
+@SysLog(subModel = SubModelType.ADMIN_DEPARTMENT_MANAGEMENT,logClass = AdminDeptLog.class)
+public class AdminDeptController {
+
+    @Autowired
+    private IAdminDeptService adminDeptService;
+
+    @PostMapping("/queryDeptTree")
+    @ApiOperation("查询部门列表树")
+    public Result<List<AdminDeptVO>> queryDeptTree(@RequestBody AdminDeptQueryBO queryBO) {
+        List<AdminDeptVO> deptList = adminDeptService.queryDeptTree(queryBO);
+        return Result.ok(deptList);
+    }
+
+    @PostMapping("/addDept")
+    @ApiOperation("新增部门")
+    @SysLogHandler(behavior = BehaviorEnum.SAVE,object = "#adminDept.name",detail = "'添加了部门:'+#adminDept.name")
+    public Result addDept(@RequestBody @Valid AdminDeptBO adminDept) {
+        adminDeptService.addDept(adminDept);
+        return Result.ok();
+    }
+
+    @PostMapping("/setDept")
+    @ApiOperation("修改部门")
+    @SysLogHandler(behavior = BehaviorEnum.SAVE,object = "#adminDept.name",detail = "'修改了部门:'+#adminDept.name")
+    public Result setDept(@RequestBody @Valid AdminDeptBO adminDept) {
+        adminDeptService.setDept(adminDept);
+        return Result.ok();
+    }
+
+    @PostMapping("/deleteDept/{deptId}")
+    @ApiOperation("删除部门")
+    @SysLogHandler(behavior = BehaviorEnum.DELETE)
+    public Result deleteDept(@PathVariable("deptId") Integer deptId) {
+        adminDeptService.deleteDept(deptId);
+        return Result.ok();
+    }
+
+    @RequestMapping("/getNameByDeptId")
+    @ApiExplain("根据部门ID获取部门名称")
+    public Result getNameByDeptId(Integer deptId) {
+        return R.ok(adminDeptService.getNameByDeptId(deptId));
+    }
+
+    @RequestMapping("/queryChildDeptId")
+    @ApiExplain("根据部门ID下的子部门")
+    public Result<List<Integer>> queryChildDeptId(@NotNull Integer deptId) {
+        return R.ok(adminDeptService.queryChildDept(deptId));
+    }
+
+    @PostMapping("/queryDeptByIds")
+    @ApiExplain("根据部门ID获取用户")
+    public Result<List<SimpleDept>> queryDeptByIds(@RequestBody List<Integer> ids) {
+        List<SimpleDept> simpleDepts = adminDeptService.queryDeptByIds(ids);
+        return R.ok(simpleDepts);
+    }
+}
+

+ 177 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminFileController.java

@@ -0,0 +1,177 @@
+package com.kakarote.admin.controller;
+
+
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import com.kakarote.admin.entity.BO.AdminDeleteByBatchIdBO;
+import com.kakarote.admin.entity.BO.RenameFileBO;
+import com.kakarote.admin.service.IAdminFileService;
+import com.kakarote.core.common.ApiExplain;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.common.SystemCodeEnum;
+import com.kakarote.core.exception.CrmException;
+import com.kakarote.core.servlet.LoginFromCookie;
+import com.kakarote.core.servlet.upload.FileEntity;
+import com.kakarote.core.servlet.upload.UploadEntity;
+import com.kakarote.core.utils.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotNull;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * <p>
+ * 附件表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminFile")
+@Api(tags = "文件操作相关接口")
+public class AdminFileController {
+
+    @Autowired
+    private IAdminFileService adminFileService;
+
+    @PostMapping("/upload")
+    @ApiOperation("上传文件")
+    public Result<UploadEntity> upload(@RequestParam("file")
+                                       @ApiParam("文件") MultipartFile file,
+                                       @ApiParam("batchId") String batchId,
+                                       @ApiParam("文件类型") String type,
+                                       @RequestParam(value = "isPublic",required = false)String isPublic) throws IOException {
+        if (StrUtil.isEmpty(isPublic)){
+            isPublic = "0";
+        }
+        UploadEntity entity = adminFileService.upload(file,batchId, type,isPublic);
+        return Result.ok(entity);
+    }
+
+    @PostMapping("/uploadBySingle")
+    @ApiOperation("上传文件")
+    public Result<UploadEntity> uploadBySingle(@RequestParam("file")
+                                       @ApiParam("文件") MultipartFile file,
+                                       @ApiParam("batchId") String batchId,
+                                       @ApiParam("文件类型") String type,
+                                       @RequestParam(value = "isPublic",required = false)String isPublic) throws IOException {
+        if (StrUtil.isEmpty(isPublic)){
+            isPublic = "0";
+        }
+        UploadEntity entity = adminFileService.uploadBySingle(file,batchId, type,isPublic);
+        return Result.ok(entity);
+    }
+
+    @RequestMapping(value = "/queryFileList/{batchId}", method = RequestMethod.POST)
+    @ApiOperation(value = "通过批次ID查询文件列表", httpMethod = "POST")
+    public Result<List<FileEntity>> queryFileList(@NotNull @PathVariable String batchId) {
+        List<FileEntity> entityList = adminFileService.queryFileList(batchId);
+        return Result.ok(entityList);
+    }
+
+    @RequestMapping(value = "/queryById/{fileId}", method = RequestMethod.POST)
+    @ApiOperation(value = "通过ID查询文件", httpMethod = "POST")
+    public Result<FileEntity> queryById(@NotNull @PathVariable @ApiParam("文件ID") Long fileId) {
+        FileEntity fileEntity = adminFileService.queryById(fileId);
+        return Result.ok(fileEntity);
+    }
+
+    @RequestMapping(value = "/queryByIds", method = RequestMethod.POST)
+    @ApiOperation(value = "通过ID查询文件", httpMethod = "POST")
+    public Result<List<FileEntity>> queryByIds(@RequestBody Collection<Long> fileIds) {
+        List<FileEntity> fileEntitys = adminFileService.queryByIds(fileIds);
+        return Result.ok(fileEntitys);
+    }
+
+    @RequestMapping(value = "/queryOneByBatchId/{batchId}", method = RequestMethod.POST)
+    @ApiOperation(value = "通过批次ID查询单个文件", httpMethod = "POST")
+    public Result<FileEntity> queryOneByBatchId(@NotNull @PathVariable @ApiParam("batchId") String batchId) {
+        FileEntity fileEntity = adminFileService.queryOneByBatchId(batchId);
+        return Result.ok(fileEntity);
+    }
+
+    @RequestMapping(value = "/deleteById/{fileId}", method = RequestMethod.POST)
+    @ApiOperation(value = "通过ID删除文件", httpMethod = "POST")
+    public Result deleteById(@NotNull @PathVariable @ApiParam("文件ID") String fileId) {
+        if (NumberUtil.isLong(fileId)) {
+            adminFileService.deleteById(Long.parseLong(fileId));
+        } else {
+            AdminDeleteByBatchIdBO bo = new AdminDeleteByBatchIdBO();
+            bo.setBatchId(fileId);
+            adminFileService.deleteByBatchId(bo);
+        }
+
+        return Result.ok();
+    }
+
+    @RequestMapping(value = "/deleteByBatchId", method = RequestMethod.POST)
+    @ApiOperation(value = "通过批次ID和文件类型删除文件", httpMethod = "POST")
+    public Result deleteByBatchId(@RequestBody AdminDeleteByBatchIdBO deleteByBatchIdBO) {
+        adminFileService.deleteByBatchId(deleteByBatchIdBO);
+        return Result.ok();
+    }
+
+    @RequestMapping(value = "/deleteByBatchIds", method = RequestMethod.POST)
+    @ApiOperation(value = "通过批次ID删除文件", httpMethod = "POST")
+    public Result deleteByBatchId(@RequestBody @ApiParam("batchId") List<String> batchId) {
+        adminFileService.deleteByBatchId(batchId);
+        return Result.ok();
+    }
+
+    @RequestMapping(value = "/down/{fileId}")
+    @ApiOperation(value = "下载文件接口", httpMethod = "POST")
+    @LoginFromCookie
+    public void down(@PathVariable("fileId") @ApiParam("文件ID") Long fileId, HttpServletResponse response) {
+        if (UserUtil.getUser() == null) {
+            throw new CrmException(SystemCodeEnum.SYSTEM_NO_AUTH);
+        }
+        adminFileService.down(response, fileId);
+    }
+
+    @PostMapping(value = "/renameFileById")
+    @ApiOperation(value = "修改附件名称", httpMethod = "POST")
+    public Result renameFileById(@RequestBody RenameFileBO renameFileBO) {
+        adminFileService.renameFileById(renameFileBO);
+        return Result.ok();
+    }
+
+    @PostMapping(value = "/queryNum")
+    @ApiExplain("查询文件数量")
+    public Result<Integer> queryNum(@RequestBody List<String> batchId) {
+        Integer num = adminFileService.queryNum(batchId);
+        return Result.ok(num);
+    }
+
+    @PostMapping(value = "/queryFileList")
+    @ApiExplain("查询文件")
+    public Result<List<FileEntity>> queryFileList(@RequestBody List<String> batchIdList) {
+        List<FileEntity> fileEntities = adminFileService.queryFileList(batchIdList);
+        return Result.ok(fileEntities);
+    }
+
+
+    @PostMapping(value = "/copyJxcImg")
+    @ApiExplain("copy进销存产品详情图")
+    public Result<String> copyJxcImg(@RequestParam(value = "batchId") String batchId) {
+        String newBatchId = adminFileService.copyJxcImg(batchId);
+        return Result.ok(newBatchId);
+    }
+
+    @PostMapping(value = "/saveBatchFileEntity")
+    @ApiExplain("批量保存附件(查询附件id,修改batchId)")
+    public Result saveBatchFileEntity(@RequestParam(value = "adminFileIdList") List<String> adminFileIdList,
+                                      @RequestParam(value = "batchId") String batchId) {
+        adminFileService.saveBatchFileEntity(adminFileIdList, batchId);
+        return Result.ok();
+    }
+}
+

+ 98 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminLanguagePackController.java

@@ -0,0 +1,98 @@
+package com.kakarote.admin.controller;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.kakarote.admin.entity.BO.AdminLanguagePackBO;
+import com.kakarote.admin.entity.VO.AdminLanguagePackVO;
+import com.kakarote.admin.entity.VO.AdminUserVO;
+import com.kakarote.admin.service.IAdminLanguagePackService;
+import com.kakarote.core.common.R;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.entity.BasePage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <p>
+ * 语言包表 前端控制器
+ * </p>
+ *
+ * @author zmj
+ * @since 2020-12-01
+ */
+@RestController
+@RequestMapping("/adminLanguagePack")
+@Api(tags = "语言包相关接口")
+public class AdminLanguagePackController {
+
+    @Autowired
+    private IAdminLanguagePackService iAdminLanguagePackService;
+
+    @ApiOperation("分页查询语言包列表")
+    @PostMapping("/queryLanguagePackList")
+    public Result<BasePage<AdminLanguagePackVO>> queryLanguagePackList(@RequestBody AdminLanguagePackBO adminLanguagePackBO) {
+        return R.ok(iAdminLanguagePackService.queryLanguagePackList(adminLanguagePackBO, 0));
+    }
+
+    @ApiOperation("新增或编辑语言包")
+    @PostMapping("/addOrUpdateLanguagePack")
+    public Result<BasePage<AdminUserVO>> addOrUpdateLanguagePack(@RequestParam("file") MultipartFile file, @RequestParam("languagePackName") String languagePackName, @RequestParam(name="languagePackId", required=false) Integer languagePackId) {
+        AdminLanguagePackBO adminLanguagePackBO = new AdminLanguagePackBO();
+        adminLanguagePackBO.setLanguagePackName(languagePackName);
+        adminLanguagePackBO.setLanguagePackId(languagePackId);
+        return iAdminLanguagePackService.addOrUpdateLanguagePack(file, adminLanguagePackBO);
+    }
+
+    @PostMapping("/deleteLanguagePackById")
+    @ApiOperation("删除语言包")
+    public Result deleteLanguagePackById(@RequestParam("languagePackId") @ApiParam(name = "languagePackId", value = "languagePackId") Integer id) {
+        iAdminLanguagePackService.deleteLanguagePackById(id);
+        return R.ok();
+    }
+
+    @PostMapping("/exportLanguagePackById")
+    @ApiOperation("导出语言包")
+    public void exportLanguagePackById(@RequestParam("languagePackId") @ApiParam(name = "languagePackId", value = "languagePackId") Integer id, HttpServletResponse response) {
+
+        iAdminLanguagePackService.exportLanguagePackById(id, response);
+    }
+
+    @PostMapping("/queryLanguagePackContextById")
+    @ApiOperation("查询语言包字段信息")
+    public Result queryLanguagePackContextById(@RequestParam("languagePackId") @ApiParam(name = "languagePackId", value = "languagePackId") Integer id) {
+        return R.ok(iAdminLanguagePackService.queryLanguagePackContextById(id));
+    }
+
+    @PostMapping("/downloadExcel")
+    @ApiOperation("导出模板")
+    public void downloadExcel(HttpServletResponse response) {
+        iAdminLanguagePackService.downloadExcel(response);
+    }
+
+    @ApiOperation("编辑语言包名称")
+    @PostMapping("/updateLanguagePackNameById")
+    public Result updateLanguagePackNameById(@RequestBody AdminLanguagePackBO adminLanguagePackBO) {
+        iAdminLanguagePackService.updateLanguagePackNameById(adminLanguagePackBO);
+        return Result.ok();
+    }
+
+    @ApiOperation("修改默认语言包配置")
+    @PostMapping("/setDeflautLanguagePackSetting")
+    public Result setDeflautLanguagePackSetting(@RequestParam("languagePackId") @ApiParam(name = "languagePackId", value = "languagePackId") Integer id) {
+        iAdminLanguagePackService.setDeflautLanguagePackSetting(id, 0);
+        return R.ok();
+    }
+
+    @ApiOperation(value = "查询系统默认语言")
+    @PostMapping("/queryDeflautLanguagePackSetting")
+    public JSONObject queryDeflautLanguagePackSetting() {
+        return iAdminLanguagePackService.queryDeflautLanguagePackSetting(0);
+    }
+}
+

+ 55 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminMenuController.java

@@ -0,0 +1,55 @@
+package com.kakarote.admin.controller;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.kakarote.admin.common.AdminRoleTypeEnum;
+import com.kakarote.admin.service.IAdminMenuService;
+import com.kakarote.core.common.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 后台菜单表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminMenu")
+@Api(tags = "菜单模块")
+public class AdminMenuController {
+
+    @Autowired
+    private IAdminMenuService adminMenuService;
+
+    @RequestMapping("/getMenuListByType/{type}")
+    @ApiOperation("根据类型查询菜单")
+    public Result<JSONObject> getMenuListByType(@PathVariable("type") Integer type) {
+        AdminRoleTypeEnum typeEnum = AdminRoleTypeEnum.parse(type);
+        JSONObject byType = adminMenuService.getMenuListByType(typeEnum);
+        return Result.ok(byType);
+    }
+
+    @RequestMapping("/getWorkMenuList")
+    @ApiOperation("查询项目管理菜单")
+    public Result<JSONObject> getWorkMenuList() {
+        JSONObject byType = adminMenuService.getMenuListByType(AdminRoleTypeEnum.WORK);
+        return Result.ok(byType);
+    }
+
+    @RequestMapping("/queryMenuId")
+    public Result<Integer> queryMenuId(@RequestParam("realm1") String realm1,@RequestParam("realm2") String realm2,
+                                       @RequestParam("realm3") String realm3){
+        Integer menuId = adminMenuService.queryMenuId(realm1,realm2,realm3);
+        return Result.ok(menuId);
+
+    }
+}
+

+ 195 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminMessageController.java

@@ -0,0 +1,195 @@
+package com.kakarote.admin.controller;
+
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.extra.servlet.ServletUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.kakarote.admin.entity.BO.AdminMessageQueryBO;
+import com.kakarote.admin.entity.PO.AdminMessage;
+import com.kakarote.admin.entity.VO.AdminMessageVO;
+import com.kakarote.admin.service.IAdminMessageService;
+import com.kakarote.core.common.ApiExplain;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.common.cache.AdminCacheKey;
+import com.kakarote.core.entity.BasePage;
+import com.kakarote.core.feign.admin.entity.AdminMessageBO;
+import com.kakarote.core.redis.Redis;
+import com.kakarote.core.utils.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <p>
+ * 系统消息表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminMessage")
+@Api(tags = "系统消息")
+@Slf4j
+public class AdminMessageController {
+
+    @Autowired
+    private IAdminMessageService messageService;
+
+    @Autowired
+    private Redis redis;
+
+    @PostMapping("/save")
+    public Result<AdminMessage> save(@RequestBody com.kakarote.core.feign.admin.entity.AdminMessage adminMessage) {
+        AdminMessage adminMessage1 = BeanUtil.copyProperties(adminMessage, AdminMessage.class);
+        if (adminMessage.getCreateTime() != null){
+            log.info("saveMessage:{}",adminMessage.getCreateTime());
+            adminMessage1.setCreateTime(DateUtil.parseDateTime(adminMessage.getCreateTime()));
+        }
+        messageService.save(adminMessage1);
+        return Result.ok(adminMessage1);
+    }
+
+    @PostMapping("/update")
+    public Result<AdminMessage> update(@RequestBody com.kakarote.core.feign.admin.entity.AdminMessage adminMessage) {
+        AdminMessage adminMessage1 = BeanUtil.copyProperties(adminMessage, AdminMessage.class);
+        if (adminMessage.getCreateTime() != null){
+            adminMessage1.setCreateTime(DateUtil.parseDateTime(adminMessage.getCreateTime()));
+        }
+        messageService.updateById(adminMessage1);
+        return Result.ok(adminMessage1);
+    }
+
+    @PostMapping("/saveOrUpdateMessage")
+    public Result<Long> saveOrUpdateMessage(@RequestBody com.kakarote.core.feign.admin.entity.AdminMessage message) {
+        Long messageId = messageService.saveOrUpdateMessage(message);
+        return Result.ok(messageId);
+    }
+
+    @PostMapping("/queryList")
+    @ApiOperation("查询消息列表")
+    public Result<BasePage<AdminMessage>> queryList(@RequestBody AdminMessageQueryBO adminMessageBO) {
+        BasePage<AdminMessage> adminMessageBasePage = messageService.queryList(adminMessageBO);
+        return Result.ok(adminMessageBasePage);
+    }
+
+    @PostMapping("/readMessage")
+    @ApiOperation("单个标记为已读")
+    public Result readMessage(@RequestParam("messageId") Long messageId) {
+        AdminMessage byId = messageService.getById(messageId);
+        if (byId != null) {
+            byId.setIsRead(1);
+            messageService.updateById(byId);
+        }
+        return Result.ok();
+    }
+
+    @PostMapping("/readAllMessage")
+    @ApiOperation("全部标记为已读")
+    public Result readAllMessage(Integer label) {
+        LambdaUpdateChainWrapper<AdminMessage> wrapper = messageService.lambdaUpdate();
+        wrapper.set(AdminMessage::getIsRead, 1);
+        wrapper.eq(AdminMessage::getRecipientUser, UserUtil.getUserId());
+        if (label != null) {
+            wrapper.eq(AdminMessage::getLabel, label);
+        }
+        wrapper.update();
+        return Result.ok();
+    }
+
+    @PostMapping("/clear")
+    @ApiOperation("删除已读消息")
+    public Result clear(Integer label) {
+        LambdaUpdateChainWrapper<AdminMessage> wrapper = messageService.lambdaUpdate();
+        wrapper.eq(AdminMessage::getIsRead, 1);
+        wrapper.eq(AdminMessage::getRecipientUser, UserUtil.getUserId());
+        if (label != null) {
+            wrapper.eq(AdminMessage::getLabel, label);
+        }
+        wrapper.remove();
+        return Result.ok();
+    }
+
+    @PostMapping("/getById/{messageId}")
+    public Result<AdminMessage> getById(@PathVariable Long messageId) {
+        AdminMessage adminMessage = messageService.getById(messageId);
+        return Result.ok(adminMessage);
+    }
+
+    @PostMapping("/queryUnreadCount")
+    @ApiOperation("查询未读消息")
+    public Result<AdminMessageVO> queryUnreadCount() {
+        AdminMessageVO messageVO = messageService.queryUnreadCount();
+        return Result.ok(messageVO);
+    }
+
+    @PostMapping("/queryImportNum")
+    @ApiOperation("查询导入数量")
+    public Result<Integer> queryImportNum(Long messageId) {
+        boolean exists = redis.exists(AdminCacheKey.UPLOAD_EXCEL_MESSAGE_PREFIX + messageId.toString());
+        Integer num = null;
+        if (exists) {
+            num = redis.get(AdminCacheKey.UPLOAD_EXCEL_MESSAGE_PREFIX + messageId.toString());
+        }
+        return Result.ok(num);
+    }
+
+    @PostMapping("/queryImportInfo")
+    @ApiOperation("查询导入信息")
+    public Result<JSONObject> queryImportInfo(@RequestParam("messageId") Long messageId) {
+        AdminMessage adminMessage = messageService.getById(messageId);
+        if (adminMessage != null && adminMessage.getContent() != null) {
+            String[] content = adminMessage.getContent().split(",");
+            JSONObject r = new JSONObject().fluentPut("totalSize", adminMessage.getTitle()).fluentPut("errSize", content[0]);
+            r.put("updateSize", content.length > 1 ? content[1] : 0);
+            return Result.ok(r);
+        } else {
+            return Result.ok(new JSONObject().fluentPut("totalSize", 0).fluentPut("errSize", 0).fluentPut("updateSize", 0));
+        }
+    }
+
+    @PostMapping("/downImportError")
+    @ApiOperation("下载错误模板")
+    public void downImportError(@RequestParam("messageId") Long messageId, HttpServletResponse response) {
+        String str = redis.get(AdminCacheKey.UPLOAD_EXCEL_MESSAGE_PREFIX + "file:" + messageId.toString());
+        final boolean exist = FileUtil.exist(str);
+        if (exist) {
+            ServletUtil.write(response, FileUtil.file(str));
+        }
+    }
+
+    @PostMapping("/sendMessage")
+    @ApiExplain("发送消息")
+    public Result sendMessage(@RequestBody AdminMessageBO adminMessageBO) {
+        messageService.addMessage(adminMessageBO);
+        return Result.ok();
+    }
+
+    @PostMapping("/deleteEventMessage")
+    @ApiExplain("删除日程消息")
+    public Result deleteEventMessage(@RequestParam("eventId")Integer eventId){
+        messageService.deleteEventMessage(eventId);
+        return Result.ok();
+    }
+
+    @PostMapping("/deleteById/{messageId}")
+    @ApiOperation("删除通知")
+    public Result deleteById(@PathVariable("messageId") Integer messageId) {
+        messageService.deleteById(messageId);
+        return Result.ok();
+    }
+
+    @PostMapping("/deleteByLabel")
+    public Result deleteByLabel(@RequestParam("label") Integer label){
+        messageService.deleteByLabel(label);
+        return Result.ok();
+    }
+}
+

+ 256 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminRoleController.java

@@ -0,0 +1,256 @@
+package com.kakarote.admin.controller;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.kakarote.admin.common.AdminRoleTypeEnum;
+import com.kakarote.admin.common.log.AdminRoleLog;
+import com.kakarote.admin.entity.BO.AdminRoleBO;
+import com.kakarote.admin.entity.PO.AdminModelSort;
+import com.kakarote.admin.entity.PO.AdminRole;
+import com.kakarote.admin.entity.VO.AdminRoleVO;
+import com.kakarote.admin.service.IAdminModelSortService;
+import com.kakarote.admin.service.IAdminRoleAuthService;
+import com.kakarote.admin.service.IAdminRoleService;
+import com.kakarote.core.common.ApiExplain;
+import com.kakarote.core.common.R;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.common.SubModelType;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.SysLog;
+import com.kakarote.core.common.log.SysLogHandler;
+import com.kakarote.core.utils.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 角色表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminRole")
+@Api(tags = "角色模块")
+@SysLog(subModel = SubModelType.ADMIN_ROLE_PERMISSIONS,logClass = AdminRoleLog.class)
+public class AdminRoleController {
+    @Autowired
+    private IAdminRoleService adminRoleService;
+
+    @Autowired
+    private IAdminModelSortService adminModelSortService;
+
+    @Autowired
+    private IAdminRoleAuthService adminRoleAuthService;
+
+    @PostMapping("/auth")
+    @ApiOperation("角色权限")
+    public Result<JSONObject> auth() {
+        JSONObject object = adminRoleService.auth(UserUtil.getUserId());
+        AdminModelSort one = adminModelSortService.lambdaQuery().select(AdminModelSort::getModel).eq(AdminModelSort::getType, 1).eq(AdminModelSort::getUserId, UserUtil.getUserId()).orderByAsc(AdminModelSort::getSort).last(" limit 1").one();
+        object.put("firstModel", one != null ? one.getModel() : "");
+        return R.ok(object);
+    }
+
+    @PostMapping("/queryNoAuthMenu")
+    @ApiOperation("获取未授权的菜单")
+    public Result<List<String>> queryNoAuthMenu(@RequestParam("userId") @NotNull Long userId) {
+        return R.ok(adminRoleService.queryNoAuthMenu(userId));
+    }
+
+    @PostMapping("/getRoleList")
+    @ApiOperation("查询新增员工时的可查询角色")
+    public Result<List<AdminRoleVO>> getRoleList(){
+        return R.ok(adminRoleService.getRoleList());
+    }
+
+    @PostMapping("/getAllRoleList")
+    @ApiOperation("全局角色查询")
+    public Result<List<AdminRoleVO>> getAllRoleList() {
+        List<AdminRoleVO> allRoleList = adminRoleService.getAllRoleList();
+        return R.ok(allRoleList);
+    }
+
+    @PostMapping("/getRoleTypeList")
+    @ApiOperation("获取角色类型列表")
+    public Result<List<Map<String, Object>>> getRoleTypeList() {
+        List<Map<String, Object>> data = new ArrayList<>(6);
+        data.add(new JSONObject().fluentPut("name", "系统管理角色").fluentPut("roleType", 1));
+        data.add(new JSONObject().fluentPut("name", "办公管理角色").fluentPut("roleType", 7));
+        data.add(new JSONObject().fluentPut("name", "客户管理角色").fluentPut("roleType", 2));
+        data.add(new JSONObject().fluentPut("name", "项目管理角色").fluentPut("roleType", 8));
+        return R.ok(data);
+    }
+
+    @PostMapping("/getRoleByType/{type}")
+    @ApiOperation("通过角色类型查询角色")
+    public Result<List<AdminRole>> getRoleByType(@PathVariable("type") Integer type) {
+        AdminRoleTypeEnum roleTypeEnum = AdminRoleTypeEnum.parse(type);
+        List<AdminRole> roleByType = adminRoleService.getRoleByType(roleTypeEnum);
+        return R.ok(roleByType);
+    }
+
+    @PostMapping("/queryRoleByRoleType")
+    @ApiExplain("通过角色类型查询角色")
+    public Result<List<Integer>> queryRoleByRoleType(@RequestParam("type") Integer type) {
+        List<AdminRole> recordList = adminRoleService.lambdaQuery().select(AdminRole::getRoleId).eq(AdminRole::getRoleType, type).list();
+        return R.ok(recordList.stream().map(AdminRole::getRoleId).collect(Collectors.toList()));
+    }
+
+    @PostMapping("/queryRoleByRoleTypeAndUserId")
+    @ApiExplain("查询当前用户在某个模块下的角色")
+    public Result<List<AdminRole>> queryRoleByRoleTypeAndUserId(@RequestParam("type") Integer type) {
+        List<AdminRole> recordList = adminRoleService.queryRoleByRoleTypeAndUserId(type);
+        return R.ok(recordList);
+    }
+
+
+    @PostMapping("/queryRoleListByUserId")
+    @ApiExplain("通过用户id查询角色")
+    public Result<List<AdminRole>> queryRoleListByUserId(@RequestBody List<Long> userIds) {
+        return R.ok(adminRoleService.queryRoleListByUserId(userIds));
+    }
+
+    @PostMapping("/queryDataType")
+    @ApiExplain("查询数据权限")
+    public Result<Integer> queryDataType(@RequestParam("userId") Long userId, @RequestParam("menuId") Integer menuId) {
+        Integer dataType = adminRoleService.queryDataType(userId, menuId);
+        return R.ok(dataType);
+    }
+
+    @PostMapping("/queryUserByAuth")
+    @ApiExplain("查询数据权限")
+    public Result<Collection<Long>> queryUserByAuth(@RequestParam("userId") Long userId, @RequestParam("menuId") Integer menuId) {
+        Collection<Long> longs = adminRoleService.queryUserByAuth(userId, menuId);
+        return R.ok(longs);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation("添加角色")
+    @SysLogHandler(behavior = BehaviorEnum.SAVE,object = "#adminRole.roleName",detail = "'添加了角色:'+#adminRole.roleName")
+    public Result add(@RequestBody AdminRole adminRole) {
+        adminRoleService.add(adminRole);
+        return R.ok();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation("修改角色")
+    @SysLogHandler(behavior = BehaviorEnum.SAVE,object = "#adminRole.roleName",detail = "'修改了了角色:'+#adminRole.roleName")
+    public Result update(@RequestBody AdminRole adminRole) {
+        adminRoleService.add(adminRole);
+        return R.ok();
+    }
+
+    @PostMapping("/delete")
+    @ApiOperation("删除角色")
+    @SysLogHandler(behavior = BehaviorEnum.DELETE)
+    public Result delete(@RequestParam("roleId") Integer roleId) {
+        adminRoleService.delete(roleId);
+        return R.ok();
+    }
+
+    @PostMapping("/copy")
+    @ApiOperation("复制角色")
+    @SysLogHandler(behavior = BehaviorEnum.COPY)
+    public Result copy(@RequestParam("roleId") Integer roleId) {
+        adminRoleService.copy(roleId);
+        return R.ok();
+    }
+
+    @PostMapping("/relatedDeptUser")
+    @ApiOperation("角色关联员工部门")
+    public Result relatedDeptUser(@RequestBody AdminRoleBO adminRoleBO) {
+        adminRoleService.relatedDeptUser(adminRoleBO.getUserIds(),adminRoleBO.getDeptIds(),adminRoleBO.getRoleIds());
+        return R.ok();
+    }
+
+    @PostMapping("/relatedUser")
+    @ApiOperation("角色关联员工")
+    public Result relatedUser(@RequestBody AdminRoleBO adminRoleBO) {
+        adminRoleService.relatedUser(adminRoleBO.getUserIds(), adminRoleBO.getRoleIds());
+        return R.ok();
+    }
+
+    @PostMapping("/unbindingUser")
+    @ApiOperation("取消角色关联员工")
+    public Result unbindingUser(@RequestParam("userId") Long userId, @RequestParam("roleId") Integer roleId) {
+        adminRoleService.unbindingUser(userId, roleId);
+        return R.ok();
+    }
+
+    @PostMapping("/updateRoleMenu")
+    @ApiOperation("保存角色菜单关系")
+    public Result updateRoleMenu(@RequestBody AdminRole adminRole) {
+        adminRoleService.updateRoleMenu(adminRole);
+        return R.ok();
+    }
+
+    @PostMapping("/updateAuthRole/{roleId}")
+    @ApiOperation("保存角色与能看到角色的关系关系")
+    public Result updateAuthRole(@PathVariable("roleId") Integer roleId,@RequestBody List<Integer> authRoleIds) {
+        adminRoleAuthService.saveRoleAuth(roleId,authRoleIds);
+        return Result.ok();
+    }
+
+    @PostMapping("/queryAuthRole/{roleId}")
+    @ApiOperation("查询角色与能看到角色的关系关系")
+    public Result<List<Integer>> queryAuthRole(@PathVariable("roleId") Integer roleId){
+        List<Integer> roleIdList = adminRoleAuthService.queryByRoleId(roleId);
+        return Result.ok(roleIdList);
+    }
+
+    @PostMapping(value = "/queryWorkRole")
+    @ApiExplain("查询项目管理角色")
+    public Result<Integer> queryWorkRole(@RequestParam("label") Integer label) {
+        Integer role = adminRoleService.queryWorkRole(label);
+        return R.ok(role);
+    }
+
+    @PostMapping(value = "/setWorkRole")
+    @ApiExplain("设置项目管理角色")
+    @SysLogHandler(subModel = SubModelType.WORK_PROJECT,behavior = BehaviorEnum.SAVE,object = "#object[roleName]",detail = "'设置项目角色:'+#object[roleName]")
+    public Result setWorkRole(@RequestBody JSONObject object) {
+        adminRoleService.setWorkRole(object);
+        return R.ok();
+    }
+
+    @PostMapping(value = "/deleteWorkRole")
+    @ApiExplain("删除项目管理角色")
+    @SysLogHandler(subModel = SubModelType.WORK_PROJECT,behavior = BehaviorEnum.DELETE)
+    public Result deleteWorkRole(@RequestParam("roleId") Integer roleId) {
+        adminRoleService.deleteWorkRole(roleId);
+        return R.ok();
+    }
+
+    @PostMapping(value = "/queryProjectRoleList")
+    @ApiOperation("查询项目管理角色列表")
+    public Result<List<AdminRole>> queryProjectRoleList() {
+        List<AdminRole> adminRoles = adminRoleService.queryProjectRoleList();
+        return R.ok(adminRoles);
+    }
+
+    @PostMapping(value = "/queryWorkRoleList")
+    @ApiOperation("查询项目管理角色列表")
+    public Result<List<AdminRole>> queryWorkRoleList() {
+        List<AdminRole> adminRoles = adminRoleService.queryRoleList();
+        return R.ok(adminRoles);
+    }
+
+    @PostMapping("/adminRole/queryUserIdByRoleId")
+    @ApiExplain("根据角色ID查询用户列表")
+    public Result<List<Long>> queryUserIdByRoleId(@RequestParam("roleId") Integer roleId){
+        List<Long> userIds = adminRoleService.queryUserIdByRoleId(roleId);
+        return R.ok(userIds);
+    }
+}
+

+ 447 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminUserController.java

@@ -0,0 +1,447 @@
+package com.kakarote.admin.controller;
+
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.core.lang.PatternPool;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.extra.servlet.ServletUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.util.TypeUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.kakarote.admin.common.AdminCodeEnum;
+import com.kakarote.admin.common.log.AdminUserLog;
+import com.kakarote.admin.entity.BO.*;
+import com.kakarote.admin.entity.PO.AdminConfig;
+import com.kakarote.admin.entity.PO.AdminUser;
+import com.kakarote.admin.entity.PO.AdminUserConfig;
+import com.kakarote.admin.entity.VO.AdminSuperUserVo;
+import com.kakarote.admin.entity.VO.AdminUserVO;
+import com.kakarote.admin.entity.VO.HrmSimpleUserVO;
+import com.kakarote.admin.service.*;
+import com.kakarote.core.common.*;
+import com.kakarote.core.common.log.BehaviorEnum;
+import com.kakarote.core.common.log.SysLog;
+import com.kakarote.core.common.log.SysLogHandler;
+import com.kakarote.core.entity.BasePage;
+import com.kakarote.core.entity.UserInfo;
+import com.kakarote.core.exception.CrmException;
+import com.kakarote.core.exception.NoLoginException;
+import com.kakarote.core.feign.admin.entity.SimpleUser;
+import com.kakarote.core.feign.email.EmailService;
+import com.kakarote.core.servlet.ApplicationContextHolder;
+import com.kakarote.core.servlet.upload.UploadEntity;
+import com.kakarote.core.utils.UserCacheUtil;
+import com.kakarote.core.utils.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotNull;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 用户表 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/adminUser")
+@Api(tags = "员工管理相关接口")
+@Slf4j
+@SysLog(subModel = SubModelType.ADMIN_STAFF_MANAGEMENT,logClass = AdminUserLog.class)
+public class AdminUserController {
+
+    @Autowired
+    private IAdminUserService adminUserService;
+
+    @Autowired
+    private IAdminUserConfigService adminUserConfigService;
+
+    @Autowired
+    private IAdminFileService adminFileService;
+
+    @RequestMapping("/findByUsername")
+    @ApiOperation(value = "通过name查询用户", httpMethod = "POST")
+    public Result<List<Map<String, Object>>> findByUsername(String username) {
+        List<Map<String, Object>> userInfoList = adminUserService.findByUsername(username);
+        return Result.ok(userInfoList);
+    }
+
+    @ApiOperation("通过条件分页查询员工列表")
+    @PostMapping("/queryUserList")
+    public Result<BasePage<AdminUserVO>> queryUserList(@RequestBody AdminUserBO adminUserBO) {
+        return R.ok(adminUserService.queryUserList(adminUserBO));
+    }
+
+    @ApiOperation("查询员工状态人数")
+    @PostMapping("/countNumOfUser")
+    public Result<JSONObject> countUserByLabel() {
+        return R.ok(adminUserService.countUserByLabel());
+    }
+
+    @ApiExplain("通过条件分页查询员工列表")
+    @PostMapping("/queryAllUserList")
+    public Result<List<Long>> queryAllUserList(@RequestParam(value = "type",required = false) Integer type) {
+        LambdaQueryWrapper<AdminUser> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.select(AdminUser::getUserId);
+        /* type=2代表不查询禁用员工 */
+        if (Objects.equals(2,type)) {
+            queryWrapper.ne(AdminUser::getStatus,0);
+        }
+        return R.ok(adminUserService.listObjs(queryWrapper, TypeUtils::castToLong));
+    }
+
+    @ApiExplain("通过条件分页查询员工列表")
+    @PostMapping("/queryAllUserInfoList")
+    public Result<List<UserInfo>> queryAllUserInfoList() {
+        List<UserInfo> userInfoList = adminUserService.queryAllUserInfoList();
+        return R.ok(userInfoList);
+    }
+
+    @PostMapping("/setUser")
+    @ApiOperation("修改用户")
+    public Result setUser(@RequestBody AdminUserVO adminUserVO) {
+        adminUserService.setUser(adminUserVO);
+        return R.ok();
+    }
+
+    @PostMapping("/setUserDept")
+    @ApiOperation("批量修改用户部门")
+    public Result setUserDept(@RequestBody AdminUserBO adminUserBO) {
+        adminUserService.setUserDept(adminUserBO);
+        return R.ok();
+    }
+
+    @PostMapping("/addUser")
+    @ApiOperation("新增用户")
+    @SysLogHandler(behavior = BehaviorEnum.SAVE,object = "#adminUserVO.realname",detail = "'新增了员工:'+#adminUserVO.realname")
+    public Result addUser(@RequestBody AdminUserVO adminUserVO) {
+        adminUserService.addUser(adminUserVO);
+        return R.ok();
+    }
+
+    @PostMapping("/usernameEdit")
+    @ApiOperation("重置登录账号")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE)
+    public Result<Integer> usernameEdit(@RequestParam("id") Integer id, @RequestParam("username") String username, @RequestParam("password") String password) {
+        Integer integer = adminUserService.usernameEdit(id, username, password);
+        return R.ok(integer);
+    }
+
+    @PostMapping("/excelImport")
+    @ApiOperation("excel导入员工")
+    @SysLogHandler(behavior = BehaviorEnum.EXCEL_IMPORT,object = "excel导入员工",detail = "excel导入员工")
+    public Result<JSONObject> excelImport(@RequestParam("file") MultipartFile file) {
+        JSONObject object = adminUserService.excelImport(file);
+        return R.ok(object);
+    }
+
+    @PostMapping("/downloadExcel")
+    @ApiOperation("下载导入模板")
+    public void downloadExcel(HttpServletResponse response) throws IOException {
+        adminUserService.downloadExcel(response);
+    }
+
+    @PostMapping("/downExcel")
+    @ApiOperation("excel下载错误数据")
+    public void downExcel(@RequestParam("token") String token, HttpServletResponse response) {
+        //防止sql注入,token只能是字母,数字,下划线
+        if (!ReUtil.isMatch(PatternPool.GENERAL, token)) {
+            throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
+        }
+        String path = FileUtil.getTmpDirPath() + "/" + token;
+        if (FileUtil.exist(path)) {
+            File file = FileUtil.file(path);
+            final String fileName = file.getName();
+            final String contentType = ObjectUtil.defaultIfNull(FileUtil.getMimeType(fileName), "application/octet-stream");
+            BufferedInputStream in = null;
+            try {
+                in = FileUtil.getInputStream(file);
+                ServletUtil.write(response, in, contentType, "import_error.xls");
+            } finally {
+                IoUtil.close(in);
+            }
+            FileUtil.del(path);
+        }
+    }
+
+    @PostMapping("/hrmAddUser")
+    @ApiOperation("从人力资源添加员工")
+    public Result hrmAddUser(@RequestBody HrmAddUserBO hrmAddUserBO) {
+        adminUserService.hrmAddUser(hrmAddUserBO);
+        return R.ok();
+    }
+
+    @PostMapping("/setUserStatus")
+    @ApiOperation("禁用启用")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE)
+    public Result setUserStatus(@RequestBody AdminUserStatusBO adminUserStatusBO) {
+        adminUserService.setUserStatus(adminUserStatusBO);
+        return R.ok();
+    }
+
+    @PostMapping("/activateUser")
+    @ApiOperation("激活账号")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE)
+    public Result activateUser(@RequestBody AdminUserStatusBO adminUserStatusBO) {
+        adminUserService.activateUser(adminUserStatusBO);
+        return R.ok();
+    }
+
+    @PostMapping("/resetPassword")
+    @ApiOperation("重置密码")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE)
+    public Result resetPassword(@RequestBody AdminUserStatusBO adminUserStatusBO) {
+        adminUserService.resetPassword(adminUserStatusBO);
+        return R.ok();
+    }
+
+    @PostMapping("/updateImg")
+    @ApiOperation("修改头像")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE,object = "修改头像",detail = "修改头像")
+    public Result updateImg(@RequestParam("file") MultipartFile file) throws IOException {
+        UploadEntity img = adminFileService.upload(file, null, "img", "0");
+        AdminUser byId = adminUserService.getById(UserUtil.getUserId());
+        byId.setImg(img.getUrl());
+        adminUserService.updateById(byId);
+        return R.ok();
+    }
+
+    @PostMapping("/updatePassword")
+    @ApiOperation("修改登录密码")
+    @SysLogHandler(behavior = BehaviorEnum.UPDATE,object = "修改登录密码",detail = "修改登录密码")
+    public Result updatePassword(@RequestParam("oldPwd") String oldPass, @RequestParam("newPwd") String newPass) {
+        AdminUser adminUser = adminUserService.getById(UserUtil.getUserId());
+        if (!UserUtil.verify(adminUser.getUsername() + oldPass, adminUser.getSalt(), adminUser.getPassword())) {
+            return R.error(AdminCodeEnum.ADMIN_PASSWORD_ERROR);
+        }
+        adminUser.setPassword(newPass);
+        return updateUser(adminUser);
+    }
+
+    @PostMapping("/updateUser")
+    @ApiOperation("修改用户信息")
+    public Result updateUser(@RequestBody AdminUser adminUser) {
+        adminUserService.updateUser(adminUser);
+        return R.ok();
+    }
+
+    @Autowired
+    private IAdminDeptService deptService;
+
+    @PostMapping("/queryLoginUser")
+    @ApiOperation("查询当前登录用户")
+    public Result<AdminUserVO> queryLoginUser(HttpServletRequest request, HttpServletResponse response) {
+        String name = "readNotice";
+        AdminUser user = adminUserService.getById(UserUtil.getUserId());
+        if (user == null) {
+            throw new NoLoginException();
+        }
+        AdminSuperUserVo adminUser = BeanUtil.copyProperties(user, AdminSuperUserVo.class);
+        adminUser.setIsAdmin(UserUtil.isAdmin());
+        AdminUserConfig userConfig = adminUserConfigService.queryUserConfigByName(name);
+        adminUser.setIsReadNotice(userConfig != null ? userConfig.getStatus() : 0);
+        adminUser.setPassword(null);
+        String deptName = deptService.getNameByDeptId(adminUser.getDeptId());
+        adminUser.setDeptName(deptName);
+        adminUser.setParentName(UserCacheUtil.getUserName(adminUser.getParentId()));
+        AdminConfig config = ApplicationContextHolder.getBean(IAdminConfigService.class).queryConfigByName("email");
+        if (config != null && config.getStatus() == 1) {
+            Integer data = ApplicationContextHolder.getBean(EmailService.class).getEmailId(adminUser.getUserId()).getData();
+            adminUser.setEmailId(data);
+        }
+        AdminUserConfig userConfigByName = adminUserConfigService.queryUserConfigByName("InitUserConfig");
+        if(userConfigByName != null){
+            adminUser.setServerUserInfo(JSON.parseObject(userConfigByName.getValue()));
+        }
+        return R.ok(adminUser);
+    }
+
+    @RequestMapping("/queryUserRoleIds")
+    @ApiExplain("查询用户角色列表")
+    public Result<List<Integer>> queryUserRoleIds(@RequestParam("userId") @NotNull Long userId) {
+        return R.ok(adminUserService.queryUserRoleIds(userId));
+    }
+
+    @RequestMapping("/queryListName")
+    @ApiExplain("查询通讯录")
+    public Result queryListName(@RequestBody UserBookBO userBookBO) {
+        return R.ok(adminUserService.queryListName(userBookBO));
+    }
+
+    @RequestMapping("/attention")
+    @ApiExplain("切换关注状态")
+    public Result attention(@RequestParam("userId") Long userId) {
+        adminUserService.attention(userId);
+        return R.ok();
+    }
+
+    @RequestMapping("/queryChildUserId")
+    @ApiExplain("根据用户ID下的子用户")
+    public Result<List<Long>> queryChildUserId(@NotNull Long userId) {
+        List<Long> longList = adminUserService.queryChildUserId(userId);
+        return R.ok(longList);
+    }
+
+    @RequestMapping("/queryUserInfo")
+    @ApiOperation("查询用户信息")
+    public Result<AdminUser> queryUserInfo(@RequestParam("userId") Long userId) {
+        AdminUser byId = adminUserService.getById(userId);
+        String nameByDeptId = ApplicationContextHolder.getBean(IAdminDeptService.class).getNameByDeptId(byId.getDeptId());
+        byId.setDeptName(nameByDeptId);
+        byId.setSalt(null);
+        byId.setPassword(null);
+        return R.ok(byId);
+    }
+
+    @RequestMapping("/queryInfoByUserId")
+    @ApiExplain("根据用户ID获取用户")
+    public Result<UserInfo> queryInfoByUserId(@NotNull Long userId) {
+        AdminUser byId = adminUserService.getById(userId);
+        UserInfo userInfo = null;
+        if (byId != null) {
+            userInfo = BeanUtil.copyProperties(byId, UserInfo.class);
+            if(byId.getDeptId() != null) {
+                String nameByDeptId = UserCacheUtil.getDeptName(byId.getDeptId());
+                userInfo.setDeptName(nameByDeptId);
+            }
+            userInfo.setRoles(adminUserService.queryUserRoleIds(userInfo.getUserId()));
+        }
+        return R.ok(userInfo);
+    }
+
+    @PostMapping("/queryNormalUserByIds")
+    @ApiExplain("根据用户ID获取正常用户")
+    public Result<List<Long>> queryNormalUserByIds(@RequestBody List<Long> ids) {
+        return R.ok(adminUserService.queryNormalUserByIds(ids));
+    }
+
+
+    @PostMapping("/queryUserById")
+    @ApiExplain("根据用户ID获取用户")
+    public Result<SimpleUser> queryUserById(@RequestParam("userId") Long userId) {
+        AdminUser adminUser = adminUserService.getById(userId);
+        if(adminUser != null) {
+            adminUser.setDeptName(deptService.getNameByDeptId(adminUser.getDeptId()));
+        }
+        return R.ok(BeanUtil.copyProperties(adminUser, SimpleUser.class));
+    }
+
+    @PostMapping("/queryUserByDeptIds")
+    @ApiExplain("根据部门ID获取用户ids")
+    public Result<List<Long>> queryUserByDeptIds(@RequestBody List<Integer> ids) {
+        List<Long> userIds = adminUserService.queryUserByDeptIds(ids);
+        return R.ok(userIds);
+    }
+
+    @PostMapping("/readNotice")
+    @ApiOperation("设置更新日志为已读")
+    public Result readNotice() {
+        Long userId = UserUtil.getUserId();
+        String name = "readNotice";
+        Integer count = adminUserConfigService.lambdaQuery().eq(AdminUserConfig::getUserId, userId).eq(AdminUserConfig::getName, name).count();
+        if (count > 1) {
+            adminUserConfigService.lambdaUpdate().set(AdminUserConfig::getStatus, 1).eq(AdminUserConfig::getUserId, userId).eq(AdminUserConfig::getName, name).update();
+        } else {
+            AdminUserConfig adminUserConfig = new AdminUserConfig();
+            adminUserConfig.setValue("");
+            adminUserConfig.setName(name);
+            adminUserConfig.setUserId(userId);
+            adminUserConfig.setStatus(1);
+            adminUserConfig.setDescription("升级日志阅读状态");
+            adminUserConfigService.save(adminUserConfig);
+        }
+        return R.ok();
+    }
+
+
+    @PostMapping("/queryAuthUserList")
+    @ApiOperation("查询权限下用户")
+    public Result<List<SimpleUser>> queryAuthUserList() {
+        List<SimpleUser> userList = new ArrayList<>();
+        if (UserUtil.isAdmin()) {
+            userList.addAll(adminUserService.list().stream().map(user -> BeanUtil.copyProperties(user, SimpleUser.class)).collect(Collectors.toList()));
+        } else {
+            List<Long> childUserId = adminUserService.queryChildUserId(UserUtil.getUserId());
+            userList.addAll(adminUserService.queryUserByIds(childUserId));
+        }
+        return R.ok(userList);
+    }
+
+    @PostMapping("/queryDeptUserList/{deptId}")
+    @ApiOperation("查询部门用户列表(表单使用)")
+    public Result<DeptUserListVO> queryDeptUserList(@PathVariable Integer deptId) {
+        DeptUserListVO deptUserListVO = adminUserService.queryDeptUserList(deptId,true);
+        return Result.ok(deptUserListVO);
+    }
+
+    @PostMapping("/queryDeptUserByExamine/{deptId}")
+    @ApiOperation("查询部门用户列表(审批使用)")
+    public Result<DeptUserListVO> queryDeptUserByExamine(@PathVariable Integer deptId) {
+        DeptUserListVO deptUserListVO = adminUserService.queryDeptUserList(deptId,false);
+        return Result.ok(deptUserListVO);
+    }
+
+    @PostMapping("/queryDeptUserListByHrm")
+    @ApiOperation("查询部门用户列表(hrm添加员工使用)")
+    public Result<Set<HrmSimpleUserVO>> queryDeptUserListByHrm(@RequestBody DeptUserListByHrmBO deptUserListByHrmBO) {
+        Set<HrmSimpleUserVO> userList = adminUserService.queryDeptUserListByHrm(deptUserListByHrmBO);
+        return Result.ok(userList);
+    }
+
+    @PostMapping("/queryUserIdByRealName")
+    @ApiOperation("查询用户id根据真实姓名")
+    public Result<List<Long>> queryUserIdByRealName(@RequestParam("realNames") List<String> realNames) {
+        List<Long> userIdList = adminUserService.queryUserIdByRealName(realNames);
+        return Result.ok(userIdList);
+    }
+
+    @PostMapping("/queryLoginUserInfo")
+    @ApiExplain("模拟查询登陆用户信息")
+    public Result<UserInfo> queryLoginUserInfo(@RequestParam("userId") Long userId) {
+        UserInfo userInfo = adminUserService.queryLoginUserInfo(userId);
+        return Result.ok(userInfo);
+    }
+
+    @PostMapping("/querySystemStatus")
+    @ApiOperation("查询当前系统初始状态")
+    @ParamAspect
+    public Result<Integer> querySystemStatus() {
+        Integer status = adminUserService.querySystemStatus();
+        return R.ok(status);
+    }
+
+    @PostMapping("/initUser")
+    @ApiOperation("初始化系统用户")
+    @ParamAspect
+    public Result initUser(@Validated @RequestBody SystemUserBO systemUserBO){
+        adminUserService.initUser(systemUserBO);
+        return R.ok();
+    }
+
+
+    @PostMapping("/queryUserIdByUserName")
+    @ApiExplain("查询用户id通过用户名")
+    public Result<Long> queryUserIdByUserName(@RequestParam("userName")String userName){
+        Long userId = adminUserService.lambdaQuery().select(AdminUser::getUserId).eq(AdminUser::getUsername, userName).oneOpt().map(AdminUser::getUserId).orElse(0L);
+        return Result.ok(userId);
+    }
+}
+

+ 38 - 0
admin/src/main/java/com/kakarote/admin/controller/AdminUserHisTableController.java

@@ -0,0 +1,38 @@
+package com.kakarote.admin.controller;
+
+import com.kakarote.admin.service.IAdminUserHisTableService;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.feign.admin.entity.CallUser;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Ian
+ * @date 2020/8/28
+ */
+@RestController
+@Api(tags = "授权坐席相关接口")
+@RequestMapping("/adminUserHisTable")
+public class AdminUserHisTableController {
+
+    @Autowired
+    private IAdminUserHisTableService adminUserHisTableService;
+
+    @PostMapping("/authorize")
+    @ApiOperation("员工坐席授权")
+    public Result<Boolean> authorize(@RequestBody CallUser callUser){
+        return Result.ok(adminUserHisTableService.authorize(callUser.getUserIds(),callUser.getState(),callUser.getHisUse()));
+    }
+
+    @PostMapping("/checkAuth")
+    @ApiOperation("判断用户是否为坐席")
+    public Result<Integer> checkAuth() {
+        return Result.ok(adminUserHisTableService.checkAuth());
+    }
+
+}

+ 147 - 0
admin/src/main/java/com/kakarote/admin/controller/SysLogController.java

@@ -0,0 +1,147 @@
+package com.kakarote.admin.controller;
+
+
+import cn.hutool.core.bean.BeanUtil;
+import com.kakarote.admin.entity.BO.QuerySysLogBO;
+import com.kakarote.admin.entity.PO.LoginLog;
+import com.kakarote.admin.entity.PO.SysLog;
+import com.kakarote.admin.service.ISysLogService;
+import com.kakarote.core.common.ModelType;
+import com.kakarote.core.common.Result;
+import com.kakarote.core.entity.BasePage;
+import com.kakarote.core.utils.ExcelParseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 系统日志 前端控制器
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-11-25
+ */
+@RestController
+@RequestMapping("/adminSysLog")
+@Api(tags = "系统日志")
+@Slf4j
+public class SysLogController {
+
+    @Autowired
+    private ISysLogService sysLogService;
+
+    @PostMapping("/saveSysLog")
+    public Result saveSysLog(@RequestBody SysLog sysLog){
+        sysLogService.saveSysLog(sysLog);
+        return Result.ok();
+    }
+
+
+
+    @PostMapping("/querySysLogPageList")
+    @ApiOperation("查询系统日志列表")
+    public Result<BasePage<SysLog>> querySysLogPageList(@RequestBody QuerySysLogBO querySysLogBO){
+        BasePage<SysLog> page = sysLogService.querySysLogPageList(querySysLogBO);
+        return Result.ok(page);
+    }
+
+    @PostMapping("/exportSysLog")
+    @ApiOperation("导出系统日志")
+    public void exportSysLog(@RequestBody QuerySysLogBO querySysLogBO, HttpServletResponse response){
+        querySysLogBO.setPageType(0);
+        BasePage<SysLog> page = sysLogService.querySysLogPageList(querySysLogBO);
+        List<Map<String, Object>> objectList = page.getList().stream().map(obj -> {
+            Map<String, Object> map = BeanUtil.beanToMap(obj);
+            map.remove("id");
+            map.remove("className");
+            map.remove("methodName");
+            map.remove("args");
+            map.remove("userId");
+            map.put("model", ModelType.valueOfName((String) map.get("model")));
+            return map;
+        }).collect(Collectors.toList());
+        List<ExcelParseUtil.ExcelDataEntity> dataList = new ArrayList<>();
+        dataList.add(ExcelParseUtil.toEntity("realname", "用户"));
+        dataList.add(ExcelParseUtil.toEntity("createTime", "时间"));
+        dataList.add(ExcelParseUtil.toEntity("ipAddress", "ip地址"));
+        dataList.add(ExcelParseUtil.toEntity("model", "模块"));
+        dataList.add(ExcelParseUtil.toEntity("subModel", "子模块"));
+        dataList.add(ExcelParseUtil.toEntity("behavior", "行为"));
+        dataList.add(ExcelParseUtil.toEntity("object", "对象"));
+        dataList.add(ExcelParseUtil.toEntity("detail", "操作详情"));
+        ExcelParseUtil.exportExcel(objectList, new ExcelParseUtil.ExcelParseService() {
+            @Override
+            public void castData(Map<String, Object> record, Map<String, Integer> headMap) {
+
+            }
+            @Override
+            public String getExcelName() {
+                return "系统日志";
+            }
+        }, dataList);
+    }
+
+    @PostMapping("/saveLoginLog")
+    public Result saveLoginLog(@RequestBody LoginLog loginLog){
+        sysLogService.saveLoginLog(loginLog);
+        return Result.ok();
+    }
+
+    @PostMapping("/queryLoginLogPageList")
+    @ApiOperation("查询登录日志列表")
+    public Result<BasePage<LoginLog>> queryLoginLogPageList(@RequestBody QuerySysLogBO querySysLogBO){
+        BasePage<LoginLog> page = sysLogService.queryLoginLogPageList(querySysLogBO);
+        return Result.ok(page);
+    }
+
+
+    @PostMapping("/exportLoginLog")
+    @ApiOperation("导出登陆日志")
+    public void exportLoginLog(@RequestBody QuerySysLogBO querySysLogBO, HttpServletResponse response){
+        querySysLogBO.setPageType(0);
+        BasePage<LoginLog> page = sysLogService.queryLoginLogPageList(querySysLogBO);
+        List<Map<String, Object>> objectList = page.getList().stream().map(obj -> {
+            Map<String, Object> map = BeanUtil.beanToMap(obj);
+            map.remove("id");
+            map.remove("userId");
+            map.remove("failResult");
+            map.put("authResult", obj.getAuthResult()==1?"成功":"失败");
+            return map;
+        }).collect(Collectors.toList());
+
+        List<ExcelParseUtil.ExcelDataEntity> dataList = new ArrayList<>();
+        dataList.add(ExcelParseUtil.toEntity("realname", "用户"));
+        dataList.add(ExcelParseUtil.toEntity("loginTime", "登陆时间"));
+        dataList.add(ExcelParseUtil.toEntity("ipAddress", "ip地址"));
+        dataList.add(ExcelParseUtil.toEntity("loginAddress", "登陆地点"));
+        dataList.add(ExcelParseUtil.toEntity("deviceType", "设备类型"));
+        dataList.add(ExcelParseUtil.toEntity("core", "终端内核"));
+        dataList.add(ExcelParseUtil.toEntity("platform", "平台"));
+        dataList.add(ExcelParseUtil.toEntity("authResult", "认证结果"));
+        ExcelParseUtil.exportExcel(objectList, new ExcelParseUtil.ExcelParseService() {
+            @Override
+            public void castData(Map<String, Object> record, Map<String, Integer> headMap) {
+
+            }
+            @Override
+            public String getExcelName() {
+                return "登录日志";
+            }
+        }, dataList);
+    }
+
+
+}
+

+ 29 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminCompanyBO.java

@@ -0,0 +1,29 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * @author zhangzhiwei
+ * BO业务逻辑代码
+ */
+@Data
+@ToString
+@ApiModel(value="AdminCompany对象", description="云平台公司配置表")
+public class AdminCompanyBO {
+
+    @ApiModelProperty(value = "企业名称",required = true,example = "良心企业")
+    @NotEmpty
+    private String companyName;
+
+    @ApiModelProperty(value = "企业LOGO", example = "/logo")
+    private String companyLogo;
+
+    private String endTime;
+
+    private Integer endDay;
+}

+ 15 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeleteByBatchIdBO.java

@@ -0,0 +1,15 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AdminDeleteByBatchIdBO {
+
+    private String batchId;
+
+    @ApiModelProperty("1 附件 2 图片")
+    private Integer type;
+}

+ 33 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeptBO.java

@@ -0,0 +1,33 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+/**
+ * @author zhangzhiwei
+ */
+@Data
+@ToString
+@ApiModel(value="部门编辑对象", description="部门对象")
+public class AdminDeptBO {
+
+    @ApiModelProperty(value = "部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "上级部门ID,0为最上级")
+    @NotNull
+    private Integer pid;
+
+    @ApiModelProperty(value = "部门名称")
+    @NotNull
+    @Size(max = 20)
+    private String name;
+
+    @ApiModelProperty(value = "部门负责人")
+    private Long ownerUserId;
+}

+ 22 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminDeptQueryBO.java

@@ -0,0 +1,22 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiParam;
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * @author zhangzhiwei
+ */
+@Data
+@ToString
+@ApiModel(value="部门编辑对象", description="部门对象")
+public class AdminDeptQueryBO {
+
+    @ApiParam(name = "id", value = "父级ID", required = true, example = "0")
+    private Integer id;
+
+    @ApiModelProperty(value = "类型")
+    private String type;
+}

+ 24 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminInitDataBO.java

@@ -0,0 +1,24 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author JiaS
+ * @date 2020/11/17
+ */
+@Data
+public class AdminInitDataBO {
+
+    @ApiModelProperty("密码")
+    private String password;
+
+    @ApiModelProperty("临时码")
+    private String temporaryCode;
+
+    @ApiModelProperty("模块")
+    private List<String> modules;
+
+}

+ 24 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminLanguagePackBO.java

@@ -0,0 +1,24 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.core.entity.PageEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @author zmj
+ * 语言包服务
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
+public class AdminLanguagePackBO extends PageEntity {
+
+    @ApiModelProperty(value = "语言包ID")
+    private Integer languagePackId;
+
+    @ApiModelProperty("语言包名称")
+    private String languagePackName;
+
+}

+ 23 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminMessageQueryBO.java

@@ -0,0 +1,23 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.core.entity.PageEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("消息列表查询对象")
+public class AdminMessageQueryBO extends PageEntity {
+
+    @ApiModelProperty("是否已读")
+    private Integer isRead;
+
+    @ApiModelProperty("label")
+    private Integer label;
+
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    @ApiModelProperty("type")
+    private Integer type;
+}

+ 24 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminRoleBO.java

@@ -0,0 +1,24 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author JiaS
+ * @date 2020/11/21
+ */
+@Data
+public class AdminRoleBO {
+
+    @ApiModelProperty("人员id列表")
+    private List<Long> userIds;
+
+    @ApiModelProperty("部门id列表")
+    private List<Integer> deptIds;
+
+    @ApiModelProperty("权限id列表")
+    private List<Integer> roleIds;
+
+}

+ 51 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminUserBO.java

@@ -0,0 +1,51 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.core.entity.PageEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author zhangzhiwe
+ * 用户列表业务对象
+ */
+@Data
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@ApiModel("用户列表查询")
+public class AdminUserBO extends PageEntity {
+
+    @ApiModelProperty(value = "类型", required = true, allowableValues = "0,1,2,3,4", example = "0")
+    private Integer label;
+
+    @ApiModelProperty("昵称")
+    private String realname;
+
+    @ApiModelProperty("昵称")
+    private Integer status;
+
+    @ApiModelProperty("角色ID")
+    private Integer roleId;
+
+    @ApiModelProperty("部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty("部门ID列表")
+    private List<Integer> deptIdList = new ArrayList<>();
+
+
+    @ApiModelProperty(value = "用户列表")
+    private List<Long> userIdList;
+
+    private Long deptOwnerUserId;
+
+    private Long userId;
+
+    @ApiModelProperty(value = "是否展示子级部门 0不需要 1 需要")
+    private Integer isNeedChild;
+}

+ 28 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/AdminUserStatusBO.java

@@ -0,0 +1,28 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+/**
+ * @author zhangzhiwe
+ * 用户状态修改
+ */
+@Data
+@ToString
+@ApiModel("用户状态修改BO")
+public class AdminUserStatusBO {
+
+    @ApiModelProperty("ids")
+    private List<Long> ids;
+
+    @ApiModelProperty("状态")
+    private Integer status;
+
+    @ApiModelProperty("密码")
+    private String password;
+
+}

+ 15 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/DeptUserListByHrmBO.java

@@ -0,0 +1,15 @@
+package com.kakarote.admin.entity.BO;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class DeptUserListByHrmBO {
+
+    private List<Long> userIdList;
+
+    private List<Integer> deptIdList;
+}

+ 17 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/DeptUserListVO.java

@@ -0,0 +1,17 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.admin.entity.VO.HrmSimpleUserVO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class DeptUserListVO {
+
+
+    private List<DeptVO> deptList;
+
+    private List<HrmSimpleUserVO> userList;
+}

+ 32 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/DeptVO.java

@@ -0,0 +1,32 @@
+package com.kakarote.admin.entity.BO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class DeptVO {
+
+
+    @ApiModelProperty(value = "部门id")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "父级ID 顶级部门为0")
+    private Integer pid;
+
+    @ApiModelProperty(value = "部门名称")
+    private String name;
+
+    @ApiModelProperty("当前部门在职人数")
+    private Integer currentNum;
+
+    @ApiModelProperty("在职人数")
+    private Integer allNum;
+
+    @ApiModelProperty("是否有下级部门 0 否 1 是")
+    private Integer hasChildren;
+
+    @ApiModelProperty(value = "部门负责人")
+    private Long ownerUserId;
+
+}

+ 29 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/HrmAddUserBO.java

@@ -0,0 +1,29 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class HrmAddUserBO {
+
+    @ApiModelProperty(value = "密码")
+    private String password;
+
+    @ApiModelProperty(value = "部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty("角色id")
+    private String roleId;
+
+    @ApiModelProperty(value = "上级ID")
+    private Long parentId;
+
+    @ApiModelProperty("员工id")
+    private List<Integer> employeeIds;
+
+
+}

+ 29 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/LogWelcomeSpeechBO.java

@@ -0,0 +1,29 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+/**
+ * @author zhangzhiwei
+ * 模块设置VO
+ */
+@ToString
+@Data
+@ApiModel("日志欢迎语对象")
+public class LogWelcomeSpeechBO {
+
+    @ApiModelProperty(value = "设置ID", required = true)
+    @NotNull
+    private Integer settingId;
+
+    @ApiModelProperty(value = "日志欢迎语", required = true)
+    @NotNull
+    @Size(max = 100)
+    private String value;
+
+}

+ 34 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/ModuleSettingBO.java

@@ -0,0 +1,34 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author zhangzhiwei
+ * 模块设置VO
+ */
+@ToString
+@Data
+@ApiModel("应用管理设置")
+public class ModuleSettingBO {
+
+    @ApiModelProperty(value = "设置ID", required = true)
+    @NotNull
+    private Integer settingId;
+
+    @ApiModelProperty(value = "状态 1:启用 0:停用", required = true,allowableValues = "0,1")
+    @NotNull(message = "状态不能为空")
+    @Max(1)
+    @Min(0)
+    private Integer status;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+}

+ 31 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/QuerySysLogBO.java

@@ -0,0 +1,31 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.core.entity.PageEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class QuerySysLogBO extends PageEntity {
+
+    @ApiModelProperty("开始时间")
+    private String startTime;
+
+    @ApiModelProperty("结束时间")
+    private String endTime;
+
+    @ApiModelProperty("模块 [admin crm oa work hrm jxc]")
+    private String model;
+
+    @ApiModelProperty("子模块")
+    private List<Integer> subModelLabels;
+
+    @ApiModelProperty("用户id")
+    private List<Long> userIds;
+
+    @ApiModelProperty("类型 1 数据操作日志 2 系统操作日志")
+    private Integer type;
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/RenameFileBO.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class RenameFileBO {
+
+    @ApiModelProperty(value = "附件id")
+    private Long fileId;
+
+    @ApiModelProperty(value = "附件名称")
+    private String name;
+}

+ 27 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/SystemUserBO.java

@@ -0,0 +1,27 @@
+package com.kakarote.admin.entity.BO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 初始话用户BO
+ */
+@Data
+public class SystemUserBO implements Serializable {
+
+    @ApiModelProperty("用户名")
+    @NotNull
+    private String username;
+
+    @ApiModelProperty("凭证")
+    @NotNull
+    private String code;
+
+    @ApiModelProperty("密码")
+    @NotNull
+    private String password;
+}
+

+ 30 - 0
admin/src/main/java/com/kakarote/admin/entity/BO/UserBookBO.java

@@ -0,0 +1,30 @@
+package com.kakarote.admin.entity.BO;
+
+import com.kakarote.core.entity.PageEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author wyq
+ */
+@Data
+@ApiModel("通讯录查询")
+public class UserBookBO extends PageEntity {
+
+    @ApiModelProperty("搜索关键字")
+    private String search;
+
+    @ApiModelProperty("排列顺序 2倒序 其他是正序")
+    private Integer initial;
+
+    @ApiModelProperty("部门id")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "关注状态,0未关注,1已关注")
+    private Integer status;
+
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+}

+ 39 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminAttention.java

@@ -0,0 +1,39 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 通讯录用户关注表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_attention")
+@ApiModel(value="AdminAttention对象", description="通讯录用户关注表")
+public class AdminAttention implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "attention_id", type = IdType.AUTO)
+    private Integer attentionId;
+
+    @ApiModelProperty(value = "被关注人")
+    private Long beUserId;
+
+    @ApiModelProperty(value = "关注人")
+    private Long attentionUserId;
+}

+ 48 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminConfig.java

@@ -0,0 +1,48 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 客户规则
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_config")
+@ApiModel(value="AdminConfig对象", description="客户规则")
+public class AdminConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "setting_id", type = IdType.AUTO)
+    private Integer settingId;
+
+    @ApiModelProperty(value = "状态,0:不启用 1 : 启用")
+    private Integer status;
+
+    @ApiModelProperty(value = "设置名称")
+    private String name;
+
+    @ApiModelProperty(value = "值")
+    private String value;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+
+
+}

+ 55 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminDept.java

@@ -0,0 +1,55 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 部门表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_dept")
+@ApiModel(value="AdminDept对象", description="部门表")
+public class AdminDept implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "dept_id", type = IdType.AUTO)
+    private Integer deptId;
+
+    @ApiModelProperty(value = "父级ID 顶级部门为0")
+    private Integer pid;
+
+    @ApiModelProperty(value = "部门名称")
+    private String name;
+
+    @ApiModelProperty(value = "排序 越大越靠后")
+    private Integer num;
+
+    @ApiModelProperty(value = "部门备注")
+    private String remark;
+
+    @ApiModelProperty(value = "部门负责人")
+    private Long ownerUserId;
+
+    @ApiModelProperty("当前部门在职人数")
+    @TableField(exist = false)
+    private Integer currentNum;
+
+
+}

+ 67 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminFile.java

@@ -0,0 +1,67 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 附件表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_file")
+@ApiModel(value="AdminFile对象", description="附件表")
+public class AdminFile implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "file_id", type = IdType.ASSIGN_ID)
+    private Long fileId;
+
+    @ApiModelProperty(value = "附件名称")
+    private String name;
+
+    @ApiModelProperty(value = "附件大小(字节)")
+    private Long size;
+
+    @ApiModelProperty(value = "创建人ID")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "文件真实路径")
+    private String path;
+
+    @ApiModelProperty(value = "文件类型,file,img")
+    private String fileType;
+
+    @ApiModelProperty(value = "1 本地 2 阿里云oss")
+    private Integer type;
+
+    @ApiModelProperty(value = "来源 0 默认 1 admin 2 crm 3 work 4 oa 5 进销存 6 hrm")
+    private Integer source;
+
+    @ApiModelProperty(value = "1 公有访问 0 私有访问")
+    private Integer isPublic;
+
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+
+
+
+}

+ 51 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminLanguagePack.java

@@ -0,0 +1,51 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 语言包表
+ * </p>
+ *
+ * @author zmj
+ * @since 2020-12-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_language_pack")
+@ApiModel(value="AdminLanguagePack对象", description="语言包表")
+public class AdminLanguagePack implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty(value = "语言包id")
+    @TableId(value = "language_pack_id", type = IdType.AUTO)
+    private Integer languagePackId;
+
+    @ApiModelProperty(value = "语言包名称")
+    private String languagePackName;
+
+    @ApiModelProperty(value = "语言包内容")
+    private String languagePackContext;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人ID")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date updateTime;
+}

+ 78 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminMenu.java

@@ -0,0 +1,78 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 后台菜单表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@Accessors(chain = true)
+@TableName("wk_admin_menu")
+@ApiModel(value="AdminMenu对象", description="后台菜单表")
+public class AdminMenu implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty(value = "菜单ID")
+    @TableId(value = "menu_id", type = IdType.AUTO)
+    private Integer menuId;
+
+    @ApiModelProperty(value = "上级菜单ID")
+    private Integer parentId;
+
+    @ApiModelProperty(value = "菜单名称")
+    private String menuName;
+
+    @ApiModelProperty(value = "权限标识")
+    private String realm;
+
+    @ApiModelProperty(value = "权限URL")
+    private String realmUrl;
+
+    @ApiModelProperty(value = "所属模块")
+    private String realmModule;
+
+    @ApiModelProperty(value = "菜单类型  1目录 2 菜单 3 按钮 4特殊")
+    private Integer menuType;
+
+    @ApiModelProperty(value = "排序(同级有效)")
+    private Integer sort;
+
+    @ApiModelProperty(value = "状态 1 启用 0 禁用")
+    private Integer status;
+
+    @ApiModelProperty(value = "菜单说明")
+    private String remarks;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "数据权限")
+    private Integer dataType;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        AdminMenu adminMenu = (AdminMenu) o;
+        return Objects.equals(menuId, adminMenu.menuId);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(menuId);
+    }
+}

+ 76 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminMessage.java

@@ -0,0 +1,76 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统消息表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_message")
+@ApiModel(value="AdminMessage对象", description="系统消息表")
+public class AdminMessage implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty(value = "消息ID")
+    @TableId(value = "message_id", type = IdType.AUTO)
+    private Long messageId;
+
+    @ApiModelProperty(value = "消息标题")
+    private String title;
+
+    @ApiModelProperty(value = "内容")
+    private String content;
+
+    @ApiModelProperty(value = "消息大类 1 任务 2 日志 3 oa审批 4公告 5 日程 6 crm消息")
+    private Integer label;
+
+    @ApiModelProperty(value = "消息类型 详见AdminMessageEnum")
+    private Integer type;
+
+    @ApiModelProperty(value = "关联ID")
+    private Integer typeId;
+
+    @ApiModelProperty(value = "消息创建者 0为系统")
+    private Long createUser;
+
+    @ApiModelProperty(value = "接收人")
+    private Long recipientUser;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "是否已读 0 未读 1 已读")
+    private Integer isRead;
+
+    @ApiModelProperty(value = "已读时间")
+    private Date readTime;
+    @ApiModelProperty(value = "valid")
+    @TableField(exist = false)
+    private Integer valid;
+
+    @ApiModelProperty(value = "昵称")
+    @TableField(exist = false)
+    private String realname;
+
+    public AdminMessage() {
+        /* 构造message对象时,默认未读,解决批量保存错误问题 */
+        this.isRead = 0;
+    }
+}

+ 51 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminModelSort.java

@@ -0,0 +1,51 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 客户管理导航栏排序表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_model_sort")
+@ApiModel(value="AdminModelSort对象", description="客户管理导航栏排序表")
+public class AdminModelSort implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "导航类型 1头部导航 2客户管理左侧导航")
+    private Integer type;
+
+    @ApiModelProperty(value = "模块  1仪表盘 2待办事项 3线索 4客户 5联系人 6商机 7合同 8回款 9发票 10回访 11产品 12市场活动")
+    private String model;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @ApiModelProperty(value = "是否隐藏  0不隐藏 1隐藏")
+    private Integer isHidden;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+
+
+}

+ 59 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminOfficialImg.java

@@ -0,0 +1,59 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 官网图片
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_official_img")
+@ApiModel(value="AdminOfficialImg对象", description="官网图片")
+public class AdminOfficialImg implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "official_img_id", type = IdType.AUTO)
+    private Integer officialImgId;
+
+    @ApiModelProperty(value = "附件大小(字节)")
+    private Long size;
+
+    @ApiModelProperty(value = "创建人ID")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "文件真实路径")
+    private String path;
+
+    @ApiModelProperty(value = "文件路径")
+    private String filePath;
+
+    @ApiModelProperty(value = "1.官网设置 2.名片海报")
+    private Integer type;
+
+    private String name;
+
+    @ApiModelProperty(value = "0")
+    private Integer tactic;
+
+
+}

+ 68 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminRole.java

@@ -0,0 +1,68 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 角色表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_role")
+@ApiModel(value="AdminRole对象", description="角色表")
+public class AdminRole implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "role_id", type = IdType.AUTO)
+    private Integer roleId;
+
+    @ApiModelProperty(value = "名称")
+    private String roleName;
+
+    @ApiModelProperty(value = "0、自定义角色1、管理角色 2、客户管理角色 3、人事角色 4、财务角色 5、项目角色 8、项目自定义角色")
+    private Integer roleType;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "1 启用 0 禁用")
+    private Integer status;
+
+    @ApiModelProperty(value = "数据权限 1、本人,2、本人及下属,3、本部门,4、本部门及下属部门,5、全部 ")
+    private Integer dataType;
+
+    @ApiModelProperty(value = "0 隐藏 1 不隐藏")
+    private Integer isHidden;
+
+    @ApiModelProperty(value = "1 系统项目管理员角色 2 项目管理角色 3 项目编辑角色 4 项目只读角色")
+    private Integer label;
+
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "菜单列表")
+    private Map<String,List<Integer>> rules;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "菜单id列表")
+    private List<Integer> menuIds = new ArrayList<>();
+
+}

+ 45 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminRoleAuth.java

@@ -0,0 +1,45 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 角色表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2021-04-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_role_auth")
+@ApiModel(value="AdminRoleAuth对象", description="角色表")
+public class AdminRoleAuth implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "角色ID")
+    private Integer roleId;
+
+    @ApiModelProperty(value = "菜单ID")
+    private Integer menuId;
+
+    @ApiModelProperty(value = "能查询的角色ID")
+    private Integer authRoleId;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 42 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminRoleMenu.java

@@ -0,0 +1,42 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 角色菜单对应关系表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_role_menu")
+@ApiModel(value="AdminRoleMenu对象", description="角色菜单对应关系表")
+public class AdminRoleMenu implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "角色ID")
+    private Integer roleId;
+
+    @ApiModelProperty(value = "菜单ID")
+    private Integer menuId;
+
+
+
+}

+ 55 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminSystemLog.java

@@ -0,0 +1,55 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统日志表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_system_log")
+@ApiModel(value="AdminSystemLog对象", description="系统日志表")
+public class AdminSystemLog implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "操作人id")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer createUserId;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "IP地址")
+    private String ipAddress;
+
+    @ApiModelProperty(value = "模块 1企业首页 2应用管理 3员工和部门管理 4名片小程序管理 5角色权限管理 6审批流(合同/回款) 7审批流(办公) 8项目管理 9客户管理 10系统日志管理 11其他设置")
+    private Integer types;
+
+    @ApiModelProperty(value = "行为")
+    private Integer behavior;
+
+    @ApiModelProperty(value = "操作对象")
+    private String object;
+
+    @ApiModelProperty(value = "操作详情")
+    private String detail;
+}

+ 95 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminUser.java

@@ -0,0 +1,95 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 用户表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_user")
+@ApiModel(value="AdminUser对象", description="用户表")
+public class AdminUser implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "user_id", type = IdType.AUTO)
+    private Long userId;
+
+    @ApiModelProperty(value = "用户名")
+    private String username;
+
+    @ApiModelProperty(value = "密码")
+    private String password;
+
+    @ApiModelProperty(value = "安全符")
+    private String salt;
+
+    @ApiModelProperty(value = "头像")
+    private String img;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realname;
+
+    @ApiModelProperty(value = "员工编号")
+    private String num;
+
+    @ApiModelProperty(value = "手机号")
+    private String mobile;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "0 未选择 1 男 2 女 ")
+    private Integer sex;
+
+    @ApiModelProperty(value = "部门")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "部门名称")
+    @TableField(exist = false)
+    private String deptName;
+
+    @ApiModelProperty(value = "岗位")
+    private String post;
+
+    @ApiModelProperty(value = "状态,0禁用,1正常,2未激活")
+    private Integer status;
+
+    @ApiModelProperty(value = "直属上级ID")
+    private Long parentId;
+
+    @ApiModelProperty(value = "最后登录时间")
+    private Date lastLoginTime;
+
+    @ApiModelProperty(value = "最后登录IP 注意兼容IPV6")
+    private String lastLoginIp;
+
+
+    @TableField(exist = false)
+    private String companyName;
+
+    @ApiModelProperty("是否删除 0 未删除 1 已删除")
+    private Integer isDel;
+
+
+}

+ 54 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserConfig.java

@@ -0,0 +1,54 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 用户配置表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@TableName("wk_admin_user_config")
+@ApiModel(value="AdminUserConfig对象", description="用户配置表")
+public class AdminUserConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "setting_id", type = IdType.AUTO)
+    private Integer settingId;
+
+    private Long userId;
+
+    @ApiModelProperty(value = "状态,0:不启用 1 : 启用")
+    private Integer status;
+
+    @ApiModelProperty(value = "设置名称")
+    private String name;
+
+    @ApiModelProperty(value = "值")
+    private String value;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+
+
+}

+ 44 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserHisTable.java

@@ -0,0 +1,44 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 授权坐席
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_user_his_table")
+@ApiModel(value="AdminUserHisTable对象", description="授权坐席")
+public class AdminUserHisTable implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "his_table_id", type = IdType.AUTO)
+    private Integer hisTableId;
+
+    private Long userId;
+
+    @ApiModelProperty(value = "0 没有 1 有")
+    private Integer hisTable;
+
+
+    @ApiModelProperty(value = "1.坐席授权 2.设置默认名片 3.关联员工")
+    private Integer type;
+
+
+}

+ 42 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/AdminUserRole.java

@@ -0,0 +1,42 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 用户角色对应关系表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_user_role")
+@ApiModel(value="AdminUserRole对象", description="用户角色对应关系表")
+public class AdminUserRole implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+    @ApiModelProperty(value = "角色ID")
+    private Integer roleId;
+
+
+
+}

+ 65 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/LoginLog.java

@@ -0,0 +1,65 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统登录日志表
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_admin_login_log")
+@ApiModel(value="AdminLoginLog对象", description="系统登录日志表")
+public class LoginLog implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "操作人id")
+    @TableField(fill = FieldFill.INSERT)
+    private Long userId;
+
+    @ApiModelProperty(value = "操作人")
+    private String realname;
+
+    @ApiModelProperty(value = "登录时间")
+    private Date loginTime;
+
+    @ApiModelProperty(value = "登录ip地址")
+    private String ipAddress;
+
+    @ApiModelProperty(value = "登录地点")
+    private String loginAddress;
+
+    @ApiModelProperty(value = "设备类型")
+    private String deviceType;
+
+    @ApiModelProperty(value = "终端内核")
+    private String core;
+
+    @ApiModelProperty(value = "平台")
+    private String platform;
+
+    @ApiModelProperty(value = "认证结果 1成功 2失败")
+    private Integer authResult;
+
+    @ApiModelProperty(value = "失败结果")
+    private String failResult;
+
+
+}

+ 76 - 0
admin/src/main/java/com/kakarote/admin/entity/PO/SysLog.java

@@ -0,0 +1,76 @@
+package com.kakarote.admin.entity.PO;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统日志
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-11-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("wk_sys_log")
+@ApiModel(value="SysLog对象", description="系统日志")
+public class SysLog implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    @JsonIgnore
+    private Long id;
+
+    @ApiModelProperty(value = "类名")
+    private String className;
+
+    @ApiModelProperty(value = "方法名")
+    private String methodName;
+
+    @ApiModelProperty(value = "参数")
+    private String args;
+
+    @ApiModelProperty(value = "模块名称")
+    private String model;
+
+    @ApiModelProperty(value = "子模块名称(线索,客户。。。)")
+    private Integer subModelLabel;
+
+    @ApiModelProperty(value = "子模块名称(线索,客户。。。)")
+    private String subModel;
+
+    @ApiModelProperty(value = "对象")
+    private String object;
+
+    @ApiModelProperty(value = "行为")
+    private String behavior;
+
+    @ApiModelProperty(value = "操作详情")
+    private String detail;
+
+    @ApiModelProperty(value = "ip地址")
+    private String ipAddress;
+
+    private Long userId;
+
+    @ApiModelProperty(value = "操作人名称")
+    private String realname;
+
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 70 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminDeptVO.java

@@ -0,0 +1,70 @@
+package com.kakarote.admin.entity.VO;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+/**
+ * @author zhangzhiwei
+ */
+@Data
+@ToString
+@ApiModel(value="部门查询对象", description="部门对象")
+public class AdminDeptVO {
+
+    @ApiModelProperty(value = "部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "部门ID2")
+    private Integer id;
+
+    @ApiModelProperty(value = "上级部门ID,0为最上级")
+    private Integer pid;
+
+    @ApiModelProperty(value = "部门名称")
+    private String name;
+
+    @ApiModelProperty(value = "部门label")
+    private String label;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+        this.label = name;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public Integer getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Integer deptId) {
+        this.deptId = deptId;
+        this.id = deptId;
+    }
+
+    @ApiModelProperty(value = "部门负责人")
+    private Long ownerUserId;
+
+    @ApiModelProperty(value = "下级部门列表")
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List<AdminDeptVO> children;
+
+
+    @ApiModelProperty("当前部门在职人数")
+    private Integer currentNum;
+}

+ 42 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminLanguagePackVO.java

@@ -0,0 +1,42 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 语言包表
+ * </p>
+ *
+ * @author zmj
+ * @since 2020-12-02
+ */
+@Data
+@ToString
+@ApiModel("语言包列表查询返回")
+public class AdminLanguagePackVO implements Serializable {
+
+
+    @ApiModelProperty(value = "语言包id")
+    private Integer languagePackId;
+
+    @ApiModelProperty(value = "语言包名称")
+    private String languagePackName;
+
+    @ApiModelProperty(value = "创建人ID")
+    private Long createUserId;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "默认语言,0,否,1,是")
+    private Integer defaultLanguage = 0;
+}

+ 42 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminMenuVO.java

@@ -0,0 +1,42 @@
+package com.kakarote.admin.entity.VO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+/**
+ * @author zhangzhiwei
+ * 菜单相关VO
+ */
+@Data
+@ToString
+@ApiModel("角色列表返回")
+public class AdminMenuVO {
+    @ApiModelProperty(value = "菜单ID")
+    @TableId(value = "menu_id", type = IdType.AUTO)
+    private Integer menuId;
+
+    @ApiModelProperty(value = "上级菜单ID")
+    private Integer parentId;
+
+    @ApiModelProperty(value = "菜单名称")
+    private String menuName;
+
+    @ApiModelProperty(value = "权限标识")
+    private String realm;
+
+    @ApiModelProperty(value = "菜单类型  1目录 2 菜单 3 按钮 4特殊")
+    private Integer menuType;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "子菜单")
+    private List<AdminMenuVO> childMenu;
+
+}

+ 42 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminMessageVO.java

@@ -0,0 +1,42 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@ApiModel("消息数量VO")
+@AllArgsConstructor
+@NoArgsConstructor
+public class AdminMessageVO {
+
+    @ApiModelProperty("全部数量")
+    private Integer allCount;
+
+    @ApiModelProperty("公告数量")
+    private Integer announceCount;
+
+    @ApiModelProperty("审批数量")
+    private Integer examineCount;
+
+    @ApiModelProperty("任务数量")
+    private Integer taskCount;
+
+    @ApiModelProperty("日志数量")
+    private Integer logCount;
+
+    @ApiModelProperty("CRM数量")
+    private Integer crmCount;
+
+    @ApiModelProperty("日程数量")
+    private Integer eventCount;
+
+    @ApiModelProperty("知识库通知数量")
+    private Integer knowledgeCount;
+    @ApiModelProperty("HRM通知数量")
+    private Integer hrmCount;
+    @ApiModelProperty("进销存通知数量")
+    private Integer jxcCount;
+}

+ 28 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminRoleVO.java

@@ -0,0 +1,28 @@
+package com.kakarote.admin.entity.VO;
+
+import com.kakarote.admin.entity.PO.AdminRole;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+/**
+ * @author zhangzhiwei
+ * 查询角色功能
+ */
+@Data
+@ToString
+@ApiModel("查询角色功能")
+public class AdminRoleVO {
+
+    @ApiModelProperty("pid")
+    private Integer pid;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("角色列表")
+    private List<AdminRole> list;
+}

+ 15 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminSuperUserVo.java

@@ -0,0 +1,15 @@
+package com.kakarote.admin.entity.VO;
+
+import com.alibaba.fastjson.JSONObject;
+
+public class AdminSuperUserVo extends AdminUserVO {
+    private JSONObject serverUserInfo;
+
+    public JSONObject getServerUserInfo() {
+        return serverUserInfo;
+    }
+
+    public void setServerUserInfo(JSONObject serverUserInfo) {
+        this.serverUserInfo = serverUserInfo;
+    }
+}

+ 84 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/AdminUserVO.java

@@ -0,0 +1,84 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.Date;
+
+/**
+ * @author zhangzhiwei
+ * 查询列表
+ */
+@Data
+@ToString
+@ApiModel("用户列表查询返回")
+public class AdminUserVO {
+
+    @ApiModelProperty("姓名")
+    private String realname;
+
+    @ApiModelProperty("用户名")
+    private String username;
+
+    @ApiModelProperty(value = "用户ID", required = true)
+    private Long userId;
+
+    @ApiModelProperty(value = "性别,0 未选择 1、男 2、女", required = true, allowableValues = "0,1,2")
+    private Integer sex;
+
+    @ApiModelProperty(value = "手机号")
+    private String mobile;
+
+    @ApiModelProperty(value = "密码")
+    private String password;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "部门名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "状态,0禁用,1正常,2未激活")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "岗位")
+    private String post;
+
+    @ApiModelProperty(value = "上级ID")
+    private Long parentId;
+
+    @ApiModelProperty(value = "上级名称")
+    private String parentName;
+
+    @ApiModelProperty(value = "角色ID")
+    private String roleId;
+
+    @ApiModelProperty(value = "角色ID")
+    private String roleIds;
+
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    @ApiModelProperty(value = "用户头像")
+    private String img;
+
+    @ApiModelProperty(value = "是否超级管理员")
+    private Boolean isAdmin;
+
+    private Integer isReadNotice;
+
+    private Integer emailId;
+
+    @ApiModelProperty("用户标识,0 主账号 1 部门负责人 2 普通用户")
+    private Integer userIdentity = 2;
+
+    private Integer hisTable;
+}

+ 31 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/CloudConfigVO.java

@@ -0,0 +1,31 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * @author zhangzhiwei
+ * 云平台账号配置
+ */
+@ToString
+@Data
+@ApiModel("云平台账号配置")
+public class CloudConfigVO {
+
+    @ApiModelProperty("开始时间")
+    private String startTime;
+
+    @ApiModelProperty("结束时间")
+    private String endTime;
+
+    @ApiModelProperty("可用人数")
+    private Integer allNum;
+
+    @ApiModelProperty("创建时间")
+    private String createTime;
+
+    @ApiModelProperty("已使用人数")
+    private Integer usingNum;
+}

+ 25 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/CpSignatureVO.java

@@ -0,0 +1,25 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class CpSignatureVO {
+
+    @ApiModelProperty("随机字符串")
+    private String noncestr;
+
+    @ApiModelProperty("时间戳")
+    private Long timestamp;
+
+    @ApiModelProperty("签名")
+    private String signature;
+
+    @ApiModelProperty("企业id")
+    private String corpid;
+
+    private Long agentId;
+
+}

+ 36 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/HrmSimpleUserVO.java

@@ -0,0 +1,36 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author zhangzhiwei
+ * 简单的用户对象
+ */
+@Data
+@ApiModel("用户对象")
+public class HrmSimpleUserVO implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    @ApiModelProperty("头像")
+    private String img;
+
+    @ApiModelProperty("昵称")
+    private String realname;
+
+    @ApiModelProperty("岗位")
+    private String post;
+
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ApiModelProperty("性别")
+    private Integer sex;
+}

+ 31 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/ModuleSettingVO.java

@@ -0,0 +1,31 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * @author zhangzhiwei
+ * 模块设置VO
+ */
+@ToString
+@Data
+@ApiModel("应用管理设置")
+public class ModuleSettingVO {
+
+    @ApiModelProperty(value = "设置ID", required = true)
+    private Integer settingId;
+
+    @ApiModelProperty(value = "模块", required = true)
+    private String module;
+
+    @ApiModelProperty(value = "状态 1:启用 0:停用", required = true,allowableValues = "0,1")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型 1:普通应用 2:增值应用 3:未发布应用", required = true,allowableValues = "1,2,3")
+    private String type;
+
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+}

+ 70 - 0
admin/src/main/java/com/kakarote/admin/entity/VO/UserBookVO.java

@@ -0,0 +1,70 @@
+package com.kakarote.admin.entity.VO;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author zhangzhiwei
+ */
+@Data
+public class UserBookVO implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @ApiModelProperty("姓名")
+    private String realname;
+
+    @ApiModelProperty("头像")
+    private String img;
+
+    @ApiModelProperty("用户名")
+    private String username;
+
+    @ApiModelProperty(value = "用户ID", required = true)
+    private Long userId;
+
+    @ApiModelProperty(value = "性别,0 未选择 1、男 2、女", required = true, allowableValues = "0,1,2")
+    private Integer sex;
+
+    @ApiModelProperty(value = "手机号")
+    private String mobile;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "部门ID")
+    private Integer deptId;
+
+    @ApiModelProperty(value = "部门名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "关注状态,0未关注,1已关注")
+    private Integer status;
+
+    @ApiModelProperty(value = "状态,0禁用,1正常,2未激活")
+    private Integer userStatus;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "岗位")
+    private String post;
+
+    @ApiModelProperty(value = "上级ID")
+    private Long parentId;
+
+    @ApiModelProperty(value = "上级名称")
+    private String parentName;
+
+    @ApiModelProperty(value = "角色ID")
+    private String roleId;
+
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    @ApiModelProperty("首字母")
+    private String initial;
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminAttentionMapper.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminAttention;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 通讯录用户关注表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminAttentionMapper extends BaseMapper<AdminAttention> {
+
+}

+ 17 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminConfigMapper.java

@@ -0,0 +1,17 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminConfig;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 客户规则 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+
+public interface AdminConfigMapper extends BaseMapper<AdminConfig> {
+
+}

+ 22 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminDeptMapper.java

@@ -0,0 +1,22 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.BO.DeptVO;
+import com.kakarote.admin.entity.PO.AdminDept;
+import com.kakarote.core.servlet.BaseMapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 部门表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminDeptMapper extends BaseMapper<AdminDept> {
+
+    List<DeptVO> queryDeptUserList();
+
+    List<AdminDept> queryDeptList();
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminFileMapper.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminFile;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 附件表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminFileMapper extends BaseMapper<AdminFile> {
+
+}

+ 24 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminLanguagePackMapper.java

@@ -0,0 +1,24 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminLanguagePack;
+import com.kakarote.admin.entity.VO.AdminLanguagePackVO;
+import com.kakarote.core.entity.BasePage;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 语言包表 Mapper 接口
+ * </p>
+ *
+ * @author zmj
+ * @since 2020-12-02
+ */
+public interface AdminLanguagePackMapper extends BaseMapper<AdminLanguagePack> {
+
+    /**
+     * 查询用户列表
+     * @param page 分页参数
+     * @return data
+     */
+    BasePage<AdminLanguagePackVO> queryLanguagePackList(BasePage<AdminLanguagePackVO> page);
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminLoginLogMapper.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.LoginLog;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 系统登录日志表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminLoginLogMapper extends BaseMapper<LoginLog> {
+
+}

+ 37 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminMenuMapper.java

@@ -0,0 +1,37 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminMenu;
+import com.kakarote.core.servlet.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 后台菜单表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminMenuMapper extends BaseMapper<AdminMenu> {
+
+    /**
+     * 查询菜单列表
+     *
+     * @param userId 用户ID
+     * @return menus
+     */
+    public List<AdminMenu> queryMenuList(Long userId);
+
+    /**
+     * 查询公海菜单权限
+     * @param userId 用户ID
+     * @param deptId 部门ID
+     * @return data
+     */
+    public Map<String, Long> queryPoolReadAuth(@Param("userId") Long userId, @Param("deptId") Integer deptId);
+
+    Integer queryMenuId(@Param("realm1") String realm1,@Param("realm2") String realm2,@Param("realm3") String realm3);
+}

+ 22 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminMessageMapper.java

@@ -0,0 +1,22 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.BO.AdminMessageQueryBO;
+import com.kakarote.admin.entity.PO.AdminMessage;
+import com.kakarote.admin.entity.VO.AdminMessageVO;
+import com.kakarote.core.entity.BasePage;
+import com.kakarote.core.servlet.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 系统消息表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminMessageMapper extends BaseMapper<AdminMessage> {
+    public BasePage<AdminMessage> queryList(BasePage<AdminMessage> parse, @Param("data") AdminMessageQueryBO adminMessageBO);
+
+    public AdminMessageVO queryUnreadCount(@Param("userId") Long userId);
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminModelSortMapper.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminModelSort;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 客户管理导航栏排序表 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminModelSortMapper extends BaseMapper<AdminModelSort> {
+
+}

+ 16 - 0
admin/src/main/java/com/kakarote/admin/mapper/AdminOfficialImgMapper.java

@@ -0,0 +1,16 @@
+package com.kakarote.admin.mapper;
+
+import com.kakarote.admin.entity.PO.AdminOfficialImg;
+import com.kakarote.core.servlet.BaseMapper;
+
+/**
+ * <p>
+ * 官网图片 Mapper 接口
+ * </p>
+ *
+ * @author zhangzhiwei
+ * @since 2020-04-27
+ */
+public interface AdminOfficialImgMapper extends BaseMapper<AdminOfficialImg> {
+
+}

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