Exemple #1
0
  @RequestMapping(
      value = "/bsar/ar/arPayment",
      method = RequestMethod.POST,
      consumes = {"application/json"})
  public String arPaymentOpen(
      Model model,
      @RequestBody OtimeVO otimeVO,
      @RequestParam(required = false) String callBackFunc) {

    logger.debug("pymDiv:::::::::::" + otimeVO.toString());
    logger.debug("pymDiv:::::::::::" + callBackFunc);

    ObjectMapper om = new ObjectMapper();
    String temp = null;
    try {
      temp = om.defaultPrettyPrintingWriter().writeValueAsString(otimeVO);
    } catch (Exception e) {
      // e.printStackTrace();
    }

    model.addAttribute("recpData", temp);
    model.addAttribute("callBackFunc", callBackFunc);
    model.addAttribute("rcpmnyDt", CmnDateUtils.addDate(0));

    // cycle bill and hotbill(payment for real time) and ownership-change hotbill(before) and
    // terminate(hotbill)
    if (otimeVO.getCsEvntCd().substring(0, 2).equals("30")
        || otimeVO.getCsEvntCd().equals("206000")
        || otimeVO.getCsEvntCd().equals("203010")
        || otimeVO.getCsEvntCd().equals("207000")) {

      List<CoAuthCodeInfo> authList =
          securityService.getCurrentMember().getSpCoAuthCodeInfoAuthList();

      for (CoAuthCodeInfo coAuthCodeInfo : authList) {
        if (coAuthCodeInfo
            .getAuthName()
            .equals("PaymentBankTransfer")) { // auth_name :: 'PaymentBankTransfer'
          model.addAttribute("bnkTransferViewalbe", true); // lnkgPymLclsCd == 30 and 권한 유저
          return "dialog.bsar.ar.arPayment";
        }
      }

      model.addAttribute("bnkTransferViewalbe", false); // lnkgPymLclsCd == 30 and 비권한 유저
      return "dialog.bsar.ar.arPayment";

    } else {
      model.addAttribute("bnkTransferViewalbe", false); // lnkgPymLclsCd != 30 and 비권한 유저
      return "dialog.bsar.ar.arPayment";
    }
  }
Exemple #2
0
  /**
   * 수납처리
   *
   * <p>*
   */
  @SuppressWarnings("unchecked")
  @RequestMapping(value = "/bsar/ar/paymentProcess", method = RequestMethod.POST)
  @ResponseBody
  public Map<String, Object> paymentProcess(@RequestBody OtimeVO otimeVO) {

    Map<String, Object> resMap = new HashMap<String, Object>();
    // TODO 1. otimeVO 멤버 주입
    otimeVO.setOperator(this.securityService.getCurrentMember());

    logger.debug("paymentProcess" + otimeVO.getCustRfndAmt());
    logger.debug("paymentProcess" + otimeVO.getCustPymAmt());

    // Map resMap = new HashMap<String, Object>();

    // System.out.println("확인용:::::::::::::::::" + otimeVO.getCsEvntCd());
    String eventCode = otimeVO.getCsEvntCd();

    int evtCodeFirtTwo = Integer.valueOf(eventCode.substring(0, 2));

    try {

      if (evtCodeFirtTwo < 30) { // LnkgPymLclsCd 3O 미만 (CS 발생 수납 이벤트 및 핫빌관련 수납)
        resMap = this.pymProcessService.insertGeneralPymData(otimeVO);
      } else { // LnkgPymLclsCd 3O 이상 (청구서 수납 및 선불 충전)  --> 수납화면 오픈 전 Merge로 MGMT, ENTR, TRGT 테이블 선
        // 저장됨.
        resMap = this.pymProcessService.insertBillPymData(otimeVO);
      }

      String lnkgPymSeqNo = (String) resMap.get("recpNo");

      if (!otimeVO.getCsEvntCd().equals("129100")) {

        this.pymProcessService.reserveOpenApiPymMthd(lnkgPymSeqNo);
      }

    } catch (AcubeCommonException e2) {
      resMap.put("status", "FAIL :" + e2.toString());
      logger.error("paymentProcess error occured :" + e2.toString());
    } catch (SQLException e1) {
      resMap.put("status", "FAIL :" + e1.toString());
      logger.error("paymentProcess error occured :" + e1.toString());
    } catch (Exception e) {
      resMap.put("status", "FAIL :" + e.toString());
      logger.error("paymentProcess error occured :" + e.toString());
    }
    return resMap;
  }
Exemple #3
0
  @RequestMapping(value = "/openapi/ar/paymentProcess", method = RequestMethod.POST)
  @ResponseBody
  public OtimeVO paymentProcess_test(@RequestBody OtimeVO otimeVO) {

    otimeVO.setOperator(this.securityService.getCurrentMember());

    try {

      OtimeVO otimeVO2 = openApiPymService.pymFromOpenApi(otimeVO);
      // pymProcessService.updateArLnkgPymMgmt(otimeVO2.getRecpNo());
      // return openApiPymService.pymFromOpenApi(otimeVO);

    } catch (AcubeCommonException e2) {
      System.err.println(e2.toString());
    } catch (Exception e) {
      System.err.println(e.toString());
    }
    return otimeVO;
  }
Exemple #4
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  @RequestMapping(value = "/bsar/ar/subsPayment", method = RequestMethod.POST)
  public String getSubsReceipt(
      Model model,
      @RequestBody OtimeVO otimeVO,
      @RequestParam(required = false) String callBackFunc) {

    System.out.println("subsPymDiv:::::::::::" + otimeVO.toString());
    System.out.println("subsPymDiv:::::::::::" + callBackFunc);

    ObjectMapper om = new ObjectMapper();
    String temp = null;
    try {
      temp = om.defaultPrettyPrintingWriter().writeValueAsString(otimeVO);
    } catch (Exception e) {
      // e.printStackTrace();
    }

    model.addAttribute("subsRecpData", temp);
    model.addAttribute("callBackFunc", callBackFunc);
    model.addAttribute("rcpmnyDt", CmnDateUtils.addDate(0));

    return "dialog.bsar.ar.subsPayment";
  }
  @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");
  }