소스정리

main
이범준 7 months ago
parent b6e834343a
commit 6b15d84015

@ -18,10 +18,9 @@ public interface CommSmartPlatformFISService {
public int insertMobileNotificationLog(Map<String, String> param) throws Exception;
// 모바일고지 화면정보
public Map<String, Object> selectMoblieDefaultNotification(Map<String, String> param) throws Exception;
public Map<String, Object> selectMoblieDefaultNotificationKakao(Map<String, String> param) throws Exception;
public Map<String, Object> selectMoblieDefaultNotificationKT(Map<String, String> param) throws Exception;
public Map<String, Object> selectMobliePenaltyNotification(Map<String, String> param) throws Exception;
public Map<String, Object> selectMobliePenaltyNotificationKakao(Map<String, String> param) throws Exception;
public Map<String, Object> selectMobliePenaltyNotificationKT(Map<String, String> param) throws Exception;
@ -45,9 +44,7 @@ public interface CommSmartPlatformFISService {
public List<Map<String, String>> selectAutoMoblieNotification(Map<String, String> param) throws Exception;
public List<Map<String, Object>> selectAutoMoblieNotifiForDefaultCar(Map<String, String> param) throws Exception;
//public Map<String, Object> callAutoMobileNotification(Map<String, String> param) throws Exception;
//public Map<String, Object> callManualDecision(Map<String, String> param) throws Exception;
public List<Map<String, Object>> selectVirtualAccount(Map<String, String> param) throws Exception;
public Map<String, Object> selectManageChk(Map<String, String> param) throws Exception;

@ -47,183 +47,7 @@ public class CommSmartPlatformFISServiceImpl implements CommSmartPlatformFISServ
/**
*
* <pre></pre>
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> selectMoblieDefaultNotification(Map<String, String> param) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
List<Map<String, Object>> obj = null;
try {
Date time = new Date();
SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss");
Map<String, String> mapOrg = new HashMap<String, String>();
String secureResult = cfsCommonService.findCommonSecureGet("sysId");
mapOrg.put("sysId", secureResult);
// 카카오 인증 검증
mapOrg.put("tranDate", sdf.format(time));
mapOrg.put("transId", "11111");
mapOrg.put("txId", URLEncoder.encode(param.get("txId"), "UTF-8"));
mapOrg.put("txId", URLEncoder.encode(param.get("txId"), "UTF-8"));
mapOrg.put("token", URLEncoder.encode(param.get("token"), "UTF-8"));
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_054");
CallWebService callWebService = new CallWebService(url);
Map<String, String> mapResult = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + mapResult.toString());
if(mapResult == null || mapResult.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setErrorMsg("E001", "카카오 인증 검증 실패 !!!!", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
JSONObject jsonParam = new JSONObject();
for(Map.Entry<String,String> entry : mapResult.entrySet()){
jsonParam.put(entry.getKey().toString(), entry.getValue().toString());
System.out.println("key : " + entry.getKey() + " , value : " + entry.getValue());
}
logger.info("============= A");
JSONParser parser = new JSONParser();
JSONObject jsonParamSub = (JSONObject)parser.parse(jsonParam.get("data").toString());
if(jsonParamSub.get("result").toString().equals("Y") == false) {
result.setErrorMsg("E001", "카카오 인증 검증 실패 !!!!", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
// 모바일 고지 확인 만료일자 체크 "completedAt": "20190926140305",
Date today = new Date();
String strDate = jsonParamSub.get("completedAt").toString();
Date date = sdf.parse(strDate);
if(date.getTime() - today.getTime() > 0) {
logger.info("============= C");
result.setErrorMsg("E001", "카카오 인증 검증 실패(기한만료)", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
obj = commSmartPlatformFISDao.selectMoblieDefaultNotification(param);
if(obj != null && obj.size() > 0) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("insttNo", obj.get(0).get("INSTTNO"));
String str = String.format("%s%s%s%s%s%s%s%010d"
, obj.get(0).get("WORKER_ID").toString()
, obj.get(0).get("FARE_OFFICE_ID").toString()
, obj.get(0).get("BOOTH_ID").toString()
, obj.get(0).get("YEAR").toString()
, obj.get(0).get("MONTH").toString()
, obj.get(0).get("DAY").toString()
, obj.get(0).get("WORK_TIMES").toString()
, Integer.parseInt(obj.get(0).get("SEQNO").toString())
);
map.put("insttDelngNo", str);
map.put("vhcleNum", obj.get(0).get("CAR_NO"));
map.put("sci", obj.get(0).get("CAR_OWNER_CI"));
map.put("passDt", obj.get(0).get("PASS_DATE").toString() + obj.get(0).get("WORK_TIMES").toString());
map.put("passFareOfi", String.format("남산%s터널", obj.get(0).get("FARE_OFFICE_ID")));
map.put("passBooth", String.format("%s차로", obj.get(0).get("BOOTH_ID")));
map.put("passAmount", obj.get(0).get("LEVY_AMOUNT"));
map.put("dueDatePayment", obj.get(0).get("DUEDATE_PAYMENT"));
str = obj.get(0).get("DUEDATE_PAYMENT").toString();
String strTemp = String.format("%s.%s.%s %s", str.substring(0, 4), str.substring(4, 6), str.substring(6, 8)
, "(휴일이면 다음날)\n 납부기한까지 미납시 통행료의 5배 과태료가 부과됩니다.\r\n 납부방법 안내 회원은 바로녹색결제 로그인 후 납부가능, 비회원은 바로녹색결제 가입 후 결제가능 합니다.");
map.put("dueDatePaymentMsg", strTemp);
map.put("imgPath", cfsCommonService.findCommonSecureGet("IMG_URL") + obj.get(0).get("CARS_STOP_PICTURE_FILE"));
map.put("movieUrl", cfsCommonService.findCommonSecureGet("IMG_URL") + obj.get(0).get("CARS_MOVE_PICTURE_FILE"));
map.put("mberNm", obj.get(0).get("CAR_OWN_NM"));
map.put("cnm", obj.get(0).get("CNM"));
map.put("registDetailCode", obj.get(0).get("REGIST_DETAIL_CODE"));
map.put("mberSeCode", obj.get(0).get("MBER_SE_CODE"));
map.put("mberSeNo", obj.get(0).get("MBER_SE_NO"));
map.put("useFuelId", obj.get(0).get("use_fuel_id"));
map.put("prposSeCode", obj.get(0).get("PRPOS_SE_CODE"));
map.put("vhctyAsortCode", obj.get(0).get("VHCTY_ASORT_CODE"));
map.put("vhctyTyCode", obj.get(0).get("VHCTY_TY_CODE"));
map.put("vhctySeCode", obj.get(0).get("VHCTY_SE_CODE"));
map.put("spcfRegistSttusCode", obj.get(0).get("SPCF_REGIST_STTUS_CODE"));
map.put("roadNmCode", obj.get(0).get("ROAD_NM_CODE"));
map.put("legaldongCode", obj.get(0).get("LEGALDONG_CODE"));
map.put("adstrdCode", obj.get(0).get("ADSTRD_CODE"));
StringBuffer strbuf = new StringBuffer();
if(obj.get(0).get("FARE_OFFICE_ID").toString().equals("01") == true) {
strbuf.append("남산 1호터널 우리 1005-780-229064");
}
else {
strbuf.append("남산 3호터널 우리 1005-881-229064");
}
strbuf.append("<br>");
strbuf.append("※ 위 전용계좌로 인터넷뱅킹, 은행 등 납부 가능");
strbuf.append("<br>");
strbuf.append("(타행이체시 수수료 본인 부담)");
map.put("virtualAcc", strbuf.toString());
map.put("ofiTel", "1666-6439");
map.put("mainTel", "1666-6439");
// 모바일고지 확인상태 업데이트
param.put("MOB_NOTI_SEQ", obj.get(0).get("MOB_NOTI_SEQ").toString());
param.put("notiType", "1");
param.put("STAT_CD", "2");
param.put("WORKER", "admin");
if(commSmartPlatformFISDao.updateMobileNotification(param) < 0) {
// 실패
result.setErrorMsg(null, null);
}
param.put("workerId", obj.get(0).get("WORKER_ID").toString());
param.put("fareOfficeId", obj.get(0).get("FARE_OFFICE_ID").toString());
param.put("boothId", obj.get(0).get("BOOTH_ID").toString());
param.put("year", obj.get(0).get("YEAR").toString());
param.put("month", obj.get(0).get("MONTH").toString());
param.put("day", obj.get(0).get("DAY").toString());
param.put("workTimes", obj.get(0).get("WORK_TIMES").toString());
param.put("seqno", obj.get(0).get("SEQNO").toString());
param.put("MOBILE_SEND_DATE", "N");
param.put("MOBILE_RESULT_ID", "0" + param.get("STAT_CD"));
if(commSmartPlatformFISDao.updateDefMobNoti(param) < 0) {
// 실패
result.setErrorMsg(null, null);
}
logger.info("========== 대민 이용료 조회 결과 " + map.toString());
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}
else {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "조회결과가 없습니다.");
}
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
*
@ -641,217 +465,9 @@ public class CommSmartPlatformFISServiceImpl implements CommSmartPlatformFISServ
return result.getResult();
}
// 과태료통지후 화면 수신
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> selectMobliePenaltyNotification(Map<String, String> param) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
logger.info("############################################## 1");
List<Map<String, Object>> obj = null;
try {
String secureResult = cfsCommonService.findCommonSecureGet("sysId");
// 카카오 인증 검증
Map<String, String> mapOrg = new HashMap<String, String>();
mapOrg.put("sysId", secureResult);
mapOrg.put("tranDate", "20190923000000");
mapOrg.put("transId", "11111");
mapOrg.put("txId", URLEncoder.encode(param.get("txId"), "UTF-8"));
mapOrg.put("token", URLEncoder.encode(param.get("token"), "UTF-8"));
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_054");
CallWebService callWebService = new CallWebService(url);
Map<String, String> mapResult = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + mapResult.toString());
if(mapResult == null || mapResult.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setErrorMsg("E001", "카카오 인증 검증 실패 !!!!", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
JSONObject jsonParam = new JSONObject();
for(Map.Entry<String,String> entry : mapResult.entrySet()){
jsonParam.put(entry.getKey().toString(), entry.getValue().toString());
System.out.println("key : " + entry.getKey() + " , value : " + entry.getValue());
}
logger.info("============= A");
JSONParser parser = new JSONParser();
JSONObject jsonParamSub = (JSONObject)parser.parse(jsonParam.get("data").toString());
if(jsonParamSub.get("result").toString().equals("Y") == false) {
result.setErrorMsg("E001", "카카오 인증 검증 실패 !!!!", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
// 모바일 고지 확인 만료일자 체크 "completedAt": "20190926140305",
Date today = new Date();
String strDate = jsonParamSub.get("completedAt").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = sdf.parse(strDate);
if(date.getTime() - today.getTime() > 0) {
logger.info("============= C");
result.setErrorMsg("E001", "카카오 인증 검증 실패(기한만료)", null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
String str = "";
obj = commSmartPlatformFISDao.selectMobliePenaltyNotification(param);
if(obj != null && obj.size() > 0) {
Map<String, Object> map = new HashMap<String, Object>();
logger.info("############################################## 2");
map.put("insttNo", obj.get(0).get("INSTTNO"));
str = String.format("%s%s%s%06d"
, obj.get(0).get("FARE_OFFICE_ID"), obj.get(0).get("BOOTH_ID")
, obj.get(0).get("PENALTY_MANAGE_YEAR"), Integer.parseInt(obj.get(0).get("PENALTY_SEQNO").toString())
);
map.put("insttDelngNo", str);
map.put("vhcleNum", obj.get(0).get("CAR_NO"));
map.put("sci", obj.get(0).get("CAR_OWNER_CI"));
// 결제관련...
map.put("vhcleTy", obj.get(0).get("CAR_PAY_TYPE"));
str = "00004734288001";
str += obj.get(0).get("PASS_DATE").toString();
map.put("taxNo", str);
map.put("virtualAcc", ""); //추후..
logger.info("############################################## 2-1");
map.put("dueDatePayment", obj.get(0).get("DUEDATE_PAYMENT").toString());
str = obj.get(0).get("DUEDATE_PAYMENT").toString();
/*
String strTemp = String.format("%s.%s.%s %s", str.substring(0, 4), str.substring(4, 6), str.substring(6, 8)
, "(휴일이면 다음날)\n 납부기한까지 미납시 통행료의 5배 과태료가 부과됩니다.\r\n 납부방법 안내 회원은 바로녹색결제 로그인 후 납부가능, 비회원은 바로녹색결제 가입 후 결제가능 합니다.");
*/
map.put("dueDatePaymentMsg", "(납부기한이 휴일이면 다음날까지)");
logger.info("############################################## 2-2");
map.put("violatDt", obj.get(0).get("PASS_DATE"));
map.put("violatFareOfi", String.format("남산%s터널", obj.get(0).get("FARE_OFFICE_ID")));
map.put("violatBooth", String.format("%s차로", obj.get(0).get("BOOTH_ID")));
map.put("violatLocation", map.get("violatFareOfi").toString() + " " + map.get("violatBooth").toString());
map.put("fineAmount", obj.get(0).get("FINE_AMOUNT"));
map.put("imgPath", cfsCommonService.findCommonSecureGet("IMG_URL") + obj.get(0).get("CARS_STOP_PICTURE_FILE"));
map.put("movieUrl", cfsCommonService.findCommonSecureGet("IMG_URL") + obj.get(0).get("CARS_MOVE_PICTURE_FILE"));
map.put("mberNm", obj.get(0).get("CAR_OWN_NM"));
map.put("cnm", obj.get(0).get("CNM"));
map.put("registDetailCode", obj.get(0).get("REGIST_DETAIL_CODE"));
map.put("mberSeCode", obj.get(0).get("MBER_SE_CODE"));
map.put("mberSeNo", obj.get(0).get("MBER_SE_NO"));
map.put("useFuelId", obj.get(0).get("use_fuel_id"));
map.put("prposSeCode", obj.get(0).get("PRPOS_SE_CODE"));
map.put("vhctyAsortCode", obj.get(0).get("VHCTY_ASORT_CODE"));
map.put("vhctyTyCode", obj.get(0).get("VHCTY_TY_CODE"));
map.put("vhctySeCode", obj.get(0).get("VHCTY_SE_CODE"));
map.put("spcfRegistSttusCode", obj.get(0).get("SPCF_REGIST_STTUS_CODE"));
map.put("roadNmCode", obj.get(0).get("ROAD_NM_CODE"));
map.put("legaldongCode", obj.get(0).get("LEGALDONG_CODE"));
map.put("adstrdCode", obj.get(0).get("ADSTRD_CODE"));
StringBuffer strbuf = new StringBuffer();
strbuf.append(obj.get(0).get("BANK_W"));
strbuf.append("<br>");
strbuf.append(obj.get(0).get("BANK_S"));
strbuf.append("<br>");
strbuf.append(obj.get(0).get("BANK_H"));
strbuf.append("<br>");
strbuf.append("※ 납기 후 가상계좌 수납 불가");
strbuf.append("<br>");
strbuf.append("※ 위 전용계좌로 인터넷뱅킹, 은행 등 납부 가능");
strbuf.append("<br>");
strbuf.append("(타행이체시 수수료 본인 부담)");
map.put("virtualAcc", strbuf.toString());
map.put("ofiTel", "1666-6439");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, map);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
logger.info(map.toString());
logger.info("############################################## 3");
// 모바일고지 확인상태 업데이트
param.put("MOB_NOTI_SEQ", obj.get(0).get("MOB_NOTI_SEQ").toString());
param.put("notiType", "1");
param.put("STAT_CD", "2");
param.put("WORKER", "admin");
if(commSmartPlatformFISDao.updateMobileNotification(param) < 0) {
// 실패
result.setErrorMsg(null, null);
}
String sysNoticeId = obj.get(0).get("SYS_NOTICE_ID").toString();
String motionId ="";
if(sysNoticeId.equals("22")){
motionId = "21";
}else if(sysNoticeId.equals("32")){
motionId = "31";
}else if(sysNoticeId.equals("42")){
motionId = "41";
}else if(sysNoticeId.equals("24")){
motionId = "23";
}else if(sysNoticeId.equals("34")){
motionId = "33";
}else if(sysNoticeId.equals("44")){
motionId = "43";
}else if(sysNoticeId.equals("26")){
motionId = "26";
}else if(sysNoticeId.equals("36")){
motionId = "36";
}else if(sysNoticeId.equals("46")){
motionId = "46";
}
System.out.println("motionId 확인");
System.out.println(sysNoticeId);
System.out.println(motionId);
param.put("workerId", obj.get(0).get("WORKER_ID").toString());
param.put("fareOfficeId", obj.get(0).get("FARE_OFFICE_ID").toString());
param.put("boothId", obj.get(0).get("BOOTH_ID").toString());
param.put("year", obj.get(0).get("YEAR").toString());
param.put("month", obj.get(0).get("MONTH").toString());
param.put("day", obj.get(0).get("DAY").toString());
param.put("workTimes", obj.get(0).get("WORK_TIMES").toString());
param.put("seqno", obj.get(0).get("SEQNO").toString());
param.put("motionId", motionId);
param.put("MOBILE_SEND_DATE", "N");
param.put("MOBILE_RESULT_ID", "0" + param.get("STAT_CD"));
if(commSmartPlatformFISDao.updatePenMobNoti(param) < 0) {
// 실패
result.setErrorMsg(null, null);
}
System.out.println(map);
}
else {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "조회결과가 없습니다.");
}
}catch(RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
// 과태료통지후 화면 수신
// 과태료통지후 화면 수신 - 카카오
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> selectMobliePenaltyNotificationKakao(Map<String, String> param) throws Exception {

@ -906,70 +906,7 @@ public class CommSmartPlatformFISController {
/**
*
* <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
// return commSmartPlatformFISService.selectMobliePenaltyNotification(param);
//2024.07 카카오 수정
return commSmartPlatformFISService.selectMobliePenaltyNotificationKakao(param);
}

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

@ -38,6 +38,7 @@ import cfs.common.util.CarNo2Code;
import cfs.common.util.HttpUtil;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.common.vo.ParamBean;
import cfs.fine.dao.FinePenaltyDao;
import cfs.fine.vo.PenaltyParamVO;
import cfs.input.vo.WorkerFareAdjustVO;
@ -47,6 +48,7 @@ import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommCollectServerService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
import cfs.trsmrcv.service.CommSmartPlatformPRPService;
import cfs.trsmrcv.vo.CommSmartPlatformPRPVO;
import tcp.seoul.sms.SMSClient;
import tcp.seoul.sms.SMSClientVO;
import tcp.seoul.util.SeedScrtyUtil;
@ -2740,7 +2742,7 @@ public class CommWebBrowserController {
// 자동 모바일 고지 쓰레드 호출
logger.info("################ 자동 모바일 고지 쓰레드 호출");
sendAutoMobileNotification(paramList, result);
this.sendAutoMobileNotification(paramList, result);
}catch(RuntimeException e) {
e.printStackTrace();
@ -2782,7 +2784,7 @@ public class CommWebBrowserController {
|| obj.get(i).get("COLLECT_ID_NEW").toString().equals("43") == true
) {
logger.info("============= 자동 모바일 안내 수행 2");
callAutoMobileNotification(obj.get(i));
this.callAutoMobileNotification(obj.get(i));
}
logger.info("============= 자동 모바일 안내 수행 3");
@ -2800,11 +2802,11 @@ public class CommWebBrowserController {
else {
if(objTemp.get(0).get("CNT").toString().equals("0") == true ) {
logger.info("============= 자동 모바일 안내 수행 4");
callAutoMobileNotification(obj.get(i));
this.callAutoMobileNotification(obj.get(i));
}
else {
logger.info("============= 자동 모바일 안내 수행 미납판독 심사대상");
callManualDecision(obj.get(i));
this.callManualDecision(obj.get(i));
}
}
}
@ -3016,7 +3018,7 @@ public class CommWebBrowserController {
}
// 모바일 고지....
sendMobileNofication(param, mapOrg, result);
this.sendMobileNofication(param, mapOrg, result);
}
logger.info("========================== 6");
@ -3040,6 +3042,7 @@ public class CommWebBrowserController {
return result.getResult();
}
//카카오
private void sendMobileNofication(Map<String, String> param, Map<String, String> mapOrg, ResultSmartPlatform result) {
try {
@ -3258,4 +3261,523 @@ public class CommWebBrowserController {
result.setErrorMsg("E001", "모바일고지 실패", null);
}
}
/**
*
* <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();
}
}

Loading…
Cancel
Save