Package com.vsked.bean

Examples of com.vsked.bean.TblRecSms


            rs = pt.executeQuery();
            while(rs.next()) {
              if(tblRecSmsList==null){
                tblRecSmsList=new ArrayList<TblRecSms>();
              }
              TblRecSms trs=new TblRecSms();
              trs.setId(rs.getInt("id"));
              trs.setRecPhone(rs.getString("rec_phone"));
              trs.setRecTime(rs.getString("rec_time"));
              trs.setRecContent(rs.getString("rec_content"));
              trs.setRemark(rs.getString("remarks"));
              trs.setState(rs.getInt("state"));
              tblRecSmsList.add(trs);
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here


            rs = pt.executeQuery();
            while(rs.next()) {
              if(tblRecSmsList==null){
                tblRecSmsList=new ArrayList<TblRecSms>();
              }
              TblRecSms trs=new TblRecSms();
              trs.setId(rs.getInt("id"));
              trs.setRecPhone(rs.getString("rec_phone"));
              trs.setRecTime(rs.getString("rec_time"));
              trs.setRecContent(rs.getString("rec_content"));
              trs.setRemark(rs.getString("remarks"));
              trs.setState(rs.getInt("state"));
              tblRecSmsList.add(trs);
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        rs = pt.executeQuery();
        while(rs.next()) {
          if(tblRecSmsList==null){
            tblRecSmsList=new ArrayList<TblRecSms>();
          }
          TblRecSms trs=new TblRecSms();
          trs.setId(rs.getInt("id"));
          trs.setRecPhone(rs.getString("rec_phone"));
          trs.setRecTime(rs.getString("rec_time"));
          trs.setRecContent(rs.getString("rec_content"));
          trs.setRemark(rs.getString("remarks"));
          trs.setState(rs.getInt("state"));
          tblRecSmsList.add(trs);
        }

    } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

    try {
      List<TblRecSms> xhList = new TblRecSmsDAO().getTblRecSmsXH();
      Connection conn = ConnectDB.getSqlServerConnection();
      Statement st = conn.createStatement();
      for (int i = 0; i < xhList.size(); i++) {
        TblRecSms trs = xhList.get(i);
                /**
                 * 接收oracle选号函数处理结果
                 */
        String result = new TblRecSmsDAO()
            .getProcResult(trs.getRecPhone().replace(" ", ""), trs.getAgentId(),
                new TblSetNumberDAO().getTbNumberCount()
                    .getSetNumber(), trs.getChannelId(),
                    (trs.getRecContent().replace(" ", "").length()<=2?"":
                    trs.getRecContent().replace(" ", "").substring(2)));
        System.out.println("class:"+(trs.getRecContent().replace(" ", "").length()<=2?"":
          trs.getRecContent().replace(" ", "").substring(2)));
        st = new TblSmsSendDAO().add(st,
            new TblSmsSend(trs.getRecPhone(), result, 1));
        /**
         * 更新短信接收处理状态
         */
        new TblRecSmsDAO().updateIsNew(trs.getId());

      }//end for i
      /**
       * 执行
       */
 
View Full Code Here

    try{
      while(true){
        List<TblRecSms> trList=new TblRecSmsDAO().getNewCommandlib();
        if(trList!=null){
          for(int i=0;i<trList.size();i++){
            TblRecSms tr=trList.get(i);
            String sendSmsStr="";
            //is unknow command don't update remarks value
            boolean isNewComm=false;
            boolean isoldComm=false;
            isoldComm=new TbCommandlibDAO().isExistTbCommand(tr.getRecContent().trim());
            if(isoldComm==true)
            {
              TbCommandlib tc=new TbCommandlibDAO().getTbCommandlibByName(tr.getRecContent().trim());
              try{   
              System.out.println(tr.getRecContent()+""+tr.getRecTime());
                //更新最后执行手机号
                new TbCommandlibDAO().updateLastMobile(tc.getCommandlibId(), tr.getRecPhone().trim());
              String sql=tc.getCommandlibSql();
              String[] colArray=(sql.substring((sql.indexOf("select")+7),sql.indexOf("from"))).split(",");
              String[] tempArray=new String[colArray.length];
              Connection oracleConn=ConnectDB.getOracleConnection();
              Statement st=oracleConn.createStatement();
              tc.setCommandlibFormat(tc.getCommandlibFormat().replace("<num>", tr.getRecPhone().trim()));
              ResultSet rs=st.executeQuery(tc.getCommandlibSql().replace("<num>", tr.getRecPhone().trim()));
              //TODO 将删除
              System.out.println(tc.getCommandlibSql().replace("<num>", tr.getRecPhone()).trim());
              String tempDate=tc.getCommandlibFormat();
              int count=0;
              while(rs.next()){
                tc.setCommandlibFormat(tempDate);
                if(tc.getCommandlibFormat()!=null && !tc.getCommandlibFormat().equals(""))
                {
                for(int n=0;n<colArray.length;n++){
                  tempArray[n]=rs.getString(colArray[n].trim());
                  tc.setCommandlibFormat(tc.getCommandlibFormat().replace("<"+(n+1)+">", tempArray[n]));
                }
                sendSmsStr=tc.getCommandlibFormat();
                //TODO 将删除
                System.out.println(sendSmsStr);
                Connection conn=ConnectDB.getSqlServerConnection();
                Statement sta=conn.createStatement();
              
                sta=new TblSmsSendDAO().add(sta,new TblSmsSend(tr.getRecPhone(),sendSmsStr,2,tc.getCommandlibName()));
                sta.executeBatch();
                //执行成功+1
                new TbCommandlibDAO().updateSuccCount(tc.getCommandlibId());
                count++;
                sta.close();
                conn.close();
               
                }               
              }
              if(count==0){
                sendSmsStr=tc.getMsgNull();
                if(!"".equals(sendSmsStr.trim()))
                {
                Connection connn=ConnectDB.getSqlServerConnection();
                Statement stn=connn.createStatement();
                stn=new TblSmsSendDAO().add(stn,new TblSmsSend(tr.getRecPhone(),sendSmsStr,2,tc.getCommandlibName()));
                stn.executeBatch();
                 //执行成功+1
                new TbCommandlibDAO().updateSuccCount(tc.getCommandlibId());
                stn.close();
                connn.close();
                //TODO 将删除
                System.out.println(sendSmsStr);
                }
              }
              }catch(Exception e){
                e.printStackTrace();
                sendSmsStr=tc.getMsgErr();
                //TODO 将删除
                if(!"".equals(sendSmsStr.trim()))
                {
                System.out.println(sendSmsStr);
                Connection conne=ConnectDB.getSqlServerConnection();
                Statement ste=conne.createStatement();
                ste=new TblSmsSendDAO().add(ste,new TblSmsSend(tr.getRecPhone(),sendSmsStr,2,tc.getCommandlibName()));
                ste.executeBatch();
                //执行失败+1
                new TbCommandlibDAO().updateFailCount(tc.getCommandlibId());
                ste.close();
                conne.close();
                }
               
              }
             
             
            }else{
              //未知指令判定
              TbSetMsg tsm=new TbSetMsgDAO().getTbSetMsg();
              if(tsm.getIsEnable()==0){
                 Connection conne=ConnectDB.getSqlServerConnection();
                 Statement ste=conne.createStatement();
                 sendSmsStr=tsm.getMsgMemo();
                 ste=new TblSmsSendDAO().add(ste,new TblSmsSend(tr.getRecPhone(),sendSmsStr,2,"未知指令"));
                 ste.executeBatch();
                 ste.close();
                 conne.close();
                 isNewComm=true;
              }
             
            }
            if(isoldComm==true)
            new TblRecSmsDAO().updateIsCommand(tr.getId());
            if(isNewComm!=true)
            new TblRecSmsDAO().updateIsNew(tr.getId());
         
          }//end fori
        }//end if trList
        Thread.currentThread().sleep(5000);
       
View Full Code Here

            System.out.println(sql);
            pt = conn.prepareStatement(sql);
            rs = pt.executeQuery();
            tblRecSmsList=new ArrayList<TblRecSms>();
            while(rs.next()) {
              TblRecSms trs=new TblRecSms();
              trs.setId(rs.getInt("id"));
              trs.setRecPhone(rs.getString("rec_phone"));
              trs.setRecTime(rs.getString("rec_time"));
              trs.setRecContent(rs.getString("rec_content"));
              trs.setRemark(rs.getString("remarks"));
              trs.setState(rs.getInt("state"));
              trs.setChannelId(rs.getString("channel_id"));
              trs.setAgentId(rs.getString("agent_id"));
              tblRecSmsList.add(trs);
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.vsked.bean.TblRecSms

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.