소스정리(미사용 메소드 제거)

main
이범준 7 months ago
parent 77bcbd28e6
commit bed64f7de7

@ -72,8 +72,6 @@ public class CalcFeeThread implements Runnable {
return;
}
// 요금 계산
//calculateFee();
}catch(RuntimeException e) {
logger.info("catch check");
@ -82,51 +80,6 @@ public class CalcFeeThread implements Runnable {
}
}
/**
*
* <pre></pre>
*/
@SuppressWarnings("unused")
private void calculateFee() {
List<Map<String, Object>> obj = null;
try {
// 면제조회
obj = this.svc.selectExemptedCar(this.vo);
if (obj == null || obj.get(0).get("CNT").toString().equals("0") == true) {
// 감면조회
obj = this.svc.selectReductedCar(this.vo);
if (obj != null && obj.size() > 0) {
// 감면율 적용....
int n = 0;
if(this.vo.getPassAmount() == null || this.vo.getPassAmount().length() == 0) {
n = 2000;
}
else {
n = Integer.parseInt(this.vo.getPassAmount());
}
this.vo.setPassAmount(String.format("%d", n / 2));
}
// 사전등록결제 대상여부
obj = this.svc.selectPreRegistCar(this.vo);
if (obj != null && obj.size() > 0) {
callPreRegistPayment(obj.get(0));
}
}
else {
// 면제처리
this.vo.setPassAmount("0");
}
// 납부 처리 추가...
}catch(RuntimeException e) {
logger.info("catch check");
} catch (Exception e) {
logger.info("catch check");
}
}
/**
*
@ -214,54 +167,4 @@ public class CalcFeeThread implements Runnable {
return nReturn;
}
/**
* ()
* <pre></pre>
*/
private int callPreRegistPayment(Map<String, Object> map) {
int nReturn = 0;
try {
this.vo.setCarOwnerCi(map.get("CAR_OWNER_CI").toString());
// 사전등록결제를 위한 함수 호출
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("WORKER_ID", this.vo.getWorkerId());
mapOrg.put("FARE_OFFICE_ID", this.vo.getFareOfficeId());
mapOrg.put("BOOTH_ID", this.vo.getBoothId());
mapOrg.put("YEAR", this.vo.getYear());
mapOrg.put("MONTH", this.vo.getMonth());
mapOrg.put("DAY", this.vo.getDay());
mapOrg.put("WORK_TIMES", this.vo.getWorkTimes());
mapOrg.put("SEQNO", this.vo.getSeqno());
mapOrg.put("PASS_DATE", this.vo.getPassDate());
// 임시 감면율을 적용하여 요금청구...???
mapOrg.put("PASS_AMOUNT", this.vo.getPassAmount());
mapOrg.put("CAR_NO", this.vo.getCarNoRevis());
mapOrg.put("CAR_OWNER_CI", this.vo.getCarOwnerCi());
// Call the method of the service
CommSmartPlatformPRPService service = (CommSmartPlatformPRPService) ctrl.getApplicationContext().getBean("commSmartPlatformPRPService");
map = service.callPreRegistPayment(mapOrg);
System.out.println("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
nReturn = -1;
}
service = null;
}catch(RuntimeException e) {
logger.info("catch check");
} catch (Exception e) {
logger.info("catch check");
}
if(nReturn < 0)
this.isSucess = false;
return nReturn;
}
}

