Commit 1fcea70a authored by ZWT's avatar ZWT

nocommit

parent dbb59cc8
...@@ -14,6 +14,11 @@ public class ThirdPartyApiConstant { ...@@ -14,6 +14,11 @@ public class ThirdPartyApiConstant {
*/ */
public static final String CQ_TOKEN_CACHE_KEY = "pps.third.cq.token"; public static final String CQ_TOKEN_CACHE_KEY = "pps.third.cq.token";
/**
* 过期时间
*/
public static final int MAX_SECOND = 300;
/** /**
* 长庆Token * 长庆Token
*/ */
......
...@@ -153,9 +153,8 @@ public class WellheadDailyProductionSituationService { ...@@ -153,9 +153,8 @@ public class WellheadDailyProductionSituationService {
if (ObjectUtil.isNull(exist)) { if (ObjectUtil.isNull(exist)) {
token = this.getCqToken(context); token = this.getCqToken(context);
} else { } else {
long between = DateUtil.between(exist.getCurrentDate(), DateUtil.date(), DateUnit.SECOND);
long duration = (long) exist.getDuration(); long duration = (long) exist.getDuration();
if (duration - between < 300) { if (duration - DateUtil.between(exist.getCurrentDate(), DateUtil.date(), DateUnit.SECOND) < ThirdPartyApiConstant.MAX_SECOND) {
token = this.getCqToken(context); token = this.getCqToken(context);
} else { } else {
token = exist.getCode(); token = exist.getCode();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment