Browse Source

2026-02-09

导出优化
master
fengyuan_yang 3 weeks ago
parent
commit
b5a92bb948
  1. 9
      src/main/java/com/gaotao/modules/report/service/impl/InboundNotificationReportServiceImpl.java
  2. 9
      src/main/java/com/gaotao/modules/report/service/impl/OutboundNotificationReportServiceImpl.java
  3. 12
      src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java
  4. 4
      src/main/resources/mapper/report/InboundNotificationReportMapper.xml
  5. 4
      src/main/resources/mapper/report/OutboundNotificationReportMapper.xml

9
src/main/java/com/gaotao/modules/report/service/impl/InboundNotificationReportServiceImpl.java

@ -27,6 +27,12 @@ public class InboundNotificationReportServiceImpl implements InboundNotification
int limit = query.getLimit() != null ? query.getLimit() : 50;
int offset = (page - 1) * limit;
// 当limit < 0时-1表示导出全部数据不分页
if (limit < 0) {
offset = 0;
limit = -1;
}
// 查询数据
List<InboundNotificationReportData> list = inboundNotificationReportMapper.searchInboundNotificationReport(
query, userName, offset, limit);
@ -35,7 +41,8 @@ public class InboundNotificationReportServiceImpl implements InboundNotification
int total = inboundNotificationReportMapper.countInboundNotificationReport(query, userName);
// 构建分页结果
return new PageUtils(list, total, limit, page);
int pageLimit = limit > 0 ? limit : total;
return new PageUtils(list, total, pageLimit, page);
}
@Override

9
src/main/java/com/gaotao/modules/report/service/impl/OutboundNotificationReportServiceImpl.java

@ -27,6 +27,12 @@ public class OutboundNotificationReportServiceImpl implements OutboundNotificati
int limit = query.getLimit() != null ? query.getLimit() : 50;
int offset = (page - 1) * limit;
// 当limit < 0时-1表示导出全部数据不分页
if (limit < 0) {
offset = 0;
limit = -1;
}
// 查询数据
List<OutboundNotificationReportData> list = outboundNotificationReportMapper.searchOutboundNotificationReport(
query, userName, offset, limit);
@ -35,7 +41,8 @@ public class OutboundNotificationReportServiceImpl implements OutboundNotificati
int total = outboundNotificationReportMapper.countOutboundNotificationReport(query, userName);
// 构建分页结果
return new PageUtils(list, total, limit, page);
int pageLimit = limit > 0 ? limit : total;
return new PageUtils(list, total, pageLimit, page);
}
@Override

12
src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java

@ -52,8 +52,16 @@ public class PartTemplateStatusServiceImpl implements PartTemplateStatusService
params.add(query.getDepartment() != null ? query.getDepartment() : "");
// 分页参数
int page = query.getPage() > 0 ? query.getPage() : 1;
int limit = query.getLimit() > 0 ? query.getLimit() : 20;
int offset = (page - 1) * limit;
int offset;
int limit;
// 当limit < 0时-1表示导出全部数据不分页
if (query.getLimit() < 0) {
offset = 0;
limit = 999999;
} else {
limit = query.getLimit();
offset = (page - 1) * limit;
}
params.add(offset);
params.add(limit);

4
src/main/resources/mapper/report/InboundNotificationReportMapper.xml

@ -107,7 +107,9 @@
</if>
</where>
ORDER BY h.created_date DESC, h.order_no, d.part_no
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
<if test="limit &gt; 0">
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
</if>
</select>
<!-- 查询收货入库任务报表数据总数 -->

4
src/main/resources/mapper/report/OutboundNotificationReportMapper.xml

@ -114,7 +114,9 @@
</if>
</where>
ORDER BY h.created_date DESC, h.order_no, d.part_no
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
<if test="limit &gt; 0">
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
</if>
</select>
<!-- 查询拣货出库任务报表数据总数 -->

Loading…
Cancel
Save