|
@@ -24,6 +24,7 @@ import com.jzg.quotation.commons.entity.vo.aggregated.*;
|
|
|
import com.jzg.quotation.commons.entity.vo.orders.InsOrdersVo;
|
|
import com.jzg.quotation.commons.entity.vo.orders.InsOrdersVo;
|
|
|
import com.jzg.quotation.commons.service.QuotationBaseService;
|
|
import com.jzg.quotation.commons.service.QuotationBaseService;
|
|
|
import com.jzg.quotation.commons.utils.SnowFlakeUtil;
|
|
import com.jzg.quotation.commons.utils.SnowFlakeUtil;
|
|
|
|
|
+import com.jzg.quotation.summary.constants.QuoteNumberConstant;
|
|
|
import com.jzg.quotation.summary.converter.QuoteInfoConverter;
|
|
import com.jzg.quotation.summary.converter.QuoteInfoConverter;
|
|
|
import com.jzg.quotation.summary.entity.po.QuoteRuleMapping;
|
|
import com.jzg.quotation.summary.entity.po.QuoteRuleMapping;
|
|
|
import com.jzg.quotation.summary.factory.CompanyFactory;
|
|
import com.jzg.quotation.summary.factory.CompanyFactory;
|
|
@@ -116,6 +117,8 @@ public class UnifyOrderManager {
|
|
|
|
|
|
|
|
@Value("${minio.bucket-name}")
|
|
@Value("${minio.bucket-name}")
|
|
|
private String bucketName;
|
|
private String bucketName;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private InsOrdersTrackService insOrdersTrackService;
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getSystemCode() {
|
|
private String getSystemCode() {
|
|
@@ -212,6 +215,20 @@ public class UnifyOrderManager {
|
|
|
quoteResultsVo.setQuoteStatus(quoteResultsVo.getQuoteStatusEnum().getCode());
|
|
quoteResultsVo.setQuoteStatus(quoteResultsVo.getQuoteStatusEnum().getCode());
|
|
|
quoteResultsVo.setOrdersNo(ordersNo);
|
|
quoteResultsVo.setOrdersNo(ordersNo);
|
|
|
|
|
|
|
|
|
|
+ // 报价轨迹
|
|
|
|
|
+ String optContent = baseController.getUserName() + "提交了报价";
|
|
|
|
|
+ InsOrdersTrack track = new InsOrdersTrack(ordersNo,
|
|
|
|
|
+ companyName,
|
|
|
|
|
+ quoteVo.getCarInfoVo().getLicenseNo(),
|
|
|
|
|
+ quoteResultsVo.getQuoteStatus().equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())
|
|
|
|
|
+ ? QuoteNumberConstant.QuoteResult.SUCCESS.getCode()
|
|
|
|
|
+ : QuoteNumberConstant.QuoteResult.FAIL.getCode(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteOptType.OPT_TYPE_1.getCode(),
|
|
|
|
|
+ optContent,
|
|
|
|
|
+ quoteResultsVo.getErrorMessage()
|
|
|
|
|
+ );
|
|
|
|
|
+ insOrdersTrackService.save(track);
|
|
|
|
|
+
|
|
|
// 报价后更新订单
|
|
// 报价后更新订单
|
|
|
insOrdersService.orderAfterUpdateQuote(ordersNo, quoteResultsVo);
|
|
insOrdersService.orderAfterUpdateQuote(ordersNo, quoteResultsVo);
|
|
|
return quoteResultsVo.getQuoteStatusEnum()
|
|
return quoteResultsVo.getQuoteStatusEnum()
|
|
@@ -255,6 +272,16 @@ public class UnifyOrderManager {
|
|
|
insOrdersService.orderAfterUpdateUnderwriting(underwritingResultsVo);
|
|
insOrdersService.orderAfterUpdateUnderwriting(underwritingResultsVo);
|
|
|
|
|
|
|
|
if (underwritingResultsVo.getUnderwritingStatus().equals(InsOrderStatusEnum.PAY_PENDING)) {
|
|
if (underwritingResultsVo.getUnderwritingStatus().equals(InsOrderStatusEnum.PAY_PENDING)) {
|
|
|
|
|
+ // 核保轨迹
|
|
|
|
|
+ String optContent = baseController.getUserName() + "提交了核保";
|
|
|
|
|
+ InsOrdersTrack track = new InsOrdersTrack(insOrders.getId(),
|
|
|
|
|
+ insOrders.getCompanyId(),
|
|
|
|
|
+ insOrdersCarInfo.getLicenseNo(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteResult.SUCCESS.getCode(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteOptType.OPT_TYPE_5.getCode(),
|
|
|
|
|
+ optContent,null
|
|
|
|
|
+ );
|
|
|
|
|
+ insOrdersTrackService.save(track);
|
|
|
return HttpResult.ok("核保成功");
|
|
return HttpResult.ok("核保成功");
|
|
|
} else {
|
|
} else {
|
|
|
if (underwritingResultsVo.getUnderwritingStatus().equals(InsOrderStatusEnum.AUDIT_FAIL)) {
|
|
if (underwritingResultsVo.getUnderwritingStatus().equals(InsOrderStatusEnum.AUDIT_FAIL)) {
|
|
@@ -263,6 +290,17 @@ public class UnifyOrderManager {
|
|
|
insOrders.setOrderStatus(String.valueOf(stateFailResult.getCurrentState()));
|
|
insOrders.setOrderStatus(String.valueOf(stateFailResult.getCurrentState()));
|
|
|
insOrdersService.updateById(insOrders);
|
|
insOrdersService.updateById(insOrders);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 核保轨迹
|
|
|
|
|
+ String optContent = baseController.getUserName() + "提交了核保";
|
|
|
|
|
+ InsOrdersTrack track = new InsOrdersTrack(insOrders.getId(),
|
|
|
|
|
+ insOrders.getCompanyId(),
|
|
|
|
|
+ insOrdersCarInfo.getLicenseNo(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteResult.FAIL.getCode(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteOptType.OPT_TYPE_5.getCode(),
|
|
|
|
|
+ optContent,
|
|
|
|
|
+ underwritingResultsVo.getUnderwritingResult()
|
|
|
|
|
+ );
|
|
|
|
|
+ insOrdersTrackService.save(track);
|
|
|
throw new SystemException(underwritingResultsVo.getUnderwritingResult());
|
|
throw new SystemException(underwritingResultsVo.getUnderwritingResult());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -280,6 +318,7 @@ public class UnifyOrderManager {
|
|
|
//获取保司实体
|
|
//获取保司实体
|
|
|
InsOrders insOrders = insOrdersService.getById(paymentLinkVo.getOrder().getOrdersNo());
|
|
InsOrders insOrders = insOrdersService.getById(paymentLinkVo.getOrder().getOrdersNo());
|
|
|
AssertionUtils.isFail(Objects.isNull(insOrders), "订单不存在");
|
|
AssertionUtils.isFail(Objects.isNull(insOrders), "订单不存在");
|
|
|
|
|
+ InsOrdersCarInfo insOrdersCarInfo = insOrdersCarInfoService.getByOrderId(insOrders.getId());
|
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(insOrders.getCompanyId(), baseController.getToken());
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(insOrders.getCompanyId(), baseController.getToken());
|
|
|
QuotationBaseService quoteService = companyFactory.getPaymentLinkService(insOrders, esmInsCompanyHttpResult.getData()
|
|
QuotationBaseService quoteService = companyFactory.getPaymentLinkService(insOrders, esmInsCompanyHttpResult.getData()
|
|
|
.getCompanyCode(), baseController, paymentLinkVo);
|
|
.getCompanyCode(), baseController, paymentLinkVo);
|
|
@@ -298,6 +337,17 @@ public class UnifyOrderManager {
|
|
|
insOrders.setPayLink(paymentLinkResultsVo.getPaymentLink());
|
|
insOrders.setPayLink(paymentLinkResultsVo.getPaymentLink());
|
|
|
insOrdersService.updateById(insOrders);
|
|
insOrdersService.updateById(insOrders);
|
|
|
insOrdersQrcodeService.saveQrCode(insOrders);
|
|
insOrdersQrcodeService.saveQrCode(insOrders);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取支付链接轨迹
|
|
|
|
|
+ String optContent = baseController.getUserName() + "请求获取支付码";
|
|
|
|
|
+ InsOrdersTrack track = new InsOrdersTrack(insOrders.getId(),
|
|
|
|
|
+ insOrders.getCompanyId(),
|
|
|
|
|
+ insOrdersCarInfo.getLicenseNo(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteResult.SUCCESS.getCode(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteOptType.OPT_TYPE_6.getCode(),
|
|
|
|
|
+ optContent,null
|
|
|
|
|
+ );
|
|
|
|
|
+ insOrdersTrackService.save(track);
|
|
|
return HttpResult.ok("");
|
|
return HttpResult.ok("");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -407,7 +457,16 @@ public class UnifyOrderManager {
|
|
|
}
|
|
}
|
|
|
insOrdersPdfUrlService.save(insOrdersPdfUrl);
|
|
insOrdersPdfUrlService.save(insOrdersPdfUrl);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 下载保单轨迹
|
|
|
|
|
+ String optContent = baseController.getUserName() + "请求下载电子保单";
|
|
|
|
|
+ InsOrdersTrack track = new InsOrdersTrack(insOrders.getId(),
|
|
|
|
|
+ insOrders.getCompanyId(),
|
|
|
|
|
+ carInfo.getLicenseNo(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteResult.SUCCESS.getCode(),
|
|
|
|
|
+ QuoteNumberConstant.QuoteOptType.OPT_TYPE_8.getCode(),
|
|
|
|
|
+ optContent,null
|
|
|
|
|
+ );
|
|
|
|
|
+ insOrdersTrackService.save(track);
|
|
|
return HttpResult.ok(insOrdersPdfUrl);
|
|
return HttpResult.ok(insOrdersPdfUrl);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|