|
@@ -377,11 +377,14 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
@Override
|
|
|
public List<AppCategory> getAllCategory(String id) {
|
|
|
List<AppCategory> appCategories = new ArrayList<>();
|
|
|
- List<Object> objects = appSitePlaceMapper.selectObjs(Wrappers.<AppSitePlace>lambdaQuery()
|
|
|
- .select(AppSitePlace::getCategoryId)
|
|
|
- .eq(AppSitePlace::getSiteId, id)
|
|
|
- .groupBy(AppSitePlace::getCategoryId));
|
|
|
- if(null == objects || objects.isEmpty()) return appCategories;
|
|
|
+ List<AppSitePlace> appSitePlaceList = appSitePlaceMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery()
|
|
|
+ .eq(AppSitePlace::getSiteId, id));
|
|
|
+ List<String> objects = appSitePlaceList.stream().map(AppSitePlace::getCategoryId).collect(Collectors.toList());
|
|
|
+ AppSite appSite = appSiteMapper.selectById(id);
|
|
|
+ if(null != appSite && appSite.getType() == 0){
|
|
|
+ objects = Arrays.asList(appSite.getCategoryId().split(","));
|
|
|
+ }
|
|
|
+ if(objects.isEmpty()) return appCategories;
|
|
|
appCategories = appCategoryMapper.selectList(Wrappers.<AppCategory>lambdaQuery()
|
|
|
.eq(AppCategory::getStatus, 0).in(AppCategory::getId,objects)
|
|
|
.eq(AppCategory::getDelFlag, 0));
|