81041
2019-01-04 b102c292bfdc2c0318b672b86a74507c7b26bf93
批量的查询
4个文件已修改
173 ■■■■ 已修改文件
gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java
@@ -109,7 +109,15 @@
        result = tojson(model);
        return SUCCESS;    
      }
  //批量设置放电参数时查询出当前放电的电池组(1u/2u分开)
      public String seachDischarge(){
          BattInf binf=getGson().fromJson(json, BattInf.class);
        User_inf uinf=(User_inf) getUser();
        binf.setNum(uinf.getUId());
          ServiceModel model = service.seachDischarge(binf);
        result = tojson(model);
        return SUCCESS;
      }
   //11.1FBS9100设备通信状态查询                 <--     跨域    -->
      public String serchByCondition_ky(){          
          //isAllowHeaders();                                                //允许跨域访问
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java
@@ -889,6 +889,80 @@
        
        return list;
    }
    //批量设置放电参数时查询出当前放电的电池组(1u/2u分开)
    public List seachDischarge(Object obj) {
        BattInf binf=(BattInf) obj;
        String sql="select distinct dev_id,dev_alarmstate,dev_workstate,dev_temp,dev_version,dev_res_test_state,dev_testtype,dev_testgroupnum "
                + ",dev_captest_onlinevol,dev_captest_groupvol,dev_captest_curr,dev_captest_cap,dev_captest_timelong "
                + ",dev_conresist,dev_concurr,dev_condvoldp,dev_condcurr,dev_61850alarms,dev_last_captest_stop_type "
                + ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2,db_battinf.tb_battinf.StationName3,db_battinf.tb_battinf.StationName5 "
                + ",db_battinf.tb_battinf.MonVolStd,db_battinf.tb_battinf.BattGroupId "
                + " from db_ram_db.tb_fbs9100_state,db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr "
                + " where   dev_workstate="+FBS9100_ComBase.DISCHARGE
                + " and db_battinf.tb_battinf.fbsdeviceId=db_ram_db.tb_fbs9100_state.dev_id    "
                + " and (db_battinf.tb_battinf.GroupIndexInFBSDevice+1)=db_ram_db.tb_fbs9100_state.dev_testgroupnum "
                + " and db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId    "
                + " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id "
                + " and db_user.tb_user_battgroup_baojigroup_usr.uId=?  "
                + " and db_battinf.tb_battinf.MonVolStd=? ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getNum(),binf.getMonVolStd()}, new CallBack() {
            @Override
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                try {
                    while(rs.next()){
                        Fbs9100_state fstate=new Fbs9100_state();
                        int dev_alarmstate=rs.getInt("dev_alarmstate");
                        String ContactorState="开关闭合";
                        if(dev_alarmstate==1 ||
                           dev_alarmstate==2 ||
                           dev_alarmstate==3 ||
                           dev_alarmstate==4 ||
                           dev_alarmstate==6 ){
                            ContactorState="开关断开";
                        }else{
                            ContactorState="开关闭合";
                        }
                        fstate.setDev_testgroupnum(rs.getInt("dev_testgroupnum"));            //被测电池组号
                        fstate.setDev_alarmstate(rs.getInt("dev_alarmstate"));
                        fstate.setDev_res_test_state(rs.getInt("dev_res_test_state"));
                        fstate.setDev_testtype(rs.getInt("dev_testtype"));
                        fstate.setNote(ContactorState);
                        fstate.setDev_workstate(rs.getInt("dev_workstate"));
                        fstate.setDev_id(rs.getInt("dev_id"));
                        fstate.setDev_version(rs.getString("dev_version"));
                        fstate.setDev_captest_onlinevol(rs.getFloat("dev_captest_onlinevol"));
                        fstate.setDev_captest_groupvol(rs.getFloat("dev_captest_groupvol"));
                        fstate.setDev_captest_curr(rs.getFloat("dev_captest_curr"));
                        fstate.setDev_captest_cap(rs.getFloat("dev_captest_cap"));
                        fstate.setDev_captest_timelong(rs.getInt("dev_captest_timelong"));
                        fstate.setDev_conresist(rs.getFloat("dev_conresist"));
                        fstate.setDev_concurr(rs.getFloat("dev_concurr"));
                        fstate.setDev_condcurr(rs.getFloat("dev_condcurr"));
                        fstate.setDev_condvoldp(rs.getFloat("dev_condvoldp"));
                        fstate.setDev_61850alarms(rs.getString("dev_61850alarms"));
                        fstate.setDev_last_captest_stop_type(rs.getInt("dev_last_captest_stop_type"));
                        fstate.setDev_temp(rs.getFloat("dev_temp"));
                        fstate.setStationName(rs.getString("stationName"));
                        fstate.setStationName1(rs.getString("stationName1"));
                        fstate.setStationName2(rs.getString("stationName2"));
                        fstate.setStationName3(rs.getString("stationName3"));
                        fstate.setStationName5(rs.getString("stationName5"));
                        fstate.setBattgroupid(rs.getInt("battgroupid"));
                        fstate.setMonvolstd(rs.getInt("monvolstd"));
                        list.add(fstate);
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
    }
    public static void main(String[] args) {
        Fbs9100_stateImpl fi=new Fbs9100_stateImpl();
        /*List<Fbs9100_state> list=fi.searchAll();
@@ -905,16 +979,19 @@
        p.setPageSize(20);
        p.setPageCurr(1);
        fs.setPage(p);
        BattInf binf=new BattInf();
        binf.setNum(1002);
        binf.setMonVolStd(12f);
        /*List<Fbs9100_state> list=fi.serchByCondition(fs);
        System.out.println(list.size());
        for(Fbs9100_state f:list){
            System.out.println(f);
        }*/
        List<Fbs9100_state> list=fi.serchByCondition_ky();
        /*List<Fbs9100_state> list=fi.serchByCondition_ky();
        System.out.println(list.size());
        for(Fbs9100_state f:list){
            System.out.println(f);
        }
        }*/
        /*BattInf binf=new BattInf();
        binf.setBattGroupId(1005069);
        List list=fi.serchByInfo(binf);
@@ -929,6 +1006,11 @@
        for(Fbs9100_state f:list){
            System.out.println(f);
        }*/
        List<Fbs9100_state> list=fi.seachDischarge(binf);
        System.out.println(list.size());
        for(Fbs9100_state f:list){
            System.out.println(f);
        }
    }
}
gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java
@@ -41,6 +41,8 @@
    private String stationName3;
    private String stationName5;
    private String deviceName;//设备名称
    private int  monvolstd;
    private int  battgroupid;
    private String note;
    private Page page;//分页
    
@@ -319,44 +321,43 @@
    public void setStationName5(String stationName5) {
        this.stationName5 = stationName5;
    }
    public int getMonvolstd() {
        return monvolstd;
    }
    public void setMonvolstd(int monvolstd) {
        this.monvolstd = monvolstd;
    }
    public int getBattgroupid() {
        return battgroupid;
    }
    public void setBattgroupid(int battgroupid) {
        this.battgroupid = battgroupid;
    }
    @Override
    public String toString() {
        return "Fbs9100_state [num=" + num + ", dev_ip=" + dev_ip
                + ", dev_version=" + dev_version + ", dev_id=" + dev_id
                + ", op_cmd=" + op_cmd + ", record_datetime=" + record_datetime
                + ", dev_datetime=" + dev_datetime + ", dev_testtype="
                + dev_testtype + ", dev_testgroupnum=" + dev_testgroupnum
                + ", dev_workstate=" + dev_workstate + ", dev_alarmstate="
                + dev_alarmstate + ", dev_temp=" + dev_temp
                + ", dev_res_test_state=" + dev_res_test_state
                + ", dev_onlinevollow=" + dev_onlinevollow
                + ", dev_eachgroup_battsum=" + dev_eachgroup_battsum
                + ", dev_captest_onlinevol=" + dev_captest_onlinevol
                + ", dev_captest_groupvol=" + dev_captest_groupvol
                + ", dev_captest_curr=" + dev_captest_curr
                + ", dev_captest_cap=" + dev_captest_cap
                + ", dev_captest_timelong=" + dev_captest_timelong
                + ", dev_restest_moncount=" + dev_restest_moncount
                + ", dev_restest_monindex=" + dev_restest_monindex
                + ", dev_commcount=" + dev_commcount + ", dev_errcommcount="
                + dev_errcommcount + ", dev_rxnullerrcount="
                + dev_rxnullerrcount + ", batt_online_state="
                + batt_online_state + ", online_vols=" + online_vols
                + ", group_vols=" + group_vols + ", group_currs=" + group_currs
                + ", stationName=" + stationName + ", stationName1="
                + stationName1 + ", stationName2=" + stationName2
                + ", stationName3=" + stationName3 + ", stationName5="
                + stationName5 + ", deviceName=" + deviceName + ", note="
                + note + ", page=" + page + ", dev_conresist=" + dev_conresist
                + ", dev_concurr=" + dev_concurr + ", dev_condvoldp="
                + dev_condvoldp + ", dev_condcurr=" + dev_condcurr
                + ", dev_61850alarms=" + dev_61850alarms
                + ", dev_last_captest_stop_type=" + dev_last_captest_stop_type
                + "]";
        return "Fbs9100_state [num=" + num + ", dev_ip=" + dev_ip + ", dev_version=" + dev_version + ", dev_id="
                + dev_id + ", op_cmd=" + op_cmd + ", record_datetime=" + record_datetime + ", dev_datetime="
                + dev_datetime + ", dev_testtype=" + dev_testtype + ", dev_testgroupnum=" + dev_testgroupnum
                + ", dev_workstate=" + dev_workstate + ", dev_alarmstate=" + dev_alarmstate + ", dev_temp=" + dev_temp
                + ", dev_res_test_state=" + dev_res_test_state + ", dev_onlinevollow=" + dev_onlinevollow
                + ", dev_eachgroup_battsum=" + dev_eachgroup_battsum + ", dev_captest_onlinevol="
                + dev_captest_onlinevol + ", dev_captest_groupvol=" + dev_captest_groupvol + ", dev_captest_curr="
                + dev_captest_curr + ", dev_captest_cap=" + dev_captest_cap + ", dev_captest_timelong="
                + dev_captest_timelong + ", dev_restest_moncount=" + dev_restest_moncount + ", dev_restest_monindex="
                + dev_restest_monindex + ", dev_commcount=" + dev_commcount + ", dev_errcommcount=" + dev_errcommcount
                + ", dev_rxnullerrcount=" + dev_rxnullerrcount + ", batt_online_state=" + batt_online_state
                + ", online_vols=" + online_vols + ", group_vols=" + group_vols + ", group_currs=" + group_currs
                + ", stationName=" + stationName + ", stationName1=" + stationName1 + ", stationName2=" + stationName2
                + ", stationName3=" + stationName3 + ", stationName5=" + stationName5 + ", deviceName=" + deviceName
                + ", monvolstd=" + monvolstd + ", battgroupid=" + battgroupid + ", note=" + note + ", page=" + page
                + ", dev_conresist=" + dev_conresist + ", dev_concurr=" + dev_concurr + ", dev_condvoldp="
                + dev_condvoldp + ", dev_condcurr=" + dev_condcurr + ", dev_61850alarms=" + dev_61850alarms
                + ", dev_last_captest_stop_type=" + dev_last_captest_stop_type + "]";
    }
    
    
    
    
    
}
gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java
@@ -198,6 +198,18 @@
        }
        return model;
    } 
  //批量设置放电参数时查询出当前放电的电池组(1u/2u分开)
    public ServiceModel seachDischarge(Object obj){
        List list=((Fbs9100_stateImpl)dao).seachDischarge(obj);
        if(list!=null && list.size()>0){
            model.setCode(1);
            model.setData(list);
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
      public static void main(String[] args) {
        Fbs9100_stateService fs = new Fbs9100_stateService();
        Fbs9100_state f=new Fbs9100_state();