新疆锂电通信程序,兼容【常规BTS,老版本并联BTS;假负载BTS,逆变BTS】
Administrator
2023-09-07 e3a15d361c798e84a4d8886f6d7a8d2143f8be73
修改更新
6个文件已修改
109 ■■■■ 已修改文件
BattMonitor_FBS9100S_ForXinJiang/bin/com/battmonitor/sql/Sql_Mysql.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/bin/com/batttest/BattResStorePro_Thread.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/bin/main/main_MonitorServer_FBS9100S.class 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/src/com/battmonitor/sql/Sql_Mysql.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/src/com/batttest/BattResStorePro_Thread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/src/main/main_MonitorServer_FBS9100S.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_ForXinJiang/bin/com/battmonitor/sql/Sql_Mysql.class
Binary files differ
BattMonitor_FBS9100S_ForXinJiang/bin/com/batttest/BattResStorePro_Thread.class
Binary files differ
BattMonitor_FBS9100S_ForXinJiang/bin/main/main_MonitorServer_FBS9100S.class
Binary files differ
BattMonitor_FBS9100S_ForXinJiang/src/com/battmonitor/sql/Sql_Mysql.java
@@ -7,6 +7,8 @@
import org.apache.logging.log4j.Logger;
import com.battmonitor.data.BattData_RT;
/**
 *     创建数据库以及表格
 * @author 军
@@ -900,4 +902,64 @@
        
        return count;
    }
    public static void initMySQLDB(MysqlConnPool gB_MysqlConnPool) {
        createBattTestDataInf_Table(gB_MysqlConnPool);
    }
    /**
     * 创建tb_batt_rtdata表并且根据集合bd_al,向表中添加电池组id和mon_num 值
     * @param conn_pool
     * @param bd_al
     */
    public static void createBattTestDataInf_Table(MysqlConnPool conn_pool)
    {
        String sql_str1 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattTestDataInf_Table + " "
                        + "( `num` bigint(20) NOT NULL AUTO_INCREMENT," +
                        "  `BattGroupId` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_record_count` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_record_count_ex` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_type` int(11) NOT NULL DEFAULT '0'," +
                        "  `record_time_interval` int(11) NOT NULL DEFAULT '0'," +
                        "  `data_new` tinyint(1) NOT NULL DEFAULT '0'," +
                        "  `data_available` tinyint(1) NOT NULL DEFAULT '0'," +
                        "  `record_num` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_starttime` datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," +
                        "  `test_starttime_ex` datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," +
                        "  `test_starttype` int(11) NOT NULL DEFAULT '0'," +
                        "  `record_time` datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," +
                        "  `test_timelong` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_stoptype` int(11) NOT NULL DEFAULT '0'," +
                        "  `group_vol` float NOT NULL DEFAULT '0'," +
                        "  `test_curr` float NOT NULL DEFAULT '0'," +
                        "  `test_cap` float NOT NULL DEFAULT '0'," +
                        "  `max_monnum` int(11) NOT NULL DEFAULT '0'," +
                        "  `max_monvol` float NOT NULL DEFAULT '0'," +
                        "  `min_monnum` int(11) NOT NULL DEFAULT '0'," +
                        "  `min_monvol` float NOT NULL DEFAULT '0'," +
                        "  `mon_num` int(11) NOT NULL DEFAULT '0'," +
                        "  `mon_vol` float NOT NULL DEFAULT '0'," +
                        "  `upload_usr_id` int(11) NOT NULL DEFAULT '0'," +
                        "  `upload_data_ext` int(11) NOT NULL DEFAULT '0'," +
                        "  `upload_client_type` int(11) NOT NULL DEFAULT '0'," +
                        "  `test_datatype` int(11) NOT NULL DEFAULT '0' COMMENT '山西61850监测放电数据标识【0:监测放电;1停电放电】'," +
                        "  PRIMARY KEY (`num`)," +
                        "  KEY `index_battgroup_id` (`BattGroupId`)," +
                        "  KEY `index_test_record_count` (`test_record_count`)," +
                        "  KEY `index_test_starttime` (`test_starttime`)," +
                        "  KEY `idx_tb_batttestdata_inf_upload_client_type` (`upload_client_type`)" +
                        ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
        try {
            sql.sqlMysqlExecute(sql_str1);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
}
BattMonitor_FBS9100S_ForXinJiang/src/com/batttest/BattResStorePro_Thread.java
@@ -472,7 +472,7 @@
                "  KEY `index_battgroup_id` (`BattGroupId`)," + 
                "  KEY `index_test_record_count` (`test_record_count`)," + 
                "  KEY `index_test_starttime` (`test_starttime`)" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=67792 DEFAULT CHARSET=utf8;";
                ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        try {
            sql.sqlMysqlExecute(sql_str);
        } catch (SQLException e) {
BattMonitor_FBS9100S_ForXinJiang/src/main/main_MonitorServer_FBS9100S.java
@@ -1,4 +1,6 @@
package main;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.TimeZone;
import org.apache.logging.log4j.LogManager;
@@ -75,20 +77,39 @@
        
        logger.info("正在连接数据库 DBserver IP:" + m_AppConfig.getMysqlServerIp() + ", port: " + MysqlServer_Port);
        
        //初始化连接池中的各种参数信息
        GB_MysqlConnPool = new MysqlConnPool(m_AppConfig.getMysqlServerIp(), MysqlServer_Port,
                                                m_AppConfig.getMysqlConnCountMax());
        Sql_Mysql sql_ck = new Sql_Mysql(GB_MysqlConnPool.getConn());
        try {
            if(null != sql_ck.mysql_con) {
                logger.info("成功连接数据库"
                            + " DBserver IP:" + m_AppConfig.getMysqlServerIp()
                            + ", port: " + MysqlServer_Port);
        Connection conn = null;
        do {
            //初始化连接池中的各种参数信息
            GB_MysqlConnPool = new MysqlConnPool(m_AppConfig.getMysqlServerIp(), MysqlServer_Port,
                    m_AppConfig.getMysqlConnCountMax());
            conn = GB_MysqlConnPool.getMysqlConn();
            if(null == conn) {
                logger.info("GB_MysqlConnPool connect to sql server timeout, continue...");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    logger.error(e.toString(), e);
                }
            } else {
                logger.info("GB_MysqlConnPool connect to sql server Successs ... ");
                break;
            }
        } finally {
            sql_ck.close_con();
        } while (true);
        try {
            if(null != conn) {
                conn.close();
            }
        } catch (SQLException e) {
            logger.error(e.toString(), e);
        }
        logger.info("/****************************************************************/");
        Sql_Mysql.initMySQLDB(GB_MysqlConnPool);
        logger.info("/****************************************************************/");
        /*
        try {