| | |
| | |
|
| | | import javax.persistence.Id;
|
| | | import javax.sql.ConnectionEvent;
|
| | | import javax.swing.text.StyledEditorKit.BoldAction;
|
| | |
|
| | | import sun.security.action.GetBooleanAction;
|
| | |
|
| | |
| | | import com.fgkj.dto.Batttestdata;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | | import com.fgkj.dto.Batttestdatastop;
|
| | | import com.fgkj.dto.Database_backup;
|
| | | import com.fgkj.dto.Limit;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.RoleLimit;
|
| | |
| | | ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
|
| | | ","+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()+")";
|
| | | |
| | | /*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 ";
|
| | | sql_str.add(baoji_sql);*/
|
| | | if(binf.getStationId().equals(maxs)){
|
| | | maxs++;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | return bl;
|
| | |
|
| | |
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BattInf binf=list.get(i);
|
| | | //验证新添加的机房是否存在
|
| | | /*//验证新添加的机房是否存在
|
| | | List listS=(new BattInfImpl()).judgeBatt(binf);
|
| | | if(listS!=null&&listS.size()>0){
|
| | | binf.setStationId((String) listS.get(listS.size()-1));
|
| | |
| | | //获取当前最大的stationid
|
| | | int maxs=BattinfGroupFactory.searchStationId();
|
| | | binf.setStationId(String.valueOf(maxs));
|
| | | /*if(maxList!=null&&maxList.size()>0){
|
| | | 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()+"',"
|
| | | }
|
| | | }*/
|
| | | /*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()+"," +
|
| | | "MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"', "
|
| | | +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"',Station_install="+binf.getStation_install()+" where battgroupId="+binf.getBattGroupId();
|
| | | +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"',Station_install="+binf.getStation_install()+" where battgroupId="+binf.getBattGroupId();*/
|
| | | String sql = "replace into db_battinf.tb_battinf(" +
|
| | | "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,Station_install" +
|
| | | ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
|
| | | "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
|
| | | ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
|
| | | ","+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);
|
| | | {
|
| | | String msg="修改"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | return bl;
|
| | | }
|
| | | //修改电池信息配置(ip地址,掩码和网关)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | return bl;
|
| | | }
|
| | | //根据维护区和机房名称查询电池组信息(电池组信息配置)
|
| | |
| | | Page page=bmd.getPage();
|
| | | Connection conn= DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct(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,Station_install " +
|
| | | " From db_battinf.tb_battinf " +
|
| | | " Where StationName like ? and StationName1 like ? and StationName2 like ? and StationName5 like ? " +
|
| | | " order by StationId " +
|
| | |
| | | while (rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName3(rs.getString("stationName3"));
|
| | |
| | | binf.setInstall_user(rs.getString("install_user"));
|
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));
|
| | | list.add(binf);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | //添加电池组时查询出最大的机房id和电池组id
|
| | | public int searchMaxId(){
|
| | | //,max(battgroupid) as maxb
|
| | | String sql="select max(stationid) as stationid_maxs from db_battinf.tb_battinf limit 1";
|
| | | String sql="select max(StationId) as id from db_battinf.tb_battinf limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | try {
|
| | |
|
| | | while(rs.next()){
|
| | | int maxs=42000000;
|
| | | int maxs=42010000;
|
| | | //int maxb=1000001;
|
| | | if(rs.getString("stationid_maxs") != null){
|
| | | maxs=Integer.parseInt(rs.getString("stationid_maxs"));
|
| | | if(rs.getString("id") != null){
|
| | | maxs=Integer.parseInt(rs.getString("id"));
|
| | | }
|
| | | /*if(rs.getInt("maxb")!=0){
|
| | | maxb=rs.getInt("maxb");
|
| | |
| | | stationid=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return stationid;
|
| | | }
|
| | | //查询出当前存在内存中最大的设备的id(很重要**********)
|
| | | public int searchMaxdevId_binf(){
|
| | | String sql="select max(FbsDeviceId) as id from db_battinf.tb_battinf 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 dev_id=0;
|
| | | if(rs.getString("id")!=null){}
|
| | | dev_id=rs.getInt("id");
|
| | | list.add(dev_id);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int dev_id=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | dev_id=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | //判断新增的电池组是否存在
|
| | | public List judgeBatt(Object obj){
|
| | |
| | | }
|
| | | });
|
| | | return list;
|
| | | }
|
| | | //判断新增的电池组是否存在
|
| | | public boolean judgeBattInOrNot(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select distinct stationid from db_battinf.tb_battinf where stationname=? limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | String stationid=rs.getString("stationid");
|
| | | list.add(stationid);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | if(list!=null&&list.size()>0){
|
| | | return true;
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | }
|
| | | //0.4根据城市名称查电池组
|
| | | public List search(Object obj){
|
| | |
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("");
|
| | | binf.setStationName("广西省-百色-GX百色乐业县立新小区WF-BTS设备");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | |
| | | System.out.println(b);
|
| | | }
|
| | | System.out.println(list.size());*/
|
| | | int nums=biml.serchByInstall_count(uinf);
|
| | | System.out.println(nums);
|
| | | /*int nums=biml.serchByInstall_count(uinf);
|
| | | System.out.println(nums);*/
|
| | | boolean bl=biml.judgeBattInOrNot(binf);
|
| | | System.out.println(bl);
|
| | | }
|
| | |
|
| | | public List getResults(ResultSet rs) {
|