Explorar el Código

诚泰驾意险bug修复

dongxin hace 1 año
padre
commit
a52430ff4a

+ 11 - 7
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -235,14 +235,18 @@ public class QuoteController extends BaseController {
                 JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(quoteVo.getAccidentalDrivingVo()));
                 javaObject = jsonObject.toJavaObject(InsDrivingIntentionInsurance.class);
                 BeanUtils.copyProperties(quoteVo,quoteVo1);
-                LambdaQueryWrapper<InsDrivingIntentionInsurance> wrapper = new LambdaQueryWrapper<>();
-                wrapper.eq(InsDrivingIntentionInsurance::getProjectCode,javaObject.getProjectCode());
-                InsDrivingIntentionInsurance insDrivingIntentionInsurance = insDrivingIntentionInsuranceService.getOne(wrapper);
-                if (StringUtils.isNotBlank(insDrivingIntentionInsurance.getRelateCode())){
-                    javaObject.setProjectCode(insDrivingIntentionInsurance.getRelateCode());
-                    quoteVo1.setAccidentalDrivingVo(javaObject);
+                if(StringUtils.isNotBlank(javaObject.getProjectCode())){
+                    LambdaQueryWrapper<InsDrivingIntentionInsurance> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(InsDrivingIntentionInsurance::getProjectCode,javaObject.getProjectCode());
+                    InsDrivingIntentionInsurance insDrivingIntentionInsurance = insDrivingIntentionInsuranceService.getOne(wrapper);
+                    if (StringUtils.isNotBlank(insDrivingIntentionInsurance.getRelateCode())){
+                        javaObject.setProjectCode(insDrivingIntentionInsurance.getRelateCode());
+                        quoteVo1.setAccidentalDrivingVo(javaObject);
+                    }else{
+                        throw new SystemException("驾意险失效,请检查方案配置");
+                    }
                 }else{
-                    throw new SystemException("驾意险失效,请检查方案配置");
+                    quoteVo1.setAccidentalDrivingVo(javaObject);
                 }
             }
             respVo = chengTaiOrderApiService.quoteApi(quoteInfo, quoteVo1);

+ 7 - 4
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java

@@ -77,11 +77,14 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
             this.biContract = biContract;
         }
         // 意外险
-        InsDrivingIntentionInsurance ctQuoteAccidentVo = quoteVo.getAccidentalDrivingVo();
-        if(StringUtils.isNotBlank(ctQuoteAccidentVo.getProjectCode())){
-            AccContractDTO accContract = new AccContractDTO(quoteVo);
-            this.accContract = accContract;
+        if(!Objects.isNull(quoteVo.getAccidentalDrivingVo())){
+            InsDrivingIntentionInsurance ctQuoteAccidentVo = quoteVo.getAccidentalDrivingVo();
+            if(StringUtils.isNotBlank(ctQuoteAccidentVo.getProjectCode())){
+                AccContractDTO accContract = new AccContractDTO(quoteVo);
+                this.accContract = accContract;
+            }
         }
+
         this.handlerCode = parameters.getUserId();
 
     }