|
|
@@ -20,13 +20,12 @@ import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
import com.ydtech.modules.order.components.InsImagesUploadCacheComponents;
|
|
|
import com.ydtech.modules.order.components.chengtai.ChengTaiRequestApiComponent;
|
|
|
import com.ydtech.modules.order.components.chengtai.ChengTaiRequestApiComponents;
|
|
|
-import com.ydtech.modules.order.components.gouren.GuorenDuplicateInsuranceComponent;
|
|
|
import com.ydtech.modules.order.constants.QuoteNumberConstant;
|
|
|
import com.ydtech.modules.order.dao.SysQuoteRecordMapper;
|
|
|
import com.ydtech.modules.order.entity.*;
|
|
|
import com.ydtech.modules.order.entity.api.chengtai.SecurityUrl;
|
|
|
-import com.ydtech.modules.order.entity.api.chengtai.XmlDateTimeFormatter;
|
|
|
-import com.ydtech.modules.order.entity.api.chengtai.constants.*;
|
|
|
+import com.ydtech.modules.order.entity.api.chengtai.constants.CarActualValueEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.chengtai.constants.KindCodeEnum;
|
|
|
import com.ydtech.modules.order.entity.api.chengtai.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.chengtai.response.*;
|
|
|
import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
|
|
|
@@ -43,7 +42,10 @@ import com.ydtech.modules.order.service.*;
|
|
|
import com.ydtech.modules.order.utils.TimeProcessing;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
-import com.ydtech.utils.*;
|
|
|
+import com.ydtech.utils.CalculateUtils;
|
|
|
+import com.ydtech.utils.HttpUtil;
|
|
|
+import com.ydtech.utils.JsonUtils;
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
import com.ydtech.utils.baidu.FileUtil;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -54,12 +56,9 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.OffsetDateTime;
|
|
|
-import java.time.ZoneOffset;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
@@ -133,6 +132,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
Integer maxQuoteNum = quoteVo.getMaxQuoteNum();
|
|
|
|
|
|
List<SysQuoteRecord> sysQuoteRecords = new ArrayList<>();
|
|
|
+
|
|
|
/** 1. 协议id获取配置实体 */
|
|
|
String agreementId = quoteVo.getAgreementId();
|
|
|
// 账号信息
|
|
|
@@ -140,33 +140,36 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
// 通过 协议id获取配置实体
|
|
|
ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
+
|
|
|
/** 2. 查询并过滤车辆车型 */
|
|
|
CarModelQueryRequest carModelQueryRequest = new CarModelQueryRequest(quoteInfoVo.getCarInfo());
|
|
|
CarModelQueryResponse carModelQueryResponse = chengTaiRequestApiComponent.carModelQuery(carModelQueryRequest);
|
|
|
CarModelQueryResponse.vehicle vehicle =
|
|
|
new CarModelsFilterUtils<CarModelQueryResponse.vehicle>().to(carModelQueryResponse.getVehicleList(),
|
|
|
quoteInfoVo.getCarInfo());
|
|
|
+
|
|
|
/** 3. 计算车辆实际价值 */
|
|
|
- BigDecimal carActualValue = calculateCarActualValue(vehicle,quoteInfoVo.getCarInfo());
|
|
|
+ BigDecimal carActualValue = calculateCarActualValue(vehicle, quoteInfoVo.getCarInfo());
|
|
|
+
|
|
|
/** 4. 报价 */
|
|
|
- PremiumCalculationRequest premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo,carActualValue,parameters,vehicle,quoteVo,quoteInfoVo.getRiskList(),null);
|
|
|
+ PremiumCalculationRequest premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), null);
|
|
|
PremiumCalculationResponse premiumCalculationResponse
|
|
|
- = getResponse(premiumCalculationRequest,quoteInfoVo,maxQuoteNum,sysQuoteRecords,carActualValue,parameters,vehicle,quoteVo);
|
|
|
+ = getResponse(premiumCalculationRequest, quoteInfoVo, maxQuoteNum, sysQuoteRecords, carActualValue, parameters, vehicle, quoteVo);
|
|
|
// 报价失败
|
|
|
if (!premiumCalculationResponse.getHead().getResponseCode().equals("0000")) {
|
|
|
InsOrders insOrders = insOrdersService.getById(quoteVo.getOrderNo());
|
|
|
InsOrderStatusEnum insOrderStatusEnum = InsOrderStatusEnum.QUOTE_FAILED;
|
|
|
- String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, insOrders, premiumCalculationResponse.getHead().getErrorMessage(), insOrderStatusEnum);
|
|
|
- SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
+ String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, quoteInfoVo, ptlAgreementAttribution, insOrders, premiumCalculationResponse.getHead().getErrorMessage(), insOrderStatusEnum);
|
|
|
+ SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), quoteVo.getCompanyId(), quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
+ QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
sysQuoteRecords.add(sysQuoteRecord);
|
|
|
//存储报价记录
|
|
|
- sysQuoteRecords.forEach(item->{
|
|
|
+ sysQuoteRecords.forEach(item -> {
|
|
|
item.setSubOrderNo(subOrderNo);
|
|
|
});
|
|
|
sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
|
|
|
//刷新redis中的报价次数
|
|
|
- sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(),quoteInfoVo.getUserid(),sysQuoteRecords);
|
|
|
+ sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
|
|
|
throw new SystemException(premiumCalculationResponse.getHead().getErrorMessage());
|
|
|
}
|
|
|
// 订单号
|
|
|
@@ -176,24 +179,24 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
// 处理报价数据
|
|
|
QuoteRespVo quoteRespVo = getQuoteRespVo(premiumCalculationResponse, quoteInfoVo);
|
|
|
quoteRespVo.setCoreModels(vehicle.toCoreModelsVo());
|
|
|
- HttpResult<QuoteRespVo> quoteRespVoHttpResult = respOrder(premiumCalculationResponse, quoteRespVo, ptlAgreementAttribution, orderNumber, quoteInfoVo,premiumCalculationRequest);
|
|
|
- SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
|
|
|
+ HttpResult<QuoteRespVo> quoteRespVoHttpResult = respOrder(premiumCalculationResponse, quoteRespVo, ptlAgreementAttribution, orderNumber, quoteInfoVo, premiumCalculationRequest);
|
|
|
+ SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), quoteVo.getCompanyId(), quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
+ QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(), QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
|
|
|
sysQuoteRecords.add(sysQuoteRecord);
|
|
|
//存储报价记录
|
|
|
- sysQuoteRecords.forEach(item->{
|
|
|
+ sysQuoteRecords.forEach(item -> {
|
|
|
item.setSubOrderNo(quoteRespVoHttpResult.getData().getCompanyId());
|
|
|
});
|
|
|
sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
|
|
|
|
|
|
- sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(),quoteInfoVo.getUserid(),sysQuoteRecords);
|
|
|
+ sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
|
|
|
return quoteRespVoHttpResult;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 计算车辆实际价值
|
|
|
*/
|
|
|
- private BigDecimal calculateCarActualValue(CarModelQueryResponse.vehicle vehicle,CarInfoVo carInfoVo) {
|
|
|
+ private BigDecimal calculateCarActualValue(CarModelQueryResponse.vehicle vehicle, CarInfoVo carInfoVo) {
|
|
|
BigDecimal carActualValue;
|
|
|
// 获取车辆折旧月数
|
|
|
DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
@@ -229,6 +232,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
/**
|
|
|
* 重复报价提取终保日期
|
|
|
+ *
|
|
|
* @param response
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -245,11 +249,12 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
/**
|
|
|
* 重复报价
|
|
|
+ *
|
|
|
* @param premiumCalculationRequest
|
|
|
* @return
|
|
|
*/
|
|
|
- private PremiumCalculationResponse getResponse(PremiumCalculationRequest premiumCalculationRequest,BaseQuoteInfoVo quoteInfoVo,Integer maxQuoteNum,List<SysQuoteRecord> sysQuoteRecords
|
|
|
- ,BigDecimal carActualValue,ChengTaiConfigureParameters parameters,CarModelQueryResponse.vehicle vehicle,BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo) throws Exception {
|
|
|
+ private PremiumCalculationResponse getResponse(PremiumCalculationRequest premiumCalculationRequest, BaseQuoteInfoVo quoteInfoVo, Integer maxQuoteNum, List<SysQuoteRecord> sysQuoteRecords
|
|
|
+ , BigDecimal carActualValue, ChengTaiConfigureParameters parameters, CarModelQueryResponse.vehicle vehicle, BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo) throws Exception {
|
|
|
|
|
|
PremiumCalculationResponse premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
maxQuoteNum--;
|
|
|
@@ -260,7 +265,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
// 获取新起保时间 终保时间
|
|
|
final String startDate = extractEndDate(premiumCalculationResponse);
|
|
|
String endDate;
|
|
|
- if (startDate != null){
|
|
|
+ if (startDate != null) {
|
|
|
if (startDate.endsWith("00:00:00")) {
|
|
|
endDate = TimeProcessing.minusOneSecondAfterYear(startDate);
|
|
|
} else {
|
|
|
@@ -269,33 +274,33 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
final String formatStartDate = startDate;
|
|
|
final String formatEndDate = endDate;
|
|
|
quoteInfoVo.getRiskList().forEach(riskInfoVo -> {
|
|
|
- String start,end = "";
|
|
|
+ String start, end = "";
|
|
|
// 处理商业险的即时起保
|
|
|
- if(riskInfoVo.getRiskCode().equals("0510")){
|
|
|
- if(!formatStartDate.endsWith("00:00:00")){
|
|
|
+ if (riskInfoVo.getRiskCode().equals("0510")) {
|
|
|
+ if (!formatStartDate.endsWith("00:00:00")) {
|
|
|
start = TimeProcessing.tomorrowDateTime(formatStartDate);
|
|
|
end = TimeProcessing.tomorrowDateTime(formatEndDate);
|
|
|
riskInfoVo.setStartDate(start);
|
|
|
riskInfoVo.setEndDate(end);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
riskInfoVo.setStartDate(formatStartDate);
|
|
|
riskInfoVo.setEndDate(formatEndDate);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
riskInfoVo.setStartDate(formatStartDate);
|
|
|
riskInfoVo.setEndDate(formatEndDate);
|
|
|
}
|
|
|
});
|
|
|
- premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo,carActualValue,parameters,vehicle,quoteVo,quoteInfoVo.getRiskList(),null);
|
|
|
+ premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), null);
|
|
|
premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
maxQuoteNum--;
|
|
|
- SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- QuoteNumberConstant.QuoteAction.DATE_DEAL.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
+ SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), quoteVo.getCompanyId(), quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
+ QuoteNumberConstant.QuoteAction.DATE_DEAL.getCode().toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
sysQuoteRecords.add(sysQuoteRecord);
|
|
|
- if(maxQuoteNum <= 0){
|
|
|
+ if (maxQuoteNum <= 0) {
|
|
|
sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
|
|
|
//刷新redis中的报价次数
|
|
|
- sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(),quoteInfoVo.getUserid(),sysQuoteRecords);
|
|
|
+ sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
|
|
|
throw new SystemException("报价次数限制");
|
|
|
}
|
|
|
}
|
|
|
@@ -308,7 +313,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
? premiumCalculationResponse.getCommRisk().getBasePart().getQuestion()
|
|
|
: null;
|
|
|
// 订单号
|
|
|
- if (ciQuestion!= null || biQuestion != null) {
|
|
|
+ if (ciQuestion != null || biQuestion != null) {
|
|
|
String orderNumber = premiumCalculationResponse.getCompRisk() != null
|
|
|
? premiumCalculationResponse.getCompRisk().getFtrno().getOrderNumber()
|
|
|
: premiumCalculationResponse.getCommRisk().getFtrno().getOrderNumber();
|
|
|
@@ -323,18 +328,22 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
if (!"{}".equals(sendBody)) {
|
|
|
String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
|
|
|
CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
|
|
|
- quoteVo.setRenewalCodeJq(resp.getJqImageCode());
|
|
|
- quoteVo.setRenewalCodeSy(resp.getSyImageCode());
|
|
|
- premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo,carActualValue,parameters,vehicle,quoteVo,quoteInfoVo.getRiskList(),orderNumber);
|
|
|
+ if(StringUtils.isNotEmpty(resp.getJqImageCode())){
|
|
|
+ quoteVo.setRenewalCodeJq(resp.getJqImageCode().replace("0", "O"));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(resp.getSyImageCode())){
|
|
|
+ quoteVo.setRenewalCodeSy(resp.getSyImageCode().replace("0", "O"));
|
|
|
+ }
|
|
|
+ premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), orderNumber);
|
|
|
premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
maxQuoteNum--;
|
|
|
- SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- QuoteNumberConstant.QuoteAction.DATE_DEAL.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
+ SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), quoteVo.getCompanyId(), quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
+ QuoteNumberConstant.QuoteAction.DATE_DEAL.getCode().toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
sysQuoteRecords.add(sysQuoteRecord);
|
|
|
- if(maxQuoteNum <= 0){
|
|
|
+ if (maxQuoteNum <= 0) {
|
|
|
sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
|
|
|
//刷新redis中的报价次数
|
|
|
- sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(),quoteInfoVo.getUserid(),sysQuoteRecords);
|
|
|
+ sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
|
|
|
throw new SystemException("报价次数限制");
|
|
|
}
|
|
|
}
|
|
|
@@ -367,7 +376,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
|
|
|
private HttpResult<QuoteRespVo> respOrder(PremiumCalculationResponse premiumCalculationResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderNumber,
|
|
|
- BaseQuoteInfoVo quoteInfoVo,PremiumCalculationRequest premiumCalculationRequest) {
|
|
|
+ BaseQuoteInfoVo quoteInfoVo, PremiumCalculationRequest premiumCalculationRequest) {
|
|
|
// 保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
|
|
|
@@ -526,7 +535,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
boolean allUploadSuccess = true;
|
|
|
String failMessage = "";
|
|
|
for (InsTaskImagesBase64 insTaskImagesBase64 : insTaskImagesBase64s) {
|
|
|
- UpLoadRequest upLoadRequest = new UpLoadRequest(parameters, orderNumber,insTaskImagesBase64);
|
|
|
+ UpLoadRequest upLoadRequest = new UpLoadRequest(parameters, orderNumber, insTaskImagesBase64);
|
|
|
String upLoadResponse = chengTaiRequestApiComponent.upLoad(upLoadRequest);
|
|
|
log.info("上传影像:{}", upLoadResponse);
|
|
|
if (!"影像上传成功".equals(upLoadResponse)) {
|
|
|
@@ -542,7 +551,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
return HttpResult.error(failMessage);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- return HttpResult.error("上传影像异常"+ e.getMessage());
|
|
|
+ return HttpResult.error("上传影像异常" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -697,85 +706,85 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
|
|
|
@Override
|
|
|
public HttpResult<Object> submit(String companyId) throws Exception {
|
|
|
- InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
- InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
- PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
- ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
|
|
|
- ptlAgreementAttribution);
|
|
|
- /**
|
|
|
- * 诚泰车型查询
|
|
|
- */
|
|
|
- CarInfoVo carInfo = JSON.toJavaObject(insOrders.getCarinfo(), CarInfoVo.class);
|
|
|
- CarModelQueryRequest carModelQueryRequest = new CarModelQueryRequest(carInfo);
|
|
|
- CarModelQueryResponse carModelQueryResponse = chengTaiRequestApiComponent.carModelQuery(carModelQueryRequest);
|
|
|
- CarModelQueryResponse.vehicle vehicle =
|
|
|
- new CarModelsFilterUtils<CarModelQueryResponse.vehicle>().to(carModelQueryResponse.getVehicleList(),
|
|
|
- carInfo);
|
|
|
- // 车辆实际价值
|
|
|
- BigDecimal carActualValue = calculateCarActualValue(vehicle,carInfo);
|
|
|
- // 投保人信息
|
|
|
- CustomerInfoVo policyHolderInfo = insOrders.getApplyinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
- PersonAreaVo policyHolderAreaVo = sysAreaService.queryByAddressYc(policyHolderInfo.getAddr(), policyHolderInfo.getIdentifyNumber());
|
|
|
- policyHolderInfo.setProvince(policyHolderAreaVo.getProvinceCode());
|
|
|
- policyHolderInfo.setCity(policyHolderAreaVo.getCityCode());
|
|
|
- policyHolderInfo.setCounty(policyHolderAreaVo.getCountyCode());
|
|
|
- // 被保人信息
|
|
|
- CustomerInfoVo insuredPersonInfo = insOrders.getInsureinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
- PersonAreaVo insuredPersonAreaVo = sysAreaService.queryByAddressYc(insuredPersonInfo.getAddr(), insuredPersonInfo.getIdentifyNumber());
|
|
|
- insuredPersonInfo.setProvince(insuredPersonAreaVo.getProvinceCode());
|
|
|
- insuredPersonInfo.setCity(insuredPersonAreaVo.getCityCode());
|
|
|
- insuredPersonInfo.setCounty(insuredPersonAreaVo.getCountyCode());
|
|
|
- // 核保
|
|
|
- SubmitRequest submitRequest = new SubmitRequest(insOrders, carActualValue, vehicle,
|
|
|
- parameters, insAreaCompany,policyHolderInfo,insuredPersonInfo);
|
|
|
- SubmitResponse submitResponse = chengTaiRequestApiComponent.submit(submitRequest);
|
|
|
- // 响应失败
|
|
|
- if (!submitResponse.getHead().getErrorMessage().equals("成功")) {
|
|
|
- return HttpResult.error(submitResponse.getHead().getErrorMessage());
|
|
|
- }
|
|
|
- // 双险审核通过
|
|
|
- if (submitResponse.getProposal().getUnderWriteInd().equals("1")
|
|
|
- || submitResponse.getProposal().getUnderWriteInd().equals("3")
|
|
|
- || submitResponse.getProposal().getUnderWriteInd().equals("5")) {
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- insAreaCompany.setJqapplyno(submitResponse.getProposal().getCompProposalNo());
|
|
|
- insAreaCompany.setSyapplyno(submitResponse.getProposal().getCommProposalNo());
|
|
|
- if (submitResponse.getProposal().getNoCarProposalNo() != null) {
|
|
|
- List<DrivingInsuranceDto> drivingInsuranceDtos = new ArrayList<>();
|
|
|
- DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
|
|
|
- drivingInsuranceDto.setApplicationNumber(submitResponse.getProposal().getNoCarProposalNo());
|
|
|
- drivingInsuranceDtos.add(drivingInsuranceDto);
|
|
|
- insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDtos)));
|
|
|
- }
|
|
|
- String payUrl = payment(companyId);
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.ok("核保成功");
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ /**
|
|
|
+ * 诚泰车型查询
|
|
|
+ */
|
|
|
+ CarInfoVo carInfo = JSON.toJavaObject(insOrders.getCarinfo(), CarInfoVo.class);
|
|
|
+ CarModelQueryRequest carModelQueryRequest = new CarModelQueryRequest(carInfo);
|
|
|
+ CarModelQueryResponse carModelQueryResponse = chengTaiRequestApiComponent.carModelQuery(carModelQueryRequest);
|
|
|
+ CarModelQueryResponse.vehicle vehicle =
|
|
|
+ new CarModelsFilterUtils<CarModelQueryResponse.vehicle>().to(carModelQueryResponse.getVehicleList(),
|
|
|
+ carInfo);
|
|
|
+ // 车辆实际价值
|
|
|
+ BigDecimal carActualValue = calculateCarActualValue(vehicle, carInfo);
|
|
|
+ // 投保人信息
|
|
|
+ CustomerInfoVo policyHolderInfo = insOrders.getApplyinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
+ PersonAreaVo policyHolderAreaVo = sysAreaService.queryByAddressYc(policyHolderInfo.getAddr(), policyHolderInfo.getIdentifyNumber());
|
|
|
+ policyHolderInfo.setProvince(policyHolderAreaVo.getProvinceCode());
|
|
|
+ policyHolderInfo.setCity(policyHolderAreaVo.getCityCode());
|
|
|
+ policyHolderInfo.setCounty(policyHolderAreaVo.getCountyCode());
|
|
|
+ // 被保人信息
|
|
|
+ CustomerInfoVo insuredPersonInfo = insOrders.getInsureinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
+ PersonAreaVo insuredPersonAreaVo = sysAreaService.queryByAddressYc(insuredPersonInfo.getAddr(), insuredPersonInfo.getIdentifyNumber());
|
|
|
+ insuredPersonInfo.setProvince(insuredPersonAreaVo.getProvinceCode());
|
|
|
+ insuredPersonInfo.setCity(insuredPersonAreaVo.getCityCode());
|
|
|
+ insuredPersonInfo.setCounty(insuredPersonAreaVo.getCountyCode());
|
|
|
+ // 核保
|
|
|
+ SubmitRequest submitRequest = new SubmitRequest(insOrders, carActualValue, vehicle,
|
|
|
+ parameters, insAreaCompany, policyHolderInfo, insuredPersonInfo);
|
|
|
+ SubmitResponse submitResponse = chengTaiRequestApiComponent.submit(submitRequest);
|
|
|
+ // 响应失败
|
|
|
+ if (!submitResponse.getHead().getErrorMessage().equals("成功")) {
|
|
|
+ return HttpResult.error(submitResponse.getHead().getErrorMessage());
|
|
|
+ }
|
|
|
+ // 双险审核通过
|
|
|
+ if (submitResponse.getProposal().getUnderWriteInd().equals("1")
|
|
|
+ || submitResponse.getProposal().getUnderWriteInd().equals("3")
|
|
|
+ || submitResponse.getProposal().getUnderWriteInd().equals("5")) {
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
+ insAreaCompany.setJqapplyno(submitResponse.getProposal().getCompProposalNo());
|
|
|
+ insAreaCompany.setSyapplyno(submitResponse.getProposal().getCommProposalNo());
|
|
|
+ if (submitResponse.getProposal().getNoCarProposalNo() != null) {
|
|
|
+ List<DrivingInsuranceDto> drivingInsuranceDtos = new ArrayList<>();
|
|
|
+ DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
|
|
|
+ drivingInsuranceDto.setApplicationNumber(submitResponse.getProposal().getNoCarProposalNo());
|
|
|
+ drivingInsuranceDtos.add(drivingInsuranceDto);
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDtos)));
|
|
|
}
|
|
|
- // 人工核保
|
|
|
- if (submitResponse.getProposal().getUnderWriteInd().equals("8")
|
|
|
+ String payUrl = payment(companyId);
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.ok("核保成功");
|
|
|
+ }
|
|
|
+ // 人工核保
|
|
|
+ if (submitResponse.getProposal().getUnderWriteInd().equals("8")
|
|
|
|| submitResponse.getProposal().getUnderWriteInd().equals("9")) {
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
- insAreaCompany.setJqapplyno(submitResponse.getProposal().getCompProposalNo());
|
|
|
- insAreaCompany.setSyapplyno(submitResponse.getProposal().getCommProposalNo());
|
|
|
- if (submitResponse.getProposal().getNoCarProposalNo() != null) {
|
|
|
- List<DrivingInsuranceDto> drivingInsuranceDtos = new ArrayList<>();
|
|
|
- DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
|
|
|
- drivingInsuranceDto.setApplicationNumber(submitResponse.getProposal().getNoCarProposalNo());
|
|
|
- drivingInsuranceDtos.add(drivingInsuranceDto);
|
|
|
- insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDtos)));
|
|
|
- }
|
|
|
- insSubOrderUpdateDetailService.insertData(insAreaCompany,insAreaCompany.getOrderstatus(),InsOrderStatusEnum.WAIT_AUDIT.getCode(),"1");
|
|
|
- String message = submitResponse.getHead().getErrorMessage();
|
|
|
- String payUrl = payment(companyId);
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
- insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, message);
|
|
|
- return HttpResult.error("自核转人工,原因:" + message);
|
|
|
- }
|
|
|
- // 拒保
|
|
|
- if (submitResponse.getProposal().getUnderWriteInd().equals("4")) {
|
|
|
- return HttpResult.error("诚泰拒保,原因:" + submitResponse.getHead().getErrorMessage());
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
+ insAreaCompany.setJqapplyno(submitResponse.getProposal().getCompProposalNo());
|
|
|
+ insAreaCompany.setSyapplyno(submitResponse.getProposal().getCommProposalNo());
|
|
|
+ if (submitResponse.getProposal().getNoCarProposalNo() != null) {
|
|
|
+ List<DrivingInsuranceDto> drivingInsuranceDtos = new ArrayList<>();
|
|
|
+ DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
|
|
|
+ drivingInsuranceDto.setApplicationNumber(submitResponse.getProposal().getNoCarProposalNo());
|
|
|
+ drivingInsuranceDtos.add(drivingInsuranceDto);
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDtos)));
|
|
|
}
|
|
|
+ insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_AUDIT.getCode(), "1");
|
|
|
+ String message = submitResponse.getHead().getErrorMessage();
|
|
|
+ String payUrl = payment(companyId);
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
+ insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, message);
|
|
|
+ return HttpResult.error("自核转人工,原因:" + message);
|
|
|
+ }
|
|
|
+ // 拒保
|
|
|
+ if (submitResponse.getProposal().getUnderWriteInd().equals("4")) {
|
|
|
+ return HttpResult.error("诚泰拒保,原因:" + submitResponse.getHead().getErrorMessage());
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -984,7 +993,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
// 人工核保
|
|
|
if (ebCallbackData.getUnderWriteInd().equals("8") || ebCallbackData.getUnderWriteInd().equals("9")) {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
- insSubOrderUpdateDetailService.insertData(insAreaCompany,insAreaCompany.getOrderstatus(),InsOrderStatusEnum.WAIT_AUDIT.getCode(),"1");
|
|
|
+ insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_AUDIT.getCode(), "1");
|
|
|
String message = ebCallbackData.getOperateText();
|
|
|
String payUrl = payment(companyId);
|
|
|
insAreaCompany.setPaymentLink(payUrl);
|
|
|
@@ -1006,16 +1015,16 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
insAreaCompany.setSyapplyno(syEbCallbackData.getProposalNo());
|
|
|
insAreaCompany.setSypolicyno(syEbCallbackData.getPolicyNo());
|
|
|
}
|
|
|
- insSubOrderUpdateDetailService.insertData(insAreaCompany,insAreaCompany.getOrderstatus(),InsOrderStatusEnum.WAIT_AUDIT.getCode(),"1");
|
|
|
+ insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_AUDIT.getCode(), "1");
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("状态更新成功");
|
|
|
}
|
|
|
|
|
|
- if (ebCallbackData.getUnderWriteInd().equals("2") || ebCallbackData.getUnderWriteInd().equals("4")){
|
|
|
+ if (ebCallbackData.getUnderWriteInd().equals("2") || ebCallbackData.getUnderWriteInd().equals("4")) {
|
|
|
errorMessage.append(ebCallbackData.getOperateText());
|
|
|
}
|
|
|
}
|
|
|
- if(!errorMessage.toString().equals("")){
|
|
|
+ if (!errorMessage.toString().equals("")) {
|
|
|
insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.TO_BACK.getCode(), "1");
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, errorMessage.toString());
|
|
|
@@ -1074,23 +1083,23 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
PolicyElectronicRequest policyElectronicRequest = new PolicyElectronicRequest(parameters, insAreaCompany);
|
|
|
PolicyElectronicResponse policyElectronicResponse = chengTaiRequestApiComponent.policyElectronic(policyElectronicRequest);
|
|
|
if (policyElectronicResponse.getResponseHead().getResponseCode().equals("0000")) {
|
|
|
- PolicyElectronicResponse.ResponseBody.ElectronicPolicy electronicPolicy = policyElectronicResponse.getResponseBody().getElectronicPolicy();
|
|
|
+ PolicyElectronicResponse.ResponseBody.ElectronicPolicy electronicPolicy = policyElectronicResponse.getResponseBody().getElectronicPolicy();
|
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
|
|
|
String licenseNo = insOrders.getLicenseno();
|
|
|
// 交强险电子保单
|
|
|
if (StringUtils.isNotEmpty(electronicPolicy.getCiDownLoad())) {
|
|
|
String jqFileName = "-交强险保单.pdf";
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(electronicPolicy.getCiDownLoad(), licenseNo+jqFileName,licenseNo));
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(electronicPolicy.getCiDownLoad(), licenseNo + jqFileName, licenseNo));
|
|
|
}
|
|
|
// 商业险电子保单
|
|
|
if (StringUtils.isNotEmpty(electronicPolicy.getBiDownLoad())) {
|
|
|
String syFileName = "-商业险保单.pdf";
|
|
|
- crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(electronicPolicy.getBiDownLoad(), licenseNo+syFileName,licenseNo));
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(electronicPolicy.getBiDownLoad(), licenseNo + syFileName, licenseNo));
|
|
|
}
|
|
|
// 交强险标志
|
|
|
if (StringUtils.isNotEmpty(electronicPolicy.getBzDownLoad())) {
|
|
|
String jqFlagName = "-交强险标志.pdf";
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(electronicPolicy.getBzDownLoad(), licenseNo+jqFlagName,licenseNo));
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(electronicPolicy.getBzDownLoad(), licenseNo + jqFlagName, licenseNo));
|
|
|
}
|
|
|
// 驾意险保单
|
|
|
// 获取驾意险保单号
|
|
|
@@ -1102,7 +1111,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
String jyUrl = "https://b2cuat.champion-ic.com/echannel/new/policy/download/partnerCode/" + parameters.getPartnerCode() + "/policyNO/" + encrypt;
|
|
|
List<CrawlerPolicyPrintVo.JyxInfoListDTO> jyxInfoListDTOS = new ArrayList<>();
|
|
|
CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
- jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicy(jyUrl,licenseNo+jyFileName,licenseNo));
|
|
|
+ jyxInfoListDTO.setJyxPolicyUrl(gainCarInsPolicy(jyUrl, licenseNo + jyFileName, licenseNo));
|
|
|
jyxInfoListDTOS.add(jyxInfoListDTO);
|
|
|
crawlerPolicyPrintVo.setJyxInfoList(jyxInfoListDTOS);
|
|
|
}
|
|
|
@@ -1171,25 +1180,25 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
public ReadPdfUrlListDto getPolicyByCompanyIdPdfList(InsAreaCompany insAreaCompany, InsOrders insOrders, boolean flag) {
|
|
|
JSONArray array = insAreaCompany.getCrossInsurance();
|
|
|
String jypolicyno = null;
|
|
|
- if(CollUtil.isNotEmpty(array)){
|
|
|
+ if (CollUtil.isNotEmpty(array)) {
|
|
|
jypolicyno = array.getJSONObject(0).getString("policy");
|
|
|
}
|
|
|
insAreaCompany.setJyPolicyNo(jypolicyno);
|
|
|
- String jqPath = getPdfUrl(insAreaCompany, insOrders,InsuranceRisk.TRAFFIC_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(),insAreaCompany.getJqpolicyno(),flag);
|
|
|
- String syPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.BUSINESS_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), insAreaCompany.getSypolicyno(),flag);
|
|
|
- String jyPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.ACCIDENT_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), jypolicyno,flag);
|
|
|
- String jqFlag = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.TRAFFIC_CODE,PolicyPrintVo.PolicyPrintType.PPT_1.getCode(), insAreaCompany.getJqpolicyno(),flag);
|
|
|
- InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy = new InsAreaCompanyExternalPolicy(insAreaCompany.getId(),jqPath,syPath,jyPath,jqFlag);
|
|
|
- return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy,insAreaCompany,null);
|
|
|
+ String jqPath = getPdfUrl(insAreaCompany, insOrders, InsuranceRisk.TRAFFIC_CODE, PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), insAreaCompany.getJqpolicyno(), flag);
|
|
|
+ String syPath = getPdfUrl(insAreaCompany, insOrders, InsuranceRisk.BUSINESS_CODE, PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), insAreaCompany.getSypolicyno(), flag);
|
|
|
+ String jyPath = getPdfUrl(insAreaCompany, insOrders, InsuranceRisk.ACCIDENT_CODE, PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), jypolicyno, flag);
|
|
|
+ String jqFlag = getPdfUrl(insAreaCompany, insOrders, InsuranceRisk.TRAFFIC_CODE, PolicyPrintVo.PolicyPrintType.PPT_1.getCode(), insAreaCompany.getJqpolicyno(), flag);
|
|
|
+ InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy = new InsAreaCompanyExternalPolicy(insAreaCompany.getId(), jqPath, syPath, jyPath, jqFlag);
|
|
|
+ return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy, insAreaCompany, null);
|
|
|
}
|
|
|
|
|
|
- public String getPdfUrl(InsAreaCompany insAreaCompany, InsOrders insOrders,String jqFlag,String jqSignFlag,String policyNo,boolean flag) {
|
|
|
+ public String getPdfUrl(InsAreaCompany insAreaCompany, InsOrders insOrders, String jqFlag, String jqSignFlag, String policyNo, boolean flag) {
|
|
|
if (!InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insAreaCompany.getOrderstatus())) {
|
|
|
throw new SystemException("此订单还未承保");
|
|
|
}
|
|
|
// 被保人信息
|
|
|
- String pathPrefix = insAreaCompany.getInscompany()+"-"+insOrders.getLicenseno()+"-"+insAreaCompany.getId() +"-"+policyNo+"-";
|
|
|
- if(StringUtils.isBlank(policyNo)){
|
|
|
+ String pathPrefix = insAreaCompany.getInscompany() + "-" + insOrders.getLicenseno() + "-" + insAreaCompany.getId() + "-" + policyNo + "-";
|
|
|
+ if (StringUtils.isBlank(policyNo)) {
|
|
|
return null;
|
|
|
}
|
|
|
// 1 通过 协议id获取配置实体
|
|
|
@@ -1201,12 +1210,12 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
// 被保人信息
|
|
|
String templateName = null;
|
|
|
String url = null;
|
|
|
- try{
|
|
|
+ try {
|
|
|
PolicyElectronicRequest policyElectronicRequest = new PolicyElectronicRequest(parameters, insAreaCompany);
|
|
|
PolicyElectronicResponse electronicPolicy = chengTaiRequestApiComponent.policyElectronic(policyElectronicRequest);
|
|
|
switch (jqFlag) {
|
|
|
case InsuranceRisk.TRAFFIC_CODE:
|
|
|
- if (jqSignFlag.equals(PolicyPrintVo.PolicyPrintType.PPT_2.getCode())){
|
|
|
+ if (jqSignFlag.equals(PolicyPrintVo.PolicyPrintType.PPT_2.getCode())) {
|
|
|
templateName = pathPrefix + InsuranceOrderPdf.JQBD.getDesc();
|
|
|
url = electronicPolicy.getResponseBody().getElectronicPolicy().getCiDownLoad();
|
|
|
} else {
|
|
|
@@ -1226,16 +1235,17 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
url = "https://b2cuat.champion-ic.com/echannel/new/policy/download/partnerCode/" + parameters.getPartnerCode() + "/policyNO/" + encrypt;
|
|
|
break;
|
|
|
}
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
throw new SystemException(e.toString());
|
|
|
}
|
|
|
- return gainCarInsPolicyNew(url, templateName, insAreaCompany.getId(),flag);
|
|
|
+ return gainCarInsPolicyNew(url, templateName, insAreaCompany.getId(), flag);
|
|
|
}
|
|
|
|
|
|
- private String gainCarInsPolicyNew(String url, String fileName, String subOrderId,boolean flag) {
|
|
|
+ private String gainCarInsPolicyNew(String url, String fileName, String subOrderId, boolean flag) {
|
|
|
String dir = "carInsPolicyNew/" + subOrderId + "/";
|
|
|
- return FileUtil.netUrlToFileNew(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl,flag);
|
|
|
+ return FileUtil.netUrlToFileNew(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl, flag);
|
|
|
}
|
|
|
+
|
|
|
private String gainCarInsPolicy(String url, String fileName, String licensePlate) {
|
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|