/*
   * 获取对象列表
   */
  public Object[] getElements(Context context, STableStatus tablestatus) {
    GetGoodsSplitBillListKey key =
        new GetGoodsSplitBillListKey(tablestatus.getBeginIndex(), tablestatus.getPageSize(), false);
    if (CheckIsNull.isNotEmpty(tablestatus.getSortColumn())) {
      key.setSortField(getSortField(tablestatus.getSortColumn()));
      key.setSortType(getSortType(tablestatus.getSortDirection()));
    }
    key.setStatus(new GoodsSplitStatus[] {GoodsSplitStatus.Approvaling});
    key.setSearchText(searchText.getText());
    key.setBeginTime(context.find(QueryTerm.class, queryTermList.getText()).getStartTime());
    key.setEndTime(context.find(QueryTerm.class, queryTermList.getText()).getEndTime());
    ListEntity<GoodsSplitItem> entity = context.find(ListEntity.class, key);
    List<GoodsSplitItem> itemList = entity.getItemList();

    // if (CheckIsNull.isEmpty(itemList)) {
    // countLabel.setText("0");
    // return null;
    // }
    GoodsSplitItem[] items = new GoodsSplitItem[itemList.size()];
    for (int i = 0; i < itemList.size(); i++) {
      items[i] = itemList.get(i);
      itemMap.put(items[i].getRECID().toString(), items[i]);
    }
    int size = items.length;
    if (tablestatus.getPageNo() != STableStatus.FIRSTPAGE) {
      String preSize = countLabel.getText();
      if (StringHelper.isNotEmpty(preSize)) {
        size += Integer.parseInt(preSize);
      }
    }
    countLabel.setText(String.valueOf(size));
    // countLabel.setText("" + items.length);
    countLabel.getParent().getParent().layout();
    return items;
  }
 @SuppressWarnings("unchecked")
 public Object[] getElements(Context context, STableStatus tablestatus) {
   // GetCustomerListKey key = new
   // GetCustomerListKey(PartnerStatus.Potential);
   if (!StringUtils.isEmpty(tablestatus.getSortColumn())) {
     key.setSortField(SortField.valueOf(tablestatus.getSortColumn()));
     if (tablestatus.getSortDirection() == SSortDirection.ASC) {
       key.setSortType(SortType.Asc);
     } else {
       key.setSortType(SortType.Desc);
     }
   }
   ListEntity<CustomerItem> listEntity = context.find(ListEntity.class, key);
   if (listEntity != null) {
     countLabel.setText(String.valueOf(listEntity.getItemList().size()));
     return listEntity.getItemList().toArray();
   }
   countLabel.setText("0");
   return null;
 }
 @SuppressWarnings("unchecked")
 @Override
 public Object[] getElements(Context context, STableStatus tablestatus) {
   GetOnlineReturnListKey key =
       new GetOnlineReturnListKey(
           tablestatus.getBeginIndex(),
           tablestatus.getPageSize(),
           true,
           OnlineReturnTab.Approving);
   key.setSearchText(search.getText());
   OnlineReturnListEntity listEntity = context.find(OnlineReturnListEntity.class, key);
   if (null == listEntity) return null;
   //		int size = listEntity.getItemList().size();
   //		if (tablestatus.getPageNo() != STableStatus.FIRSTPAGE) {
   //			String preSize = countLabel.getText();
   //			if (StringHelper.isNotEmpty(preSize)) {
   //				size += Integer.parseInt(preSize);
   //			}
   //		}
   countLabel.setText(listEntity.getTotalCount() + "");
   return listEntity.getItemList().toArray();
 }
  @Override
  public void process(Situation context) {
    super.process(context);
    table.addClientEventHandler(
        SEditTable.CLIENT_EVENT_VALUE_CHANGED, "OnlineOrder.handleTableDataChange");
    final Label nameLabel = createLabelControl(ID_Label_CustomerName);
    final Label mobileLable = createLabelControl(ID_Label_MobileNo);
    final Label dateLabel = createLabelControl(ID_Label_BookingDate);
    final Button saveButton = createButtonControl(ID_Button_Save);
    final Button cancelButton = createButtonControl(ID_Button_Cancel);

    nameLabel.setText(orderInfo.getRealName());
    mobileLable.setText(orderInfo.getConsigneeTel());
    dateLabel.setText(DateUtil.dateFromat(orderInfo.getCreateDate()));

    searateAction(saveButton);
    cancelAction(cancelButton);
  }
  @Override
  protected Object[] getOrderItem(STableStatus tablestatus) {
    // OrderListEntity, GetPurchaseOrderListKey
    GetPurchaseOrderListKey key =
        new GetPurchaseOrderListKey(tablestatus.getBeginIndex(), tablestatus.getPageSize(), false);
    key.setOrderStatus(OrderStatus.finish, OrderStatus.Stop);
    if (null != queryScopeSource) {
      key.setQueryScope(queryScopeSource.getQueryScope(queryScopeList.getText()));
    }
    key.setQueryTerm(getContext().find(QueryTerm.class, colstDate.getText()));
    key.setSearchText(searchText.getText());
    if (null != tablestatus.getSortColumn()) {
      key.setSortField(Columns.valueOf(tablestatus.getSortColumn()).getSortField());
    }
    // 排序
    setLimitKeySort(key, tablestatus);

    listEntity = context.find(OrderListEntity.class, key);
    long size = listEntity.getTotalCount();
    double orderAmount = listEntity.getOrderAmount();
    double returnAmount = listEntity.getReturnAmount();
    if (tablestatus.getPageNo() != STableStatus.FIRSTPAGE) {
      String preSize = lblOrderCount.getText();
      if (StringHelper.isNotEmpty(preSize)) {
        size += Integer.parseInt(preSize);
      }
      String preOrderAmount = lblPurchaseAmount.getText();
      if (StringHelper.isNotEmpty(preOrderAmount)) {
        orderAmount = DoubleUtil.sub(orderAmount, DoubleUtil.strToDouble(preOrderAmount));
      }
      String preReturnAmount = lblReturnAmount.getText();
      if (StringHelper.isNotEmpty(preReturnAmount)) {
        returnAmount = DoubleUtil.sub(returnAmount, DoubleUtil.strToDouble(preReturnAmount));
      }
    }
    lblOrderCount.setText(String.valueOf(size));
    lblPurchaseAmount.setText(DoubleUtil.getRoundStr(orderAmount));
    lblReturnAmount.setText(DoubleUtil.getRoundStr(returnAmount));

    return listEntity.getItemList().toArray();
  }
 /** 获得未发布公告列表 */
 public Object[] getElements(Context context, STableStatus tablestatus) {
   List<NoticeItem> noticeItemList = findNoticeItemList(context, tablestatus);
   // 设置公告数量
   noticeCountLabel.setText((null != noticeItemList ? noticeItemList.size() : 0) + "");
   return null != noticeItemList ? noticeItemList.toArray() : null;
 }