|
@@ -127,6 +127,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
// 如果险种为单商或交商 需要报两次价 将第一次报出的车实际价值取到
|
|
// 如果险种为单商或交商 需要报两次价 将第一次报出的车实际价值取到
|
|
|
//报价
|
|
//报价
|
|
|
InsOrders insOrders = insOrdersService.getById(quoteInfoVo.getOrderNo());
|
|
InsOrders insOrders = insOrdersService.getById(quoteInfoVo.getOrderNo());
|
|
|
|
|
+ quoteInfoVo.setProductId(insOrders.getProductid());
|
|
|
|
|
|
|
|
YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest = new YangGuangAccuracyCalculateRequest(quoteInfoVo, purchasePrice, carModelList1, riskList.get(0),startDate,ygConfigureParameters,quoteVo);
|
|
YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest = new YangGuangAccuracyCalculateRequest(quoteInfoVo, purchasePrice, carModelList1, riskList.get(0),startDate,ygConfigureParameters,quoteVo);
|
|
|
yangGuangAccuracyCalculateRequest.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
|
|
yangGuangAccuracyCalculateRequest.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
|
|
@@ -301,7 +302,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
YangGuangSubmitRequest yangGuangSubmitRequest = new YangGuangSubmitRequest(insOrders, insAreaCompany, productid, ygConfigureParameters);
|
|
YangGuangSubmitRequest yangGuangSubmitRequest = new YangGuangSubmitRequest(insOrders, insAreaCompany, productid, ygConfigureParameters);
|
|
|
YangGuangSubmitResponse yangGuangSubmitResponse = yangGuangRequestApiComponents.submit(yangGuangSubmitRequest);
|
|
YangGuangSubmitResponse yangGuangSubmitResponse = yangGuangRequestApiComponents.submit(yangGuangSubmitRequest);
|
|
|
if (!yangGuangSubmitResponse.getErrorCode().equals("0")) {
|
|
if (!yangGuangSubmitResponse.getErrorCode().equals("0")) {
|
|
|
- return HttpResult.error(yangGuangSubmitResponse.message(yangGuangSubmitResponse.getErrorMessage()));
|
|
|
|
|
|
|
+ return HttpResult.error(yangGuangSubmitResponse.getErrorMessage());
|
|
|
}
|
|
}
|
|
|
if (yangGuangSubmitResponse.getCiProposalNo() != null) {
|
|
if (yangGuangSubmitResponse.getCiProposalNo() != null) {
|
|
|
insAreaCompany.setJqapplyno(yangGuangSubmitResponse.getCiProposalNo());
|
|
insAreaCompany.setJqapplyno(yangGuangSubmitResponse.getCiProposalNo());
|
|
@@ -656,7 +657,50 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean autoWriteOff(String companyId) throws Exception {
|
|
|
|
|
|
|
+ public HttpResult<Object> autoWriteOff(String companyId) throws Exception {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
|
|
+ YangGuangConfigureParameters ygConfigureParameters = configureParametersComponents.toEntity(YangGuangConfigureParameters.class,
|
|
|
|
|
+ insAreaCompany.getAgreementId());
|
|
|
|
|
+ String productid = insAreaCompany.getProductid();
|
|
|
|
|
+ //单交
|
|
|
|
|
+ if (productid.equals("0330")) {
|
|
|
|
|
+ YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
|
|
|
|
|
+ YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponse = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequest);
|
|
|
|
|
+ if (yangGuangAutoWriteOffResponse.getErrorCode().equals("0")) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("撤单成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 单商
|
|
|
|
|
+ if (productid.equals("034001")) {
|
|
|
|
|
+ YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSyapplyno());
|
|
|
|
|
+ YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponse = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequest);
|
|
|
|
|
+ if (yangGuangAutoWriteOffResponse.getErrorCode().equals("0")) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("撤单成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //交商同保
|
|
|
|
|
+ if (insAreaCompany.getJqpolicyno() != null && insAreaCompany.getSypolicyno() != null && !insAreaCompany.getJqpolicyno().equals("") && !insAreaCompany.getSypolicyno().equals("")) {
|
|
|
|
|
+ YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestJq = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
|
|
|
|
|
+ YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseJq = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestJq);
|
|
|
|
|
+ YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestSy = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSyapplyno());
|
|
|
|
|
+ YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseSy = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestSy);
|
|
|
|
|
+ if (yangGuangAutoWriteOffResponseJq.getErrorCode().equals("0") && yangGuangAutoWriteOffResponseSy.getErrorCode().equals("0")) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("撤单成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return HttpResult.error("撤单失败,原因:"+ yangGuangAutoWriteOffResponseSy.getErrorMessage() + yangGuangAutoWriteOffResponseJq.getErrorMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return HttpResult.ok("撤单成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean autoWriteOffOrder(String companyId) throws Exception {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
YangGuangConfigureParameters ygConfigureParameters = configureParametersComponents.toEntity(YangGuangConfigureParameters.class,
|
|
YangGuangConfigureParameters ygConfigureParameters = configureParametersComponents.toEntity(YangGuangConfigureParameters.class,
|
|
|
insAreaCompany.getAgreementId());
|
|
insAreaCompany.getAgreementId());
|
|
@@ -681,7 +725,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //交商同保
|
|
|
|
|
|
|
+ //交商同保
|
|
|
if (insAreaCompany.getJqpolicyno() != null && insAreaCompany.getSypolicyno() != null && !insAreaCompany.getJqpolicyno().equals("") && !insAreaCompany.getSypolicyno().equals("")) {
|
|
if (insAreaCompany.getJqpolicyno() != null && insAreaCompany.getSypolicyno() != null && !insAreaCompany.getJqpolicyno().equals("") && !insAreaCompany.getSypolicyno().equals("")) {
|
|
|
YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestJq = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
|
|
YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestJq = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
|
|
|
YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseJq = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestJq);
|
|
YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseJq = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestJq);
|
|
@@ -731,7 +775,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
quoteRespVo.setSyScore(discount.getMarkingnobcBI() != null ? discount.getMarkingnobcBI() : "");
|
|
quoteRespVo.setSyScore(discount.getMarkingnobcBI() != null ? discount.getMarkingnobcBI() : "");
|
|
|
quoteRespVo.setJqLossRation(Double.parseDouble(discount.getFinalmarkingnoCi() != null ? discount.getFinalmarkingnoCi() : "0.00"));
|
|
quoteRespVo.setJqLossRation(Double.parseDouble(discount.getFinalmarkingnoCi() != null ? discount.getFinalmarkingnoCi() : "0.00"));
|
|
|
quoteRespVo.setSyLossRation(Double.parseDouble(discount.getFinalmarkingnoBi() != null ? discount.getFinalmarkingnoBi() : "0.00"));
|
|
quoteRespVo.setSyLossRation(Double.parseDouble(discount.getFinalmarkingnoBi() != null ? discount.getFinalmarkingnoBi() : "0.00"));
|
|
|
- quoteRespVo.setMergeCostRate(Double.parseDouble(yangGuangAccuracyCalculateResponse.getVascostmarginbc() != null ?yangGuangAccuracyCalculateResponse.getVascostmarginbc() : "0.00"));
|
|
|
|
|
|
|
+ quoteRespVo.setMergeCostRate(yangGuangAccuracyCalculateResponse.getVascostmarginbc() != null ?yangGuangAccuracyCalculateResponse.getVascostmarginbc() : "0.00");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<QuoteKindRespVo> kindList1 = new ArrayList<>();
|
|
List<QuoteKindRespVo> kindList1 = new ArrayList<>();
|
|
@@ -786,6 +830,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
|
|
quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
|
|
|
quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax, jyPremium));//保费合计
|
|
quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax, jyPremium));//保费合计
|
|
|
quoteRespVo.setTotalAdjustRate(0);
|
|
quoteRespVo.setTotalAdjustRate(0);
|
|
|
|
|
+ quoteRespVo.setMergeCostRate(yangGuangAccuracyCalculateResponse.getVascostmarginbc());
|
|
|
quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo()); //订单号
|
|
quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo()); //订单号
|
|
|
return quoteRespVo;
|
|
return quoteRespVo;
|
|
|
}
|
|
}
|
|
@@ -802,7 +847,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(yangGuangAccuracyCalculateResponse)));
|
|
insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(yangGuangAccuracyCalculateResponse)));
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
insAreaCompany.setInsOrderNo(yangGuangAccuracyCalculateResponse.getInfotransNo());
|
|
insAreaCompany.setInsOrderNo(yangGuangAccuracyCalculateResponse.getInfotransNo());
|
|
|
- insAreaCompany.setMergeCostRate(Double.parseDouble(yangGuangAccuracyCalculateResponse.getVascostmarginbc()));
|
|
|
|
|
|
|
+ insAreaCompany.setMergeCostRate(quoteRespVo.getMergeCostRate());
|
|
|
InsOrders insOrders = insOrdersService.getById(orderId);
|
|
InsOrders insOrders = insOrdersService.getById(orderId);
|
|
|
//车船税
|
|
//车船税
|
|
|
if (!insOrders.getProductid().equals("034001") && !insOrders.getProductid().equals("034002")) {
|
|
if (!insOrders.getProductid().equals("034001") && !insOrders.getProductid().equals("034002")) {
|