Пример #1
0
  public ArrayList<ReceiveDocVO> getAllReceiveDoc() {

    try {
      ArrayList<ReceiveDocPO> list = rmiObj.getReceiveDoclist();
      if (list == null) return null;
      // 如果没有收款单,直接返回null
      ArrayList<ReceiveDocVO> transList = new ArrayList<ReceiveDocVO>();

      for (ReceiveDocPO po : list) {
        ReceiveDocVO vo =
            new ReceiveDocVO(
                po.getReceiveDate(),
                po.getReceivePrice(),
                po.getDeliverManID(),
                po.getAllOrderIDs(),
                po.getOrgID());
        transList.add(vo);
      }

      return transList;
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return null;
    }
  }
Пример #2
0
  public SumReceiveVO getReceiveDocList(String date, String orgID) {

    try {
      ArrayList<ReceiveDocPO> list = rmiObj.getReceiveDoclist();
      if (list == null) return null;
      // 如果没有收款单,直接返回null
      if (date == null) {
        Date d = new Date();
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        date = format.format(d);
      }
      // 如果未选择日期,则日期为今天的日期

      double sum = 0;
      ArrayList<ReceiveDocVO> transList = new ArrayList<ReceiveDocVO>();

      if (orgID == null) {
        // 如果未选择营业厅
        for (ReceiveDocPO po : list) {
          if (po.getReceiveDate().equals(date)) {
            // 选择符合时间的收款单

            sum += po.getReceivePrice();

            ReceiveDocVO vo =
                new ReceiveDocVO(
                    po.getReceiveDate(),
                    po.getReceivePrice(),
                    po.getDeliverManID(),
                    po.getAllOrderIDs(),
                    po.getOrgID());
            transList.add(vo);
          }
        }
      } else {
        // 如果选择营业厅
        for (ReceiveDocPO po : list) {
          if (po.getReceiveDate().equals(date) && po.getOrgID().equals(orgID)) {
            // 选择符合时间和营业厅名称的收款单

            sum += po.getReceivePrice();

            ReceiveDocVO vo =
                new ReceiveDocVO(
                    po.getReceiveDate(),
                    po.getReceivePrice(),
                    po.getDeliverManID(),
                    po.getAllOrderIDs(),
                    po.getOrgID());
            transList.add(vo);
          }
        }
      }

      SumReceiveVO sumReceiveDoc = new SumReceiveVO(transList, sum);

      return sumReceiveDoc;
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return new SumReceiveVO(null, 0);
    }
  }