|
|
|
@ -79,6 +79,7 @@ public class DeviceDownloadService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getToken() {
|
|
|
|
|
token = redisUtil.get("UDISYNC_TOKEN");
|
|
|
|
|
if (StrUtil.isEmpty(token)) {
|
|
|
|
|
companyEntity = companyService.findCompany();
|
|
|
|
|
TokenRequest tokenRequest = new TokenRequest();
|
|
|
|
@ -88,13 +89,12 @@ public class DeviceDownloadService {
|
|
|
|
|
String response = HttpClient.post("token/get", tokenRequest);
|
|
|
|
|
TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class);
|
|
|
|
|
token = tokenEntity.getAccessToken();
|
|
|
|
|
redisUtil.setEx("UDISYNC_TOKEN", token, 1 * 60 * 60 * 6);
|
|
|
|
|
}
|
|
|
|
|
return token;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTokenNow(TokenRequest tokenRequest) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String response = HttpClient.post("token/get", tokenRequest);
|
|
|
|
|
TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class);
|
|
|
|
@ -329,7 +329,7 @@ public class DeviceDownloadService {
|
|
|
|
|
jobLog.setRealCount(jobLog.getRealCount() + dataSetResult.getDataSet().getDeviceInfo().size());
|
|
|
|
|
jobLog.setInsertCount(jobLog.getInsertCount() + insertCount);
|
|
|
|
|
jobLog.setTotalCount(dataSetResult.getTotalRecordCount());
|
|
|
|
|
jobLog.setMsg("下载中:" + "总条数:" + dataSetResult.getTotalRecordCount() + ";下载条数:" + jobLog.getRealCount() + ";插入条数:" + jobLog.getInsertCount());
|
|
|
|
|
jobLog.setMsg("总条数:" + dataSetResult.getTotalRecordCount() + ";下载条数:" + jobLog.getRealCount() + ";插入条数:" + jobLog.getInsertCount());
|
|
|
|
|
jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest));
|
|
|
|
|
jobLogService.update(jobLog);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|