Parcourir la source

1、永诚获取渠道信息方式变更,根据协议号取。

ligang134 il y a 3 ans
Parent
commit
866e764b3c

+ 46 - 51
src/main/java/com/ydtech/components/InsAlltrustRequestApiComponents.java

@@ -18,62 +18,57 @@ public class InsAlltrustRequestApiComponents {
     @Value("${yc.api.url}")
     String url = "";
 
-    @Value("${yc.api.userName}")
-    private String userName;
-    @Value("${yc.api.password}")
-    private String password;
 
     @Value("${yc.api.pay.callBack}")
     private String payCallBack;
 
-    @Value("${yc.api.agent.dptCde}")
-    private String dptCde;
-    @Value("${yc.api.agent.agentCode}")
-    private String agentCode;
-    @Value("${yc.api.agent.conferCode}")
-    private String conferCode;
-    @Value("${yc.api.agent.agentType}")
-    private String agentType;
-    @Value("${yc.api.agent.agentNme}")
-    private String agentNme;
-    @Value("${yc.api.agent.qlftNo}")
-    private String qlftNo;
-    @Value("${yc.api.agent.operatorCode}")
-    private String operatorCode;
-    @Value("${yc.api.agent.salesmanNo}")
-    private String salesmanNo;
-    @Value("${yc.api.agent.CChaType}")
-    private String cChaType;
-    @Value("${yc.api.agent.custNature}")
-    private String custNature;
-    @Value("${yc.api.agent.cOprcde}")
-    private String cOprcde;
-    @Value("${yc.api.agent.cBsnsTyp}")
-    private String cBsnsTyp;
+//    @Value("${yc.api.userName}")
+//    private String userName;
+//    @Value("${yc.api.password}")
+//    private String password;
+//    @Value("${yc.api.agent.dptCde}")
+//    private String dptCde;
+//    @Value("${yc.api.agent.agentCode}")
+//    private String agentCode;
+//    @Value("${yc.api.agent.conferCode}")
+//    private String conferCode;
+//    @Value("${yc.api.agent.agentType}")
+//    private String agentType;
+//    @Value("${yc.api.agent.agentNme}")
+//    private String agentNme;
+//    @Value("${yc.api.agent.qlftNo}")
+//    private String qlftNo;
+//    @Value("${yc.api.agent.operatorCode}")
+//    private String operatorCode;
+//    @Value("${yc.api.agent.salesmanNo}")
+//    private String salesmanNo;
+//    @Value("${yc.api.agent.CChaType}")
+//    private String cChaType;
+//    @Value("${yc.api.agent.custNature}")
+//    private String custNature;
+//    @Value("${yc.api.agent.cOprcde}")
+//    private String cOprcde;
+//    @Value("${yc.api.agent.cBsnsTyp}")
+//    private String cBsnsTyp;
 
-    private Agent agent;
-//    private final Agent agent;
-
-//    public YongchengRequestApiComponents(Agent agent) {
-//        this.agent = agent;
+//    private Agent agent;
+//
+//    /**
+//     * 获取渠道
+//     */
+//    public Agent gainAgent() {
+//        if (null == agent) {
+//            agent = new Agent();
+//            agent.setAgentCode(agentCode);
+//            agent.setConferCode(conferCode);
+//            agent.setAgentType(agentType);
+//            agent.setAgentNme(agentNme);
+//            agent.setQlftNo(qlftNo);
+//            agent.setCustNature(custNature);
+//            agent.setAgentProfId(qlftNo);
+//            agent.setSubCoNo(conferCode);
+//        }
+//        return agent;
 //    }
 
-    /**
-     * 获取渠道
-     */
-    public Agent gainAgent() {
-        if (null == agent) {
-            agent = new Agent();
-            agent.setAgentCode(agentCode);
-            agent.setConferCode(conferCode);
-            agent.setAgentType(agentType);
-            agent.setAgentNme(agentNme);
-            agent.setQlftNo(qlftNo);
-            agent.setCustNature(custNature);
-            agent.setAgentProfId(qlftNo);
-            agent.setSubCoNo(conferCode);
-        }
-        return agent;
-    }
-
 }

+ 3 - 0
src/main/java/com/ydtech/modules/ins/model/ya/CarModel_Req.java

