| | |
| | |
|
| | | 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;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | 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;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | 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,Station_install " +
|
| | | " From db_battinf.tb_battinf " +
|
| | |
| | | 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"));
|
| | |
| | | }
|
| | | //添加电池组时查询出最大的机房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 GREATEST((select max(StationId) from db_battinf.tb_battinf) ,(select max(StationId) from db_battinf.tb_battinf_apply)) as id";
|
| | | 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");
|
| | |
| | | }
|
| | | 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){
|
| | | BattInf binf=(BattInf) obj;
|