|
@@ -14,6 +14,7 @@ import com.songhua.system.service.ICruiseShipMappingService;
|
|
|
import com.songhua.system.service.ISysConfigService;
|
|
|
import com.songhua.system.service.impl.BasicCruiseShipServiceImpl;
|
|
|
import com.songhua.web.controller.utils.MD5Encryptor;
|
|
|
+import com.songhua.web.controller.utils.URLEncodeExampleUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -22,8 +23,10 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.InputStreamReader;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -121,6 +124,7 @@ public class gpsJob {
|
|
|
} else {
|
|
|
obj = redisCache.getCacheObject("access_token");
|
|
|
}
|
|
|
+
|
|
|
Date date = new Date();
|
|
|
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
|
|
|
Map<String, String> configMap = getStringStringMap();
|
|
@@ -135,7 +139,7 @@ public class gpsJob {
|
|
|
"v2.0" +
|
|
|
configMap.get("app_secret"));
|
|
|
log.info("singStr:{}",configMap.get("app_secret") +
|
|
|
- "access_token" + obj +
|
|
|
+ "access_token" + URLEncodeExampleUtil.URLEncodeExample(obj) +
|
|
|
"app_key" + configMap.get("app_key") +
|
|
|
"dev_key59346d400236ab95e95193f35f3df6a4" +
|
|
|
"fieldsdid,activeGpsDataformatjsonlimit-1mapBAIDU" +
|
|
@@ -162,6 +166,8 @@ public class gpsJob {
|
|
|
connection.setRequestMethod("GET");
|
|
|
// 获取响应状态码
|
|
|
int responseCode = connection.getResponseCode();
|
|
|
+ log.info("connection.getResponseMessage():{}", connection.getResponseMessage());
|
|
|
+ log.info("connection:{}", connection);
|
|
|
if (responseCode == HttpURLConnection.HTTP_OK) {
|
|
|
// 读取响应内容
|
|
|
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
|
@@ -302,5 +308,4 @@ public class gpsJob {
|
|
|
return configMap;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|