@@ -29,6 +29,9 @@ public class CarModel_Req {
     @ApiModelProperty("是否新车")
     private String newVehicle;//是否新车
 
+    @ApiModelProperty("协议ID")
+    private String agreementId;
+
     public CarModel_Req(String frameNo, String enrollDate, String modelName) {
         this.frameNo = frameNo;
         this.enrollDate = enrollDate;

+ 71 - 0
src/main/java/com/ydtech/modules/ins/model/yc/YcConfigureParameters.java

@@ -0,0 +1,71 @@
+package com.ydtech.modules.ins.model.yc;
+
+import com.ydtech.modules.ins.model.yc.ruote.Agent;
+import com.ydtech.modules.order.entity.config.ConfigureParameters;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+
+@Data
+public class YcConfigureParameters implements ConfigureParameters {
+
+    //机构代码(dptCde)
+    private String dptCde;
+    //渠道编码(agentCode)
+    private String agentCode;
+    //协议编码(conferCode)
+    private String conferCode;
+    //渠道分类(agentType)
+    private String agentType;
+    //代理人名称(agentNme)
+    private String agentNme;
+    //代理人资格证号(qlftNo)
+    private String qlftNo;
+    //录入人(operatorCode)
+    private String operatorCode;
+    //业务员代码(salesmanNo)
+    private String salesmanNo;
+    //新业务来源(CChaType)
+    private String CChaType;
+    //客户性质(custNature)
+    private String custNature;
+    //操作人员代码(cOprcde)
+    private String cOprcde;
+    //业务来源(cBsnsTyp)
+    private String cBsnsTyp;
+    //用户名
+    private String userName;
+    //密码
+    private String password;
+
+
+
+    /**
+     * 获取渠道
+     */
+    public Agent gainAgent() {
+        Agent agent = new Agent();
+        agent.setAgentCode(agentCode);
+        agent.setConferCode(conferCode);
+        agent.setAgentType(agentType);
+        agent.setAgentNme(agentNme);
+        agent.setQlftNo(qlftNo);
+        agent.setCustNature(custNature);
+        agent.setAgentProfId(qlftNo);
+        agent.setSubCoNo(conferCode);
+        return agent;
+    }
+
+    /**
+     * @description: 获取验证数据
+     * @author: lig
+     * @date: 2023年02月07日 0007
+     */
+    public AuthorityDataXml gainAuthorityDataXml() {
+        AuthorityDataXml authorityDataXml = new AuthorityDataXml();
+        authorityDataXml.setUserName(userName);
+        authorityDataXml.setPassword(password);
+        return authorityDataXml;
+    }
+
+
+}

+ 4 - 3
src/main/java/com/ydtech/modules/ins/model/yc/accident/Accident.java

@@ -6,6 +6,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import com.ydtech.components.InsAlltrustRequestApiComponents;
 import com.ydtech.modules.ins.model.cbit.VehicleModel_QueRen;
 import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 import com.ydtech.utils.StringUtils;
@@ -68,18 +69,18 @@ public class Accident {
      * @author: lig
      * @date: 2023-02-15
      */
-    public static Accident buildPayParam(AccidentalDrivingQueryVo accidentalDrivingVo, AuthorityDataXml authorityDataXml, InsAlltrustRequestApiComponents apiComponents, String schemeNo) {
+    public static Accident buildPayParam(AccidentalDrivingQueryVo accidentalDrivingVo, YcConfigureParameters ycConfigureParameters, String schemeNo) {
 
         Accident m = new Accident();
 //
         RequestLabel r = new RequestLabel();
 
-        r.setAuthorityData(authorityDataXml);
+        r.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
 
 //        VehicleModel_QueRen vehicleModel_QueRen = JSON.parseObject(JSON.toJSONString(order.getCarinfo()), VehicleModel_QueRen.class);
 //        vehicleModel_QueRen.getSeatCount();
 
-        r.setDeptcde(apiComponents.getDptCde().substring(0, 2));
+        r.setDeptcde(ycConfigureParameters.getDptCde().substring(0, 2));
         r.setSeatsNum(accidentalDrivingVo.getSeatNum() + "");
         if (StringUtils.isNotEmpty(schemeNo)) {
             r.setSchemeNo(schemeNo);

+ 4 - 3
src/main/java/com/ydtech/modules/ins/model/yc/audit/Audit.java

@@ -7,6 +7,7 @@ import com.ydtech.components.InsAlltrustRequestApiComponents;
 import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
 import com.ydtech.modules.ins.model.yc.YcBuildData;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.utils.IDCardUtils;
 import lombok.Data;
@@ -212,7 +213,7 @@ public class Audit {
      * @author: lig
      * @date: 2023-02-15
      */
-    public static Audit buildAuditParam(CustomerInfoVo ownerInfo, CustomerInfoVo insureInfo, CustomerInfoVo applyInfo, AuthorityDataXml authorityDataXml, InsAreaCompany iac, InsAlltrustRequestApiComponents apiComponents) {
+    public static Audit buildAuditParam(CustomerInfoVo ownerInfo, CustomerInfoVo insureInfo, CustomerInfoVo applyInfo, YcConfigureParameters ycConfigureParameters, InsAreaCompany iac) {
 //    public static Audit buildAuditParam(InsOrders order, AuthorityDataXml authorityDataXml,InsAreaCompany iac) {
 
 //        //车主
@@ -229,7 +230,7 @@ public class Audit {
         Condition condition = new Condition();
 
         //<condition>  "14A4"
-        condition.setDeptCode(apiComponents.getDptCde());
+        condition.setDeptCode(ycConfigureParameters.getDptCde());
         condition.setJqFlag(iac.getJqpremium().intValue() > 0 ? "1" : "0");
         condition.setSyFlag(iac.getSypremium().intValue() > 0 ? "1" : "0");
         condition.setCommissionPercentage("0");
@@ -278,7 +279,7 @@ public class Audit {
         condition.setCustomer(customer);
         condition.setTaxATion(taxATion);
 
-        r.setAuthorityData(authorityDataXml);
+        r.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
         r.setCondition(condition);
 
 

+ 6 - 4
src/main/java/com/ydtech/modules/ins/model/yc/imageUp/ImageUp.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import com.ydtech.components.InsAlltrustRequestApiComponents;
 import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.utils.StringUtils;
 import lombok.Data;
@@ -98,22 +99,23 @@ public class ImageUp {
      * @author: lig
      * @date: 2023-02-15
      */
-    public static ImageUp buildImageUpParam(InsOrders order, AuthorityDataXml authorityDataXml, String encoderBase, String imgType, InsAlltrustRequestApiComponents apiComponents) {
+    public static ImageUp buildImageUpParam(InsOrders order, YcConfigureParameters ycConfigureParameters, String encoderBase, String imgType) {
+//    public static ImageUp buildImageUpParam(InsOrders order, AuthorityDataXml authorityDataXml, String encoderBase, String imgType, InsAlltrustRequestApiComponents apiComponents) {
 
 //        CustomerInfoVo insureInfo = JSONObject.parseObject(order.getInsureinfo().toJSONString(), CustomerInfoVo.class);
 //        CustomerInfoVo applyInfo = JSONObject.parseObject(order.getApplyinfo().toJSONString(), CustomerInfoVo.class);
         ImageUp m = new ImageUp();
 
         NewImgUpLoadInfoRequest niuir = new NewImgUpLoadInfoRequest();
-        niuir.setAuthorityData(authorityDataXml);
+        niuir.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
 
         RequestBase rb = new RequestBase();
         rb.setRack(order.getFrameno());
 
-        rb.setDeptCode(apiComponents.getDptCde());
+        rb.setDeptCode(ycConfigureParameters.getDptCde());
 
         rb.setEncoderBase(encoderBase);
-        rb.setOprCde(apiComponents.getSalesmanNo());
+        rb.setOprCde(ycConfigureParameters.getSalesmanNo());
 
         String fileName = "";
         //C01车辆影像,C02车主身份证,C03投保人身份证,C04被保人身份证,C05验车照

+ 7 - 5
src/main/java/com/ydtech/modules/ins/model/yc/ruote/Base.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.ydtech.components.InsAlltrustRequestApiComponents;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.utils.DateTimeUtil;
 import com.ydtech.utils.DateUtil;
 import lombok.Data;
@@ -277,11 +278,12 @@ public class Base {
     private String CBsnsTyp;
 
 
-    public static Base buildBase(YaQuoteInfoVo yaQuoteInfoVo, InsAlltrustRequestApiComponents apiComponents) {
+    public static Base buildBase(YaQuoteInfoVo yaQuoteInfoVo, YcConfigureParameters ycConfigureParameters) {
+//    public static Base buildBase(YaQuoteInfoVo yaQuoteInfoVo, InsAlltrustRequestApiComponents apiComponents) {
 //    public static Base buildBase(YaQuoteInfoVo yaQuoteInfoVo,Agent agent) {
         Base base = new Base();
 
-        base.setCDptCde(apiComponents.getDptCde());
+        base.setCDptCde(ycConfigureParameters.getDptCde());
 //        base.setCDptCde("14A4");
         //  340001	按日计算(D)  340002	按月计算(M)
         base.setCRatioTyp("340001");
@@ -289,7 +291,7 @@ public class Base {
         base.setNPrmRmbExch("1");
         base.setCAmtCur("01");
         base.setCPrmCur("01");
-        base.setCOprCde(apiComponents.getCOprcde());
+        base.setCOprCde(ycConfigureParameters.getCOprcde());
         //@TODO 是否及时生效
         base.setCImmeffMrk("0");
         base.setCUserType("0");
@@ -304,8 +306,8 @@ public class Base {
         base.setTaxFlag("1");
         base.setRenewalFlagJQ("0");
         base.setRenewalFlagSY("0");
-        base.setCSlsCde(apiComponents.getSalesmanNo());
-        base.setOperatorCode(apiComponents.getOperatorCode());
+        base.setCSlsCde(ycConfigureParameters.getSalesmanNo());
+        base.setOperatorCode(ycConfigureParameters.getOperatorCode());
         base.setTIssueTm(DateUtil.getDateFormat(new Date(), "yyyy-MM-dd"));
         base.setCChaType("191010");
 

+ 6 - 4
src/main/java/com/ydtech/modules/ins/model/yc/ruote/Ruote.java

@@ -9,6 +9,7 @@ import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
 import com.ydtech.modules.ins.model.yc.YcBuildData;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.utils.StringUtils;
 import lombok.Data;
@@ -153,7 +154,8 @@ public class Ruote {
      * @author: lig
      * @date: 2023年02月08日 0008
      */
-    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, AuthorityDataXml authorityDataXml, Agent agent, InsAlltrustRequestApiComponents apiComponents, AccidentalDrivingVo adVo) {
+    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, YcConfigureParameters ycConfigureParameters, InsAlltrustRequestApiComponents apiComponents, AccidentalDrivingVo adVo) {
+//    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, AuthorityDataXml authorityDataXml, Agent agent, InsAlltrustRequestApiComponents apiComponents, AccidentalDrivingVo adVo) {
 //    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, AuthorityDataXml authorityDataXml,Agent agent) {
 
         Ruote m = new Ruote();
@@ -172,7 +174,7 @@ public class Ruote {
         /**
          * 基本信息 base
          */
-        Base base = Base.buildBase(yaQuoteInfoVo, apiComponents);
+        Base base = Base.buildBase(yaQuoteInfoVo, ycConfigureParameters);
         condition.setBase(base);
 
         /**
@@ -267,7 +269,7 @@ public class Ruote {
          * 渠道及费用信息
          * 渠道及费用信息agent
          */
-        condition.setAgent(agent);
+        condition.setAgent(ycConfigureParameters.gainAgent());
 
         /**
          * 投保人信息
@@ -307,7 +309,7 @@ public class Ruote {
 //        condition.setVhlAddInsured(vhlAddInsured);
 
 
-        requestLabel.setAuthorityData(authorityDataXml);
+        requestLabel.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
         requestLabel.setCondition(condition);
 
 

+ 90 - 97
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -14,7 +14,6 @@ import com.ydtech.constants.enums.dict.AttachInsureEnum;
 import com.ydtech.constants.enums.dict.WhetherEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureDetailsMapper;
@@ -47,6 +46,7 @@ import com.ydtech.modules.ins.model.yc.policy.response.PolicyResponse;
 import com.ydtech.modules.ins.model.yc.ruote.*;
 import com.ydtech.modules.ins.model.yc.ruote.response.RuoteResponse;
 import com.ydtech.modules.ins.service.*;
+import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
@@ -102,7 +102,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     private EsmAgreementService esmAgreementService;
     @Autowired
     private EsmAgreementProdService esmAgreementProdService;
-//    @Autowired
+    //    @Autowired
 //    private EsmUserInternalService esmUserInternalService;
     @Autowired
     private InsTaskHistoryService insTaskHistoryService;
@@ -121,40 +121,42 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
     @Autowired
     InsApiLogService insApiLogService;
+    @Autowired
+    ConfigureParametersComponents configureParametersComponents;
 
 
-    /**
-     * @description: 获取验证数据
-     * @author: lig
-     * @date: 2023年02月07日 0007
-     */
-    private AuthorityDataXml gainAuthorityDataXml() {
-        if (null == authorityDataXml) {
-            authorityDataXml = new AuthorityDataXml();
-            authorityDataXml.setUserName(apiComponents.getUserName());
-            authorityDataXml.setPassword(apiComponents.getPassword());
-        }
-        return authorityDataXml;
-    }
-
-    /**
-     * 获取渠道
-     */
-    public Agent gainAgent() {
-        return apiComponents.gainAgent();
-//        if (null == agent) {
-//            agent = new Agent();
-//            agent.setAgentCode(agentCode);
-//            agent.setConferCode(agentType);
-//            agent.setAgentType(agentType);
-//            agent.setAgentNme(agentNme);
-//            agent.setQlftNo(qlftNo);
-//            agent.setCustNature(custNature);
-//            agent.setAgentProfId(agentCode);
-//            agent.setSubCoNo(agentType);
+//    /**
+//     * @description: 获取验证数据
+//     * @author: lig
+//     * @date: 2023年02月07日 0007
+//     */
+//    private AuthorityDataXml gainAuthorityDataXml() {
+//        if (null == authorityDataXml) {
+//            authorityDataXml = new AuthorityDataXml();
+//            authorityDataXml.setUserName(apiComponents.getUserName());
+//            authorityDataXml.setPassword(apiComponents.getPassword());
 //        }
-//        return agent;
-    }
+//        return authorityDataXml;
+//    }
+
+//    /**
+//     * 获取渠道
+//     */
+//    public Agent gainAgent() {
+//        return apiComponents.gainAgent();
+////        if (null == agent) {
+////            agent = new Agent();
+////            agent.setAgentCode(agentCode);
+////            agent.setConferCode(agentType);
+////            agent.setAgentType(agentType);
+////            agent.setAgentNme(agentNme);
+////            agent.setQlftNo(qlftNo);
+////            agent.setCustNature(custNature);
+////            agent.setAgentProfId(agentCode);
+////            agent.setSubCoNo(agentType);
+////        }
+////        return agent;
+//    }
 
     private ObjectMapper gainXmlMapper() {
         if (null == xmlMapper) {
@@ -187,7 +189,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
 //        gainAuthorityDataXml(), apiComponents.gainAgent()
 
-        ModelsQueryXml m = buildModelsQueryParam(carModelReq);
+
+        // 获取协议配置信息
+        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(carModelReq.getAgreementId());
+
+
+        ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
         ObjectMapper xmlMapper = this.gainXmlMapper();
 
         log.info("===永诚--车型查询接口请求开始===");
@@ -212,6 +219,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      */
     @Override
     public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+
+
+        // 获取协议配置信息
+        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
+
+
 //    public HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo) {
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
         HttpResult httpResult = new HttpResult();
@@ -223,12 +236,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
 
-
         //1.1必填校验
         checkEmpty(yaQuoteInfoVo);
 
         //组装参数
-        Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, gainAuthorityDataXml(), apiComponents.gainAgent(), apiComponents, adVo);
+        Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, apiComponents, adVo);
         //构造地区
         buildRegion(m);
 
@@ -259,7 +271,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                 quoteVo.setRenewalCodeSy(cCheckCodeSY);
                 quoteVo.setCQryCdeJq(rr.getVhl().getCQryCdeJQ());
                 quoteVo.setCQryCdeSy(rr.getVhl().getCQryCdeSY());
-                return HttpResult.error(101,quoteVo,"转保单");
+                return HttpResult.error(101, quoteVo, "转保单");
             }
 
 
@@ -342,6 +354,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         String msg = "提交成功";
         HttpResult h = HttpResult.ok(msg);
         try {
+
             //子订单
             InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
             if (iac == null) {
@@ -349,6 +362,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             }
             InsOrders order = insOrdersService.getById(iac.getOrderno());
 
+            // 获取协议配置信息
+            YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
+
 //            if (InsOrderStatus.S_5.getCode().equals(iac.getOrderstatus()) || InsOrderStatus.S_4.getCode().equals(iac.getOrderstatus())) {
 //                return HttpResult.ok(InsOrderStatus.matchKey(iac.getOrderstatus()).getDesc());
 //            }
@@ -363,7 +379,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
 
             //组装参数
-            Audit m = Audit.buildAuditParam(ownerInfo, insureInfo, applyInfo, this.gainAuthorityDataXml(), iac, apiComponents);
+            Audit m = Audit.buildAuditParam(ownerInfo, insureInfo, applyInfo, ycConfigureParameters, iac);
 
             //处理地区
             Map<String, String> insureMap = gainRegionCode(insureInfo.getAddr());
@@ -457,15 +473,16 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         InsOrders order = insOrdersService.getById(iac.getOrderno());
         List<InsTaskImage> insTaskImages = insTaskImageService.selectByTaskId(order.getQuoteno());
 
-//        InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
-//        InsOrders order = insOrdersService.getById(iac.getOrderno());
+        //获取协议配置信息
+        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
+
 
         insTaskImages.stream().forEach(a -> {
             InsApiLog apiLog = null;
             //组装参数
             log.debug("=========永诚API方式 - xml请求 - 影像上传开始======");
             //接口请求
-            ImageUp iUp = ImageUp.buildImageUpParam(order, gainAuthorityDataXml(), a.getImage(), a.getImgtype(), apiComponents);
+            ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, a.getImage(), a.getImgtype());
             log.debug("=========永诚API方式 - xml请求 - 影像上传结束!======");
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
@@ -496,8 +513,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     public InsAreaCompany getPayUrlApi(InsAreaCompany iac) {
 
         try {
+            // 获取协议配置信息
+            YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
             //组装参数
-            Pay pay = Pay.buildPayParam(iac, gainAuthorityDataXml(), apiComponents.getPayCallBack());
+            Pay pay = Pay.buildPayParam(iac, ycConfigureParameters.gainAuthorityDataXml(), apiComponents.getPayCallBack());
 
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
@@ -524,51 +543,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         }
         return iac;
     }
-//    /**
-//     * 5 支付
-//     */
-//    @Override
-//    public HttpResult getPayUrlApi(String quoteOrderNo) {
-//        HttpResult httpResult = new HttpResult();
-//
-//        try {
-//            InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
-//            InsOrders order = insOrdersService.getById(iac.getOrderno());
-////            InsOrders order = insOrderService.selectByPk(orderno);
-//            if (iac == null) {
-//                return HttpResult.error("报价订单不存在");
-//            }
-//            //组装参数
-//            Pay pay = Pay.buildPayParam(iac, gainAuthorityDataXml(), apiComponents.getPayCallBack());
-//
-//            ObjectMapper xmlMapper = gainXmlMapper();
-//            //接口请求
-//            log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
-//            InsApiLog apiLog = httpPost(xmlMapper, pay, YcBuildData.API_PAY);
-//            log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
-//            verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_3);
-//            String responseData = apiLog.getResponseData();
-//
-//
-//            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-//            PayResponse payResp = xmlMapper.readValue(cleanStr, PayResponse.class);
-//
-//            if (payResp.getReturnCode().equals("E0000")) {
-//                iac.setPaymentLink(payResp.getPayTransUrl());
-//                insAreaCompanyService.updateById(iac);
-//                httpResult.setMsg(payResp.getPayTransUrl());
-//            } else {
-//                httpResult.setMsg(payResp.getReturnMessage());
-//            }
-//
-//        } catch (SystemException e) {
-//            return HttpResult.error(e.getMessage());
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return HttpResult.error("系统错误,请联系管理员");
-//        }
-//        return httpResult;
-//    }
 
     /**
      * 补传回调
@@ -583,12 +557,15 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             if (iac == null) {
                 return HttpResult.error("报价订单不存在");
             }
+
+            // 获取协议配置信息
+            YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
             //0 支付回调 1核保回调 5直接返回字符串信息
 //            String type = "0";
             String type = "5";
 //            if(iac.getOrderstatus().equals(InsOrderStatus.S_1.getCode())) type = "1";
             //组装参数
-            CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, gainAuthorityDataXml(), type);
+            CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, ycConfigureParameters.gainAuthorityDataXml(), type);
 
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
@@ -663,11 +640,14 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             if (iac == null) {
                 return HttpResult.error("报价订单不存在");
             }
+
+            // 获取协议配置信息
+            YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
             String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
 
 
             //组装参数
-            Policy p = Policy.buildPolicyParam(policyNo, gainAuthorityDataXml());
+            Policy p = Policy.buildPolicyParam(policyNo, ycConfigureParameters.gainAuthorityDataXml());
 
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
@@ -721,8 +701,13 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //            if (iac == null) {
 //                return HttpResult.error("报价订单不存在");
 //            }
+
+
+            // 获取协议配置信息
+            YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
+
             //组装参数
-            Accident accident = Accident.buildPayParam(accidentalDrivingVo, gainAuthorityDataXml(), apiComponents, null);
+            Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, null);
 
             ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
@@ -869,8 +854,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     public AccidentResponse gainAccidentInsure(AccidentalDrivingQueryVo accidentalDrivingVo, String schemeNo) {
         HttpResult httpResult = new HttpResult();
 
+        // 获取协议配置信息
+        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
         //组装参数
-        Accident accident = Accident.buildPayParam(accidentalDrivingVo, gainAuthorityDataXml(), apiComponents, schemeNo);
+        Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, schemeNo);
 
         ObjectMapper xmlMapper = gainXmlMapper();
         //接口请求
@@ -979,19 +966,17 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      * @author: lig
      * @date: 2023年02月08日 0008
      */
-    private ModelsQueryXml buildModelsQueryParam(CarModel_Req carModelReq) {
+    private ModelsQueryXml buildModelsQueryParam(CarModel_Req carModelReq, YcConfigureParameters ycConfigureParameters) {
         ModelsQueryXml m = new ModelsQueryXml();
         ModelsQueryXml.RequestLabel requestLabel = new ModelsQueryXml.RequestLabel();
         requestLabel.setSearchKeyword(carModelReq.getFrameNo().substring(0, 8));
         requestLabel.setVid(carModelReq.getFrameNo());
         requestLabel.setEngineNo(carModelReq.getEngineNo());
-        requestLabel.setDptCde(apiComponents.getDptCde());
+        requestLabel.setDptCde(ycConfigureParameters.getDptCde());
         requestLabel.setProno("0326");
         requestLabel.setMotorTypeCode("11");
         requestLabel.setCFstRegYm(carModelReq.getEnrollDate());
-        requestLabel.setAuthorityData(this.gainAuthorityDataXml());
-
-
+        requestLabel.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
 
 
         m.setRequestLabel(requestLabel);
@@ -1294,6 +1279,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         insAreaCompany.setSyapplyno(queryCodeSy);
         insAreaCompany.setCompanyId(eic.getId());
         insAreaCompany.setInscompany(eic.getNamesimple());
+        insAreaCompany.setAgreementId(quoteVo.getAgreementId());
         insAreaCompanyService.save(insAreaCompany);
         return insAreaCompany;
 
@@ -1391,7 +1377,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         log.debug("*********永诚API方式 - 身份证地址解析 参数:" + address);
         Map<String, String> m = IDCardUtils.addressResolution(address);
-        if(null == m) return null;
+        if (null == m) return null;
         String city = m.get("city");
         String district = m.get("district");
 //        if(StringUtils.isNullOrEmpty(district)){
@@ -1604,4 +1590,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //    }
 
 
+    private YcConfigureParameters gainYcConfigParams(String agreementId) {
+        YcConfigureParameters ycConfigureParameters = new YcConfigureParameters();
+        configureParametersComponents.toEntity(ycConfigureParameters, agreementId);
+        return ycConfigureParameters;
+    }
+
+
 }

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/vo/AccidentalDrivingQueryVo.java

@@ -23,5 +23,9 @@ public class AccidentalDrivingQueryVo implements Serializable {
     @ApiModelProperty(value = "座位数")
     private int seatNum;
 
+    @NotNull(message = "协议ID必填")
+    @ApiModelProperty(value = "协议ID")
+    private String agreementId;
+
 
 }