dongxin 1 рік тому
батько
коміт
a320351670

+ 10 - 8
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -234,14 +234,16 @@ public class QuoteController extends BaseController {
             if(!Objects.isNull(quoteVo.getAccidentalDrivingVo())) {
                 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);
+                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);
+                }else{
+                    throw new SystemException("驾意险失效,请检查方案配置");
+                }
             }
             respVo = chengTaiOrderApiService.quoteApi(quoteInfo, quoteVo1);
         }