|
|
|
|
@ -36,6 +36,9 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
public List<Map<String, Object>> selectSisulDefaultResiList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
System.out.println("요청 확인");
|
|
|
|
|
System.out.println(data.toString());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String resource = "../api.properties";
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
|
@ -56,6 +59,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
|
|
|
|
|
param.put("carNo", data.get("carNo"));
|
|
|
|
|
param.put("residentNo", data.get("residentNo"));
|
|
|
|
|
param.put("carDiv", data.get("carDiv"));
|
|
|
|
|
param.put("allCarCheck", data.get("allCarCheck"));
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
@ -79,7 +84,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("응답 확인");
|
|
|
|
|
System.out.println(result.toString());
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
@ -105,6 +111,9 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
public List<Map<String, Object>> sisulPenaltyList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
System.out.println("요청 확인");
|
|
|
|
|
System.out.println(data.toString());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String resource = "../api.properties";
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
|
@ -151,7 +160,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("응답 확인");
|
|
|
|
|
System.out.println(result.toString());
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
@ -179,6 +189,9 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
public List<Map<String, Object>> selectSisulOverList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
System.out.println("요청 확인");
|
|
|
|
|
System.out.println(data.toString());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String resource = "../api.properties";
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
|
@ -221,7 +234,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("응답 확인");
|
|
|
|
|
System.out.println(result.toString());
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
@ -244,77 +258,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> sisulDefaultList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String resource = "../api.properties";
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
|
Reader reader = Resources.getResourceAsReader(resource);
|
|
|
|
|
properties.load(reader);
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("URL")); // API URL
|
|
|
|
|
|
|
|
|
|
HttpURLConnection con = (HttpURLConnection)obj.openConnection();
|
|
|
|
|
con.setRequestMethod("POST"); // GET, POST
|
|
|
|
|
con.setRequestProperty("Content-type", "application/json; charset=UTF-8");
|
|
|
|
|
con.setDoOutput(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DATA
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
|
|
|
|
|
param.put("stDate", data.get("stDate"));
|
|
|
|
|
param.put("edDate", data.get("edDate"));
|
|
|
|
|
param.put("carNo", data.get("carNo"));
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
wr.flush();
|
|
|
|
|
// API 호출
|
|
|
|
|
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
|
|
|
|
|
String line;
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
|
while((line = in.readLine()) != null){
|
|
|
|
|
sb.append(line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONParser parser = new JSONParser();
|
|
|
|
|
JSONArray jsonResult = (JSONArray)parser.parse(sb.toString());
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resCode = new HashMap<>();
|
|
|
|
|
resCode.put("resCode", con.getResponseCode());
|
|
|
|
|
result.add(resCode);
|
|
|
|
|
if(jsonResult.size() != 0) {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (JsonMappingException e) {
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* jsonObject --> map 으로 변경
|
|
|
|
|
|