@ -1678,265 +1678,8 @@ public class CommSmartPlatformPRPController {
}
/**
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callPrpmstInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callPrpmstInfo(@RequestBody Map<String, Object> param, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, String> pMap = new HashMap<String, String>();
pMap.put("insttNo", param.get("insttNo").toString());
pMap.put("insttCntcJobSe", param.get("insttCntcJobSe").toString());
pMap.put("requstDt", param.get("requstDt").toString());
pMap.put("registDt", param.get("registDt").toString());
pMap.put("indexStart", param.get("indexStart").toString());
pMap.put("indexEnd", param.get("indexEnd").toString());
logger.info("==== pMap.toString()");
logger.info("==== " + pMap.toString());
// 사전등록결제 웹서비스 호출
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_036");
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(pMap);
//결과 수신
logger.info("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
logger.info("callPrpmstInfo_조회 실패");
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
//성공 처리 Table Insert
JSONParser parser = new JSONParser();
JSONObject jsonParam = (JSONObject)parser.parse(map.get("data").toString());
System.out.println("=== " + jsonParam.toJSONString());
List<Map<String, String>> obj = (List<Map<String, String>>)jsonParam.get("dataArray");
String strExmptCode = "";
// 사전등록정보 갱신
for(int i=0; i< obj.size(); i++){
logger.info("=== 1 vhcleOwnerCi : " + obj.get(i).get("vhcleOwnerCi").toString());
obj.get(i).put("CAR_NO", obj.get(i).get("vhcleNo"));
obj.get(i).put("CAR_OWNER_CI", obj.get(i).get("vhcleOwnerCi"));
obj.get(i).put("OWNER_NM", obj.get(i).get("mberNm"));
obj.get(i).put("MODI_YN", "N");
// 01: 일반, 02: 경차, 03: 면제
// 면제차량 확인
strExmptCode = searchExmptCarNo(obj.get(i).get("CAR_NO").toString(), false);
// 감면차량 확인
if(strExmptCode.equals("") == true) {
strExmptCode = searchHalfExmptCarNo(obj.get(i).get("CAR_NO").toString());
}
obj.get(i).put("EXMP_CD", strExmptCode);
obj.get(i).put("CAR_NO_HEX", CarNo2Code.runCarNo2Code(obj.get(i).get("CAR_NO").toString()));
obj.get(i).put("REQ_DATE", obj.get(i).get("registDt"));
obj.get(i).put("WORKER", "admin");
// 탈퇴이거나 차량을 삭제하면 삭제만 함.
if(obj.get(i).get("secsnAt").toString().equals("Y") == true
|| obj.get(i).get("vhcleSttusTy").toString().equals("03") == true
|| obj.get(i).get("vhcleSttusTy").toString().equals("02") == true
|| obj.get(i).get("namsanPasmny").toString().equals("N") == true
) {
logger.info("=== 사전등록결제 회원 탈퇴 : " + obj.get(i).get("CAR_NO").toString());
obj.get(i).put("SECSN_YN", "Y");
obj.get(i).put("SECSN_DATE", obj.get(i).get("sbscrbDt").toString());
obj.get(i).put("MODI_YN", "Y");
}else {
obj.get(i).put("SECSN_YN", "N");
}
commSmartPlatformPRPService.insertPreChgInfo(obj.get(i));
logger.info("========= 마스터 insert전 테스트 데이터 확인");
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}catch(RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
return result.getResult();
}
/**
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callPrpchgInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callPrpchgInfo(@RequestBody Map<String, Object> param, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, String> pMap = new HashMap<String, String>();
pMap.put("insttNo", param.get("insttNo").toString());
pMap.put("insttCntcJobSe", param.get("insttCntcJobSe").toString());
pMap.put("requstDt", param.get("requstDt").toString());
pMap.put("startDt", param.get("startDt").toString());
pMap.put("endDt", param.get("endDt").toString());
pMap.put("indexStart", param.get("indexStart").toString());
pMap.put("indexEnd", param.get("indexEnd").toString());
logger.info("==== pMap.toString()");
logger.info("==== " + pMap.toString());
// 사전등록결제 웹서비스 호출
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_037");
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(pMap);
//결과 수신
logger.info("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
logger.info("callPrpchgInfo_조회 실패");
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}catch(RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
return result.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("배");
/*
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 "";
}
private String searchHalfExmptCarNo(String strCarNo) {
// 감면 테이블 조회(겸차, 저공해)
Map<String, String> param = new HashMap<String, String>();
param.put("carNo", strCarNo);
try {
List<Map<String, Object>> obj = commCollectServerService.selectSmallCarInfo(param);
if(obj.get(0).get("CNT").toString().equals("0") == false) {
return "02";
}
logger.info("");
}catch(RuntimeException e) {
logger.info("catch check");
logger.info("경차 테이블 조회");
} catch (Exception e) {
logger.info("catch check");
logger.info("경차 테이블 조회");
}
return "01";
}
}

Loading…
Cancel
Save