‘linchangsheng’ 3 hafta önce
ebeveyn
işleme
97490c946e

+ 10 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

@@ -24,6 +24,7 @@ import com.gree.mall.miniapp.utils.RedisUtil;
 import com.gree.mall.miniapp.utils.StringUtil;
 import com.gree.mall.miniapp.utils.ocr.OCRUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.http.client.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -450,12 +451,19 @@ public class WorkerLogic {
             throw new RemoteServiceException("已拥有对应时间的保险");
 
         int month = DateUtil.month(startTime);
+
+        Mailbox mailbox = mailboxService.getById("1");
+        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(new Date(),"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
+
+        if (new Date().after(endTime) && DateUtil.offsetDay(startTime,22).month() != DateUtil.month(startTime)){
+            month = month+1;
+        }
+
         int month2 = DateUtil.month(policy.getEndTime());
         int year = DateUtil.year(startTime);
         int year2 = DateUtil.year(policy.getEndTime());
 
-
-        Integer integer =(year2-year)*12+( month2-month+1);
+        Integer integer =(year2-year)*12+(month2-month+1);
         if (integer > 12 || integer < 1)
             throw new RemoteServiceException("保险配置错误");
 

+ 0 - 7
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java

@@ -605,8 +605,6 @@ public class AgreementLogic {
 
 
 
-        List<MailboxReceive> mailboxReceives = mailboxReceiveService.lambdaQuery().eq(MailboxReceive::getMailboxId, mailbox.getId()).list();
-
 
         //意外保险发送邮件
         List<PolicyOrder> policyOrders = policyOrderService.lambdaQuery()
@@ -1140,11 +1138,6 @@ public class AgreementLogic {
         }
 
 
-
-
-        List<MailboxReceive> mailboxReceives = mailboxReceiveService.lambdaQuery().eq(MailboxReceive::getMailboxId, mailbox.getId()).list();
-
-
         //雇主保险发送邮件
         List<PolicyOrder> policyOrdersEm = policyOrderService.lambdaQuery()
                 .le(PolicyOrder::getCreateTime,endTime)