修改db_user.tb_user_inf表中face_id默认值为1引发的bug
| | |
| | | " `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`)" + |
| | |
| | | + " 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" |
| | |
| | | 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'"); |
| | |
| | | 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'"); |