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;