Commit f07fd244 authored by duanruiming's avatar duanruiming

[update] 优化告警数据和页面统计联动2

parent e97d6cbb
......@@ -18,6 +18,7 @@ import net.wanji.web.mapper.TDeviceStatusMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -74,13 +75,23 @@ public class SignalStatusTask {
// 更新数据库状态
updateSignalStatus(signalStatusVO, crossId, name, currentSignalStatus, currentFaultType);
insertControlHist(signalStatusVO);
log.info("更新信号机状态成功");
});
extracted();
} catch (Exception e) {
log.error("定时任务同步信号机设备状态远程utcService调用异常", e);
}
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void extracted() {
LambdaQueryWrapper<TDeviceStatusInfo> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
objectLambdaQueryWrapper.eq(TDeviceStatusInfo::getStatus, 1);
int size = tDeviceStatusMapper.selectList(objectLambdaQueryWrapper).size();
log.info("当前设备在线数量:{}", size);
}
private static String getSignalName(List<BaseCrossInfoPO> finalBaseCrossInfoPOList, String crossId) {
String name = null;
for (BaseCrossInfoPO baseCrossInfoPO : finalBaseCrossInfoPOList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment