소스정리

main
이범준 4 months ago
parent 63492b7efc
commit 41d0f974ba

@ -20,21 +20,22 @@ public class ApiMainController {
@Resource(name = "apiMainService")
private ApiMainService apiMainService;
@RequestMapping(value = "/sisulPenaltyList", produces = "application/json; charset=utf8", method=RequestMethod.POST)
public List<Map<String, Object>> sisulPenaltyList(@RequestBody Map<String, Object> data) {
return apiMainService.sisulPenaltyList(data);
}
@RequestMapping(value = "/selectSisulDefaultResiList", produces = "application/json; charset=utf8", method=RequestMethod.POST)
public List<Map<String, Object>> selectSisulDefaultResiList(@RequestBody Map<String, Object> data) {
return apiMainService.selectSisulDefaultResiList(data);
}
@RequestMapping(value = "/sisulPenaltyList", produces = "application/json; charset=utf8", method=RequestMethod.POST)
public List<Map<String, Object>> sisulPenaltyList(@RequestBody Map<String, Object> data) {
return apiMainService.sisulPenaltyList(data);
}
@RequestMapping(value = "/selectSisulOverList", produces = "application/json; charset=utf8", method=RequestMethod.POST)
public List<Map<String, Object>> selectSisulOverList(@RequestBody Map<String, Object> data) {
return apiMainService.selectSisulOverList(data);
}
@RequestMapping(value = "/sisulDefaultList", produces = "application/json; charset=utf8", method=RequestMethod.POST)
public List<Map<String, Object>> sisulDefaultList(@RequestBody Map<String, Object> data) {
return apiMainService.sisulDefaultList(data);

@ -5,13 +5,13 @@ import java.util.Map;
public interface ApiMainService {
List<Map<String, Object>> selectSisulDefaultResiList(Map<String, Object> data);
List<Map<String, Object>> sisulPenaltyList(Map<String, Object> data);
List<Map<String, Object>> selectSisulDefaultResiList(Map<String, Object> data);
List<Map<String, Object>> selectSisulOverList(Map<String, Object> data);
List<Map<String, Object>> sisulDefaultList(Map<String, Object> data);
}

@ -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>>();

@ -1,12 +1,12 @@
#\uc5f0\uacc4 \uc11c\ube44\uc2a4 URL
#\ubbf8\ub0a9 \uae30\uac04\uc9c0\uc815 \uc870\ud68c api
URL=http://175.193.201:92/rest/cfs/sisulDefaultNotification.do
#\uacfc\ud0dc\ub8cc \uc870\ud68c api
PENALTY=http://175.193.201:92/rest/cfs/sisulPenaltyNotification.do
#\ubbf8\ub0a9 \uc870\ud68c api
DEFAULT=http://175.193.201:92/rest/cfs/selectSisulDefaultResiList.do
#\uacfc\ud0dc\ub8cc \uc870\ud68c api
PENALTY=http://175.193.201:92/rest/cfs/sisulPenaltyNotification.do
#\uacfc\uc624\ub0a9 \uc870\ud68c api
OVER=http://175.193.201:92/rest/cfs/selectSisulOverFareList.do
#\ubbf8\ub0a9 \uae30\uac04\uc9c0\uc815 \uc870\ud68c api
URL=http://175.193.201:92/rest/cfs/sisulDefaultNotification.do

Loading…
Cancel
Save