|
@@ -233,7 +233,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
log.debug("--------报价开始,订单号:{},协议号:{}--------------", quoteVo.getOrderNo(), quoteVo.getAgreementId());
|
|
log.debug("--------报价开始,订单号:{},协议号:{}--------------", quoteVo.getOrderNo(), quoteVo.getAgreementId());
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(),quoteVo.getKinds());
|
|
|
|
|
|
|
+ BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getKinds());
|
|
|
InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
|
|
|
|
@@ -271,8 +271,21 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
// 特别约定
|
|
// 特别约定
|
|
|
List<GuoRenSpecialAgreementVo> specialAgreementVo = quoteVo.getGuoRenSpecialAgreementVo();
|
|
List<GuoRenSpecialAgreementVo> specialAgreementVo = quoteVo.getGuoRenSpecialAgreementVo();
|
|
|
// 4、保费计算
|
|
// 4、保费计算
|
|
|
- PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar,
|
|
|
|
|
|
|
+ PremiumResp resp = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar,
|
|
|
specialAgreementVo, noCarPremium, goodsCode);
|
|
specialAgreementVo, noCarPremium, goodsCode);
|
|
|
|
|
+
|
|
|
|
|
+ if (resp.getResultCode() == 1) {
|
|
|
|
|
+ InsOrderStatusEnum insOrderStatusEnum = InsOrderStatusEnum.QUOTE_FAILED;
|
|
|
|
|
+ if(resp.getResultMsg().contains("重复投保"))
|
|
|
|
|
+ {
|
|
|
|
|
+ insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
|
|
|
|
|
+ }
|
|
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(quoteVo.getAgreementId());
|
|
|
|
|
+ insOrdersService.responseFailedOrder(quoteVo,ptlAgreementAttribution, order,resp.getResultMsg(),insOrderStatusEnum);
|
|
|
|
|
+ throw new SystemException(resp.getResultMsg() == null ? "保费计算失败,请联系管理员" : resp.getResultMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ PremiumResp.DataDTO premiumResult = resp.getData();
|
|
|
AssertionUtils.isEmpty(premiumResult, "保费计算失败");
|
|
AssertionUtils.isEmpty(premiumResult, "保费计算失败");
|
|
|
|
|
|
|
|
// 5、 生成订单
|
|
// 5、 生成订单
|
|
@@ -297,12 +310,12 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
|
|
|
|
|
InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
|
|
InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
|
|
|
- if(accidentalDrivingVo != null) {
|
|
|
|
|
|
|
+ if (accidentalDrivingVo != null) {
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(quoteVo.getAccidentalDrivingVo().getProdCode());
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(quoteVo.getAccidentalDrivingVo().getProdCode());
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskName(quoteVo.getAccidentalDrivingVo().getGoodsName());
|
|
insAreaCompanyAccidentalDriving.setRideRiskName(quoteVo.getAccidentalDrivingVo().getGoodsName());
|
|
|
insAreaCompanyAccidentalDriving.setQuantity(quoteVo.getAccidentalDrivingVo().getQuantity());
|
|
insAreaCompanyAccidentalDriving.setQuantity(quoteVo.getAccidentalDrivingVo().getQuantity());
|
|
|
}
|
|
}
|
|
|
- insAreaCompanyService.insertCompanyAndOrders(iac,insAreaCompanyAccidentalDriving);
|
|
|
|
|
|
|
+ insAreaCompanyService.insertCompanyAndOrders(iac, insAreaCompanyAccidentalDriving);
|
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
|
// 返回核心车型
|
|
// 返回核心车型
|
|
|
quoteRespVo.setCoreModels(vinQ.toCoreModelsVo());
|
|
quoteRespVo.setCoreModels(vinQ.toCoreModelsVo());
|
|
@@ -327,7 +340,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
//子订单
|
|
//子订单
|
|
|
InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
|
|
InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
|
|
|
|
|
|
|
|
- String oldStatus =iac.getOrderstatus();
|
|
|
|
|
|
|
+ String oldStatus = iac.getOrderstatus();
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
|
|
|
|
|
@@ -345,7 +358,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
String statusJq = auditResp.getData().get(0).getUnderWriteFlagCI();
|
|
String statusJq = auditResp.getData().get(0).getUnderWriteFlagCI();
|
|
|
String statusSy = auditResp.getData().get(0).getUnderWriteFlagBI();
|
|
String statusSy = auditResp.getData().get(0).getUnderWriteFlagBI();
|
|
|
String message = auditResp.getData().get(0).getMessage();
|
|
String message = auditResp.getData().get(0).getMessage();
|
|
|
- if (StringUtils.isEmpty(statusJq) && StringUtils.isEmpty(statusSy)){
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(statusJq) && StringUtils.isEmpty(statusSy)) {
|
|
|
return HttpResult.error("核保失败:" + message);
|
|
return HttpResult.error("核保失败:" + message);
|
|
|
}
|
|
}
|
|
|
//单交 核保状态 0初始值/1通过/2不通过/3 无需核保 9待核保
|
|
//单交 核保状态 0初始值/1通过/2不通过/3 无需核保 9待核保
|
|
@@ -384,7 +397,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) {
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) {
|
|
|
iac.setUnderwritingStatus(UnderwritingStatus.US_2.getCode());
|
|
iac.setUnderwritingStatus(UnderwritingStatus.US_2.getCode());
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,oldStatus,iac.getOrderstatus(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, oldStatus, iac.getOrderstatus(), "1");
|
|
|
insAreaCompanyService.updateCompanyAndOrdersMessage(iac, message);
|
|
insAreaCompanyService.updateCompanyAndOrdersMessage(iac, message);
|
|
|
return HttpResult.error(message);
|
|
return HttpResult.error(message);
|
|
|
}
|
|
}
|
|
@@ -396,7 +409,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
return HttpResult.error(message);
|
|
return HttpResult.error(message);
|
|
|
}
|
|
}
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,oldStatus,iac.getOrderstatus(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, oldStatus, iac.getOrderstatus(), "1");
|
|
|
InsUtils.buildOrderStatus(order, iac);
|
|
InsUtils.buildOrderStatus(order, iac);
|
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
|
|
|
//获取签名地址
|
|
//获取签名地址
|
|
@@ -449,7 +462,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
if (jqBoo || syBoo || jqSyBoo) {
|
|
if (jqBoo || syBoo || jqSyBoo) {
|
|
|
|
|
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,iac.getOrderstatus(),InsOrderStatusEnum.WAIT_PAY.getCode(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, iac.getOrderstatus(), InsOrderStatusEnum.WAIT_PAY.getCode(), "1");
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
//更新支付链接
|
|
//更新支付链接
|
|
|
SignatureResponse signature = guorenRequestApiComponent.signature(iac);
|
|
SignatureResponse signature = guorenRequestApiComponent.signature(iac);
|
|
@@ -476,7 +489,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
// 支付
|
|
// 支付
|
|
|
if (updateFlag) {
|
|
if (updateFlag) {
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,iac.getOrderstatus(),InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, iac.getOrderstatus(), InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(), "1");
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
guorenRequestApiComponent.queryNoCarPolicyNo(iac);
|
|
guorenRequestApiComponent.queryNoCarPolicyNo(iac);
|
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
@@ -628,9 +641,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult callBackApi(HttpServletRequest request) {
|
|
public HttpResult callBackApi(HttpServletRequest request) {
|
|
@@ -655,7 +665,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
InsAreaCompany iac = insAreaCompanyService.getByInsOrderNo(orderId);
|
|
InsAreaCompany iac = insAreaCompanyService.getByInsOrderNo(orderId);
|
|
|
if (null != iac) {
|
|
if (null != iac) {
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,iac.getOrderstatus(),InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, iac.getOrderstatus(), InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(), "1");
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
if (StringUtils.toInt(order.getOrderstatus()) < StringUtils.toInt(iac.getOrderstatus())) {
|
|
if (StringUtils.toInt(order.getOrderstatus()) < StringUtils.toInt(iac.getOrderstatus())) {
|
|
@@ -826,7 +836,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
for (PremiumResp.DataDTO.CiInsureDemandDTO ciInsureDemandDTO : ciInsureDemandDTOS) {
|
|
for (PremiumResp.DataDTO.CiInsureDemandDTO ciInsureDemandDTO : ciInsureDemandDTOS) {
|
|
|
if (GuoRenRiskCode.R_0507.getCode().equals(ciInsureDemandDTO.getRiskCode())) {
|
|
if (GuoRenRiskCode.R_0507.getCode().equals(ciInsureDemandDTO.getRiskCode())) {
|
|
|
quoteRespVo.setJqClaims(ciInsureDemandDTO.getClaimTimes());
|
|
quoteRespVo.setJqClaims(ciInsureDemandDTO.getClaimTimes());
|
|
|
- }else if(GuoRenRiskCode.R_0518.getCode().equals(ciInsureDemandDTO.getRiskCode())){
|
|
|
|
|
|
|
+ } else if (GuoRenRiskCode.R_0518.getCode().equals(ciInsureDemandDTO.getRiskCode())) {
|
|
|
quoteRespVo.setSyClaims(ciInsureDemandDTO.getClaimTimes());
|
|
quoteRespVo.setSyClaims(ciInsureDemandDTO.getClaimTimes());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1067,7 +1077,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
/**
|
|
/**
|
|
|
* 保费计算
|
|
* 保费计算
|
|
|
*/
|
|
*/
|
|
|
- public PremiumResp.DataDTO premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
|
|
|
|
+ public PremiumResp premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
CarPriceResp.DataDTO carPriceResult,
|
|
CarPriceResp.DataDTO carPriceResult,
|
|
|
VinQueryResp.DataDTO vinQ,
|
|
VinQueryResp.DataDTO vinQ,
|
|
|
boolean isNoCar,
|
|
boolean isNoCar,
|
|
@@ -1081,7 +1091,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar, specialAgreementVo, noCarPremium, goodsCode);
|
|
PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar, specialAgreementVo, noCarPremium, goodsCode);
|
|
|
PremiumResp resp;
|
|
PremiumResp resp;
|
|
|
-
|
|
|
|
|
|
|
+ int a = 0;
|
|
|
for (; ; ) {
|
|
for (; ; ) {
|
|
|
resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004, PremiumResp.class);
|
|
resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004, PremiumResp.class);
|
|
|
req.getCi().getPrpTmain().setAnswer(null);
|
|
req.getCi().getPrpTmain().setAnswer(null);
|
|
@@ -1089,19 +1099,26 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
//1、 交强险重复投保 替换时间
|
|
//1、 交强险重复投保 替换时间
|
|
|
boo = GuorenDuplicateInsuranceComponent.processor(resp, requestInfoList, req);
|
|
boo = GuorenDuplicateInsuranceComponent.processor(resp, requestInfoList, req);
|
|
|
if (boo) {
|
|
if (boo) {
|
|
|
|
|
+ a++;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
boo = GuorenDuplicateInsuranceComponent.theCheckCodeIsWrong(resp);
|
|
boo = GuorenDuplicateInsuranceComponent.theCheckCodeIsWrong(resp);
|
|
|
if (boo) {
|
|
if (boo) {
|
|
|
|
|
+ a++;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//2、 转保
|
|
//2、 转保
|
|
|
boo = GuorenDuplicateInsuranceComponent.buildCheckCodeParam(resp, requestInfoList, req);
|
|
boo = GuorenDuplicateInsuranceComponent.buildCheckCodeParam(resp, requestInfoList, req);
|
|
|
if (boo) {
|
|
if (boo) {
|
|
|
|
|
+ a++;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (a > 6) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1110,11 +1127,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
resp.getData().setBiStartDate(req.getBi().getPrpTmain().getStartDate());
|
|
resp.getData().setBiStartDate(req.getBi().getPrpTmain().getStartDate());
|
|
|
resp.getData().setBiEndDate(req.getBi().getPrpTmain().getEndDate());
|
|
resp.getData().setBiEndDate(req.getBi().getPrpTmain().getEndDate());
|
|
|
|
|
|
|
|
- if (resp.getResultCode() == 1) {
|
|
|
|
|
- throw new SystemException(resp.getResultMsg() == null ? "保费计算失败,请联系管理员" : resp.getResultMsg());
|
|
|
|
|
- }
|
|
|
|
|
- return resp.getData();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1215,11 +1228,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
// 支付
|
|
// 支付
|
|
|
if (updateFlag) {
|
|
if (updateFlag) {
|
|
|
//设置支付时间
|
|
//设置支付时间
|
|
|
- if(iac.getPayDate()==null){
|
|
|
|
|
|
|
+ if (iac.getPayDate() == null) {
|
|
|
iac.setPayDate(LocalDateTime.now());
|
|
iac.setPayDate(LocalDateTime.now());
|
|
|
}
|
|
}
|
|
|
// add by hxl 添加自动更新状态
|
|
// add by hxl 添加自动更新状态
|
|
|
- insSubOrderUpdateDetailService.insertData(iac,iac.getOrderstatus(),InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(),"1");
|
|
|
|
|
|
|
+ insSubOrderUpdateDetailService.insertData(iac, iac.getOrderstatus(), InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(), "1");
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
guorenRequestApiComponent.queryNoCarPolicyNo(iac);
|
|
guorenRequestApiComponent.queryNoCarPolicyNo(iac);
|
|
|
insAreaCompanyService.updateCompanyAndOrdersNew(iac);
|
|
insAreaCompanyService.updateCompanyAndOrdersNew(iac);
|
|
@@ -1232,11 +1245,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
public boolean cancelOrder(InsAreaCompany insAreaCompany) {
|
|
public boolean cancelOrder(InsAreaCompany insAreaCompany) {
|
|
|
String jqapplyno = insAreaCompany.getJqapplyno();
|
|
String jqapplyno = insAreaCompany.getJqapplyno();
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
- if(StringUtils.isNotEmpty(jqapplyno)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(jqapplyno)) {
|
|
|
list.add(jqapplyno);
|
|
list.add(jqapplyno);
|
|
|
}
|
|
}
|
|
|
String syapplyno = insAreaCompany.getSyapplyno();
|
|
String syapplyno = insAreaCompany.getSyapplyno();
|
|
|
- if(StringUtils.isNotEmpty(syapplyno)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(syapplyno)) {
|
|
|
list.add(syapplyno);
|
|
list.add(syapplyno);
|
|
|
}
|
|
}
|
|
|
|
|
|