コード例 #1
0
  // 添加付汇单页面查找数据
  @SuppressWarnings("unused")
  private String searchCustomerPayMoney(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String resultPage = "/beijing/finance/customerPayMoney_add.jsp";
    try {
      int page = 1;
      try {
        page = Integer.parseInt(request.getParameter(Constant.PARA_CURPAGE));
      } catch (Exception ex) {
        page = 1;
      }

      String BrandID = "";
      if (request.getParameter("BrandID") != null) {
        BrandID = request.getParameter("BrandID");
      }
      String CustomerID = "";
      if (request.getParameter("CustomerID") != null) {
        CustomerID = request.getParameter("CustomerID");
      }
      String MandatorID = "";
      if (request.getParameter("MandatorID") != null) {
        MandatorID = request.getParameter("MandatorID");
      }
      String CurrencyID = "";
      if (request.getParameter("CurrencyID") != null) {
        CurrencyID = request.getParameter("CurrencyID");
      }
      // 付汇日期
      String curDate = "";
      if (request.getParameter("OrderTime") != null) {
        curDate = request.getParameter("OrderTime");
      }
      // 付汇金额
      String curMoney = "";
      if (request.getParameter("Money") != null) {
        curMoney = request.getParameter("Money");
      }
      String SenderID = "";
      if (request.getParameter("SenderID") != null) {
        SenderID = request.getParameter("SenderID");
      }
      String ReceiverID = "";
      if (request.getParameter("ReceiverID") != null) {
        ReceiverID = request.getParameter("ReceiverID");
      }

      // 获得已经选中的接收单Id,传回页面
      String orderIds = "";
      if (request.getParameter("orderIds") != null
          && request.getParameter("orderIds").length() > 0) {
        orderIds = request.getParameter("orderIds");
      }
      // 选中了单据的钱的总和
      String chooseMoney = "";
      if (request.getParameter("chooseMoney") != null
          && request.getParameter("chooseMoney").length() > 0) {
        chooseMoney = request.getParameter("chooseMoney");
      }
      // 选中了单据后剩余的钱
      String remainMoney = "";
      if (request.getParameter("remainMoney") != null
          && request.getParameter("remainMoney").length() > 0) {
        remainMoney = request.getParameter("remainMoney");
      }

      HttpSession session = request.getSession(true);
      String strids = request.getParameter("strids");

      session.removeAttribute("PayMoneyIDS");
      session.setAttribute("PayMoneyIDS", strids);

      String UserID = GlobalFunc.getUserID(request);
      int pageRows = Integer.parseInt(GlobalFunc.getUserPerPageNum(request));

      int totalRows =
          payMoneyManager.getAddToPayReceiveOrderTotalRows(
              MandatorID, CustomerID, CurrencyID, BrandID, SenderID);

      int totalPage = PageManager.getTotalPages(totalRows, pageRows);
      ArrayList<?> Temp_List =
          payMoneyManager.getForFuHuiReceiveOrder(
              page, pageRows, MandatorID, CustomerID, CurrencyID, BrandID, SenderID);

      String totalUSDMoney =
          payMoneyManager.getRemainTotalMoney(
              MandatorID, CustomerID, CurrencyID, BrandID, SenderID);

      request.setAttribute("totalUSDMoney", totalUSDMoney);
      request.setAttribute(Constant.PARA_LIST, Temp_List);
      request.setAttribute("BorderHeight", GlobalFunc.getBorderHeight(request));

      request.setAttribute("CustomerID", CustomerID);
      request.setAttribute("MandatorID", MandatorID);
      request.setAttribute("SenderID", SenderID);
      request.setAttribute("CurrencyID", CurrencyID);
      request.setAttribute("ReceiverID", ReceiverID);
      request.setAttribute("BrandID", BrandID);
      request.setAttribute("curDate", curDate);
      request.setAttribute("curMoney", curMoney);

      request.setAttribute("orderIds", orderIds);
      request.setAttribute("remainMoney", remainMoney);
      request.setAttribute("chooseMoney", chooseMoney);

      request.setAttribute(Constant.PARA_CURPAGE, page);
      request.setAttribute(Constant.PARA_TOTALROWS, totalRows);
      request.setAttribute(Constant.PARA_TOTALPAGE, totalPage);
      request.setAttribute(
          "CustomerList",
          PageManager.getLimitData("BeiJingCustomer", "ID,ShortName", "Status!=-1"));
      request.setAttribute(
          "MandatorList", PageManager.getLimitData("BeiJingClient", "ID,ShortName", "Status!=-1"));
      request.setAttribute(
          "CurrencyList", PageManager.getLimitData("Currency", "ID,Currency", "Status!=-1"));
      request.setAttribute(
          "BrandList",
          PageManager.getLimitData("BeiJingJieSuanBrand", "ID,BrandName", "Status!=-1"));
      request.setAttribute(
          "ReceiverList",
          PageManager.getLimitData("BJPayee", "ID,PayeeName as ReceiverName", "Status!=-1"));
      request.setAttribute(
          "SenderList", PageManager.getLimitData("BeiJingSender", "ID,SenderName", "Status!=-1"));

    } catch (Exception e) {
      e.printStackTrace();
    }

    return resultPage;
  }
