星伟
2018-09-25 acd46c13a2a74b00f933629887c8093fe419278b
左侧导航4层提交
4个文件已修改
232 ■■■■■ 已修改文件
gx_tieta/src/com/fgkj/actions/BattInfAction.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/db/DBUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/services/BattInfServices.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/actions/BattInfAction.java
@@ -243,13 +243,7 @@
        return SUCCESS;
    }
    
    //查询所有的机房
    public String serchAllStation(){
        User_inf u = (User_inf)getUser();
        ServiceModel model = service.serchAllStation(u);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    
    //搜索机房或电池组
    public String serchStationOrBattgroup(){
@@ -258,7 +252,34 @@
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //根据机房id查询机房下的电池组信息
    //查询所有的省份(左侧导航第一层,查所有的省份,num中存放uid)
    public String serchAllStation(){
        User_inf u = (User_inf)getUser();
        BattInf binf=new BattInf();
        binf.setNum(u.getUId());
        ServiceModel model = service.serchAllStation(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public String serchStationName2(){
        User_inf u = (User_inf)getUser();
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        binf.setNum(u.getUId());
        ServiceModel model = service.serchStationName2(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
    public String serchStationName3(){
        User_inf u = (User_inf)getUser();
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        binf.setNum(u.getUId());
        ServiceModel model = service.serchStationName3(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public String serchBattByStation(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchBattByStation(binf);
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -3244,83 +3244,106 @@
        
    }
    //查询所有的机房
    //查询所有的省份(左侧导航第一层,查所有的省份,num中存放uid)
    public List serchAllStation(Object obj){
        User_inf uinf=(User_inf) obj;
        String sql="select DISTINCT stationid,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationName6,StationName7,StationName8,StationName9,fBSDeviceId  " +
        BattInf binf=(BattInf) obj;;
        String sql="select DISTINCT StationName " +
                " FROM db_battinf.tb_battinf " +
                " where StationId in(" +
                " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
                " )";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()},new CallBack() {
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum()},new CallBack() {
            
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                String conStr="-";//连接机房名称的符号
                try {
                    while(rs.next()){
                        BattInf batt = new BattInf();
                        String stationName="";
                        if(!rs.getString("StationName1").trim().equals("")){
                            stationName+=rs.getString("StationName1");
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName1(rs.getString("stationName1"));
                            list.add(batt);
                        }
                        if(!rs.getString("StationName2").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName2");
                        }
                        if(!rs.getString("StationName3").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName3");
                        }
                        if(!rs.getString("StationName4").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName4");
                        }
                        if(!rs.getString("StationName5").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName5");
                        }
                        if(!rs.getString("StationName6").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName6");
                        }
                        if(!rs.getString("StationName7").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName7");
                        }
                        if(!rs.getString("StationName8").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName8");
                        }
                        if(!rs.getString("StationName9").trim().equals("")){
                            stationName+=conStr;
                            stationName+=rs.getString("StationName9");
                        }
                        batt.setStationName(stationName);
                        batt.setStationId(rs.getString("StationId"));
                        batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
                        list.add(batt);
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        } );
        return list;
    }
    //根据机房id查询机房下的电池组信息
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public List serchStationName2(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName2  " +
                " FROM db_battinf.tb_battinf " +
                " where StationId in(" +
                " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
                " ) and StationName1 like ?";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%"},new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName2(rs.getString("stationName2"));
                            list.add(batt);
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                return list;
            }
        } );
        return list;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
    public List serchStationName3(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName3,stationid,fbsdeviceid  " +
                " FROM db_battinf.tb_battinf " +
                " where StationId in(" +
                " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
                " ) and StationName1 like ? and StationName2 like ? ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName3(rs.getString("stationName3"));
                            batt.setStationId(rs.getString("stationId"));
                            batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
                            list.add(batt);
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                return list;
            }
        } );
        return list;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public List serchBattByStation(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
                "from db_battinf.tb_battinf  where stationid=? " +
                "and StationId in(" +
                " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
                " ) " +
                "ORDER BY StationName1,battgroupId ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getStationId()},new CallBack() {
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getNum(),binf.getStationId()},new CallBack() {
            
            public List getResults(ResultSet rs) {
                List list = new ArrayList();
                String conStr="-";//连接机房名称的符号
                try {
                    while (rs.next()) {
                        BattInf batt = new BattInf();
gx_tieta/src/com/fgkj/db/DBUtil.java
@@ -15,9 +15,10 @@
    //private static String username="website";
    //private static String password="amtb3737";
    
    //private static String url="jdbc:mysql://118.89.139.230:3360/db_user";
    private static String username="root";
    private static String password="lmx8688139";
    //private static String url="jdbc:mysql://118.89.139.230:3360/db_user";
    private static String url="jdbc:mysql://123.207.82.239:3360/db_user";
    //private static String url="jdbc:mysql://192.168.0.34:3360/db_user";
    //private static String url="jdbc:mysql://127.0.0.1:3360/db_user";
gx_tieta/src/com/fgkj/services/BattInfServices.java
@@ -641,21 +641,7 @@
        }
        return model;
    }
    //查询所有的机房
    public ServiceModel serchAllStation(Object obj){
        List list=((BattInfImpl)dao).serchAllStation(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        //System.out.println(model);
        return model;
    }
    //搜索机房或电池组
    public ServiceModel serchStationOrBattgroup(Object obj){
        List list=((BattInfImpl)dao).serchStationOrBattgroup(obj);
@@ -671,7 +657,49 @@
        //System.out.println(list.size());
        return model;
    }
    //根据机房id查询机房下的电池组信息
    //查询所有的省份(左侧导航第一层,查所有的省份)
    public ServiceModel serchAllStation(Object obj){
        List list=((BattInfImpl)dao).serchAllStation(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public ServiceModel serchStationName2(Object obj){
        List list=((BattInfImpl)dao).serchStationName2(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
    public ServiceModel serchStationName3(Object obj){
        List list=((BattInfImpl)dao).serchStationName3(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public ServiceModel serchBattByStation(Object obj){
        List list=((BattInfImpl)dao).serchBattByStation(obj);
        if (list != null && list.size() > 0) {
@@ -683,7 +711,6 @@
            model.setData(list);
            model.setMsg("查询失败!");
        }
        //System.out.println(model);
        return model;
    }
    //查询所有的电池组数