|
|
@@ -699,6 +699,49 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
return HttpResult.ok("撤单成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean autoWriteOffOrder(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 true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 单商
|
|
|
+ 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 true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //交商同保
|
|
|
+ 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 true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
public QuoteRespVo getQuoteRespVo (YangGuangAccuracyCalculateResponse yangGuangAccuracyCalculateResponse, BaseQuoteInfoVo yaQuoteInfoVo, List<YgQuoteAccidentVo> accidentalDrivingVo, boolean isEnergy) {
|
|
|
double jqPremium = 0;
|
|
|
double syPremium = 0;
|