|
|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|