|
|
|
@ -110,6 +110,20 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
// 排序索引
|
|
|
|
int index=0; |
|
|
|
List<Goods> glist = goodsMapper.getGoodsByCondition(where,limit,order,"DESC"); |
|
|
|
// 查询到的list 进行排序
|
|
|
|
List<Goods> newgoodsList = new LinkedList<>(); |
|
|
|
Collections.sort(glist, new Comparator<Goods>() { |
|
|
|
@Override |
|
|
|
public int compare(Goods o1, Goods o2) { |
|
|
|
if(o1.getRecommendSort()>o2.getRecommendSort()){ |
|
|
|
return -1; |
|
|
|
} |
|
|
|
if(o1.getRecommendSort()== o2.getRecommendSort()){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
if(glist!=null){ |
|
|
|
for(Goods g:glist){ |
|
|
|
Map<String,Object> ngmap = new HashMap<>(); |
|
|
|
|