From 0bc1c477919750ad7f7c3ffb9fa3c77c3f89cd12 Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 8 May 2024 16:54:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E3=80=90add=E3=80=91readme=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BB=93=E7=AE=97=E3=80=81=E8=AF=A6=E6=83=85=E8=A1=A8?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51f01f2e..7f5c4eb4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 差旅项目 +# 差旅项目功能模块 ## application ### commands 继承command类,通用的of方法用于选取处理方法 @@ -48,4 +48,17 @@ dao层 加密、jwt等工具类 ## interfaces ### rest -高德、同程、携程等第三方API \ No newline at end of file +高德、同程、携程等第三方API + +# 表 +## 结算记录表 非实时(同程是 月初才有数据 , 携程是 T+1) +order_flight_record +order_hotel_record +order_train_record +order_car_record + +## 结算详情表 实时 +flight_order_detail +hotel_order_detail +train_order_detail +car_order_detail \ No newline at end of file From 881938047af2c8c50d0c0c52b6f96dc4e2187d79 Mon Sep 17 00:00:00 2001 From: nixj Date: Thu, 9 May 2024 08:52:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=90update=E3=80=91=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E4=B8=BAdetail=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jdbc/JdbcOrderCarRecordRepository.java | 2 - .../jdbc/JdbcOrderFlightRecordRepository.java | 2 - .../jdbc/JdbcOrderHotelRecordRepository.java | 1 - .../jdbc/JdbcOrderTrainRecordRepository.java | 3 - .../manage/entity/ConsumptionDetailExcel.java | 4 +- .../mapper/JdbcCarOrderDetailRepository.java | 13 +++ .../JdbcFlightOrderDetailRepository.java | 13 +++ .../JdbcHotelOrderDetailRepository.java | 14 +++ .../JdbcTrainOrderDetailRepository.java | 13 +++ .../JdbcConsumptionDetailRepositoryImpl.java | 107 ++++++++++++++---- 10 files changed, 143 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/chint/manage/mapper/JdbcCarOrderDetailRepository.java create mode 100644 src/main/java/com/chint/manage/mapper/JdbcFlightOrderDetailRepository.java create mode 100644 src/main/java/com/chint/manage/mapper/JdbcHotelOrderDetailRepository.java create mode 100644 src/main/java/com/chint/manage/mapper/JdbcTrainOrderDetailRepository.java diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderCarRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderCarRecordRepository.java index 63611abc..d5fde564 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderCarRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderCarRecordRepository.java @@ -48,6 +48,4 @@ public interface JdbcOrderCarRecordRepository extends CrudRepository findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderFlightRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderFlightRecordRepository.java index d9570ea4..4ef8daf5 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderFlightRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderFlightRecordRepository.java @@ -47,6 +47,4 @@ public interface JdbcOrderFlightRecordRepository extends CrudRepository findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderHotelRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderHotelRecordRepository.java index 2b1a45e6..d1ed6c2c 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderHotelRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderHotelRecordRepository.java @@ -49,5 +49,4 @@ public interface JdbcOrderHotelRecordRepository extends CrudRepository findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderTrainRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderTrainRecordRepository.java index e6c9e029..e9a52072 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderTrainRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderTrainRecordRepository.java @@ -46,7 +46,4 @@ public interface JdbcOrderTrainRecordRepository extends CrudRepository findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); } diff --git a/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java b/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java index 72905207..e12c6c8a 100644 --- a/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java +++ b/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java @@ -1,6 +1,7 @@ package com.chint.manage.entity; import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Builder; import lombok.Data; /** @@ -9,6 +10,7 @@ import lombok.Data; * @Date:2024/5/7 14:17 */ @Data +@Builder public class ConsumptionDetailExcel extends BaseExcel{ @ExcelProperty("出行人姓名") private String userName; @@ -25,6 +27,6 @@ public class ConsumptionDetailExcel extends BaseExcel{ @ExcelProperty("到达站") private String toStationName; @ExcelProperty("订单总额(含前收服务费)") - private String payAmount; + private String orderAmount; } diff --git a/src/main/java/com/chint/manage/mapper/JdbcCarOrderDetailRepository.java b/src/main/java/com/chint/manage/mapper/JdbcCarOrderDetailRepository.java new file mode 100644 index 00000000..e618902d --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcCarOrderDetailRepository.java @@ -0,0 +1,13 @@ +package com.chint.manage.mapper; + +import com.chint.domain.aggregates.order.CarOrderDetail; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcCarOrderDetailRepository extends CrudRepository { + + Page findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); +} diff --git a/src/main/java/com/chint/manage/mapper/JdbcFlightOrderDetailRepository.java b/src/main/java/com/chint/manage/mapper/JdbcFlightOrderDetailRepository.java new file mode 100644 index 00000000..e8d30c7c --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcFlightOrderDetailRepository.java @@ -0,0 +1,13 @@ +package com.chint.manage.mapper; + +import com.chint.domain.aggregates.order.FlightOrderDetail; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcFlightOrderDetailRepository extends CrudRepository { + + Page findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); +} diff --git a/src/main/java/com/chint/manage/mapper/JdbcHotelOrderDetailRepository.java b/src/main/java/com/chint/manage/mapper/JdbcHotelOrderDetailRepository.java new file mode 100644 index 00000000..4fcda59e --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcHotelOrderDetailRepository.java @@ -0,0 +1,14 @@ +package com.chint.manage.mapper; + +import com.chint.domain.aggregates.order.HotelOrderDetail; +import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcHotelOrderDetailRepository extends CrudRepository { + + Page findAllByBookingNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); +} diff --git a/src/main/java/com/chint/manage/mapper/JdbcTrainOrderDetailRepository.java b/src/main/java/com/chint/manage/mapper/JdbcTrainOrderDetailRepository.java new file mode 100644 index 00000000..ca270676 --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcTrainOrderDetailRepository.java @@ -0,0 +1,13 @@ +package com.chint.manage.mapper; + +import com.chint.domain.aggregates.order.TrainOrderDetail; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcTrainOrderDetailRepository extends CrudRepository { + + Page findAllByUserNameContainsAndOrderNoContaining(String userName, String orderNo, Pageable pageable); +} 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 904308f6..393da817 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -1,13 +1,13 @@ package com.chint.manage.mapper.impl; -import com.chint.domain.aggregates.order.OrderDetail; +import com.chint.domain.aggregates.order.*; import com.chint.domain.aggregates.order.order_record.*; import com.chint.infrastructure.constant.LegConstant; import com.chint.infrastructure.repository.jdbc.*; import com.chint.infrastructure.util.PageResult; import com.chint.manage.entity.ConsumptionDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; -import com.chint.manage.mapper.JdbcConsumptionDetailRepository; +import com.chint.manage.mapper.*; import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -32,13 +32,13 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private NamedParameterJdbcTemplate jdbcTemplate; @Autowired - private JdbcOrderTrainRecordRepository jdbcOrderTrainRecordRepository; + private JdbcTrainOrderDetailRepository jdbcTrainOrderDetailRepository; @Autowired - private JdbcOrderCarRecordRepository jdbcOrderCarRecordRepository; + private JdbcCarOrderDetailRepository jdbcCarOrderDetailRepository; @Autowired - private JdbcOrderHotelRecordRepository jdbcOrderHotelRecordRepository; + private JdbcHotelOrderDetailRepository jdbcHotelOrderDetailRepository; @Autowired - private JdbcOrderFlightRecordRepository jdbcOrderFlightRecordRepository; + private JdbcFlightOrderDetailRepository jdbcFlightOrderDetailRepository; @Override @@ -74,27 +74,33 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } PageRequest pageRequest = PageRequest .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id")); - Page data=new PageImpl<>(Collections.emptyList()); + Page data=new PageImpl<>(Collections.emptyList()); + //todo 各类型数据处理 record换成detail表 switch (dto.getProductType()) { - case LEG_TYPE_TRAIN -> data=jdbcOrderTrainRecordRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest); - case LEG_TYPE_AIRPLANE -> data=jdbcOrderFlightRecordRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest); - case LEG_TYPE_HOTEL -> data=jdbcOrderHotelRecordRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest); - case LEG_TYPE_TAXI -> data=jdbcOrderCarRecordRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest); + case LEG_TYPE_TRAIN -> data=getOrderTrainRecord(jdbcTrainOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_AIRPLANE -> data=getOrderFlightRecord(jdbcFlightOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_HOTEL -> data=getOrderHotelRecord(jdbcHotelOrderDetailRepository.findAllByBookingNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_TAXI -> data=getOrderCarRecord(jdbcCarOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); } - //todo 数据处理 - Page result=mapOrderTrainRecordToConsumptionDetailExcel(data); - return PageResult.totalPageNum(result.getTotalElements(), result.getContent()); + return PageResult.totalPageNum(data.getTotalElements(), data.getContent()); } - public Page mapOrderTrainRecordToConsumptionDetailExcel(Page page) { - List orderRecords = page.getContent(); + public Page getOrderTrainRecord(Page page) { + List orderRecords = page.getContent(); List consumptionDetailExcels = new ArrayList<>(); // 遍历 OrderBaseRecord,将其转换为 ConsumptionDetailExcel - for (OrderBaseRecord orderRecord : orderRecords) { - ConsumptionDetailExcel consumptionDetailExcel = new ConsumptionDetailExcel(); - // 使用 BeanUtils.copyProperties 进行属性拷贝 - BeanUtils.copyProperties(orderRecord, consumptionDetailExcel); + for (TrainOrderDetail orderRecord : orderRecords) { + ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() + .userName(orderRecord.getUserName()) + .startDate(orderRecord.getStartTime()) + .arriveDate(orderRecord.getArriveTime()) + .fromCity(orderRecord.getFromCity()) + .toCity(orderRecord.getToCity()) + .fromStationName(orderRecord.getFromStationName()) + .toStationName(orderRecord.getToStationName()) + .orderAmount(orderRecord.getOrderAmount()) + .build(); // 添加到结果列表中 consumptionDetailExcels.add(consumptionDetailExcel); } @@ -102,4 +108,65 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai // 构建一个新的 Page 对象并返回 return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); } + + public Page getOrderFlightRecord(Page page) { + List orderRecords = page.getContent(); + List consumptionDetailExcels = new ArrayList<>(); + for (FlightOrderDetail orderRecord : orderRecords) { + ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() + .userName(orderRecord.getUserName()) + .startDate(orderRecord.getStartTime()) + .arriveDate(orderRecord.getArriveTime()) + .fromCity(orderRecord.getStartCityName()) + .toCity(orderRecord.getEndCityName()) + .fromStationName(orderRecord.getStartAirportName()) + .toStationName(orderRecord.getEndAirportName()) + .orderAmount(orderRecord.getOrderAmount()) + .build(); + consumptionDetailExcels.add(consumptionDetailExcel); + } + + // 构建一个新的 Page 对象并返回 + return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + } + + public Page getOrderHotelRecord(Page page) { + List orderRecords = page.getContent(); + List consumptionDetailExcels = new ArrayList<>(); + + for (HotelOrderDetail orderRecord : orderRecords) { + ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() + .userName(orderRecord.getBookingName()) + .startDate(orderRecord.getCheckInDate()) + .orderAmount(orderRecord.getOrderAmount()) + .build(); + consumptionDetailExcels.add(consumptionDetailExcel); + } + + // 构建一个新的 Page 对象并返回 + return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + } + + public Page getOrderCarRecord(Page page) { + List orderRecords = page.getContent(); + List consumptionDetailExcels = new ArrayList<>(); + + // 遍历 OrderBaseRecord,将其转换为 ConsumptionDetailExcel + for (CarOrderDetail orderRecord : orderRecords) { + ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() + .userName(orderRecord.getUserName()) + .startDate(orderRecord.getStartTime()) + .arriveDate(orderRecord.getArriveTime()) + .fromCity(orderRecord.getFromCity()) + .toCity(orderRecord.getToCity()) + .fromStationName(orderRecord.getFromStationName()) + .toStationName(orderRecord.getToStationName()) + .orderAmount(orderRecord.getOrderAmount()) + .build(); + consumptionDetailExcels.add(consumptionDetailExcel); + } + + // 构建一个新的 Page 对象并返回 + return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + } } From 21af75c2fc87ebbf5f8453cf5fcf28ee1ca71998 Mon Sep 17 00:00:00 2001 From: nixj Date: Thu, 9 May 2024 13:38:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90add=E3=80=91=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/manage/controller/ManageController.java | 2 ++ .../manage/entity/dto/ConsumptionDetailDto.java | 2 +- .../impl/JdbcConsumptionDetailRepositoryImpl.java | 13 ++++++------- .../manage/service/impl/ManageServiceImpl.java | 7 ------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/chint/manage/controller/ManageController.java b/src/main/java/com/chint/manage/controller/ManageController.java index d57179b3..654331db 100644 --- a/src/main/java/com/chint/manage/controller/ManageController.java +++ b/src/main/java/com/chint/manage/controller/ManageController.java @@ -36,6 +36,8 @@ public class ManageController { @ApiOperation("消费明细导出接口") @PostMapping("/export") public ResponseEntity export(@RequestBody ConsumptionDetailDto dto) { + dto.setPageNum(1); + dto.setPageSize(Integer.MAX_VALUE); File file = manageService.saveConsumptionDetail(dto); Resource resource; try { diff --git a/src/main/java/com/chint/manage/entity/dto/ConsumptionDetailDto.java b/src/main/java/com/chint/manage/entity/dto/ConsumptionDetailDto.java index 79b667e9..62764ea6 100644 --- a/src/main/java/com/chint/manage/entity/dto/ConsumptionDetailDto.java +++ b/src/main/java/com/chint/manage/entity/dto/ConsumptionDetailDto.java @@ -11,6 +11,6 @@ import lombok.Data; @Data public class ConsumptionDetailDto extends BaseQuery{ private Integer productType; - private String supplierName; + private String userName; private String orderNo; } 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 393da817..51e5eaa6 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -66,8 +66,8 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai @Override public PageResult pageConsumptionDetail(ConsumptionDetailDto dto) { - if (dto.getSupplierName()==null){ - dto.setSupplierName(""); + if (dto.getUserName()==null){ + dto.setUserName(""); } if (dto.getOrderNo()==null){ dto.setOrderNo(""); @@ -75,12 +75,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai PageRequest pageRequest = PageRequest .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id")); Page data=new PageImpl<>(Collections.emptyList()); - //todo 各类型数据处理 record换成detail表 switch (dto.getProductType()) { - case LEG_TYPE_TRAIN -> data=getOrderTrainRecord(jdbcTrainOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); - case LEG_TYPE_AIRPLANE -> data=getOrderFlightRecord(jdbcFlightOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); - case LEG_TYPE_HOTEL -> data=getOrderHotelRecord(jdbcHotelOrderDetailRepository.findAllByBookingNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); - case LEG_TYPE_TAXI -> data=getOrderCarRecord(jdbcCarOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getSupplierName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_TRAIN -> data=getOrderTrainRecord(jdbcTrainOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_AIRPLANE -> data=getOrderFlightRecord(jdbcFlightOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_HOTEL -> data=getOrderHotelRecord(jdbcHotelOrderDetailRepository.findAllByBookingNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); + case LEG_TYPE_TAXI -> data=getOrderCarRecord(jdbcCarOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); } return PageResult.totalPageNum(data.getTotalElements(), data.getContent()); } 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 9d067f7e..61d3d4c8 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -1,10 +1,5 @@ package com.chint.manage.service.impl; -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.chint.domain.aggregates.order.OrderDetail; -import com.chint.infrastructure.export.OrderDetailExport; import com.chint.infrastructure.util.PageResult; import com.chint.manage.entity.ConsumptionDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; @@ -15,8 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.File; -import java.util.List; -import java.util.Objects; /** * From ca520c072ba9b03da799a661f87ca7a963040e84 Mon Sep 17 00:00:00 2001 From: nixj Date: Thu, 9 May 2024 15:01:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=90update=E3=80=91=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=8A=A5=E8=A1=A8=E5=AD=97=E6=AE=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/controller/ManageController.java | 6 +- .../manage/entity/{ => excel}/BaseExcel.java | 5 +- .../entity/excel/CarOrderDetailExcel.java | 41 ++++++++ .../entity/excel/FlightOrderDetailExcel.java | 35 +++++++ .../entity/excel/HotelOrderDetailExcel.java | 31 ++++++ .../TrainOrderDetailExcel.java} | 27 ++++-- .../JdbcConsumptionDetailRepository.java | 5 +- .../JdbcConsumptionDetailRepositoryImpl.java | 96 +++++++------------ .../chint/manage/service/ManageService.java | 6 +- .../service/impl/ManageServiceImpl.java | 6 +- .../java/com/chint/manage/util/ExcelUtil.java | 4 +- src/test/java/com/chint/ManageTest.java | 7 +- 12 files changed, 177 insertions(+), 92 deletions(-) rename src/main/java/com/chint/manage/entity/{ => excel}/BaseExcel.java (90%) create mode 100644 src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java create mode 100644 src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java create mode 100644 src/main/java/com/chint/manage/entity/excel/HotelOrderDetailExcel.java rename src/main/java/com/chint/manage/entity/{ConsumptionDetailExcel.java => excel/TrainOrderDetailExcel.java} (51%) diff --git a/src/main/java/com/chint/manage/controller/ManageController.java b/src/main/java/com/chint/manage/controller/ManageController.java index 654331db..85e88852 100644 --- a/src/main/java/com/chint/manage/controller/ManageController.java +++ b/src/main/java/com/chint/manage/controller/ManageController.java @@ -1,8 +1,8 @@ package com.chint.manage.controller; -import com.chint.application.dtos.AuthenticationSignDto; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; +import com.chint.manage.entity.excel.TrainOrderDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; import com.chint.manage.service.ManageService; import io.swagger.annotations.ApiOperation; @@ -29,7 +29,7 @@ public class ManageController { @ApiOperation("消费明细查询接口") @PostMapping("/query") - public PageResult query(@RequestBody ConsumptionDetailDto dto){ + public PageResult query(@RequestBody ConsumptionDetailDto dto){ return manageService.pageConsumptionDetail(dto); } diff --git a/src/main/java/com/chint/manage/entity/BaseExcel.java b/src/main/java/com/chint/manage/entity/excel/BaseExcel.java similarity index 90% rename from src/main/java/com/chint/manage/entity/BaseExcel.java rename to src/main/java/com/chint/manage/entity/excel/BaseExcel.java index 38380637..c63149f5 100644 --- a/src/main/java/com/chint/manage/entity/BaseExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/BaseExcel.java @@ -1,14 +1,13 @@ -package com.chint.manage.entity; +package com.chint.manage.entity.excel; import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.enums.poi.FillPatternTypeEnum; -import lombok.Data; import lombok.NoArgsConstructor; /** - * + * 基础Excel类 * @Author:nxj * @Date:2024/5/8 14:57 */ diff --git a/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java new file mode 100644 index 00000000..2a577ff5 --- /dev/null +++ b/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java @@ -0,0 +1,41 @@ +package com.chint.manage.entity.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class CarOrderDetailExcel extends BaseExcel{ + @ExcelProperty("用车人姓名") + private String userName; + @ExcelProperty("出发时间") + private String startTime; + @ExcelProperty("到达时间") + private String arriveTime; + @ExcelProperty("出发城市") + private String fromCity; + @ExcelProperty("到达城市") + private String toCity; + @ExcelProperty("出发地") + private String fromStationName; + @ExcelProperty("到达地") + private String toStationName; + @ExcelProperty("订单总额(含前收服务费)") + private String orderAmount; + @ExcelProperty("车型") + private String carModel; + @ExcelProperty("里程数") + private String mileage; + @ExcelProperty("订单状态") + private String orderStatus; + @ExcelProperty("是否超标") + private String overStandard; + @ExcelProperty("超标原因") + private String overStandardReason; + @ExcelProperty("订单号") + private String orderNo; + @ExcelProperty("订单创建时间") + private String createTime; + + + +} diff --git a/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java new file mode 100644 index 00000000..07068d32 --- /dev/null +++ b/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java @@ -0,0 +1,35 @@ +package com.chint.manage.entity.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + + +@Data +public class FlightOrderDetailExcel extends BaseExcel{ + @ExcelProperty("出行人姓名") + private String userName; + @ExcelProperty("起飞时间") + private String startTime; + @ExcelProperty("到达时间") + private String arriveTime; + @ExcelProperty("起飞城市名称") + private String startCityName; + @ExcelProperty("到达城市名称") + private String endCityName; + @ExcelProperty("订单总额") + private String orderAmount; + @ExcelProperty("舱位名称") + private String seatPointName; + @ExcelProperty("订单状态") + private String orderStatus; + @ExcelProperty("是否超标") + private String isOverStandard; + @ExcelProperty("超标原因") + private String overStandardReason; + @ExcelProperty("订单号") + private String orderNo; + @ExcelProperty("订单创建时间") + private String createTime; + + +} diff --git a/src/main/java/com/chint/manage/entity/excel/HotelOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/HotelOrderDetailExcel.java new file mode 100644 index 00000000..e9c5ccbc --- /dev/null +++ b/src/main/java/com/chint/manage/entity/excel/HotelOrderDetailExcel.java @@ -0,0 +1,31 @@ +package com.chint.manage.entity.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class HotelOrderDetailExcel extends BaseExcel { + + @ExcelProperty("入住人姓名") + private String userName; + @ExcelProperty("入住日期") + private String checkInDate; + @ExcelProperty("离店日期") + private String departureDate; + @ExcelProperty("入住城市") + private String checkInCity; + @ExcelProperty("间夜信息") + private String nightRates; + @ExcelProperty("订单总额") + private String orderAmount; + @ExcelProperty("是否超标") + private String overStandard; + @ExcelProperty("超标原因") + private String overStandardReason; + @ExcelProperty("是否协议酒店") + private String agreementHotel; + @ExcelProperty("订单号") + private String orderNo; + @ExcelProperty("订单创建时间") + private String createTime; +} diff --git a/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java similarity index 51% rename from src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java rename to src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java index e12c6c8a..dd179ff5 100644 --- a/src/main/java/com/chint/manage/entity/ConsumptionDetailExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java @@ -1,23 +1,18 @@ -package com.chint.manage.entity; +package com.chint.manage.entity.excel; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Builder; import lombok.Data; -/** - * 消费明细-order_detail - * @Author:nxj - * @Date:2024/5/7 14:17 - */ + @Data -@Builder -public class ConsumptionDetailExcel extends BaseExcel{ +public class TrainOrderDetailExcel extends BaseExcel{ @ExcelProperty("出行人姓名") private String userName; @ExcelProperty("出发时间") - private String startDate; + private String startTime; @ExcelProperty("到达时间") - private String arriveDate; + private String arriveTime; @ExcelProperty("出发城市") private String fromCity; @ExcelProperty("到达城市") @@ -28,5 +23,17 @@ public class ConsumptionDetailExcel extends BaseExcel{ private String toStationName; @ExcelProperty("订单总额(含前收服务费)") private String orderAmount; + @ExcelProperty("座位等级") + private String seatType; + @ExcelProperty("订单状态") + private String orderStatus; + @ExcelProperty("是否超标") + private String overStandard; + @ExcelProperty("超标原因") + private String overStandardReason; + @ExcelProperty("订单号") + private String orderNo; + @ExcelProperty("订单创建时间") + private String createTime; } diff --git a/src/main/java/com/chint/manage/mapper/JdbcConsumptionDetailRepository.java b/src/main/java/com/chint/manage/mapper/JdbcConsumptionDetailRepository.java index e03e399b..a70cd6ca 100644 --- a/src/main/java/com/chint/manage/mapper/JdbcConsumptionDetailRepository.java +++ b/src/main/java/com/chint/manage/mapper/JdbcConsumptionDetailRepository.java @@ -2,7 +2,8 @@ package com.chint.manage.mapper; import com.chint.domain.aggregates.order.OrderDetail; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; +import com.chint.manage.entity.excel.TrainOrderDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -10,5 +11,5 @@ import org.springframework.data.domain.Pageable; public interface JdbcConsumptionDetailRepository { Page findAllByProductType(String productType, String param2, String param3, Pageable pageable); - PageResult pageConsumptionDetail(ConsumptionDetailDto dto); + PageResult pageConsumptionDetail(ConsumptionDetailDto dto); } \ No newline at end of file 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 51e5eaa6..605018c6 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -1,14 +1,10 @@ package com.chint.manage.mapper.impl; import com.chint.domain.aggregates.order.*; -import com.chint.domain.aggregates.order.order_record.*; -import com.chint.infrastructure.constant.LegConstant; -import com.chint.infrastructure.repository.jdbc.*; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.*; import com.chint.manage.entity.dto.ConsumptionDetailDto; import com.chint.manage.mapper.*; -import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.*; @@ -17,6 +13,7 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; import java.util.*; +import java.util.stream.Collectors; import static com.chint.infrastructure.constant.LegConstant.*; @@ -65,7 +62,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } @Override - public PageResult pageConsumptionDetail(ConsumptionDetailDto dto) { + public PageResult pageConsumptionDetail(ConsumptionDetailDto dto) { if (dto.getUserName()==null){ dto.setUserName(""); } @@ -74,7 +71,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } PageRequest pageRequest = PageRequest .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id")); - Page data=new PageImpl<>(Collections.emptyList()); + Page data=new PageImpl<>(Collections.emptyList()); switch (dto.getProductType()) { case LEG_TYPE_TRAIN -> data=getOrderTrainRecord(jdbcTrainOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); case LEG_TYPE_AIRPLANE -> data=getOrderFlightRecord(jdbcFlightOrderDetailRepository.findAllByUserNameContainsAndOrderNoContaining(dto.getUserName(),dto.getOrderNo(),pageRequest)); @@ -84,88 +81,61 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai return PageResult.totalPageNum(data.getTotalElements(), data.getContent()); } - public Page getOrderTrainRecord(Page page) { + public Page getOrderTrainRecord(Page page) { List orderRecords = page.getContent(); - List consumptionDetailExcels = new ArrayList<>(); - + List trainOrderDetailExcels = new ArrayList<>(); // 遍历 OrderBaseRecord,将其转换为 ConsumptionDetailExcel for (TrainOrderDetail orderRecord : orderRecords) { - ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() - .userName(orderRecord.getUserName()) - .startDate(orderRecord.getStartTime()) - .arriveDate(orderRecord.getArriveTime()) - .fromCity(orderRecord.getFromCity()) - .toCity(orderRecord.getToCity()) - .fromStationName(orderRecord.getFromStationName()) - .toStationName(orderRecord.getToStationName()) - .orderAmount(orderRecord.getOrderAmount()) - .build(); - // 添加到结果列表中 - consumptionDetailExcels.add(consumptionDetailExcel); + TrainOrderDetailExcel trainOrderDetailExcel = new TrainOrderDetailExcel(); + BeanUtils.copyProperties(orderRecord, trainOrderDetailExcel); + trainOrderDetailExcels.add(trainOrderDetailExcel); } - // 构建一个新的 Page 对象并返回 - return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + return new PageImpl<>(trainOrderDetailExcels, page.getPageable(), page.getTotalElements()); } - public Page getOrderFlightRecord(Page page) { + public Page getOrderFlightRecord(Page page) { List orderRecords = page.getContent(); - List consumptionDetailExcels = new ArrayList<>(); + List trainOrderDetailExcels = new ArrayList<>(); for (FlightOrderDetail orderRecord : orderRecords) { - ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() - .userName(orderRecord.getUserName()) - .startDate(orderRecord.getStartTime()) - .arriveDate(orderRecord.getArriveTime()) - .fromCity(orderRecord.getStartCityName()) - .toCity(orderRecord.getEndCityName()) - .fromStationName(orderRecord.getStartAirportName()) - .toStationName(orderRecord.getEndAirportName()) - .orderAmount(orderRecord.getOrderAmount()) - .build(); - consumptionDetailExcels.add(consumptionDetailExcel); + FlightOrderDetailExcel flightOrderDetailExcel = new FlightOrderDetailExcel(); + BeanUtils.copyProperties(orderRecord, flightOrderDetailExcel); + trainOrderDetailExcels.add(flightOrderDetailExcel); } - // 构建一个新的 Page 对象并返回 - return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + return new PageImpl<>(trainOrderDetailExcels, page.getPageable(), page.getTotalElements()); } - public Page getOrderHotelRecord(Page page) { + public Page getOrderHotelRecord(Page page) { List orderRecords = page.getContent(); - List consumptionDetailExcels = new ArrayList<>(); + List trainOrderDetailExcels = new ArrayList<>(); for (HotelOrderDetail orderRecord : orderRecords) { - ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() - .userName(orderRecord.getBookingName()) - .startDate(orderRecord.getCheckInDate()) - .orderAmount(orderRecord.getOrderAmount()) - .build(); - consumptionDetailExcels.add(consumptionDetailExcel); + HotelOrderDetailExcel hotelOrderDetailExcel = new HotelOrderDetailExcel(); + BeanUtils.copyProperties(orderRecord, hotelOrderDetailExcel); + List customers=orderRecord.getCustomers(); + String userNames = customers.stream() + .map(HotelOrderDetailCustomer::getUserName) // 获取用户名 + .collect(Collectors.joining(",")); // 用逗号分隔拼接 + hotelOrderDetailExcel.setUserName(userNames); + trainOrderDetailExcels.add(hotelOrderDetailExcel); } - // 构建一个新的 Page 对象并返回 - return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + return new PageImpl<>(trainOrderDetailExcels, page.getPageable(), page.getTotalElements()); } - public Page getOrderCarRecord(Page page) { + public Page getOrderCarRecord(Page page) { List orderRecords = page.getContent(); - List consumptionDetailExcels = new ArrayList<>(); + List trainOrderDetailExcels = new ArrayList<>(); // 遍历 OrderBaseRecord,将其转换为 ConsumptionDetailExcel for (CarOrderDetail orderRecord : orderRecords) { - ConsumptionDetailExcel consumptionDetailExcel = ConsumptionDetailExcel.builder() - .userName(orderRecord.getUserName()) - .startDate(orderRecord.getStartTime()) - .arriveDate(orderRecord.getArriveTime()) - .fromCity(orderRecord.getFromCity()) - .toCity(orderRecord.getToCity()) - .fromStationName(orderRecord.getFromStationName()) - .toStationName(orderRecord.getToStationName()) - .orderAmount(orderRecord.getOrderAmount()) - .build(); - consumptionDetailExcels.add(consumptionDetailExcel); + CarOrderDetailExcel carOrderDetailExcel = new CarOrderDetailExcel(); + BeanUtils.copyProperties(orderRecord, carOrderDetailExcel); + trainOrderDetailExcels.add(carOrderDetailExcel); } // 构建一个新的 Page 对象并返回 - return new PageImpl<>(consumptionDetailExcels, page.getPageable(), page.getTotalElements()); + return new PageImpl<>(trainOrderDetailExcels, page.getPageable(), page.getTotalElements()); } } diff --git a/src/main/java/com/chint/manage/service/ManageService.java b/src/main/java/com/chint/manage/service/ManageService.java index da9225d9..a484f99f 100644 --- a/src/main/java/com/chint/manage/service/ManageService.java +++ b/src/main/java/com/chint/manage/service/ManageService.java @@ -1,8 +1,8 @@ package com.chint.manage.service; -import com.chint.domain.aggregates.order.order_record.OrderBaseRecord; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; +import com.chint.manage.entity.excel.TrainOrderDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; import java.io.File; @@ -14,7 +14,7 @@ import java.io.File; */ public interface ManageService { - PageResult pageConsumptionDetail(ConsumptionDetailDto dto); + PageResult pageConsumptionDetail(ConsumptionDetailDto dto); File saveConsumptionDetail(ConsumptionDetailDto dto); } 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 61d3d4c8..c6237833 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -1,11 +1,13 @@ package com.chint.manage.service.impl; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; +import com.chint.manage.entity.excel.TrainOrderDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; import com.chint.manage.mapper.impl.JdbcConsumptionDetailRepositoryImpl; import com.chint.manage.service.ManageService; import com.chint.manage.util.ExcelUtil; +import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -22,7 +24,7 @@ public class ManageServiceImpl implements ManageService { private JdbcConsumptionDetailRepositoryImpl jdbcConsumptionDetailRepository; @Override - public PageResult pageConsumptionDetail(ConsumptionDetailDto dto) { + public PageResult pageConsumptionDetail(ConsumptionDetailDto dto) { return jdbcConsumptionDetailRepository.pageConsumptionDetail(dto); } diff --git a/src/main/java/com/chint/manage/util/ExcelUtil.java b/src/main/java/com/chint/manage/util/ExcelUtil.java index 90e7648b..e2b0b642 100644 --- a/src/main/java/com/chint/manage/util/ExcelUtil.java +++ b/src/main/java/com/chint/manage/util/ExcelUtil.java @@ -3,9 +3,7 @@ package com.chint.manage.util; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; -import com.chint.infrastructure.export.OrderDetailExport; -import com.chint.manage.entity.BaseExcel; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; import java.io.File; import java.util.List; diff --git a/src/test/java/com/chint/ManageTest.java b/src/test/java/com/chint/ManageTest.java index 96921bc3..86af2b33 100644 --- a/src/test/java/com/chint/ManageTest.java +++ b/src/test/java/com/chint/ManageTest.java @@ -3,7 +3,8 @@ package com.chint; import com.chint.domain.aggregates.order.OrderDetail; import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; import com.chint.infrastructure.util.PageResult; -import com.chint.manage.entity.ConsumptionDetailExcel; +import com.chint.manage.entity.excel.BaseExcel; +import com.chint.manage.entity.excel.TrainOrderDetailExcel; import com.chint.manage.entity.dto.ConsumptionDetailDto; import com.chint.manage.service.ManageService; import org.junit.jupiter.api.Test; @@ -21,8 +22,8 @@ public class ManageTest { dto.setPageNum(1); dto.setPageSize(10); dto.setProductType(0); - dto.setSupplierName("王玲峰"); - PageResult result=manageService.pageConsumptionDetail(dto); + dto.setUserName("王玲峰"); + PageResult result=manageService.pageConsumptionDetail(dto); System.out.println(result); }