From 7b059e9abaaea204523fc85c67f237bfa51f3f82 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期三, 25 九月 2024 10:20:07 +0800 Subject: [PATCH] 修改 --- src/com/table/badbatt/BadBatt_thread.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/table/badbatt/BadBatt_thread.java b/src/com/table/badbatt/BadBatt_thread.java index ad38d3c..174db83 100644 --- a/src/com/table/badbatt/BadBatt_thread.java +++ b/src/com/table/badbatt/BadBatt_thread.java @@ -256,6 +256,7 @@ while(rs.next()){ BattInf binf=new BattInf(); binf.setBattGroupId(rs.getInt("battGroupId")); + binf.setStationId(rs.getString("StationId")); binf.setStationName1(rs.getString("stationName1")); binf.setStationName(rs.getString("stationName")); binf.setBattProducer(rs.getString("battProducer")); @@ -379,7 +380,7 @@ MySqlPool.makeManualCommit(m_ConnPool.getConn(), sql_str); } //计算出落后单体 - public List calculatorBadBatt(int battGroupId,double monCapStd,double monVolStd,double maxVol,List<Batttestdatastop> stopList,MySqlPool m_ConnPool) { + public List calculatorBadBatt(int battGroupId,int monCount,double monCapStd,double monVolStd,double maxVol,List<Batttestdatastop> stopList,MySqlPool m_ConnPool) { //查询告警落后和更换的参数值 float aparam=1; int Caplevel=1; @@ -437,6 +438,7 @@ BattInf binf=new BattInf(); binf.setBattGroupId(battGroupId); binf.setMonCapStd((float) monCapStd); + binf.setMonCount(monCount); insertUnjudge(binf,"2",4,m_ConnPool); } try { @@ -468,6 +470,7 @@ + " values "; for(int i=0;i<badList.size();i++){ BadbattMon badMon=badList.get(i); + //System.out.println(badMon.toString()); if(i>0){ insertbadbatt_monSql+=" , "; }else { @@ -503,9 +506,11 @@ //3.计算每个单体的实际容量并判断是否为告警或更换或优秀(1,2,3) List<Batttestdatastop> stopList=Batt_selectBadSql(binf.getBattGroupId(), tinf.getTest_record_count(),tinf.getRecord_num(),BadBatt_thread.sdf.format(tinf.getRecord_time()), m_ConnPool ); //计算出落后单体 - List<BadbattMon> badList=calculatorBadBatt(binf.getBattGroupId(),binf.getMonCapStd(),binf.getMonVolStd(),tinf.getMax_monvol(),stopList,m_ConnPool); + List<BadbattMon> badList=calculatorBadBatt(binf.getBattGroupId(),binf.getMonCount(),binf.getMonCapStd(),binf.getMonVolStd(),tinf.getMax_monvol(),stopList,m_ConnPool); //4.将数据插入badBattMon表 - insertBadBatt(badList,m_ConnPool); + if(badList.size()>0) { + insertBadBatt(badList,m_ConnPool); + } }else { //标记为无法判断:flag为4并插入 insertUnjudge(binf,"0",4,m_ConnPool); -- Gitblit v1.9.1