Example #1
0
  @Test
  public void getPagingListTest() throws Exception {
    //        String url =
    //               "http://employeeservice.hzfh.com:8080/service-employee/empCompilePlan";
    //		 HessianProxyFactory factory = new HessianProxyFactory();
    //        EmpCompilePlanService empCompilePlanService =
    // (EmpCompilePlanService)factory.create(EmpCompilePlanService.class, url);
    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    EmpCompilePlanService empCompilePlanService =
        (EmpCompilePlanService) context.getBean("empCompilePlanService");

    EmpCompilePlanCondition empCompilePlanCondition = new EmpCompilePlanCondition();
    // productCondition.setId(1);
    empCompilePlanCondition.setPageIndex(1);
    empCompilePlanCondition.setPageSize(4);
    empCompilePlanCondition.setTotalCount(9);

    List<SortItem> sortItemList = new ArrayList<SortItem>();
    SortItem sortItem1 = new SortItem();
    sortItem1.setSortFeild("id");
    sortItem1.setSortType(SortType.DESC);
    sortItemList.add(sortItem1);
    empCompilePlanCondition.setSortItemList(sortItemList);

    // empCompilePlanCondition.setByPosition(2);
    // empCompilePlanCondition.setByYear(2015);
    PagedList<EmpCompilePlan> empCompilePlanList =
        empCompilePlanService.getPagingList(empCompilePlanCondition);
    System.out.println("getPagingListTest");
    for (EmpCompilePlan empCompilePlan : empCompilePlanList.getResultList()) {
      System.out.println(empCompilePlan.getId() + "," + empCompilePlan.getYear());
    }
  }
 @Override
 public String execute() throws Exception {
   PagedList<PaymentRefund> paymentRefundPagedList =
       PaymentRefundModel.getPagingList(this.getCondition());
   List<PaymentRefund> list = new ArrayList<PaymentRefund>();
   list = paymentRefundPagedList.getResultList();
   PaymentRefund paymentRefund = new PaymentRefund();
   P2pProduct p2pProduct = new P2pProduct();
   Product product = new Product();
   for (int i = 0; i < list.size(); i++) {
     paymentRefund = list.get(i);
     if (paymentRefund.getProductType() == 5) {
       p2pProduct = P2pProductModel.getP2pByProductNo(paymentRefund.getProductNo());
       if (p2pProduct != null) {
         list.get(i).setEditComment(p2pProduct.getName());
       } else {
         list.get(i).setEditComment("");
       }
     } else {
       product = ProductModel.getInfo(paymentRefund.getProductNo());
       if (product != null) {
         list.get(i).setEditComment(product.getName());
       } else {
         list.get(i).setEditComment("");
       }
     }
   }
   this.setResultList(list);
   this.setPageCount(paymentRefundPagedList.getPagingInfo().getPageCount());
   this.setPageIndex(paymentRefundPagedList.getPagingInfo().getPageIndex());
   this.setRecordCount(paymentRefundPagedList.getPagingInfo().getTotalCount());
   return SUCCESS;
 }
  @Override
  public String execute() throws Exception {

    PagedList<PaymentMoneyWithdraw> paymentMoneyWithdrawPagedList =
        PaymentMoneyWithdrawModel.getPagingList(this.getCondition());
    this.setResultList(paymentMoneyWithdrawPagedList.getResultList());
    this.setPageCount(paymentMoneyWithdrawPagedList.getPagingInfo().getPageCount());
    this.setPageIndex(paymentMoneyWithdrawPagedList.getPagingInfo().getPageIndex());
    this.setRecordCount(paymentMoneyWithdrawPagedList.getPagingInfo().getTotalCount());
    int i = 0;
    for (PaymentMoneyWithdraw item : paymentMoneyWithdrawPagedList.getResultList()) {
      item.setId(++i);
    }
    return SUCCESS;
  }
  @Override
  public String execute() throws Exception {
    TempRecruitDetailCondition tempRecruitDetailCondition = new TempRecruitDetailCondition();
    tempRecruitDetailCondition.setPageSize(this.getPageSize());
    tempRecruitDetailCondition.setPageIndex(this.getPageIndex());

    List<SortItem> sortItemList = new ArrayList<SortItem>();
    SortItem sortItem = new SortItem();
    sortItem.setSortFeild(this.getSidx());
    sortItem.setSortType(this.getSortType());
    sortItemList.add(sortItem);
    tempRecruitDetailCondition.setSortItemList(sortItemList);

    PagedList<TempRecruitDetail> tempRecruitDetailPagedList =
        TempRecruitDetailModel.getPagingList(tempRecruitDetailCondition);
    this.setResultList(tempRecruitDetailPagedList.getResultList());
    this.setPageCount(tempRecruitDetailPagedList.getPagingInfo().getPageCount());
    this.setPageIndex(tempRecruitDetailPagedList.getPagingInfo().getPageIndex());
    this.setRecordCount(tempRecruitDetailPagedList.getPagingInfo().getTotalCount());
    return SUCCESS;
  }