‘linchangsheng’ hai 5 días
pai
achega
ae3452d1f0

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

@@ -788,7 +788,18 @@ public class WorkerLogic {
         List<String> collect = websitUsers.stream()
                 .map(WebsitUser::getWebsitId).collect(Collectors.toList());
 
-        List<PolicyWebsit> policyWebsits = policyWebsitService.lambdaQuery().in(PolicyWebsit::getWebsitId,collect ).list();
+        List<Policy> policies = policyService.lambdaQuery().eq(Policy::getType, "DS")
+                .ge(Policy::getEndTime, new Date())
+                .list();
+
+        if (CollectionUtils.isEmpty(policies))
+            return new ArrayList<>();
+
+        List<PolicyWebsit> policyWebsits = policyWebsitService.lambdaQuery()
+                .in(PolicyWebsit::getWebsitId,collect )
+                .in(PolicyWebsit::getPolicyId,policies.stream()
+                        .map(Policy::getId).collect(Collectors.toList()) )
+                .list();
 
         if (CollectionUtils.isEmpty(policyWebsits))
             return new ArrayList<>();