|
|
|
|
@ -32,8 +32,8 @@ import com.ibatis.common.resources.Resources;
|
|
|
|
|
@Transactional
|
|
|
|
|
public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> sisulPenaltyList(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 {
|
|
|
|
|
@ -43,7 +43,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
properties.load(reader);
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("PENALTY")); // API URL
|
|
|
|
|
obj = new URL(properties.getProperty("DEFAULT")); // API URL
|
|
|
|
|
|
|
|
|
|
HttpURLConnection con = (HttpURLConnection)obj.openConnection();
|
|
|
|
|
con.setRequestMethod("POST"); // GET, POST
|
|
|
|
|
@ -54,12 +54,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
// 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"));
|
|
|
|
|
param.put("carNo", data.get("carNo"));
|
|
|
|
|
param.put("residentNo", data.get("residentNo"));
|
|
|
|
|
|
|
|
|
|
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
|
|
|
|
|
wr.write(param.toString());
|
|
|
|
|
@ -78,6 +74,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
Map<String, Object> resCode = new HashMap<>();
|
|
|
|
|
resCode.put("resCode", con.getResponseCode());
|
|
|
|
|
result.add(resCode);
|
|
|
|
|
|
|
|
|
|
if(jsonResult.size() != 0) {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
@ -105,7 +102,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> selectSisulDefaultResiList(Map<String, Object> data) {
|
|
|
|
|
public List<Map<String, Object>> sisulPenaltyList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@ -115,7 +112,7 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
properties.load(reader);
|
|
|
|
|
|
|
|
|
|
URL obj = null;
|
|
|
|
|
obj = new URL(properties.getProperty("DEFAULT")); // API URL
|
|
|
|
|
obj = new URL(properties.getProperty("PENALTY")); // API URL
|
|
|
|
|
|
|
|
|
|
HttpURLConnection con = (HttpURLConnection)obj.openConnection();
|
|
|
|
|
con.setRequestMethod("POST"); // GET, POST
|
|
|
|
|
@ -126,8 +123,12 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
// DATA
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
|
|
|
|
|
param.put("carNo", data.get("carNo"));
|
|
|
|
|
param.put("residentNo", data.get("residentNo"));
|
|
|
|
|
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());
|
|
|
|
|
@ -146,7 +147,6 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
Map<String, Object> resCode = new HashMap<>();
|
|
|
|
|
resCode.put("resCode", con.getResponseCode());
|
|
|
|
|
result.add(resCode);
|
|
|
|
|
|
|
|
|
|
if(jsonResult.size() != 0) {
|
|
|
|
|
result = getListMapFromJsonArray(jsonResult);
|
|
|
|
|
}
|
|
|
|
|
@ -173,6 +173,8 @@ public class ApiMainServiceImpl implements ApiMainService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> selectSisulOverList(Map<String, Object> data) {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|