|
|
@@ -39,21 +39,17 @@ import java.util.stream.Collectors;
|
|
|
@AllArgsConstructor
|
|
|
public class StatisticService {
|
|
|
|
|
|
- private UserRepo userRepo;
|
|
|
- private OrderRepo orderRepo;
|
|
|
- private TokenHistoryRepo tokenHistoryRepo;
|
|
|
- private BalanceRecordRepo balanceRecordRepo;
|
|
|
- private PhotoAssetRepo photoAssetRepo;
|
|
|
- private DomainOrderRepo domainOrderRepo;
|
|
|
- private CollectionService collectionService;
|
|
|
- private NewsRepo newsRepo;
|
|
|
- private MintActivityService mintActivityService;
|
|
|
- private UserService userService;
|
|
|
- private CollectionPrivilegeRepo collectionPrivilegeRepo;
|
|
|
- private RedisTemplate<String, Object> redisTemplate;
|
|
|
- private RocketMQTemplate rocketMQTemplate;
|
|
|
- private GeneralProperties generalProperties;
|
|
|
- private Environment env;
|
|
|
+ private UserRepo userRepo;
|
|
|
+ private OrderRepo orderRepo;
|
|
|
+ private TokenHistoryRepo tokenHistoryRepo;
|
|
|
+ private BalanceRecordRepo balanceRecordRepo;
|
|
|
+ private PhotoAssetRepo photoAssetRepo;
|
|
|
+ private DomainOrderRepo domainOrderRepo;
|
|
|
+ private CollectionService collectionService;
|
|
|
+ private NewsRepo newsRepo;
|
|
|
+ private MintActivityService mintActivityService;
|
|
|
+ private UserService userService;
|
|
|
+ private ShowroomService showroomService;
|
|
|
|
|
|
public Map<String, Object> total(Long userId, Long companyId) {
|
|
|
User user1 = userRepo.findByIdAndDelFalse(userId).orElseThrow(new BusinessException("无用户"));
|
|
|
@@ -492,18 +488,22 @@ public class StatisticService {
|
|
|
map.put("notLike", "星星的孩子,测试");
|
|
|
pageQuery.setQuery(map);
|
|
|
Page<Collection> collections1 = collectionService.all(pageQuery).toPage();
|
|
|
+ //default
|
|
|
globalSearchDTO.setCollections(collections1.getContent());
|
|
|
globalSearchDTO.setCollectionsAll(collections1.getTotalElements() <= 6);
|
|
|
map.put("type", "PICTURE");
|
|
|
Page<Collection> collections2 = collectionService.all(pageQuery).toPage();
|
|
|
+ //picture
|
|
|
globalSearchDTO.setPictures(collections2.getContent());
|
|
|
globalSearchDTO.setPicturesAll(collections2.getTotalElements() <= 6);
|
|
|
map.put("type", "DOMAIN");
|
|
|
Page<Collection> collections3 = collectionService.all(pageQuery).toPage();
|
|
|
+ //domain
|
|
|
globalSearchDTO.setDomains(collections3.getContent());
|
|
|
globalSearchDTO.setDomainsAll(collections3.getTotalElements() <= 6);
|
|
|
PageRequest pageRequest = PageRequest.of(0, 6);
|
|
|
Page<News> news = newsRepo.findByTitleLike("%" + search + "%", pageRequest);
|
|
|
+ //news
|
|
|
globalSearchDTO.setNews(news.getContent());
|
|
|
globalSearchDTO.setNewsAll(news.getTotalElements() <= 6);
|
|
|
Map<String, Object> mintMap = new HashMap<>();
|
|
|
@@ -511,6 +511,7 @@ public class StatisticService {
|
|
|
mintMap.put("del", false);
|
|
|
pageQuery.setQuery(mintMap);
|
|
|
Page<MintActivity> mints = mintActivityService.all(pageQuery);
|
|
|
+ //mint
|
|
|
globalSearchDTO.setMintActivities(mints.getContent());
|
|
|
globalSearchDTO.setMintActivitiesAll(mints.getTotalElements() <= 6);
|
|
|
Map<String, Object> minterMap = new HashMap<>();
|
|
|
@@ -519,14 +520,22 @@ public class StatisticService {
|
|
|
minterMap.put("minter", true);
|
|
|
pageQuery.setQuery(minterMap);
|
|
|
Page<User> minters = userService.all(pageQuery).toPage();
|
|
|
+ //minter
|
|
|
globalSearchDTO.setMinters(minters.getContent());
|
|
|
globalSearchDTO.setMintersAll(minters.getTotalElements() <= 6);
|
|
|
Page<User> userPage = userRepo
|
|
|
.findByNicknameLikeOrIntroLike("%" + search + "%", "%" + search + "%", pageRequest);
|
|
|
- globalSearchDTO.setMinters(userPage.getContent());
|
|
|
- globalSearchDTO.setMintersAll(userPage.getTotalElements() <= 6);
|
|
|
+ //user
|
|
|
+ globalSearchDTO.setUsers(userPage.getContent());
|
|
|
+ globalSearchDTO.setUsersAll(userPage.getTotalElements() <= 6);
|
|
|
+ Map<String, Object> showRoomMap = new HashMap<>();
|
|
|
+ showRoomMap.put("del", false);
|
|
|
+ showRoomMap.put("status", "SUCCESS");
|
|
|
+ pageQuery.setQuery(showRoomMap);
|
|
|
+ Page<Showroom> showrooms = showroomService.all(pageQuery);
|
|
|
+ //showroom
|
|
|
+ globalSearchDTO.setShowrooms(showrooms.getContent());
|
|
|
+ globalSearchDTO.setShowroomAll(showrooms.getTotalElements() <= 6);
|
|
|
return globalSearchDTO;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|