| | |
| | | if(list!=null && list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | int uid=((User_inf)ActionUtil.getUser()).getUId();
|
| | | bapply.setApply_uid(uid);
|
| | | /*int uid=((User_inf)ActionUtil.getUser()).getUId();
|
| | | bapply.setApply_uid(uid);*/
|
| | | BattInf binf=bapply.getBinf();
|
| | | //验证新添加的机房是否存在
|
| | | List listS=(new BattInfImpl()).judgeBatt(binf);
|
| | |
| | | }
|
| | | maxb++;
|
| | | sql_str.add(sql);
|
| | | {
|
| | | /*{
|
| | | String msg=((User_inf)ActionUtil.getUser()).getUId()+"申请添加"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
|
| | | listU.add(ulog);
|
| | | }
|
| | | }*/
|
| | | }
|
| | | }
|
| | | Boolean bl=false;
|
| | |
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | //(new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | |
|
| | | return bl;
|
| | | }
|
| | |
| | | return bl;
|
| | |
|
| | | }
|
| | |
|
| | | public boolean del(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | //申请人再我的申请页面的修改操作
|
| | | public boolean updatePro(Object obj){
|
| | | List<Battinf_apply> list=(List<Battinf_apply>) obj;
|
| | | List<User_log> listU=new ArrayList<User_log>();//存放user_log
|
| | | ArrayList<String> sql_str=new ArrayList();
|
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | bapply.setConfrim_uid(((User_inf)ActionUtil.getUser()).getUId());
|
| | | BattInf binf=bapply.getBinf();
|
| | | String sql_update_apply= "update db_battinf.tb_battinf_apply set StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',"
|
| | | + "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()+" where num="+bapply.getNum();
|
| | | sql_str.add(sql_update_apply);
|
| | | {
|
| | | String msg="修改"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
|
| | | listU.add(ulog);
|
| | | }
|
| | | }
|
| | | }
|
| | | 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;
|
| | | }
|
| | | //我的申请中取消申请多条
|
| | | public boolean del(Object obj) {
|
| | | List<Battinf_apply> list=(List<Battinf_apply>) obj;
|
| | | List<User_log> listU=new ArrayList<User_log>();//存放user_log
|
| | | ArrayList<String> sql_str=new ArrayList();
|
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | BattInf binf=bapply.getBinf();
|
| | | String sql_del_apply=" delete from db_battinf.tb_battinf_apply where num="+bapply.getNum();
|
| | | sql_str.add(sql_del_apply);
|
| | | {
|
| | | String msg="取消"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的申请";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
|
| | | listU.add(ulog);
|
| | | }
|
| | | }
|
| | | }
|
| | | 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;
|
| | | }
|
| | |
|
| | | public List searchAll() {
|
| | |
| | | Battinf_apply apply=new Battinf_apply();
|
| | | apply.setNum(rs.getInt("num"));
|
| | | apply.setApply_uid(rs.getInt("apply_uid"));
|
| | | apply.setApply_name((new User_infImpl()).changeUidToUname(apply.getApply_uid()));
|
| | | apply.setConfrim_uid(rs.getInt("confrim_uid"));
|
| | | apply.setConfirm_name((new User_infImpl()).changeUidToUname(apply.getConfrim_uid()));
|
| | | apply.setApply_en(rs.getInt("apply_en"));
|
| | | apply.setApply_date(rs.getTimestamp("apply_date"));
|
| | | apply.setApply_note(rs.getString("apply_note"));
|
| | |
| | | ",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 " +
|
| | | " from db_battinf.tb_battinf_apply " +
|
| | | " where apply_en=? and apply_uid=? " +
|
| | | " where apply_en=? and apply_uid=? order by apply_date desc " +
|
| | | " limit ?,? ";
|
| | | List<Battinf_apply> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bapply.getApply_en(),bapply.getNum(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | |
| | | Battinf_apply apply=new Battinf_apply();
|
| | | apply.setNum(rs.getInt("num"));
|
| | | apply.setApply_uid(rs.getInt("apply_uid"));
|
| | | apply.setApply_name((new User_infImpl()).changeUidToUname(apply.getApply_uid()));
|
| | | apply.setConfrim_uid(rs.getInt("confrim_uid"));
|
| | | apply.setConfirm_name((new User_infImpl()).changeUidToUname(apply.getConfrim_uid()));
|
| | | apply.setApply_en(rs.getInt("apply_en"));
|
| | | apply.setApply_date(rs.getTimestamp("apply_date"));
|
| | | apply.setApply_note(rs.getString("apply_note"));
|
| | |
| | | int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
|
| | | //System.out.println("number: "+number);
|
| | | if(list!=null&&list.size()>0){
|
| | | list.get(list.size()-1).setNum(number);
|
| | | list.get(list.size()-1).setApply_note(String.valueOf(number));
|
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | public static void main(String[] args) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | Date date1 = sdf.parse("2000-01-01 00:00:00");
|
| | |
| | |
|
| | | BattInf binf=new BattInf();
|
| | | binf.setStationName1("湖北省");
|
| | | binf.setStationName2("武汉市");
|
| | | binf.setStationName3("荆门市");
|
| | | binf.setStationName2("荆门市");
|
| | | binf.setStationName3("测试设备机房2");
|
| | | binf.setStationName4("BTS设备");
|
| | | binf.setStationName5("钟祥");
|
| | | binf.setStationName5("沙洋县");
|
| | | binf.setStationId("4011100");
|
| | | binf.setStationIp("");
|
| | | binf.setFBSDeviceId(910001000);
|
| | |
| | | binf.setMonVolLowToAvg(0.05f );
|
| | | binf.setLoad_curr(15f);
|
| | | binf.setDisCurrMax(39.5f);
|
| | | binf.setStation_phone("12345678912"); |
| | | binf.setStation_phone("98765432198"); |
| | | binf.setBattProducer("");
|
| | | binf.setBattModel("");
|
| | | binf.setBattProductDate(ActionUtil.getSimpDate(date1));
|
| | |
| | | page.setPageSize(10);
|
| | | binf.setPage(page);
|
| | | bapply.setBinf(binf);
|
| | | List list=bimpl.serchByCondition(page);
|
| | | System.out.println(list.size());
|
| | | /*List list=new ArrayList();
|
| | | /*List list=bimpl.serchByCondition(page);
|
| | | System.out.println(list.size());*/
|
| | | List list=new ArrayList();
|
| | | list.add(bapply);
|
| | | boolean bl=bimpl.add(list);
|
| | | System.err.println(bl);*/
|
| | | System.err.println(bl);
|
| | | /*int dev_id=BattinfGroupFactory.searchmaxdev_id();
|
| | | System.out.println(dev_id);
|
| | | int station_id=BattinfGroupFactory.searchStationId();
|