|
|
@@ -10,6 +10,7 @@ import com.izouma.nineth.domain.*;
|
|
|
import com.izouma.nineth.domain.Collection;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.dto.excel.GlobalSearchDTO;
|
|
|
+import com.izouma.nineth.dto.nftdomain.CollectionDTO;
|
|
|
import com.izouma.nineth.enums.BalanceType;
|
|
|
import com.izouma.nineth.enums.CollectionSource;
|
|
|
import com.izouma.nineth.enums.OrderStatus;
|
|
|
@@ -20,6 +21,7 @@ import com.izouma.nineth.utils.netease.CheckSumBuilder;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.RandomStringUtils;
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
@@ -475,8 +477,8 @@ public class StatisticService {
|
|
|
return today;
|
|
|
}
|
|
|
|
|
|
- @Cacheable(value = "globalSearch", key = "#search")
|
|
|
- public GlobalSearchDTO otherSearch(String search) {
|
|
|
+ @Cacheable(value = "globalSearchV2", key = "#search")
|
|
|
+ public CollectionDTO otherSearch(String search) {
|
|
|
PageQuery pageQuery = new PageQuery();
|
|
|
pageQuery.setPage(0);
|
|
|
pageQuery.setSize(6);
|
|
|
@@ -488,20 +490,12 @@ public class StatisticService {
|
|
|
map.put("del", false);
|
|
|
map.put("notLike", "星星的孩子,测试");
|
|
|
pageQuery.setQuery(map);
|
|
|
- GlobalSearchDTO globalSearchDTO = new GlobalSearchDTO();
|
|
|
+ CollectionDTO globalSearchDTO = new CollectionDTO();
|
|
|
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<>();
|
|
|
- mintMap.put("companyId", 1);
|
|
|
- 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<>();
|
|
|
minterMap.put("companyId", 1);
|
|
|
minterMap.put("del", false);
|
|
|
@@ -527,8 +521,9 @@ public class StatisticService {
|
|
|
return globalSearchDTO;
|
|
|
}
|
|
|
|
|
|
- public GlobalSearchDTO globalSearch(String search) {
|
|
|
- GlobalSearchDTO globalSearchDTO = otherSearch(search);
|
|
|
+ public GlobalSearchDTO globalSearch(String search, CollectionDTO dto) {
|
|
|
+ GlobalSearchDTO globalSearchDTO = new GlobalSearchDTO();
|
|
|
+ BeanUtils.copyProperties(dto, globalSearchDTO);
|
|
|
PageQuery pageQuery = new PageQuery();
|
|
|
pageQuery.setPage(0);
|
|
|
pageQuery.setSize(6);
|
|
|
@@ -554,6 +549,14 @@ public class StatisticService {
|
|
|
//domain
|
|
|
globalSearchDTO.setDomains(collections3.getContent());
|
|
|
globalSearchDTO.setDomainsAll(collections3.getTotalElements() <= 6);
|
|
|
+ Map<String, Object> mintMap = new HashMap<>();
|
|
|
+ mintMap.put("companyId", 1);
|
|
|
+ mintMap.put("del", false);
|
|
|
+ pageQuery.setQuery(mintMap);
|
|
|
+ Page<MintActivity> mints = mintActivityService.all(pageQuery);
|
|
|
+ //mint
|
|
|
+ globalSearchDTO.setMintActivities(mints.getContent());
|
|
|
+ globalSearchDTO.setMintActivitiesAll(mints.getTotalElements() <= 6);
|
|
|
return globalSearchDTO;
|
|
|
}
|
|
|
}
|