‘linchangsheng’ 6 天之前
父節點
當前提交
4c57c2ba60
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

+ 12 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

@@ -785,11 +785,23 @@ public class WorkerLogic {
 
         List<AdminWebsit> adminWebsits = new ArrayList<>();
 
+        List<String> collect = websitUsers.stream()
+                .map(WebsitUser::getWebsitId).collect(Collectors.toList());
+
+        List<PolicyWebsit> policyWebsits = policyWebsitService.lambdaQuery().in(PolicyWebsit::getWebsitId,collect ).list();
+
+        if (CollectionUtils.isEmpty(policyWebsits))
+            return new ArrayList<>();
+
+
         Policy policy = policyService.lambdaQuery()
                 .eq(Policy::getType, "DS")
                 .ge(Policy::getEndTime, new Date())
+                .in(Policy::getId,  policyWebsits.stream()
+                        .map(PolicyWebsit::getPolicyId).collect(Collectors.toList()))
                 .orderByDesc(Policy::getEndTime)
                 .last("limit 1").one();
+
         if (policy == null)
             return new ArrayList<>();
         for (WebsitUser websitUser : websitUsers) {