소스 검색

永诚接口调整

785834757 2 년 전
부모
커밋
710d0b95d1
1개의 변경된 파일16개의 추가작업 그리고 8개의 파일을 삭제
  1. 16 8
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

+ 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);