📄 scanbillthreadtwo.java~1~
字号:
package orderapp;/** * Title: * Description: * 补发线程,扫描bill表 * Copyright: Copyright (c) 2002 * Company: * @author * @version 1.0 */import utilities.*;import data.ConnectionPool;import java.sql.*;import data.*;public class scanBillThreadTwo extends Engine{ public ConnectionPool database; public ConnectionPool dataUpdate; public ResultSet rs; public ResultSet rsUpdate; public String sqlQuery,sqlUpdate; //public getContent pushSubmit; public XmlString xml; public long time; Utility Timer; public String submit; //----------------- public long row_id; public String bill_type; public String service_id; public String src_terminal_id; public int registered_delivery; public int fee_user_type; public int fee_type; public String fee_code; public int agent_flag; public String given_value; public int mo_relate_to_mt; public int pk_total; public int pk_number; public String dest_terminal_id; public int msg_type; public String msg_content; public String gateway_route; public String gateway_msg_id; public int gateway_result; public int gateway_confirmed; public int gateway_status; public int ih_process; public int ih_retry; public String create_time; //----------------- public scanBillThreadTwo() { setDaemon(true); database=new ConnectionPool(); dataUpdate=new ConnectionPool(); Timer=new Utility(); // pushSubmit=new getContent(); } public void run(){ while(true){ try{ time=Timer.createTime()-Config.resendTime*1000; //System.out.print(time+"biao"); Thread.sleep(60000); }catch(Exception e){ e.printStackTrace(); } try{ sqlQuery="select * from mobile_bill where ih_retry>0 and gateway_result<>0 and bill_type='mt'and create_time <"+time; rs=database.executeQuery(sqlQuery); //sqlUpdate="update mobile_bill set ih_retry = ih_retry-1,create_time="+time+" ,ih_process=0 where row_id ="; while(rs.next()){ row_id=rs.getLong("row_id"); bill_type=rs.getString("bill_type"); service_id=rs.getString("service_id"); src_terminal_id = rs.getString("src_terminal_id"); registered_delivery = rs.getInt("registered_delivery"); fee_user_type=rs.getInt("fee_user_type"); fee_type=rs.getInt("fee_type"); fee_code=rs.getString("fee_code"); agent_flag=rs.getInt("agent_flag"); given_value=rs.getString("given_value"); mo_relate_to_mt=rs.getInt("mo_relate_to_mt"); pk_total=rs.getInt("pk_total"); pk_number=rs.getInt("pk_number"); dest_terminal_id=rs.getString("dest_terminal_id"); msg_type=rs.getInt("msg_type"); msg_content=rs.getString("msg_content"); gateway_route=rs.getString("gateway_route"); gateway_msg_id=rs.getString("gateway_msg_id"); gateway_result=rs.getInt("gateway_result"); gateway_confirmed=rs.getInt("gateway_confirmed"); gateway_status=rs.getInt("gateway_status"); // public int ih_process=rs.getInt("ih_p"); // public int ih_retry; //public String create_time; //pushSubmit.getParameter(String.valueOf(wwwOrder.msg_id),wwwOrder.service_type,"ww",wwwOrder.order_id,wwwOrder.dest_number,wwwOrder.gateway,wwwOrder.mobile_number,wwwOrder.dest_number); //pushSubmit.insertSubmit(); //更新mobile_www_order表 submit="<cmpp_submit><source><name>1</name><guid>"+row_id+"</guid></source><destination><name>"+gateway_route+"</name></destination><src_terminal_id>"+src_terminal_id+"</src_terminal_id><dest_terminal_id>"+dest_terminal_id+"</dest_terminal_id><msg_fmt>"+msg_type+"</msg_fmt><tp_pid>0</tp_pid><tp_udhi>0</tp_udhi><registered_delivery>0</registered_delivery><service_id>"+service_id+"</service_id><fee_user_type>"+fee_user_type+"</fee_user_type><fee_type>"+fee_type+"</fee_type><fee_code>"+fee_code+"</fee_code><msg_content>"+msg_content+"</msg_content></cmpp_submit>\r\n"; Config.submit_queue.push(submit); //更新数据库应在回应后,在get_response中更新 //sqlUpdate+=row_id; //dataUpdate.executeUpdate(sqlUpdate); } rs.close(); } catch(Exception e){ e.printStackTrace(); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -