|
|
@@ -219,6 +219,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
List<Product> products = new ArrayList<Product>();
|
|
|
page.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
page.filter("b2cEnabled", com.uas.platform.b2c.prod.commodity.constant.IntegerConstant.YES_INT);
|
|
|
+ page.sorting(Sort.Direction.DESC, "standard", "id");
|
|
|
//产品部要求导出是非标和标准全部导出,先注释这条代码
|
|
|
// if(StringUtils.isEmpty(type)) {
|
|
|
// type = "all";
|
|
|
@@ -242,28 +243,13 @@ public class ProductServiceImpl implements ProductService {
|
|
|
query.where(page.getPredicates(root, query, cb));
|
|
|
return null;
|
|
|
}
|
|
|
- });
|
|
|
- //先按照id降序排列
|
|
|
- Collections.sort(products, new Comparator<Product>() {
|
|
|
- @Override
|
|
|
- public int compare(Product o1, Product o2) {
|
|
|
- return (o2.getId().compareTo(o1.getId()));
|
|
|
- }
|
|
|
- });
|
|
|
- //后面按照非标与标准排列
|
|
|
- Collections.sort(products, new Comparator<Product>() {
|
|
|
- @Override
|
|
|
- public int compare(Product o1, Product o2) {
|
|
|
- return o2.getStandard().compareTo(o1.getStandard());
|
|
|
- }
|
|
|
- });
|
|
|
+ }, page.getSort());
|
|
|
List<Goods> goodses = new ArrayList<>();
|
|
|
for (Product product : products) {
|
|
|
- System.out.println(product.getId() + " -" + product.getStandard());
|
|
|
List<Goods> goodses1 = goodsDao.findByProductIdOrderByGoodsId(product.getId());
|
|
|
- if(goodses1.size() > 0) {
|
|
|
+ if (goodses1.size() > 0) {
|
|
|
goodses.addAll(goodses1);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
Goods g = Goods.productConvertGoods(product);
|
|
|
goodses.add(g);
|
|
|
}
|