|
@@ -425,7 +425,7 @@ public class WorkerLogic {
|
|
List<WorkerPolicy> workerPolicies = workerPolicyService.lambdaQuery()
|
|
List<WorkerPolicy> workerPolicies = workerPolicyService.lambdaQuery()
|
|
.eq(WorkerPolicy::getWebsitId, websitId)
|
|
.eq(WorkerPolicy::getWebsitId, websitId)
|
|
.eq(WorkerPolicy::getWebsitUserId, websiUser.getId())
|
|
.eq(WorkerPolicy::getWebsitUserId, websiUser.getId())
|
|
- .eq(WorkerPolicy::getPolicyType, "AC")
|
|
|
|
|
|
+ .eq(WorkerPolicy::getPolicyType, policy.getType())
|
|
.orderByDesc(WorkerPolicy::getEndTime)
|
|
.orderByDesc(WorkerPolicy::getEndTime)
|
|
.list();
|
|
.list();
|
|
|
|
|
|
@@ -785,10 +785,23 @@ public class WorkerLogic {
|
|
|
|
|
|
List<AdminWebsit> adminWebsits = new ArrayList<>();
|
|
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()
|
|
Policy policy = policyService.lambdaQuery()
|
|
.eq(Policy::getType, "DS")
|
|
.eq(Policy::getType, "DS")
|
|
|
|
+ .ge(Policy::getEndTime, new Date())
|
|
|
|
+ .in(Policy::getId, policyWebsits.stream()
|
|
|
|
+ .map(PolicyWebsit::getPolicyId).collect(Collectors.toList()))
|
|
.orderByDesc(Policy::getEndTime)
|
|
.orderByDesc(Policy::getEndTime)
|
|
.last("limit 1").one();
|
|
.last("limit 1").one();
|
|
|
|
+
|
|
if (policy == null)
|
|
if (policy == null)
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
for (WebsitUser websitUser : websitUsers) {
|
|
for (WebsitUser websitUser : websitUsers) {
|
|
@@ -805,7 +818,8 @@ public class WorkerLogic {
|
|
.eq(PolicyOrder::getWebsitUserId,websitUser.getId())
|
|
.eq(PolicyOrder::getWebsitUserId,websitUser.getId())
|
|
.count() < 1){
|
|
.count() < 1){
|
|
AdminWebsit adminWebsit = adminWebsitService.getById(websitUser.getWebsitId());
|
|
AdminWebsit adminWebsit = adminWebsitService.getById(websitUser.getWebsitId());
|
|
-
|
|
|
|
|
|
+ if (!adminWebsit.getAttr().equals("SELF"))
|
|
|
|
+ continue;
|
|
adminWebsits.add(adminWebsit);
|
|
adminWebsits.add(adminWebsit);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -828,14 +842,15 @@ public class WorkerLogic {
|
|
return new Page<>();
|
|
return new Page<>();
|
|
|
|
|
|
|
|
|
|
- PolicyOrder policyOrder = policyOrderService
|
|
|
|
|
|
+ List<PolicyOrder> policyOrderList = policyOrderService
|
|
.lambdaQuery()
|
|
.lambdaQuery()
|
|
.eq(PolicyOrder::getType, "DS")
|
|
.eq(PolicyOrder::getType, "DS")
|
|
.isNotNull(PolicyOrder::getEndTime)
|
|
.isNotNull(PolicyOrder::getEndTime)
|
|
.eq(PolicyOrder::getIsPay, IsYesNoEnum.YES.getKey())
|
|
.eq(PolicyOrder::getIsPay, IsYesNoEnum.YES.getKey())
|
|
.eq(PolicyOrder::getWebsitUserId, websitUser.getId())
|
|
.eq(PolicyOrder::getWebsitUserId, websitUser.getId())
|
|
.orderByDesc(PolicyOrder::getEndTime)
|
|
.orderByDesc(PolicyOrder::getEndTime)
|
|
- .last("limit 1").one();
|
|
|
|
|
|
+ .list();
|
|
|
|
+
|
|
|
|
|
|
List<PolicyOrder> policyOrders = policyOrderService
|
|
List<PolicyOrder> policyOrders = policyOrderService
|
|
.lambdaQuery()
|
|
.lambdaQuery()
|
|
@@ -849,12 +864,14 @@ public class WorkerLogic {
|
|
List<String> policyIds = policyOrders.stream().map(PolicyOrder::getPolicyId).collect(Collectors.toList());
|
|
List<String> policyIds = policyOrders.stream().map(PolicyOrder::getPolicyId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
+ boolean notEmpty = CollectionUtil.isNotEmpty(policyOrderList);
|
|
|
|
+
|
|
Page<Policy> page = policyService.lambdaQuery()
|
|
Page<Policy> page = policyService.lambdaQuery()
|
|
- .notIn(policyOrder == null && CollectionUtil.isNotEmpty(policyOrders), Policy::getId, policyIds)
|
|
|
|
- .ge(policyOrder != null, Policy::getEndTime, policyOrder.getEndTime())
|
|
|
|
|
|
+ .notIn(CollectionUtil.isEmpty(policyOrderList) && CollectionUtil.isNotEmpty(policyOrders), Policy::getId, policyIds)
|
|
.eq(Policy::getIsBuy, IsYesNoEnum.YES.getKey())
|
|
.eq(Policy::getIsBuy, IsYesNoEnum.YES.getKey())
|
|
.le(Policy::getPolicyStartTime, new Date())
|
|
.le(Policy::getPolicyStartTime, new Date())
|
|
- .ge(Policy::getEndTime, new Date())
|
|
|
|
|
|
+ .eq(Policy::getType, "DS")
|
|
|
|
+ .ge(Policy::getEndTime, notEmpty?policyOrderList.get(0).getEndTime():new Date())
|
|
.in(Policy::getId, policyWebsits.stream().map(PolicyWebsit::getPolicyId).collect(Collectors.toList()))
|
|
.in(Policy::getId, policyWebsits.stream().map(PolicyWebsit::getPolicyId).collect(Collectors.toList()))
|
|
.orderByAsc(Policy::getEndTime)
|
|
.orderByAsc(Policy::getEndTime)
|
|
.page(new Page<>(pageNum, pageSize));
|
|
.page(new Page<>(pageNum, pageSize));
|