|
@@ -170,22 +170,22 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|
|
}
|
|
|
@Override
|
|
|
public List<CategoryDTO> getRootCategories(CategoryListParam param){
|
|
|
- Long userId = SessionContextHolder.getId();
|
|
|
- Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
|
|
|
- if (scope == Scope.ADMIN) {
|
|
|
- param.setType("0");
|
|
|
- }else {
|
|
|
- List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
|
|
|
- if (ObjectUtils.isEmpty(merchants)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- param.setMerchantId(merchants.get(0));
|
|
|
- param.setType("1");
|
|
|
- }
|
|
|
+// Long userId = SessionContextHolder.getId();
|
|
|
+// Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
|
|
|
+// if (scope == Scope.ADMIN) {
|
|
|
+// param.setType("0");
|
|
|
+// }else {
|
|
|
+// List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
|
|
|
+// if (ObjectUtils.isEmpty(merchants)) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// param.setMerchantId(merchants.get(0));
|
|
|
+// param.setType("1");
|
|
|
+// }
|
|
|
List<Category> categories = this.lambdaQuery()
|
|
|
.eq(Category::getEnabled, true)
|
|
|
- .eq(StringUtils.notEmpty(param.getType()),Category::getType,param.getType())
|
|
|
- .eq(StringUtils.notEmpty(param.getMerchantId()),Category::getMerchantId,param.getMerchantId())
|
|
|
+// .eq(StringUtils.notEmpty(param.getType()),Category::getType,param.getType())
|
|
|
+// .eq(StringUtils.notEmpty(param.getMerchantId()),Category::getMerchantId,param.getMerchantId())
|
|
|
.orderByAsc(Category::getSort).list();
|
|
|
categories.sort(Comparator.comparing(Category::getType).thenComparing(Category::getSort));
|
|
|
return CategoryCopier.INSTANCE.copying(categories);
|