package ccwp;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class Receive_50_info {
private static String db_config="db_config.properties";
public static String DRIVERS=null;
public static String USER=null;
public static String URL=null;
public static String PASSWORD=null;
public static long V_WAYBILLNO2;
static{
Properties props=new Properties();
InputStream inStr=null;
try{
inStr=ClassLoader.getSystemResourceAsStream(db_config);
props.load(inStr);
}catch (IOException e){
e.printStackTrace();
}
DRIVERS=props.getProperty("drivers");
URL=props.getProperty("url");
USER=props.getProperty("user");
PASSWORD=props.getProperty("pwd");
}
public static Connection getConnection(){
Connection con = null;
try{
con = DriverManager.getConnection(URL , USER , PASSWORD ) ;
}catch(SQLException se){
System.out.println("数据库连接失败!");
se.printStackTrace() ;
}
return con;}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Connection con = getConnection();
Statement statement = null;
String sql0=null;
String sql1=null;
String sql2=null;
String sql3=null;
long V_WAYBILLNO_long=0;
String V_WAYBILLNO="";
//long V_WAYBILLNO2;
//long V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
try {
statement=con.createStatement();
sql0="select max(t.waybill_no) max_no from tt_bar_record t where t.waybill_no like '723%'";
ResultSet result = statement.executeQuery(sql0);
while(result.next()){
V_WAYBILLNO_long=result.getLong("max_no");
}
V_WAYBILLNO_long=V_WAYBILLNO_long+1;
V_WAYBILLNO=String.valueOf(V_WAYBILLNO_long);
System.out.println(V_WAYBILLNO_long);//打印出要测试的运单号
sql1="insert into tt_bar_record" +
"(" +
"BAR_RECORD_ID," +
"WAYBILL_NO," +
"ZONE_CODE," +
"OP_CODE," +
"OP_ATTACH_INFO," +
"COURIER_CODE," +
"BAR_OPR_CODE," +
"BAR_UPLOAD_TM," +
"OBJ_TYPE_CODE," +
"CONTNR_CODE," +
"PAY_FLG," +
"STAY_WHY_CODE," +
"SUBBILL_PIECE_QTY," +
"BAR_UPLOAD_TYPE_CODE," +
"WEIGHT_QTY," +
"FEE_AMT," +
"ACCOUNTANT_CODE," +
"OTHER_INFO," +
"OP_NAME," +
"ZONE_TYPE_CODE," +
"ENCRYPT_STRING," +
"BAR_SN," +
"SCHEDULE_CODE," +
"SIGN_TYPE_CODE," +
"SRC_CONTNR_CODE," +
"PHONE_ZONE," +
"PHONE," +
"STOP_OVER_FLG," +
"BATCH_CODE," +
"DEST_ZONE_CODE," +
"AUTOLOADING," +
"BAR_SCAN_TM," +
"BAR_SCAN_DT," +
"EXTEND_ATTACH_1," +
"EXTEND_ATTACH_2," +
"BAR_UPLOAD_OPR_CODE," +
"EXTEND_ATTACH_3," +
"EXTEND_ATTACH_4," +
"EXTEND_ATTACH_5," +
"EXTEND_ATTACH_6," +
"EXTEND_ATTACH_7," +
"BAR_UPLOAD_TM_STD," +
"BAR_SCAN_TM_STD" +
")" +
"values" +
"(" +
V_WAYBILLNO +
","+
V_WAYBILLNO +
","+
"'755A'," +
"'50'," +
"''," +
"'046154'," +
"'1000005565'," +
"sysdate," +
"20," +
"''," +
"0," +
"''," +
"0," +
"0," +
"'1.000'," +
"0.0000," +
"''," +
"'T4'," +
"'派件中'," +
"0," +
"'424'," +
"'V6.6.2'," +
"''," +
"0," +
"''," +
"'755'," +
"'13421841858'," +
"0," +
"''," +
"''," +
"'1'," +
"sysdate," +
"sysdate," +
"''," +
"''," +
"'171403'," +
"''," +
"''," +
"''," +
"''," +
"sysdate," +
"sysdate," +
"sysdate" +
")";
//System.out.println("5555555555555");
System.out.println(V_WAYBILLNO);
V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
sql2="INSERT INTO tt_bar_record_log (record_id) SELECT bar_record_id FROM tt_bar_record WHERE waybill_no ='"+V_WAYBILLNO2+"'";
System.out.println(sql2);
sql3="commit";
//System.out.println("6666666666");
statement.executeQuery(sql1);
statement.executeQuery(sql3);
//System.out.println("6666666");
statement.executeQuery(sql2);
statement.executeQuery(sql3);
//System.out.println("77777777");
System.out.println("变量值"+V_WAYBILLNO2);
statement.executeQuery(sql3);
} catch (SQLException e) {
e.printStackTrace();
}
}
public long getBno(){Connection con = getConnection();
Statement statement = null;
String sql0=null;
String sql1=null;
String sql2=null;
String sql3=null;
long V_WAYBILLNO_long=0;
String V_WAYBILLNO="";
//long V_WAYBILLNO2;
//long V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
try {
statement=con.createStatement();
sql0="select max(t.waybill_no) max_no from tt_bar_record t where t.waybill_no like '723%'";
ResultSet result = statement.executeQuery(sql0);
while(result.next()){
V_WAYBILLNO_long=result.getLong("max_no");
}
V_WAYBILLNO_long=V_WAYBILLNO_long+1;
V_WAYBILLNO=String.valueOf(V_WAYBILLNO_long);
System.out.println(V_WAYBILLNO_long);//打印出要测试的运单号
sql1="insert into tt_bar_record" +
"(" +
"BAR_RECORD_ID," +
"WAYBILL_NO," +
"ZONE_CODE," +
"OP_CODE," +
"OP_ATTACH_INFO," +
"COURIER_CODE," +
"BAR_OPR_CODE," +
"BAR_UPLOAD_TM," +
"OBJ_TYPE_CODE," +
"CONTNR_CODE," +
"PAY_FLG," +
"STAY_WHY_CODE," +
"SUBBILL_PIECE_QTY," +
"BAR_UPLOAD_TYPE_CODE," +
"WEIGHT_QTY," +
"FEE_AMT," +
"ACCOUNTANT_CODE," +
"OTHER_INFO," +
"OP_NAME," +
"ZONE_TYPE_CODE," +
"ENCRYPT_STRING," +
"BAR_SN," +
"SCHEDULE_CODE," +
"SIGN_TYPE_CODE," +
"SRC_CONTNR_CODE," +
"PHONE_ZONE," +
"PHONE," +
"STOP_OVER_FLG," +
"BATCH_CODE," +
"DEST_ZONE_CODE," +
"AUTOLOADING," +
"BAR_SCAN_TM," +
"BAR_SCAN_DT," +
"EXTEND_ATTACH_1," +
"EXTEND_ATTACH_2," +
"BAR_UPLOAD_OPR_CODE," +
"EXTEND_ATTACH_3," +
"EXTEND_ATTACH_4," +
"EXTEND_ATTACH_5," +
"EXTEND_ATTACH_6," +
"EXTEND_ATTACH_7," +
"BAR_UPLOAD_TM_STD," +
"BAR_SCAN_TM_STD" +
")" +
"values" +
"(" +
V_WAYBILLNO +
","+
V_WAYBILLNO +
","+
"'755A'," +
"'50'," +
"''," +
"'046154'," +
"'1000005565'," +
"sysdate," +
"20," +
"''," +
"0," +
"''," +
"0," +
"0," +
"'1.000'," +
"0.0000," +
"''," +
"'T4'," +
"'派件中'," +
"0," +
"'424'," +
"'V6.6.2'," +
"''," +
"0," +
"''," +
"'755'," +
"'13692212840'," +
"0," +
"''," +
"''," +
"'1'," +
"sysdate," +
"sysdate," +
"''," +
"''," +
"'171403'," +
"''," +
"''," +
"''," +
"''," +
"sysdate," +
"sysdate," +
"sysdate" +
")";
System.out.println("5555555555555");
//sql2="SELECT bar_record_id FROM tt_bar_record WHERE waybill_no like"+ V_WAYBILLNO;
System.out.println(V_WAYBILLNO);
V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
sql2="INSERT INTO tt_bar_record_log (record_id) SELECT bar_record_id FROM tt_bar_record WHERE waybill_no ='"+V_WAYBILLNO2+"'";
System.out.println(sql2);
sql3="commit";
//System.out.println("6666666666");
statement.executeQuery(sql1);
statement.executeQuery(sql3);
System.out.println("6666666");
statement.executeQuery(sql2);
statement.executeQuery(sql3);
//System.out.println("77777777");
System.out.println("变量值"+V_WAYBILLNO2);
statement.executeQuery(sql3);
} catch (SQLException e) {
e.printStackTrace();
}
return V_WAYBILLNO2;
}
}
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class Receive_50_info {
private static String db_config="db_config.properties";
public static String DRIVERS=null;
public static String USER=null;
public static String URL=null;
public static String PASSWORD=null;
public static long V_WAYBILLNO2;
static{
Properties props=new Properties();
InputStream inStr=null;
try{
inStr=ClassLoader.getSystemResourceAsStream(db_config);
props.load(inStr);
}catch (IOException e){
e.printStackTrace();
}
DRIVERS=props.getProperty("drivers");
URL=props.getProperty("url");
USER=props.getProperty("user");
PASSWORD=props.getProperty("pwd");
}
public static Connection getConnection(){
Connection con = null;
try{
con = DriverManager.getConnection(URL , USER , PASSWORD ) ;
}catch(SQLException se){
System.out.println("数据库连接失败!");
se.printStackTrace() ;
}
return con;}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Connection con = getConnection();
Statement statement = null;
String sql0=null;
String sql1=null;
String sql2=null;
String sql3=null;
long V_WAYBILLNO_long=0;
String V_WAYBILLNO="";
//long V_WAYBILLNO2;
//long V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
try {
statement=con.createStatement();
sql0="select max(t.waybill_no) max_no from tt_bar_record t where t.waybill_no like '723%'";
ResultSet result = statement.executeQuery(sql0);
while(result.next()){
V_WAYBILLNO_long=result.getLong("max_no");
}
V_WAYBILLNO_long=V_WAYBILLNO_long+1;
V_WAYBILLNO=String.valueOf(V_WAYBILLNO_long);
System.out.println(V_WAYBILLNO_long);//打印出要测试的运单号
sql1="insert into tt_bar_record" +
"(" +
"BAR_RECORD_ID," +
"WAYBILL_NO," +
"ZONE_CODE," +
"OP_CODE," +
"OP_ATTACH_INFO," +
"COURIER_CODE," +
"BAR_OPR_CODE," +
"BAR_UPLOAD_TM," +
"OBJ_TYPE_CODE," +
"CONTNR_CODE," +
"PAY_FLG," +
"STAY_WHY_CODE," +
"SUBBILL_PIECE_QTY," +
"BAR_UPLOAD_TYPE_CODE," +
"WEIGHT_QTY," +
"FEE_AMT," +
"ACCOUNTANT_CODE," +
"OTHER_INFO," +
"OP_NAME," +
"ZONE_TYPE_CODE," +
"ENCRYPT_STRING," +
"BAR_SN," +
"SCHEDULE_CODE," +
"SIGN_TYPE_CODE," +
"SRC_CONTNR_CODE," +
"PHONE_ZONE," +
"PHONE," +
"STOP_OVER_FLG," +
"BATCH_CODE," +
"DEST_ZONE_CODE," +
"AUTOLOADING," +
"BAR_SCAN_TM," +
"BAR_SCAN_DT," +
"EXTEND_ATTACH_1," +
"EXTEND_ATTACH_2," +
"BAR_UPLOAD_OPR_CODE," +
"EXTEND_ATTACH_3," +
"EXTEND_ATTACH_4," +
"EXTEND_ATTACH_5," +
"EXTEND_ATTACH_6," +
"EXTEND_ATTACH_7," +
"BAR_UPLOAD_TM_STD," +
"BAR_SCAN_TM_STD" +
")" +
"values" +
"(" +
V_WAYBILLNO +
","+
V_WAYBILLNO +
","+
"'755A'," +
"'50'," +
"''," +
"'046154'," +
"'1000005565'," +
"sysdate," +
"20," +
"''," +
"0," +
"''," +
"0," +
"0," +
"'1.000'," +
"0.0000," +
"''," +
"'T4'," +
"'派件中'," +
"0," +
"'424'," +
"'V6.6.2'," +
"''," +
"0," +
"''," +
"'755'," +
"'13421841858'," +
"0," +
"''," +
"''," +
"'1'," +
"sysdate," +
"sysdate," +
"''," +
"''," +
"'171403'," +
"''," +
"''," +
"''," +
"''," +
"sysdate," +
"sysdate," +
"sysdate" +
")";
//System.out.println("5555555555555");
System.out.println(V_WAYBILLNO);
V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
sql2="INSERT INTO tt_bar_record_log (record_id) SELECT bar_record_id FROM tt_bar_record WHERE waybill_no ='"+V_WAYBILLNO2+"'";
System.out.println(sql2);
sql3="commit";
//System.out.println("6666666666");
statement.executeQuery(sql1);
statement.executeQuery(sql3);
//System.out.println("6666666");
statement.executeQuery(sql2);
statement.executeQuery(sql3);
//System.out.println("77777777");
System.out.println("变量值"+V_WAYBILLNO2);
statement.executeQuery(sql3);
} catch (SQLException e) {
e.printStackTrace();
}
}
public long getBno(){Connection con = getConnection();
Statement statement = null;
String sql0=null;
String sql1=null;
String sql2=null;
String sql3=null;
long V_WAYBILLNO_long=0;
String V_WAYBILLNO="";
//long V_WAYBILLNO2;
//long V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
try {
statement=con.createStatement();
sql0="select max(t.waybill_no) max_no from tt_bar_record t where t.waybill_no like '723%'";
ResultSet result = statement.executeQuery(sql0);
while(result.next()){
V_WAYBILLNO_long=result.getLong("max_no");
}
V_WAYBILLNO_long=V_WAYBILLNO_long+1;
V_WAYBILLNO=String.valueOf(V_WAYBILLNO_long);
System.out.println(V_WAYBILLNO_long);//打印出要测试的运单号
sql1="insert into tt_bar_record" +
"(" +
"BAR_RECORD_ID," +
"WAYBILL_NO," +
"ZONE_CODE," +
"OP_CODE," +
"OP_ATTACH_INFO," +
"COURIER_CODE," +
"BAR_OPR_CODE," +
"BAR_UPLOAD_TM," +
"OBJ_TYPE_CODE," +
"CONTNR_CODE," +
"PAY_FLG," +
"STAY_WHY_CODE," +
"SUBBILL_PIECE_QTY," +
"BAR_UPLOAD_TYPE_CODE," +
"WEIGHT_QTY," +
"FEE_AMT," +
"ACCOUNTANT_CODE," +
"OTHER_INFO," +
"OP_NAME," +
"ZONE_TYPE_CODE," +
"ENCRYPT_STRING," +
"BAR_SN," +
"SCHEDULE_CODE," +
"SIGN_TYPE_CODE," +
"SRC_CONTNR_CODE," +
"PHONE_ZONE," +
"PHONE," +
"STOP_OVER_FLG," +
"BATCH_CODE," +
"DEST_ZONE_CODE," +
"AUTOLOADING," +
"BAR_SCAN_TM," +
"BAR_SCAN_DT," +
"EXTEND_ATTACH_1," +
"EXTEND_ATTACH_2," +
"BAR_UPLOAD_OPR_CODE," +
"EXTEND_ATTACH_3," +
"EXTEND_ATTACH_4," +
"EXTEND_ATTACH_5," +
"EXTEND_ATTACH_6," +
"EXTEND_ATTACH_7," +
"BAR_UPLOAD_TM_STD," +
"BAR_SCAN_TM_STD" +
")" +
"values" +
"(" +
V_WAYBILLNO +
","+
V_WAYBILLNO +
","+
"'755A'," +
"'50'," +
"''," +
"'046154'," +
"'1000005565'," +
"sysdate," +
"20," +
"''," +
"0," +
"''," +
"0," +
"0," +
"'1.000'," +
"0.0000," +
"''," +
"'T4'," +
"'派件中'," +
"0," +
"'424'," +
"'V6.6.2'," +
"''," +
"0," +
"''," +
"'755'," +
"'13692212840'," +
"0," +
"''," +
"''," +
"'1'," +
"sysdate," +
"sysdate," +
"''," +
"''," +
"'171403'," +
"''," +
"''," +
"''," +
"''," +
"sysdate," +
"sysdate," +
"sysdate" +
")";
System.out.println("5555555555555");
//sql2="SELECT bar_record_id FROM tt_bar_record WHERE waybill_no like"+ V_WAYBILLNO;
System.out.println(V_WAYBILLNO);
V_WAYBILLNO2 = Long.parseLong(V_WAYBILLNO);
sql2="INSERT INTO tt_bar_record_log (record_id) SELECT bar_record_id FROM tt_bar_record WHERE waybill_no ='"+V_WAYBILLNO2+"'";
System.out.println(sql2);
sql3="commit";
//System.out.println("6666666666");
statement.executeQuery(sql1);
statement.executeQuery(sql3);
System.out.println("6666666");
statement.executeQuery(sql2);
statement.executeQuery(sql3);
//System.out.println("77777777");
System.out.println("变量值"+V_WAYBILLNO2);
statement.executeQuery(sql3);
} catch (SQLException e) {
e.printStackTrace();
}
return V_WAYBILLNO2;
}
}