diff --git a/src/main/java/club/joylink/rtss/services/CommandService.java b/src/main/java/club/joylink/rtss/services/CommandService.java index 26be58c11..7d67efd3c 100644 --- a/src/main/java/club/joylink/rtss/services/CommandService.java +++ b/src/main/java/club/joylink/rtss/services/CommandService.java @@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.ArrayList; import java.util.List; @@ -52,11 +53,11 @@ public class CommandService implements ICommandService { CommandDefinitionExample commandDefinitionExample = new CommandDefinitionExample(); CommandDefinitionExample.Criteria criteria = commandDefinitionExample.createCriteria(); //条件:线路 - if (!lineCode.isEmpty()) { + if (!StringUtils.isEmpty(lineCode)) { criteria.andLineCodeEqualTo(lineCode); } //条件:操作对象 - if (!queryVO.getOperateObject().isEmpty()) { + if (!StringUtils.isEmpty(queryVO.getOperateObject())) { criteria.andOperateObjectEqualTo(queryVO.getOperateObject()); } @@ -86,14 +87,14 @@ public class CommandService implements ICommandService { //条件:线路 CommandDefinitionExample commandDefinitionExample = new CommandDefinitionExample(); - if (!lineCode.isEmpty()) { + if (!StringUtils.isEmpty(lineCode)) { CommandDefinitionExample.Criteria criteria = commandDefinitionExample.createCriteria(); criteria.andLineCodeEqualTo(lineCode); - if (!simulationRole.isEmpty()) { + if (!StringUtils.isEmpty(simulationRole)) { //+操作对象过滤 criteria.andSimulationRoleEqualTo(simulationRole); } - if (!prdType.isEmpty()) { + if (!StringUtils.isEmpty(prdType)) { criteria.andPrdTypeEqualTo(prdType); }