|
@@ -90,6 +90,15 @@ public class UnifyOrderManager {
|
|
|
OrderStateListener orderStateListener;
|
|
OrderStateListener orderStateListener;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ private String getSystemCode(){
|
|
|
|
|
+ //如果是APP登录的话 则传递SystemCode的头部字段
|
|
|
|
|
+ if(baseController.getUserSystemCode().equals("APP")){
|
|
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
+ return request.getHeader("system_code");
|
|
|
|
|
+ }
|
|
|
|
|
+ return baseController.getUserSystemCode();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取报价号
|
|
* 获取报价号
|
|
|
* @param licenseNo
|
|
* @param licenseNo
|
|
@@ -138,9 +147,9 @@ public class UnifyOrderManager {
|
|
|
public HttpResult quote(@RequestBody QuoteVo quoteVo) throws JsonProcessingException {
|
|
public HttpResult quote(@RequestBody QuoteVo quoteVo) throws JsonProcessingException {
|
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(quoteVo.getOrder().getInsuranceCompanyCode(), baseController.getToken());
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(quoteVo.getOrder().getInsuranceCompanyCode(), baseController.getToken());
|
|
|
AssertionUtils.isFail(esmInsCompanyHttpResult.getCode() != 200,esmInsCompanyHttpResult.getMsg());
|
|
AssertionUtils.isFail(esmInsCompanyHttpResult.getCode() != 200,esmInsCompanyHttpResult.getMsg());
|
|
|
- String systemCode = baseController.getAppSystemCode();
|
|
|
|
|
|
|
+ String systemCode = getSystemCode();
|
|
|
|
|
|
|
|
- String companyName = CompanyConstants.getCompanyNameByCode(quoteVo.getOrder().getInsuranceCompanyCode());
|
|
|
|
|
|
|
+ String companyName = CompanyConstants.getCompanyNameByCode(esmInsCompanyHttpResult.getData().getCompanyCode());
|
|
|
//先默认第一个协议
|
|
//先默认第一个协议
|
|
|
HttpResult<List<PtlAgreement>> byCompanyId = orgClient.getByCompanyId(esmInsCompanyHttpResult.getData().getId(), baseController.getToken(),systemCode);
|
|
HttpResult<List<PtlAgreement>> byCompanyId = orgClient.getByCompanyId(esmInsCompanyHttpResult.getData().getId(), baseController.getToken(),systemCode);
|
|
|
if(byCompanyId.getData().isEmpty()){
|
|
if(byCompanyId.getData().isEmpty()){
|
|
@@ -160,9 +169,6 @@ public class UnifyOrderManager {
|
|
|
QuoteInfoConverter.converterKindInfoVo(quoteVo.getKindInfoVo(), quoteKindMappingMap.get(QuoteRuleCategory.KIND.getCode()));
|
|
QuoteInfoConverter.converterKindInfoVo(quoteVo.getKindInfoVo(), quoteKindMappingMap.get(QuoteRuleCategory.KIND.getCode()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //更新用户的区划code
|
|
|
|
|
- setUserAreaCode(quoteVo);
|
|
|
|
|
-
|
|
|
|
|
// 生成订单
|
|
// 生成订单
|
|
|
String ordersNo = insOrdersService.generateOrders(quoteVo,companyName);
|
|
String ordersNo = insOrdersService.generateOrders(quoteVo,companyName);
|
|
|
|
|
|
|
@@ -182,32 +188,7 @@ public class UnifyOrderManager {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public void setUserAreaCode(QuoteVo quoteVo){
|
|
|
|
|
- HttpResult<PersonAreaVo> ownerAddress = orgClient.queryByAddress(
|
|
|
|
|
- quoteVo.getOwnersInfo().getAddr(), quoteVo.getOwnersInfo().getIdentifyNumber());
|
|
|
|
|
-
|
|
|
|
|
- HttpResult<PersonAreaVo> insuredAddress = quoteVo.getOwnersInfo().getIdentifyNumber()
|
|
|
|
|
- .equals(quoteVo.getInsuredPersonInfo().getIdentifyNumber())
|
|
|
|
|
- ? ownerAddress
|
|
|
|
|
- : orgClient.queryByAddress(quoteVo.getInsuredPersonInfo().getAddr(), quoteVo.getInsuredPersonInfo().getIdentifyNumber());
|
|
|
|
|
-
|
|
|
|
|
- HttpResult<PersonAreaVo> policyAddress = quoteVo.getPolicyHolderInfo().getIdentifyNumber()
|
|
|
|
|
- .equals(quoteVo.getOwnersInfo().getIdentifyNumber())
|
|
|
|
|
- ? ownerAddress
|
|
|
|
|
- : quoteVo.getPolicyHolderInfo().getIdentifyNumber().equals(quoteVo.getInsuredPersonInfo().getIdentifyNumber())
|
|
|
|
|
- ? insuredAddress
|
|
|
|
|
- : orgClient.queryByAddress(quoteVo.getPolicyHolderInfo().getAddr(), quoteVo.getPolicyHolderInfo().getIdentifyNumber());
|
|
|
|
|
-
|
|
|
|
|
- quoteVo.getOwnersInfo().setProvinceCode(ownerAddress.getData().getProvinceCode());
|
|
|
|
|
- quoteVo.getOwnersInfo().setCityCode(ownerAddress.getData().getCityCode());
|
|
|
|
|
- quoteVo.getOwnersInfo().setCountyCode(ownerAddress.getData().getCountyCode());
|
|
|
|
|
- quoteVo.getInsuredPersonInfo().setProvinceCode(insuredAddress.getData().getProvinceCode());
|
|
|
|
|
- quoteVo.getInsuredPersonInfo().setCityCode(insuredAddress.getData().getCityCode());
|
|
|
|
|
- quoteVo.getInsuredPersonInfo().setCountyCode(insuredAddress.getData().getCountyCode());
|
|
|
|
|
- quoteVo.getPolicyHolderInfo().setProvinceCode(policyAddress.getData().getProvinceCode());
|
|
|
|
|
- quoteVo.getPolicyHolderInfo().setCityCode(policyAddress.getData().getCityCode());
|
|
|
|
|
- quoteVo.getPolicyHolderInfo().setCountyCode(policyAddress.getData().getCountyCode());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Operation(summary = "统一核保")
|
|
@Operation(summary = "统一核保")
|
|
|
@PostMapping("/underwriting")
|
|
@PostMapping("/underwriting")
|
|
@@ -225,6 +206,7 @@ public class UnifyOrderManager {
|
|
|
|
|
|
|
|
InsOrdersPolicy insOrdersPolicy = insOrdersPolicyService.getById(insOrders.getId());
|
|
InsOrdersPolicy insOrdersPolicy = insOrdersPolicyService.getById(insOrders.getId());
|
|
|
|
|
|
|
|
|
|
+ //拼装参数
|
|
|
underwritingVo.setInsOrders(insOrders);
|
|
underwritingVo.setInsOrders(insOrders);
|
|
|
underwritingVo.setInsOrdersCarInfo(insOrdersCarInfo);
|
|
underwritingVo.setInsOrdersCarInfo(insOrdersCarInfo);
|
|
|
underwritingVo.setInsOrdersCarUserInfoList(insOrdersCarUserInfos);
|
|
underwritingVo.setInsOrdersCarUserInfoList(insOrdersCarUserInfos);
|
|
@@ -251,7 +233,7 @@ public class UnifyOrderManager {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "获取支付链接")
|
|
@Operation(summary = "获取支付链接")
|
|
|
@PostMapping("/getPaymentLink")
|
|
@PostMapping("/getPaymentLink")
|
|
|
- public HttpResult PaymentLinkService(@RequestBody PaymentLinkVo paymentLinkVo) throws JsonProcessingException {
|
|
|
|
|
|
|
+ public HttpResult getPaymentLink(@RequestBody PaymentLinkVo paymentLinkVo) throws JsonProcessingException {
|
|
|
//获取保司实体
|
|
//获取保司实体
|
|
|
InsOrders insOrders = insOrdersService.getById(paymentLinkVo.getOrder().getOrdersNo());
|
|
InsOrders insOrders = insOrdersService.getById(paymentLinkVo.getOrder().getOrdersNo());
|
|
|
AssertionUtils.isFail(Objects.isNull(insOrders),"订单不存在");
|
|
AssertionUtils.isFail(Objects.isNull(insOrders),"订单不存在");
|
|
@@ -271,7 +253,7 @@ public class UnifyOrderManager {
|
|
|
// 保存支付链接
|
|
// 保存支付链接
|
|
|
insOrders.setPayLink(paymentLinkResultsVo.getPaymentLink());
|
|
insOrders.setPayLink(paymentLinkResultsVo.getPaymentLink());
|
|
|
insOrdersService.updateById(insOrders);
|
|
insOrdersService.updateById(insOrders);
|
|
|
- return HttpResult.ok();
|
|
|
|
|
|
|
+ return HttpResult.ok("");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "影像上传")
|
|
@Operation(summary = "影像上传")
|
|
@@ -279,12 +261,8 @@ public class UnifyOrderManager {
|
|
|
public HttpResult imagesUpload(@RequestBody InsuranceUploadImageVo insuranceUploadImageVo) {
|
|
public HttpResult imagesUpload(@RequestBody InsuranceUploadImageVo insuranceUploadImageVo) {
|
|
|
InsOrders insOrders = insOrdersService.getById(insuranceUploadImageVo.getOrder().getOrdersNo());
|
|
InsOrders insOrders = insOrdersService.getById(insuranceUploadImageVo.getOrder().getOrdersNo());
|
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(insOrders.getCompanyId(), baseController.getToken());
|
|
HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(insOrders.getCompanyId(), baseController.getToken());
|
|
|
- String systemCode = "";
|
|
|
|
|
- //如果是APP登录的话 则传递SystemCode的头部字段
|
|
|
|
|
- if(baseController.getUserSystemCode().equals("APP")){
|
|
|
|
|
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
- systemCode = request.getHeader("system_code");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String systemCode = getSystemCode();
|
|
|
|
|
+
|
|
|
//先默认第一个协议
|
|
//先默认第一个协议
|
|
|
HttpResult<List<PtlAgreement>> byCompanyId = orgClient.getByCompanyId(insOrders.getCompanyId(), baseController.getToken(),systemCode);
|
|
HttpResult<List<PtlAgreement>> byCompanyId = orgClient.getByCompanyId(insOrders.getCompanyId(), baseController.getToken(),systemCode);
|
|
|
if(byCompanyId.getData().isEmpty()){
|
|
if(byCompanyId.getData().isEmpty()){
|