public class PushNewBarcodeToPool
extends Engine {
//用于计数,是否到了给PUSH已发送但未取票的用户再次发送
public static int min = 0;
String sql = "";
//String sql = "select * from tom_ticket_order";
DbConnect db;
public PushNewBarcodeToPool() {
super("PushNewBarcodeToPool");
setDaemon(true);
db = new DbConnect();
}
public void run() {
while (true) {
Vector vResult = new Vector();
//获得需要发送二维码的用户 判断是否为PUSH已发送未取票需再次发送或是PUSH需要发送的
if(min ==0 || min == 360) {
sql = "select a.order_id, a.ticket_id, a.phone_no, a.order_name, a.order_time, a.ticket_counts, a.email, a.user_no, b.hold_no, b.area_code,b.ticket_no, b.eff_time, b.exp_time, b.barcode_name, b.barcode_addr, a.send_flag,b.company_no from tom_ticket_order a, tbc_ticket_info b where a.status='Q0A' and (a.send_flag not like 'Q0S%') and a.send_times<1 and a.ticket_id=b.ticket_id";
if(min == 360)
min= 0;
}else {
sql = "select a.order_id, a.ticket_id, a.phone_no, a.order_name, a.order_time, a.ticket_counts, a.email, a.user_no, b.hold_no, b.area_code,b.ticket_no, b.eff_time, b.exp_time, b.barcode_name, b.barcode_addr, a.send_flag,b.company_no from tom_ticket_order a, tbc_ticket_info b where a.status='Q0A' and (a.send_flag not like 'Q0S%' and a.send_flag not like 'Q0M%') and a.send_times<1 and a.ticket_id=b.ticket_id";
}
vResult = (Vector) db.executeSQL(sql);
int size = vResult.size();
//如果有需要发送二维码的用户
if (size > 0) {