From 21470758cfe2fa92be6dc0934d7e495aa8517e34 Mon Sep 17 00:00:00 2001 From: nixj Date: Mon, 27 May 2024 09:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=E3=80=91=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E5=8D=95=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=BAnull=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/impl/JdbcConsumptionDetailRepositoryImpl.java | 3 +++ .../com/chint/manage/service/impl/ManageServiceImpl.java | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java index 29148b91..129a723a 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -54,6 +54,9 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } Map params = new HashMap<>(); + if (dto.getActualOrderNo()!=null&&dto.getActualOrderNo().isEmpty()){ + dto.setActualOrderNo(null); + } params.put("actualOrderNo", dto.getActualOrderNo()); params.put("userIds", dto.getUserIds()); PageRequest pageRequest = PageRequest diff --git a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java index 98f1de08..8b645400 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -89,9 +89,12 @@ public class ManageServiceImpl implements ManageService { @Override public PageResult itineraryPageQuery(ItineraryPageQuery dto) { - List users=jdbcUserRepository.findAllByNameContains(dto.getApplicant()); - if (users==null||users.isEmpty()){ - return null; + List users=new ArrayList<>(); + if (dto.getApplicant()!=null&&!dto.getApplicant().isEmpty()){ + users=jdbcUserRepository.findAllByNameContains(dto.getApplicant()); + if (users==null||users.isEmpty()){ + return null; + } } dto.setUserIds(users.stream().map(User::getEmployeeNo).toList()); Page page= jdbcConsumptionDetailRepository.itineraryPageQueryByDto(dto);