|
|
|
@ -52,7 +52,7 @@ public class AsyncServiceImpl implements IAsyncService {
|
|
|
|
|
|
|
|
|
|
}, asyncExecutor); |
|
|
|
|
future.thenAccept(list -> { |
|
|
|
|
if(CollUtil.isNotEmpty(list)){ |
|
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
|
// 获取组装的数据列表
|
|
|
|
|
List<Object> detailVo = pageMap.get(finalI); |
|
|
|
|
// 将查询数据添加到本地缓存
|
|
|
|
@ -92,11 +92,11 @@ public class AsyncServiceImpl implements IAsyncService {
|
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Override |
|
|
|
|
// @LogpmAsync("asyncExecutor")
|
|
|
|
|
public List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(List<Long> idBatch) { |
|
|
|
|
return reportDeliverMapeer.getDeliveryTrainLoadSacnInvnByIds(idBatch); |
|
|
|
|
} |
|
|
|
|
public List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(List<Long> idBatch) { |
|
|
|
|
return reportDeliverMapeer.getDeliveryTrainLoadSacnInvnByIds(idBatch); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
// @LogpmAsync("asyncExecutor")
|
|
|
|
@ -105,8 +105,8 @@ public class AsyncServiceImpl implements IAsyncService {
|
|
|
|
|
return reportDeliverMapeer.getDeliveryTrainLoadSacnByIds(idBatch); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<ReportDetailVO> getdetailPages(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size) { |
|
|
|
|
@Override |
|
|
|
|
public List<ReportDetailVO> getdetailPages(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size) { |
|
|
|
|
List<ReportDetailVO> detailsPage = reportDeliverMapeer.getDetailsPage(page, queryWrapper); |
|
|
|
|
// 包件总数
|
|
|
|
|
long total = page.getTotal(); |
|
|
|
@ -123,7 +123,7 @@ public class AsyncServiceImpl implements IAsyncService {
|
|
|
|
|
int zeroSize = zeroTotal % size; |
|
|
|
|
long limitA = 0; |
|
|
|
|
long limitB = 0; |
|
|
|
|
if(zeroSize == 0){ |
|
|
|
|
if (zeroSize == 0) { |
|
|
|
|
zeroSize = size; |
|
|
|
|
} |
|
|
|
|
if (!NumberUtil.equals(zeroCurrent, 1)) { |
|
|
|
@ -132,12 +132,50 @@ public class AsyncServiceImpl implements IAsyncService {
|
|
|
|
|
} |
|
|
|
|
limitB = zeroSize; |
|
|
|
|
List<ReportDetailVO> zeroPage = reportDeliverMapeer.getDetailsZeroPage(limitA, limitB, queryWrapper); |
|
|
|
|
if(CollUtil.isEmpty(detailsPage)){ |
|
|
|
|
if (CollUtil.isEmpty(detailsPage)) { |
|
|
|
|
detailsPage = new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
detailsPage.addAll(zeroPage); |
|
|
|
|
} |
|
|
|
|
page.setTotal(allTotal); |
|
|
|
|
return detailsPage; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<ReportDetailVO> getdetailPagesExport(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size) { |
|
|
|
|
List<ReportDetailVO> detailsPage = reportDeliverMapeer.getDetailsPageExport(queryWrapper, (current - 1) * size, size); |
|
|
|
|
// 包件总数
|
|
|
|
|
long total = detailsPage.size(); |
|
|
|
|
// 零件总数
|
|
|
|
|
Long detailsZeroPageCount = reportDeliverMapeer.getDetailsZeroPageCount(queryWrapper); |
|
|
|
|
long allTotal = total + detailsZeroPageCount; |
|
|
|
|
// 包件没数据查零担
|
|
|
|
|
int pageSize = current * size; |
|
|
|
|
if (total < pageSize) { |
|
|
|
|
// 剩余需要查询的数量
|
|
|
|
|
int zeroTotal = Convert.toInt(pageSize - total); |
|
|
|
|
double div = NumberUtil.div(zeroTotal, size.doubleValue()); |
|
|
|
|
long zeroCurrent = (int) Math.ceil(div); |
|
|
|
|
int zeroSize = zeroTotal % size; |
|
|
|
|
long limitA = 0; |
|
|
|
|
long limitB = 0; |
|
|
|
|
if (zeroSize == 0) { |
|
|
|
|
zeroSize = size; |
|
|
|
|
} |
|
|
|
|
if (!NumberUtil.equals(zeroCurrent, 1)) { |
|
|
|
|
limitA = zeroSize + (zeroCurrent - 2) * size; |
|
|
|
|
zeroSize = size; |
|
|
|
|
} |
|
|
|
|
limitB = zeroSize; |
|
|
|
|
List<ReportDetailVO> zeroPage = reportDeliverMapeer.getDetailsZeroPage(limitA, limitB, queryWrapper); |
|
|
|
|
if (CollUtil.isEmpty(detailsPage)) { |
|
|
|
|
detailsPage = new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
detailsPage.addAll(zeroPage); |
|
|
|
|
} |
|
|
|
|
page.setTotal(allTotal); |
|
|
|
|
return detailsPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|