commit 5e83bae822f351b135926c0ff0ecf841a9e35874
Author: review512jwy@163.com <“review512jwy@163.com”>
Date: Tue Oct 21 10:30:37 2025 +0800
初始化
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d63dd99
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+/target/
+/logs/
+/.idea/
+*.iml
+*.bak
+*.log
+/.settings/
+*.project
+*.classpath
+*.factorypath
+*.springBeans
+/.apt_generated/
+/.externalToolBuilders/
+/bin/
+/dongjian-dashboard-back-controller/tmp/
+application-*.properties
diff --git a/document/cmd b/document/cmd
new file mode 100644
index 0000000..09a4d33
--- /dev/null
+++ b/document/cmd
@@ -0,0 +1,31 @@
+aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com
+
+docker tag 67f91fc6cfbf 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
+
+docker push 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
+
+docker pull 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
+
+docker run -d -p 8887:20008 -v /home/data-center-business/back/application.properties:/home/data-center-business/config/application.properties 381659385655.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business
+
+aws configure
+
+docker run -e apiEnable=false -e datasourceDNS=tokyo-building-db.caetvgb7diak.ap-northeast-1.rds.amazonaws.com -e datasourceTimeZone=Asia/Tokyo -e datasourceUsername=techsor -e datasourcePassword=Abc#123456xyz -e loggingLevel=ERROR -e loggingPath=/home/data-center-business/log -e loggingAppender=SYSLOG -e redisHost=replication-group-tokyo-build.ncvpel.ng.0001.apne1.cache.amazonaws.com -e redisPassword= -e awsAccesskey=AKIA5OFH5OOZHM3U3KX4 -e awsSecretkey=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 -e awsBucket=tokyo-build-databucket-381659385655 -e ibatisLoggingLog=ERROR -e ibatisLoggingLogFactory=ERROR -d -p 20008:20008 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
+
+阿里云
+docker tag e1fe6f58961e registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest
+
+docker push registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest
+
+docker pull registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server:latest
+
+docker exec -it 3c77bb84d338 /bin/bash
+
+docker run -d -p 20008:20015 -v /home/application.properties:/home/dongjian-dashboard-back/config/application.properties registry.cn-shanghai.aliyuncs.com/test-data-business/data-business-server
+
+测试环境
+aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com
+
+docker tag ecee6b583d3c 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
+
+docker push 923770123186.dkr.ecr.ap-northeast-1.amazonaws.com/tokyo-build-business:latest
diff --git a/document/db/20240508.sql b/document/db/20240508.sql
new file mode 100644
index 0000000..3b87a30
--- /dev/null
+++ b/document/db/20240508.sql
@@ -0,0 +1,85 @@
+USE `data_center_new`;
+
+DROP procedure IF EXISTS `add_column`;
+
+DELIMITER $$
+
+CREATE PROCEDURE add_column()
+
+BEGIN
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'aurora_flag'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `aurora_flag` int DEFAULT '0' COMMENT '0-未创建,1-创建中,2-创建成功,3-创建失败';
+ END IF;
+
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'aurora_url'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `aurora_url` varchar(255) DEFAULT NULL;
+ END IF;
+
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'aurora_username'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `aurora_username` varchar(255) DEFAULT NULL;
+ END IF;
+
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'aurora_password'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `aurora_password` varchar(255) DEFAULT NULL;
+ END IF;
+
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'redis_db_id'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `redis_db_id` int DEFAULT NULL COMMENT '使用的redis库id';
+ END IF;
+
+ IF NOT EXISTS (
+ SELECT *
+ FROM information_schema.columns
+ WHERE table_schema = 'data_center_new'
+ AND table_name = 'basic_company'
+ AND column_name = 'bearer_token'
+ ) THEN
+ ALTER TABLE basic_company
+ ADD COLUMN `bearer_token` text;
+ END IF;
+
+ update basic_company set aurora_flag = 2 where aurora_url is not null;
+
+END$$
+
+DELIMITER ;
+
+
+CALL add_column();
+
+DROP procedure IF EXISTS `add_column`;
\ No newline at end of file
diff --git a/document/db/20240515.sql b/document/db/20240515.sql
new file mode 100644
index 0000000..d731e2a
--- /dev/null
+++ b/document/db/20240515.sql
@@ -0,0 +1,62 @@
+USE `data_center_new`;
+
+/*Table structure for table `basic_menu` */
+
+DROP TABLE IF EXISTS `basic_menu`;
+
+CREATE TABLE `basic_menu` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `parent_menu_id` bigint DEFAULT NULL,
+ `menu_name` varchar(100) DEFAULT NULL,
+ `menu_name_en` varchar(100) DEFAULT NULL,
+ `menu_name_jp` varchar(100) DEFAULT NULL,
+ `remark` varchar(100) DEFAULT NULL,
+ `menu_level` int DEFAULT '1' COMMENT '菜单级别',
+ `flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
+ `create_time` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Data for the table `basic_menu` */
+
+insert into `basic_menu`(`id`,`parent_menu_id`,`menu_name`,`menu_name_en`,`menu_name_jp`,`remark`,`menu_level`,`flag`,`create_time`) values (1,-1,'项目管理','项目管理','プロジェクト管理','项目管理',1,0,1659079777164),(2,-1,'楼宇模块','楼宇模块','ビルモジュール','楼宇模块',1,0,1659079777164),(3,-1,'设备模块','设备模块','設備モジュール','设备模块',1,0,1659079777164),(4,-1,'转发管理','转发管理','転送管理','转发管理',1,0,1659079777164),(5,-1,'数据来源管理','数据来源管理','データ源管理','数据来源管理',1,0,1659079777164),(6,1,'添加','添加','追加','项目管理-添加',2,0,1659079777164),(7,1,'编辑','编辑','編集','项目管理-编辑',2,0,1659079777164),(8,1,'删除','删除','削除','项目管理-删除',2,0,1659079777164),(9,1,'批量添加','批量添加','大量に追加','项目管理-批量添加',2,0,1659079777164),(10,2,'楼宇管理','楼宇管理','ビル管理','楼宇管理',2,0,1659079777164),(11,2,'楼层管理','楼层管理','フロア管理','楼层管理',2,0,1659079777164),(12,2,'房间管理','房间管理','部屋管理','房间管理',2,0,1659079777164),(13,2,'资产管理','资产管理','資産管理','资产管理',2,0,1659079777164),(14,10,'添加','添加','追加','楼宇管理-添加',3,0,1659079777164),(15,10,'编辑','编辑','編集','楼宇管理-编辑',3,0,1659079777164),(16,10,'删除','删除','削除','楼宇管理-删除',3,0,1659079777164),(17,11,'添加','添加','追加','楼层管理-添加',3,0,1659079777164),(18,11,'编辑','编辑','編集','楼层管理-编辑',3,0,1659079777164),(19,11,'删除','删除','削除','楼层管理-删除',3,0,1659079777164),(20,12,'添加','添加','追加','房间管理-添加',3,0,1659079777164),(21,12,'编辑','编辑','編集','房间管理-编辑',3,0,1659079777164),(22,12,'删除','删除','削除','房间管理-删除',3,0,1659079777164),(23,13,'添加','添加','追加','资产管理-添加',3,0,1659079777164),(24,13,'编辑','编辑','編集','资产管理-编辑',3,0,1659079777164),(25,13,'删除','删除','削除','资产管理-删除',3,0,1659079777164),(26,3,'设备管理','设备管理','設備管理','设备管理',2,0,1659079777164),(27,26,'添加','添加','追加','设备管理-添加',3,0,1659079777164),(28,26,'编辑','编辑','編集','设备管理-编辑',3,0,1659079777164),(29,26,'删除','删除','削除','设备管理-删除',3,0,1659079777164),(30,26,'批量添加','批量添加','大量に追加','设备管理-批量添加',3,0,1659079777164),(31,26,'批量删除','批量删除','一括削除','设备管理-批量删除',3,0,1659079777164),(32,3,'设备类别管理','设备类别管理','設備の種類管理','设备类别管理',2,0,1659079777164),(33,32,'添加','添加','追加','设备类别管理-添加',3,0,1659079777164),(34,32,'编辑','编辑','編集','设备类别管理-编辑',3,0,1659079777164),(35,32,'删除','删除','削除','设备类别管理-删除',3,0,1659079777164),(36,4,'添加','添加','追加','转发管理-添加',3,0,1659079777164),(37,4,'编辑','编辑','編集','转发管理-编辑',3,0,1659079777164),(38,4,'删除','删除','削除','转发管理-删除',3,0,1659079777164),(39,5,'添加','添加','追加','数据来源管理-添加',3,0,1659079777164),(40,5,'编辑','编辑','編集','数据来源管理-编辑',3,0,1659079777164),(41,5,'删除','删除','削除','数据来源管理-删除',3,0,1659079777164),(42,26,'设置告警模板','设置告警模板','アラームテンプレートの設定','设备管理-设置告警模板',3,0,1659079777164);
+
+
+/*Table structure for table `basic_role` */
+
+DROP TABLE IF EXISTS `basic_role`;
+
+CREATE TABLE `basic_role` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `company_id` bigint DEFAULT NULL,
+ `role_name` varchar(100) DEFAULT NULL,
+ `description` varchar(500) DEFAULT NULL,
+ `flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL,
+ `modifier_id` bigint DEFAULT NULL,
+ `modify_time` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `basic_role_menu_relation` */
+
+DROP TABLE IF EXISTS `basic_role_menu_relation`;
+
+CREATE TABLE `basic_role_menu_relation` (
+ `role_id` bigint DEFAULT NULL,
+ `menu_id` bigint DEFAULT NULL,
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `basic_role_user_relation` */
+
+DROP TABLE IF EXISTS `basic_role_user_relation`;
+
+CREATE TABLE `basic_role_user_relation` (
+ `user_id` bigint DEFAULT NULL,
+ `role_id` bigint DEFAULT NULL,
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
diff --git a/document/db/init.sql b/document/db/init.sql
new file mode 100644
index 0000000..b1cf338
--- /dev/null
+++ b/document/db/init.sql
@@ -0,0 +1,161 @@
+/*
+SQLyog 企业版 - MySQL GUI v8.14
+MySQL - 8.0.28 : Database - data_center_new
+*********************************************************************
+*/
+
+
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_new` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
+
+USE `data_center_new`;
+
+/*Table structure for table `basic_company` */
+
+DROP TABLE IF EXISTS `basic_company`;
+
+CREATE TABLE `basic_company` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `parent_id` bigint DEFAULT NULL,
+ `company_name` varchar(500) DEFAULT NULL,
+ `mfa_switch` int DEFAULT '0' COMMENT '谷歌mfa服务开关。0-关闭,1-开启',
+ `flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
+ `create_time` bigint DEFAULT NULL,
+ `modify_time` bigint DEFAULT NULL,
+ `apikey` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Data for the table `basic_company` */
+
+insert into `basic_company`(`id`,`parent_id`,`company_name`,`mfa_switch`,`flag`,`create_time`,`modify_time`) values (1,-1,'MiniSolution',0,0,1658978002231,1658978002231);
+
+/*Table structure for table `basic_menu` */
+
+DROP TABLE IF EXISTS `basic_menu`;
+
+CREATE TABLE `basic_menu` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `parent_menu_id` bigint DEFAULT NULL,
+ `menu_name` varchar(100) DEFAULT NULL,
+ `menu_name_en` varchar(100) DEFAULT NULL,
+ `menu_name_jp` varchar(100) DEFAULT NULL,
+ `remark` varchar(100) DEFAULT NULL,
+ `menu_level` int DEFAULT '1' COMMENT '菜单级别',
+ `flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
+ `create_time` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Data for the table `basic_menu` */
+
+insert into `basic_menu`(`id`,`parent_menu_id`,`menu_name`,`menu_name_en`,`menu_name_jp`,`remark`,`menu_level`,`flag`,`create_time`) values (1,-1,'项目管理','项目管理','项目管理','项目管理',1,0,1659079777164),(2,-1,'楼宇模块','楼宇模块','楼宇模块','楼宇模块',1,0,1659079777164),(3,-1,'设备模块','设备模块','设备模块','设备模块',1,0,1659079777164),(4,-1,'转发管理','转发管理','转发管理','转发管理',1,0,1659079777164),(5,-1,'数据来源管理','数据来源管理','数据来源管理','数据来源管理',1,0,1659079777164),(6,1,'添加','添加','添加','项目管理-添加',2,0,1659079777164),(7,1,'编辑','编辑','编辑','项目管理-编辑',2,0,1659079777164),(8,1,'删除','删除','删除','项目管理-删除',2,0,1659079777164),(9,1,'批量添加','批量添加','批量添加','项目管理-批量添加',2,0,1659079777164),(10,2,'楼宇管理','楼宇管理','楼宇管理','楼宇管理',2,0,1659079777164),(11,2,'楼层管理','楼层管理','楼层管理','楼层管理',2,0,1659079777164),(12,2,'房间管理','房间管理','房间管理','房间管理',2,0,1659079777164),(13,2,'资产管理','资产管理','资产管理','资产管理',2,0,1659079777164),(14,10,'添加','添加','添加','楼宇管理-添加',3,0,1659079777164),(15,10,'编辑','编辑','编辑','楼宇管理-编辑',3,0,1659079777164),(16,10,'删除','删除','删除','楼宇管理-删除',3,0,1659079777164),(17,11,'添加','添加','添加','楼层管理-添加',3,0,1659079777164),(18,11,'编辑','编辑','编辑','楼层管理-编辑',3,0,1659079777164),(19,11,'删除','删除','删除','楼层管理-删除',3,0,1659079777164),(20,12,'添加','添加','添加','房间管理-添加',3,0,1659079777164),(21,12,'编辑','编辑','编辑','房间管理-编辑',3,0,1659079777164),(22,12,'删除','删除','删除','房间管理-删除',3,0,1659079777164),(23,13,'添加','添加','添加','资产管理-添加',3,0,1659079777164),(24,13,'编辑','编辑','编辑','资产管理-编辑',3,0,1659079777164),(25,13,'删除','删除','删除','资产管理-删除',3,0,1659079777164),(26,3,'设备管理','设备管理','设备管理','设备管理',2,0,1659079777164),(27,26,'添加','添加','添加','设备管理-添加',3,0,1659079777164),(28,26,'编辑','编辑','编辑','设备管理-编辑',3,0,1659079777164),(29,26,'删除','删除','删除','设备管理-删除',3,0,1659079777164),(30,26,'批量添加','批量添加','批量添加','设备管理-批量添加',3,0,1659079777164),(31,26,'批量删除','批量删除','批量删除','设备管理-批量删除',3,0,1659079777164),(32,3,'设备类别管理','设备类别管理','设备类别管理','设备类别管理',2,0,1659079777164),(33,32,'添加','添加','添加','设备类别管理-添加',3,0,1659079777164),(34,32,'编辑','编辑','编辑','设备类别管理-编辑',3,0,1659079777164),(35,32,'删除','删除','删除','设备类别管理-删除',3,0,1659079777164),(36,4,'添加','添加','添加','转发管理-添加',3,0,1659079777164),(37,4,'编辑','编辑','编辑','转发管理-编辑',3,0,1659079777164),(38,4,'删除','删除','删除','转发管理-删除',3,0,1659079777164),(39,5,'添加','添加','添加','数据来源管理-添加',3,0,1659079777164),(40,5,'编辑','编辑','编辑','数据来源管理-编辑',3,0,1659079777164),(41,5,'删除','删除','删除','数据来源管理-删除',3,0,1659079777164);
+
+/*Table structure for table `basic_role` */
+
+DROP TABLE IF EXISTS `basic_role`;
+
+CREATE TABLE `basic_role` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `company_id` bigint DEFAULT NULL,
+ `role_name` varchar(100) DEFAULT NULL,
+ `description` varchar(500) DEFAULT NULL,
+ `flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL,
+ `modifier_id` bigint DEFAULT NULL,
+ `modify_time` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `basic_role_menu_relation` */
+
+DROP TABLE IF EXISTS `basic_role_menu_relation`;
+
+CREATE TABLE `basic_role_menu_relation` (
+ `role_id` bigint DEFAULT NULL,
+ `menu_id` bigint DEFAULT NULL,
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `basic_role_user_relation` */
+
+DROP TABLE IF EXISTS `basic_role_user_relation`;
+
+CREATE TABLE `basic_role_user_relation` (
+ `user_id` bigint DEFAULT NULL,
+ `role_id` bigint DEFAULT NULL,
+ `creator_id` bigint DEFAULT NULL,
+ `create_time` bigint DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `basic_user` */
+
+DROP TABLE IF EXISTS `basic_user`;
+
+CREATE TABLE `basic_user` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `user_type` int DEFAULT '0' COMMENT '0-未知,1-管理平台用户,2-普通平台用户',
+ `company_id` bigint NOT NULL,
+ `username` varchar(255) DEFAULT NULL,
+ `login_name` varchar(255) DEFAULT NULL,
+ `password` varchar(255) DEFAULT NULL,
+ `password_modify_time` bigint DEFAULT NULL,
+ `salt` varchar(255) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `mobile_number` varchar(255) DEFAULT NULL,
+ `mfa_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
+ `mfa_bind` int DEFAULT '0' COMMENT '用户是否绑定了mfa设备。0-未绑定,1-已绑定',
+ `last_login_time` bigint DEFAULT NULL,
+ `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除',
+ `expire_time` bigint DEFAULT '4114487556000',
+ `create_time` bigint DEFAULT NULL,
+ `creator_id` bigint DEFAULT NULL,
+ `modify_time` bigint DEFAULT NULL,
+ `modifier_id` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Data for the table `basic_user` */
+
+insert into `basic_user`(`id`,`user_type`,`company_id`,`username`,`login_name`,`password`,`password_modify_time`,`salt`,`email`,`mobile_number`,`mfa_secret`,`mfa_bind`,`last_login_time`,`flag`,`expire_time`,`create_time`,`creator_id`,`modify_time`,`modifier_id`) values (1,1,1,'admin','admin','nVg+buw0YAs=',1670312031273,'09bc3a7898','1053492832@qq.com',NULL,NULL,0,1706177793183,0,4114487556000,4114487556000,NULL,1670312031273,NULL);
+
+/*Table structure for table `login_history` */
+
+DROP TABLE IF EXISTS `login_history`;
+
+CREATE TABLE `login_history` (
+ `id` bigint NOT NULL AUTO_INCREMENT,
+ `user_id` bigint DEFAULT NULL,
+ `request_ip` varchar(255) DEFAULT NULL,
+ `login_time` bigint DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+/*Table structure for table `worker_node` */
+
+DROP TABLE IF EXISTS `worker_node`;
+
+CREATE TABLE `worker_node` (
+ `ID` bigint NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
+ `HOST_NAME` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'host name',
+ `PORT` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'port',
+ `TYPE` int NOT NULL COMMENT 'node type: ACTUAL or CONTAINER',
+ `LAUNCH_DATE` date NOT NULL COMMENT 'launch date',
+ `MODIFIED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modified time',
+ `CREATED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='DB WorkerID Assigner for UID Generator';
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
diff --git a/document/start.sh b/document/start.sh
new file mode 100644
index 0000000..d5c9ca5
--- /dev/null
+++ b/document/start.sh
@@ -0,0 +1,30 @@
+#! /bin/sh
+#启动方法
+start(){
+now=`date "+%Y%m%d%H%M%S"`
+cd /home/dongjian-dashboard-back/back/server/run && nohup /usr/local/java/jdk1.8.0_221/bin/java -server -Xms256m -Xmx256m -jar /home/dongjian-dashboard-back/back/server/run/dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar > /dev/null 2>boot.log &
+}
+#停止方法
+stop(){
+ ps -ef|grep java|grep dongjian-dashboard-back-controller-0.0.1-SNAPSHOT.jar|awk '{print $2}'|while read pid
+ do
+ kill -9 $pid
+ done
+}
+
+case "$1" in
+start)
+start
+;;
+stop)
+stop
+;;
+restart)
+stop
+start
+;;
+*)
+printf 'Usage: %s {start|stop|restart}\n' "$prog"
+exit 1
+;;
+esac
\ No newline at end of file
diff --git a/document/update.sh b/document/update.sh
new file mode 100644
index 0000000..ef12fdd
--- /dev/null
+++ b/document/update.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+projectName=dongjian-dashboard-back
+backFilePath=/home/$projectName/back/server
+
+basepath=$(cd `dirname $0`; pwd)
+cd $basepath
+
+echo "start for Web"
+
+rm -rf $backFilePath/run/lib
+unzip -o $backFilePath/$projectName.zip -d $backFilePath/run
+\cp -r $backFilePath/run/$projectName/* $backFilePath/run/
+rm -rf $backFilePath/run/$projectName
+
+sh start.sh restart
+exit
\ No newline at end of file
diff --git a/dongjian-dashboard-back-common/.gitignore b/dongjian-dashboard-back-common/.gitignore
new file mode 100644
index 0000000..aa23915
--- /dev/null
+++ b/dongjian-dashboard-back-common/.gitignore
@@ -0,0 +1,15 @@
+/target/
+/logs/
+/.idea/
+*.iml
+*.bak
+*.log
+/.settings/
+*.project
+*.classpath
+*.factorypath
+*.springBeans
+/.apt_generated/
+/.externalToolBuilders/
+/bin/
+application-*.properties
diff --git a/dongjian-dashboard-back-common/pom.xml b/dongjian-dashboard-back-common/pom.xml
new file mode 100644
index 0000000..3826ebe
--- /dev/null
+++ b/dongjian-dashboard-back-common/pom.xml
@@ -0,0 +1,35 @@
+
+
+ 4.0.0
+
+ com.techsor
+ dongjian-dashboard-back
+ 0.0.1-SNAPSHOT
+
+ dongjian-dashboard-back-common
+ dongjian-dashboard-back-common
+ http://maven.apache.org
+
+ UTF-8
+
+
+
+ junit
+ junit
+ test
+
+
+
+ com.techsor
+ dongjian-dashboard-back-dao
+ 0.0.1-SNAPSHOT
+
+
+ com.techsor
+ dongjian-dashboard-back-util
+ 0.0.1-SNAPSHOT
+
+
+
+
diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java
new file mode 100644
index 0000000..0ce104e
--- /dev/null
+++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java
@@ -0,0 +1,54 @@
+package com.dongjian.dashboard.back.common;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+* @author Mr.Jiang
+* @time 2022年5月20日 下午2:01:41
+*/
+public class Constants {
+
+ //这个很重要,不要随便动
+ public static final String DES_SALT = "ci3b512jwy199511";
+
+ public static final String APP_NAME = "data-center-business:";
+
+ //用户ID,登录名,企业ID,token
+ public static final String ACCESS_TOKEN_FORMAT = "RequestHeader:AccessToken:{0}:{1}:{2}:{3}";
+
+ public static final String CAPTCHA_VERIFICATION = "CAPTCHA:VERIFICATION:";
+
+ public static final String DATASOURCE_PREFIX = "dataSourceForCompany_";
+
+ public static final String THIRD_DB_PREFIX = "data_center_dongjian_";
+
+ public static final int AURORA_IN_BATCH_SIZE = 1000;
+
+ // 定义大类常量
+ public static final int CATEGORY_ALARM = 1;//报警
+ public static final int CATEGORY_ACCUMULATE = 2;//累积
+ public static final int CATEGORY_MEASURE = 3;//计测
+ public static final int CATEGORY_STATUS= 4;//状态
+
+ // 所有设备类型ID的总集合
+ public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>();
+
+ // 定义分类与设备类型的映射
+ public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>();
+ static {
+ CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, Arrays.asList(46, 110));
+ CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, Arrays.asList(47, 111, 121));
+ CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, Arrays.asList(48, 112, 122));
+ CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, Arrays.asList(86, 113, 123));
+
+ // 收集所有的设备类型ID
+ for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) {
+ ALL_DEVICE_TYPE_IDS.addAll(ids);
+ }
+ }
+
+}
diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java
new file mode 100644
index 0000000..7e788d0
--- /dev/null
+++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java
@@ -0,0 +1,129 @@
+package com.dongjian.dashboard.back.common.config;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.dongjian.dashboard.back.common.Constants;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.jdbc.DataSourceBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.core.JdbcTemplate;
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
+
+@Configuration
+public class DataSourceAdminConfig {
+
+ private static Logger logger = LoggerFactory.getLogger(DataSourceAdminConfig.class);
+
+ @Value("${spring.datasource.admin.name}")
+ private String name;
+
+ @Value("${spring.datasource.admin.url}")
+ private String url;
+
+ @Value("${spring.datasource.admin.username}")
+ private String username;
+
+ @Value("${spring.datasource.admin.password}")
+ private String password;
+
+ @Value("${spring.datasource.admin.driverClassName}")
+ private String driverClassName;
+
+ @Value("${spring.datasource.admin.type}")
+ private String type;
+
+ @Value("${dynamic.jdbc.url}")
+ private String dynamicJdbcUrl;
+
+
+ private final static String THIRD_DB_PREFIX = Constants.THIRD_DB_PREFIX;
+
+ private final static String DATASOURCE_PREFIX = Constants.DATASOURCE_PREFIX;
+
+
+ @Primary
+ @Bean
+ public DataSource adminDatasource() {
+ DruidDataSource datasource = DataSourceBuilder.create()
+ .url(url)
+ .username(username)
+ .password(password).driverClassName(driverClassName)
+ .type(DruidDataSource.class)
+ .build();
+
+ return datasource;
+ }
+
+ @Bean
+ public JdbcTemplate jdbcTemplate(DataSource adminDatasource) {
+ return new JdbcTemplate(adminDatasource);
+ }
+
+ @Bean
+ @ConfigurationProperties(prefix = "mybatis.configuration")
+ public org.apache.ibatis.session.Configuration globalConfiguration() {
+ return new org.apache.ibatis.session.Configuration();
+ }
+
+ @Bean
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dynamicDataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+ sessionFactory.setDataSource(dynamicDataSource); // 设置为动态数据源
+ sessionFactory.setConfiguration(globalConfiguration());//驼峰设置mybatis.configuration.map-underscore-to-camel-case不生效处理
+ sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:mappers/**/*.xml")); // 设置Mapper XML文件的位置
+ return sessionFactory.getObject();
+ }
+
+ @Bean
+ public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+
+
+ @Bean
+ public DataSource dynamicDataSource(JdbcTemplate jdbcTemplate, DataSource adminDatasource) {
+ DynamicRouteDataSource dynamicDataSource = new DynamicRouteDataSource();
+ Map