|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -122,7 +123,7 @@ public class BusDeviceRunningServiceImpl implements IBusDeviceRunningService
|
|
|
busDeviceNews.setBloodVolumeReturn(json.getBody().getCurrentValue().getBloodVolumeReturn());
|
|
busDeviceNews.setBloodVolumeReturn(json.getBody().getCurrentValue().getBloodVolumeReturn());
|
|
|
busDeviceNews.setRateBpReal(json.getBody().getCurrentValue().getRateBPReal());
|
|
busDeviceNews.setRateBpReal(json.getBody().getCurrentValue().getRateBPReal());
|
|
|
}
|
|
}
|
|
|
- SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
|
|
+ SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String createTime =sm.format(new Date());
|
|
String createTime =sm.format(new Date());
|
|
|
|
|
|
|
|
List<BusDeviceHistory> historyList = busDeviceHistoryMapper.selectBusDeviceByDeviceId(deviceId);
|
|
List<BusDeviceHistory> historyList = busDeviceHistoryMapper.selectBusDeviceByDeviceId(deviceId);
|
|
@@ -133,10 +134,26 @@ public class BusDeviceRunningServiceImpl implements IBusDeviceRunningService
|
|
|
busDeviceHistoryMapper.updateBusDeviceHistory(deviceHistory);
|
|
busDeviceHistoryMapper.updateBusDeviceHistory(deviceHistory);
|
|
|
}
|
|
}
|
|
|
busDeviceNews.setHistoryId(deviceHistory.getId());
|
|
busDeviceNews.setHistoryId(deviceHistory.getId());
|
|
|
|
|
+
|
|
|
|
|
+ BusDeviceNews findNewsByDIdAndCreateTime = new BusDeviceNews();
|
|
|
|
|
+ SimpleDateFormat fm =new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ String NDate = fm.format(new Date());
|
|
|
|
|
+ findNewsByDIdAndCreateTime.setDeviceId(deviceId);
|
|
|
|
|
+ findNewsByDIdAndCreateTime.setTime(this.addHour(busDeviceNews.getTime(),-3));
|
|
|
|
|
+ List<BusDeviceNews> newsLists = busDeviceNewsMapper.selectBusDeviceNewsListByDIdAndCreateTime(findNewsByDIdAndCreateTime);
|
|
|
|
|
+ System.out.println("newsLists.size()::::::::::::::"+newsLists.size());
|
|
|
|
|
+ if(newsLists!=null && newsLists.size()>0){
|
|
|
|
|
+ for(int i = 0; i<newsLists.size(); i++){
|
|
|
|
|
+ BusDeviceNews upHis = newsLists.get(i);
|
|
|
|
|
+ upHis.setHistoryId(deviceHistory.getId());
|
|
|
|
|
+ this.busDeviceNewsMapper.updateBusDeviceNews(upHis);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
busDeviceRunning.setStatus("0");
|
|
busDeviceRunning.setStatus("0");
|
|
|
}
|
|
}
|
|
|
busDeviceNews.setCreateTime(createTime);
|
|
busDeviceNews.setCreateTime(createTime);
|
|
|
|
|
+
|
|
|
busDeviceNewsMapper.insertBusDeviceNews(busDeviceNews);
|
|
busDeviceNewsMapper.insertBusDeviceNews(busDeviceNews);
|
|
|
return busDeviceRunningMapper.insertBusDeviceRunning(busDeviceRunning);
|
|
return busDeviceRunningMapper.insertBusDeviceRunning(busDeviceRunning);
|
|
|
}
|
|
}
|
|
@@ -176,4 +193,18 @@ public class BusDeviceRunningServiceImpl implements IBusDeviceRunningService
|
|
|
{
|
|
{
|
|
|
return busDeviceRunningMapper.deleteBusDeviceRunningById(id);
|
|
return busDeviceRunningMapper.deleteBusDeviceRunningById(id);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 在原日期的基础上增加小时数
|
|
|
|
|
+ * @param date
|
|
|
|
|
+ * @param i
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static Date addHour(Date date,int i){
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(date);
|
|
|
|
|
+ c.add(Calendar.HOUR_OF_DAY, i);
|
|
|
|
|
+ Date newDate = c.getTime();
|
|
|
|
|
+ return newDate;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|