| | |
| | | int uid=((User_inf)ActionUtil.getUser()).getUId();
|
| | | bapply.setApply_uid(uid);
|
| | | BattInf binf=bapply.getBinf();
|
| | | String sql = "insert into db_battinf.tb_battinf_apply(" +
|
| | | String sql = "replace into db_battinf.tb_battinf_apply(" +
|
| | | "apply_uid,apply_date,StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone" +
|
| | |
| | | ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
|
| | | ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"',"+binf.getStation_install()+")";
|
| | | sql_str.add(sql_insert_binf);
|
| | | //给添加的机房加入包机组(管理员组)
|
| | | String baoji_sql_main="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) values('100011','"+binf.getStationId()+"',"+binf.getBattGroupId()+")";
|
| | | sql_str.add(baoji_sql_main);
|
| | | //System.out.println(baoji_sql_main);
|
| | | //给添加的机房加入包机组(该用户的)
|
| | | String baoji_sql="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) " +
|
| | | " SELECT baoji_group_id,'"+binf.getStationId()+"',"+binf.getBattGroupId()+" from db_user.tb_user_battgroup_baojigroup ";
|
| | | " SELECT baoji_group_id,'"+binf.getStationId()+"',"+binf.getBattGroupId()+" from db_user.tb_user_battgroup_baojigroup_usr where uid="+bapply.getApply_uid();
|
| | | sql_str.add(baoji_sql);
|
| | | |
| | | {
|
| | | String msg="确认添加"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
|
| | |
| | | bapply.setCheck_uid(((User_inf)ActionUtil.getUser()).getUId());
|
| | | String sql_update_apply=" update db_battinf.tb_battinf_apply set check_uid="+bapply.getCheck_uid()+",check_en=1 where battgroupid="+binf.getBattGroupId();
|
| | | sql_str.add(sql_update_apply);
|
| | | String sql_replace_map=" replace into web_site.tb_battmap_information(StationId,StationName,address,longitude,latitude) values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+bapply.getAddress()+"',"+bapply.getLongitude()+","+bapply.getLatitude()+")";
|
| | | sql_str.add(sql_replace_map);
|
| | | {
|
| | | String msg="验收"+binf.getStationName()+"机房";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
|
| | |
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | BattInf binf=bapply.getBinf();
|
| | | String sql_update_apply=" update db_battinf.tb_battinf_apply set check_en=2 where battgroupid="+binf.getBattGroupId();
|
| | | String sql_update_apply=" update db_battinf.tb_battinf_apply set check_en=2,longitude="+bapply.getLongitude()+",latitude="+bapply.getLatitude()+",address='"+bapply.getAddress()+"' where battgroupid="+binf.getBattGroupId();
|
| | | sql_str.add(sql_update_apply);
|
| | | {
|
| | | String msg="申请验收"+binf.getStationName()+"机房";
|
| | |
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql=" select SQL_CALC_FOUND_ROWS distinct num,apply_uid,confrim_uid,check_uid,check_en,apply_date,apply_en,apply_note,StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FbsDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp"+
|
| | | ",FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone " +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone "
|
| | | + ",longitude,latitude,address " +
|
| | | " from db_battinf.tb_battinf_apply " +
|
| | | " where apply_en=? order by apply_date desc" +
|
| | | " limit ?,? ";
|
| | | List<Battinf_apply> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bapply.getApply_en(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | " where ";
|
| | | //未审批
|
| | | if(bapply.getApply_en()==0) {
|
| | | sql+=" apply_en=? and check_en!=? ";
|
| | | }else {
|
| | | sql+=" apply_en=? and check_en=? ";
|
| | | }
|
| | | sql+=" order by apply_date desc limit ?,?";
|
| | | List<Battinf_apply> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bapply.getApply_en(),bapply.getCheck_en(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | apply.setCheck_uname((new User_infImpl()).changeUidToUname(apply.getCheck_uid()));
|
| | | apply.setApply_date(rs.getTimestamp("apply_date"));
|
| | | apply.setApply_note(rs.getString("apply_note"));
|
| | | apply.setLongitude(rs.getDouble("longitude"));
|
| | | apply.setLatitude(rs.getDouble("latitude"));
|
| | | apply.setAddress(rs.getString("address"));
|
| | |
|
| | | BattInf binf=new BattInf();
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | |
| | | }
|
| | | //申请表中已审批通过的设备连接数
|
| | | public List devCommNum() {
|
| | | String sql=" select distinct db_battinf.tb_battinf_apply.FbsDeviceId,dev_commcount " +
|
| | | String sql=" select distinct db_battinf.tb_battinf_apply.FbsDeviceId,dev_commcount,dev_errcommcount " +
|
| | | " from db_battinf.tb_battinf_apply,db_ram_db.tb_fbs9100_state " +
|
| | | " where apply_en=1 and db_battinf.tb_battinf_apply.FbsDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
|
| | | + " order by apply_date desc" ;
|
| | |
| | | Fbs9100_state fbs=new Fbs9100_state();
|
| | | fbs.setDev_id(rs.getInt("FbsDeviceId"));
|
| | | fbs.setDev_commcount(rs.getInt("dev_commcount"));
|
| | | fbs.setDev_errcommcount(rs.getInt("dev_errcommcount"));
|
| | | list.add(fbs);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | Battinf_apply bapply=new Battinf_apply();
|
| | | bapply.setApply_date(ActionUtil.getSimpDate(date2));
|
| | | bapply.setApply_uid(1004);
|
| | | |
| | | bapply.setApply_en(1);
|
| | | bapply.setCheck_en(1);
|
| | |
|
| | | BattInf binf=new BattInf();
|
| | | binf.setStationName("广西省-百色-GX百色乐业县立新小区WF-BTS设备");
|
| | |
| | |
|
| | | Page page=new Page();
|
| | | page.setPageCurr(1);
|
| | | page.setPageSize(10);
|
| | | page.setPageSize(20);
|
| | | binf.setPage(page);
|
| | | bapply.setBinf(binf);
|
| | | /*List list=bimpl.serchByCondition(page);
|
| | | System.out.println(list.size());*/
|
| | | List list=bimpl.serchByCondition(bapply);
|
| | | System.out.println(list.size());
|
| | | /*List list=new ArrayList();
|
| | | list.add(bapply);
|
| | | boolean bl=bimpl.add(list);
|
| | |
| | | for (Fbs9100_state f : list) {
|
| | | System.out.println(f.getDev_id()+" "+f.getDev_commcount());
|
| | | }*/
|
| | | List list=bimpl.serchById(bapply);
|
| | | System.err.println(list.size());
|
| | | /*List list=bimpl.serchById(bapply);
|
| | | System.err.println(list.size());*/
|
| | | }
|
| | | }
|