优化逻辑

This commit is contained in:
weitang 2025-06-06 09:19:41 +08:00
parent 90254b22bb
commit 4aff06ac8b
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ public class AlgorithmTaskManager {
private static final String JOB_GROUP_PREFIX = "STATION_";
// 存储每个 stationCode 对应的 Scheduler
private Map<String, Scheduler> schedulers = new HashMap<>();
private final Map<String, Scheduler> schedulers = new HashMap<>();
/**
* 添加定时任务

View File

@ -25,10 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -113,6 +110,9 @@ public class SubstationMaindeviceController {
@GetMapping("/getMainDeviceByType")
@ApiOperation("根据主设备类型获取主设备")
public ResponseResult getMainDeviceByType(String stationCode, String deviceType) {
if (StrUtil.isBlank(stationCode) || StrUtil.isBlank(deviceType)) {
return ResponseResult.successData(new ArrayList<>());
}
LambdaQueryWrapper<SubstationMaindevice> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StrUtil.isNotBlank(stationCode), SubstationMaindevice::getStationCode, stationCode);
queryWrapper.eq(StrUtil.isNotBlank(deviceType), SubstationMaindevice::getDeviceType, StrUtil.split(deviceType