/** 가입자별 수납 파라미터 생성 * */ @RequestMapping(value = "/bsar/ar/pymItemCrte", method = RequestMethod.POST) @ResponseBody public List<SubsPymItem> pymItemCrte(@RequestBody RecpDataCmd recpDataCmd) { String recpNo = recpDataCmd.getRecpNo(); String hbSeqNo = recpDataCmd.getHbSeqNo(); String eventCode = recpDataCmd.getEventCode(); logger.debug("recpDataCrte" + recpNo); logger.debug("recpDataCrte" + hbSeqNo); logger.debug("recpDataCrte" + eventCode); List<SubsPymItem> payments = new ArrayList<SubsPymItem>(); if (recpNo != "") { payments = this.pymProcessService.getSubsPymParamCrte(recpDataCmd); } else { try { throw new Exception(); } catch (Exception e) { e.printStackTrace(); } } return payments; }
/** 파라미터 생성 MgMt * */ @RequestMapping(value = "/bsar/ar/getMgMtData", method = RequestMethod.POST) @ResponseBody public ArLnkgPymMgMtVO getMgMtData(@RequestBody RecpDataCmd recpDataCmd) { if (logger.isDebugEnabled()) { logger.debug("recpDataCrte" + recpDataCmd.getRecpNo()); logger.debug("recpDataCrte" + recpDataCmd.getEventCode()); } ArLnkgPymMgMtVO arLnkgPymMgMtVO = new ArLnkgPymMgMtVO(); // TODO Step 1. 인증키로 데이터 조회 // TODO Step 2. 조회된 데이터의 이벤트코드와 파라미터로 들어온 이벤트와 같은지 비교 //정말 필요한지 생각... // TODO Step 3. return arLnkgPymMgMtVO = this.pymProcessService.getMgMtData(recpDataCmd); return arLnkgPymMgMtVO; }
@Override public String autoHotBillPymProcess(String hbSeqNo, double billAcntBalance, OtimeVO otimeVO) throws SQLException { // make payment structure String lnkgPymSclsCd = "206000"; String zeroAmt = "0.00"; RecpDataCmd recpDataCmd = new RecpDataCmd(); recpDataCmd.setHbSeqNo(hbSeqNo); recpDataCmd.setEventCode(lnkgPymSclsCd); // payment of hotbill (common-code :: LnkgPymSclsCd) ArLnkgPymMgMtVO arLnkgPymMgMtVO = this.pymProcessService.getMgMtData(recpDataCmd); otimeVO.setBillAcntCustNm(arLnkgPymMgMtVO.getBillAcntCustNm()); // 청구계정고객명 otimeVO.setBillAcntPymSsn(arLnkgPymMgMtVO.getBillAcntPymSsn()); // 청구계정납부SSN // otimeVO.set otimeVO.setPymLvlCd("2"); otimeVO.setCsEvntCd(lnkgPymSclsCd); otimeVO.setRcpmnyDt(CmnDateUtils.addDate(0)); otimeVO.setHbSeqNo(hbSeqNo); // 핫빌누적번호 otimeVO.setLnkgPymLclsCd(lnkgPymSclsCd.substring(0, 2)); otimeVO.setLnkgPymMclsCd(lnkgPymSclsCd.substring(0, 4)); otimeVO.setLnkgPymSclsCd(lnkgPymSclsCd); otimeVO.setGrtmnRfndAmt(zeroAmt); otimeVO.setCustRfndAmt(zeroAmt); otimeVO.setCustPymAmt(zeroAmt); otimeVO.setCashPymAmt(zeroAmt); otimeVO.setGrtmnPymAmt(zeroAmt); otimeVO.setCashRfndAmt(zeroAmt); otimeVO.setInsRflctAmt(zeroAmt); List<PaymentsVO> paymentsVOs = pymProcessService.getBillCycleParamCrte(recpDataCmd); Map<String, String> sumAmtMap = this.getLnkgPymTrgtSumAmts(paymentsVOs); otimeVO.setPymTrgtAmt(sumAmtMap.get("pymTrgtAmtSum")); otimeVO.setAddvTxAmt(sumAmtMap.get("addvTxAmtSum")); otimeVO.setSplyAmt(sumAmtMap.get("splyAmtSum")); // try{ // ObjectMapper om1 = new ObjectMapper(); // String temp1 = om1.defaultPrettyPrintingWriter().writeValueAsString(paymentsVOs); // System.out.println("old paymentsVOsstructure::"+temp1); // } catch (Exception e) { // System.err.println(e.toString()); // } for (PaymentsVO eachPayment : paymentsVOs) { List<ArLnkgPymTrgtVO> newTrgtList = setImdtPymYnAndRshtItemCd(eachPayment.getArLnkgPymEntr().getArLnkgPymTrgt()); eachPayment.getArLnkgPymEntr().setArLnkgPymTrgt(newTrgtList); } /* List<PaymentsVO> new_payment_list = new ArrayList<PaymentsVO>(); for (PaymentsVO each_payment : paymentsVOs) { PaymentsVO newPaymentsVO = new PaymentsVO(); ArLnkgPymEntrVO arLnkgPymEntrVO = each_payment.getArLnkgPymEntr(); List<ArLnkgPymTrgtVO> newArLnkgPymTrgtVOs = new ArrayList<ArLnkgPymTrgtVO>(); List<ArLnkgPymTrgtVO> arLnkgPymTrgtVOs = each_payment.getArLnkgPymEntr().getArLnkgPymTrgt(); for(ArLnkgPymTrgtVO arLnkgPymTrgtVO : arLnkgPymTrgtVOs) { arLnkgPymTrgtVO.setImdtPymYn("0"); // 익월청구로 세팅 arLnkgPymTrgtVO.setRshtItemCd("2" + arLnkgPymTrgtVO.getBlItemMclsCd()); // 영수증항목 하드코딩(청구중분류만 있으므로) newArLnkgPymTrgtVOs.add(arLnkgPymTrgtVO); } arLnkgPymEntrVO.getArLnkgPymTrgt().clear(); arLnkgPymEntrVO.setArLnkgPymTrgt(newArLnkgPymTrgtVOs); newPaymentsVO.setArLnkgPymEntr(arLnkgPymEntrVO); new_payment_list.add(newPaymentsVO); }*/ otimeVO.setPayments(paymentsVOs); // try{ // ObjectMapper om2 = new ObjectMapper(); // String temp2 = om2.defaultPrettyPrintingWriter().writeValueAsString(paymentsVOs); // System.out.println("new paymentsVOsstructure::"+temp2); // } catch (Exception e) { // System.err.println(e.toString()); // } ArLnkgPymMgmtMemoVO arLnkgPymMgmtMemoVO = new ArLnkgPymMgmtMemoVO(); arLnkgPymMgmtMemoVO.setUserMemoCntnt( "Auto HotBill using bill account balance(" + billAcntBalance + ") for threshold revocation."); otimeVO.setArLnkgPymMgmtMemo(arLnkgPymMgmtMemoVO); // 익월청구이므로 납부방법별 수납금액은 없으므로 []로 넘김. null로 넘기면 null pointer exception 발생 주의 otimeVO.setArLnkgPymDetl(new ArrayList<ArLnkgPymDetlVO>()); Map<String, Object> pymResMap = pymProcessService.insertGeneralPymData(otimeVO); pymProcessService.updateArLnkgPymMgmt((String) pymResMap.get("recpNo")); return (String) pymResMap.get("recpNo"); }
/** 일반수납 파라미터 생성 * */ @RequestMapping(value = "/bsar/ar/recpDataCrte", method = RequestMethod.POST) @ResponseBody // public List<PaymentsVO> recpDataCrte(@RequestBody RecpDataCmd // recpDataCmd){ public Map<String, Object> recpDataCrte(@RequestBody RecpDataCmd recpDataCmd) { String recpNo = recpDataCmd.getRecpNo(); String hbSeqNo = recpDataCmd.getHbSeqNo(); String eventCode = recpDataCmd.getEventCode(); Map<String, Object> resMap = new HashMap<String, Object>(); if (logger.isDebugEnabled()) { logger.debug("recpDataCrte" + recpNo); logger.debug("recpDataCrte" + hbSeqNo); logger.debug("recpDataCrte" + eventCode); } List<PaymentsVO> payments = new ArrayList<PaymentsVO>(); try { // 청구, 선불충전 // TODO 청구 이벤트랑 선불충전의 차이가 있을지 없을지 확인 if (StringUtils.isNotEmpty(recpNo) && StringUtils.isEmpty(hbSeqNo)) { if (logger.isDebugEnabled()) { logger.debug("recpDataCrte 청구" + recpNo); logger.debug("recpDataCrte 청구" + hbSeqNo); logger.debug("recpDataCrte 청구" + eventCode); } payments = this.pymProcessService.getBillParamCrte(recpDataCmd); } else if (StringUtils.isNotEmpty(hbSeqNo) && StringUtils.isEmpty(recpNo)) { if (logger.isDebugEnabled()) { logger.debug("recpDataCrte 핫빌" + hbSeqNo); logger.debug("recpDataCrte 핫빌" + recpNo); logger.debug("recpDataCrte 핫빌" + eventCode); } // Arrays.asList("201001", "201002","205000","206000").contains(eventCode) if ("201001".equals(eventCode) // none number saving(일시정지) || "201002".equals(eventCode) // number saving(일시정지) || "205000".equals(eventCode) // 청구주기 변경 || "206000".equals(eventCode) // 실시간 수납 ) { // 주기변경, // 2013-05-06 추가 일시정지,실시간수납 ==> 이전보증금 미편성 payments = this.pymProcessService.getBillCycleParamCrte(recpDataCmd); } else { // 이전보증금 포함(자동수납항목) payments = this.pymProcessService.getHotBillParamCrte(recpDataCmd); } } resMap.put("payments", payments); resMap.put("result", "SUCCESS"); } catch (AcubeCommonException e) { resMap.put("result", "FAIL: " + e.toString()); } catch (Exception e) { resMap.put("result", "FAIL: " + e.toString()); } return resMap; // return payments; }