فهرست منبع

诚泰驾意功能提交

dongxin 1 سال پیش
والد
کامیت
5b65959c3b

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

@@ -2,6 +2,7 @@ package com.ydtech.modules.order.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
@@ -30,6 +31,7 @@ import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.service.PtlTaxSourceNewService;
 import com.ydtech.modules.protocol.service.impl.TaxSourceExcludeServiceImpl;
+import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -109,6 +111,8 @@ public class QuoteController extends BaseController {
 
     @Autowired
     PtlAgreementService ptlAgreementService;
+    @Autowired
+    InsDrivingIntentionInsuranceService insDrivingIntentionInsuranceService;
 
     @QuoteVerification("报价授权")
     @PostMapping(value = "/quote")
@@ -232,7 +236,13 @@ public class QuoteController extends BaseController {
                 javaObject = jsonObject.toJavaObject(InsDrivingIntentionInsurance.class);
             }
             BeanUtils.copyProperties(quoteVo,quoteVo1);
-            quoteVo1.setAccidentalDrivingVo(javaObject);
+            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);
+            }
             respVo = chengTaiOrderApiService.quoteApi(quoteInfo, quoteVo1);
         }
         if ("YGBX1000000".equals(ptlAgreementAttribution.getInsCompanyId()) && Objects.isNull(respVo)) {

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/InsDrivingIntentionInsurance.java

@@ -95,6 +95,9 @@ public class InsDrivingIntentionInsurance implements Serializable {
     @TableField(value = "request_data")
     private String requestData;
 
+    @TableField(value = "relate_code")
+    private String relateCode;
+
     /**
      * 份数
      */

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

@@ -132,25 +132,9 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
 
             public ContractMainDTO(BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo){
                 InsDrivingIntentionInsurance ctQuoteAccidentVo = quoteVo.getAccidentalDrivingVo();
-                this.riskCode = ctQuoteAccidentVo.getRiskCode();
+                this.riskCode = "ct_1116";
                 this.renewalFlag = "0";
                 this.insPlan = ctQuoteAccidentVo.getProjectCode();
-                List<RiskInfoVo> riskList = quoteVo.getRisks();
-                if (CollUtil.isNotEmpty(riskList)){
-                    for (RiskInfoVo riskInfoVo : riskList) {
-                        if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())){
-                            this.validAtOnce = StringUtils.isBlank(riskInfoVo.getInstantFlag())
-                                    || "0".equals(riskInfoVo.getInstantFlag()) ? "0" : "1"; // 及时起保
-                            this.validDate =riskInfoVo.getStartDate();
-                            this.expiryDate = riskInfoVo.getEndDate();
-                        }else if(InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())){
-                            this.validAtOnce = StringUtils.isBlank(riskInfoVo.getInstantFlag())
-                                    || "0".equals(riskInfoVo.getInstantFlag()) ? "0" : "1"; // 及时起保
-                            this.validDate =riskInfoVo.getStartDate();
-                            this.expiryDate = riskInfoVo.getEndDate();
-                        }
-                    }
-                }
             }
         }
 
@@ -171,20 +155,31 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
             private String shortRate;
 
             public static List<CoverageDTO> toCoverageList(InsDrivingIntentionInsurance ctQuoteAccidentVo) {
-                List<InsDrivingIntentionInsuranceSon> sons = ctQuoteAccidentVo.getInsDrivingIntentionInsuranceSon();
                 List<CoverageDTO> coverageDTOS = new ArrayList<>();
-                if (CollUtil.isNotEmpty(sons)){
-                    for (InsDrivingIntentionInsuranceSon son : sons) {
-                        CoverageDTO coverageDTO = new CoverageDTO();
-                        coverageDTO.setKindCode(son.getCode());
-                        coverageDTO.setIfMainKind("2");
-                        coverageDTO.setQuantity(0);
-                        coverageDTO.setCalculateFlag("1");
-                        coverageDTO.setShortRateType("2");
-                        coverageDTO.setShortRate("100");
-                        coverageDTOS.add(coverageDTO);
-                    }
-                }
+                CoverageDTO coverageDTO1 = new CoverageDTO();
+                coverageDTO1.setKindCode("ct_111601");
+                coverageDTO1.setIfMainKind("2");
+                coverageDTO1.setQuantity(0);
+                coverageDTO1.setCalculateFlag("1");
+                coverageDTO1.setShortRateType("2");
+                coverageDTO1.setShortRate("100");
+                coverageDTOS.add(coverageDTO1);
+                CoverageDTO coverageDTO2 = new CoverageDTO();
+                coverageDTO2.setKindCode("ct_111602");
+                coverageDTO2.setIfMainKind("2");
+                coverageDTO2.setQuantity(0);
+                coverageDTO2.setCalculateFlag("1");
+                coverageDTO2.setShortRateType("2");
+                coverageDTO2.setShortRate("100");
+                coverageDTOS.add(coverageDTO2);
+                CoverageDTO coverageDTO3 = new CoverageDTO();
+                coverageDTO3.setKindCode("ct_111603");
+                coverageDTO3.setIfMainKind("2");
+                coverageDTO3.setQuantity(0);
+                coverageDTO3.setCalculateFlag("1");
+                coverageDTO3.setShortRateType("2");
+                coverageDTO3.setShortRate("100");
+                coverageDTOS.add(coverageDTO3);
                 return coverageDTOS;
             }
         }

+ 0 - 1
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -98,7 +98,6 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
                 ptlAgreementAttribution);
         HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
-
         /** 2. 查询车型 */
         CarInfoRequest carInfoRequest = new CarInfoRequest(quoteInfoVo.getCarInfo(), parameters);
         CarInfoResponse carInfoResponse = chengTaiRequestApiComponents.carinfoQuery(carInfoRequest, httpHeaders);