|
|
|
|
@ -31,11 +31,11 @@ public class DumbJob implements Job {
|
|
|
|
|
|
|
|
|
|
private ArrayList<String> state;
|
|
|
|
|
|
|
|
|
|
private static String[] g_strDB = new String[4];
|
|
|
|
|
private static String g_strDB = "";
|
|
|
|
|
private String g_strTunnel = "";
|
|
|
|
|
|
|
|
|
|
private static String[] g_strFTP = new String[7];
|
|
|
|
|
|
|
|
|
|
private String g_strTenel = "";
|
|
|
|
|
private static String[] g_strFTP = new String[3];
|
|
|
|
|
private String g_strNotBrokenTunnel = "";
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
String str = "";
|
|
|
|
|
@ -57,23 +57,19 @@ public class DumbJob implements Job {
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
FileInputStream fis = new FileInputStream(propFile);
|
|
|
|
|
props.load(new BufferedInputStream(fis));
|
|
|
|
|
g_strDB[0] = props.getProperty("db_driver");
|
|
|
|
|
g_strDB[1] = props.getProperty("db_connect");
|
|
|
|
|
g_strDB[2] = props.getProperty("db_id");
|
|
|
|
|
g_strDB[3] = props.getProperty("db_pw");
|
|
|
|
|
System.out.println("=== " + g_strDB[0]);
|
|
|
|
|
System.out.println("=== " + g_strDB[1]);
|
|
|
|
|
System.out.println("=== " + g_strDB[2]);
|
|
|
|
|
System.out.println("=== " + g_strDB[3]);
|
|
|
|
|
g_strFTP[0] = props.getProperty("path_org");
|
|
|
|
|
g_strFTP[1] = props.getProperty("ftp_ip");
|
|
|
|
|
g_strFTP[2] = props.getProperty("ftp_id");
|
|
|
|
|
g_strFTP[3] = props.getProperty("ftp_pw");
|
|
|
|
|
g_strFTP[4] = props.getProperty("api_url");
|
|
|
|
|
g_strFTP[5] = props.getProperty("api_id");
|
|
|
|
|
g_strFTP[6] = props.getProperty("api_pw");
|
|
|
|
|
|
|
|
|
|
this.g_strTenel = props.getProperty("tennel_no");
|
|
|
|
|
|
|
|
|
|
g_strDB = props.getProperty("db_connect");
|
|
|
|
|
|
|
|
|
|
System.out.println("=== " + g_strDB);
|
|
|
|
|
|
|
|
|
|
this.g_strTunnel = props.getProperty("tunnel_no");
|
|
|
|
|
|
|
|
|
|
g_strFTP[0] = props.getProperty("api_url");
|
|
|
|
|
g_strFTP[1] = props.getProperty("api_id");
|
|
|
|
|
g_strFTP[2] = props.getProperty("api_pw");
|
|
|
|
|
|
|
|
|
|
this.g_strNotBrokenTunnel = props.getProperty("not_broken_tunnel_no");
|
|
|
|
|
|
|
|
|
|
props.clear();
|
|
|
|
|
props = null;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
@ -114,7 +110,7 @@ public class DumbJob implements Job {
|
|
|
|
|
map.put("0309", "07");
|
|
|
|
|
map.put("0310", "08");
|
|
|
|
|
JSONObject jsonParam = new JSONObject();
|
|
|
|
|
jsonParam.put("fareOfficeId", String.format("0%s", new Object[] { this.g_strTenel.trim() }));
|
|
|
|
|
jsonParam.put("fareOfficeId", String.format("0%s", new Object[] { this.g_strTunnel.trim() }));
|
|
|
|
|
jsonParam.put("start_dt", strPassDate);
|
|
|
|
|
jsonParam.put("end_dt", strPassDate);
|
|
|
|
|
StringBuffer strbuf = new StringBuffer();
|
|
|
|
|
@ -148,14 +144,35 @@ public class DumbJob implements Job {
|
|
|
|
|
System.out.println(objectInArray);
|
|
|
|
|
nBoothId = Integer.parseInt(map.get(String.valueOf(objectInArray.get("FARE_OFFICE_ID").toString()) + objectInArray.get("BOOTH_ID").toString()));
|
|
|
|
|
|
|
|
|
|
if(this.g_strNotBrokenTunnel != null && !this.g_strNotBrokenTunnel.trim().equals("")) {
|
|
|
|
|
if(!this.g_strNotBrokenTunnel.trim().equals(this.g_strTunnel.trim())) {
|
|
|
|
|
switch(nBoothId) {
|
|
|
|
|
case 1 :
|
|
|
|
|
nBoothId = 5;
|
|
|
|
|
break;
|
|
|
|
|
case 2 :
|
|
|
|
|
nBoothId = 6;
|
|
|
|
|
break;
|
|
|
|
|
case 3 :
|
|
|
|
|
nBoothId = 7;
|
|
|
|
|
break;
|
|
|
|
|
case 4 :
|
|
|
|
|
nBoothId = 8;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String uri = String.format("%s/download/video%d.mp4", new Object[] {
|
|
|
|
|
g_strFTP[4],
|
|
|
|
|
g_strFTP[0],
|
|
|
|
|
Integer.valueOf(nBoothId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String param_id_pw = String.format("user=%s&password=%s", new Object[] {
|
|
|
|
|
g_strFTP[5],
|
|
|
|
|
g_strFTP[6]
|
|
|
|
|
g_strFTP[1],
|
|
|
|
|
g_strFTP[2]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String param_start_end = String.format("start=%s&end=%s", new Object[] {
|
|
|
|
|
@ -187,8 +204,8 @@ public class DumbJob implements Job {
|
|
|
|
|
InputStreamReader isr = null;
|
|
|
|
|
BufferedReader br = null;
|
|
|
|
|
try {
|
|
|
|
|
URL url = new URL(g_strDB[1]);
|
|
|
|
|
this.logger.info("==== : " + g_strDB[1]);
|
|
|
|
|
URL url = new URL(g_strDB);
|
|
|
|
|
this.logger.info("==== : " + g_strDB);
|
|
|
|
|
connection = (HttpURLConnection)url.openConnection();
|
|
|
|
|
connection.setDoInput(true);
|
|
|
|
|
connection.setDoOutput(true);
|
|
|
|
|
|