...
|
...
|
@@ -171,7 +171,27 @@ public class ProductSortServiceImpl implements IProductSortService { |
|
|
List<JSONObject> jsonObjectList = new ArrayList<>();
|
|
|
JSONObject jsonObject;
|
|
|
for (ProductSort productSort : productSorts) {
|
|
|
if (productSort.getParentId() == null || productSort.getParentId() == 0) {
|
|
|
if ((productSort.getParentId() == null || productSort.getParentId() == 0) && PRODUCT_SORT_LEVEL_1.equals(productSort.getLevel())) {
|
|
|
jsonObject = new JSONObject();
|
|
|
jsonObject.put("id", productSort.getId());
|
|
|
jsonObject.put("text", productSort.getSortName());
|
|
|
jsonObjectList.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
if (CollectionUtils.isEmpty(jsonObjectList)) {
|
|
|
jsonObject = new JSONObject();
|
|
|
jsonObjectList.add(jsonObject);
|
|
|
}
|
|
|
return jsonObjectList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<JSONObject> getLevel2SortIdAndName() {
|
|
|
List<ProductSort> productSorts = this.getAllProcutSort();
|
|
|
List<JSONObject> jsonObjectList = new ArrayList<>();
|
|
|
JSONObject jsonObject;
|
|
|
for (ProductSort productSort : productSorts) {
|
|
|
if ((productSort.getParentId() != null || productSort.getParentId() != 0) && PRODUCT_SORT_LEVEL_2.equals(productSort.getLevel())) {
|
|
|
jsonObject = new JSONObject();
|
|
|
jsonObject.put("id", productSort.getId());
|
|
|
jsonObject.put("text", productSort.getSortName());
|
...
|
...
|
@@ -180,8 +200,6 @@ public class ProductSortServiceImpl implements IProductSortService { |
|
|
}
|
|
|
if (CollectionUtils.isEmpty(jsonObjectList)) {
|
|
|
jsonObject = new JSONObject();
|
|
|
/*jsonObject.put("id", "");
|
|
|
jsonObject.put("text", "");*/
|
|
|
jsonObjectList.add(jsonObject);
|
|
|
}
|
|
|
return jsonObjectList;
|
...
|
...
|
|