V1.102 2024-12-09
1.修复电源告警恢复后无法自动恢复
2.修复设备通信故障后,实时数据还会一直更新
| | |
| | | public class main_PowerDev_IEC61850 {
|
| | |
|
| | | public final static boolean app_debug = false;
|
| | | public final static double m_VersionNum = 1.101;
|
| | | public final static double m_VersionNum = 1.102;
|
| | | public final static String m_Version = "Welcome To Use Monitor_PowerDev_IEC61850 V"
|
| | | + m_VersionNum + " RC_20201216";
|
| | |
|
| | |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | ResultSet res = null;
|
| | | try {
|
| | | System.err.println(sql_str);
|
| | | //System.err.println(sql_str);
|
| | | res = sql.sqlMysqlQuery(sql_str);
|
| | | while(res.next()) {
|
| | | PwrDeviceAlarm_Data alm = new PwrDeviceAlarm_Data(res.getInt("alm_type"));
|
| | |
| | | boolean commerr = false;
|
| | | int comErrTimeLong = 0;
|
| | | if(rtpd.GetPwrDeviceCommErrState() == true) {
|
| | | comErrTimeLong = (int)(((new Date().getTime()) - rtpd.commRecordTime.getTime())/1000);
|
| | | |
| | | comErrTimeLong = (int)(((new Date().getTime()) - rtpd.commRecordTime_rec.getTime())/1000);
|
| | | //System.out.println("数据更新时间:" + Com.getDateTimeFormat(rtpd.commRecordTime_rec, Com.DTF_YMDhms));
|
| | | if(comErrTimeLong > PwrDeviceAlarm_Data.COMM_ERR_TIME_INTERVAL) {
|
| | | commerr = true;
|
| | | }
|
| | |
| | | String sql_str2 = " INSERT INTO " + Sql_Mysql.TB_PWRDEV_ALARM_HISTORY+"(record_id,PowerDeviceId,alm_type,alm_level,alm_start_time,alm_end_time,alm_value,alm_is_confirmed,alm_confirmed_time,alm_cleared_type,alm_trigger,alm_severity) (SELECT record_id,PowerDeviceId,alm_type,alm_level,alm_start_time,alm_end_time,alm_value,alm_is_confirmed,alm_confirmed_time,alm_cleared_type,alm_trigger,alm_severity from "+Sql_Mysql.TB_PWRDEV_ALARM+" WHERE PowerDeviceId = " + alm.pwrdev_id + " and alm_type = " + alm.alm_type + " and alm_cleared_type = " + PwrDeviceAlarm_Data.ALM_CLEARED_TYPE_HIST + ")";
|
| | |
|
| | | //将实时告警表中的非实时告警删除
|
| | | String sql_str3 = " DELETE FROM " + Sql_Mysql.TB_PWRDEV_ALARM +" WHERE PowerDeviceId = "+ alm.pwrdev_id + " and alm_type = " + alm.alm_type + " and alm_cleared_type = " + PwrDeviceAlarm_Data.ALM_CLEARED_TYPE_HIST + ")";
|
| | | String sql_str3 = " DELETE FROM " + Sql_Mysql.TB_PWRDEV_ALARM +" WHERE PowerDeviceId = "+ alm.pwrdev_id + " and alm_type = " + alm.alm_type + " and alm_cleared_type = " + PwrDeviceAlarm_Data.ALM_CLEARED_TYPE_HIST;
|
| | |
|
| | | //sql_strs.add(sql_str1);
|
| | | sql_strs.add(sql_str2);
|
| | | sql_strs.add(sql_str3);
|
| | | //System.out.println(sql_str2);
|
| | | //System.out.println(sql_str3);
|
| | | sql.makeManualCommit(sql_strs);
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | {
|
| | | String sql_str = "UPDATE " + Sql_Mysql.PWRDEV_ACDCDATA_TABLE
|
| | | + " SET "
|
| | | + " record_datetime='" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms) + "',"
|
| | | /**
|
| | | * 注释清空数据库实时数据会导致界面错误判断
|
| | | */
|
| | | //+ " record_datetime='" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms) + "',"
|
| | | + " acIn1_volA=" + rtdata.m_acdcData.acIn1_volA + ","
|
| | | + " acIn1_volB=" + rtdata.m_acdcData.acIn1_volB + ","
|
| | | + " acIn1_volC=" + rtdata.m_acdcData.acIn1_volC + ","
|
| | |
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | logger.error(e.toString(), e);
|
| | | exe_res = false;
|
| | | } finally {
|
| | | try {
|
| | |
| | | mysql_con.setAutoCommit(true);
|
| | | } catch (SQLException e1) {
|
| | | // TODO Auto-generated catch block
|
| | | e1.printStackTrace();
|
| | | logger.error(e1.toString(), e1);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 山西太原 电源通信程序
|
| | |
|
| | | V1.102 2024-12-09 |
| | | 1.修复电源告警恢复后无法自动恢复
|
| | | 2.修复设备通信故障后,实时数据还会一直更新
|
| | |
|
| | | V1.101 2023-09-08
|
| | | 1.电源历史告警新增按照年来分表记录,便于电源历史告警查询
|
| | | 2.分表中创建时间超过3年的分表会被删除
|