| | |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.system.service.ISysConfigService; |
| | | import com.ycl.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 设备资产Service业务层处理 |
| | |
| | | { |
| | | @Autowired |
| | | private TMonitorMapper tMonitorMapper; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * 查询设备资产 |
| | |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public List<TMonitorVO> selectTMonitorList(TMonitor tMonitor) |
| | | { |
| | | return tMonitorMapper.selectTMonitorList(tMonitor); |
| | | List<TMonitorVO> monitors = tMonitorMapper.selectTMonitorList(tMonitor); |
| | | if (Objects.equals(tMonitor.getRecovery(), 1L)) { |
| | | String time = configService.selectConfigByKey("abnormal.equipment.continuous.attention.time"); |
| | | if (StringUtils.isBlank(time)) { |
| | | throw new RuntimeException("请配置异常设备连续关注时间"); |
| | | } |
| | | List<TMonitorVO> recoveryMonitors = tMonitorMapper.selectRecoveryMonitor(time); |
| | | monitors.addAll(recoveryMonitors); |
| | | } |
| | | return monitors; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public Map<String, String> recoveryException() { |
| | | return tMonitorMapper.recoveryException(); |
| | | String time = configService.selectConfigByKey("abnormal.equipment.continuous.attention.time"); |
| | | return tMonitorMapper.recoveryException(time); |
| | | } |
| | | } |