Ejemplo n.º 1
0
  /**
   * 처리 내용 : 차주정보 수정에 대한 데이터 처리 처리 날짜 : 2015.01.08
   *
   * @param mapParams
   * @param request
   * @param response
   * @throws Exception
   */
  @RequestMapping("/edit_action.do")
  public void carOwnEditAction(
      @RequestParam Map<String, Object> mapParams,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    BaseSessInfo info = SessionUtility.getLoginForAdmin(request);

    if (info == null) {
      ComUtils.responseJson(request, response, ResultVO.create(BaseResVO.ERR_SESSION_NOT_EXIST));
      return;
    }

    CarOwnerVO dataVO = new CarOwnerVO();
    ResultVO resVO = new ResultVO();

    int nRet = 0;
    String sUserTelno =
        ComStr.toStr(mapParams.get("own_tel01"))
            + "-"
            + ComStr.toStr(mapParams.get("own_tel02"))
            + "-"
            + ComStr.toStr(mapParams.get("own_tel03"));

    dataVO.setOwn_car_no(ComStr.toStr(mapParams.get("own_car_no")));
    dataVO.setOwn_name(ComStr.toStr(mapParams.get("own_name")));
    dataVO.setTel_no(ComCrypto.encode(cryptoService, sUserTelno));

    try {
      nRet = carOwnerService.updateData(dataVO, info.getUserId());

      if (nRet > 0) {
        resVO.setRetCode(ResultVO.RET_OK, messageSource);

      } else {
        resVO.setRetCode(ResultVO.ERR_UPDATE_FAIL, messageSource);
      }

    } catch (DataAccessException e) {
      logger.error("/cms/carown/edit_action.do, Update Error...");
      resVO.setRetCode(ResultVO.ERR_APP_WEBCOMMON, messageSource);
    } catch (Exception e) {
      logger.error("/cms/carown/edit_action.do, Update Error...");
      resVO.setRetCode(ResultVO.ERR_APP_WEBCOMMON, messageSource);
    }

    ComUtils.responseJson(request, response, resVO);
  }
Ejemplo n.º 2
0
  /**
   * 처리 내용 : 차주정보 등록에 대한 데이터 처리 처리 날짜 : 2015.01.08
   *
   * @param mapParams
   * @param request
   * @param response
   * @throws Exception
   */
  @RequestMapping("/reg_action.do")
  public void carOwnRegAction(
      @RequestParam Map<String, Object> mapParams,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    BaseSessInfo info = SessionUtility.getLoginForAdmin(request);

    if (info == null) {
      ComUtils.responseJson(request, response, ResultVO.create(BaseResVO.ERR_SESSION_NOT_EXIST));
      return;
    }

    CarOwnerVO dataVO = new CarOwnerVO();
    ResultVO resVO = new ResultVO();

    String sOwnCarNo = ComStr.toStr(mapParams.get("own_car_no"));
    String sOwnName = ComStr.toStr(mapParams.get("own_name"));
    String sOwnTelno =
        ComStr.toStr(mapParams.get("own_tel01"))
            + "-"
            + ComStr.toStr(mapParams.get("own_tel02"))
            + "-"
            + ComStr.toStr(mapParams.get("own_tel03"));

    dataVO.setOwn_car_no(sOwnCarNo);
    dataVO.setOwn_name(sOwnName);
    dataVO.setTel_no(ComCrypto.encode(cryptoService, sOwnTelno));

    try {
      carOwnerService.insertData(dataVO, info.getUserId());
      resVO.setRetCode(ResultVO.RET_OK, messageSource);

    } catch (DataAccessException e) {
      if (DbUtils.getErrorCode(e) == DbUtils.ERR_DB_DUPLICATE_KEY) {
        resVO.setRetCode(ResultVO.ERR_DB_DUPLICATE_KEY, messageSource);
      } else {
        resVO.setRetCode(ResultVO.ERR_INSERT_FAIL, messageSource);
      }

      logger.debug("/cms/carown/reg_action.do, Insert Error...");
    } catch (Exception e) {
      resVO.setRetCode(ResultVO.ERR_INSERT_FAIL, messageSource);
      logger.debug("/cms/carown/reg_action.do, Insert Error...");
    }
    ComUtils.responseJson(request, response, resVO);
  }