최초커밋

main
이범준 5 months ago
parent 2209758009
commit 2973e90020

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,109 @@
/* */ import java.util.ArrayList;
/* */ import java.util.Hashtable;
/* */ import java.util.Map;
/* */ import org.quartz.CronScheduleBuilder;
/* */ import org.quartz.CronTrigger;
/* */ import org.quartz.JobBuilder;
/* */ import org.quartz.JobDetail;
/* */ import org.quartz.ScheduleBuilder;
/* */ import org.quartz.Scheduler;
/* */ import org.quartz.SchedulerException;
/* */ import org.quartz.Trigger;
/* */ import org.quartz.TriggerBuilder;
/* */ import org.quartz.impl.StdSchedulerFactory;
/* */
/* */
/* */
/* */ public class AnprCarInfoSend
/* */ {
/* */ public static void main(String[] args) {
/* 20 */ String str = "*/1 * * * * ?";
/* 21 */ if (args.length > 0) {
/* 22 */ str = String.format("*/%s * * * * ?", new Object[] { args[0] });
/* */ }
/* */
/* 25 */ AnprStateSend anpr = new AnprStateSend(str);
/* 26 */ anpr.runCarNoImageSend();
/* */ }
/* */ public AnprCarInfoSend() {
/* 29 */ Map<String, Boolean> mapIsRun_1 = new Hashtable<>();
/* 30 */ Map<String, Boolean> mapIsRun_3 = new Hashtable<>();
/* */
/* */
/* */
/* */
/* */
/* 36 */ mapIsRun_1.put("01", Boolean.valueOf(false));
/* 37 */ mapIsRun_1.put("02", Boolean.valueOf(false));
/* 38 */ mapIsRun_1.put("03", Boolean.valueOf(false));
/* 39 */ mapIsRun_1.put("04", Boolean.valueOf(false));
/* 40 */ mapIsRun_1.put("05", Boolean.valueOf(false));
/* 41 */ mapIsRun_1.put("06", Boolean.valueOf(false));
/* 42 */ mapIsRun_1.put("07", Boolean.valueOf(false));
/* 43 */ mapIsRun_1.put("08", Boolean.valueOf(false));
/* */
/* 45 */ mapIsRun_3.put("01", Boolean.valueOf(false));
/* 46 */ mapIsRun_3.put("02", Boolean.valueOf(false));
/* 47 */ mapIsRun_3.put("03", Boolean.valueOf(false));
/* 48 */ mapIsRun_3.put("04", Boolean.valueOf(false));
/* 49 */ mapIsRun_3.put("05", Boolean.valueOf(false));
/* 50 */ mapIsRun_3.put("06", Boolean.valueOf(false));
/* 51 */ mapIsRun_3.put("07", Boolean.valueOf(false));
/* 52 */ mapIsRun_3.put("08", Boolean.valueOf(false));
/* 53 */ mapIsRun_3.put("09", Boolean.valueOf(false));
/* 54 */ mapIsRun_3.put("10", Boolean.valueOf(false));
/* */ }
/* */
/* */
/* */ public void runAnprCarInfo(String str) {
/* */ try {
/* 60 */ ArrayList<String> state = new ArrayList<>();
/* */
/* */
/* */
/* */
/* */
/* 66 */ JobDetail job = JobBuilder.newJob(AnprImageJob.class)
/* 67 */ .withIdentity("testJob")
/* 68 */ .usingJobData("jobSays", "ant.xml")
/* 69 */ .usingJobData("myFloatValue", Float.valueOf(3.141F)).build();
/* */
/* 71 */ job.getJobDataMap().put("state", state);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 81 */ CronTrigger cronTrigger =
/* 82 */ (CronTrigger)TriggerBuilder.newTrigger()
/* 83 */ .withIdentity("crontrigger", "crontriggergroup1")
/* 84 */ .withSchedule(
/* 85 */ (ScheduleBuilder)CronScheduleBuilder.cronSchedule("*/5 * * * * ?"))
/* */
/* 87 */ .build();
/* */
/* */
/* 90 */ StdSchedulerFactory stdSchedulerFactory = new StdSchedulerFactory();
/* 91 */ Scheduler sch = stdSchedulerFactory.getScheduler();
/* */
/* */
/* */
/* 95 */ sch.start();
/* 96 */ sch.scheduleJob(job, (Trigger)cronTrigger);
/* */
/* */ }
/* 99 */ catch (SchedulerException e) {
/* 100 */ e.printStackTrace();
/* */ }
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\AnprCarInfoSend.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,167 @@
/* */ import java.io.BufferedInputStream;
/* */ import java.io.FileInputStream;
/* */ import java.util.ArrayList;
/* */ import java.util.Date;
/* */ import java.util.List;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */ import org.apache.log4j.PropertyConfigurator;
/* */ import org.quartz.DisallowConcurrentExecution;
/* */ import org.quartz.Job;
/* */ import org.quartz.JobExecutionContext;
/* */ import org.quartz.JobExecutionException;
/* */ import org.quartz.JobKey;
/* */ import org.quartz.PersistJobDataAfterExecution;
/* */
/* */ @PersistJobDataAfterExecution
/* */ @DisallowConcurrentExecution
/* */ public class AnprImageJob
/* */ implements Job
/* */ {
/* */ private String jobSays;
/* */ private float myFloatValue;
/* */ private ArrayList<Date> state;
/* 24 */ private String g_strTenel = "";
/* 25 */ private List<String> g_listN1 = new ArrayList<>();
/* 26 */ private List<String> g_listN3 = new ArrayList<>();
/* */
/* */ private boolean g_isRunning = false;
/* */
/* 30 */ private final Logger logger = Logger.getLogger(AnprImageJob.class);
/* */
/* */ public AnprImageJob() {
/* 33 */ PropertyConfigurator.configure("./log4j.properties");
/* */
/* */
/* */ try {
/* 37 */ String propFile = "./config.properties";
/* */
/* */
/* 40 */ Properties props = new Properties();
/* */
/* */
/* 43 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 46 */ props.load(new BufferedInputStream(fis));
/* */
/* 48 */ this.g_strTenel = props.getProperty("tennel_no");
/* */
/* 50 */ props.clear();
/* 51 */ props = null;
/* 52 */ System.out.println("===================== A");
/* */
/* 54 */ this.g_listN1.add("01");
/* 55 */ this.g_listN1.add("02");
/* 56 */ this.g_listN1.add("03");
/* 57 */ this.g_listN1.add("04");
/* 58 */ this.g_listN1.add("05");
/* 59 */ this.g_listN1.add("06");
/* 60 */ this.g_listN1.add("07");
/* 61 */ this.g_listN1.add("08");
/* */
/* 63 */ this.g_listN3.add("01");
/* 64 */ this.g_listN3.add("02");
/* 65 */ this.g_listN3.add("03");
/* 66 */ this.g_listN3.add("04");
/* */
/* */
/* 69 */ this.g_listN3.add("07");
/* 70 */ this.g_listN3.add("08");
/* 71 */ this.g_listN3.add("09");
/* 72 */ this.g_listN3.add("10");
/* 73 */ System.out.println("===================== B");
/* 74 */ } catch (Exception e) {
/* 75 */ this.logger.debug("Exception : " + e);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void execute(JobExecutionContext context) throws JobExecutionException {
/* 85 */ JobKey key = context.getJobDetail().getKey();
/* 86 */ this.state.add(new Date());
/* */
/* 88 */ this.logger.info("Instance " + key + " of DmbJob says: " + this.jobSays + ", and val is: " + this.myFloatValue +
/* 89 */ ", state size:" + this.state.size() + "," + this.state.get(this.state.size() - 1));
/* */
/* 91 */ this.logger.debug("======== 차로개수 : " + this.g_listN3.size());
/* 92 */ List<String> list = new ArrayList<>();
/* 93 */ if (this.g_strTenel.equals("3")) {
/* 94 */ list.addAll(this.g_listN3);
/* 95 */ } else if (this.g_strTenel.equals("1")) {
/* 96 */ list.addAll(this.g_listN1);
/* */ } else {
/* */ return;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 118 */ if (this.g_isRunning) {
/* 119 */ this.logger.debug("======== 기존 쓰레드 미완료로 미수행");
/* */
/* */ return;
/* */ }
/* */
/* 124 */ this.g_isRunning = true;
/* */
/* 126 */ SendThread obj = null;
/* 127 */ for (int i = 0; i < list.size(); i++) {
/* */
/* 129 */ this.logger.info(String.format("%s차로 시작", new Object[] { list.get(i) }));
/* */
/* 131 */ obj = new SendThread(list.get(i));
/* 132 */ obj.runCarNoImageSend();
/* */
/* */
/* */ try {
/* 136 */ Thread.sleep(5L);
/* */ }
/* 138 */ catch (InterruptedException e) {
/* 139 */ e.printStackTrace();
/* */ } finally {
/* */
/* 142 */ this.g_isRunning = false;
/* */ }
/* */
/* 145 */ this.logger.info(String.format("%s차로 끝", new Object[] { list.get(i) }));
/* */ }
/* */ }
/* */
/* */
/* */ public void setJobSays(String jobSays) {
/* 151 */ this.jobSays = jobSays;
/* */ }
/* */
/* */ public void setMyFloatValue(float myFloatValue) {
/* 155 */ this.myFloatValue = myFloatValue;
/* */ }
/* */
/* */ public void setState(ArrayList<Date> state) {
/* 159 */ this.state = state;
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\AnprImageJob.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,216 @@
/* */ import java.io.BufferedInputStream;
/* */ import java.io.BufferedOutputStream;
/* */ import java.io.BufferedReader;
/* */ import java.io.FileInputStream;
/* */ import java.io.InputStream;
/* */ import java.io.InputStreamReader;
/* */ import java.net.HttpURLConnection;
/* */ import java.net.URL;
/* */ import java.text.SimpleDateFormat;
/* */ import java.util.ArrayList;
/* */ import java.util.Date;
/* */ import java.util.HashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */ import org.json.simple.JSONObject;
/* */
/* */ public class AnprStateSend
/* */ extends Thread
/* */ {
/* 22 */ private String[] g_strDB = new String[4];
/* 23 */ private String[] g_strFTP = new String[6];
/* 24 */ private String[] g_strFTPColl = new String[4];
/* */
/* 26 */ private String g_strTenel = "";
/* 27 */ private String g_strLane = "";
/* */
/* 29 */ private String g_strApiUrAnprStatusl = "";
/* */
/* 31 */ private final Logger logger = Logger.getLogger(AnprStateSend.class);
/* */
/* */
/* */ public AnprStateSend(String str) {
/* */ try {
/* 36 */ String propFile = "./config.properties";
/* */
/* */
/* 39 */ Properties props = new Properties();
/* */
/* */
/* 42 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 45 */ props.load(new BufferedInputStream(fis));
/* */
/* */
/* 48 */ this.g_strDB[0] = props.getProperty("db_driver");
/* 49 */ this.g_strDB[1] = props.getProperty("db_connect");
/* 50 */ this.g_strDB[2] = props.getProperty("db_id");
/* 51 */ this.g_strDB[3] = props.getProperty("db_pw");
/* */
/* */
/* 54 */ this.g_strFTP[0] = props.getProperty("path_org");
/* 55 */ this.g_strFTP[1] = props.getProperty("ftp_ip");
/* 56 */ this.g_strFTP[2] = props.getProperty("ftp_id");
/* 57 */ this.g_strFTP[3] = props.getProperty("ftp_pw");
/* 58 */ this.g_strFTP[4] = props.getProperty("api_url");
/* 59 */ this.g_strFTP[5] = props.getProperty("path_desc");
/* */
/* 61 */ this.g_strFTPColl[0] = props.getProperty("coll_ftp_ip");
/* 62 */ this.g_strFTPColl[1] = props.getProperty("coll_ftp_id");
/* 63 */ this.g_strFTPColl[2] = props.getProperty("coll_ftp_pw");
/* 64 */ this.g_strFTPColl[3] = props.getProperty("center_ftp_ip");
/* */
/* 66 */ this.g_strTenel = props.getProperty("tennel_no");
/* 67 */ this.g_strLane = str;
/* */
/* 69 */ this.g_strApiUrAnprStatusl = props.getProperty("api_url_status");
/* */
/* 71 */ props.clear();
/* 72 */ props = null;
/* */ }
/* 74 */ catch (Exception e) {
/* 75 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public void run() {
/* 84 */ runCarNoImageSend();
/* 85 */ this.logger.debug(String.format("=======================================================", new Object[0]));
/* */ }
/* */
/* */
/* */
/* */
/* */ public void runCarNoImageSend() {
/* 92 */ Map<String, String> cctvID = new HashMap<>();
/* */
/* 94 */ cctvID.put("101", "A10401001");
/* 95 */ cctvID.put("102", "A10301002");
/* 96 */ cctvID.put("103", "A10201003");
/* 97 */ cctvID.put("104", "A10101004");
/* 98 */ cctvID.put("105", "A10111005");
/* 99 */ cctvID.put("106", "A10211006");
/* 100 */ cctvID.put("107", "A10311007");
/* 101 */ cctvID.put("108", "A10411008");
/* 102 */ cctvID.put("301", "A10503001");
/* 103 */ cctvID.put("302", "A10403002");
/* 104 */ cctvID.put("303", "A10303003");
/* 105 */ cctvID.put("304", "A10203004");
/* 106 */ cctvID.put("307", "A10213005");
/* 107 */ cctvID.put("308", "A10313006");
/* 108 */ cctvID.put("309", "A10413007");
/* 109 */ cctvID.put("310", "A10513008");
/* */
/* 111 */ Date date_now = new Date(System.currentTimeMillis());
/* 112 */ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
/* 113 */ String strDate = sdf.format(date_now);
/* 114 */ this.logger.debug("===========" + strDate);
/* */
/* */
/* 117 */ List<String> temp = new ArrayList<>();
/* 118 */ temp.add("13");
/* 119 */ temp.add("11");
/* 120 */ temp.add("12");
/* */
/* 122 */ int n = (int)(Math.random() * 1000.0D) % 3;
/* */
/* 124 */ JSONObject jsonParam = new JSONObject();
/* 125 */ jsonParam.put("camId", cctvID.get(String.valueOf(this.g_strTenel) + this.g_strLane));
/* 126 */ jsonParam.put("colctTime", strDate);
/* 127 */ jsonParam.put("camConectSttus", "0");
/* 128 */ jsonParam.put("rtuTp", temp.get(n % 3));
/* 129 */ jsonParam.put("bxDoorSttus", "0");
/* 130 */ jsonParam.put("camSdCardSttus", "0");
/* 131 */ this.logger.debug("============== : " + jsonParam.toJSONString());
/* 132 */ callAnprCarnoSend(jsonParam.toJSONString());
/* 133 */ jsonParam.clear();
/* */ }
/* */
/* */
/* */ private void callAnprCarnoSend(String strJson) {
/* 138 */ HttpURLConnection connection = null;
/* 139 */ InputStream is = null;
/* 140 */ InputStreamReader isr = null;
/* 141 */ BufferedReader br = null;
/* */
/* */ try {
/* 144 */ URL url = new URL(this.g_strApiUrAnprStatusl);
/* 145 */ this.logger.debug("==== 수집서버 주소 : " + this.g_strApiUrAnprStatusl);
/* */
/* 147 */ connection = (HttpURLConnection)url.openConnection();
/* */
/* 149 */ connection.setDoInput(true);
/* 150 */ connection.setDoOutput(true);
/* 151 */ connection.setUseCaches(false);
/* 152 */ connection.setRequestMethod("POST");
/* */
/* 154 */ connection.setConnectTimeout(30000);
/* */
/* 156 */ connection.setReadTimeout(30000);
/* */
/* */
/* */
/* 160 */ connection.setRequestProperty("Accept", "application/json");
/* 161 */ connection.setRequestProperty("Content-Type", "application/json");
/* */
/* */
/* 164 */ BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
/* 165 */ bos.write(strJson.getBytes("UTF-8"));
/* 166 */ bos.flush();
/* 167 */ bos.close();
/* */
/* 169 */ int resCode = connection.getResponseCode();
/* 170 */ StringBuffer sb = new StringBuffer();
/* 171 */ String inputLine = null;
/* */
/* 173 */ this.logger.debug("==== : " + resCode);
/* 174 */ if (resCode == 200) {
/* 175 */ is = connection.getInputStream();
/* 176 */ isr = new InputStreamReader(is, "UTF-8");
/* 177 */ br = new BufferedReader(isr);
/* */
/* 179 */ while ((inputLine = br.readLine()) != null) {
/* 180 */ sb.append(inputLine);
/* */ }
/* */
/* 183 */ this.logger.debug("==== " + sb.toString());
/* */ }
/* 185 */ else if (connection.getErrorStream() != null) {
/* 186 */ br = new BufferedReader(new InputStreamReader(connection.getErrorStream(), "UTF-8"));
/* */
/* 188 */ while ((inputLine = br.readLine()) != null) {
/* 189 */ sb.append(inputLine);
/* */ }
/* 191 */ this.logger.debug("==== Http Error Resopnse : " + sb.toString());
/* */ } else {
/* 193 */ this.logger.debug("==== Http Error Resopnse : " + sb.toString());
/* */ }
/* */
/* 196 */ } catch (Exception e) {
/* 197 */ e.printStackTrace();
/* 198 */ this.logger.debug("==== Http Error Resopnse : ");
/* */ } finally {
/* */ try {
/* 201 */ if (is != null)
/* 202 */ is.close();
/* 203 */ if (isr != null)
/* 204 */ isr.close();
/* 205 */ if (br != null)
/* 206 */ br.close();
/* 207 */ } catch (Exception exception) {}
/* */ }
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\AnprStateSend.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,111 @@
/* */ import java.util.ArrayList;
/* */ import java.util.Hashtable;
/* */ import java.util.Map;
/* */ import org.quartz.CronScheduleBuilder;
/* */ import org.quartz.CronTrigger;
/* */ import org.quartz.JobBuilder;
/* */ import org.quartz.JobDetail;
/* */ import org.quartz.ScheduleBuilder;
/* */ import org.quartz.Scheduler;
/* */ import org.quartz.SchedulerException;
/* */ import org.quartz.Trigger;
/* */ import org.quartz.TriggerBuilder;
/* */ import org.quartz.impl.StdSchedulerFactory;
/* */
/* */
/* */ public class AnprStatusInfo
/* */ {
/* */ public static void main(String[] args) {
/* 19 */ String str = "*/1 * * * * ?";
/* 20 */ if (args.length > 0) {
/* 21 */ str = String.format("*/%s * * * * ?", new Object[] { args[0] });
/* */ }
/* */
/* 24 */ AnprStatusInfo anpr = new AnprStatusInfo();
/* 25 */ anpr.runAnprCarInfo(str);
/* */ }
/* */
/* */ public AnprStatusInfo() {
/* 29 */ Map<String, Boolean> mapIsRun_1 = new Hashtable<>();
/* 30 */ Map<String, Boolean> mapIsRun_3 = new Hashtable<>();
/* */
/* */
/* */
/* */
/* */
/* 36 */ mapIsRun_1.put("01", Boolean.valueOf(false));
/* 37 */ mapIsRun_1.put("02", Boolean.valueOf(false));
/* 38 */ mapIsRun_1.put("03", Boolean.valueOf(false));
/* 39 */ mapIsRun_1.put("04", Boolean.valueOf(false));
/* 40 */ mapIsRun_1.put("05", Boolean.valueOf(false));
/* 41 */ mapIsRun_1.put("06", Boolean.valueOf(false));
/* 42 */ mapIsRun_1.put("07", Boolean.valueOf(false));
/* 43 */ mapIsRun_1.put("08", Boolean.valueOf(false));
/* */
/* 45 */ mapIsRun_3.put("01", Boolean.valueOf(false));
/* 46 */ mapIsRun_3.put("02", Boolean.valueOf(false));
/* 47 */ mapIsRun_3.put("03", Boolean.valueOf(false));
/* 48 */ mapIsRun_3.put("04", Boolean.valueOf(false));
/* 49 */ mapIsRun_3.put("05", Boolean.valueOf(false));
/* 50 */ mapIsRun_3.put("06", Boolean.valueOf(false));
/* 51 */ mapIsRun_3.put("07", Boolean.valueOf(false));
/* 52 */ mapIsRun_3.put("08", Boolean.valueOf(false));
/* 53 */ mapIsRun_3.put("09", Boolean.valueOf(false));
/* 54 */ mapIsRun_3.put("10", Boolean.valueOf(false));
/* */ }
/* */
/* */
/* */
/* */ public void runAnprCarInfo(String str) {
/* */ try {
/* 61 */ ArrayList<String> state = new ArrayList<>();
/* */
/* */
/* */
/* */
/* */
/* */
/* 68 */ JobDetail job = JobBuilder.newJob(AnprStatusJob.class)
/* 69 */ .withIdentity("testJob")
/* 70 */ .usingJobData("jobSays", "ant.xml")
/* 71 */ .usingJobData("myFloatValue", Float.valueOf(3.141F)).build();
/* */
/* 73 */ job.getJobDataMap().put("state", state);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 83 */ CronTrigger cronTrigger =
/* 84 */ (CronTrigger)TriggerBuilder.newTrigger()
/* 85 */ .withIdentity("crontrigger", "crontriggergroup1")
/* 86 */ .withSchedule(
/* */
/* 88 */ (ScheduleBuilder)CronScheduleBuilder.cronSchedule("0 0/1 * * * ?"))
/* 89 */ .build();
/* */
/* */
/* 92 */ StdSchedulerFactory stdSchedulerFactory = new StdSchedulerFactory();
/* 93 */ Scheduler sch = stdSchedulerFactory.getScheduler();
/* */
/* */
/* */
/* 97 */ sch.start();
/* 98 */ sch.scheduleJob(job, (Trigger)cronTrigger);
/* */
/* */ }
/* 101 */ catch (SchedulerException e) {
/* 102 */ e.printStackTrace();
/* */ }
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\AnprStatusInfo.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,124 @@
/* */ import java.io.BufferedInputStream;
/* */ import java.io.FileInputStream;
/* */ import java.util.ArrayList;
/* */ import java.util.Date;
/* */ import java.util.List;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */ import org.apache.log4j.PropertyConfigurator;
/* */ import org.quartz.Job;
/* */ import org.quartz.JobExecutionContext;
/* */ import org.quartz.JobExecutionException;
/* */ import org.quartz.JobKey;
/* */
/* */ public class AnprStatusJob
/* */ implements Job
/* */ {
/* */ private String jobSays;
/* */ private float myFloatValue;
/* */ private ArrayList<Date> state;
/* 20 */ private String g_strTenel = "";
/* 21 */ private List<String> g_listN1 = new ArrayList<>();
/* 22 */ private List<String> g_listN3 = new ArrayList<>();
/* */
/* 24 */ private final Logger logger = Logger.getLogger(AnprStatusJob.class);
/* */
/* */ public AnprStatusJob() {
/* 27 */ PropertyConfigurator.configure("./log4j.properties");
/* */
/* */
/* */ try {
/* 31 */ String propFile = "./config.properties";
/* */
/* */
/* 34 */ Properties props = new Properties();
/* */
/* */
/* 37 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 40 */ props.load(new BufferedInputStream(fis));
/* */
/* 42 */ this.g_strTenel = props.getProperty("tennel_no");
/* */
/* 44 */ props.clear();
/* 45 */ props = null;
/* 46 */ System.out.println("===================== A");
/* */
/* 48 */ this.g_listN1.add("01");
/* 49 */ this.g_listN1.add("02");
/* 50 */ this.g_listN1.add("03");
/* 51 */ this.g_listN1.add("04");
/* 52 */ this.g_listN1.add("05");
/* 53 */ this.g_listN1.add("06");
/* 54 */ this.g_listN1.add("07");
/* 55 */ this.g_listN1.add("08");
/* */
/* 57 */ this.g_listN3.add("01");
/* 58 */ this.g_listN3.add("02");
/* 59 */ this.g_listN3.add("03");
/* 60 */ this.g_listN3.add("04");
/* */
/* */
/* 63 */ this.g_listN3.add("07");
/* 64 */ this.g_listN3.add("08");
/* 65 */ this.g_listN3.add("09");
/* 66 */ this.g_listN3.add("10");
/* 67 */ System.out.println("===================== B");
/* 68 */ } catch (Exception e) {
/* 69 */ this.logger.debug("Exception : " + e);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void execute(JobExecutionContext context) throws JobExecutionException {
/* 79 */ JobKey key = context.getJobDetail().getKey();
/* 80 */ this.state.add(new Date());
/* */
/* 82 */ this.logger.info("Instance " + key + " of DmbJob says: " + this.jobSays + ", and val is: " + this.myFloatValue +
/* 83 */ ", state size:" + this.state.size() + "," + this.state.get(this.state.size() - 1));
/* */
/* 85 */ this.logger.debug("======== 차로개수 : " + this.g_listN3.size());
/* 86 */ List<String> list = new ArrayList<>();
/* 87 */ if (this.g_strTenel.equals("3")) {
/* 88 */ list.addAll(this.g_listN3);
/* 89 */ } else if (this.g_strTenel.equals("1")) {
/* 90 */ list.addAll(this.g_listN1);
/* */ } else {
/* */ return;
/* */ }
/* */
/* 95 */ AnprStateSend obj = null;
/* 96 */ for (int i = 0; i < list.size(); i++) {
/* 97 */ this.logger.debug(String.format("%s차로 시작", new Object[] { list.get(i) }));
/* */
/* 99 */ obj = new AnprStateSend(list.get(i));
/* 100 */ obj.runCarNoImageSend();
/* */
/* 102 */ this.logger.debug(String.format("%s차로 끝", new Object[] { list.get(i) }));
/* */ }
/* */ }
/* */
/* */
/* */ public void setJobSays(String jobSays) {
/* 108 */ this.jobSays = jobSays;
/* */ }
/* */
/* */ public void setMyFloatValue(float myFloatValue) {
/* 112 */ this.myFloatValue = myFloatValue;
/* */ }
/* */
/* */ public void setState(ArrayList<Date> state) {
/* 116 */ this.state = state;
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\AnprStatusJob.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,141 @@
/* */ import java.io.BufferedInputStream;
/* */ import java.io.FileInputStream;
/* */ import java.util.ArrayList;
/* */ import java.util.Date;
/* */ import java.util.List;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */ import org.apache.log4j.PropertyConfigurator;
/* */ import org.quartz.Job;
/* */ import org.quartz.JobExecutionContext;
/* */ import org.quartz.JobExecutionException;
/* */ import org.quartz.JobKey;
/* */
/* */ public class DumbJob
/* */ implements Job
/* */ {
/* */ private String jobSays;
/* */ private float myFloatValue;
/* */ private ArrayList<Date> state;
/* 20 */ private String g_strTenel = "";
/* 21 */ private List<String> g_listN1 = new ArrayList<>();
/* 22 */ private List<String> g_listN3 = new ArrayList<>();
/* */
/* 24 */ private final Logger logger = Logger.getLogger(DumbJob.class);
/* */
/* */ public DumbJob() {
/* 27 */ PropertyConfigurator.configure("./log4j.properties");
/* */
/* */
/* */ try {
/* 31 */ String propFile = "./config.properties";
/* */
/* */
/* 34 */ Properties props = new Properties();
/* */
/* */
/* 37 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 40 */ props.load(new BufferedInputStream(fis));
/* */
/* 42 */ this.g_strTenel = props.getProperty("tennel_no");
/* */
/* 44 */ props.clear();
/* 45 */ props = null;
/* 46 */ System.out.println("===================== A");
/* */
/* 48 */ this.g_listN1.add("01");
/* 49 */ this.g_listN1.add("02");
/* 50 */ this.g_listN1.add("03");
/* 51 */ this.g_listN1.add("04");
/* 52 */ this.g_listN1.add("05");
/* 53 */ this.g_listN1.add("06");
/* 54 */ this.g_listN1.add("07");
/* 55 */ this.g_listN1.add("08");
/* */
/* 57 */ this.g_listN3.add("01");
/* 58 */ this.g_listN3.add("02");
/* 59 */ this.g_listN3.add("03");
/* 60 */ this.g_listN3.add("04");
/* */
/* */
/* 63 */ this.g_listN3.add("07");
/* 64 */ this.g_listN3.add("08");
/* 65 */ this.g_listN3.add("09");
/* 66 */ this.g_listN3.add("10");
/* 67 */ System.out.println("===================== B");
/* 68 */ } catch (Exception e) {
/* 69 */ this.logger.debug("Exception : " + e);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void execute(JobExecutionContext context) throws JobExecutionException {
/* 79 */ JobKey key = context.getJobDetail().getKey();
/* 80 */ this.state.add(new Date());
/* */
/* 82 */ this.logger.info("Instance " + key + " of DmbJob says: " + this.jobSays + ", and val is: " + this.myFloatValue +
/* 83 */ ", state size:" + this.state.size() + "," + this.state.get(this.state.size() - 1));
/* */
/* 85 */ this.logger.debug("======== 차로개수 : " + this.g_listN3.size());
/* 86 */ List<String> list = new ArrayList<>();
/* 87 */ if (this.g_strTenel.equals("3")) {
/* 88 */ list.addAll(this.g_listN3);
/* 89 */ } else if (this.g_strTenel.equals("1")) {
/* 90 */ list.addAll(this.g_listN1);
/* */ } else {
/* */ return;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 112 */ SendThread obj = null;
/* 113 */ for (int i = 0; i < list.size(); i++) {
/* 114 */ this.logger.debug(String.format("%s차로 시작", new Object[] { list.get(i) }));
/* */
/* 116 */ obj = new SendThread(list.get(i));
/* 117 */ obj.runCarNoImageSend();
/* */
/* 119 */ this.logger.debug(String.format("%s차로 끝", new Object[] { list.get(i) }));
/* */ }
/* */ }
/* */
/* */
/* */ public void setJobSays(String jobSays) {
/* 125 */ this.jobSays = jobSays;
/* */ }
/* */
/* */ public void setMyFloatValue(float myFloatValue) {
/* 129 */ this.myFloatValue = myFloatValue;
/* */ }
/* */
/* */ public void setState(ArrayList<Date> state) {
/* 133 */ this.state = state;
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\DumbJob.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,229 @@
/* */ import com.jcraft.jsch.Channel;
/* */ import com.jcraft.jsch.ChannelSftp;
/* */ import com.jcraft.jsch.JSch;
/* */ import com.jcraft.jsch.JSchException;
/* */ import com.jcraft.jsch.Session;
/* */ import com.jcraft.jsch.SftpException;
/* */ import java.io.BufferedInputStream;
/* */ import java.io.File;
/* */ import java.io.FileInputStream;
/* */ import java.io.IOException;
/* */ import java.io.InputStream;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */
/* */
/* */ public class FTPUtil
/* */ {
/* 18 */ private Session session = null;
/* 19 */ private Channel channel = null;
/* 20 */ private ChannelSftp channelSftp = null;
/* */
/* 22 */ private static String[] g_strFTP = new String[5];
/* */
/* 24 */ private final Logger logger = Logger.getLogger(FTPUtil.class);
/* */
/* */ public static void main(String[] args) {
/* */ try {
/* 28 */ String propFile = "./config.properties";
/* */
/* 30 */ Properties props = new Properties();
/* */
/* 32 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* 34 */ props.load(new BufferedInputStream(fis));
/* */
/* */
/* */
/* 38 */ g_strFTP[0] = props.getProperty("path_org");
/* 39 */ g_strFTP[1] = props.getProperty("ftp_ip");
/* 40 */ g_strFTP[2] = props.getProperty("ftp_id");
/* 41 */ g_strFTP[3] = props.getProperty("ftp_pw");
/* 42 */ g_strFTP[4] = props.getProperty("path_desc");
/* */
/* */
/* 45 */ props.clear();
/* 46 */ props = null;
/* 47 */ } catch (Exception e) {
/* 48 */ e.printStackTrace();
/* */ }
/* */
/* 51 */ String path = g_strFTP[0];
/* 52 */ g_strFTP[4] = String.valueOf(g_strFTP[4]) + "/2019/07/36/A10100013/";
/* */
/* 54 */ FTPUtil sftp = new FTPUtil();
/* 55 */ sftp.init(g_strFTP[1], g_strFTP[2], g_strFTP[3]);
/* */
/* */
/* */ try {
/* 59 */ sftp.mkdir2(g_strFTP[4].substring(1));
/* 60 */ System.out.println("폴더가 생성되었습니다.");
/* 61 */ } catch (Exception e) {
/* 62 */ e.getStackTrace();
/* */ }
/* */
/* */
/* 66 */ File file = new File(String.valueOf(path) + "/aaa.txt");
/* */
/* */ try {
/* 69 */ sftp.upload(g_strFTP[4], file, "aaa.txt", "bbb.txt");
/* */ }
/* 71 */ catch (SftpException e) {
/* 72 */ e.printStackTrace();
/* 73 */ } catch (IOException e) {
/* 74 */ e.printStackTrace();
/* */ }
/* */
/* 77 */ sftp.disconnect();
/* */ }
/* */
/* */
/* */
/* */ public String mkdir(String path) throws SftpException {
/* 83 */ String[] pathArray = path.split("/");
/* */
/* 85 */ String currentDirectory = String.valueOf(this.channelSftp.pwd()) + "/";
/* 86 */ String totPathArray = "";
/* */
/* 88 */ for (int i = 0; i < pathArray.length; i++) {
/* 89 */ if (pathArray[i].length() != 0) {
/* */
/* */
/* 92 */ totPathArray = String.valueOf(totPathArray) + pathArray[i] + "/";
/* 93 */ String currentPath = String.valueOf(currentDirectory) + totPathArray;
/* */
/* */ try {
/* 96 */ this.channelSftp.mkdir(currentPath);
/* 97 */ this.channelSftp.cd(currentPath);
/* 98 */ } catch (Exception e) {
/* 99 */ this.channelSftp.cd(currentPath);
/* */ }
/* */ }
/* */ }
/* 103 */ return String.valueOf(currentDirectory) + "/" + totPathArray;
/* */ }
/* */
/* */
/* */ public String mkdir2(String path) throws SftpException {
/* 108 */ String[] pathArray = path.split("/");
/* */
/* 110 */ String currentDirectory = "/";
/* 111 */ String totPathArray = "";
/* */
/* 113 */ for (int i = 0; i < pathArray.length; i++) {
/* 114 */ if (pathArray[i].length() != 0) {
/* */
/* */
/* 117 */ totPathArray = String.valueOf(totPathArray) + pathArray[i] + "/";
/* 118 */ String currentPath = String.valueOf(currentDirectory) + totPathArray;
/* */
/* */ try {
/* 121 */ this.channelSftp.mkdir(currentPath);
/* 122 */ this.channelSftp.cd(currentPath);
/* 123 */ this.channelSftp.chmod(511, currentPath);
/* 124 */ } catch (Exception e) {
/* 125 */ this.channelSftp.cd(currentPath);
/* */ }
/* */ }
/* */ }
/* 129 */ return String.valueOf(currentDirectory) + "/" + totPathArray;
/* */ }
/* */
/* */
/* */
/* */
/* */ public void init(String url, String user, String password) {
/* 136 */ System.out.println(url);
/* */
/* 138 */ JSch jsch = new JSch();
/* */ try {
/* 140 */ this.session = jsch.getSession(user, url);
/* */
/* 142 */ this.session.setPassword(password);
/* */
/* 144 */ Properties config = new Properties();
/* */
/* 146 */ config.put("StrictHostKeyChecking", "no");
/* 147 */ this.session.setConfig(config);
/* */
/* 149 */ this.session.connect();
/* */
/* 151 */ this.channel = this.session.openChannel("sftp");
/* 152 */ this.channel.connect();
/* */ }
/* 154 */ catch (JSchException e) {
/* 155 */ this.logger.debug("Exception : " + e);
/* */ }
/* 157 */ this.channelSftp = (ChannelSftp)this.channel;
/* */ }
/* */
/* */
/* */ public void upload(String dir, File file, String old, String neo) throws SftpException, IOException {
/* 162 */ FileInputStream in = null;
/* */
/* 164 */ in = new FileInputStream(file);
/* 165 */ this.channelSftp.cd(dir);
/* 166 */ this.channelSftp.put(in, file.getName());
/* 167 */ in.close();
/* */
/* 169 */ this.channelSftp.chmod(511, dir);
/* 170 */ this.channelSftp.chmod(511, old);
/* 171 */ this.channelSftp.rename(old, neo);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void upload2(String dir, File file, String old, String neo) throws SftpException, IOException {
/* 191 */ FileInputStream in = null;
/* */
/* 193 */ in = new FileInputStream(file);
/* 194 */ this.channelSftp.cd(dir);
/* 195 */ this.channelSftp.put(in, file.getName());
/* 196 */ in.close();
/* */
/* 198 */ this.logger.debug(String.format("============= :upload2 1 ", new Object[0]));
/* 199 */ this.channelSftp.rename(old, neo);
/* */
/* 201 */ this.logger.debug(String.format("============= :upload2 2 ", new Object[0]));
/* */ }
/* */
/* */
/* */ public InputStream download(String dir, String fileNm) {
/* 206 */ InputStream in = null;
/* 207 */ String path = "...";
/* */ try {
/* 209 */ this.channelSftp.cd(String.valueOf(path) + dir);
/* 210 */ in = this.channelSftp.get(fileNm);
/* */ }
/* 212 */ catch (SftpException se) {
/* 213 */ this.logger.debug("Exception : " + se);
/* */ }
/* */
/* 216 */ return in;
/* */ }
/* */
/* */ public void disconnect() {
/* 220 */ this.channelSftp.quit();
/* 221 */ this.session.disconnect();
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\FTPUtil.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,253 @@
/* */ import com.jcraft.jsch.SftpException;
/* */ import java.io.BufferedInputStream;
/* */ import java.io.File;
/* */ import java.io.FileInputStream;
/* */ import java.io.IOException;
/* */ import java.sql.Connection;
/* */ import java.sql.DriverManager;
/* */ import java.sql.ResultSet;
/* */ import java.util.Properties;
/* */ import oracle.jdbc.OracleConnection;
/* */ import oracle.jdbc.OraclePreparedStatement;
/* */ import org.apache.log4j.Logger;
/* */ import org.apache.log4j.PropertyConfigurator;
/* */
/* */
/* */
/* */ public class LossDefaultCarImageSend
/* */ {
/* 19 */ private String[] g_strDB = new String[4];
/* 20 */ private String[] g_strFTP = new String[6];
/* 21 */ private String[] g_strFTPColl = new String[4];
/* */
/* 23 */ private String g_strTenel = "";
/* */
/* 25 */ private final Logger logger = Logger.getLogger(LossDefaultCarImageSend.class);
/* */
/* */ public static void main(String[] args) {
/* 28 */ LossDefaultCarImageSend obj = new LossDefaultCarImageSend();
/* */
/* */ try {
/* 31 */ obj.sendDefaultCarImage();
/* 32 */ } catch (Exception e) {
/* 33 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */ public LossDefaultCarImageSend() {
/* 38 */ PropertyConfigurator.configure("./log4j.properties");
/* */
/* */
/* */ try {
/* 42 */ String propFile = "./config.properties";
/* */
/* */
/* 45 */ Properties props = new Properties();
/* */
/* */
/* 48 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 51 */ props.load(new BufferedInputStream(fis));
/* */
/* */
/* 54 */ this.g_strDB[0] = props.getProperty("db_driver");
/* 55 */ this.g_strDB[1] = props.getProperty("db_connect");
/* 56 */ this.g_strDB[2] = props.getProperty("db_id");
/* 57 */ this.g_strDB[3] = props.getProperty("db_pw");
/* */
/* */
/* 60 */ this.g_strFTP[0] = props.getProperty("path_org");
/* 61 */ this.g_strFTP[1] = props.getProperty("ftp_ip");
/* 62 */ this.g_strFTP[2] = props.getProperty("ftp_id");
/* 63 */ this.g_strFTP[3] = props.getProperty("ftp_pw");
/* 64 */ this.g_strFTP[4] = props.getProperty("api_url");
/* 65 */ this.g_strFTP[5] = props.getProperty("path_desc");
/* */
/* 67 */ this.g_strFTPColl[0] = props.getProperty("coll_ftp_ip");
/* 68 */ this.g_strFTPColl[1] = props.getProperty("coll_ftp_id");
/* 69 */ this.g_strFTPColl[2] = props.getProperty("coll_ftp_pw");
/* 70 */ this.g_strFTPColl[3] = props.getProperty("center_ftp_ip");
/* */
/* 72 */ this.g_strTenel = props.getProperty("tennel_no");
/* */
/* 74 */ props.clear();
/* 75 */ props = null;
/* */ }
/* 77 */ catch (Exception e) {
/* 78 */ this.logger.info("Exception : " + e);
/* */ }
/* */ }
/* */
/* */
/* */ public String findFileList(String source, String prefix, String suffix) {
/* 84 */ File dir = new File(source);
/* 85 */ File[] fileList = dir.listFiles();
/* 86 */ if (fileList == null) {
/* 87 */ this.logger.debug("======== 12.5 :::" + source);
/* 88 */ return "";
/* */ }
/* */
/* 91 */ for (int i = 0; i < fileList.length; i++) {
/* 92 */ File file = fileList[i];
/* 93 */ if (file.isFile()) {
/* 94 */ String tempFileName = file.getName();
/* 95 */ if (tempFileName.startsWith(prefix)) {
/* 96 */ this.logger.info("=== = " + tempFileName);
/* */
/* 98 */ if (tempFileName.endsWith(suffix)) {
/* 99 */ return tempFileName;
/* */ }
/* */ }
/* */ }
/* */ }
/* 104 */ return null;
/* */ }
/* */
/* */ private void sendDefaultCarImage() throws Exception {
/* 108 */ String sql = "";
/* */
/* */
/* 111 */ OracleConnection conn = null;
/* 112 */ OraclePreparedStatement ps = null;
/* 113 */ OraclePreparedStatement ps2 = null;
/* 114 */ ResultSet rs = null;
/* */
/* */ try {
/* 117 */ conn = (OracleConnection)getOrclConn();
/* */
/* 119 */ sql = "select FARE_OFFICE_ID, BOOTH_ID, YEAR, MONTH, DAY, WORK_TIMES, ";
/* 120 */ sql = String.valueOf(sql) + " substr(CAR_NO, -4) || '_' || ";
/* 121 */ sql = String.valueOf(sql) + " decode(BOOTH_ID, '01', '0.JPG', '02', '0.JPG', '03', '0.JPG', '04', '0.JPG' ";
/* 122 */ sql = String.valueOf(sql) + " , '07', '1.JPG', '08', '1.JPG', '09', '1.JPG', '10', '1.JPG' ";
/* 123 */ sql = String.valueOf(sql) + " ) as car_no_4, ";
/* 124 */ sql = String.valueOf(sql) + " worker_id, seqno ";
/* 125 */ sql = String.valueOf(sql) + " from DEFAULT_FARE_READ_INFO where updater = 'PROCADD'";
/* */
/* 127 */ ps = (OraclePreparedStatement)conn.prepareStatement(sql);
/* 128 */ rs = ps.executeQuery(sql);
/* */
/* 130 */ String strPath = "";
/* 131 */ String pathDest = "";
/* 132 */ String strFindFileName = "";
/* 133 */ String strFileNameOld = "";
/* 134 */ String strFileNameNeo = "";
/* 135 */ while (rs.next()) {
/* 136 */ strPath = String.format("%s/%s/%s/send/", new Object[] { this.g_strFTP[0], rs.getString(4), rs.getString(2) });
/* 137 */ strFindFileName = String.format("%s%s%s_%s", new Object[] { rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6).substring(0, 4) });
/* */
/* 139 */ strFileNameOld = findFileList(strPath, strFindFileName, rs.getString(7));
/* */
/* 141 */ if (strFileNameOld == null || strFileNameOld == "") {
/* */ continue;
/* */ }
/* 144 */ strFileNameNeo = String.format("%s%s%s%s%s%sS.JPG", new Object[] { rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6) });
/* */
/* 146 */ pathDest = String.format("/DOTR/%s%s%s/0%s/IMAGE/", new Object[] { rs.getString(3), rs.getString(4), rs.getString(5), this.g_strTenel });
/* */
/* 148 */ callSendImage(strPath, pathDest, strFileNameOld, strFileNameNeo);
/* 149 */ callSendImageCenter(strPath, pathDest, strFileNameOld, strFileNameNeo);
/* */
/* */
/* 152 */ sql = "update DEFAULT_FARE_READ_INFO set updater = 'PROCMOD' ";
/* 153 */ sql = String.valueOf(sql) + " where FARE_OFFICE_ID = ? and BOOTH_ID = ? and YEAR = ? and MONTH = ? and DAY = ? and WORK_TIMES = ? ";
/* 154 */ sql = String.valueOf(sql) + " and worker_id = ? and seqno = ? ";
/* */
/* 156 */ this.logger.info("=== = " + sql);
/* */
/* 158 */ ps2 = (OraclePreparedStatement)conn.prepareStatement(sql);
/* 159 */ ps2.setString(1, rs.getString(1));
/* 160 */ ps2.setString(2, rs.getString(2));
/* 161 */ ps2.setString(3, rs.getString(3));
/* 162 */ ps2.setString(4, rs.getString(4));
/* 163 */ ps2.setString(5, rs.getString(5));
/* 164 */ ps2.setString(6, rs.getString(6));
/* */
/* 166 */ ps2.setString(7, rs.getString(8));
/* 167 */ ps2.setString(8, rs.getString(9));
/* */
/* 169 */ ps2.execute();
/* 170 */ ps2.close();
/* */ }
/* 172 */ ps.close();
/* 173 */ } catch (Exception e) {
/* 174 */ this.logger.info("Exception : " + e);
/* */ } finally {
/* 176 */ if (rs != null)
/* 177 */ rs.close();
/* 178 */ if (ps != null) {
/* 179 */ ps.close();
/* */ }
/* 181 */ conn.close();
/* */ }
/* 183 */ this.logger.info(String.format("============= : DefaultCarDB 업데이트 2 후 ", new Object[0]));
/* */ }
/* */
/* */ public void callSendImage(String pathOrg, String pathDest, String old, String neo) {
/* 187 */ File file = new File(String.valueOf(pathOrg) + old);
/* */
/* 189 */ FTPUtil sftp = new FTPUtil();
/* 190 */ sftp.init(this.g_strFTP[1], this.g_strFTP[2], this.g_strFTP[3]);
/* */
/* */ try {
/* 193 */ sftp.upload("/data2" + pathDest, file, old, neo);
/* */
/* 195 */ sftp.disconnect();
/* 196 */ } catch (SftpException e) {
/* 197 */ this.logger.info("Exception : " + e);
/* 198 */ } catch (IOException e) {
/* 199 */ this.logger.info("Exception : " + e);
/* */ }
/* */ }
/* */
/* */ public void callSendImageCenter(String pathOrg, String pathDest, String old, String neo) {
/* 204 */ File file = new File(String.valueOf(pathOrg) + old);
/* */
/* 206 */ FTPUtil sftp = new FTPUtil();
/* 207 */ sftp.init(this.g_strFTP[3], this.g_strFTP[2], this.g_strFTP[3]);
/* */
/* */ try {
/* 210 */ sftp.upload(pathDest, file, old, neo);
/* */
/* 212 */ sftp.disconnect();
/* 213 */ } catch (SftpException e) {
/* 214 */ this.logger.info("Exception : " + e);
/* 215 */ } catch (IOException e) {
/* 216 */ this.logger.info("Exception : " + e);
/* */ }
/* */
/* */
/* 220 */ OracleConnection conn = null;
/* 221 */ OraclePreparedStatement ps = null;
/* */ try {
/* 223 */ conn = (OracleConnection)getOrclConnCenter();
/* */
/* 225 */ String sql = "update DEFAULT_FARE_READ_INFO set updater = 'PROCMOD' where updater = 'PROCADD'";
/* 226 */ ps = (OraclePreparedStatement)conn.prepareStatement(sql);
/* 227 */ ps.executeUpdate();
/* 228 */ ps.close();
/* */
/* 230 */ conn.close();
/* 231 */ } catch (Exception e) {
/* 232 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */
/* */ private Connection getOrclConn() throws Exception {
/* 238 */ Class.forName(this.g_strDB[0]);
/* 239 */ return DriverManager.getConnection(this.g_strDB[1], this.g_strDB[2], this.g_strDB[3]);
/* */ }
/* */
/* */
/* */ private Connection getOrclConnCenter() throws Exception {
/* 244 */ Class.forName(this.g_strDB[0]);
/* 245 */ return DriverManager.getConnection("jdbc:oracle:thin:@150.50.46.11:1521:Ora91", "NAMSAN", "namsan");
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\LossDefaultCarImageSend.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,197 @@
/* */ import java.util.HashMap;
/* */ import java.util.Map;
/* */
/* */ public class MakeCarNoHex2CarNo
/* */ {
/* */ public static void main(String[] args) {
/* 7 */ String[] array = { "9905501184", "9902422041", "", "", "" };
/* */
/* */
/* */
/* 11 */ for (int i = 0; i < array.length; i++) {
/* 12 */ if (array[i].length() != 0)
/* */ {
/* */
/* 15 */ System.out.println(makeCarNoHex2CarNo(array[i])); }
/* */ }
/* */ }
/* */ public static boolean isNumeric(String s) {
/* 19 */ return s.matches("-?\\d+(\\.\\d+)?");
/* */ }
/* */
/* */ public static String makeCarNoHex2CarNo(String strCarNoHex) {
/* 23 */ if (strCarNoHex.contains("XXXX")) {
/* 24 */ return "??????????";
/* */ }
/* 26 */ if (strCarNoHex.contains("0000000000")) {
/* 27 */ return "??????????";
/* */ }
/* 29 */ StringBuffer strbuf = new StringBuffer();
/* 30 */ String strTemp = getRegionRev(strCarNoHex.substring(0, 2));
/* 31 */ strbuf.append(strTemp);
/* */
/* 33 */ if (!isNumeric(strTemp)) {
/* 34 */ int n = Integer.parseInt(strCarNoHex.substring(2, 4));
/* 35 */ strbuf.append(String.format("%02d", new Object[] { Integer.valueOf(n) }));
/* */ } else {
/* */
/* 38 */ strbuf.append(strCarNoHex.substring(2, 4));
/* 39 */ } strbuf.append(getCarClassRev(strCarNoHex.substring(4, 6)));
/* 40 */ strbuf.append(strCarNoHex.substring(6, 10));
/* */
/* 42 */ return strbuf.toString();
/* */ }
/* */
/* */
/* */
/* */
/* */ private static String getRegionRev(String str) {
/* 49 */ Map<String, String> mapRegion = new HashMap<>();
/* */
/* 51 */ mapRegion.put("00", "서울");
/* 52 */ mapRegion.put("01", "부산");
/* 53 */ mapRegion.put("02", "인천");
/* 54 */ mapRegion.put("03", "대구");
/* 55 */ mapRegion.put("04", "광주");
/* 56 */ mapRegion.put("05", "대전");
/* 57 */ mapRegion.put("06", "경기");
/* 58 */ mapRegion.put("07", "강원");
/* 59 */ mapRegion.put("08", "충북");
/* 60 */ mapRegion.put("09", "충남");
/* 61 */ mapRegion.put("10", "전북");
/* 62 */ mapRegion.put("11", "전남");
/* 63 */ mapRegion.put("12", "경북");
/* 64 */ mapRegion.put("13", "경남");
/* 65 */ mapRegion.put("14", "제주");
/* 66 */ mapRegion.put("15", "울산");
/* 67 */ mapRegion.put("16", "세종");
/* */
/* 69 */ mapRegion.put("81", "1");
/* 70 */ mapRegion.put("82", "2");
/* 71 */ mapRegion.put("83", "3");
/* 72 */ mapRegion.put("84", "4");
/* 73 */ mapRegion.put("85", "5");
/* 74 */ mapRegion.put("86", "6");
/* 75 */ mapRegion.put("87", "7");
/* 76 */ mapRegion.put("88", "8");
/* 77 */ mapRegion.put("89", "9");
/* */
/* 79 */ mapRegion.put("98", "외교");
/* */
/* 81 */ mapRegion.put("99", "");
/* */
/* 83 */ if (mapRegion.get(str) == null) {
/* 84 */ return "??";
/* */ }
/* 86 */ return mapRegion.get(str);
/* */ }
/* */
/* */
/* */
/* */ private static String getCarClassRev(String str) {
/* 92 */ Map<String, String> mapCarClass = new HashMap<>();
/* 93 */ mapCarClass.put("00", "가");
/* 94 */ mapCarClass.put("01", "나");
/* 95 */ mapCarClass.put("02", "다");
/* 96 */ mapCarClass.put("03", "라");
/* 97 */ mapCarClass.put("04", "마");
/* 98 */ mapCarClass.put("05", "바");
/* 99 */ mapCarClass.put("06", "사");
/* 100 */ mapCarClass.put("07", "아");
/* 101 */ mapCarClass.put("08", "자");
/* 102 */ mapCarClass.put("09", "자");
/* 103 */ mapCarClass.put("10", "카");
/* 104 */ mapCarClass.put("11", "타");
/* 105 */ mapCarClass.put("12", "파");
/* 106 */ mapCarClass.put("13", "하");
/* 107 */ mapCarClass.put("14", "거");
/* 108 */ mapCarClass.put("15", "너");
/* 109 */ mapCarClass.put("16", "더");
/* 110 */ mapCarClass.put("17", "러");
/* 111 */ mapCarClass.put("18", "머");
/* 112 */ mapCarClass.put("19", "버");
/* 113 */ mapCarClass.put("20", "서");
/* 114 */ mapCarClass.put("21", "어");
/* 115 */ mapCarClass.put("22", "저");
/* 116 */ mapCarClass.put("23", "처");
/* 117 */ mapCarClass.put("24", "커");
/* 118 */ mapCarClass.put("25", "터");
/* 119 */ mapCarClass.put("26", "퍼");
/* 120 */ mapCarClass.put("27", "허");
/* 121 */ mapCarClass.put("28", "고");
/* 122 */ mapCarClass.put("29", "노");
/* 123 */ mapCarClass.put("30", "도");
/* 124 */ mapCarClass.put("31", "로");
/* 125 */ mapCarClass.put("32", "모");
/* 126 */ mapCarClass.put("33", "보");
/* 127 */ mapCarClass.put("34", "소");
/* 128 */ mapCarClass.put("35", "오");
/* 129 */ mapCarClass.put("36", "조");
/* 130 */ mapCarClass.put("37", "초");
/* 131 */ mapCarClass.put("38", "코");
/* 132 */ mapCarClass.put("39", "토");
/* 133 */ mapCarClass.put("40", "포");
/* 134 */ mapCarClass.put("41", "호");
/* 135 */ mapCarClass.put("42", "구");
/* 136 */ mapCarClass.put("43", "누");
/* 137 */ mapCarClass.put("44", "두");
/* 138 */ mapCarClass.put("45", "루");
/* 139 */ mapCarClass.put("46", "무");
/* 140 */ mapCarClass.put("47", "부");
/* 141 */ mapCarClass.put("48", "수");
/* 142 */ mapCarClass.put("49", "우");
/* 143 */ mapCarClass.put("50", "주");
/* 144 */ mapCarClass.put("51", "추");
/* 145 */ mapCarClass.put("52", "쿠");
/* 146 */ mapCarClass.put("53", "투");
/* 147 */ mapCarClass.put("54", "푸");
/* 148 */ mapCarClass.put("55", "후");
/* 149 */ mapCarClass.put("56", "그");
/* 150 */ mapCarClass.put("57", "느");
/* 151 */ mapCarClass.put("58", "드");
/* 152 */ mapCarClass.put("59", "르");
/* 153 */ mapCarClass.put("60", "므");
/* 154 */ mapCarClass.put("61", "브");
/* 155 */ mapCarClass.put("62", "스");
/* 156 */ mapCarClass.put("63", "으");
/* 157 */ mapCarClass.put("64", "즈");
/* 158 */ mapCarClass.put("65", "츠");
/* 159 */ mapCarClass.put("66", "크");
/* 160 */ mapCarClass.put("67", "트");
/* 161 */ mapCarClass.put("68", "프");
/* 162 */ mapCarClass.put("69", "흐");
/* 163 */ mapCarClass.put("70", "기");
/* 164 */ mapCarClass.put("71", "니");
/* 165 */ mapCarClass.put("72", "디");
/* 166 */ mapCarClass.put("73", "리");
/* 167 */ mapCarClass.put("74", "미");
/* 168 */ mapCarClass.put("75", "비");
/* 169 */ mapCarClass.put("76", "시");
/* 170 */ mapCarClass.put("77", "이");
/* 171 */ mapCarClass.put("78", "지");
/* 172 */ mapCarClass.put("79", "치");
/* 173 */ mapCarClass.put("80", "키");
/* 174 */ mapCarClass.put("81", "티");
/* 175 */ mapCarClass.put("82", "피");
/* 176 */ mapCarClass.put("83", "히");
/* 177 */ mapCarClass.put("84", "육");
/* 178 */ mapCarClass.put("85", "해");
/* 179 */ mapCarClass.put("86", "공");
/* 180 */ mapCarClass.put("87", "국");
/* 181 */ mapCarClass.put("88", "합");
/* 182 */ mapCarClass.put("89", "_");
/* 183 */ mapCarClass.put("90", "배");
/* 184 */ mapCarClass.put("98", "외");
/* */
/* 186 */ if (mapCarClass.get(str) == null) {
/* 187 */ return "????";
/* */ }
/* 189 */ return mapCarClass.get(str);
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\MakeCarNoHex2CarNo.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,790 @@
/* */ import com.jcraft.jsch.SftpException;
/* */ import java.io.BufferedInputStream;
/* */ import java.io.BufferedOutputStream;
/* */ import java.io.BufferedReader;
/* */ import java.io.File;
/* */ import java.io.FileInputStream;
/* */ import java.io.IOException;
/* */ import java.io.InputStream;
/* */ import java.io.InputStreamReader;
/* */ import java.net.HttpURLConnection;
/* */ import java.net.URL;
/* */ import java.sql.Connection;
/* */ import java.sql.DriverManager;
/* */ import java.sql.SQLException;
/* */ import java.util.ArrayList;
/* */ import java.util.Calendar;
/* */ import java.util.HashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import java.util.Properties;
/* */ import org.apache.log4j.Logger;
/* */ import org.apache.log4j.PropertyConfigurator;
/* */ import org.json.simple.JSONObject;
/* */
/* */
/* */ public class SendThread
/* */ extends Thread
/* */ {
/* 29 */ private String[] g_strDB = new String[4];
/* 30 */ private String[] g_strFTP = new String[6];
/* 31 */ private String[] g_strFTPColl = new String[4];
/* */
/* 33 */ private String g_strTenel = "";
/* */
/* 35 */ private final Logger logger = Logger.getLogger(SendThread.class);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void run() {
/* 48 */ runCarNoImageSend();
/* 49 */ this.logger.debug(String.format("=======================================================", new Object[0]));
/* */ }
/* */
/* */
/* */
/* */
/* */ public SendThread(String str) {
/* 56 */ PropertyConfigurator.configure("./log4j.properties");
/* */
/* */
/* */ try {
/* 60 */ String propFile = "./config.properties";
/* */
/* */
/* 63 */ Properties props = new Properties();
/* */
/* */
/* 66 */ FileInputStream fis = new FileInputStream(propFile);
/* */
/* */
/* 69 */ props.load(new BufferedInputStream(fis));
/* */
/* */
/* 72 */ this.g_strDB[0] = props.getProperty("db_driver");
/* 73 */ this.g_strDB[1] = props.getProperty("db_connect");
/* 74 */ this.g_strDB[2] = props.getProperty("db_id");
/* 75 */ this.g_strDB[3] = props.getProperty("db_pw");
/* */
/* */
/* 78 */ this.g_strFTP[0] = props.getProperty("path_org");
/* 79 */ this.g_strFTP[1] = props.getProperty("ftp_ip");
/* 80 */ this.g_strFTP[2] = props.getProperty("ftp_id");
/* 81 */ this.g_strFTP[3] = props.getProperty("ftp_pw");
/* 82 */ this.g_strFTP[4] = props.getProperty("api_url");
/* 83 */ this.g_strFTP[5] = props.getProperty("path_desc");
/* */
/* 85 */ this.g_strFTPColl[0] = props.getProperty("coll_ftp_ip");
/* 86 */ this.g_strFTPColl[1] = props.getProperty("coll_ftp_id");
/* 87 */ this.g_strFTPColl[2] = props.getProperty("coll_ftp_pw");
/* 88 */ this.g_strFTPColl[3] = props.getProperty("center_ftp_ip");
/* */
/* 90 */ this.g_strTenel = props.getProperty("tennel_no");
/* */
/* */
/* 93 */ Calendar cal = Calendar.getInstance();
/* */
/* */
/* */
/* 97 */ int date = cal.get(5);
/* 98 */ this.g_strFTP[0] = String.format("%s/%02d/%s/", new Object[] { this.g_strFTP[0], Integer.valueOf(date), str });
/* */
/* 100 */ props.clear();
/* 101 */ props = null;
/* */ }
/* 103 */ catch (Exception e) {
/* 104 */ this.logger.info("Exception : " + e);
/* */ }
/* */ }
/* */
/* */
/* */ public void findFileList(String source, List<String> list) {
/* 110 */ File dir = new File(source);
/* 111 */ File[] fileList = dir.listFiles();
/* */
/* 113 */ if (fileList == null) {
/* 114 */ this.logger.debug("======== 12.5 :::" + source);
/* */
/* */ return;
/* */ }
/* 118 */ int cnt = 10;
/* 119 */ if (fileList.length < cnt) {
/* 120 */ cnt = fileList.length;
/* */ }
/* 122 */ for (int i = 0; i < cnt; i++) {
/* 123 */ File file = fileList[i];
/* 124 */ if (file.isFile()) {
/* 125 */ String tempFileName = file.getName();
/* 126 */ if (tempFileName.toLowerCase().endsWith(".jpg")) {
/* 127 */ list.add(tempFileName);
/* 128 */ this.logger.info("=== = " + file.getName());
/* */
/* */ }
/* */
/* */ }
/* 133 */ else if (file.isDirectory()) {
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 142 */ this.logger.debug("디렉토리 이름 = " + file.getName());
/* */ }
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private String transFileName(String strOrgFile, JSONObject jsonParam, Map<String, String> mapDefault) {
/* 153 */ Map<String, String> cctvID = new HashMap<>();
/* */
/* 155 */ cctvID.put("101", "A10401001");
/* 156 */ cctvID.put("102", "A10301002");
/* 157 */ cctvID.put("103", "A10201003");
/* 158 */ cctvID.put("104", "A10101004");
/* 159 */ cctvID.put("105", "A10111005");
/* 160 */ cctvID.put("106", "A10211006");
/* 161 */ cctvID.put("107", "A10311007");
/* 162 */ cctvID.put("108", "A10411008");
/* 163 */ cctvID.put("301", "A10503001");
/* 164 */ cctvID.put("302", "A10403002");
/* 165 */ cctvID.put("303", "A10303003");
/* 166 */ cctvID.put("304", "A10203004");
/* 167 */ cctvID.put("305", "폐쇄차로");
/* 168 */ cctvID.put("306", "폐쇄차로");
/* 169 */ cctvID.put("307", "A10213005");
/* 170 */ cctvID.put("308", "A10313006");
/* 171 */ cctvID.put("309", "A10413007");
/* 172 */ cctvID.put("310", "A10513008");
/* */
/* 174 */ String[] strarr = strOrgFile.split("_");
/* */
/* 176 */ String tennel = strarr[3].substring(0, 1);
/* 177 */ String line = strarr[3].substring(1, 3);
/* 178 */ String dirc = strarr[3].substring(3);
/* */
/* 180 */ dirc = cctvID.get(String.valueOf(tennel) + line);
/* 181 */ this.logger.debug("=============================X : " + dirc);
/* 182 */ dirc = dirc.substring(dirc.length() - 1);
/* 183 */ this.logger.debug("============================= Y : " + dirc);
/* 184 */ Map<String, String> mapDic = new HashMap<>();
/* 185 */ mapDic.put("1", "0");
/* 186 */ mapDic.put("2", "0");
/* 187 */ mapDic.put("3", "0");
/* 188 */ mapDic.put("4", "0");
/* 189 */ mapDic.put("5", "1");
/* 190 */ mapDic.put("6", "1");
/* 191 */ mapDic.put("7", "1");
/* 192 */ mapDic.put("8", "1");
/* */
/* 194 */ this.logger.debug("============================= Z : " + (String)mapDic.get(dirc));
/* */
/* */
/* 197 */ mapDefault.put("image_path_desc", String.format("/data2/DOTR/%s/0%s/IMAGE/", new Object[] { strarr[0], tennel }));
/* 198 */ mapDefault.put("image_path_desc_center", String.format("/DOTR/%s/0%s/IMAGE/", new Object[] { strarr[0], tennel }));
/* 199 */ mapDefault.put("work_times", strarr[1]);
/* 200 */ mapDefault.put("seqno", strarr[2]);
/* */
/* 202 */ int n = Integer.parseInt(strarr[2].substring(6, 8));
/* */
/* 204 */ if (n >= 40 && n < 50) {
/* 205 */ mapDefault.put("collect_id", "40");
/* 206 */ } else if (n >= 60 && n < 70) {
/* 207 */ mapDefault.put("collect_id", "40");
/* */ } else {
/* 209 */ mapDefault.put("collect_id", String.format("%02d", new Object[] { Integer.valueOf(n) }));
/* */ }
/* 211 */ String strRate = "95";
/* 212 */ String strCarNo = MakeCarNoHex2CarNo.makeCarNoHex2CarNo(strarr[4].trim());
/* 213 */ if (strCarNo.contains("????") || strCarNo.contains("XXXX")) {
/* 214 */ strRate = "0";
/* 215 */ this.logger.debug("=== strCarNo : " + strCarNo + ", " + strarr[4].trim());
/* */ }
/* */
/* 218 */ jsonParam.put("camId", cctvID.get(String.valueOf(tennel) + line));
/* 219 */ jsonParam.put("pasageTime", String.valueOf(strarr[0]) + strarr[1].substring(0, 6));
/* 220 */ jsonParam.put("vhcleNum", strCarNo);
/* 221 */ jsonParam.put("vhcleKnd", strarr[5].substring(0, 1));
/* 222 */ jsonParam.put("vhcleColor", "0");
/* 223 */ jsonParam.put("allImagePath", "./car_img/");
/* 224 */ jsonParam.put("vhcleImagePath", "");
/* 225 */ jsonParam.put("nopltImagePath", "");
/* 226 */ jsonParam.put("inputKnd", "");
/* 227 */ jsonParam.put("vhcleDrc", mapDic.get(dirc));
/* 228 */ jsonParam.put("recogCnfdncRate", strRate);
/* 229 */ jsonParam.put("tfclneInfo", line);
/* 230 */ jsonParam.put("recogReqreTime", "000000");
/* 231 */ jsonParam.put("regltTrgetSe", "20");
/* 232 */ jsonParam.put("fareId", "0" + tennel);
/* 233 */ jsonParam.put("boothId", line);
/* */
/* */
/* 236 */ StringBuilder pathOrg = new StringBuilder();
/* 237 */ pathOrg.append(this.g_strFTP[0]);
/* */
/* */
/* */
/* */
/* */
/* */
/* 244 */ StringBuilder path = new StringBuilder();
/* 245 */ path.append(this.g_strFTP[5]);
/* 246 */ path.append("/");
/* 247 */ path.append(strarr[0].substring(0, 4));
/* 248 */ path.append("/");
/* 249 */ path.append(strarr[0].substring(4, 6));
/* 250 */ path.append("/");
/* 251 */ path.append(strarr[0].substring(6, 8));
/* 252 */ path.append("/");
/* 253 */ path.append(cctvID.get(String.valueOf(tennel) + line));
/* 254 */ path.append("/");
/* 255 */ path.append(strarr[1].substring(0, 2));
/* 256 */ path.append("/");
/* */
/* 258 */ StringBuilder strbuf = new StringBuilder();
/* 259 */ strbuf.append("2");
/* 260 */ if (tennel.equals("1")) {
/* 261 */ strbuf.append("NO");
/* 262 */ } else if (tennel.equals("3")) {
/* 263 */ strbuf.append("NT");
/* */ } else {
/* 265 */ return null;
/* */ }
/* 267 */ strbuf.append("TT");
/* 268 */ strbuf.append("C");
/* 269 */ strbuf.append("_");
/* */
/* 271 */ strbuf.append(cctvID.get(String.valueOf(tennel) + line));
/* 272 */ strbuf.append("_");
/* */
/* 274 */ strbuf.append(strarr[0]);
/* 275 */ strbuf.append("_");
/* 276 */ strbuf.append(strarr[1]);
/* 277 */ strbuf.append("_");
/* 278 */ strbuf.append(strarr[2]);
/* 279 */ strbuf.append(".jpg");
/* */
/* 281 */ mapDefault.put("image_file_new2",
/* 282 */ String.format("0%s%s%s%sS.JPG", new Object[] { tennel, line, strarr[0], strarr[1].substring(0, 6) }));
/* */
/* 284 */ mapDefault.put("image_path", pathOrg.toString());
/* 285 */ mapDefault.put("image_file", strOrgFile);
/* */
/* */
/* 288 */ this.logger.debug("=== pathOrg.toString() : " + pathOrg.toString());
/* 289 */ this.logger.debug("=== path.toString() : " + path.toString());
/* 290 */ this.logger.debug("=== strbuf.toString() : " + strbuf.toString());
/* */
/* 292 */ jsonParam.put("allImagePath", String.format("%s%s", new Object[] { path.toString().replace(String.valueOf(this.g_strFTP[5]) + "/", ""), strbuf.toString() }));
/* */
/* 294 */ this.logger.debug("=== : " + jsonParam.toJSONString());
/* 295 */ return String.valueOf(pathOrg.toString()) + "#" + path.toString() + "#" + strbuf.toString() + "#" + line;
/* */ }
/* */
/* */ private int callAnprCarnoSend(String strJson) {
/* 299 */ int nResult = 0;
/* */
/* 301 */ HttpURLConnection connection = null;
/* 302 */ InputStream is = null;
/* 303 */ InputStreamReader isr = null;
/* 304 */ BufferedReader br = null;
/* */
/* */ try {
/* 307 */ URL url = new URL(this.g_strFTP[4]);
/* 308 */ this.logger.info("==== 수집서버 주소 : " + this.g_strFTP[4]);
/* */
/* 310 */ connection = (HttpURLConnection)url.openConnection();
/* */
/* 312 */ connection.setDoInput(true);
/* 313 */ connection.setDoOutput(true);
/* 314 */ connection.setUseCaches(false);
/* 315 */ connection.setRequestMethod("POST");
/* */
/* 317 */ connection.setConnectTimeout(30000);
/* */
/* 319 */ connection.setReadTimeout(30000);
/* */
/* */
/* */
/* 323 */ connection.setRequestProperty("Accept", "application/json");
/* 324 */ connection.setRequestProperty("Content-Type", "application/json");
/* */
/* */
/* 327 */ BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
/* 328 */ bos.write(strJson.getBytes("UTF-8"));
/* 329 */ bos.flush();
/* 330 */ bos.close();
/* */
/* 332 */ int resCode = connection.getResponseCode();
/* 333 */ StringBuffer sb = new StringBuffer();
/* 334 */ String inputLine = null;
/* */
/* 336 */ this.logger.info("==== : " + resCode);
/* 337 */ if (resCode == 200) {
/* 338 */ is = connection.getInputStream();
/* 339 */ isr = new InputStreamReader(is, "UTF-8");
/* 340 */ br = new BufferedReader(isr);
/* */
/* 342 */ while ((inputLine = br.readLine()) != null) {
/* 343 */ sb.append(inputLine);
/* */ }
/* */
/* 346 */ this.logger.info("==== " + sb.toString());
/* */ }
/* 348 */ else if (connection.getErrorStream() != null) {
/* 349 */ br = new BufferedReader(new InputStreamReader(connection.getErrorStream(), "UTF-8"));
/* */
/* 351 */ while ((inputLine = br.readLine()) != null) {
/* 352 */ sb.append(inputLine);
/* */ }
/* 354 */ this.logger.info("==== Http Error Resopnse : " + sb.toString());
/* 355 */ nResult = -1;
/* */ } else {
/* 357 */ this.logger.info("==== Http Error Resopnse : " + sb.toString());
/* 358 */ nResult = -1;
/* */ }
/* */
/* 361 */ } catch (Exception e) {
/* 362 */ this.logger.info("Exception : " + e);
/* 363 */ this.logger.info("==== Http Error Resopnse : ");
/* */
/* 365 */ nResult = -1;
/* */ } finally {
/* */ try {
/* 368 */ if (is != null)
/* 369 */ is.close();
/* 370 */ if (isr != null)
/* 371 */ isr.close();
/* 372 */ if (br != null)
/* 373 */ br.close();
/* 374 */ } catch (Exception exception) {}
/* */ }
/* */
/* */
/* 378 */ return nResult;
/* */ }
/* */
/* */
/* */ public void runCarNoImageSend() {
/* 383 */ List<String> list = new ArrayList<>();
/* 384 */ String pathOrg = this.g_strFTP[0];
/* 385 */ findFileList(pathOrg, list);
/* 386 */ if (list.size() == 0) {
/* 387 */ this.logger.debug("======== 21");
/* 388 */ this.logger.debug("신규 이미지 없음");
/* */
/* */
/* */ return;
/* */ }
/* */
/* 394 */ Map<String, String> mapNewTerminal = new HashMap<>();
/* 395 */ mapNewTerminal.put("101", "new");
/* 396 */ mapNewTerminal.put("102", "new");
/* 397 */ mapNewTerminal.put("103", "new");
/* 398 */ mapNewTerminal.put("104", "new");
/* 399 */ mapNewTerminal.put("105", "new");
/* 400 */ mapNewTerminal.put("106", "new");
/* 401 */ mapNewTerminal.put("107", "new");
/* 402 */ mapNewTerminal.put("108", "new");
/* 403 */ mapNewTerminal.put("301", "new");
/* 404 */ mapNewTerminal.put("302", "new");
/* 405 */ mapNewTerminal.put("303", "new");
/* 406 */ mapNewTerminal.put("304", "new");
/* 407 */ mapNewTerminal.put("307", "new");
/* 408 */ mapNewTerminal.put("308", "new");
/* 409 */ mapNewTerminal.put("309", "new");
/* 410 */ mapNewTerminal.put("310", "new");
/* */
/* */
/* 413 */ Map<String, String> mapDefaultCar = new HashMap<>();
/* */
/* 415 */ boolean isOk = false;
/* 416 */ String strNewFile = "";
/* 417 */ String[] strTargPath = null;
/* 418 */ JSONObject jsonParam = new JSONObject();
/* 419 */ FTPUtil sftp = new FTPUtil();
/* 420 */ sftp.init(this.g_strFTP[1], this.g_strFTP[2], this.g_strFTP[3]);
/* 421 */ for (int i = 0; i < list.size(); i++) {
/* 422 */ mapDefaultCar.clear();
/* 423 */ this.logger.debug("=== i : " + i + ", : " + (String)list.get(i));
/* */
/* 425 */ strNewFile = transFileName(list.get(i), jsonParam, mapDefaultCar);
/* 426 */ if (strNewFile == null || strNewFile.equals("") || jsonParam.size() == 0) {
/* 427 */ this.logger.debug("=== continue 1");
/* */
/* */ }
/* */ else {
/* */
/* 432 */ strTargPath = strNewFile.split("#");
/* 433 */ this.logger.debug("===" + strTargPath[0]);
/* 434 */ this.logger.debug("===" + strTargPath[1]);
/* 435 */ this.logger.debug("===" + strTargPath[2]);
/* 436 */ this.logger.debug("===" + strTargPath[3]);
/* */
/* 438 */ File Folder = new File(String.valueOf(strTargPath[0]) + "send/");
/* 439 */ if (!Folder.exists()) {
/* */ try {
/* 441 */ Folder.mkdir();
/* 442 */ this.logger.debug("폴더가 생성되었습니다.");
/* 443 */ } catch (Exception e) {
/* 444 */ e.getStackTrace();
/* */ }
/* */ } else {
/* 447 */ this.logger.debug("이미 폴더가 생성되어 있습니다.");
/* */ }
/* 449 */ File FolderErr = new File(String.valueOf(strTargPath[0]) + "error/");
/* 450 */ if (!FolderErr.exists()) {
/* */ try {
/* 452 */ FolderErr.mkdir();
/* 453 */ this.logger.debug("폴더가 생성되었습니다.(error)");
/* 454 */ } catch (Exception e) {
/* 455 */ e.getStackTrace();
/* */ }
/* */ } else {
/* 458 */ this.logger.debug("이미 폴더가 생성되어 있습니다.");
/* */ }
/* */
/* */
/* 462 */ File file = new File(String.valueOf(strTargPath[0]) + (String)list.get(i));
/* 463 */ File fileNew = new File(String.valueOf(strTargPath[0]) + "send/" + (String)list.get(i));
/* 464 */ File fileErr = new File(String.valueOf(strTargPath[0]) + "error/" + (String)list.get(i));
/* */
/* 466 */ if (fileNew.exists()) {
/* 467 */ fileNew.delete();
/* */ }
/* 469 */ if (fileErr.exists()) {
/* 470 */ fileErr.delete();
/* */ }
/* */
/* 473 */ this.logger.debug("=== 3 : " + strTargPath[0]);
/* 474 */ this.logger.debug("=== 4 : " + strTargPath[1]);
/* */
/* 476 */ isOk = false;
/* */
/* */ try {
/* 479 */ sftp.mkdir2(strTargPath[1].substring(1));
/* 480 */ this.logger.debug("폴더가 생성되었습니다.");
/* 481 */ } catch (Exception e) {
/* 482 */ e.getStackTrace();
/* */ }
/* */
/* */ try {
/* 486 */ sftp.upload(strTargPath[1], file, list.get(i), strTargPath[2]);
/* */
/* 488 */ isOk = true;
/* 489 */ } catch (SftpException e) {
/* 490 */ this.logger.info("Exception : " + e);
/* 491 */ } catch (IOException e) {
/* 492 */ this.logger.info("Exception : " + e);
/* */ }
/* */
/* 495 */ int nResult = 0;
/* 496 */ if (isOk) {
/* */
/* 498 */ nResult = callAnprCarnoSend(jsonParam.toJSONString());
/* 499 */ jsonParam.clear();
/* */ }
/* */
/* */
/* 503 */ this.logger.debug(String.format("============= : 미납체크 전", new Object[0]));
/* 504 */ String strTemp = String.valueOf(this.g_strTenel) + strTargPath[3];
/* 505 */ if (((String)mapNewTerminal.get(strTemp)).equals("new")) {
/* 506 */ this.logger.debug("============= : 미납여부 확인 후 : " + (String)mapDefaultCar.get("collect_id"));
/* 507 */ if (((String)mapDefaultCar.get("collect_id")).equals("40")) {
/* 508 */ this.logger.debug(String.format("=== update param : %s, %s, %s", new Object[] { strTargPath[1], file, list.get(i), strTargPath[2] }));
/* */
/* 510 */ this.logger.debug("==== 미납 수행 시작");
/* */ try {
/* 512 */ DefaultCar(strTargPath[3], file, mapDefaultCar);
/* 513 */ DefaultCarCenter(strTargPath[3], file, mapDefaultCar);
/* 514 */ } catch (SQLException e) {
/* 515 */ this.logger.info("Exception : " + e);
/* */ }
/* 517 */ this.logger.debug("==== 미납 수행 완료");
/* */ }
/* */ }
/* 520 */ this.logger.debug(String.format("============= : 미납체크 후", new Object[0]));
/* */
/* 522 */ if (file.exists()) {
/* 523 */ if (nResult < 0) {
/* 524 */ file.renameTo(fileErr);
/* */ } else {
/* */
/* 527 */ file.renameTo(fileNew);
/* */ }
/* */ }
/* */ }
/* */ }
/* 532 */ sftp.disconnect();
/* */ }
/* */
/* */ private void DefaultCar(String strBoothId, File file, Map<String, String> map) throws SQLException {
/* 536 */ this.logger.info(String.format("============= : DefaultCar 시작", new Object[0]));
/* */
/* 538 */ boolean isOk = false;
/* */
/* */
/* 541 */ FTPUtil sftp = new FTPUtil();
/* 542 */ sftp.init(this.g_strFTPColl[0], this.g_strFTPColl[1], this.g_strFTPColl[2]);
/* 543 */ this.logger.debug("=== : " + (String)map.get("image_path"));
/* */ try {
/* */ try {
/* 546 */ sftp.mkdir2(((String)map.get("image_path_desc")).substring(1));
/* 547 */ this.logger.debug("폴더가 생성되었습니다.");
/* 548 */ } catch (Exception e) {
/* 549 */ e.getStackTrace();
/* */ }
/* */
/* 552 */ this.logger.debug("=== " + (String)map.get("image_path_desc"));
/* 553 */ this.logger.debug("=== image_file_new2 : " + (String)map.get("image_file_new2"));
/* 554 */ this.logger.info(String.format("============= : DefaultCar 파일전송 전 ", new Object[0]));
/* */
/* 556 */ this.logger.debug(String.format("=== update2 param : %s, %s, %s", new Object[] { map.get("image_path_desc"), file, map.get("image_file"), map.get("image_file_new2") }));
/* 557 */ sftp.upload2(map.get("image_path_desc"), file, map.get("image_file"), map.get("image_file_new2"));
/* 558 */ this.logger.info(String.format("============= : DefaultCar 파일전송 후 ", new Object[0]));
/* 559 */ isOk = true;
/* 560 */ } catch (IOException e) {
/* 561 */ this.logger.info("Exception : " + e);
/* 562 */ } catch (SftpException e) {
/* 563 */ this.logger.info("Exception : " + e);
/* */ } finally {
/* 565 */ sftp.disconnect();
/* */ }
/* */
/* 568 */ if (!isOk) {
/* */ return;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 651 */ this.logger.info(String.format("============= : DefaultCar 끝", new Object[0]));
/* */ }
/* */
/* */
/* */
/* */
/* */ private void DefaultCarCenter(String strBoothId, File file, Map<String, String> map) throws SQLException {
/* 658 */ boolean isOk = false;
/* */
/* */
/* 661 */ FTPUtil sftp = new FTPUtil();
/* 662 */ sftp.init(this.g_strFTPColl[3], this.g_strFTPColl[1], this.g_strFTPColl[2]);
/* 663 */ this.logger.debug("============ Center ftp connect");
/* */ try {
/* */ try {
/* 666 */ sftp.mkdir2(((String)map.get("image_path_desc_center")).substring(1));
/* 667 */ this.logger.debug("폴더가 생성되었습니다.");
/* 668 */ } catch (Exception e) {
/* 669 */ e.getStackTrace();
/* */ }
/* */
/* 672 */ this.logger.debug("=== " + (String)map.get("image_path_desc_center"));
/* 673 */ this.logger.debug("=== image_file_new2 : " + (String)map.get("image_file_new2"));
/* 674 */ this.logger.info(String.format("============= : DefaultCarCenter 파일전송 전 ", new Object[0]));
/* */
/* 676 */ this.logger.debug(String.format("=== update2 param : %s, %s, %s", new Object[] { map.get("image_path_desc_center"), file, map.get("image_file"), map.get("image_file_new2") }));
/* 677 */ sftp.upload2(map.get("image_path_desc_center"), file, map.get("image_file"), map.get("image_file_new2"));
/* 678 */ this.logger.info(String.format("============= : DefaultCarCenter 파일전송 후 ", new Object[0]));
/* 679 */ isOk = true;
/* 680 */ } catch (IOException e) {
/* 681 */ this.logger.info("Exception : " + e);
/* 682 */ } catch (SftpException e) {
/* 683 */ this.logger.info("Exception : " + e);
/* */ } finally {
/* 685 */ sftp.disconnect();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private Connection getOrclConn() throws Exception {
/* 774 */ Class.forName(this.g_strDB[0]);
/* 775 */ return DriverManager.getConnection(this.g_strDB[1], this.g_strDB[2], this.g_strDB[3]);
/* */ }
/* */
/* */
/* */
/* */ private Connection getOrclConnCenter() throws Exception {
/* 781 */ Class.forName(this.g_strDB[0]);
/* 782 */ return DriverManager.getConnection("jdbc:oracle:thin:@150.50.46.11:1521:Ora91", "NAMSAN", "namsan");
/* */ }
/* */ }
/* Location: C:\Users\XIT_LBJ\Desktop\ \ \3 \car\anpr\anpr_status_send.jar!\SendThread.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="severity" value="error" />
<!--module name="Header">
<property name="headerFile" value="${checkstyle.header.file}" />
<message key="header.missing" value="Source file missing Quartz license header" />
<message key="header.mismatch" value="Quartz license header mismatch" />
</module-->
<module name="FileTabCharacter" />
<module name="TreeWalker">
<module name="FileContentsHolder"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE_ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
</module>
Loading…
Cancel
Save