|
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.aliyun.oss.common.utils.StringUtils;
|
|
|
import com.imcs.admin.db.service.JdbcService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -251,7 +252,7 @@ public class DeviceCollectionTaskJob {
|
|
|
list.add(map);
|
|
|
detailInfo = JSONUtil.toJsonStr(list);
|
|
|
long todayEarliestPowerOnTime = 0;
|
|
|
- if(!Objects.isNull(powerOnTime.toString())){
|
|
|
+ if(!Objects.isNull(powerOnTime) && !StringUtils.isNullOrEmpty(powerOnTime.toString()) && !"null".equals(powerOnTime.toString())){
|
|
|
todayEarliestPowerOnTime = Long.parseLong(powerOnTime.toString());
|
|
|
}
|
|
|
String sql = "insert into device_collection_detail (device_rate,today_earliest_power_on_time,detail_info,create_date,device_ip) values(?,?,?,?,?) ";
|
|
@@ -322,12 +323,12 @@ public class DeviceCollectionTaskJob {
|
|
|
String url = "http://localhost:9000/DeviceApi";
|
|
|
String returnInfo = null;
|
|
|
try{
|
|
|
- // returnInfo = restTemplate.postForObject(url, formEntity, String.class);
|
|
|
+ returnInfo = restTemplate.postForObject(url, formEntity, String.class);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
log.info("连接报错,参数:{}",data);
|
|
|
}
|
|
|
- returnInfo = "{" +
|
|
|
+ /*returnInfo = "{" +
|
|
|
"code:0," +
|
|
|
"result:true," +
|
|
|
"msg:调用成功," +
|
|
@@ -338,7 +339,7 @@ public class DeviceCollectionTaskJob {
|
|
|
"actSpindle:1," +
|
|
|
"powerOnTime:26947355," +
|
|
|
"deviceState:不在线" +
|
|
|
- "}";
|
|
|
+ "}";*/
|
|
|
log.info("返回值:{}",returnInfo);
|
|
|
return returnInfo;
|
|
|
}
|