‘linchangsheng’ 2 周之前
父節點
當前提交
4d8cd1d538

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

@@ -290,12 +290,14 @@ public class WorkerLogic {
 
         PolicyOrderDetail policyOrderDetail = BeanUtil.toBean(policyOrder, PolicyOrderDetail.class);
 
-        Policy policy = policyService.getById(policyOrderDetail.getPolicyId());
 
+        Policy policy = policyService.getById(policyOrderDetail.getPolicyId());
 
-        List<PolicyRange> policyRanges = policyRangeService.lambdaQuery().eq(PolicyRange::getPolicyId, policy.getId()).list();
+        if (policy == null){
+            List<PolicyRange> policyRanges = policyRangeService.lambdaQuery().eq(PolicyRange::getPolicyId, policy.getId()).list();
         policyOrderDetail.setPolicy(policy);
         policyOrderDetail.setPolicyRanges(policyRanges);
+        }
 
         List<AgreementPolicy> agreementPolicies = agreementPolicyService.lambdaQuery().eq(AgreementPolicy::getPolicyId, policy.getId()).list();