Browse Source

feat(all): 修改报表导出不准确问题

master
zhaoqiaobo 10 months ago
parent
commit
149aba5ceb
  1. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryTrainReader.java
  2. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java
  3. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

6
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<T> findList(Page page, Wrapper query) {
return reportDeliverMapeer.getDeliveryTrainPage(page, query);
return reportDeliverService.getDeliveryTrainPageReader(page, query);
}
}

6
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<T> getDeliveryTrainPageReader(Page page, Wrapper query);
}

15
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<ReportDevilerVO> deliveryTrainPage = getReportDevilerVOList(page, queryWrapper);
return page.setRecords(deliveryTrainPage);
}
private @NotNull List<ReportDevilerVO> getReportDevilerVOList(IPage<ReportDevilerVO> page, Wrapper queryWrapper) {
// 查询数据
List<ReportDevilerVO> deliveryTrainPage = reportDeliverMapeer.getDeliveryTrainPage(page, queryWrapper);
// 异步组装统计数据
asyncBuildDeliveryTrainPage(deliveryTrainPage);
return page.setRecords(deliveryTrainPage);
return deliveryTrainPage;
}
private void asyncBuildDeliveryTrainPage(List<ReportDevilerVO> deliveryTrainPage) {
@ -336,4 +344,9 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
new ReportExcelUtil().export(response, stockOrderReader, StockOrderVO.class, queryWrapper, "在库订单表");
}
@Override
public List<T> getDeliveryTrainPageReader(Page page, Wrapper query) {
return this.getReportDevilerVOList(page, query);
}
}

Loading…
Cancel
Save