Explorar o código

永诚接口调整

785834757 %!s(int64=2) %!d(string=hai) anos
pai
achega
710d0b95d1

+ 16 - 8
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -258,10 +258,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         RuoteResponse rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
         //存储 报价返回的查询码  交强和商业
         if(rr.getVhl() != null) {
-            redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
-                    rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
-            redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
-                    rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            if(rr.getVhl().getCQryCdeJQ() != null) {
+                redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
+                        rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            }
+            if(rr.getVhl().getCQryCdeSY() != null) {
+                redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
+                        rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            }
         }
 
         //重新设置 请求的查询码
@@ -423,10 +427,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
         //存储 报价返回的查询码  交强和商业
         if(rr.getVhl() != null) {
-            redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
-                    rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
-            redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
-                    rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            if(rr.getVhl().getCQryCdeJQ() != null) {
+                redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_JQ + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
+                        rr.getVhl().getCQryCdeJQ(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            }
+            if(rr.getVhl().getCQryCdeSY() != null) {
+                redisTemplate.opsForValue().set(REDIS_YONGCHENG_QUERY_CODE_SY + yaQuoteInfoVo.getCarInfo().getVinNo() + yaQuoteInfoVo.getCarInfo().getLicenseNo(),
+                        rr.getVhl().getCQryCdeSY(), REDIS_YONGCHENG_QUERY_CODE_EXPIRE, TimeUnit.DAYS);
+            }
         }
 
         return HttpResult.ok("报价成功", quoteRespVo);