| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.inspectiontask.dto.TimingTaskDto; |
| | | import com.ruoyi.inspectiontask.mapper.TimingTaskMapper; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | |
| | | if (taskId == null || taskId <= 0) { |
| | | return; |
| | | } |
| | | if (deviceLedgerMapper.selectById(taskId.longValue()) == null) { |
| | | DeviceLedger deviceLedger = deviceLedgerMapper.selectById(taskId.longValue()); |
| | | if (deviceLedger == null) { |
| | | throw new IllegalArgumentException("所选设备不存在,请重新选择"); |
| | | } |
| | | boolean deviceChanged = oldTimingTask == null || !Objects.equals(oldTimingTask.getTaskId(), taskId); |
| | | if (deviceChanged && Integer.valueOf(0).equals(deviceLedger.getIsEnabled())) { |
| | | throw new IllegalArgumentException("所选设备已停用,不能安排巡检"); |
| | | } |
| | | } |
| | | |
| | | public LocalDateTime calculateFirstExecutionTime(TimingTask task) { |