|
@@ -143,7 +143,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
|
|
private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
|
|
|
|
|
|
|
|
- public ModelsQueryResponse.VehicleInfo gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
|
|
|
|
|
|
|
+ public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
|
|
|
CarModel_Req carModelReq = new CarModel_Req();
|
|
CarModel_Req carModelReq = new CarModel_Req();
|
|
|
carModelReq.setFrameNo(carInfo.getFrameNo());
|
|
carModelReq.setFrameNo(carInfo.getFrameNo());
|
|
|
carModelReq.setEngineNo(carInfo.getEngineNo());
|
|
carModelReq.setEngineNo(carInfo.getEngineNo());
|
|
@@ -153,7 +153,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
rd = yongchengRequestApiComponents.newQueryVehicleTypes(m);
|
|
rd = yongchengRequestApiComponents.newQueryVehicleTypes(m);
|
|
|
- rd.setVehicleInfoList(new ArrayList<>());
|
|
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
throw new SystemException("车型查询接口异常,请联系管理。");
|
|
throw new SystemException("车型查询接口异常,请联系管理。");
|
|
|
}
|
|
}
|
|
@@ -184,14 +183,16 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
rd.getVehicleInfoList().stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).collect(Collectors.toList());
|
|
rd.getVehicleInfoList().stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(vehicleInfoList)) {
|
|
if (CollUtil.isNotEmpty(vehicleInfoList)) {
|
|
|
- return vehicleInfoList.get(0);
|
|
|
|
|
|
|
+ buildCarInfo(carInfo, vehicleInfoList.get(0));
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//金额升序
|
|
//金额升序
|
|
|
vehicleInfoList =
|
|
vehicleInfoList =
|
|
|
rd.getVehicleInfoList().stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
rd.getVehicleInfoList().stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
- return vehicleInfoList.get(0);
|
|
|
|
|
|
|
+ buildCarInfo(carInfo, vehicleInfoList.get(0));
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//匹配的车辆信息数据
|
|
//匹配的车辆信息数据
|
|
@@ -199,7 +200,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
vehicleInfoList.stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).findFirst().orElse(null);
|
|
vehicleInfoList.stream().filter(a -> a.getVehiclePrice().equals(carInfo.getPurchasePrice())).findFirst().orElse(null);
|
|
|
|
|
|
|
|
if (null != matchVehicleInfo) {
|
|
if (null != matchVehicleInfo) {
|
|
|
- return matchVehicleInfo;
|
|
|
|
|
|
|
+ buildCarInfo(carInfo, matchVehicleInfo);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//匹配的车辆信息数据里 未匹配成功 默认选择第一条
|
|
//匹配的车辆信息数据里 未匹配成功 默认选择第一条
|
|
@@ -207,9 +209,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
vehicleInfoList =
|
|
vehicleInfoList =
|
|
|
vehicleInfoList.stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehicleYear).thenComparing((o1,
|
|
vehicleInfoList.stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehicleYear).thenComparing((o1,
|
|
|
o2) -> Integer.compare(StringUtils.toInt(o2.getVehiclePrice()), StringUtils.toInt(o1.getVehiclePrice()))).reversed()).collect(Collectors.toList());
|
|
o2) -> Integer.compare(StringUtils.toInt(o2.getVehiclePrice()), StringUtils.toInt(o1.getVehiclePrice()))).reversed()).collect(Collectors.toList());
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- return vehicleInfoList.get(0);
|
|
|
|
|
|
|
+ buildCarInfo(carInfo, vehicleInfoList.get(0));
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -227,11 +227,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
|
|
|
|
|
//构造车辆信息
|
|
//构造车辆信息
|
|
|
- ModelsQueryResponse.VehicleInfo vehicleInfo = gainVehicleModel(ycConfigureParameters, carInfo);
|
|
|
|
|
|
|
+ gainVehicleModel(ycConfigureParameters, carInfo);
|
|
|
AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
|
|
AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
|
|
|
|
|
|
|
|
//组装参数
|
|
//组装参数
|
|
|
- Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, adVo, vehicleInfo);
|
|
|
|
|
|
|
+ Ruote m = Ruote.buildQuoteParam(yaQuoteInfoVo, ycConfigureParameters, adVo);
|
|
|
//构造地区
|
|
//构造地区
|
|
|
buildRegion(m, yaQuoteInfoVo);
|
|
buildRegion(m, yaQuoteInfoVo);
|
|
|
return m;
|
|
return m;
|
|
@@ -1315,6 +1315,12 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo) {
|
|
|
|
|
+ carInfo.setModelCode(vehicleInfo.getVehicleId());
|
|
|
|
|
+ carInfo.setCiCarName(vehicleInfo.getVehicleName());
|
|
|
|
|
+ carInfo.setModelcname(vehicleInfo.getVehicleName());
|
|
|
|
|
+// carInfo.setSeatCount(vehicleInfo.getVehicleSeat());
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|