From bd97a783060618c08510de59a4a5695742c7e903 Mon Sep 17 00:00:00 2001 From: nixj Date: Mon, 27 May 2024 10:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BC=A0=E5=8F=82null=E8=AE=BE=E7=BD=AE=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/entity/query/ConsumptionDetailQuery.java | 4 ++-- .../chint/manage/entity/query/ItineraryPageQuery.java | 4 ++-- .../com/chint/manage/entity/query/OrderPageQuery.java | 10 +++++----- .../impl/JdbcConsumptionDetailRepositoryImpl.java | 9 ++------- .../chint/manage/service/impl/ManageServiceImpl.java | 2 +- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java b/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java index dfd37b77..9c5300e6 100644 --- a/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java +++ b/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java @@ -14,6 +14,6 @@ public class ConsumptionDetailQuery extends BaseQuery{ * 0-火车 1飞机 2酒店 3打车 */ private Integer productType; - private String userName; - private String orderNo; + private String userName=""; + private String orderNo=""; } diff --git a/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java b/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java index 62e2ebc1..4d7e7639 100644 --- a/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java +++ b/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java @@ -8,7 +8,7 @@ import java.util.List; @Data public class ItineraryPageQuery extends BaseQuery { - private String applicant;// 申请人 - private String actualOrderNo; //申请单号 + private String applicant="";// 申请人 + private String actualOrderNo=""; //申请单号 private List userIds=new ArrayList<>(); } diff --git a/src/main/java/com/chint/manage/entity/query/OrderPageQuery.java b/src/main/java/com/chint/manage/entity/query/OrderPageQuery.java index f3e08024..ae52fbbd 100644 --- a/src/main/java/com/chint/manage/entity/query/OrderPageQuery.java +++ b/src/main/java/com/chint/manage/entity/query/OrderPageQuery.java @@ -9,13 +9,13 @@ import java.util.List; @Data public class OrderPageQuery extends BaseQuery { //订单号 - private String oderNo; + private String oderNo=""; //申请单号 - private String actualOrderNo; + private String actualOrderNo=""; //出行人 - private String travelers; + private String travelers=""; //预订人 - private String applicant; + private String applicant=""; //开始日期 private String startTime; //结束日期 @@ -23,6 +23,6 @@ public class OrderPageQuery extends BaseQuery { //产品类型 private String productType; //部门名称 - private String deptName; + private String deptName=""; private List userIds=new ArrayList<>(); } 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 129a723a..934198de 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -54,7 +54,8 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } Map params = new HashMap<>(); - if (dto.getActualOrderNo()!=null&&dto.getActualOrderNo().isEmpty()){ + //设置null + if (dto.getActualOrderNo().isEmpty()){ dto.setActualOrderNo(null); } params.put("actualOrderNo", dto.getActualOrderNo()); @@ -74,12 +75,6 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai @Override public PageResult pageConsumptionDetail(ConsumptionDetailQuery dto) { - if (dto.getUserName()==null){ - dto.setUserName(""); - } - if (dto.getOrderNo()==null){ - dto.setOrderNo(""); - } PageRequest pageRequest = PageRequest .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id").descending()); Page data=new PageImpl<>(Collections.emptyList()); 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 8b645400..d3eefd9e 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -90,7 +90,7 @@ public class ManageServiceImpl implements ManageService { @Override public PageResult itineraryPageQuery(ItineraryPageQuery dto) { List users=new ArrayList<>(); - if (dto.getApplicant()!=null&&!dto.getApplicant().isEmpty()){ + if (!dto.getApplicant().isEmpty()){ users=jdbcUserRepository.findAllByNameContains(dto.getApplicant()); if (users==null||users.isEmpty()){ return null;