金马推送URL有非法字符,修改
This commit is contained in:
parent
8fcfb57b90
commit
65f8bb313b
@ -15,7 +15,6 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -50,7 +49,7 @@ public class KingMaForwarder extends Forwarder{
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/35 * * * ?") // 每30分钟执行一次
|
||||
@Scheduled(cron = "0 0/10 * * * ?") // 每30分钟执行一次
|
||||
private void forwardGnss() {
|
||||
logger.info("kingma forwardGnss");
|
||||
forwardCurrentGnss(FORWARDER_NAME);
|
||||
@ -65,7 +64,8 @@ public class KingMaForwarder extends Forwarder{
|
||||
boolean updateToken() throws Exception{
|
||||
String jsonLogin = "{\"username\":\""+login_user+"\"," +
|
||||
"\"password\":\""+login_pwd+"\"}";
|
||||
String result = HttpUtils.postJson(URLEncoder.encode(login_host,"UTF-8"), jsonLogin);
|
||||
|
||||
String result = HttpUtils.postJson(login_host, jsonLogin);
|
||||
if(result == null) return false;
|
||||
|
||||
String token = null;
|
||||
@ -117,19 +117,14 @@ public class KingMaForwarder extends Forwarder{
|
||||
sendNum++;
|
||||
}
|
||||
String json = GsonUtil.toJson(dataList);
|
||||
try {
|
||||
String result = HttpUtils.postJson(URLEncoder.encode(data_host, "UTF-8"), header, json);
|
||||
String result = HttpUtils.postJson(data_host,header,json);
|
||||
logger.info("project " + projectId + ": push calculation result to Kingma");
|
||||
logger.info(json);
|
||||
logger.info("result: "+result);
|
||||
JSONObject obj = (JSONObject) JSONObject.parse(result);
|
||||
String msg = obj.getString("message");
|
||||
if(msg.equals("Success")) return sendNum;
|
||||
}
|
||||
catch (Exception e){
|
||||
logger.error(e.toString());
|
||||
}
|
||||
return 0;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user