日期:2014-05-20 浏览次数:20833 次
public List getNewBids() { // TODO Auto-generated method stub Bid bid = new Bid(); List bidList = bidDao.findByExample(bid); List bidList2 = bidList; //就是这段代码没有执行, //将出价表中对同一商品的出价进行筛选. for(int i =0;i>bidList.size()-1;i++){ System.out.println("执行......"); Goods goods1 = ((Bid)bidList.get(i)).getGoods(); Goods goods2 = ((Bid)bidList.get(i+1)).getGoods(); System.out.println(goods1.getGoodsName()); System.out.println(goods2.getGoodsName()); if(goods1.getGoodsName().equals(goods2.getGoodsName())){ System.out.println("删除一条.."); bidList2.remove(i+1); } } int max = 0; if(bidList2.size()>3){ max = 3; }else{ max = bidList2.size(); } List newList = new ArrayList(); System.out.println("长度对比:"+bidList.size()+" 2:::::"+bidList2.size()); for(int i =0;i<max;i++){ newList.add(bidList2.get(i)); } return newList; }