|
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.ydtech.config.properties.GuorenApiConfigurationProperties;
|
|
import com.ydtech.config.properties.GuorenApiConfigurationProperties;
|
|
|
import com.ydtech.constants.InsuranceEnum;
|
|
import com.ydtech.constants.InsuranceEnum;
|
|
|
import com.ydtech.constants.enums.InsQuoteFlow;
|
|
import com.ydtech.constants.enums.InsQuoteFlow;
|
|
@@ -26,7 +25,7 @@ import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
|
import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
|
|
import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
|
|
|
import com.ydtech.modules.ins.model.InsApiLog;
|
|
import com.ydtech.modules.ins.model.InsApiLog;
|
|
|
-import com.ydtech.modules.ins.model.guoRen.*;
|
|
|
|
|
|
|
+import com.ydtech.modules.ins.model.guoren.*;
|
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
|
import com.ydtech.modules.ins.model.ya.CarModel_Req;
|
|
import com.ydtech.modules.ins.model.ya.CarModel_Req;
|
|
|
import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
@@ -58,7 +57,6 @@ import lombok.Data;
|
|
|
import org.apache.commons.httpclient.methods.multipart.FilePart;
|
|
import org.apache.commons.httpclient.methods.multipart.FilePart;
|
|
|
import org.apache.commons.httpclient.methods.multipart.Part;
|
|
import org.apache.commons.httpclient.methods.multipart.Part;
|
|
|
import org.apache.commons.httpclient.methods.multipart.StringPart;
|
|
import org.apache.commons.httpclient.methods.multipart.StringPart;
|
|
|
-import org.apache.poi.hssf.record.SSTRecord;
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -82,19 +80,19 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
@Service
|
|
|
public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger("guoRen");
|
|
private static final Logger log = LoggerFactory.getLogger("guoRen");
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private GuorenApiConfigurationProperties properties;
|
|
|
|
|
-
|
|
|
|
|
@Value("${upload.file.path}")
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadFilePath;
|
|
private String uploadFilePath;
|
|
|
@Value("${upload.file.url}")
|
|
@Value("${upload.file.url}")
|
|
|
|
|
+
|
|
|
private String showFileUrl;
|
|
private String showFileUrl;
|
|
|
|
|
+
|
|
|
@Value("${api.url}")
|
|
@Value("${api.url}")
|
|
|
private String apiUrl;
|
|
private String apiUrl;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private GuorenApiConfigurationProperties properties;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsAlltrustRegionMapper insAlltrustRegionMapper;
|
|
private InsAlltrustRegionMapper insAlltrustRegionMapper;
|
|
@@ -102,8 +100,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsOrdersComponents insOrdersComponents;
|
|
private InsOrdersComponents insOrdersComponents;
|
|
|
|
|
|
|
|
- private ObjectMapper xmlMapper = null;
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsAreaCompanyService insAreaCompanyService;
|
|
private InsAreaCompanyService insAreaCompanyService;
|
|
|
|
|
|
|
@@ -120,21 +116,19 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
private EsmInsCompanyService esmInsCompanyService;
|
|
private EsmInsCompanyService esmInsCompanyService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- InsApiLogService insApiLogService;
|
|
|
|
|
|
|
+ private InsApiLogService insApiLogService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- ConfigureParametersComponents configureParametersComponents;
|
|
|
|
|
|
|
+ private ConfigureParametersComponents configureParametersComponents;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- InsTaskImagesMapper insTaskImagesMapper;
|
|
|
|
|
|
|
+ private InsTaskImagesMapper insTaskImagesMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private GuorenRequestApiComponent guorenRequestApiComponent;
|
|
private GuorenRequestApiComponent guorenRequestApiComponent;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private static ChannelInfoDto channelInfo = null;
|
|
private static ChannelInfoDto channelInfo = null;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//
|
|
//
|
|
|
//==============================API 方式
|
|
//==============================API 方式
|
|
|
//
|
|
//
|
|
@@ -149,9 +143,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
public HttpResult gainChannelInfo(String thirdCode) {
|
|
public HttpResult gainChannelInfo(String thirdCode) {
|
|
|
Map m = new HashMap();
|
|
Map m = new HashMap();
|
|
|
m.put("thirdCode", thirdCode);
|
|
m.put("thirdCode", thirdCode);
|
|
|
-// String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
|
|
|
|
|
ChannelInfoResp request = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00018, ChannelInfoResp.class);
|
|
ChannelInfoResp request = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00018, ChannelInfoResp.class);
|
|
|
-
|
|
|
|
|
return HttpResult.ok(request);
|
|
return HttpResult.ok(request);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -177,13 +169,12 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
|
|
|
- if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
|
|
|
|
|
|
|
+
|
|
|
this.channelInfo = channelInfo;
|
|
this.channelInfo = channelInfo;
|
|
|
|
|
|
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 1、vin码查询
|
|
* 1、vin码查询
|
|
|
*/
|
|
*/
|
|
@@ -196,27 +187,20 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
VinQueryResp.DataDTO vinQ = vinQuery(vinQueryReq);
|
|
VinQueryResp.DataDTO vinQ = vinQuery(vinQueryReq);
|
|
|
if (null == vinQ) return HttpResult.error("未找到匹配的车辆信息");
|
|
if (null == vinQ) return HttpResult.error("未找到匹配的车辆信息");
|
|
|
log.debug("vin码查询通过---");
|
|
log.debug("vin码查询通过---");
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 2、车价查询
|
|
* 2、车价查询
|
|
|
*/
|
|
*/
|
|
|
CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ);
|
|
CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ);
|
|
|
if (null == carPriceResult) return HttpResult.error("车价获取失败");
|
|
if (null == carPriceResult) return HttpResult.error("车价获取失败");
|
|
|
// String redisNum = buildCarPriceQueryUidNum(order.getOrderno());
|
|
// String redisNum = buildCarPriceQueryUidNum(order.getOrderno());
|
|
|
-
|
|
|
|
|
log.debug("车价查询通过");
|
|
log.debug("车价查询通过");
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 3、保费计算
|
|
* 3、保费计算
|
|
|
*/
|
|
*/
|
|
|
PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ);
|
|
PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ);
|
|
|
-
|
|
|
|
|
if (null == premiumResult) return HttpResult.error("保费计算失败");
|
|
if (null == premiumResult) return HttpResult.error("保费计算失败");
|
|
|
log.debug("保费计算通过");
|
|
log.debug("保费计算通过");
|
|
|
-
|
|
|
|
|
//转保
|
|
//转保
|
|
|
-
|
|
|
|
|
-//
|
|
|
|
|
// /**
|
|
// /**
|
|
|
// * 创建非车订单
|
|
// * 创建非车订单
|
|
|
// */
|
|
// */
|
|
@@ -259,14 +243,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
}
|
|
}
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//核保基本赋值
|
|
//核保基本赋值
|
|
|
iac.setAudittime(LocalDateTime.now());
|
|
iac.setAudittime(LocalDateTime.now());
|
|
|
iac.setAuditid(order.getUserid());
|
|
iac.setAuditid(order.getUserid());
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
|
|
|
|
|
-
|
|
|
|
|
//2、核保
|
|
//2、核保
|
|
|
SubmitAuditResp auditResp = submitAudit(iac);
|
|
SubmitAuditResp auditResp = submitAudit(iac);
|
|
|
|
|
|
|
@@ -435,21 +416,15 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult pay(String companyId) {
|
|
public HttpResult pay(String companyId) {
|
|
|
-
|
|
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo("115");
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo("115");
|
|
|
if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
|
|
if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
|
|
|
this.channelInfo = channelInfo;
|
|
this.channelInfo = channelInfo;
|
|
|
-
|
|
|
|
|
//子订单
|
|
//子订单
|
|
|
InsAreaCompany iac = insAreaCompanyService.getById(companyId);
|
|
InsAreaCompany iac = insAreaCompanyService.getById(companyId);
|
|
|
if (iac == null) {
|
|
if (iac == null) {
|
|
|
return HttpResult.error("订单不存在");
|
|
return HttpResult.error("订单不存在");
|
|
|
}
|
|
}
|
|
|
- InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
-
|
|
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
|
|
|
|
|
-
|
|
|
|
|
//获取缴费地址
|
|
//获取缴费地址
|
|
|
PayResp.DataDTO payResp = pay(iac);
|
|
PayResp.DataDTO payResp = pay(iac);
|
|
|
iac.setPaymentLink(payResp.getPayUrl());
|
|
iac.setPaymentLink(payResp.getPayUrl());
|