lixiaolong 2 месяцев назад
Родитель
Сommit
d0f16b1e13

+ 15 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -27,6 +27,7 @@ import com.jzg.commons.entity.scheme.vo.*;
 import com.jzg.commons.entity.vo.CompanyClauseVo;
 import com.jzg.commons.entity.vo.EsmInsCompanyResVo;
 import com.jzg.commons.entity.vo.InsCompanyClauseVo;
+import com.jzg.commons.entity.vo.JyxConfigVo;
 import com.jzg.commons.exception.NoneException;
 import com.jzg.commons.exception.ValidateException;
 import com.jzg.commons.util.AssertionUtils;
@@ -149,6 +150,20 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
 
         //驾意险信息
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = ptlSchemeSaveVo.getPtlSchemeInsuranceDrivingIntentionList();
+        //校验驾意险归属:drivingIntentionId 对应的 jyx_config 必须属于当前方案的保险公司
+        if (CollUtil.isNotEmpty(ptlSchemeInsuranceDrivingIntentionList)) {
+            String schemeCompanyId = ptlSchemeSaveVo.getCompanyId();
+            for (PtlSchemeInsuranceDrivingIntention di : ptlSchemeInsuranceDrivingIntentionList) {
+                if (di.getDrivingIntentionId() == null) continue;
+                HttpResult<JyxConfigVo> jyxResult = platformClient.jyxConfigGetById(di.getDrivingIntentionId());
+                if (jyxResult != null && jyxResult.getData() != null) {
+                    JyxConfigVo jyxConfig = jyxResult.getData();
+                    if (!schemeCompanyId.equals(jyxConfig.getCompany())) {
+                        throw new ValidateException("驾意险[" + jyxConfig.getProductName() + "]属于公司[" + jyxConfig.getCompanyName() + "],与当前方案的公司不一致,请检查");
+                    }
+                }
+            }
+        }
         //校验驾意险座位数范围不可重复
         validateDrivingIntentionSeatRange(ptlSchemeInsuranceDrivingIntentionList);
         //清空驾意险信息