This commit is contained in:
2026-07-29 13:08:49 +08:00
parent 29ecbf321f
commit 6be6d5d333
59 changed files with 1396 additions and 304 deletions

View File

@@ -9,6 +9,7 @@ import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import com.maibu.memory.DeviceSessionManager;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -29,7 +30,6 @@ import com.maibu.dto.DevicePlanStatisticsDTO;
import com.maibu.dto.DevicePlanTaskStatisticsDTO;
import com.maibu.dto.DeviceTaskQueryDTO;
import com.maibu.dto.DeviceWorkStatisticsDTO;
import com.maibu.manager.DeviceSessionManager;
import com.maibu.mapper.DeviceMapper;
import com.maibu.mapper.DevicePlanMapper;
import com.maibu.mapper.DevicePlanTaskMapper;
@@ -454,7 +454,7 @@ public class DeviceTaskService {
return list;
}
public boolean createDeviceTask(DeviceTaskCommandDTO dto, String username) {
public Long createDeviceTask(DeviceTaskCommandDTO dto, String username) {
DevicePlanTask task = new DevicePlanTask();
task.setOrgId(dto.getOrgId());
task.setSiteId(dto.getSiteId());
@@ -464,7 +464,7 @@ public class DeviceTaskService {
task.setCreateTime(LocalDateTime.now());
task.setRouteId(dto.getRouteId());
task.setStartTime(dto.getStartTime());
boolean result = devicePlanTaskMapper.saveOrUpdate(task);
devicePlanTaskMapper.saveOrUpdate(task);
if (dto.getOrgId() == null) {
SysSite site = sysSiteMapper.selectById(dto.getSiteId());
if (site != null) {
@@ -473,7 +473,7 @@ public class DeviceTaskService {
}
SiteMemory siteMemory = GlobalMemory.getSiteMemory(task.getOrgId(), task.getSiteId());
siteMemory.addDevicePlanPrepare(task);
return result;
return task.getId();
}
public boolean cancelTask(DeviceTaskCommandDTO dto, String username) {