📄 getcontent.java
字号:
package data;/** * Title: * Description:"row_id"是主键 * 根据mo池中的参数,从content,serivce表中读取相应值封装一个submit包,压入submit池 * Copyright: Copyright (c) 2002 * Company: * @author * @version 1.0 */import java.sql.*;import orderapp.*;import utilities.Utility;public class getContent { public long id; public ConnectionPool database; public String msg_id; public String service_type; public String bill_type; public String gateway_msg_id; public String src_terminal_id; public String source_name; public String registered_delivery; public String sqlQuery; public String sql; public String submitStr; public submit billContent; public int order_id; public int msg_type; public Utility Time; public String dest_number; public String wwwGateway; public String wwwSrcNumber; public String wwwDestNumber; public boolean result=false; public boolean rsBool=false; public boolean msg_idRight=false;//点播的msg_id是否正确 public String MaxRow; public ResultSet rsTmp; //获得费率 public getFee GetFee; public fee Fee; public data.Content otherContent; public String thirdGatewayName; public long thirdNum; public getContent(){ Time=new Utility(); database=new ConnectionPool(); //获得最大row_id号 MaxRow="select max(row_id) from mobile_bill "; rsTmp=database.executeQuery(MaxRow); try{ rsTmp.next(); Config.id=rsTmp.getLong("max(row_id)"); //System.out.println(Config.id); } catch(Exception e){ Config.id=0; e.printStackTrace(); } GetFee=new getFee(); otherContent=new data.Content(); } //www型 public synchronized void getParameter(String msg_id,String service_type,String bill_type,int order_id,String dest_number,String gateway,String wwwSrcNumber,String wwwDestNumber) { this.msg_id=msg_id; this.service_type=service_type; this.bill_type=bill_type; this.order_id=order_id;//没用了 this.dest_number=dest_number; this.wwwGateway=gateway; this.wwwSrcNumber =wwwSrcNumber; this.src_terminal_id = wwwSrcNumber; this.wwwDestNumber=wwwDestNumber; //费率 this.Fee=GetFee.get(service_type); try{ sqlQuery="select msg_type ,msg_content, pk_total,pk_number from mobile_content where service_type like '"+this.service_type+"' and msg_id = "+Integer.parseInt(this.msg_id) +" order by pk_number"; //System.out.println(this.msg_id); msg_idRight=true; } catch(Exception e){ msg_idRight=false; } } //非www型 public synchronized void getParameter(String thirdGatewayName,long thirdNum,String msg_id,String service_type,String bill_type,String gateway_msg_id,String src_terminal_id,String registered_delivery,String source_name,String msg_fmt) { this.thirdGatewayName=thirdGatewayName; this.thirdNum=thirdNum; this.msg_id=msg_id; this.service_type=service_type; this.bill_type=bill_type; this.src_terminal_id =src_terminal_id; this.registered_delivery = registered_delivery; this.source_name=source_name; this.gateway_msg_id = gateway_msg_id;//MO中的msg_id,写mobile_bill表的gateway_msg_id 注 Mo中的msg_content中的内容为mobile_content表中的msg_id //this.msg_fmt=msg_fmt; //this.order_id=order_id; //费率 this.Fee=GetFee.get(service_type); //System.out.println(service_type); // System.out.println(Fee.service_id+"::::"); //System.out.println(this.Fee.fee_user_type+"::::"); try{ sqlQuery="select msg_type ,msg_content ,pk_total,pk_number from mobile_content where service_type like '"+this.service_type+"' and msg_id = "+this.msg_id +" order by pk_number"; System.out.print(sqlQuery); msg_idRight=true; }catch(Exception e){ msg_idRight=false; } } public synchronized boolean insertSubmit(){ ResultSet rs=null; /* try{ rsTmp=database.executeQuery(MaxRow); rsTmp.last(); id=(long)rsTmp.getInt("row_id"); System.out.println("---"+id); rsTmp.close(); } catch(Exception e){ id=0; e.printStackTrace(); } */ //id++; try{ rs=database.executeQuery(sqlQuery); rsBool=rs.next();//sure have rs rs.beforeFirst(); //System.out.print(rsBool); } catch(Exception e){ rsBool=false; Config.LogPool.push("Find a Error Mo!"); } //if(!rsBool||!msg_idRight||this.thirdGatewayName == null){//MO信息点播错误的内容(??包括www的)不加入mobile_bill表 if(!rsBool||!msg_idRight){ System.out.println(rsBool +"bb"+ msg_idRight); submitStr="<cmpp_submit><source><name>1</name><guid>"+(Config.id)+"</guid></source><destination><name>"+this.source_name+"</name></destination><src_terminal_id>"+Config.service_code+"</src_terminal_id><dest_terminal_id>"+this.src_terminal_id+"</dest_terminal_id><msg_fmt>15</msg_fmt><tp_pid>0</tp_pid><tp_udhi>0</tp_udhi><registered_delivery>0</registered_delivery><service_id></service_id><fee_user_type>0</fee_user_type><fee_type>01</fee_type><fee_code>000000</fee_code><msg_content>"+utilities.Utility.toHexString(Config.error)+"</msg_content></cmpp_submit>\r\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -