Przeglądaj źródła

1、永诚解决车辆年款报错问题。

ligang134 3 lat temu
rodzic
commit
f4e24ac001

+ 10 - 0
README.md

@@ -120,6 +120,16 @@
   2. 解决永城报价有时候提示系统级别错误。
 
 
+**《掌柜鼎PC平台》临时更新公告**
+
+* 版本号:v0.0.3.8
+* 访问地址:http://sxzgkj.baoxianzhanggui.com/
+* 更新日期:2023-09-06
+* 更新时间:15:10  ~  15:20
+* 更新内容:
+  1. 永诚解决车辆年款报错问题。
+
+
 
 
 

+ 8 - 4
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -255,16 +255,22 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
         String responseData = apiLog.getResponseData();
         log.info("===永诚--车型查询接口请求结束--"+carInfo.getLicenseNo()+"===");
+        ModelsQueryResponse rd = null;
         try {
             String cleanStr = YcBuildData.cleanResponseStr(responseData);
-            ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
+            rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
 //            List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = buildCarModel(rd);
 
+        } catch (IOException e) {
+            throw new SystemException("车型查询接口异常,请联系管理。");
+        }
             BigDecimal matchNum = BigDecimal.ZERO;
 
             //获取上市年份大于等于注册日期的车辆信息
             List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = buildCarModel(rd).stream().filter(a ->DateTimeUtil.dateIsAfter(carInfo.getRegisterDate(),a.getVehicleYear())).collect(Collectors.toList());
 
+            if(null == vehicleInfoList && vehicleInfoList.size()<1)throw new SystemException("车型年款匹配失败");
+
 
             //匹配车辆信息
             vehicleInfoList.stream().forEach(a ->{
@@ -295,9 +301,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //            }
 
 
-        } catch (IOException e) {
-            throw new SystemException("车型查询接口异常,请联系管理。");
-        }
+
 
 
 

+ 1 - 1
src/main/java/com/ydtech/utils/DateTimeUtil.java

@@ -456,7 +456,7 @@ public class DateTimeUtil {
 
 //        System.err.println("注册日期:"+lRegisterDate);
 //        System.err.println("上市日期:"+lVehicleYearDate);
-        return lVehicleYearDate.isAfter(lRegisterDate);
+        return lVehicleYearDate.isBefore(lRegisterDate);