|
|
|
|
@ -100,87 +100,77 @@ public class CommWebBrowserController {
|
|
|
|
|
* 자동판독 요청 수신
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/cfs/trsmrcv/callDecisionTrough.do", method=RequestMethod.POST)
|
|
|
|
|
@RequestMapping(value={"/cfs/trsmrcv/callDecisionTrough.do"}, method=RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> callDecisionTrough(@RequestBody Map<String, String> param, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
ResultSmartPlatform result = new ResultSmartPlatform();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> mapOrg = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 차량번호기준 면제 체크
|
|
|
|
|
* 면제 테이블 체크
|
|
|
|
|
* 감면 테이블 체크
|
|
|
|
|
*
|
|
|
|
|
* 사전등록결제 대상이면 결제처리...
|
|
|
|
|
*/
|
|
|
|
|
ResultSmartPlatform webRes = new ResultSmartPlatform();
|
|
|
|
|
Map<String, Object> webResData = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
String carNo = param.get("carNo");
|
|
|
|
|
if(carNo == null){
|
|
|
|
|
carNo = "";
|
|
|
|
|
param.put("carNo", carNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(carNo.equals("")
|
|
|
|
|
||carNo.indexOf("???") != -1
|
|
|
|
|
|| carNo.indexOf("XXX") != -1){
|
|
|
|
|
webResData = new HashMap<String, Object>();
|
|
|
|
|
webResData.put("resultExmpCd", "00");
|
|
|
|
|
webResData.put("resultDecode", "00");
|
|
|
|
|
webRes.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, webResData);
|
|
|
|
|
webRes.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.(대상 없음)");
|
|
|
|
|
return webRes.getResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = null;
|
|
|
|
|
List<Map<String, Object>> obj = null;
|
|
|
|
|
try {
|
|
|
|
|
mapOrg.put("READ_RESULT_ID", "01");
|
|
|
|
|
mapOrg.put("READING_ID", "30");
|
|
|
|
|
mapOrg.put("READ_KBN", "1");
|
|
|
|
|
mapOrg.put("READER", "admin");
|
|
|
|
|
mapOrg.put("workerId", param.get("workerId"));
|
|
|
|
|
mapOrg.put("fareOfficeId", param.get("fareOfficeId"));
|
|
|
|
|
mapOrg.put("boothId", param.get("boothId"));
|
|
|
|
|
mapOrg.put("year", param.get("year"));
|
|
|
|
|
mapOrg.put("month", param.get("month"));
|
|
|
|
|
mapOrg.put("day", param.get("day"));
|
|
|
|
|
mapOrg.put("workTimes", param.get("workTimes"));
|
|
|
|
|
mapOrg.put("seqno", param.get("seqno"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 차량번호기준 면제 체크
|
|
|
|
|
String exmptCheckReturn = this.searchExmptCarNo(param.get("carNo"), true);
|
|
|
|
|
Map<String, String> exemptSearchMap = new HashMap<String, String>();
|
|
|
|
|
exemptSearchMap.put("carNo", param.get("carNo").toString());
|
|
|
|
|
exemptSearchMap.put("year", param.get("year").toString());
|
|
|
|
|
exemptSearchMap.put("month", param.get("month").toString());
|
|
|
|
|
exemptSearchMap.put("day", param.get("day").toString());
|
|
|
|
|
|
|
|
|
|
if(exmptCheckReturn.equals("03") == true) {
|
|
|
|
|
map = new HashMap<String, Object>();
|
|
|
|
|
map.put("resultExmpCd", "01");
|
|
|
|
|
map.put("resultDecode", "10");
|
|
|
|
|
map.put("remarks", "화물 차량/경형승합화물");
|
|
|
|
|
List<Map<String, String>> exemptResultSet = commCollectServerService.selectExemptCarInfoAuto(exemptSearchMap);
|
|
|
|
|
if(exemptResultSet != null && exemptResultSet.size() > 0) {
|
|
|
|
|
|
|
|
|
|
mapOrg.put("EXEMPT_REASON_ID", "10");
|
|
|
|
|
mapOrg.put("REMARKS", "면제자동판단(화물자동차)");
|
|
|
|
|
mapOrg.put("WORKER", "시스템");
|
|
|
|
|
webResData = new HashMap<String, Object>();
|
|
|
|
|
webResData.put("resultExmpCd", "01");
|
|
|
|
|
|
|
|
|
|
commCollectServerService.updateDecisionResult(mapOrg);
|
|
|
|
|
|
|
|
|
|
logger.info("자동판독 면제처리1 (" + param.get("carNo") + ")");
|
|
|
|
|
logger.info(map.toString());
|
|
|
|
|
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(exmptCheckReturn.equals("05") == true) {
|
|
|
|
|
Map<String, String> mapTemp = new HashMap<String, String>();
|
|
|
|
|
mapTemp.put("carNo", param.get("carNo").toString());
|
|
|
|
|
mapTemp.put("year", param.get("year").toString());
|
|
|
|
|
mapTemp.put("month", param.get("month").toString());
|
|
|
|
|
mapTemp.put("day", param.get("day").toString());
|
|
|
|
|
Map<String,String> exemptResultSet1 = exemptResultSet.get(0);
|
|
|
|
|
|
|
|
|
|
obj = commCollectServerService.selectExemptCarInfoAuto(mapTemp);
|
|
|
|
|
if(obj != null && obj.size() > 0) {
|
|
|
|
|
map = new HashMap<String, Object>();
|
|
|
|
|
map.put("resultExmpCd", "01");
|
|
|
|
|
map.put("resultDecode", obj.get(0).get("EXEMPT_KBN").toString());
|
|
|
|
|
map.put("remarks", obj.get(0).get("REMARKS").toString());
|
|
|
|
|
|
|
|
|
|
mapOrg.put("EXEMPT_REASON_ID", obj.get(0).get("EXEMPT_KBN").toString());
|
|
|
|
|
mapOrg.put("REMARKS", obj.get(0).get("REMARKS").toString());
|
|
|
|
|
mapOrg.put("WORKER", "시스템");
|
|
|
|
|
|
|
|
|
|
commCollectServerService.updateDecisionResult(mapOrg);
|
|
|
|
|
|
|
|
|
|
logger.info("자동판독 면제처리2 (" + param.get("carNo") + ")");
|
|
|
|
|
logger.info(map.toString());
|
|
|
|
|
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
return result.getResult();
|
|
|
|
|
webResData.put("resultDecode", exemptResultSet1.get("EXEMPT_REASON_ID"));
|
|
|
|
|
webResData.put("remarks", exemptResultSet1.get("REMARKS"));
|
|
|
|
|
|
|
|
|
|
Map<String, Object> udtMap = new HashMap<String, Object>();
|
|
|
|
|
udtMap.put("workerId", param.get("workerId"));
|
|
|
|
|
udtMap.put("fareOfficeId", param.get("fareOfficeId"));
|
|
|
|
|
udtMap.put("boothId", param.get("boothId"));
|
|
|
|
|
udtMap.put("year", param.get("year"));
|
|
|
|
|
udtMap.put("month", param.get("month"));
|
|
|
|
|
udtMap.put("day", param.get("day"));
|
|
|
|
|
udtMap.put("workTimes", param.get("workTimes"));
|
|
|
|
|
udtMap.put("seqno", param.get("seqno"));
|
|
|
|
|
udtMap.put("READ_RESULT_ID", "01");
|
|
|
|
|
udtMap.put("READING_ID", "30");
|
|
|
|
|
udtMap.put("READ_KBN", "1");
|
|
|
|
|
udtMap.put("READER", "admin");
|
|
|
|
|
udtMap.put("EXEMPT_REASON_ID", exemptResultSet1.get("EXEMPT_REASON_ID"));
|
|
|
|
|
if(exemptResultSet1.get("REMARKS2") != null && !exemptResultSet1.get("REMARKS2").equals("")){
|
|
|
|
|
udtMap.put("REMARKS", exemptResultSet1.get("REMARKS2"));
|
|
|
|
|
} else {
|
|
|
|
|
udtMap.put("REMARKS", exemptResultSet1.get("REMARKS"));
|
|
|
|
|
}
|
|
|
|
|
udtMap.put("WORKER", "시스템");
|
|
|
|
|
commCollectServerService.updateDecisionResult(udtMap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
webRes.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, webResData);
|
|
|
|
|
webRes.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
return webRes.getResult();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> codeMap_redu = new HashMap<String, String>();
|
|
|
|
|
codeMap_redu.put("00", "경차");
|
|
|
|
|
@ -189,12 +179,11 @@ public class CommWebBrowserController {
|
|
|
|
|
codeMap_redu.put("03", "저공해");
|
|
|
|
|
|
|
|
|
|
String reduCheckReturn = "";
|
|
|
|
|
|
|
|
|
|
obj = commCollectServerService.selectReduCarList(param);
|
|
|
|
|
if(obj != null && obj.size() > 0) {
|
|
|
|
|
List<Map<String, Object>> reduResultSet = commCollectServerService.selectReduCarList(param);
|
|
|
|
|
if(reduResultSet != null && reduResultSet.size() > 0) {
|
|
|
|
|
boolean localResidentsYn = false;
|
|
|
|
|
for(int i=0; i<obj.size(); i++){
|
|
|
|
|
if(obj.get(i).get("REDU_CD").toString().equals("02")){
|
|
|
|
|
for(int i=0; i<reduResultSet.size(); i++){
|
|
|
|
|
if(reduResultSet.get(i).get("REDU_CD").toString().equals("02")){
|
|
|
|
|
localResidentsYn = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -202,120 +191,39 @@ public class CommWebBrowserController {
|
|
|
|
|
if(localResidentsYn){
|
|
|
|
|
reduCheckReturn = "02";
|
|
|
|
|
} else {
|
|
|
|
|
reduCheckReturn = obj.get(0).get("REDU_CD").toString();
|
|
|
|
|
reduCheckReturn = reduResultSet.get(0).get("REDU_CD").toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!reduCheckReturn.equals("")){
|
|
|
|
|
map = new HashMap<String, Object>();
|
|
|
|
|
map.put("resultExmpCd", "20");
|
|
|
|
|
map.put("resultDecode", reduCheckReturn);
|
|
|
|
|
map.put("remarks", String.format("%s감면 차량", codeMap_redu.get(reduCheckReturn)));
|
|
|
|
|
webResData = new HashMap<String, Object>();
|
|
|
|
|
webResData.put("resultExmpCd", "20");
|
|
|
|
|
webResData.put("resultDecode", reduCheckReturn);
|
|
|
|
|
webResData.put("remarks", String.format("%s감면 차량", codeMap_redu.get(reduCheckReturn)));
|
|
|
|
|
|
|
|
|
|
logger.info("자동판독 감면처리 (" + param.get("carNo") + ")");
|
|
|
|
|
logger.info(map.toString());
|
|
|
|
|
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
return result.getResult();
|
|
|
|
|
|
|
|
|
|
webRes.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, webResData);
|
|
|
|
|
webRes.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
return webRes.getResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
map = new HashMap<String, Object>();
|
|
|
|
|
map.put("resultExmpCd", "00");
|
|
|
|
|
map.put("resultDecode", "00");
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.(대상 없음)");
|
|
|
|
|
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
|
|
|
|
|
webResData = new HashMap<String, Object>();
|
|
|
|
|
webResData.put("resultExmpCd", "00");
|
|
|
|
|
webResData.put("resultDecode", "00");
|
|
|
|
|
webRes.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.(대상 없음)");
|
|
|
|
|
webRes.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, webResData);
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
|
|
|
|
webRes.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
webRes.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info(result.getResult().get("resultMessage").toString());
|
|
|
|
|
return result.getResult();
|
|
|
|
|
return webRes.getResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
private boolean isNumeric(String s) {
|
|
|
|
|
try {
|
|
|
|
|
Double.parseDouble(s);
|
|
|
|
|
return true;
|
|
|
|
|
} catch(NumberFormatException e) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String searchExmptCarNo(String strCarNo, boolean isAuto) {
|
|
|
|
|
// 차량번호로 면제 처리
|
|
|
|
|
// 비사업자용외 면제
|
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
|
|
list.add("아");
|
|
|
|
|
list.add("사");
|
|
|
|
|
list.add("바");
|
|
|
|
|
list.add("자");
|
|
|
|
|
list.add("배");
|
|
|
|
|
|
|
|
|
|
if(isAuto == false) {
|
|
|
|
|
list.add("국");
|
|
|
|
|
list.add("합");
|
|
|
|
|
list.add("육");
|
|
|
|
|
list.add("해");
|
|
|
|
|
list.add("공");
|
|
|
|
|
list.add("외교");
|
|
|
|
|
list.add("영사");
|
|
|
|
|
list.add("준외");
|
|
|
|
|
list.add("준영");
|
|
|
|
|
list.add("협정");
|
|
|
|
|
list.add("대표");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < list.size(); i++) {
|
|
|
|
|
if(strCarNo.contains(list.get(i)) == true)
|
|
|
|
|
return "03";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 비승용차 면제
|
|
|
|
|
String strTemp = "";
|
|
|
|
|
if(strCarNo.length() == 9) { // 서울01가1234
|
|
|
|
|
strTemp = strCarNo.substring(strCarNo.length() -7, strCarNo.length()-5);
|
|
|
|
|
}
|
|
|
|
|
else if(strCarNo.length() == 7) { // 01가1234
|
|
|
|
|
strTemp = strCarNo.substring(strCarNo.length() -7, strCarNo.length()-5);
|
|
|
|
|
}
|
|
|
|
|
else if(strCarNo.length() == 8) { // 123가1234, 서울1가1234
|
|
|
|
|
strTemp = strCarNo.substring(0, 3);
|
|
|
|
|
if(isNumeric(strTemp) == true) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
strTemp = strTemp.substring(strTemp.length() -1, strTemp.length());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(Integer.parseInt(strTemp) >= 70)
|
|
|
|
|
return "03";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 면제 테이블 조회
|
|
|
|
|
Map<String, String> param = new HashMap<String, String>();
|
|
|
|
|
param.put("carNo", strCarNo);
|
|
|
|
|
try {
|
|
|
|
|
List<Map<String, Object>> obj = commCollectServerService.selectExemptCarInfo(param);
|
|
|
|
|
if(obj != null && Integer.parseInt(obj.get(0).get("CNT").toString()) > 0) {
|
|
|
|
|
System.out.println(obj.get(0).get("CAR_NO"));
|
|
|
|
|
if(isAuto == true)
|
|
|
|
|
return "05";
|
|
|
|
|
else
|
|
|
|
|
return "03";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("면제 테이블 조회");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.info("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
/**
|
|
|
|
|
|