Esempio n. 1
0
 // 获得付汇单明细前准备数据
 private String detailCustomerPayMoney(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   String resultPage = "/beijing/finance/customerPayMoney_detail.jsp";
   try {
     String ID = request.getParameter("ID");
     // 付汇单信息
     HashMap<String, String> hm = payMoneyManager.getFuHuiInfo(ID);
     // 付汇单对应的鲜活接收单信息
     ArrayList<?> ls = payMoneyManager.getReceiveOrderInfoByFuHuiID(ID);
     request.setAttribute("OrderHM", hm);
     request.setAttribute("detailList", ls);
   } catch (Exception e) {
     request.setAttribute(Constant.ERROR_EXCEPTION, e);
     resultPage = Constant.ERROR_JSP;
   }
   return resultPage;
 }
Esempio n. 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;
  }