|
@@ -204,81 +204,90 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //region 2.报价查询
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 2 报价-
|
|
|
|
|
|
|
+ * 组装参数
|
|
|
|
|
+ * @param quoteVo
|
|
|
|
|
+ * @return
|
|
|
*/
|
|
*/
|
|
|
- @Override
|
|
|
|
|
- @Transactional
|
|
|
|
|
- public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException {
|
|
|
|
|
-
|
|
|
|
|
- requestInfoList = new ArrayList<>();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private Ruote builderParams(BaseQuoteVo<AccidentalDrivingVo> quoteVo,BaseQuoteInfoVo yaQuoteInfoVo){
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
|
|
|
|
|
//构造车辆信息
|
|
//构造车辆信息
|
|
|
gainVehicleModel(ycConfigureParameters, carInfo);
|
|
gainVehicleModel(ycConfigureParameters, carInfo);
|
|
|
- InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
|
|
|
AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
|
|
AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
|
|
|
|
|
|
|
|
//组装参数
|
|
//组装参数
|
|
|
Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, apiComponents, adVo);
|
|
Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, apiComponents, adVo);
|
|
|
//构造地区
|
|
//构造地区
|
|
|
buildRegion(m, yaQuoteInfoVo);
|
|
buildRegion(m, yaQuoteInfoVo);
|
|
|
|
|
+ return m;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- RuoteResponse rr = null;
|
|
|
|
|
- boolean boo = false;
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 递归获取报价请求结果
|
|
|
|
|
+ * @param m
|
|
|
|
|
+ * @param vinNo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws JsonProcessingException
|
|
|
|
|
+ */
|
|
|
|
|
+ private RuoteResponse getResponse(Ruote m,String vinNo) throws JsonProcessingException {
|
|
|
|
|
+ Boolean boo = false;
|
|
|
boolean isBiRepeat = true;
|
|
boolean isBiRepeat = true;
|
|
|
- String vinNo = carInfo.getVinNo();
|
|
|
|
|
- while (!boo) {
|
|
|
|
|
- rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
|
|
|
|
|
- //交强
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ("");
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ("");
|
|
|
|
|
- //商业
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY("");
|
|
|
|
|
- m.getRequestLabel().getCondition().getVhl().setCQryCdeSY("");
|
|
|
|
|
-
|
|
|
|
|
- if (rr.getHead().getErrorCode().equals("009999") && (rr.getHead().getErrorMessage().contains("车主") || rr.getHead().getErrorMessage().contains("投保人") || rr.getHead().getErrorMessage().contains("被保人"))) {
|
|
|
|
|
- return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
|
|
- }
|
|
|
|
|
- //处理返回信息
|
|
|
|
|
- //1、交强险重复投保处理
|
|
|
|
|
- boo = ciRepetitionInsure(rr, m);
|
|
|
|
|
- if (!boo) {
|
|
|
|
|
- InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 交强险重复投保处理", vinNo);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //2、转保处理
|
|
|
|
|
- boo = reinsurance(rr, m);
|
|
|
|
|
- if (!boo) {
|
|
|
|
|
- InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isBiRepeat) {
|
|
|
|
|
- //3、商业险日期处理
|
|
|
|
|
- boo = biRepetitionInsure(rr, m);
|
|
|
|
|
- if (!boo) {
|
|
|
|
|
- isBiRepeat = false;
|
|
|
|
|
- InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 商业险日期处理", vinNo);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 转保验证码
|
|
|
|
|
- boo = reinsuranceCodeError(rr, m);
|
|
|
|
|
|
|
+ RuoteResponse rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
|
|
|
|
|
+ //交强
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ("");
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ("");
|
|
|
|
|
+ //商业
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY("");
|
|
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCQryCdeSY("");
|
|
|
|
|
+
|
|
|
|
|
+ if (rr.getHead().getErrorCode().equals("009999") && (rr.getHead().getErrorMessage().contains("车主") || rr.getHead().getErrorMessage().contains("投保人") || rr.getHead().getErrorMessage().contains("被保人"))) {
|
|
|
|
|
+ return rr;
|
|
|
|
|
+ }
|
|
|
|
|
+ //处理返回信息
|
|
|
|
|
+ //1、交强险重复投保处理
|
|
|
|
|
+ boo = ciRepetitionInsure(rr, m);
|
|
|
|
|
+ if (!boo) {
|
|
|
|
|
+ InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 交强险重复投保处理", vinNo);
|
|
|
|
|
+ rr = this.getResponse(m,vinNo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //2、转保处理
|
|
|
|
|
+ boo = reinsurance(rr, m);
|
|
|
|
|
+ if (!boo) {
|
|
|
|
|
+ InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
|
|
|
|
|
+ rr = this.getResponse(m,vinNo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (isBiRepeat) {
|
|
|
|
|
+ //3、商业险日期处理
|
|
|
|
|
+ boo = biRepetitionInsure(rr, m);
|
|
|
if (!boo) {
|
|
if (!boo) {
|
|
|
- InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
|
|
|
|
|
|
|
+ isBiRepeat = false;
|
|
|
|
|
+ InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 商业险日期处理", vinNo);
|
|
|
|
|
+ rr = this.getResponse(m,vinNo);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 转保验证码
|
|
|
|
|
+ boo = reinsuranceCodeError(rr, m);
|
|
|
|
|
+ if (!boo) {
|
|
|
|
|
+ InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
|
|
|
}
|
|
}
|
|
|
|
|
+ return rr;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取错误信息
|
|
|
|
|
+ * @param rr
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private StringBuilder getErrorInfo(RuoteResponse rr) {
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("车主省市县码值不符合规范")) {
|
|
if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("车主省市县码值不符合规范")) {
|
|
|
sb.append("|永诚 - 保司 - 车主地区自动解析失败");
|
|
sb.append("|永诚 - 保司 - 车主地区自动解析失败");
|
|
|
}
|
|
}
|
|
@@ -288,14 +297,40 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("被保人省市县码值不符合规范")) {
|
|
if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("被保人省市县码值不符合规范")) {
|
|
|
sb.append("|永诚 - 保司 - 被保人地区自动解析失败");
|
|
sb.append("|永诚 - 保司 - 被保人地区自动解析失败");
|
|
|
}
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(sb)) {
|
|
|
|
|
- throw new SystemException(sb.toString());
|
|
|
|
|
|
|
+ return sb;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 2 报价-
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException {
|
|
|
|
|
+
|
|
|
|
|
+ requestInfoList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ //获取报价信息
|
|
|
|
|
+ BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
|
|
+
|
|
|
|
|
+ //build参数
|
|
|
|
|
+ Ruote m = this.builderParams(quoteVo,yaQuoteInfoVo);
|
|
|
|
|
+
|
|
|
|
|
+ //递归报价
|
|
|
|
|
+ RuoteResponse rr = this.getResponse(m,yaQuoteInfoVo.getCarInfo().getVinNo());
|
|
|
|
|
+
|
|
|
|
|
+ //错误信息
|
|
|
|
|
+ StringBuilder errorInfo = this.getErrorInfo(rr);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(errorInfo)) {
|
|
|
|
|
+ throw new SystemException(errorInfo.toString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //报价失败
|
|
|
if (!rr.getHead().getErrorCode().equals("000000")) {
|
|
if (!rr.getHead().getErrorCode().equals("000000")) {
|
|
|
return HttpResult.error(rr.getHead().getErrorMessage());
|
|
return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //查询订单信息
|
|
|
|
|
+ InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
|
|
|
+
|
|
|
QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
|
|
QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
|
|
|
//8 生成订单
|
|
//8 生成订单
|
|
|
InsAreaCompany iac = response_order(order, quoteRespVo, m, rr, quoteVo);
|
|
InsAreaCompany iac = response_order(order, quoteRespVo, m, rr, quoteVo);
|
|
@@ -314,6 +349,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //endregion
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 报价 交强险 重复 投保业务处理
|
|
* 报价 交强险 重复 投保业务处理
|
|
|
*/
|
|
*/
|