9 Commits 2301539efc ... 4c57c2ba60

Autor SHA1 Mensaje Fecha
  ‘linchangsheng’ 4c57c2ba60 需求 hace 1 semana
  ‘linchangsheng’ 21c5794a88 需求 hace 1 semana
  ‘linchangsheng’ eaa4fcd1f4 需求 hace 1 semana
  ‘linchangsheng’ cb25ed4ec4 需求 hace 1 semana
  ‘linchangsheng’ cdcefe3e2a 需求 hace 1 semana
  ‘linchangsheng’ 86a5d410d7 需求 hace 1 semana
  ‘linchangsheng’ 22b944ea95 需求 hace 1 semana
  ‘linchangsheng’ 188159f6fe 需求 hace 1 semana
  ‘linchangsheng’ 0c6473dabf 需求 hace 1 semana

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/common/CommonLogic.java

@@ -88,7 +88,7 @@ public class CommonLogic {
             token = request.getParameter("x-token");
         }
 
-    //    log.info("打印token:"+token);
+        log.info("打印token:"+token);
         AdminCompanyWechat adminCompanyWechat;
         User user = null;
 

+ 24 - 7
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

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