|
|
|
|
@ -45,6 +45,7 @@ import cfs.trsmrcv.dao.CommSmartPlatformPRPDao;
|
|
|
|
|
import cfs.trsmrcv.dao.TrsmrcvDao;
|
|
|
|
|
import cfs.trsmrcv.service.CommCollectServerService;
|
|
|
|
|
import cfs.trsmrcv.service.CommRelayServerService;
|
|
|
|
|
import cfs.trsmrcv.service.CommSmartPlatformFISService;
|
|
|
|
|
import cfs.trsmrcv.service.CommSmartPlatformPRPService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -60,7 +61,10 @@ import cfs.trsmrcv.service.CommSmartPlatformPRPService;
|
|
|
|
|
@Controller
|
|
|
|
|
public class CommSmartPlatformPRPController {
|
|
|
|
|
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="commSmartPlatformFISService")
|
|
|
|
|
private CommSmartPlatformFISService commSmartPlatformFISService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "commSmartPlatformPRPService")
|
|
|
|
|
private CommSmartPlatformPRPService commSmartPlatformPRPService;
|
|
|
|
|
@Resource(name = "commRelayServerService")
|
|
|
|
|
@ -458,528 +462,7 @@ public class CommSmartPlatformPRPController {
|
|
|
|
|
logger.info(result.getResult().get("resultMessage").toString());
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 사전등록결제 취소 수신
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@Transactional
|
|
|
|
|
@RequestMapping(value = "/rest/broker/cfs/callPreRegistPaymentCancle", method = RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> callPreRegistPaymentCancle(@RequestBody ParamBean<CommSmartPlatformPRPVO> param, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
CommSmartPlatformPRPVO commSmartPlatformPRPVO = param.getParam();
|
|
|
|
|
Map<String, Object> pMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
ResultSmartPlatform result = new ResultSmartPlatform();
|
|
|
|
|
try {
|
|
|
|
|
Map<String, String> mapOrg = new HashMap<String, String>();
|
|
|
|
|
|
|
|
|
|
pMap.put("WORKER_ID", commSmartPlatformPRPVO.getWorkerId());
|
|
|
|
|
pMap.put("FARE_OFFICE_ID", commSmartPlatformPRPVO.getFareOfficeId());
|
|
|
|
|
pMap.put("BOOTH_ID", commSmartPlatformPRPVO.getBoothId());
|
|
|
|
|
pMap.put("YEAR", commSmartPlatformPRPVO.getYear());
|
|
|
|
|
pMap.put("MONTH", commSmartPlatformPRPVO.getMonth());
|
|
|
|
|
pMap.put("DAY", commSmartPlatformPRPVO.getDay());
|
|
|
|
|
pMap.put("WORK_TIMES", commSmartPlatformPRPVO.getWorkTimes());
|
|
|
|
|
pMap.put("SEQNO", commSmartPlatformPRPVO.getSeqno());
|
|
|
|
|
pMap.put("COLLECTIDNEW", commSmartPlatformPRPVO.getCollectIdNew());
|
|
|
|
|
pMap.put("REPAY_CNT", commSmartPlatformPRPVO.getRepayCnt());
|
|
|
|
|
//임시 명칭
|
|
|
|
|
pMap.put("in_work_id", commSmartPlatformPRPVO.getWorkerId());
|
|
|
|
|
pMap.put("in_fare", commSmartPlatformPRPVO.getFareOfficeId());
|
|
|
|
|
pMap.put("in_booth", commSmartPlatformPRPVO.getBoothId());
|
|
|
|
|
pMap.put("in_year", commSmartPlatformPRPVO.getYear());
|
|
|
|
|
pMap.put("in_month", commSmartPlatformPRPVO.getMonth());
|
|
|
|
|
pMap.put("in_day", commSmartPlatformPRPVO.getDay());
|
|
|
|
|
pMap.put("in_work_times", commSmartPlatformPRPVO.getWorkTimes());
|
|
|
|
|
pMap.put("in_seqno", commSmartPlatformPRPVO.getSeqno());
|
|
|
|
|
pMap.put("STAT_CD", "2"); // 1: 요청, 2: 결제, 3: 거절 4: 취소
|
|
|
|
|
List<Map<String, Object>> obj = null;
|
|
|
|
|
obj = commSmartPlatformPRPService.selectPreRegistPayment(pMap);
|
|
|
|
|
|
|
|
|
|
if(obj == null || obj.size() == 0) {
|
|
|
|
|
// 조회 실패
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, "조회 실패");
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
pMap.put("CAR_NO", obj.get(0).get("CAR_NO").toString());
|
|
|
|
|
pMap.put("CAR_OWNER_CI", obj.get(0).get("CAR_OWNER_CI").toString());
|
|
|
|
|
pMap.put("PASS_DATE", obj.get(0).get("PASS_DATE").toString());
|
|
|
|
|
pMap.put("PASS_AMOUNT", obj.get(0).get("PASS_AMOUNT").toString());
|
|
|
|
|
pMap.put("TR_DTTM", obj.get(0).get("TR_DTTM").toString());
|
|
|
|
|
pMap.put("PAYM_AMOUNT", obj.get(0).get("PAYM_AMOUNT").toString());
|
|
|
|
|
pMap.put("BRS_MNO", obj.get(0).get("BRS_MNO").toString());
|
|
|
|
|
|
|
|
|
|
StringBuffer strbuf = new StringBuffer();
|
|
|
|
|
strbuf.append(pMap.get("WORKER_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("FARE_OFFICE_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("BOOTH_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("YEAR").toString());
|
|
|
|
|
strbuf.append(pMap.get("MONTH").toString());
|
|
|
|
|
strbuf.append(pMap.get("DAY").toString());
|
|
|
|
|
strbuf.append(pMap.get("WORK_TIMES").toString());
|
|
|
|
|
|
|
|
|
|
strbuf.append(String.format("%d%09d"
|
|
|
|
|
, Integer.parseInt(pMap.get("REPAY_CNT").toString())
|
|
|
|
|
, Integer.parseInt(pMap.get("SEQNO").toString())
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttNo", obj.get(0).get("INSTTNO").toString());
|
|
|
|
|
mapOrg.put("insttCntcJobSe", "012"); // Sync : 003
|
|
|
|
|
mapOrg.put("vhcleNo", pMap.get("CAR_NO").toString());
|
|
|
|
|
|
|
|
|
|
String carOwnerCiBeforeEncode = pMap.get("CAR_OWNER_CI").toString();
|
|
|
|
|
carOwnerCiBeforeEncode = carOwnerCiBeforeEncode.replaceAll(" ", "+");
|
|
|
|
|
pMap.put("CAR_OWNER_CI",carOwnerCiBeforeEncode);
|
|
|
|
|
|
|
|
|
|
String vhcleOwnerCiAfterEncode = URLEncoder.encode(pMap.get("CAR_OWNER_CI").toString(), "UTF-8");
|
|
|
|
|
vhcleOwnerCiAfterEncode = vhcleOwnerCiAfterEncode.replaceAll("%20", "%2B");
|
|
|
|
|
mapOrg.put("vhcleOwnerCi", vhcleOwnerCiAfterEncode);
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttDelngNo", strbuf.toString());
|
|
|
|
|
mapOrg.put("requstDt", pMap.get("TR_DTTM").toString());
|
|
|
|
|
mapOrg.put("requstAmount", pMap.get("PAYM_AMOUNT").toString());
|
|
|
|
|
mapOrg.put("brsMno", pMap.get("BRS_MNO").toString());
|
|
|
|
|
|
|
|
|
|
// 사전등록결제 취소 웹서비스 호출
|
|
|
|
|
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_060");
|
|
|
|
|
CallWebService callWebService = new CallWebService(url);
|
|
|
|
|
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
|
|
|
|
|
System.out.println("==== " + map.toString());
|
|
|
|
|
if(map == null || map.get("result").toString().equals("FAIL") == true) {
|
|
|
|
|
// 조회 실패
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
JSONParser parser = new JSONParser();
|
|
|
|
|
JSONObject jsonParam = (JSONObject)parser.parse(map.get("data").toString());
|
|
|
|
|
System.out.println("=== " + jsonParam.toJSONString());
|
|
|
|
|
pMap.put("PRP_REQ_SEQ", obj.get(0).get("PRP_REQ_SEQ").toString());
|
|
|
|
|
pMap.put("WORKER", "admin");
|
|
|
|
|
pMap.put("STAT_CD", "4"); // 1: 요청, 2: 결제, 3: 거절 4: 취소
|
|
|
|
|
|
|
|
|
|
// 사전등록결제요청내역 업데이트
|
|
|
|
|
if(commSmartPlatformPRPService.updatePreRegistReqList(pMap) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
// 사전등록결제요청이력 추가
|
|
|
|
|
if(commSmartPlatformPRPService.insertPreRegistReqListLog(pMap) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pMap.put("BRS_MNO", jsonParam.get("brsMno"));
|
|
|
|
|
pMap.put("INSTT_NO", jsonParam.get("insttNo"));
|
|
|
|
|
pMap.put("INSTT_DELNG_NO", jsonParam.get("insttDelngNo"));
|
|
|
|
|
pMap.put("DELNG_DATE", jsonParam.get("delngDate"));
|
|
|
|
|
pMap.put("DELNG_TIME", jsonParam.get("delngTime"));
|
|
|
|
|
pMap.put("STCMP_NO", jsonParam.get("stcmpNo"));
|
|
|
|
|
pMap.put("STCMP_NM", jsonParam.get("stcmpNm"));
|
|
|
|
|
pMap.put("MRHST_NO", jsonParam.get("mrhstNo"));
|
|
|
|
|
pMap.put("FFNLG_TAXITM", jsonParam.get("ffnlgTaxitm"));
|
|
|
|
|
pMap.put("ORGNLDELNG_AMOUNT", Integer.parseInt(jsonParam.get("requstAmount").toString()));
|
|
|
|
|
pMap.put("DSCNT_RT", Float.parseFloat(jsonParam.get("dscntRt").toString()));
|
|
|
|
|
pMap.put("DSCNT_AMOUNT", Integer.parseInt(jsonParam.get("dscntAmount").toString()));
|
|
|
|
|
pMap.put("SETLE_AMOUNT", Integer.parseInt(jsonParam.get("setleAmount").toString()));
|
|
|
|
|
pMap.put("CCMP_CODE", jsonParam.get("ccmpCode"));
|
|
|
|
|
pMap.put("CARD_NM", jsonParam.get("ccmpNm"));
|
|
|
|
|
pMap.put("CARD_NO", jsonParam.get("cardNo"));
|
|
|
|
|
|
|
|
|
|
pMap.put("CONFM_DT", jsonParam.get("canclDt"));
|
|
|
|
|
pMap.put("RSPNS_CODE", jsonParam.get("rspnsCode"));
|
|
|
|
|
pMap.put("RSPNS_MSSAGE", jsonParam.get("rspnsMssage"));
|
|
|
|
|
// 사전등록결제상세내역 추가(사전등록결제DB 동일)
|
|
|
|
|
if(commSmartPlatformPRPService.insertPreRegistReusltList(pMap) < 0) {
|
|
|
|
|
result.setErrorMsg(null, null);
|
|
|
|
|
}
|
|
|
|
|
pMap.put("in_rcvmsg", "사전등록결제 취소 수신");
|
|
|
|
|
|
|
|
|
|
//새로운 프로시져 추가
|
|
|
|
|
pMap.put("in_reject_id", "02");
|
|
|
|
|
System.out.println("=== REPAIR 프로시저1");
|
|
|
|
|
commSmartPlatformPRPService.callSP_PRP_REPAIR(pMap);
|
|
|
|
|
System.out.println("=== REPAIR 프로시저2");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//commSmartPlatformPRPService.callSP_UPDATE_READING(pMap);
|
|
|
|
|
//commSmartPlatformPRPService.updateAdjsut(pMap);
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info(result.getResult().get("resultMessage").toString());
|
|
|
|
|
return result.getResult();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 바로녹색 취소 수신
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@Transactional
|
|
|
|
|
@RequestMapping(value = "/rest/broker/cfs/callGreenPaymentCancle", method = RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> callGreenPaymentCancle(@RequestBody ParamBean<CommSmartPlatformPRPVO> param, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
CommSmartPlatformPRPVO commSmartPlatformPRPVO = param.getParam();
|
|
|
|
|
Map<String, Object> pMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
ResultSmartPlatform result = new ResultSmartPlatform();
|
|
|
|
|
try {
|
|
|
|
|
Map<String, String> mapOrg = new HashMap<String, String>();
|
|
|
|
|
|
|
|
|
|
pMap.put("BRS_MNO", commSmartPlatformPRPVO.getBrsMno());
|
|
|
|
|
pMap.put("INSTTNO", commSmartPlatformPRPVO.getInsttNo());
|
|
|
|
|
pMap.put("YEAR", commSmartPlatformPRPVO.getYear());
|
|
|
|
|
pMap.put("MONTH", commSmartPlatformPRPVO.getMonth());
|
|
|
|
|
pMap.put("DAY", commSmartPlatformPRPVO.getDay());
|
|
|
|
|
pMap.put("WORK_TIMES", commSmartPlatformPRPVO.getWorkTimes());
|
|
|
|
|
pMap.put("REPAY_CNT", commSmartPlatformPRPVO.getRepayCnt());
|
|
|
|
|
pMap.put("STAT_CD", "2"); // 1: 요청, 2: 결제, 3: 거절 4: 취소
|
|
|
|
|
List<Map<String, Object>> obj = null;
|
|
|
|
|
obj = commSmartPlatformPRPService.selectGreenPayment(pMap);
|
|
|
|
|
|
|
|
|
|
if(obj == null || obj.size() == 0) {
|
|
|
|
|
// 조회 실패
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, "조회 실패");
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
pMap.put("CAR_NO", obj.get(0).get("CAR_NO").toString());
|
|
|
|
|
pMap.put("CAR_OWNER_CI", obj.get(0).get("CAR_OWNER_CI").toString());
|
|
|
|
|
pMap.put("PASS_DATE", obj.get(0).get("PASS_DATE").toString());
|
|
|
|
|
pMap.put("PASS_AMOUNT", obj.get(0).get("PASS_AMOUNT").toString());
|
|
|
|
|
pMap.put("TR_DTTM", obj.get(0).get("TR_DTTM").toString());
|
|
|
|
|
pMap.put("PAYM_AMOUNT", obj.get(0).get("PAYM_AMOUNT").toString());
|
|
|
|
|
pMap.put("BRS_MNO", obj.get(0).get("BRS_MNO").toString());
|
|
|
|
|
|
|
|
|
|
pMap.put("WORKER_ID", obj.get(0).get("WORKER_ID").toString());
|
|
|
|
|
pMap.put("FARE_OFFICE_ID", obj.get(0).get("FARE_OFFICE_ID").toString());
|
|
|
|
|
pMap.put("BOOTH_ID", obj.get(0).get("BOOTH_ID").toString());
|
|
|
|
|
pMap.put("SEQNO", obj.get(0).get("SEQNO").toString());
|
|
|
|
|
|
|
|
|
|
StringBuffer strbuf = new StringBuffer();
|
|
|
|
|
strbuf.append(pMap.get("WORKER_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("FARE_OFFICE_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("BOOTH_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("YEAR").toString());
|
|
|
|
|
strbuf.append(pMap.get("MONTH").toString());
|
|
|
|
|
strbuf.append(pMap.get("DAY").toString());
|
|
|
|
|
strbuf.append(pMap.get("WORK_TIMES").toString());
|
|
|
|
|
|
|
|
|
|
strbuf.append(String.format("%d%09d"
|
|
|
|
|
, Integer.parseInt(pMap.get("REPAY_CNT").toString())
|
|
|
|
|
, Integer.parseInt(pMap.get("SEQNO").toString())
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttNo", pMap.get("INSTTNO").toString());
|
|
|
|
|
mapOrg.put("insttCntcJobSe", "012"); // Sync : 003
|
|
|
|
|
mapOrg.put("vhcleNo", pMap.get("CAR_NO").toString());
|
|
|
|
|
|
|
|
|
|
String carOwnerCiBeforeEncode = pMap.get("CAR_OWNER_CI").toString();
|
|
|
|
|
carOwnerCiBeforeEncode = carOwnerCiBeforeEncode.replaceAll(" ", "+");
|
|
|
|
|
pMap.put("CAR_OWNER_CI", carOwnerCiBeforeEncode);
|
|
|
|
|
|
|
|
|
|
String vhcleOwnerCiAfterEncode = URLEncoder.encode(pMap.get("CAR_OWNER_CI").toString(), "UTF-8");
|
|
|
|
|
vhcleOwnerCiAfterEncode = vhcleOwnerCiAfterEncode.replaceAll("%20", "%2B");
|
|
|
|
|
mapOrg.put("vhcleOwnerCi", vhcleOwnerCiAfterEncode);
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttDelngNo", strbuf.toString());
|
|
|
|
|
mapOrg.put("requstDt", pMap.get("TR_DTTM").toString());
|
|
|
|
|
mapOrg.put("requstAmount", pMap.get("PAYM_AMOUNT").toString());
|
|
|
|
|
mapOrg.put("brsMno", pMap.get("BRS_MNO").toString());
|
|
|
|
|
|
|
|
|
|
// 사전등록결제 취소 웹서비스 호출
|
|
|
|
|
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_060");
|
|
|
|
|
CallWebService callWebService = new CallWebService(url);
|
|
|
|
|
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
|
|
|
|
|
if(map == null || map.get("result").toString().equals("FAIL") == true) {
|
|
|
|
|
// 조회 실패
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
return result.getResult();
|
|
|
|
|
}
|
|
|
|
|
JSONParser parser = new JSONParser();
|
|
|
|
|
JSONObject jsonParam = (JSONObject)parser.parse(map.get("data").toString());
|
|
|
|
|
System.out.println("=== " + jsonParam.toJSONString());
|
|
|
|
|
pMap.put("PRP_REQ_SEQ", obj.get(0).get("PRP_REQ_SEQ").toString());
|
|
|
|
|
pMap.put("WORKER", "admin");
|
|
|
|
|
pMap.put("STAT_CD", "4"); // 1: 요청, 2: 결제, 3: 거절 4: 취소
|
|
|
|
|
|
|
|
|
|
// 사전등록결제요청내역 업데이트
|
|
|
|
|
if(commSmartPlatformPRPService.updatePreRegistReqList(pMap) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
// 사전등록결제요청이력 추가
|
|
|
|
|
if(commSmartPlatformPRPService.insertPreRegistReqListLog(pMap) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info(result.getResult().get("resultMessage").toString());
|
|
|
|
|
return result.getResult();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 사전등록결제 수동청구 요청 수신(IP002P03(요금단말수정 및 환불입력))
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@Transactional
|
|
|
|
|
@RequestMapping(value = "/rest/broker/cfs/callPreRegistPaymentRepay", method = RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> callPreRegistPaymentRepay(
|
|
|
|
|
@RequestBody ParamBean<CommSmartPlatformPRPVO> param,
|
|
|
|
|
HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
System.out.println("재청구 시작");
|
|
|
|
|
CommSmartPlatformPRPVO commSmartPlatformPRPVO = param.getParam();
|
|
|
|
|
Map<String, Object> pMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
ResultSmartPlatform result = new ResultSmartPlatform();
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
Map<String, String> mapOrg = new HashMap<String, String>();
|
|
|
|
|
System.out.println("재청구 시작1");
|
|
|
|
|
pMap.put("WORKER_ID", commSmartPlatformPRPVO.getWorkerId());
|
|
|
|
|
pMap.put("FARE_OFFICE_ID", commSmartPlatformPRPVO.getFareOfficeId());
|
|
|
|
|
pMap.put("BOOTH_ID", commSmartPlatformPRPVO.getBoothId());
|
|
|
|
|
pMap.put("YEAR", commSmartPlatformPRPVO.getYear());
|
|
|
|
|
pMap.put("MONTH", commSmartPlatformPRPVO.getMonth());
|
|
|
|
|
pMap.put("DAY", commSmartPlatformPRPVO.getDay());
|
|
|
|
|
pMap.put("WORK_TIMES", commSmartPlatformPRPVO.getWorkTimes());
|
|
|
|
|
pMap.put("SEQNO", commSmartPlatformPRPVO.getSeqno());
|
|
|
|
|
pMap.put("COLLECTIDNEW", commSmartPlatformPRPVO.getCollectIdNew());
|
|
|
|
|
pMap.put("REPAY_CNT", commSmartPlatformPRPVO.getRepayCnt());
|
|
|
|
|
pMap.put("CAR_NO", commSmartPlatformPRPVO.getCarNo());
|
|
|
|
|
pMap.put("PASS_DATE", commSmartPlatformPRPVO.getYear()
|
|
|
|
|
+ commSmartPlatformPRPVO.getMonth()
|
|
|
|
|
+ commSmartPlatformPRPVO.getDay()
|
|
|
|
|
+ commSmartPlatformPRPVO.getWorkTimes() );
|
|
|
|
|
pMap.put("PASS_AMOUNT", commSmartPlatformPRPVO.getAmount());
|
|
|
|
|
//임시 명칭
|
|
|
|
|
pMap.put("in_work_id", commSmartPlatformPRPVO.getWorkerId());
|
|
|
|
|
pMap.put("in_fare", commSmartPlatformPRPVO.getFareOfficeId());
|
|
|
|
|
pMap.put("in_booth", commSmartPlatformPRPVO.getBoothId());
|
|
|
|
|
pMap.put("in_year", commSmartPlatformPRPVO.getYear());
|
|
|
|
|
pMap.put("in_month", commSmartPlatformPRPVO.getMonth());
|
|
|
|
|
pMap.put("in_day", commSmartPlatformPRPVO.getDay());
|
|
|
|
|
pMap.put("in_work_times", commSmartPlatformPRPVO.getWorkTimes());
|
|
|
|
|
pMap.put("in_seqno", commSmartPlatformPRPVO.getSeqno());
|
|
|
|
|
pMap.put("in_car", commSmartPlatformPRPVO.getCarNo());
|
|
|
|
|
pMap.put("COLLECT_ID_NEW", commSmartPlatformPRPVO.getCollectIdNew());
|
|
|
|
|
|
|
|
|
|
pMap.put("amount", commSmartPlatformPRPVO.getAmount());
|
|
|
|
|
pMap.put("collectId", commSmartPlatformPRPVO.getCollectId());
|
|
|
|
|
|
|
|
|
|
pMap.put("STAT_CD", "4"); // 1: 요청, 2: 결제, 3: 거절 4: 취소
|
|
|
|
|
pMap.put("REQ_KBN", "1"); // 1: 수동청구
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//fare_terminal_history_info 에 insert
|
|
|
|
|
commSmartPlatformPRPService.insertFareTerminalHistory(pMap);
|
|
|
|
|
//fare_terminal_update = collectId,levy_amount,취소 활성화 조건들
|
|
|
|
|
commSmartPlatformPRPService.updateRepayTerminal(pMap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> obj = null;
|
|
|
|
|
System.out.println("재청구 시작2");
|
|
|
|
|
obj = commSmartPlatformPRPService.selectPreRegistPayment(pMap);
|
|
|
|
|
System.out.println("재청구 시작3");
|
|
|
|
|
|
|
|
|
|
if(obj == null || obj.size() == 0) { //사전등록결제 요청 정보가 없으면
|
|
|
|
|
// 재청구
|
|
|
|
|
|
|
|
|
|
// 사전등록결제를 위한 함수 호출
|
|
|
|
|
Map<String, Object> mapTarg = new HashMap<String, Object>();
|
|
|
|
|
mapTarg.put("WORKER_ID", pMap.get("WORKER_ID").toString());
|
|
|
|
|
mapTarg.put("FARE_OFFICE_ID", pMap.get("FARE_OFFICE_ID").toString());
|
|
|
|
|
mapTarg.put("BOOTH_ID", pMap.get("BOOTH_ID").toString());
|
|
|
|
|
mapTarg.put("YEAR", pMap.get("YEAR").toString());
|
|
|
|
|
mapTarg.put("MONTH", pMap.get("MONTH").toString());
|
|
|
|
|
mapTarg.put("DAY", pMap.get("DAY").toString());
|
|
|
|
|
mapTarg.put("WORK_TIMES", pMap.get("WORK_TIMES").toString());
|
|
|
|
|
mapTarg.put("SEQNO", pMap.get("SEQNO").toString());
|
|
|
|
|
mapTarg.put("PASS_DATE", pMap.get("PASS_DATE").toString());
|
|
|
|
|
mapTarg.put("PASS_AMOUNT", pMap.get("PASS_AMOUNT").toString());
|
|
|
|
|
mapTarg.put("CAR_NO", pMap.get("CAR_NO").toString());
|
|
|
|
|
mapTarg.put("REQ_KBN", pMap.get("REQ_KBN").toString());
|
|
|
|
|
mapTarg.put("COLLECT_ID_NEW", pMap.get("COLLECT_ID_NEW").toString());
|
|
|
|
|
|
|
|
|
|
return commSmartPlatformPRPService.callPreRegistPayment(mapTarg);
|
|
|
|
|
|
|
|
|
|
} else { //사전등록결제 요청 정보가 있으면
|
|
|
|
|
|
|
|
|
|
// 취소 후 재청구
|
|
|
|
|
pMap.put("CAR_NO", obj.get(0).get("CAR_NO").toString());
|
|
|
|
|
pMap.put("CAR_OWNER_CI", obj.get(0).get("CAR_OWNER_CI").toString());
|
|
|
|
|
pMap.put("PASS_DATE", obj.get(0).get("PASS_DATE").toString());
|
|
|
|
|
pMap.put("TR_DTTM", obj.get(0).get("TR_DTTM").toString());
|
|
|
|
|
pMap.put("PAYM_AMOUNT", obj.get(0).get("PAYM_AMOUNT").toString());
|
|
|
|
|
pMap.put("BRS_MNO", obj.get(0).get("BRS_MNO").toString());
|
|
|
|
|
pMap.put("PRP_REQ_SEQ", obj.get(0).get("PRP_REQ_SEQ").toString());
|
|
|
|
|
pMap.put("REPAY_CNT", Integer.parseInt(obj.get(0).get("REPAY_CNT").toString()) + 1);
|
|
|
|
|
|
|
|
|
|
StringBuffer strbuf = new StringBuffer();
|
|
|
|
|
strbuf.append(pMap.get("WORKER_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("FARE_OFFICE_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("BOOTH_ID").toString());
|
|
|
|
|
strbuf.append(pMap.get("YEAR").toString());
|
|
|
|
|
strbuf.append(pMap.get("MONTH").toString());
|
|
|
|
|
strbuf.append(pMap.get("DAY").toString());
|
|
|
|
|
strbuf.append(pMap.get("WORK_TIMES").toString());
|
|
|
|
|
strbuf.append(String.format("%d%09d"
|
|
|
|
|
, Integer.parseInt(pMap.get("REPAY_CNT").toString())
|
|
|
|
|
, Integer.parseInt(pMap.get("SEQNO").toString())
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttNo", obj.get(0).get("INSTTNO").toString());
|
|
|
|
|
mapOrg.put("insttCntcJobSe", "011"); // Sync : 003
|
|
|
|
|
mapOrg.put("vhcleNo", pMap.get("CAR_NO").toString());
|
|
|
|
|
if(pMap.get("amount").toString().equals("1000") == true){ // 감면
|
|
|
|
|
mapOrg.put("vhcleTy", "61");
|
|
|
|
|
}else {
|
|
|
|
|
mapOrg.put("vhcleTy", "60");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String carOwnerCiBeforeEncode = pMap.get("CAR_OWNER_CI").toString();
|
|
|
|
|
carOwnerCiBeforeEncode = carOwnerCiBeforeEncode.replaceAll(" ", "+");
|
|
|
|
|
pMap.put("CAR_OWNER_CI", carOwnerCiBeforeEncode);
|
|
|
|
|
|
|
|
|
|
String vhcleOwnerCiAfterEncode = URLEncoder.encode(pMap.get("CAR_OWNER_CI").toString(), "UTF-8");
|
|
|
|
|
vhcleOwnerCiAfterEncode = vhcleOwnerCiAfterEncode.replaceAll("%20", "%2B");
|
|
|
|
|
mapOrg.put("vhcleOwnerCi", vhcleOwnerCiAfterEncode);
|
|
|
|
|
|
|
|
|
|
mapOrg.put("insttDelngNo", strbuf.toString());
|
|
|
|
|
mapOrg.put("requstDt", pMap.get("TR_DTTM").toString());
|
|
|
|
|
mapOrg.put("requstAmount", pMap.get("PASS_AMOUNT").toString());
|
|
|
|
|
mapOrg.put("occrrncDate", pMap.get("PASS_DATE").toString().substring(0, 8));
|
|
|
|
|
mapOrg.put("occrrncTime", pMap.get("PASS_DATE").toString().substring(8));
|
|
|
|
|
mapOrg.put("insttChrgeDetail", "01");
|
|
|
|
|
mapOrg.put("insttDetailCode", String.format("0%s", pMap.get("FARE_OFFICE_ID"))); // 001 003 : 영업소 코드 기반
|
|
|
|
|
mapOrg.put("insttDetailNm", String.format("남산%s호터널 %s차로", pMap.get("FARE_OFFICE_ID").toString(), pMap.get("BOOTH_ID").toString()));
|
|
|
|
|
mapOrg.put("pasngSeCode", "1");
|
|
|
|
|
mapOrg.put("ffnlgTaxitm", ""); // 삭제가능
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 사전등록결제 웹서비스 호출
|
|
|
|
|
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_002");
|
|
|
|
|
CallWebService callWebService = new CallWebService(url);
|
|
|
|
|
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
|
|
|
|
|
System.out.println("==== " + map.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ITF_CFS_O_002끝
|
|
|
|
|
if(map == null || map.get("result").toString().equals("FAIL") == true) {
|
|
|
|
|
|
|
|
|
|
if(map.get("resultCode").toString().equals("ES0009") //차량상태 정상인 회원정보 없음
|
|
|
|
|
||map.get("resultCode").toString().equals("ES0011") //바로녹색 탈퇴회원
|
|
|
|
|
||map.get("resultCode").toString().equals("EC0007") //공통 이용료 미동의
|
|
|
|
|
||map.get("resultCode").toString().equals("EC0021") //이용기간 종료
|
|
|
|
|
||map.get("resultCode").toString().equals("EC0019") //상세 과태료,이용료 결제 미동의
|
|
|
|
|
){
|
|
|
|
|
//변동분 등록(미사용 회원)
|
|
|
|
|
Map<String, Object> mapFail = new HashMap<String, Object>();
|
|
|
|
|
mapFail.put("CAR_NO", pMap.get("CAR_NO").toString());
|
|
|
|
|
mapFail.put("CAR_OWNER_CI", pMap.get("CAR_OWNER_CI").toString());
|
|
|
|
|
mapFail.put("OWNER_NM", "delete");
|
|
|
|
|
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
String reqDate = sdf14.format(now);
|
|
|
|
|
mapFail.put("REQ_DATE", reqDate);
|
|
|
|
|
mapFail.put("CAR_NO_HEX", CarNo2Code.runCarNo2Code(pMap.get("CAR_NO").toString()));
|
|
|
|
|
mapFail.put("MODI_YN", "N");
|
|
|
|
|
mapFail.put("SECSN_YN", "Y");
|
|
|
|
|
mapFail.put("WORKER", "admin");
|
|
|
|
|
commCollectServerDao.insertPreRegistInfoModi(mapFail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> mapFail = new HashMap<String, Object>();
|
|
|
|
|
// 조회 실패
|
|
|
|
|
//수동청구 실패
|
|
|
|
|
logger.info("재청구 실패");
|
|
|
|
|
mapFail.put("in_work_id", pMap.get("WORKER_ID"));
|
|
|
|
|
mapFail.put("in_fare", pMap.get("FARE_OFFICE_ID"));
|
|
|
|
|
mapFail.put("in_booth", pMap.get("BOOTH_ID"));
|
|
|
|
|
mapFail.put("in_year", pMap.get("YEAR"));
|
|
|
|
|
mapFail.put("in_month", pMap.get("MONTH"));
|
|
|
|
|
mapFail.put("in_day", pMap.get("DAY"));
|
|
|
|
|
mapFail.put("in_work_times", pMap.get("WORK_TIMES"));
|
|
|
|
|
mapFail.put("in_seqno", Integer.parseInt(pMap.get("SEQNO").toString()));
|
|
|
|
|
mapFail.put("in_reject_id", "04");
|
|
|
|
|
mapFail.put("in_rcvmsg", "수동청구 실패");
|
|
|
|
|
commSmartPlatformPRPService.callSP_PRP_REPAIR(mapFail);
|
|
|
|
|
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
return result.getResult();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> mapTarg = new HashMap<String, Object>();
|
|
|
|
|
mapTarg.put("WORKER_ID", pMap.get("WORKER_ID").toString());
|
|
|
|
|
mapTarg.put("FARE_OFFICE_ID", pMap.get("FARE_OFFICE_ID").toString());
|
|
|
|
|
mapTarg.put("BOOTH_ID", pMap.get("BOOTH_ID").toString());
|
|
|
|
|
mapTarg.put("YEAR", pMap.get("YEAR").toString());
|
|
|
|
|
mapTarg.put("MONTH", pMap.get("MONTH").toString());
|
|
|
|
|
mapTarg.put("DAY", pMap.get("DAY").toString());
|
|
|
|
|
mapTarg.put("WORK_TIMES", pMap.get("WORK_TIMES").toString());
|
|
|
|
|
mapTarg.put("SEQNO", pMap.get("SEQNO").toString());
|
|
|
|
|
|
|
|
|
|
mapTarg.put("CAR_NO", pMap.get("CAR_NO").toString());
|
|
|
|
|
mapTarg.put("CAR_OWNER_CI", pMap.get("CAR_OWNER_CI").toString());
|
|
|
|
|
mapTarg.put("PASS_DATE", pMap.get("PASS_DATE").toString());
|
|
|
|
|
mapTarg.put("PASS_AMOUNT", pMap.get("PASS_AMOUNT").toString());
|
|
|
|
|
|
|
|
|
|
mapTarg.put("PRP_REQ_SEQ", pMap.get("PRP_REQ_SEQ").toString());
|
|
|
|
|
mapTarg.put("REPAY_CNT", Integer.parseInt(pMap.get("REPAY_CNT").toString()));
|
|
|
|
|
|
|
|
|
|
mapTarg.put("STAT_CD", "5"); // 1: 요청, 2: 결제, 3: 거절, 4: 취소, 5: 수동청구
|
|
|
|
|
mapTarg.put("REQ_KBN", "1");
|
|
|
|
|
mapTarg.put("WORKER", "admin");
|
|
|
|
|
|
|
|
|
|
// 사전등록결제요청내역 추가
|
|
|
|
|
mapTarg.put("insttDelngNo", "");
|
|
|
|
|
mapTarg.put("WORKER", "admin");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(commSmartPlatformPRPService.insertPreRegistPayment(mapTarg) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mapTarg.put("PRP_REQ_SEQ", mapTarg.get("insttDelngNo"));
|
|
|
|
|
// 사전등록결제요청이력 추가
|
|
|
|
|
if(commSmartPlatformPRPService.insertPreRegistReqListLog(mapTarg) < 0) {
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info(result.getResult().get("resultMessage").toString());
|
|
|
|
|
return result.getResult();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 사전등록결제 수정 수신
|
|
|
|
|
@ -1033,7 +516,69 @@ public class CommSmartPlatformPRPController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*미납 통지후 화면 수신
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/rest/broker/cfs/recvMoblieDefaultNotification", method=RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> recvMoblieDefaultNotification(
|
|
|
|
|
@RequestParam String insttNo
|
|
|
|
|
, @RequestParam String insttCntcJobSe
|
|
|
|
|
, @RequestParam String insttDelngNo
|
|
|
|
|
, @RequestParam String txId
|
|
|
|
|
, @RequestParam String token
|
|
|
|
|
, @RequestParam String jobSe
|
|
|
|
|
, @RequestParam String uk
|
|
|
|
|
|
|
|
|
|
, HttpServletRequest request) throws Exception {
|
|
|
|
|
// 로긱은 ServiceImplement 로 이동
|
|
|
|
|
Map<String, String> param = new HashMap<String, String>();
|
|
|
|
|
param.put("insttNo", insttNo);
|
|
|
|
|
param.put("insttCntcJobSe", insttCntcJobSe);
|
|
|
|
|
param.put("insttDelngNo", insttDelngNo);
|
|
|
|
|
param.put("txId", txId);
|
|
|
|
|
param.put("token", token);
|
|
|
|
|
param.put("uk", uk);
|
|
|
|
|
|
|
|
|
|
logger.info("==================== jobSe : " + jobSe);
|
|
|
|
|
logger.info("==================== 카카오_열람: " + param.toString());
|
|
|
|
|
if(jobSe.equals("2") == true) // KT
|
|
|
|
|
return commSmartPlatformFISService.selectMoblieDefaultNotificationKT(param);
|
|
|
|
|
else
|
|
|
|
|
//2024.07 카카오 수정
|
|
|
|
|
return commSmartPlatformFISService.selectMoblieDefaultNotificationKakao(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 과태료통지후 화면 수신
|
|
|
|
|
* <pre></pre>
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/rest/broker/cfs/recvMobliePenaltyNotification", method=RequestMethod.POST)
|
|
|
|
|
public @ResponseBody Map<String, Object> recvMobliePenaltyNotification(
|
|
|
|
|
@RequestParam String insttNo
|
|
|
|
|
, @RequestParam String insttCntcJobSe
|
|
|
|
|
, @RequestParam String insttDelngNo
|
|
|
|
|
, @RequestParam String txId
|
|
|
|
|
, @RequestParam String token
|
|
|
|
|
, @RequestParam String jobSe
|
|
|
|
|
, @RequestParam String uk
|
|
|
|
|
|
|
|
|
|
, HttpServletRequest request) throws Exception {
|
|
|
|
|
// 로긱은 ServiceImplement 로 이동
|
|
|
|
|
Map<String, String> param = new HashMap<String, String>();
|
|
|
|
|
param.put("insttNo", insttNo);
|
|
|
|
|
param.put("insttCntcJobSe", insttCntcJobSe);
|
|
|
|
|
param.put("insttDelngNo", insttDelngNo);
|
|
|
|
|
param.put("txId", txId);
|
|
|
|
|
param.put("token", token);
|
|
|
|
|
param.put("uk", uk);
|
|
|
|
|
|
|
|
|
|
if(jobSe.equals("2") == true) // KT
|
|
|
|
|
return commSmartPlatformFISService.selectMobliePenaltyNotificationKT(param);
|
|
|
|
|
else
|
|
|
|
|
//2024.07 카카오 수정
|
|
|
|
|
return commSmartPlatformFISService.selectMobliePenaltyNotificationKakao(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|