From e6127f8fc2e32360366315e02668ed06483c31e6 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.7> Date: 星期一, 03 十二月 2018 16:16:32 +0800 Subject: [PATCH] 修改 --- gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java | 36 ++++ gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java | 15 + gx_tieta/src/com/fgkj/dao/BaseDAO.java | 2 gx_tieta/src/com/fgkj/services/App_bts_comm_taskService.java | 33 +++ gx_tieta/src/com/fgkj/dto/App_bts_comm_task.java | 181 ++++++++++++++++++++ gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java | 115 ++++++++++++ gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 40 ++- gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java | 37 +++ gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java | 28 +++ gx_tieta/src/com/fgkj/services/BattMap_informationService.java | 47 +++- gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java | 2 11 files changed, 504 insertions(+), 32 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java b/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java new file mode 100644 index 0000000..ec0e9aa --- /dev/null +++ b/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java @@ -0,0 +1,36 @@ +package com.fgkj.actions; + +import com.fgkj.dto.BattInf; +import com.fgkj.dto.ServiceModel; +import com.fgkj.dto.User_inf; +import com.fgkj.services.App_bts_comm_taskService; + + +public class App_bts_comm_taskAction extends ActionUtil{ + private App_bts_comm_taskService service = new App_bts_comm_taskService(); + private String json; + private String result; + + + + + //鏍规嵁鐪佸競鍖烘満鎴垮悕绉版煡璇� + public String serchByCondition(){ + BattInf binf=getGson("").fromJson(json, BattInf.class); + User_inf uinf=(User_inf) getUser(); + binf.setNum(uinf.getUId()); + ServiceModel model=service.serchByCondition(binf); + result=tojson(model); + return SUCCESS; + } + + public String getResult() { + return result; + } + public void setJson(String json) { + this.json = json; + } + + + +} diff --git a/gx_tieta/src/com/fgkj/dao/BaseDAO.java b/gx_tieta/src/com/fgkj/dao/BaseDAO.java index a5b20ea..e720d18 100644 --- a/gx_tieta/src/com/fgkj/dao/BaseDAO.java +++ b/gx_tieta/src/com/fgkj/dao/BaseDAO.java @@ -200,6 +200,8 @@ public static final int FBS9100_BATTPARAM=98; + public static final int APP_BTS_COMM_TASK=99; + public boolean add(Object obj); // 娣诲姞 public boolean update(Object obj); // 鏇存柊 diff --git a/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java b/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java index 9fba458..628b621 100644 --- a/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java +++ b/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java @@ -3,6 +3,7 @@ import com.fgkj.dao.impl.Alarm_paramImpl; import com.fgkj.dao.impl.AnnounceImpl; import com.fgkj.dao.impl.App_ParamImpl; +import com.fgkj.dao.impl.App_bts_comm_taskImpl; import com.fgkj.dao.impl.BadBatt_monImpl; import com.fgkj.dao.impl.BadBatt_mon_flagImpl; import com.fgkj.dao.impl.BattDischarge_paramImpl; @@ -206,6 +207,7 @@ case 96:return new Fbs9100_sysparamImpl(); case 97:return new Bts_gprs_stateImpl(); case 98:return new Fbs9100_battparamImpl(); + case 99:return new App_bts_comm_taskImpl(); default :return null; } } diff --git a/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java b/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java index 87071d6..2259cf5 100644 --- a/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java +++ b/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.List; +import com.fgkj.dao.impl.BattInfImpl; +import com.fgkj.dao.impl.Batt_rtstateDAOImpl; import com.fgkj.dto.BattInf; public class BattinfGroupFactory { @@ -102,5 +104,16 @@ } return list; } - + //鏌ヨ褰撳墠鏈�澶х殑鐢垫睜缁刬d + public static int searchMaxBattgroupId(){ + int BattgroupId_max=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d + int BattgroupId_next=BattgroupId_max+1; + return BattgroupId_next; + } + //鏌ヨ褰撳墠鏈�澶х殑stationid + public static int searchStationId(){ + int station_max=(new BattInfImpl()).searchMaxId();//褰撳墠鏈�澶х殑stationid + int station_next=station_max+1; + return station_next; + } } diff --git a/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java b/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java new file mode 100644 index 0000000..eca5a0d --- /dev/null +++ b/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java @@ -0,0 +1,115 @@ +package com.fgkj.dao.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import com.fgkj.dao.BaseDAO; +import com.fgkj.dao.CallBack; +import com.fgkj.dao.DAOHelper; +import com.fgkj.dao.LimitNumberFactory; +import com.fgkj.db.DBUtil; +import com.fgkj.dto.App_bts_comm_task; +import com.fgkj.dto.BattInf; +import com.fgkj.dto.Page; +import com.mysql.fabric.xmlrpc.base.Array; + +public class App_bts_comm_taskImpl implements BaseDAO,CallBack{ + + public List getResults(ResultSet rs) { + // TODO Auto-generated method stub + return null; + } + + public boolean add(Object obj) { + // TODO Auto-generated method stub + return false; + } + + public boolean update(Object obj) { + // TODO Auto-generated method stub + return false; + } + + public boolean del(Object obj) { + // TODO Auto-generated method stub + return false; + } + + public List searchAll() { + // TODO Auto-generated method stub + return null; + } + //鏍规嵁鐪佸競鍖烘満鎴垮悕绉版煡璇�(uid鏀惧湪num涓�) + public List serchByCondition(Object obj) { + BattInf binf=(BattInf) obj; + Page page=binf.getPage(); + Connection conn=DBUtil.getConn(); + String numberSql=" SELECT FOUND_ROWS() number"; + String sql=" select SQL_CALC_FOUND_ROWS distinct dev_id,thread_id,battgroup_cnt,battgroup_id1,battgroup_index1,battgroup_id2,battgroup_index2,battgroup_id3,battgroup_index3,battgroup_id4,battgroup_index4,connect_time,dev_comm_runtime,break_type " + + " ,stationName,stationName1,stationName2,stationName3,stationName5,StationId " + + " from db_app_sys.tb_app_bts_comm_task,db_battinf.tb_battinf " + + " where db_app_sys.tb_app_bts_comm_task.dev_id=db_battinf.tb_battinf.fBSDeviceId " + + " and stationName1 like ? and stationName2 like ? and stationId like ? and stationName5 like ? " + + " and db_app_sys.tb_app_bts_comm_task.dev_id in (" + + " select distinct db_battinf.tb_battinf.fBSDeviceId " + + " from db_battinf.tb_battinf " + + " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " + + " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + + " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + + " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.station_install=1 ) "+ + " limit ?,? "; + List<App_bts_comm_task> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationId()+"%","%"+binf.getStationName5()+"%",binf.getNum(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + App_bts_comm_task atask=new App_bts_comm_task(); + atask.setDev_id(rs.getInt("dev_id")); + atask.setThread_id(rs.getInt("thread_id")); + atask.setBattgroup_cnt(rs.getInt("battgroup_cnt")); + atask.setBattgroup_id1(rs.getInt("battgroup_id1")); + atask.setBattgroup_index1(rs.getInt("battgroup_index1")); + atask.setBattgroup_id2(rs.getInt("battgroup_id2")); + atask.setBattgroup_index2(rs.getInt("battgroup_index2")); + atask.setBattgroup_id3(rs.getInt("battgroup_id3")); + atask.setBattgroup_index3(rs.getInt("battgroup_index3")); + atask.setBattgroup_id4(rs.getInt("battgroup_id4")); + atask.setBattgroup_index4(rs.getInt("battgroup_index4")); + atask.setConnect_time(rs.getTimestamp("connect_time")); + atask.setDev_comm_runtime(rs.getTimestamp("dev_comm_runtime")); + atask.setBreak_type(rs.getInt("break_type")); + atask.setStationId(rs.getString("stationId")); + atask.setStationName(rs.getString("stationName")); + atask.setStationName1(rs.getString("stationName1")); + atask.setStationName2(rs.getString("stationName2")); + atask.setStationName3(rs.getString("stationName3")); + atask.setStationName5(rs.getString("stationName5")); + list.add(atask); + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + //鍘绘帀limit鏉′欢鍚庣殑鎬绘暟 + int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql); + //System.out.println("number: "+number); + if(list!=null&&list.size()>0){ + list.get(list.size()-1).setNum(number); + } + return list; + } + + public List serchByInfo(Object obj) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java index 4b6c4c8..0ef3f65 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -17,6 +17,7 @@ import com.fgkj.actions.ActionUtil; import com.fgkj.dao.BaseDAO; +import com.fgkj.dao.BattinfGroupFactory; import com.fgkj.dao.CallBack; import com.fgkj.dao.DAOHelper; import com.fgkj.dao.FBS9100_ComBase; @@ -53,11 +54,12 @@ //鑾峰彇褰撳墠鏈�澶х殑stationid鍜宐attgroupid int maxs=42000000;//鏈�澶tationid int maxb=1000001;//鏈�澶attgroupid - List maxList=(new BattInfImpl()).searchMaxId(); - if(maxList!=null&&maxList.size()>0){ + maxs=BattinfGroupFactory.searchStationId(); + maxb=BattinfGroupFactory.searchMaxBattgroupId(); + /*if(maxList!=null&&maxList.size()>0){ maxs=(Integer) maxList.get(0)+1; - maxb=(Integer) maxList.get(1)+1; - } + //maxb=(Integer) maxList.get(1)+1; + }*/ if(list!=null && list.size()>0){ for (int i = 0; i < list.size(); i++) { BattInf binf=list.get(i); @@ -110,11 +112,12 @@ binf.setStationId((String) listS.get(listS.size()-1)); }else{ //鑾峰彇褰撳墠鏈�澶х殑stationid - List maxList=(new BattInfImpl()).searchMaxId(); - if(maxList!=null&&maxList.size()>0){ + int maxs=BattinfGroupFactory.searchStationId(); + binf.setStationId(String.valueOf(maxs)); + /*if(maxList!=null&&maxList.size()>0){ int maxs=(Integer) maxList.get(0)+1; binf.setStationId(String.valueOf(maxs)); - } + }*/ } String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"'," + "FBSDeviceName='"+binf.getFBSDeviceName()+"',GroupIndexInFBSDevice="+binf.getGroupIndexInFBSDevice()+",BattGroupNum="+binf.getBattGroupNum()+",BattGroupName='"+binf.getBattGroupName()+"',FloatVolLevel="+binf.getFloatVolLevel()+",OfflineVolLevel="+binf.getOfflineVolLevel()+",BattFloatCurrent="+binf.getBattFloatCurrent()+"," + @@ -354,8 +357,9 @@ return list; } //娣诲姞鐢垫睜缁勬椂鏌ヨ鍑烘渶澶х殑鏈烘埧id鍜岀數姹犵粍id - public List searchMaxId(){ - String sql="select max(stationid) as maxs,max(battgroupid) as maxb from db_battinf.tb_battinf limit 1"; + public int searchMaxId(){ + //,max(battgroupid) as maxb + String sql="select max(stationid) as stationid_maxs from db_battinf.tb_battinf limit 1"; List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() { public List getResults(ResultSet rs) { @@ -364,15 +368,15 @@ while(rs.next()){ int maxs=42000000; - int maxb=1000001; - if(rs.getString("maxs") != null){ - maxs=Integer.parseInt(rs.getString("maxs")); + //int maxb=1000001; + if(rs.getString("stationid_maxs") != null){ + maxs=Integer.parseInt(rs.getString("stationid_maxs")); } - if(rs.getInt("maxb")!=0){ + /*if(rs.getInt("maxb")!=0){ maxb=rs.getInt("maxb"); - } + }*/ list.add(maxs); - list.add(maxb); + //list.add(maxb); } } catch (SQLException e) { // TODO Auto-generated catch block @@ -381,7 +385,11 @@ return list; } }); - return list; + int stationid=0; + if(list!=null&&list.size()>0){ + stationid=(Integer) list.get(list.size()-1); + } + return stationid; } //鍒ゆ柇鏂板鐨勭數姹犵粍鏄惁瀛樺湪 public List judgeBatt(Object obj){ diff --git a/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java index 56f9959..f9c15b2 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java @@ -749,7 +749,33 @@ } return list; } - public static void main(String[] args) { + + //鏌ヨ鍑哄綋鍓嶅瓨鍦ㄥ唴瀛樹腑鏈�澶х殑鐢垫睜缁刬d(寰堥噸瑕�**********) + public int searchMaxBattgroupId(){ + String sql=" select max(battgroupid) as max_id from db_ram_db.tb_batt_rtstate limit 1"; + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + int battgroupid=rs.getInt("battgroupid"); + list.add(battgroupid); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + int battgroupid=0; + if(list!=null&&list.size()>0){ + battgroupid=(Integer) list.get(list.size()-1); + } + return battgroupid; + } + public static void main(String[] args) { User_inf uinf=new User_inf(); uinf.setUId(1001); Batt_rtstateDAOImpl bimpl=new Batt_rtstateDAOImpl(); diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java index e8d8225..f9bc254 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java @@ -263,6 +263,35 @@ } return nums; } + //鏌ヨ鍏蜂綋鏌愭満鎴挎帀绔欐暟(鏍规嵁station_id ) + public int serchByStationId_diaozhan(Object obj) { + BattMap_information binformation=(BattMap_information) obj; + String sql="select count(num) as nums from db_ram_db.tb_bts_station_state " + + " where station_stat&32>1 " + + " and station_id=? " + + " limit 1 "; + //System.out.println(sql); + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binformation.getStationId()}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + int nums=rs.getInt("nums"); + list.add(nums); + } + } catch (SQLException e) { + e.printStackTrace(); + } + return list; + } + }); + int nums=0;//鏈�鍚庣殑缁撴灉 + if(list!=null&&list.size()>0){ + nums=(Integer) list.get(list.size()-1); + } + return nums; + } public List serchByInfo(Object obj) { // TODO Auto-generated method stub return null; @@ -282,16 +311,20 @@ p.setPageCurr(1); p.setPageSize(10); binf.setPage(p); - List<Bts_station_state> list=bimpl.serchByCondition(binf); + /*List<Bts_station_state> list=bimpl.serchByCondition(binf); for (Bts_station_state bs : list) { //System.out.println(bs.getStation_stat_diaozhan()+" "+bs.getStation_stat_dooropen()+" "+bs.getStation_stat_fadian()+" "+bs.getStation_stat_xuhang()+" "+bs.getStation_stat_poff()); System.out.println(bs); } - int nums=bimpl.serchByState(uinf); + int nums=bimpl.serchByState(uinf);*/ /*BattMap_information bm=new BattMap_information(); bm.setStationId("42000570"); int nums=bimpl.serchByStationId(bm);*/ //int nums=bimpl.serchByState_diaozhan(uinf); + BattMap_information bm=new BattMap_information(); + bm.setStationId("42000366"); + int nums=bimpl.serchByStationId_diaozhan(bm); + System.out.println(nums); } diff --git a/gx_tieta/src/com/fgkj/dto/App_bts_comm_task.java b/gx_tieta/src/com/fgkj/dto/App_bts_comm_task.java new file mode 100644 index 0000000..0ef987f --- /dev/null +++ b/gx_tieta/src/com/fgkj/dto/App_bts_comm_task.java @@ -0,0 +1,181 @@ +package com.fgkj.dto; + +import java.io.Serializable; +import java.util.Date; + +public class App_bts_comm_task implements Serializable{ + private int num; + private int thread_id; + private int dev_id; + private int battgroup_cnt; + private int battgroup_id1; + private int battgroup_index1; + private int battgroup_id2; + private int battgroup_index2; + private int battgroup_id3; + private int battgroup_index3; + private int battgroup_id4; + private int battgroup_index4; + private Date connect_time; + private Date dev_comm_runtime; + private int break_type;//break_type 锛�0锛屾垚鍔熻繛鎺ワ紱1锛屾壘涓嶅埌瀵瑰簲dev_id锛�2锛岄�氫俊寮傚父鏂紑 + private String stationName; + private String stationName1; + private String stationName2; + private String stationName3; + private String stationName5; + private String stationId; + private String note; + public int getNum() { + return num; + } + public void setNum(int num) { + this.num = num; + } + public int getThread_id() { + return thread_id; + } + public void setThread_id(int thread_id) { + this.thread_id = thread_id; + } + public int getDev_id() { + return dev_id; + } + public void setDev_id(int dev_id) { + this.dev_id = dev_id; + } + public int getBattgroup_cnt() { + return battgroup_cnt; + } + public void setBattgroup_cnt(int battgroup_cnt) { + this.battgroup_cnt = battgroup_cnt; + } + public int getBattgroup_id1() { + return battgroup_id1; + } + public void setBattgroup_id1(int battgroup_id1) { + this.battgroup_id1 = battgroup_id1; + } + public int getBattgroup_index1() { + return battgroup_index1; + } + public void setBattgroup_index1(int battgroup_index1) { + this.battgroup_index1 = battgroup_index1; + } + public int getBattgroup_id2() { + return battgroup_id2; + } + public void setBattgroup_id2(int battgroup_id2) { + this.battgroup_id2 = battgroup_id2; + } + public int getBattgroup_index2() { + return battgroup_index2; + } + public void setBattgroup_index2(int battgroup_index2) { + this.battgroup_index2 = battgroup_index2; + } + public int getBattgroup_id3() { + return battgroup_id3; + } + public void setBattgroup_id3(int battgroup_id3) { + this.battgroup_id3 = battgroup_id3; + } + public int getBattgroup_index3() { + return battgroup_index3; + } + public void setBattgroup_index3(int battgroup_index3) { + this.battgroup_index3 = battgroup_index3; + } + public int getBattgroup_id4() { + return battgroup_id4; + } + public void setBattgroup_id4(int battgroup_id4) { + this.battgroup_id4 = battgroup_id4; + } + public int getBattgroup_index4() { + return battgroup_index4; + } + public void setBattgroup_index4(int battgroup_index4) { + this.battgroup_index4 = battgroup_index4; + } + public Date getConnect_time() { + return connect_time; + } + public void setConnect_time(Date connect_time) { + this.connect_time = connect_time; + } + public Date getDev_comm_runtime() { + return dev_comm_runtime; + } + public void setDev_comm_runtime(Date dev_comm_runtime) { + this.dev_comm_runtime = dev_comm_runtime; + } + public int getBreak_type() { + return break_type; + } + public void setBreak_type(int break_type) { + this.break_type = break_type; + } + public String getNote() { + return note; + } + public void setNote(String note) { + this.note = note; + } + public String getStationName() { + return stationName; + } + public void setStationName(String stationName) { + this.stationName = stationName; + } + public String getStationName1() { + return stationName1; + } + public void setStationName1(String stationName1) { + this.stationName1 = stationName1; + } + public String getStationName2() { + return stationName2; + } + public void setStationName2(String stationName2) { + this.stationName2 = stationName2; + } + public String getStationName3() { + return stationName3; + } + public void setStationName3(String stationName3) { + this.stationName3 = stationName3; + } + public String getStationName5() { + return stationName5; + } + public void setStationName5(String stationName5) { + this.stationName5 = stationName5; + } + public String getStationId() { + return stationId; + } + public void setStationId(String stationId) { + this.stationId = stationId; + } + @Override + public String toString() { + return "App_bts_comm_task [num=" + num + ", thread_id=" + thread_id + + ", dev_id=" + dev_id + ", battgroup_cnt=" + battgroup_cnt + + ", battgroup_id1=" + battgroup_id1 + ", battgroup_index1=" + + battgroup_index1 + ", battgroup_id2=" + battgroup_id2 + + ", battgroup_index2=" + battgroup_index2 + ", battgroup_id3=" + + battgroup_id3 + ", battgroup_index3=" + battgroup_index3 + + ", battgroup_id4=" + battgroup_id4 + ", battgroup_index4=" + + battgroup_index4 + ", connect_time=" + connect_time + + ", dev_comm_runtime=" + dev_comm_runtime + ", break_type=" + + break_type + ", stationName=" + stationName + + ", stationName1=" + stationName1 + ", stationName2=" + + stationName2 + ", stationName3=" + stationName3 + + ", stationName5=" + stationName5 + ", stationId=" + stationId + + ", note=" + note + "]"; + } + + + +} diff --git a/gx_tieta/src/com/fgkj/services/App_bts_comm_taskService.java b/gx_tieta/src/com/fgkj/services/App_bts_comm_taskService.java new file mode 100644 index 0000000..acb632c --- /dev/null +++ b/gx_tieta/src/com/fgkj/services/App_bts_comm_taskService.java @@ -0,0 +1,33 @@ +package com.fgkj.services; + +import java.util.ArrayList; +import java.util.List; + +import com.fgkj.dao.BaseDAO; +import com.fgkj.dao.BaseDAOFactory; +import com.fgkj.dto.ServiceModel; + +public class App_bts_comm_taskService { + private BaseDAO dao; + private ServiceModel model; + public App_bts_comm_taskService() { + super(); + dao=BaseDAOFactory.getBaseDAO(BaseDAO.APP_BTS_COMM_TASK); + model=new ServiceModel(); + } + //鏍规嵁鐪佸競鍖烘満鎴垮悕绉版煡璇� + public ServiceModel serchByCondition(Object obj){ + List list =dao.serchByCondition(obj); + if(list!=null&&list.size()>0){ + model.setCode(1); + model.setData(list); + model.setMsg("鏌ヨ鎴愬姛!"); + }else{ + model.setCode(0); + model.setMsg("鏌ヨ澶辫触!"); + } + return model; + } + + +} diff --git a/gx_tieta/src/com/fgkj/services/BattMap_informationService.java b/gx_tieta/src/com/fgkj/services/BattMap_informationService.java index 6e46763..ade425e 100644 --- a/gx_tieta/src/com/fgkj/services/BattMap_informationService.java +++ b/gx_tieta/src/com/fgkj/services/BattMap_informationService.java @@ -109,6 +109,7 @@ int numAlarm=0; int numPlan=0; int numPoff=0; + int dianzhanNum=0; if(list!=null&&list.size()>0){ for(int i=0;i<list.size();i++){ state="item-normal"; @@ -119,10 +120,11 @@ binf.setFBSDeviceId(binformation.getFBSDeviceId()); state=(new Fbs9100_stateImpl().seachDevNow(binf)); }else{ - numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //鍋滅數鏁� + numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //鍋滅數鏁� + dianzhanNum=((Bts_station_stateImpl)dao).serchByStationId_diaozhan(binformation); //鎺夌珯鏁� numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation); //钀藉悗鎬绘暟 numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation); //鍛婅鎬绘暟 - numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //寤惰繜鎬绘暟 + //numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //寤惰繜鎬绘暟 if(numPoff>0){ state="item-poff"; //鍋滅數 }else{ @@ -132,8 +134,11 @@ if(numAlarm > 0){ state="item-warn"; //鍛婅鏈烘埧 }else{ - if(numPlan > 0){ + /*if(numPlan > 0){ state="item-timeout"; //寤惰繜鏈烘埧 + }*/ + if(dianzhanNum>0){ + state="item-diaozhan"; } } } @@ -147,7 +152,8 @@ model.setMsgO(String.valueOf(numPoff)); //鍋滅數鏁� model.setCode(numAlarm); //鍛婅鎬绘暟 model.setSum(numBadBatt); //钀藉悗鎬绘暟 - model.setNewsum(numPlan); //寤舵椂鎬绘暟 + //model.setNewsum(numPlan); //寤舵椂鎬绘暟 + model.setMsgT(String.valueOf(dianzhanNum)); //鎺夌珯 model.setMsg(state); //61850鐘舵�� model.setMsgN(binformation.getFBSDeviceId().toString()); listAll.add(model); @@ -163,6 +169,8 @@ int numBadBatt=0; int numAlarm=0; int numPlan=0; + int numPoff=0; + int dianzhanNum=0; if(list!=null&&list.size()>0){ for(int i=0;i<list.size();i++){ state="item-normal"; @@ -173,25 +181,36 @@ binf.setFBSDeviceId(binformation.getFBSDeviceId()); state=(new Fbs9100_stateImpl().seachDevNow(binf)); }else{ + numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //鍋滅數鏁� + dianzhanNum=((Bts_station_stateImpl)dao).serchByStationId_diaozhan(binformation); //鎺夌珯鏁� numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation); //钀藉悗鎬绘暟 numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation); //鍛婅鎬绘暟 - numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //寤惰繜鎬绘暟 - if(numBadBatt>0){ - state="item-behind"; //钀藉悗鏈烘埧 + //numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //寤惰繜鎬绘暟 + if(numPoff>0){ + state="item-poff"; //鍋滅數 }else{ - if(numAlarm > 0){ - state="item-warn"; //鍛婅鏈烘埧 + if(numBadBatt>0){ + state="item-behind"; //钀藉悗鏈烘埧 }else{ - if(numPlan > 0){ - state="item-timeout"; //寤惰繜鏈烘埧 + if(numAlarm > 0){ + state="item-warn"; //鍛婅鏈烘埧 + }else{ + /*if(numPlan > 0){ + state="item-timeout"; //寤惰繜鏈烘埧 + }*/ + if(dianzhanNum>0){ + state="item-diaozhan"; + } } } } } model.setData(list.get(i)); + model.setMsgO(String.valueOf(numPoff)); //鍋滅數鏁� model.setCode(numAlarm); //鍛婅鎬绘暟 model.setSum(numBadBatt); //钀藉悗鎬绘暟 - model.setNewsum(numPlan); //寤舵椂鎬绘暟 + //model.setNewsum(numPlan); //寤舵椂鎬绘暟 + model.setMsgT(String.valueOf(dianzhanNum)); //鎺夌珯 model.setMsg(state); //61850鐘舵�� model.setMsgN(binformation.getFBSDeviceId().toString()); listAll.add(model); @@ -210,10 +229,14 @@ int numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation); int numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation); int numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); + int numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //鍋滅數鏁� + int dianzhanNum=((Bts_station_stateImpl)dao).serchByStationId_diaozhan(binformation); //鎺夌珯鏁� model.setData(list.get(i)); model.setCode(numAlarm); //鍛婅鎬绘暟 model.setSum(numBadBatt); //钀藉悗鎬绘暟 model.setNewsum(numPlan); //寤舵椂鎬绘暟 + model.setMsgO(String.valueOf(numPoff)); //鍋滅數鏁� + model.setMsgT(String.valueOf(dianzhanNum)); //鎺夌珯 listAll.add(model); } } -- Gitblit v1.9.1