|
|
@@ -333,21 +333,12 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (StringUtils.isEmpty(type)) {
|
|
|
type = "nStandard";
|
|
|
}
|
|
|
+ page.filter("b2cEnabled", (short) 1);
|
|
|
if (type.contains("standard")) {
|
|
|
page.filter("standard", (short)1);
|
|
|
- page.filter("b2cEnabled", (short) 1);
|
|
|
} else if (type.contains("nStandard")) {
|
|
|
page.filter("standard", (short)0);
|
|
|
- page.filter("b2cEnabled", (short) 1);
|
|
|
} else if (type.contains("all")) {
|
|
|
-// SimpleExpression[] arr = new SimpleExpression[2];
|
|
|
-// arr[0] = PredicateUtils.eq("b2cEnabled", (short) 1, false);
|
|
|
-// arr[1] = PredicateUtils.eq("standard", (short) 1, false);
|
|
|
-// LogicalExpression logicalExpression = PredicateUtils.and(arr);
|
|
|
-// SimpleExpression standard = PredicateUtils.eq("standard", (short) 0, false);
|
|
|
-// page.orExpression(standard);
|
|
|
-// page.orExpression(logicalExpression);
|
|
|
- page.filter("b2cEnabled", (short) 1);
|
|
|
page.sorting("createTime", Sort.Direction.DESC);
|
|
|
}
|
|
|
|
|
|
@@ -360,7 +351,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
LogicalExpression logicalExpression4 = PredicateUtils.or(expressions4);
|
|
|
page.expression(logicalExpression4);
|
|
|
}
|
|
|
-
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
Page<V_ProductPerson> productPage = v_productPersonDao.findAll(new Specification<V_ProductPerson>() {
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<V_ProductPerson> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
@@ -368,14 +359,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return null;
|
|
|
}
|
|
|
}, page);
|
|
|
-
|
|
|
- /*Page<Product> productPage = productDao.findAll(new Specification<Product>() {
|
|
|
- @Override
|
|
|
- public Predicate toPredicate(Root<Product> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
- query.where(page.getPredicates(root, query, cb));
|
|
|
- return null;
|
|
|
- }
|
|
|
- }, page);*/
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
+ System.err.println("l1 ------------- l" + (l1 - l));
|
|
|
List<V_ProductPerson> productList = productPage.getContent();
|
|
|
if (CollectionUtils.isNotEmpty(productList)) {
|
|
|
List<Long> list = new ArrayList<>();
|
|
|
@@ -388,6 +373,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
list.add(product.getId());
|
|
|
}
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
+ System.err.println("l2 ------------- l1" + (l2 - l1));
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
List<ProductAttachSubmit> submits = productAttachService.findByProductidsAndStatus(list, Status.UNAUDIT.value());
|
|
|
for (ProductAttachSubmit productAttachSubmit : submits) {
|
|
|
@@ -398,7 +385,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ long l3 = System.currentTimeMillis();
|
|
|
+ System.err.println("l3 ------------- l2" + (l3 - l2));
|
|
|
Map<Long, List<ProductReplace>> batchGetProductReplace = batchGetProductReplace(list);
|
|
|
if ((batchGetProductReplace != null) && (batchGetProductReplace.size() != 0)) {
|
|
|
for (V_ProductPerson product : productList) {
|
|
|
@@ -408,6 +396,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ long l4 = System.currentTimeMillis();
|
|
|
+ System.err.println("l4 ------------- l3" + (l4 - l3));
|
|
|
}
|
|
|
return new PageImpl<V_ProductPerson>(productList, page, productPage.getTotalElements());
|
|
|
} else {
|