|
|
|
|
@ -48,6 +48,7 @@ import org.springblade.modules.system.service.IDictService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.time.LocalTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -418,7 +419,11 @@ public class ConfigMonitorServiceImpl extends ServiceImpl<ConfigMonitorMapper, C |
|
|
|
|
@Override |
|
|
|
|
public List<ConfigMonitor> getMiddleList() { |
|
|
|
|
LambdaQueryWrapper<ConfigMonitor> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(ConfigMonitor::getType, MonitorConstant.REDIS).or().eq(ConfigMonitor::getType, MonitorConstant.MYSQL); |
|
|
|
|
List<String> typeList = new ArrayList<>(); |
|
|
|
|
typeList.add(MonitorConstant.REDIS); |
|
|
|
|
typeList.add(MonitorConstant.MYSQL); |
|
|
|
|
typeList.add(MonitorConstant.SOFTWARE); |
|
|
|
|
wrapper.in(ConfigMonitor::getType, typeList); |
|
|
|
|
List<ConfigMonitor> list = baseMapper.selectList(wrapper); |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
@ -475,6 +480,8 @@ public class ConfigMonitorServiceImpl extends ServiceImpl<ConfigMonitorMapper, C |
|
|
|
|
monitoringEquip(); |
|
|
|
|
//更新报警信息
|
|
|
|
|
updateDataWarn(); |
|
|
|
|
//更新门禁软件状态
|
|
|
|
|
checkSysSoftware(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<Long> getParentIdList(List<Long> parentIdList, Long parentId) { |
|
|
|
|
@ -495,5 +502,35 @@ public class ConfigMonitorServiceImpl extends ServiceImpl<ConfigMonitorMapper, C |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean checkSysSoftware(){ |
|
|
|
|
LambdaQueryWrapper<ConfigMonitor> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(BaseEntity::getIsDeleted,"0"); |
|
|
|
|
queryWrapper.eq(ConfigMonitor::getType,"software"); |
|
|
|
|
ConfigMonitor monitor = baseMapper.selectOne(queryWrapper); |
|
|
|
|
LocalTime now = LocalTime.now(); |
|
|
|
|
LocalTime start1 = LocalTime.of(17, 0); |
|
|
|
|
LocalTime end1 = LocalTime.of(8, 0); |
|
|
|
|
if((now.isBefore(end1)&&now.isAfter(start1))){ |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
Date date = new Date(); |
|
|
|
|
Date beforeDate = baseMapper.getMaxTime(); |
|
|
|
|
long diff = date.getTime() - beforeDate.getTime(); |
|
|
|
|
if(diff > 30 * 60 * 1000){ |
|
|
|
|
if(monitor!=null){ |
|
|
|
|
monitor.setStatus(2); |
|
|
|
|
monitor.setResult("result"); |
|
|
|
|
} |
|
|
|
|
baseMapper.updateById(monitor); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if(monitor!=null){ |
|
|
|
|
monitor.setStatus(1); |
|
|
|
|
monitor.setResult("0"); |
|
|
|
|
} |
|
|
|
|
baseMapper.updateById(monitor); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|