Просмотр исходного кода

fix 国任财险报价提示0400 id不存在问题

liub 3 месяцев назад
Родитель
Сommit
0a3fb7594a

+ 51 - 25
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/request/GuoRenCrawlerProposalNoSaveRequest.java

@@ -49,49 +49,75 @@ public class GuoRenCrawlerProposalNoSaveRequest implements Serializable {
     }
 
     /**
-     * 从试算响应中提取报价ID,回填到保存请求的bc字段中
+     * 从试算响应中提取报价ID及关键字段,回填到保存请求中
      * 解决保司合规规则"报价ID缺失"问题
      */
     private void fillProposalNoFromResponse(GuoRenCrawlerCalculationPremiumData response) {
         if (response == null) {
             return;
         }
-        // 1. 从响应的BC中回填proposalNo到请求的BC
+        // 1. 从响应的BC中回填关键字段到请求的BC
         GuoRenCrawlerCalculationPremiumData.BcDTO responseBc = response.getBc();
-        if (responseBc != null) {
-            // 回填BC.prpTmain.proposalNo
-            if (responseBc.getPrpTmain() != null && StringUtils.hasText(responseBc.getPrpTmain().getProposalNo())) {
-                String bcProposalNo = responseBc.getPrpTmain().getProposalNo();
-                String bcDemandNo = responseBc.getPrpTmain().getDemandNo();
-                if (this.bc.getPrpTmain() != null) {
-                    this.bc.getPrpTmain().setProposalNo(bcProposalNo);
-                    this.bc.getPrpTmain().setDemandNo(bcDemandNo);
-                }
-                if (this.bc.getPrpTitemCar() != null) {
-                    this.bc.getPrpTitemCar().setProposalNo(bcProposalNo);
-                }
+        if (responseBc != null && responseBc.getPrpTmain() != null && this.bc.getPrpTmain() != null) {
+            String bcProposalNo = responseBc.getPrpTmain().getProposalNo();
+            String bcDemandNo = responseBc.getPrpTmain().getDemandNo();
+            String bcCertiNo = responseBc.getPrpTmain().getCertiNo();
+            String bcCarsonlyid = responseBc.getPrpTmain().getCarsonlyid();
+            if (StringUtils.hasText(bcProposalNo)) {
+                this.bc.getPrpTmain().setProposalNo(bcProposalNo);
+            }
+            if (StringUtils.hasText(bcDemandNo)) {
+                this.bc.getPrpTmain().setDemandNo(bcDemandNo);
+            }
+            if (StringUtils.hasText(bcCertiNo)) {
+                this.bc.getPrpTmain().setCertiNo(bcCertiNo);
+                this.bc.getPrpTmain().setCertino1(bcCertiNo);
+            }
+            if (StringUtils.hasText(bcCarsonlyid)) {
+                this.bc.getPrpTmain().setCarsonlyid(bcCarsonlyid);
+            }
+            if (this.bc.getPrpTitemCar() != null && StringUtils.hasText(bcProposalNo)) {
+                this.bc.getPrpTitemCar().setProposalNo(bcProposalNo);
             }
         }
-        // 2. 从响应的CI中回填proposalNo到ciInsureDemand
+        // 2. 从响应的CI中回填proposalNo/demandNo,并传播到子对象
         GuoRenCrawlerCalculationPremiumData.CiDTO responseCi = response.getCi();
-        if (responseCi != null && responseCi.getPrpTmain() != null
-                && StringUtils.hasText(responseCi.getPrpTmain().getProposalNo())) {
+        if (responseCi != null && responseCi.getPrpTmain() != null) {
             String ciProposalNo = responseCi.getPrpTmain().getProposalNo();
-            String demandNo = responseCi.getPrpTmain().getDemandNo();
+            String ciDemandNo = responseCi.getPrpTmain().getDemandNo();
+            // 回填ciInsureDemand
             if (this.ci != null && this.ci.getCiInsureDemand() != null) {
-                this.ci.getCiInsureDemand().setProposalNo(ciProposalNo);
-                this.ci.getCiInsureDemand().setDemandNo(demandNo);
+                if (StringUtils.hasText(ciProposalNo)) {
+                    this.ci.getCiInsureDemand().setProposalNo(ciProposalNo);
+                }
+                if (StringUtils.hasText(ciDemandNo)) {
+                    this.ci.getCiInsureDemand().setDemandNo(ciDemandNo);
+                }
+            }
+            // 传播demandNo到ciCarShipTaxQGDemandSchema
+            if (this.ci != null && this.ci.getCiCarShipTaxQGDemandSchema() != null) {
+                String effectiveDemandNo = StringUtils.hasText(ciDemandNo) ? ciDemandNo
+                        : (this.ci.getCiInsureDemand() != null ? this.ci.getCiInsureDemand().getDemandNo() : null);
+                if (StringUtils.hasText(effectiveDemandNo)) {
+                    this.ci.getCiCarShipTaxQGDemandSchema().setDemandNo(effectiveDemandNo);
+                }
+                if (StringUtils.hasText(ciProposalNo)) {
+                    this.ci.getCiCarShipTaxQGDemandSchema().setProposalNo(ciProposalNo);
+                }
             }
         }
-        // 3. 从响应的BI中回填proposalNo到ciInsureDemand
+        // 3. 从响应的BI中回填proposalNo/demandNo到ciInsureDemand
         GuoRenCrawlerCalculationPremiumData.BiDTO responseBi = response.getBi();
-        if (responseBi != null && responseBi.getPrpTmain() != null
-                && StringUtils.hasText(responseBi.getPrpTmain().getProposalNo())) {
+        if (responseBi != null && responseBi.getPrpTmain() != null) {
             String biProposalNo = responseBi.getPrpTmain().getProposalNo();
             String biDemandNo = responseBi.getPrpTmain().getDemandNo();
             if (this.bi != null && this.bi.getCiInsureDemand() != null) {
-                this.bi.getCiInsureDemand().setProposalNo(biProposalNo);
-                this.bi.getCiInsureDemand().setDemandNo(biDemandNo);
+                if (StringUtils.hasText(biProposalNo)) {
+                    this.bi.getCiInsureDemand().setProposalNo(biProposalNo);
+                }
+                if (StringUtils.hasText(biDemandNo)) {
+                    this.bi.getCiInsureDemand().setDemandNo(biDemandNo);
+                }
             }
         }
     }

+ 21 - 7
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerQuoteProcessServiceImpl.java

@@ -110,8 +110,8 @@ public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteP
     @Override
     public HttpHeaders getHeaders(String username) {
         HttpHeaders headers = new HttpHeaders();
-        String token = guoRenCrawlerCacheComponent.getToken(username);
-//        String token = "eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3Nzg5MjY2MDB9.UYGTs0DQgbZJinMWJExUV18JhfJW23JonveQVVq6N5Muy_vu6Py8pL-AI5Ohv0BDoCCfdOD7SjLmiCqGy4uU9130O1_QlLzyxsriiBKUPXPJKbipftpqSdjYyFSgfNSIySO99hs005Ip89HnkaT34ephMA-C8jyyxGShQdNkuxI";
+//        String token = guoRenCrawlerCacheComponent.getToken(username);
+        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3ODEyNDU1NDJ9.YsfJuQ58NaPa-7aUrYjh0SdvRkxhsiejP648H39j6h1PztC0b5Rdb8GOi5oGkVew_CI-T5j0VeaYfSFF-DrqrT_LReqtbl-iM0_OeN8acFLNcXbhfv80mRz1HqPZrUXrwngS-8Q6eF42gOJVxAX_nSFNdJpX5977A3_KJdmVbxs";
         if (!StringUtils.hasText(token)) {
             throw new TokenExpireException("500", "国任财险账号登录过期,请重新登录");
         }
@@ -215,11 +215,25 @@ public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteP
                 calculationPremium.getCi().getPrpTmain().getProposalNo());
         crawlerCalculationPremiumRequest.getCi().setCiInsureDemand(calculationPremium.getCi().getCiInsureDemand());
         crawlerCalculationPremiumRequest.getCi().setPrptengageList(calculationPremium.getCi().getPrptengageList());
-        // BC也需要回填proposalNo
-        if (calculationPremium.getBc() != null && calculationPremium.getBc().getPrpTmain() != null
-                && org.springframework.util.StringUtils.hasText(calculationPremium.getBc().getPrpTmain().getProposalNo())) {
-            crawlerCalculationPremiumRequest.getBc().getPrpTmain().setProposalNo(
-                    calculationPremium.getBc().getPrpTmain().getProposalNo());
+        // BC也需要回填proposalNo/demandNo/certiNo/carsonlyid
+        if (calculationPremium.getBc() != null && calculationPremium.getBc().getPrpTmain() != null) {
+            if (org.springframework.util.StringUtils.hasText(calculationPremium.getBc().getPrpTmain().getProposalNo())) {
+                crawlerCalculationPremiumRequest.getBc().getPrpTmain().setProposalNo(
+                        calculationPremium.getBc().getPrpTmain().getProposalNo());
+            }
+            if (org.springframework.util.StringUtils.hasText(calculationPremium.getBc().getPrpTmain().getDemandNo())) {
+                crawlerCalculationPremiumRequest.getBc().getPrpTmain().setDemandNo(
+                        calculationPremium.getBc().getPrpTmain().getDemandNo());
+            }
+            if (org.springframework.util.StringUtils.hasText(calculationPremium.getBc().getPrpTmain().getCertiNo())) {
+                String certiNo = calculationPremium.getBc().getPrpTmain().getCertiNo();
+                crawlerCalculationPremiumRequest.getBc().getPrpTmain().setCertiNo(certiNo);
+                crawlerCalculationPremiumRequest.getBc().getPrpTmain().setCertino1(certiNo);
+            }
+            if (org.springframework.util.StringUtils.hasText(calculationPremium.getBc().getPrpTmain().getCarsonlyid())) {
+                crawlerCalculationPremiumRequest.getBc().getPrpTmain().setCarsonlyid(
+                        calculationPremium.getBc().getPrpTmain().getCarsonlyid());
+            }
         }
         if (crawlerCalculationPremiumRequest.getBi().getPrpTmain() != null) {
             crawlerCalculationPremiumRequest.getBi().getPrpTmain().setDemandNo(demandNoBi);