⚡ 毛利分析分页复用汇总订单数并禁用重复统计
This commit is contained in:
+3
@@ -8,6 +8,7 @@ import java.nio.file.Paths;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -105,6 +106,8 @@ public class PrcProfitReportController extends BaseController
|
||||
public TableDataInfo orders(PrcProfitReportQuery query)
|
||||
{
|
||||
startPage();
|
||||
// 分页总数由页面复用汇总订单数,订单明细仅执行分页查询。
|
||||
PageHelper.getLocalPage().setCount(false);
|
||||
List<PrcProfitReportOrderRow> rows = profitReportService.selectOrderRows(query);
|
||||
return getDataTable(rows);
|
||||
}
|
||||
|
||||
@@ -277,7 +277,8 @@ const hasSearched = ref(false)
|
||||
const exporting = ref(false)
|
||||
const pageNum = ref(1)
|
||||
const pageSize = ref(10)
|
||||
const total = ref(0)
|
||||
// 汇总按币种分组,分页总数复用各币种订单数之和。
|
||||
const total = computed(() => summaryList.value.reduce((count, summary) => count + Number(summary.orderCount || 0), 0))
|
||||
/* 提成表单状态与初始化暂停使用,保留代码便于恢复。
|
||||
const commissionDialogVisible = ref(false)
|
||||
const commissionLoading = ref(false)
|
||||
@@ -377,7 +378,6 @@ function loadRows() {
|
||||
return listProfitOrders(buildQuery()).then(res => {
|
||||
if (requestVersion !== rowsRequestVersion) return
|
||||
rows.value = res.rows || []
|
||||
total.value = res.total || 0
|
||||
}).finally(() => {
|
||||
if (requestVersion === rowsRequestVersion) loading.value = false
|
||||
})
|
||||
@@ -390,7 +390,6 @@ function clearReportResults() {
|
||||
summaryList.value = []
|
||||
summaryLoaded.value = false
|
||||
rows.value = []
|
||||
total.value = 0
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user