Ejemplo n.º 1
0
  /**
   * 保存中继站信息 操作权限:73001
   *
   * @param mapping ActionMapping
   * @param request HttpServletRequest
   * @param strKey String
   * @param args Map
   * @return ActionForward
   * @throws Exception
   */
  public ActionForward add(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    // TODO Auto-generated method stub
    if (!CheckPower.checkPower(request.getSession(), "73001")) {
      return mapping.findForward("powererror");
    }

    baseBo = new RepeaterStationBO();
    RepeaterStationBean bean = (RepeaterStationBean) form;
    String operationCode = baseBo.insertRepeaterStation(bean);
    String url = request.getContextPath() + "/station_info.do?method=";
    if (ExecuteCode.EXIST_STATION_ERR_CODE.equals(operationCode)) {
      return super.forwardErrorPageWithUrl(mapping, request, "ExistStationError", url + "addForm");
    }
    if (ExecuteCode.FAIL_CODE.equals(operationCode)) {
      return super.forwardErrorPageWithUrl(mapping, request, "FailCode", url + "addForm");
    }
    if (ExecuteCode.SUCCESS_CODE.equals(operationCode)) {
      return super.forwardInfoPageWithUrl(
          mapping, request, "SuccessCode", url + "list&reset_query=1");
    }
    return mapping.findForward("");
  }
Ejemplo n.º 2
0
  /**
   * 保存修改的中继站信息 操作权限:73002
   *
   * @param mapping ActionMapping
   * @param request HttpServletRequest
   * @param strKey String
   * @param args Map
   * @return ActionForward
   * @throws Exception
   */
  public ActionForward mod(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    // TODO Auto-generated method stub
    if (!CheckPower.checkPower(request.getSession(), "73002")) {
      return mapping.findForward("powererror");
    }

    baseBo = new RepeaterStationBO();
    RepeaterStationBean bean = (RepeaterStationBean) form;
    String operationCode = baseBo.updateRepeaterStation(bean);
    String url = request.getContextPath() + "/station_info.do?method=";
    if (ExecuteCode.NOT_EXIST_STATION_ERR_CODE.equals(operationCode)) {
      return super.forwardErrorPageWithUrl(mapping, request, "NotExistStationError", url + "list");
    }
    if (ExecuteCode.EXIST_STATION_ERR_CODE.equals(operationCode)) {
      return super.forwardErrorPageWithUrl(
          mapping, request, "ExistStationError", url + "modForm&station_id=" + bean.getTid());
    }
    // if (ExecuteCode.EXIST_PLAN_ERR_CODE.equals(operationCode)) {
    // return super.forwardErrorPageWithUrl(mapping, request,
    // "StationExistPlanError", url
    // + "list");
    // }
    if (ExecuteCode.FAIL_CODE.equals(operationCode)) {
      return super.forwardErrorPageWithUrl(
          mapping, request, "FailCode", url + "modForm&station_id=" + bean.getTid());
    }
    if (ExecuteCode.SUCCESS_CODE.equals(operationCode)) {
      return super.forwardInfoPageWithUrl(mapping, request, "SuccessCode", url + "list");
    }
    return mapping.findForward("");
  }