|
@@ -81,7 +81,7 @@ public class DashboardJob {
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(DashboardJob.class);
|
|
|
|
|
|
- @Scheduled(cron="0 0/2 * * * ?")
|
|
|
+ @Scheduled(cron="0 0/1 * * * ?")
|
|
|
public void updateDashboardJob(){
|
|
|
//taskService.pushTask();
|
|
|
BaseContextHandler.setTenant("0000");
|
|
@@ -147,13 +147,11 @@ public class DashboardJob {
|
|
|
LbqWrapper<AAutoNodeLog> warnWrapper = warnWrap.lambda();
|
|
|
//Date start = new Date();
|
|
|
//警报弹框只执行一次
|
|
|
- //Date end = DateUtil.stringToDate7(DateUtil.dateToString(new Date()) + " 23:59:59");
|
|
|
- //warnWrapper.between(AAutoNodeLog::getCreateTime,start, end);
|
|
|
- //warnWrapper.isNull(AAutoNodeLog::getExeResult).le(AAutoNodeLog::getEndTime,new Date());
|
|
|
- //warnWrapper.and(condition -> condition.isNull(AAutoNodeLog::getExeResult).or().eq(AAutoNodeLog::getExeResult,"0")).orderByDesc(AAutoNodeLog::getCreateTime);
|
|
|
//返回还未处理、执行状态为失败,并且还未推送的日志记录
|
|
|
- warnWrapper.eq(AAutoNodeLog::getExeResult,"0").eq(AAutoNodeLog::getStatus,"0").eq(AAutoNodeLog::getSendStatus,"0");
|
|
|
- IPage<AAutoNodeLog> warnData = autoNodeLogService.pageList(new Page<AAutoNodeLog>(), warnWrapper);
|
|
|
+ warnWrapper.eq(AAutoNodeLog::getExeResult,"0").eq(AAutoNodeLog::getStatus,"0")
|
|
|
+ //.eq(AAutoNodeLog::getSendStatus,"0")
|
|
|
+ .orderByDesc(AAutoNodeLog::getCreateTime);
|
|
|
+ IPage<AAutoNodeLog> warnData = autoNodeLogService.pageList(new Page<AAutoNodeLog>(1L, 5), warnWrapper);
|
|
|
|
|
|
Map warnMap = Maps.newHashMap();
|
|
|
warnMap.put("warnData", warnData);
|
|
@@ -170,14 +168,14 @@ public class DashboardJob {
|
|
|
webSocketServer.BroadCastInfo(pushMsg);
|
|
|
|
|
|
//更新推送状态
|
|
|
- if(CollectionUtil.isNotEmpty(warnData.getRecords())) {
|
|
|
- Long[] ids = warnData.getRecords().stream().map(item -> {
|
|
|
- return item.getId();
|
|
|
- }).toArray(Long[]::new);
|
|
|
- UpdateWrapper<AAutoNodeLog> updateWrapper = new UpdateWrapper<AAutoNodeLog>();
|
|
|
- updateWrapper.lambda().set(AAutoNodeLog::getSendStatus, "1").in(AAutoNodeLog::getId, ids);
|
|
|
- autoNodeLogService.update(null, updateWrapper);
|
|
|
- }
|
|
|
+// if(CollectionUtil.isNotEmpty(warnData.getRecords())) {
|
|
|
+// Long[] ids = warnData.getRecords().stream().map(item -> {
|
|
|
+// return item.getId();
|
|
|
+// }).toArray(Long[]::new);
|
|
|
+// UpdateWrapper<AAutoNodeLog> updateWrapper = new UpdateWrapper<AAutoNodeLog>();
|
|
|
+// updateWrapper.lambda().set(AAutoNodeLog::getSendStatus, "1").in(AAutoNodeLog::getId, ids);
|
|
|
+// autoNodeLogService.update(null, updateWrapper);
|
|
|
+// }
|
|
|
}
|
|
|
catch (Exception e){
|
|
|
logger.error("推送异常======"+e.getMessage());
|