|
|
|
|
@ -36,30 +36,29 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
@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);
|
|
|
|
|
System.out.println(properties.getProperty("URL"));
|
|
|
|
|
|
|
|
|
|
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("residentNo", data.get("residentNo"));
|
|
|
|
|
param.put("carNo", data.get("carNo"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
wr.flush();
|
|
|
|
|
@ -70,74 +69,70 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
while((line = in.readLine()) != null){
|
|
|
|
|
sb.append(line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// System.out.println(sb.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
// String text = sb.toString();
|
|
|
|
|
// ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
//
|
|
|
|
|
// Map<String, Object> map = mapper.readValue(text, Map.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (JsonMappingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// return map;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> sisulPenaltyList(Map<String, Object> data) {
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> sisulPenaltyList(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);
|
|
|
|
|
// System.out.println(properties.getProperty("URL"));
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("PENALTY")); // 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("workerId", data.get("workerId"));
|
|
|
|
|
param.put("fareOfficeId", data.get("fareOfficeId"));
|
|
|
|
|
param.put("boothId", data.get("boothId"));
|
|
|
|
|
param.put("passDate", data.get("passDate"));
|
|
|
|
|
param.put("workTimes", data.get("workTimes"));
|
|
|
|
|
param.put("seqno", data.get("seqno"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
wr.flush();
|
|
|
|
|
@ -148,63 +143,64 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
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) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// return map;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> selectSisulDefaultResiList(Map<String, Object> data) {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> selectSisulDefaultResiList(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);
|
|
|
|
|
// System.out.println(properties.getProperty("URL"));
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("DEFAULT")); // 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("carNo", data.get("carNo"));
|
|
|
|
|
param.put("residentNo", data.get("residentNo"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
wr.flush();
|
|
|
|
|
@ -215,64 +211,64 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
System.out.println("jsonResult"+ jsonResult.toJSONString());
|
|
|
|
|
|
|
|
|
|
if(jsonResult.size() != 0) {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (JsonMappingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// return map;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> selectSisulOverList(Map<String, Object> data) {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> selectSisulOverList(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);
|
|
|
|
|
// System.out.println(properties.getProperty("URL"));
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("OVER")); // 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("carNo", data.get("carNo"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
wr.flush();
|
|
|
|
|
@ -283,41 +279,40 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
System.out.println("jsonResult"+ jsonResult.toJSONString());
|
|
|
|
|
|
|
|
|
|
if(jsonResult.size() != 0) {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
|
con.disconnect();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (JsonMappingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// return map;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* jsonObject --> map 으로 변경
|
|
|
|
|
* JSONObject 에 JSONArray 없어야 햠.
|
|
|
|
|
@ -335,7 +330,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* json array 를 list map 으로 변경.
|
|
|
|
|
*
|
|
|
|
|
@ -352,6 +347,6 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|