Преглед изворни кода

[功能修复]下单3分钟内60秒获取103 超过3分钟4分钟获取103

liuf пре 1 година
родитељ
комит
c0a4058c17

+ 6 - 1
src/main/java/com/tmzn/devicelinkykc/taskQueue/runner/MsgCharngingRunner.java

@@ -158,7 +158,12 @@ public class MsgCharngingRunner {
         }
         log.info("{}-{}-5分钟内无状态下发一次103", orderStatus.getPileCode(), orderStatus.getGunsCode());
         deviceControlerService.sendImeiDetail(orderStatus.getDeviceImei());
-        redisCache.setCacheObject(key, System.currentTimeMillis(),240, TimeUnit.SECONDS);
+        int timeout = 240;
+        //订单3分钟内一分钟请求一次103 否则就4分钟获取一次
+        if((System.currentTimeMillis()-orderStatus.getCreateTime())<180*1000){
+            timeout = 60;
+        }
+        redisCache.setCacheObject(key, System.currentTimeMillis(),timeout, TimeUnit.SECONDS);
     }
 
     //停止一个订单