‘linchangsheng’ 1 月之前
父节点
当前提交
90342e942b

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/comlist/WorkerComListLogic.java

@@ -194,7 +194,7 @@ public class WorkerComListLogic {
         }
         WorkerComList workerComList = workerComListService.getById(id);
 
-        if (adminUser.getType() == 1 || adminUser.getNickName().equals(workerComList.getCreateBy())) {
+        if (adminUser.getType() == 1 || workerComList.getCreateBy().contains(adminUser.getNickName())) {
             log.info("【中心文件下发下载】:{}", JSONObject.toJSONString(adminUser));
             CommonUtils.downloadFile(workerComList.getFileUrl(),workerComList.getTitle()+".xlsx" , response);
         } else {

+ 28 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/es/EsLogic.java

@@ -7,6 +7,7 @@ import com.gree.mall.manager.utils.CommonUtils;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
 import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
 import org.springframework.data.elasticsearch.core.SearchHit;
 import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
@@ -93,12 +94,38 @@ public class EsLogic {
             must.must(QueryBuilders.termsQuery("websitNumber.keyword",websitNumbers));
         }
         NativeSearchQuery titleBuild = new NativeSearchQueryBuilder().withQuery(titleQueryBuilder).build();
-        NativeSearchQuery dataBuild = new NativeSearchQueryBuilder().withQuery(must).build();
+        NativeSearchQuery dataBuild = new NativeSearchQueryBuilder()
+                .withQuery(must)
+                .withPageable(PageRequest.of(0, 10000))
+                .build();
+
+        NativeSearchQuery dataBuild2 = new NativeSearchQueryBuilder()
+                .withQuery(must)
+                .withPageable(PageRequest.of(1, 10000))
+                .build();
+        NativeSearchQuery dataBuild3 = new NativeSearchQueryBuilder()
+                .withQuery(must)
+                .withPageable(PageRequest.of(2, 10000))
+                .build();
 
         List<SearchHit<CommonListES>> searchHits1 = elasticsearchRestTemplate.search(titleBuild, CommonListES.class).getSearchHits();
         List<SearchHit<CommonListES>> searchHits2 = elasticsearchRestTemplate.search(dataBuild, CommonListES.class).getSearchHits();
+
+
         List<CommonListES> titles = searchHits1.stream().map(SearchHit<CommonListES>::getContent).collect(Collectors.toList());
         List<CommonListES> datas = searchHits2.stream().map(SearchHit<CommonListES>::getContent).collect(Collectors.toList());
+
+
+        if (datas.size() == 10000) {
+            List<SearchHit<CommonListES>> searchHits3 = elasticsearchRestTemplate.search(dataBuild2, CommonListES.class).getSearchHits();
+            datas.addAll(searchHits3.stream().map(SearchHit<CommonListES>::getContent).collect(Collectors.toList()));
+        }
+
+        if (datas.size() == 20000) {
+            List<SearchHit<CommonListES>> searchHits4 = elasticsearchRestTemplate.search(dataBuild3, CommonListES.class).getSearchHits();
+            datas.addAll(searchHits4.stream().map(SearchHit<CommonListES>::getContent).collect(Collectors.toList()));
+        }
+
         titles.addAll(datas);
 
         return titles;