From 149aba5ceb7e851854e24e027ccf05f6c3bfdfb8 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Fri, 21 Jun 2024 13:57:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=87=BA=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/report/reader/DeliveryTrainReader.java | 6 +++++- .../report/service/ReportDeliverService.java | 6 ++++++ .../service/impl/ReportDeliverServiceImpl.java | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryTrainReader.java b/blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryTrainReader.java index ce2ce25bc..19c422b18 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryTrainReader.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryTrainReader.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.report.mapper.ReportDeliverMapeer; import com.logpm.report.service.ExportReader; +import com.logpm.report.service.ReportDeliverService; import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Component; @@ -20,6 +21,9 @@ public class DeliveryTrainReader implements ExportReader { @Resource private ReportDeliverMapeer reportDeliverMapeer; + @Resource + private ReportDeliverService reportDeliverService; + @Override public Long getCount(Wrapper query) { Page page = new Page(1, 1); @@ -29,7 +33,7 @@ public class DeliveryTrainReader implements ExportReader { @Override public List findList(Page page, Wrapper query) { - return reportDeliverMapeer.getDeliveryTrainPage(page, query); + return reportDeliverService.getDeliveryTrainPageReader(page, query); } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java index 2080c8bc6..ee83b2954 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java @@ -1,6 +1,8 @@ package com.logpm.report.service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.report.query.DevilerDetailsQuery; import com.logpm.report.query.ReportCustomerQuery; import com.logpm.report.query.ReportDevilerQuery; @@ -9,8 +11,10 @@ import com.logpm.report.vo.ReportCustomerVO; import com.logpm.report.vo.ReportDetailVO; import com.logpm.report.vo.ReportDevilerVO; import com.logpm.report.vo.StockOrderVO; +import org.apache.poi.ss.formula.functions.T; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * @author zhaoqiaobo @@ -87,4 +91,6 @@ public interface ReportDeliverService { * @param query */ void exportStockOrder(HttpServletResponse response, StockOrderVO vo, StockOrderQuery query); + + List getDeliveryTrainPageReader(Page page, Wrapper query); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java index 7f73b9eef..f3ff449b1 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java @@ -4,8 +4,10 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.report.dto.DeliveryTrainLoadedScanDTO; import com.logpm.report.mapper.ReportDeliverMapeer; @@ -26,6 +28,7 @@ import com.logpm.report.vo.ReportDetailVO; import com.logpm.report.vo.ReportDevilerVO; import com.logpm.report.vo.StockOrderVO; import lombok.AllArgsConstructor; +import org.apache.poi.ss.formula.functions.T; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -70,11 +73,16 @@ public class ReportDeliverServiceImpl implements ReportDeliverService { // 2 用户页面没有选择仓库,但是切换了仓库,按切换的仓库查 // 3 用户没有选择仓库,也没有切换仓库,按用户当前所有仓查询 ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient); + List deliveryTrainPage = getReportDevilerVOList(page, queryWrapper); + return page.setRecords(deliveryTrainPage); + } + + private @NotNull List getReportDevilerVOList(IPage page, Wrapper queryWrapper) { // 查询数据 List deliveryTrainPage = reportDeliverMapeer.getDeliveryTrainPage(page, queryWrapper); // 异步组装统计数据 asyncBuildDeliveryTrainPage(deliveryTrainPage); - return page.setRecords(deliveryTrainPage); + return deliveryTrainPage; } private void asyncBuildDeliveryTrainPage(List deliveryTrainPage) { @@ -336,4 +344,9 @@ public class ReportDeliverServiceImpl implements ReportDeliverService { new ReportExcelUtil().export(response, stockOrderReader, StockOrderVO.class, queryWrapper, "在库订单表"); } + @Override + public List getDeliveryTrainPageReader(Page page, Wrapper query) { + return this.getReportDevilerVOList(page, query); + } + }