|
|
@@ -22,6 +22,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@@ -82,6 +83,16 @@ public class CollectionController extends BaseController {
|
|
|
public Page<Collection> all(@RequestBody PageQuery pageQuery) {
|
|
|
pageQuery.getQuery().putIfAbsent("companyId", 1);
|
|
|
Page<Collection> page = collectionService.all(pageQuery).toPage();
|
|
|
+ if (pageQuery.getQuery().get("distinctPrefix") != null) {
|
|
|
+ List<Collection> newContent = new ArrayList<>();
|
|
|
+ page.getContent().forEach(collection -> {
|
|
|
+ String count = collectionService.countNum(collection.getPrefixName());
|
|
|
+ collection.setTransferringCount(Long.valueOf(count));
|
|
|
+ newContent.add(collection);
|
|
|
+ });
|
|
|
+ collectionService.queryUserDetail(page.getContent());
|
|
|
+ return new PageImpl<>(newContent, page.getPageable(), page.getTotalElements());
|
|
|
+ }
|
|
|
collectionService.queryUserDetail(page.getContent());
|
|
|
return page;
|
|
|
}
|
|
|
@@ -248,5 +259,6 @@ public class CollectionController extends BaseController {
|
|
|
map.put("tranferingNum", String.valueOf(tranferCount - 1));
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|