蓄电池监控管理平台数据库初始化程序
Administrator
2023-05-12 9defd4f260aad3da7ccb45a4b508de1e6b804784
修改db_user.tb_user_inf表中face_id默认值为1引发的bug
2个文件已修改
8 ■■■■ 已修改文件
BattMonitor_DB_Builder/bin/com/database_util/DB_db_user.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/src/com/database_util/DB_db_user.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_DB_Builder/bin/com/database_util/DB_db_user.class
Binary files differ
BattMonitor_DB_Builder/src/com/database_util/DB_db_user.java
@@ -1277,7 +1277,7 @@
                "  `uPubKeyX` varchar(200) NOT NULL DEFAULT ''," + 
                "  `uPubKeyY` varchar(200) NOT NULL DEFAULT ''," + 
                "  `uKey_ID` varchar(200) NOT NULL DEFAULT ''," + 
                "  `face_id` int(5) NOT NULL DEFAULT '1'," +
                "  `face_id` int(5) DEFAULT NULL," +
                "  `license` text DEFAULT NULL," + 
                "  PRIMARY KEY (`uId`)," + 
                "  UNIQUE KEY `user_id` (`uId`)" + 
@@ -1342,7 +1342,7 @@
                    + " AND column_name='face_id'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.TB_UserInf 
                                + " ADD COLUMN `face_id` int(5) NOT NULL DEFAULT '1'");
                                + " ADD COLUMN `face_id` int(5) DEFAULT NULL;");
            }
            //添加license
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
@@ -1508,7 +1508,7 @@
                    int count = res.getInt("num_count");
                    if(count<1) {
                        //默认没有添加用户信息时添加'admin'
                        sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1001', '" + upstr + "', 'admin', 'admin', 'employeeid', '12345678912', '12345678912', 'abcde@mail.com', '', '1980-01-01', '2015-12-09', '男', '广东省', 'protitle', 'authority', '默认班组', 'duties', 'tasks', '1', 'note', '"+upstr+"', '', '', '48505834353130373639353153594E4F', '28', '0','0','0','1','1',null,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"','2022-05-19 14:53:44','2022-05-19 14:53:44',null,'00:00:01~23:59:59','*');");
                        sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1001', '" + upstr + "', 'admin', 'admin', 'employeeid', '12345678912', '12345678912', 'abcde@mail.com', '', '1980-01-01', '2015-12-09', '男', '广东省', 'protitle', 'authority', '默认班组', 'duties', 'tasks', '1', 'note', '"+upstr+"', '', '', '48505834353130373639353153594E4F', NULL, '0','0','0','1','1',null,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"','2022-05-19 14:53:44','2022-05-19 14:53:44',null,'00:00:01~23:59:59','*');");
                    }else {
                        //修复前期添加默认账号时添加成了临时账号
                        sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.UserInfTable + " SET type = 1,expiration_time = null,lock_time = null,visit_time='00:00:00~23:59:59',visit_ip = '*' WHERE uName = 'admin'");
@@ -1520,7 +1520,7 @@
                    int count = res.getInt("num_count");
                    if(count<1) {
                        //默认没有添加用户信息时添加'superuser'
                        sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1002', '" + upstr + "', 'superuser', '1234567', '100010000', '12345678', '15346259512', '123456789@qq.com', '', '1990-04-20', '2016-03-28', '男', '湖北省', '软件工程师', 'authority111', '默认班组', 'dutie', '完成软件的研发工作', '0', 'note', '"+upstr+"', '', '', '14031C0F0136063E', '27', '0','0','0','1','1',null,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"','2022-05-19 14:53:44','2022-05-19 14:53:44',null,'00:00:01~23:59:59','*');");
                        sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1002', '" + upstr + "', 'superuser', '1234567', '100010000', '12345678', '15346259512', '123456789@qq.com', '', '1990-04-20', '2016-03-28', '男', '湖北省', '软件工程师', 'authority111', '默认班组', 'dutie', '完成软件的研发工作', '0', 'note', '"+upstr+"', '', '', '14031C0F0136063E', NULL, '0','0','0','1','1',null,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"','2022-05-19 14:53:44','2022-05-19 14:53:44',null,'00:00:01~23:59:59','*');");
                    }else {
                        //修复前期添加默认账号时添加成了临时账号
                        sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.UserInfTable + " SET type = 1,expiration_time = null,lock_time = null,visit_time='00:00:00~23:59:59',visit_ip = '*' WHERE uName = 'superuser'");