|
|
|
@ -19,6 +19,7 @@ import com.logpm.report.reader.DeliveryCustomerReader;
|
|
|
|
|
import com.logpm.report.reader.DeliveryDetailReader; |
|
|
|
|
import com.logpm.report.reader.DeliveryTrainReader; |
|
|
|
|
import com.logpm.report.reader.StockOrderReader; |
|
|
|
|
import com.logpm.report.service.IAsyncService; |
|
|
|
|
import com.logpm.report.service.ReportDataService; |
|
|
|
|
import com.logpm.report.service.ReportDeliverService; |
|
|
|
|
import com.logpm.report.util.QueryUtil; |
|
|
|
@ -57,6 +58,7 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
|
|
|
|
|
private final IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
private final ReportDataService reportDataService; |
|
|
|
|
private final ReportExcelUtil reportExcelUtil; |
|
|
|
|
private final IAsyncService anAsyncService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<ReportDevilerVO> deliveryTrainPage(ReportDevilerVO vo, ReportDevilerQuery query) { |
|
|
|
@ -168,6 +170,11 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
|
|
|
|
|
detailsCustomQuery(query, queryWrapper); |
|
|
|
|
// 仓库权限
|
|
|
|
|
ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient); |
|
|
|
|
List<ReportDetailVO> detailsPage = anAsyncService.getdetailPages(page, queryWrapper, current, size); |
|
|
|
|
return page.setRecords(detailsPage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<ReportDetailVO> getdetailPages(IPage<ReportDetailVO> page, QueryWrapper<ReportDetailVO> queryWrapper, Integer current, Integer size) { |
|
|
|
|
List<ReportDetailVO> detailsPage = reportDeliverMapeer.getDetailsPage(page, queryWrapper); |
|
|
|
|
// 包件总数
|
|
|
|
|
long total = page.getTotal(); |
|
|
|
@ -182,8 +189,6 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
|
|
|
|
|
double div = NumberUtil.div(zeroTotal, size.doubleValue()); |
|
|
|
|
long zeroCurrent = (int) Math.ceil(div); |
|
|
|
|
int zeroSize = zeroTotal % size; |
|
|
|
|
IPage<ReportDetailVO> page1 = Condition.getPage(query); |
|
|
|
|
page1.setCurrent(zeroCurrent); |
|
|
|
|
long limitA = 0; |
|
|
|
|
long limitB = 0; |
|
|
|
|
if(zeroSize == 0){ |
|
|
|
@ -194,7 +199,6 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
|
|
|
|
|
zeroSize = size; |
|
|
|
|
} |
|
|
|
|
limitB = zeroSize; |
|
|
|
|
page1.setSize(zeroSize); |
|
|
|
|
List<ReportDetailVO> zeroPage = reportDeliverMapeer.getDetailsZeroPage(limitA, limitB, queryWrapper); |
|
|
|
|
if(CollUtil.isEmpty(detailsPage)){ |
|
|
|
|
detailsPage = new ArrayList<>(); |
|
|
|
@ -202,7 +206,7 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
|
|
|
|
|
detailsPage.addAll(zeroPage); |
|
|
|
|
} |
|
|
|
|
page.setTotal(allTotal); |
|
|
|
|
return page.setRecords(detailsPage); |
|
|
|
|
return detailsPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void detailsCustomQuery(DevilerDetailsQuery query, QueryWrapper<ReportDetailVO> queryWrapper) { |
|
|
|
|