コード例 #2
0
  // 添加核销单据之前准备数据
  @SuppressWarnings("unused")
  private String toAddOrderForFuHui(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String resultPage = "/beijing/finance/customerPayMoney_edit.jsp";
    try {
      int page = 1;
      try {
        page = Integer.parseInt(request.getParameter(Constant.PARA_CURPAGE));
      } catch (Exception ex) {
        page = 1;
      }

      // 根据ID获得付汇信息
      HashMap<String, String> orderHM = payMoneyManager.getFuHuiInfo(request.getParameter("ID"));
      String CurrencyID = orderHM.get("CurrencyID").toString();
      String MandatorID = orderHM.get("MandatorID").toString();
      String CustomerID = orderHM.get("CustomerID").toString();
      String BrandID = "";

      if (request.getParameter("BrandID") != null && request.getParameter("BrandID").length() > 0) {
        BrandID = request.getParameter("BrandID");
      }

      HttpSession session = request.getSession(true);
      String strids = request.getParameter("strids");

      session.removeAttribute("PayMoneyIDS");
      session.setAttribute("PayMoneyIDS", strids);

      double chooseMoney = 0.0;

      if (request.getParameter("chooseMoney") != null
          && request.getParameter("chooseMoney").toString().length() > 0) {
        chooseMoney = Double.parseDouble(request.getParameter("chooseMoney"));
      }

      double remainMoney = payMoneyManager.getFuHuiRemainMoney(orderHM, chooseMoney);
      remainMoney = PBMeth.round(remainMoney, 2);

      // 获得用户选择的接收单Id,传回页面
      String orderIds = "";
      if (request.getParameter("orderIds") != null
          && request.getParameter("orderIds").length() > 0) {
        orderIds = request.getParameter("orderIds");
      }

      // chooseMoney = Double.parseDouble(orderHM.get("Money").toString()) - remainMoney;

      // 获得用户设置的每页显示行数
      String UserID = GlobalFunc.getUserID(request);
      int pageRows = Integer.parseInt(GlobalFunc.getUserPerPageNum(request));

      // 根据付汇单信息获得可添加成核销的接收单数量
      int totalRows =
          payMoneyManager.getAddToPayReceiveOrderTotalRows(
              MandatorID, CustomerID, CurrencyID, BrandID, "");
      // 根据总数据量和每页显示行数得到总页数
      int totalPage = PageManager.getTotalPages(totalRows, pageRows);
      // 获得可添加的接收单List
      ArrayList<?> Temp_List =
          payMoneyManager.getForFuHuiReceiveOrder(
              page, pageRows, MandatorID, CustomerID, CurrencyID, BrandID, "");

      request.setAttribute(Constant.PARA_LIST, Temp_List);
      request.setAttribute("BorderHeight", GlobalFunc.getBorderHeight(request));
      request.setAttribute("remainMoney", String.valueOf(remainMoney));
      request.setAttribute("chooseMoney", String.valueOf(chooseMoney));
      request.setAttribute("orderIds", orderIds);
      request.setAttribute("OrderHM", orderHM);
      request.setAttribute("BrandID", BrandID);

      request.setAttribute(Constant.PARA_CURPAGE, page);
      request.setAttribute(Constant.PARA_TOTALROWS, totalRows);
      request.setAttribute(Constant.PARA_TOTALPAGE, totalPage);
      request.setAttribute("BrandList", GlobalFunction.getAllBJJieSuanBrand("0"));

    } catch (ACDException e) {
      request.setAttribute(Constant.ERROR_EXCEPTION, e);
      resultPage = Constant.ERROR_JSP;
    } catch (Exception e) {
      e.printStackTrace();
    }

    return resultPage;
  }