|
|
@ -27,6 +27,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.ruoyi.quartz.helper.OkHttpHelper.post;
|
|
|
|
import static com.ruoyi.quartz.helper.OkHttpHelper.post;
|
|
|
@ -325,6 +326,8 @@ public abstract class SyncAccountsJobAbstract {
|
|
|
|
* 生成调用接口的token信息
|
|
|
|
* 生成调用接口的token信息
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void generateToken(CJTJobContext context) {
|
|
|
|
private void generateToken(CJTJobContext context) {
|
|
|
|
|
|
|
|
String openToken = (String) redisCache.getCacheObject(RedisConstants.CJT_TOKEN_CACHE_KEY);
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(RedisConstants.CJT_TOKEN_CACHE_KEY)){
|
|
|
|
CJTRequest cjtRequest = new CJTRequest(REQUEST_GENERATE_TOKEN_PATH
|
|
|
|
CJTRequest cjtRequest = new CJTRequest(REQUEST_GENERATE_TOKEN_PATH
|
|
|
|
, context.getAppKey()
|
|
|
|
, context.getAppKey()
|
|
|
|
, context.getAppSecret()
|
|
|
|
, context.getAppSecret()
|
|
|
@ -335,6 +338,8 @@ public abstract class SyncAccountsJobAbstract {
|
|
|
|
JSONObject value = body.getJSONObject("value");
|
|
|
|
JSONObject value = body.getJSONObject("value");
|
|
|
|
String token = value.getString("accessToken");
|
|
|
|
String token = value.getString("accessToken");
|
|
|
|
context.setOpenToken(token);
|
|
|
|
context.setOpenToken(token);
|
|
|
|
|
|
|
|
redisCache.setCacheObject(RedisConstants.CJT_TOKEN_CACHE_KEY,token,10, TimeUnit.MINUTES);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|