Forráskód Böngészése

1.修改专场合作申请查询 过滤

lengfaqiang 2 éve
szülő
commit
c54a3f6b2b

+ 11 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -1172,8 +1172,18 @@ public class KwsEnterpriseService {
                 return Collections.emptyList();
             }
             kwsEnterprises = kwsEnterprises.stream().filter(item -> !entIds.contains(item.getId())).collect(Collectors.toList());
+        } else {
+            //求交集数据
+            List<Long> entIds = remoteSystemService.queryEntIdsByCode(accessSpecial, null);
+            List<Long> longList = kwsEnterprises.stream().map(KwsEnterprise::getId).distinct().collect(Collectors.toList());
+            List<Long> intersection = longList.stream()
+                    .filter(entIds::contains)
+                    .collect(Collectors.toList());
+            kwsEnterprises = kwsEnterpriseDao.selectByKeys(intersection);
+        }
+        if (kwsEnterprises.size() < 1) {
+            return Collections.emptyList();
         }
-
         //过滤除了当前企业的其他企业
         kwsEnterprises = kwsEnterprises.stream().filter(item -> !item.getId().equals(entId)).toList();
         if (CollectionUtils.isEmpty(kwsEnterprises)) {