|
|
@@ -410,6 +410,46 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> auditStatusQuery(String companyId) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
+ // 1 通过 协议id获取配置实体
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ ZjConfigureParameters zjConfigureParameters = configureParametersComponents.toEntity(ZjConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ HttpHeaders httpHeaders = zijinRequestApiComponents.getHttpHeaders(insAreaCompany.getAgreementId());
|
|
|
+ // 2 请求查看订单状态
|
|
|
+ QueryOrderDetailRequest queryOrderDetailRequest = new QueryOrderDetailRequest(insAreaCompany.getInsOrderNo());
|
|
|
+ QueryOrderStateResponse response = zijinRequestApiComponents.queryOrderDetail(queryOrderDetailRequest,
|
|
|
+ httpHeaders);
|
|
|
+ // 3. 订单生效以后修改状态
|
|
|
+ String uwFlag = response.getUwFlag();
|
|
|
+
|
|
|
+ if (OrderStatusEnum.O_2.getCode().equals(uwFlag)) {
|
|
|
+ insAreaCompany.setJqpolicyno(response.getTciProposalNo());
|
|
|
+ insAreaCompany.setSypolicyno(response.getVciProposalNo());
|
|
|
+ // 2.2 投保单号
|
|
|
+ insAreaCompany.setJqapplyno(response.getTciPolicyNo());
|
|
|
+ insAreaCompany.setSyapplyno(response.getVciPolicyNo());
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
+ // 3. 聚合支付服务
|
|
|
+ BigDecimal multiply = insAreaCompany.getSumpremium().multiply(new BigDecimal(100));
|
|
|
+ ZbfAggregatePayRequest zbfAggregatePayRequest = new ZbfAggregatePayRequest(String.valueOf(multiply.intValue()),
|
|
|
+ zjConfigureParameters.getAppKey(), insAreaCompany.getId());
|
|
|
+ ZbfAggregatePayResponse zbfAggregatePayResponse = zijinRequestApiComponents.zbfAggregatePay(zbfAggregatePayRequest,
|
|
|
+ httpHeaders);
|
|
|
+ insAreaCompany.setPaymentLink(zbfAggregatePayResponse.getPayUrl());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.ok("核保成功");
|
|
|
+ } else if (OrderStatusEnum.O_3.getCode().equals(uwFlag)) {
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.error(OrderStatusEnum.O_3.getName() + ":" + response.getUwMsg());
|
|
|
+ }
|
|
|
+
|
|
|
+ return HttpResult.ok("核保状态未修改");
|
|
|
+ }
|
|
|
+
|
|
|
public QuoteRespVo getQuoteRespVo(CalculatePremiumResponse calculatePremiumResponse, BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
List<ZjQuoteAccidentVo> accidentalDrivingVo, boolean isEnergy) {
|
|
|
double jqPremium = 0;
|