Jelajahi Sumber

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 7 bulan lalu
induk
melakukan
b3b49063a7

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

@@ -270,6 +270,9 @@ public class WorkerLogic {
                 .eq(WebsitUser::getUserId, currentCompanyWechat.getUserId())
                 .eq(WebsitUser::getWebsitId, websitId).one();
 
+        if (websiUser == null)
+            throw new RemoteServiceException("没有入驻信息");
+
 
         AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
 

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -1319,7 +1319,7 @@ public class UserLogic {
             workerImgService.saveBatch(workerImgs);
         }
 
-        if (userApplyBean.getWorkerPolicy()!= null && userApplyBean.getStartTime() != null) {
+        if (userApplyBean.getWorkerPolicy()!= null && userApplyBean.getWorkerPolicy().getStartTime() != null) {
             userApplyBean.getWorkerPolicy().insert();
         }
     }

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyOrderInVO.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.gree.mall.manager.annotation.ZfireField;
 import com.gree.mall.manager.enums.IsYesNoEnum;
+import com.gree.mall.manager.enums.PolicyOrderInStutasEnum;
 import com.gree.mall.manager.plus.entity.PolicyOrder;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -60,7 +61,7 @@ public class PolicyOrderInVO    {
     private String payAmount;
 
     @ApiModelProperty(value = "保单状态")
-    private String policyOrderStatus;
+    private PolicyOrderInStutasEnum policyOrderStatus;
 
 
 

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

@@ -740,13 +740,14 @@ public class AgreementLogic {
     }
 
     public void offInsure() {
+
         workerPolicyService.lambdaUpdate()
                 .le(WorkerPolicy::getEndTime,new Date())
-                .eq(WorkerPolicy::getStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
+                .set(WorkerPolicy::getStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
 
         policyOrderService.lambdaUpdate()
                 .le(PolicyOrder::getEndTime,new Date())
-                .eq(PolicyOrder::getPolicyOrderStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
+                .set(PolicyOrder::getPolicyOrderStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
 
 
         workerPolicyService.lambdaUpdate()
@@ -770,7 +771,8 @@ public class AgreementLogic {
         List<WebsitUser> websitUsers = websitUserService.lambdaQuery().eq(WebsitUser::getExamineStatus, "WAIT_WORKER").list();
 
         for (WebsitUser websitUser : websitUsers) {
-            if (workerPolicyService.lambdaQuery().in(WorkerPolicy::getStatus,"BZZ","DSX").count() > 2) {
+            if (workerPolicyService.lambdaQuery().in(WorkerPolicy::getStatus,"BZZ","DSX")
+                    .eq(WorkerPolicy::getWebsitUserId,websitUser.getId()).count() > 1) {
                 websitUser.setExamineStatus("POLICY_WAIT");
                 websitUser.updateById();
             }

+ 21 - 15
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/PolicyOrderLogic.java

@@ -94,7 +94,7 @@ public class PolicyOrderLogic {
                     .eq(PolicyOrder::getWebsitId, (String) row.get(1))
                     .eq(PolicyOrder::getWorkerNumber, (String) row.get(3))
                     .eq(PolicyOrder::getType, "IN")
-                    .eq(PolicyOrder::getPolicyOrderStatus, "DSX").one();
+                    .eq(PolicyOrder::getPolicyOrderStatus, "DGM").one();
 
 
             if (policyOrder != null){
@@ -106,14 +106,14 @@ public class PolicyOrderLogic {
                 workerPolicy.setCompany(policyOrder.getBelongCompany());
                 workerPolicy.setPolicyOrder(policyOrder.getPolicyNumber());
                 workerPolicy.setPolicyType("IN");
-                workerPolicy.setStartTime(policyOrder.getStartTime());
-                workerPolicy.setEndTime(policyOrder.getEndTime());
+                workerPolicy.setStartTime(DateUtil.parse((String) row.get(9),"yyyy-MM-dd"));
+                workerPolicy.setEndTime(DateUtil.endOfDay(DateUtil.parse((String) row.get(10),"yyyy-MM-dd")));
                 workerPolicy.setWebsitUserId(policyOrder.getId());
                 workerPolicy.setWebsitId(policyOrder.getWebsitId());
                 workerPolicy.setWebsitName(policyOrder.getWebsitName());
                 workerPolicy.setWorkerName(policyOrder.getWorkerName());
 
-                if (new Date().after(policyOrder.getStartTime()) && new Date().before(policyOrder.getEndTime()))
+                if (new Date().after(workerPolicy.getStartTime()) && new Date().before(workerPolicy.getEndTime()))
                     workerPolicy.setStatus("BZZ");
                 else if (new Date().after(policyOrder.getEndTime()))
                     workerPolicy.setStatus("YSX");
@@ -123,17 +123,23 @@ public class PolicyOrderLogic {
                 workerPolicy.insert();
             }
 
-            policyOrderService.lambdaUpdate()
-                    .eq(PolicyOrder::getWebsitId,(String) row.get(1))
-                    .eq(PolicyOrder::getWorkerNumber,(String) row.get(3))
-                    .eq(PolicyOrder::getType,"IN")
-                    .eq(PolicyOrder::getPolicyOrderStatus,"DSX")
-                    .set(PolicyOrder::getStartTime, DateUtil.parse((String) row.get(9),"yyyy-MM-dd"))
-                    .set(PolicyOrder::getEndTime,DateUtil.endOfDay(DateUtil.parse((String) row.get(10),"yyyy-MM-dd")))
-                    .set(PolicyOrder::getClassWebsitId,(String) row.get(11))
-                    .set(PolicyOrder::getClassWebsitName,(String) row.get(12))
-                    .set(DateUtil.parse((String) row.get(9),"yyyy-MM-dd").after(new Date()),PolicyOrder::getPolicyOrderStatus,"BZZ")
-                    .update();
+            policyOrder.setStartTime(DateUtil.parse((String) row.get(9),"yyyy-MM-dd"));
+            policyOrder.setEndTime(DateUtil.endOfDay(DateUtil.parse((String) row.get(10),"yyyy-MM-dd")));
+            policyOrder.setClassWebsitId((String) row.get(11));
+            policyOrder.setClassWebsitId((String) row.get(12));
+
+
+            if (new Date().after(policyOrder.getStartTime()) && new Date().before(policyOrder.getEndTime()))
+                policyOrder.setPolicyOrderStatus("BZZ");
+            else if (new Date().after(policyOrder.getEndTime()))
+                policyOrder.setPolicyOrderStatus("YSX");
+            else {
+                policyOrder.setPolicyOrderStatus("DSX");
+            }
+
+            policyOrder.updateById();
+
+
 
         }
     }

+ 22 - 22
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/WorkerManagerLogic.java

@@ -226,12 +226,12 @@ public class WorkerManagerLogic {
 
             for (WorkerPolicy workerPolicy : workerManagerBean.getWorkerPolicies()) {
                 if (workerPolicy.getEndTime().after(new Date()) && workerPolicy.getStartTime().before(new Date())) {
-                    workerPolicy.setStatus("ON");
+                    workerPolicy.setStatus("BZZ");
                 } else {
-                    workerPolicy.setStatus("WAIT_ON");
+                    workerPolicy.setStatus("DSX");
                 }
                 if (workerPolicy.getEndTime().before(new Date())) {
-                    workerPolicy.setStatus("OFF");
+                    workerPolicy.setStatus("YSX");
                 }
             }
         }
@@ -245,7 +245,7 @@ public class WorkerManagerLogic {
                 throw new RemoteServiceException("请填工程师意外险");
 
 
-            if (workerPolicies.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+            if (workerPolicies.stream().filter(item -> item.getStatus().equals("BZZ")).count() > 0) {
                 throw new RemoteServiceException("意外险必须有生效的保险");
             }
 
@@ -265,7 +265,7 @@ public class WorkerManagerLogic {
                     throw new RemoteServiceException("工伤险有相同覆盖范围内的保险");
 
 
-                if (workerPoliciesIn.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+                if (workerPoliciesIn.stream().filter(item -> item.getStatus().equals("BZZ")).count() > 0) {
                     throw new RemoteServiceException("工伤险必须有生效的保险");
                 }
 
@@ -279,7 +279,7 @@ public class WorkerManagerLogic {
                     throw new RemoteServiceException("雇主险有相同覆盖范围内的保险");
 
 
-                if (workerPoliciesEm.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+                if (workerPoliciesEm.stream().filter(item -> item.getStatus().equals("BZZ")).count() > 0) {
                     throw new RemoteServiceException("雇主险必须有生效的保险");
                 }
             }
@@ -292,7 +292,7 @@ public class WorkerManagerLogic {
             if (wp)
                 throw new RemoteServiceException("意外险有相同覆盖范围内的保险");
 
-            if (workerPolicies.stream().filter(item -> item.getStatus().equals("ON")).count() < 1)
+            if (workerPolicies.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1)
                 workerManagerBean.setExamineStatus(ExamineWorkerStatusEnum.WAIT_WORKER.getKey());
 
 
@@ -305,7 +305,7 @@ public class WorkerManagerLogic {
                 if (in)
                     throw new RemoteServiceException("工伤险有相同覆盖范围内的保险");
 
-                if (workerPoliciesIn.stream().filter(item -> item.getStatus().equals("ON")).count() < 1) {
+                if (workerPoliciesIn.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1) {
                     workerManagerBean.setExamineStatus(ExamineWorkerStatusEnum.WAIT_WORKER.getKey());
                     this.scGongShang(workerManagerBean);
                 }
@@ -320,7 +320,7 @@ public class WorkerManagerLogic {
                 if (em)
                     throw new RemoteServiceException("雇主险有相同覆盖范围内的保险");
 
-                if (workerPoliciesEm.stream().filter(item -> item.getStatus().equals("ON")).count() < 1) {
+                if (workerPoliciesEm.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1) {
                     workerManagerBean.setExamineStatus(ExamineWorkerStatusEnum.WAIT_WORKER.getKey());
                     this.scGuZhu(workerManagerBean);
                 }
@@ -357,7 +357,7 @@ public class WorkerManagerLogic {
             workerPolicyService.lambdaUpdate()
                     .eq(WorkerPolicy::getOrderId,policyOrders.get(0).getId())
                     .eq(WorkerPolicy::getWebsitUserId,workerManagerBean.getId())
-                    .set(WorkerPolicy::getStatus, "OFF")
+                    .set(WorkerPolicy::getStatus, "YSX")
                     .set(WorkerPolicy::getEndTime,new Date()).update();
 
             PolicyOrder policyOrder = policyOrders.get(0);
@@ -492,15 +492,15 @@ public class WorkerManagerLogic {
 
         for (WorkerPolicy workerPolicy : workerPolicies) {
             if (workerPolicy.getEndTime().after(new Date()) && workerPolicy.getStartTime().before(new Date())) {
-                workerPolicy.setStatus("ON");
+                workerPolicy.setStatus("BZZ");
             }else {
-                workerPolicy.setStatus("WAIT_ON");
+                workerPolicy.setStatus("DSX");
             }
             if (workerPolicy.getEndTime().before(new Date())) {
-                workerPolicy.setStatus("OFF");
+                workerPolicy.setStatus("YSX");
             }
         }
-        if (workerPolicies.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+        if (workerPolicies.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1) {
             throw new RemoteServiceException("意外险必须有生效的保险");
         }
 
@@ -522,16 +522,16 @@ public class WorkerManagerLogic {
 
             for (WorkerPolicy workerPolicy : workerPoliciesIn) {
                 if (workerPolicy.getEndTime().after(new Date()) && workerPolicy.getStartTime().before(new Date())) {
-                    workerPolicy.setStatus("ON");
+                    workerPolicy.setStatus("BZZ");
                 }else {
-                    workerPolicy.setStatus("WAIT_ON");
+                    workerPolicy.setStatus("DSX");
                 }
                 if (workerPolicy.getEndTime().before(new Date())) {
-                    workerPolicy.setStatus("OFF");
+                    workerPolicy.setStatus("YSX");
                 }
             }
 
-            if (workerPolicies.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+            if (workerPolicies.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1) {
                 throw new RemoteServiceException("工伤险必须有生效的保险");
             }
 
@@ -547,16 +547,16 @@ public class WorkerManagerLogic {
 
             for (WorkerPolicy workerPolicy : workerPoliciesEm) {
                 if (workerPolicy.getEndTime().after(new Date()) && workerPolicy.getStartTime().before(new Date())) {
-                    workerPolicy.setStatus("ON");
+                    workerPolicy.setStatus("BZZ");
                 }else {
-                    workerPolicy.setStatus("WAIT_ON");
+                    workerPolicy.setStatus("DSX");
                 }
                 if (workerPolicy.getEndTime().before(new Date())) {
-                    workerPolicy.setStatus("OFF");
+                    workerPolicy.setStatus("YSX");
                 }
             }
 
-            if (workerPolicies.stream().filter(item -> item.getStatus().equals("ON")).count() > 0) {
+            if (workerPolicies.stream().filter(item -> item.getStatus().equals("BZZ")).count() < 1) {
                 throw new RemoteServiceException("雇主险必须有生效的保险");
             }
         }

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/schedule/InsureEmailSchedule.java

@@ -15,7 +15,7 @@ import java.io.IOException;
  * 定时购买保险
  */
 @ConditionalOnProperty(name = "schedule.enable", havingValue = "true", matchIfMissing = true)
-//@Component
+@Component
 public class InsureEmailSchedule {
 
 
@@ -46,7 +46,7 @@ public class InsureEmailSchedule {
 
 
     //检查保险是否全部买齐转为保险待审批
-    @Scheduled(fixedDelay = 60* 1000)
+    @Scheduled(fixedDelay = 30* 1000)
     public void task4(){
         agreementLogic.task4();
     }