Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fix-sign
汤建军 5 months ago
parent
commit
52463cfcd9
  1. 46
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

46
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

@ -2,6 +2,8 @@ package com.logpm.report.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@ -456,15 +458,57 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
public void exportDetailsV3(HttpServletResponse response, DevilerDetailsQuery query) {
IPage<ReportDetailVO> page = Condition.getPage(query);
page.setPages(1);
page.setSize(100000);
page.setSize(-1);
Integer more = 1;
if (StrUtil.isEmpty(query.getWarehouseNameRange())) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtil.isNotEmpty(myCurrentWarehouse)) {
query.setWarehouseNameRange(myCurrentWarehouse.getName());
} else {
more = 2;
List<BasicdataWarehouseEntity> warehouseEntities = warehouseClient.getMyWarehouseList();
query.setWarehouseNameRange(warehouseEntities.stream().map(BasicdataWarehouseEntity::getName).collect(Collectors.joining(",")));
}
} else {
String warehouseNameRange = query.getWarehouseNameRange();
if (StrUtil.contains(warehouseNameRange, ",")) {
more = 2;
}
}
if (more == 1) {
// 单仓,最多导出1个月的数据
if (StrUtil.isNotEmpty(query.getTrainNumber()) || StrUtil.isNotEmpty(query.getOrderPackageCode()) || StrUtil.isNotEmpty(query.getReservationCode()) || StrUtil.isNotEmpty(query.getStockArticleId())) {
}else{
if (ObjectUtil.isNotEmpty(query.getStartTaskTime()) || ObjectUtil.isNotEmpty(query.getEndTaskTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartTaskTime(), query.getEndTaskTime(), DateUnit.DAY) <= 30;
if (!withinOneMonth) {
throw new ServiceException("配送日期必选且时间不超过一个月");
}
}
if (ObjectUtil.isNotEmpty(query.getStartSjsigningTime()) || ObjectUtil.isNotEmpty(query.getEndSjsigningTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartSjsigningTime(), query.getEndSjsigningTime(), DateUnit.DAY) <= 30;
if (!withinOneMonth) {
throw new ServiceException("签收日期必选且时间不超过一个月");
}
}
}
} else {
// 多仓,最多导出1个星期的数据
if (StrUtil.isNotEmpty(query.getTrainNumber()) || StrUtil.isNotEmpty(query.getOrderPackageCode()) || StrUtil.isNotEmpty(query.getReservationCode()) || StrUtil.isNotEmpty(query.getStockArticleId())) {
}else{
if (ObjectUtil.isNotEmpty(query.getStartTaskTime()) || ObjectUtil.isNotEmpty(query.getEndTaskTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartTaskTime(), query.getEndTaskTime(), DateUnit.DAY) <= 7;
if (!withinOneMonth) {
throw new ServiceException("配送日期必选且时间不超过7天");
}
}
if (ObjectUtil.isNotEmpty(query.getStartSjsigningTime()) || ObjectUtil.isNotEmpty(query.getEndSjsigningTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartSjsigningTime(), query.getEndSjsigningTime(), DateUnit.DAY) <= 7;
if (!withinOneMonth) {
throw new ServiceException("签收日期必选且时间不超过7天 ");
}
}
}
}
List<ReportDetailVO> detailsPage = reportDeliverMapeer.getDetailsPageV3(page, query);
ReportExcelUtil.setExportHeader(response, "配送明细报表");

Loading…
Cancel
Save