diff --git a/ecom-dmb-backend/sql/V20260330__permission_code_and_company_permission.sql b/ecom-dmb-backend/sql/migration/V20260330__permission_code_and_company_permission.sql similarity index 100% rename from ecom-dmb-backend/sql/V20260330__permission_code_and_company_permission.sql rename to ecom-dmb-backend/sql/migration/V20260330__permission_code_and_company_permission.sql diff --git a/ecom-dmb-backend/sql/V20260409__add_missing_permissions.sql b/ecom-dmb-backend/sql/migration/V20260409__add_missing_permissions.sql similarity index 100% rename from ecom-dmb-backend/sql/V20260409__add_missing_permissions.sql rename to ecom-dmb-backend/sql/migration/V20260409__add_missing_permissions.sql diff --git a/ecom-dmb-backend/sql/V20260422__add_ec_platform.sql b/ecom-dmb-backend/sql/migration/V20260422__add_ec_platform.sql similarity index 100% rename from ecom-dmb-backend/sql/V20260422__add_ec_platform.sql rename to ecom-dmb-backend/sql/migration/V20260422__add_ec_platform.sql diff --git a/ecom-dmb-backend/sql/V20260430__add_shop_details_menu.sql b/ecom-dmb-backend/sql/migration/V20260430__add_shop_details_menu.sql similarity index 100% rename from ecom-dmb-backend/sql/V20260430__add_shop_details_menu.sql rename to ecom-dmb-backend/sql/migration/V20260430__add_shop_details_menu.sql diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/vo/CompanyOverviewVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/vo/CompanyOverviewVO.java index 141fa9dd..f104fad7 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/vo/CompanyOverviewVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/model/vo/CompanyOverviewVO.java @@ -285,6 +285,9 @@ public class CompanyOverviewVO { @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; + @Schema(description = "总成本(商品成本+运费+其他成本)", example = "5000.00") + private BigDecimal totalCost; + @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; @@ -344,6 +347,8 @@ public class CompanyOverviewVO { @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; + @Schema(description = "总成本(商品成本+运费+其他成本)", example = "5000.00") + private BigDecimal totalCost; @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; @@ -360,11 +365,9 @@ public class CompanyOverviewVO { @Schema(description = "税前盈亏", example = "35000.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额4%税额", example = "2000.00") private BigDecimal salesTaxAmount; - @Schema(description = "税后盈亏", example = "30000.00") private BigDecimal profitAfterTax; @@ -414,6 +417,9 @@ public class CompanyOverviewVO { @Schema(description = "其他成本", example = "3200.00") private BigDecimal otherCost; + @Schema(description = "总成本(商品成本+运费+其他成本)", example = "167700.00") + private BigDecimal totalCost; + @Schema(description = "退款金额", example = "12600.00") private BigDecimal refundAmount; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CategoryExportExcelServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CategoryExportExcelServiceImpl.java index 6d76d126..debffe0e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CategoryExportExcelServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CategoryExportExcelServiceImpl.java @@ -231,6 +231,7 @@ public class CategoryExportExcelServiceImpl implements CategoryExportExcelServic data.setProductCost(productCost); data.setShippingCost(shippingCost); data.setOtherCost(otherCost); + data.setTotalCost(totalCost); data.setRefundAmount(refundAmount); data.setTotalPromotionFee(totalPromotionFee); data.setBrushFee(totalBrushFee); @@ -272,18 +273,18 @@ public class CategoryExportExcelServiceImpl implements CategoryExportExcelServic CellStyle headerStyle = createHeaderStyle(sheet.getWorkbook()); CellStyle dataStyle = createDataStyle(sheet.getWorkbook()); + String taxLabel = taxRate.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP).toPlainString() + "%税额"; + String[] headers = { + "品类名称", "销售额", "单量", "客单价", + "商品成本", "运费", "其他成本", "总成本", "退款金额", "推广费", "刷单费用", + "费比", "税前盈亏", taxLabel, "税后盈亏", "ROI" + }; + Row titleRow = sheet.createRow(0); Cell titleCell = titleRow.createCell(0); titleCell.setCellValue("品类明细 | " + dateRangeLabel); titleCell.setCellStyle(titleStyle); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 13)); - - String taxLabel = taxRate.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP).toPlainString() + "%税额"; - String[] headers = { - "品类名称", "销售额", "单量", "客单价", - "商品成本", "运费", "其他成本", "退款金额", "推广费", "刷单费用", - "费比", "税前盈亏", taxLabel, "税后盈亏", "ROI" - }; + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headers.length - 1)); Row headerRow = sheet.createRow(1); for (int i = 0; i < headers.length; i++) { @@ -302,14 +303,15 @@ public class CategoryExportExcelServiceImpl implements CategoryExportExcelServic setCell(row, 4, objToDouble(data.getProductCost()), dataStyle); setCell(row, 5, objToDouble(data.getShippingCost()), dataStyle); setCell(row, 6, objToDouble(data.getOtherCost()), dataStyle); - setCell(row, 7, objToDouble(data.getRefundAmount()), dataStyle); - setCell(row, 8, objToDouble(data.getTotalPromotionFee()), dataStyle); - setCell(row, 9, objToDouble(data.getBrushFee()), dataStyle); - setCell(row, 10, objToDouble(data.getFeeRatio()), dataStyle); - setCell(row, 11, objToDouble(data.getTotalProfitBeforeTax()), dataStyle); - setCell(row, 12, objToDouble(data.getSalesTaxAmount()), dataStyle); - setCell(row, 13, objToDouble(data.getProfitAfterTax()), dataStyle); - setCell(row, 14, objToDouble(data.getRoi()), dataStyle); + setCell(row, 7, objToDouble(data.getTotalCost()), dataStyle); + setCell(row, 8, objToDouble(data.getRefundAmount()), dataStyle); + setCell(row, 9, objToDouble(data.getTotalPromotionFee()), dataStyle); + setCell(row, 10, objToDouble(data.getBrushFee()), dataStyle); + setCell(row, 11, objToDouble(data.getFeeRatio()), dataStyle); + setCell(row, 12, objToDouble(data.getTotalProfitBeforeTax()), dataStyle); + setCell(row, 13, objToDouble(data.getSalesTaxAmount()), dataStyle); + setCell(row, 14, objToDouble(data.getProfitAfterTax()), dataStyle); + setCell(row, 15, objToDouble(data.getRoi()), dataStyle); } for (int i = 0; i < headers.length; i++) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CompanyOverviewServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CompanyOverviewServiceImpl.java index e1c23ccd..1f7716c1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CompanyOverviewServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/CompanyOverviewServiceImpl.java @@ -616,6 +616,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { comparison.setProductCost(productCost); comparison.setShippingCost(shippingCost); comparison.setOtherCost(otherCost); + comparison.setTotalCost(productCost.add(shippingCost).add(otherCost)); comparison.setRefundAmount(refundAmount); comparison.setTotalPromotionFee(totalPromotionFee); comparison.setBrushFee(brushFee); @@ -702,6 +703,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { total.setProductCost(totalProductCost); total.setShippingCost(totalShippingCost); total.setOtherCost(totalOtherCost); + total.setTotalCost(totalCost); total.setRefundAmount(totalRefund); total.setTotalPromotionFee(totalPromoFee); total.setBrushFee(totalBrushFee); @@ -991,6 +993,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { comparison.setProductCost(productCost); comparison.setShippingCost(shippingCost); comparison.setOtherCost(otherCost); + comparison.setTotalCost(totalCost); comparison.setRefundAmount(refundAmount); comparison.setTotalPromotionFee(totalPromotionFee); comparison.setBrushFee(totalBrushFee); @@ -1061,6 +1064,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { total.setProductCost(totalProductCost); total.setShippingCost(totalShippingCost); total.setOtherCost(totalOtherCost); + total.setTotalCost(totalCost); total.setRefundAmount(totalRefund); total.setTotalPromotionFee(totalPromoFee); total.setBrushFee(totalBrushFee); @@ -1279,6 +1283,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { platformSummary.setProductCost(totalProductCost); platformSummary.setShippingCost(totalShippingCost); platformSummary.setOtherCost(totalOtherCost); + platformSummary.setTotalCost(totalCost); platformSummary.setRefundAmount(totalRefundAmount); platformSummary.setTotalPromotionFee(totalPromotionFee); platformSummary.setBrushFee(totalBrushFee); @@ -1377,6 +1382,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { total.setProductCost(totalProductCost); total.setShippingCost(totalShippingCost); total.setOtherCost(totalOtherCost); + total.setTotalCost(totalCost); total.setRefundAmount(totalRefundAmount); total.setTotalPromotionFee(totalPromotionFee); total.setBrushFee(totalBrushFee); @@ -1507,6 +1513,7 @@ public class CompanyOverviewServiceImpl implements CompanyOverviewService { summary.setProductCost(totalProductCost); summary.setShippingCost(totalShippingCost); summary.setOtherCost(totalOtherCost); + summary.setTotalCost(totalCost); summary.setRefundAmount(totalRefundAmount); summary.setTotalPromotionFee(totalPromotionFee); summary.setBrushFee(totalBrushFee); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ExportServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ExportServiceImpl.java index 4f060621..3fdba226 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ExportServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ExportServiceImpl.java @@ -235,18 +235,18 @@ public class ExportServiceImpl implements ExportService { Cell titleCell = titleRow.createCell(0); titleCell.setCellValue("店铺明细 | " + dateRangeLabel); titleCell.setCellStyle(createTitleStyle(sheet.getWorkbook())); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 17)); - CellStyle headerStyle = createHeaderStyle(sheet.getWorkbook()); - CellStyle dataStyle = createDataStyle(sheet.getWorkbook()); - - // 列顺序与 Dashboard 表格一致 String taxLabel = (taxRate.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP)).toPlainString() + "%税额"; String[] headers = { "店铺名称", "目标单量", "单量达成率(%)", "目标额", "销售达成率(%)", "实际销售额", "单量", "客单价", - "商品成本", "运费", "其他成本", "退款金额", "推广费", "刷单费用", "费比", + "商品成本", "运费", "其他成本", "总成本", "退款金额", "推广费", "刷单费用", "费比", "税前盈亏", taxLabel, "ROI", "税后盈亏" }; + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headers.length - 1)); + CellStyle headerStyle = createHeaderStyle(sheet.getWorkbook()); + CellStyle dataStyle = createDataStyle(sheet.getWorkbook()); + + // 列顺序与 Dashboard 表格一致 Row headerRow = sheet.createRow(1); for (int i = 0; i < headers.length; i++) { @@ -269,14 +269,15 @@ public class ExportServiceImpl implements ExportService { setCell(row, 8, objToDouble(data.get("productCost")), dataStyle); setCell(row, 9, objToDouble(data.get("shippingCost")), dataStyle); setCell(row, 10, objToDouble(data.get("otherCost")), dataStyle); - setCell(row, 11, objToDouble(data.get("refundAmount")), dataStyle); - setCell(row, 12, objToDouble(data.get("totalPromotionFee")), dataStyle); - setCell(row, 13, objToDouble(data.get("brushFee")), dataStyle); - setCell(row, 14, objToDouble(data.get("feeRatio")), dataStyle); - setCell(row, 15, objToDouble(data.get("totalProfitBeforeTax")), dataStyle); - setCell(row, 16, objToDouble(data.get("salesTaxAmount")), dataStyle); - setCell(row, 17, objToDouble(data.get("roi")), dataStyle); - setCell(row, 18, objToDouble(data.get("profitAfterTax")), dataStyle); + setCell(row, 11, objToDouble(data.get("totalCost")), dataStyle); + setCell(row, 12, objToDouble(data.get("refundAmount")), dataStyle); + setCell(row, 13, objToDouble(data.get("totalPromotionFee")), dataStyle); + setCell(row, 14, objToDouble(data.get("brushFee")), dataStyle); + setCell(row, 15, objToDouble(data.get("feeRatio")), dataStyle); + setCell(row, 16, objToDouble(data.get("totalProfitBeforeTax")), dataStyle); + setCell(row, 17, objToDouble(data.get("salesTaxAmount")), dataStyle); + setCell(row, 18, objToDouble(data.get("roi")), dataStyle); + setCell(row, 19, objToDouble(data.get("profitAfterTax")), dataStyle); } for (int i = 0; i < headers.length; i++) { @@ -478,6 +479,7 @@ public class ExportServiceImpl implements ExportService { data.put("productCost", productCostTotal); data.put("shippingCost", shippingCost); data.put("otherCost", otherCostTotal); + data.put("totalCost", totalCost); data.put("totalProfitBeforeTax", profitBeforeTax); // 对齐 ShopComparison data.put("salesTaxAmount", tax); // 对齐 ShopComparison data.put("profitAfterTax", profitAfterTax); @@ -768,6 +770,7 @@ public class ExportServiceImpl implements ExportService { data.put("productCost", totalProductCost); data.put("shippingCost", totalShippingCost); data.put("otherCost", totalOtherCost); + data.put("totalCost", totalCost); data.put("refundAmount", totalRefundAmount); data.put("totalPromotionFee", totalPromotionFee); data.put("brushFee", totalBrushFee); @@ -807,15 +810,14 @@ public class ExportServiceImpl implements ExportService { Cell titleCell = titleRow.createCell(0); titleCell.setCellValue("平台维度汇总 | " + dateRangeLabel); titleCell.setCellStyle(titleStyle); - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 17)); - String taxLabel = taxRate.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP).toPlainString() + "%税额"; String[] headers = { "平台名称", "目标单量", "单量达成率(%)", "目标额", "销售达成率(%)", "实际销售额", "单量", "客单价", - "商品成本", "运费", "其他成本", "退款金额", "推广费", "刷单费用", "费比", + "商品成本", "运费", "其他成本", "总成本", "退款金额", "推广费", "刷单费用", "费比", "税前盈亏", taxLabel, "ROI", "税后盈亏" }; + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headers.length - 1)); Row headerRow = sheet.createRow(1); for (int i = 0; i < headers.length; i++) { @@ -838,14 +840,15 @@ public class ExportServiceImpl implements ExportService { setCell(row, 8, objToDouble(data.get("productCost")), dataStyle); setCell(row, 9, objToDouble(data.get("shippingCost")), dataStyle); setCell(row, 10, objToDouble(data.get("otherCost")), dataStyle); - setCell(row, 11, objToDouble(data.get("refundAmount")), dataStyle); - setCell(row, 12, objToDouble(data.get("totalPromotionFee")), dataStyle); - setCell(row, 13, objToDouble(data.get("brushFee")), dataStyle); - setCell(row, 14, objToPct(data.get("feeRatio")), dataStyle); - setCell(row, 15, objToDouble(data.get("totalProfitBeforeTax")), dataStyle); - setCell(row, 16, objToDouble(data.get("salesTaxAmount")), dataStyle); - setCell(row, 17, objToDouble(data.get("roi")), dataStyle); - setCell(row, 18, objToDouble(data.get("profitAfterTax")), dataStyle); + setCell(row, 11, objToDouble(data.get("totalCost")), dataStyle); + setCell(row, 12, objToDouble(data.get("refundAmount")), dataStyle); + setCell(row, 13, objToDouble(data.get("totalPromotionFee")), dataStyle); + setCell(row, 14, objToDouble(data.get("brushFee")), dataStyle); + setCell(row, 15, objToPct(data.get("feeRatio")), dataStyle); + setCell(row, 16, objToDouble(data.get("totalProfitBeforeTax")), dataStyle); + setCell(row, 17, objToDouble(data.get("salesTaxAmount")), dataStyle); + setCell(row, 18, objToDouble(data.get("roi")), dataStyle); + setCell(row, 19, objToDouble(data.get("profitAfterTax")), dataStyle); } for (int i = 0; i < headers.length; i++) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ShopOverviewStatisticsServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ShopOverviewStatisticsServiceImpl.java index 74dccddb..446f936d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ShopOverviewStatisticsServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/overview/service/impl/ShopOverviewStatisticsServiceImpl.java @@ -563,7 +563,7 @@ public class ShopOverviewStatisticsServiceImpl implements ShopOverviewStatistics : BigDecimal.ZERO; BigDecimal totalCost = totalProductCost.add(totalShippingCost).add(totalOtherCost); BigDecimal profitBeforeTax = totalSales.subtract(totalCost).subtract(totalRefund); - BigDecimal salesTax = totalSales.multiply(new BigDecimal("0.04")); + BigDecimal salesTax = totalSales.multiply(taxRate); BigDecimal profitAfterTax = profitBeforeTax.subtract(salesTax); BigDecimal roi = totalPromoFee.compareTo(BigDecimal.ZERO) > 0 ? totalSales.subtract(totalRefund).divide(totalPromoFee, 4, RoundingMode.HALF_UP) @@ -894,7 +894,7 @@ public class ShopOverviewStatisticsServiceImpl implements ShopOverviewStatistics : BigDecimal.ZERO; BigDecimal totalCost = totalProductCost.add(totalShippingCost).add(totalOtherCost); BigDecimal profitBeforeTax = totalSales.subtract(totalCost).subtract(totalRefund); - BigDecimal salesTax = totalSales.multiply(new BigDecimal("0.04")); + BigDecimal salesTax = totalSales.multiply(taxRate); BigDecimal profitAfterTax = profitBeforeTax.subtract(salesTax); BigDecimal roi = totalPromoFee.compareTo(BigDecimal.ZERO) > 0 ? totalSales.subtract(totalRefund).divide(totalPromoFee, 4, RoundingMode.HALF_UP) diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java index f0d0c3b9..ec8ec7ba 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java @@ -83,6 +83,8 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { ? queryDTO.getTaxRate() : new BigDecimal("0.04"); + List autoStatisticsStatusIds = getAutoStatisticsStatusIds(companyId); + // 查询订单数据 LambdaQueryWrapper orderWrapper = new LambdaQueryWrapper<>(); orderWrapper.eq(OrderPO::getCompanyId, companyId) @@ -90,6 +92,11 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { queryDTO.getProductId()) .ge(OrderPO::getOrderTime, startDateTime) .le(OrderPO::getOrderTime, endDateTime); + if (!autoStatisticsStatusIds.isEmpty()) { + orderWrapper.in(OrderPO::getStatusId, autoStatisticsStatusIds); + } else { + orderWrapper.isNull(OrderPO::getId); + } List orders = orderMapper.selectList(orderWrapper); // 收集店铺ID列表 @@ -126,6 +133,11 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { queryDTO.getProductId()) .ge(OrderPO::getOrderTime, lastStartTime) .le(OrderPO::getOrderTime, lastEndTime); + if (!autoStatisticsStatusIds.isEmpty()) { + lastPeriodWrapper.in(OrderPO::getStatusId, autoStatisticsStatusIds); + } else { + lastPeriodWrapper.isNull(OrderPO::getId); + } List lastPeriodOrders = orderMapper.selectList(lastPeriodWrapper); // ========== 构建返回对象 ========== @@ -602,6 +614,19 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { return summary; } + /** + * 获取参与统计的订单状态ID列表 + */ + private List getAutoStatisticsStatusIds(Long companyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(OrderStatusPO::getCompanyId, companyId) + .eq(OrderStatusPO::getAutoStatistics, 1) + .select(OrderStatusPO::getId); + return orderStatusMapper.selectList(wrapper).stream() + .map(OrderStatusPO::getId) + .collect(Collectors.toList()); + } + /** * 获取退款状态ID集合 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/store-overview/types/types.vo.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/store-overview/types/types.vo.ts index c3bbfa94..600c974b 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/store-overview/types/types.vo.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/store-overview/types/types.vo.ts @@ -117,6 +117,8 @@ export namespace CompanyOverviewVO { shippingCost?: number; /** 其他成本 */ otherCost?: number; + /** 总成本(商品成本+运费+其他成本) */ + totalCost?: number; /** 退款金额 */ refundAmount?: number; /** 推广费 */ @@ -153,6 +155,8 @@ export namespace CompanyOverviewVO { shippingCost?: number; /** 其他成本 */ otherCost?: number; + /** 总成本(商品成本+运费+其他成本) */ + totalCost?: number; /** 退款金额 */ refundAmount?: number; /** 推广费 */ @@ -197,6 +201,8 @@ export namespace CompanyOverviewVO { shippingCost?: number; /** 其他成本 */ otherCost?: number; + /** 总成本(商品成本+运费+其他成本) */ + totalCost?: number; /** 退款金额 */ refundAmount?: number; /** 推广费 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue index f7749633..a3cd3b80 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/CategoryComparisonTable.vue @@ -131,7 +131,7 @@ const formatPercentPlain = (value: number | undefined) => { 经营规模维度 成本费用维度 @@ -152,6 +152,7 @@ const formatPercentPlain = (value: number | undefined) => { 商品成本 运费 其他成本 + 总成本 退款金额 @@ -214,6 +215,9 @@ const formatPercentPlain = (value: number | undefined) => { {{ cat.productCost ? formatAmount(cat.productCost) : '-' }} {{ cat.shippingCost ? formatAmount(cat.shippingCost) : '-' }} {{ cat.otherCost ? formatAmount(cat.otherCost) : '-' }} + + {{ cat.totalCost != null ? formatAmount(cat.totalCost) : '-' }} + {{ cat.refundAmount ? formatAmount(cat.refundAmount) : '-' }} @@ -238,7 +242,7 @@ const formatPercentPlain = (value: number | undefined) => { - + 暂无数据 @@ -255,6 +259,7 @@ const formatPercentPlain = (value: number | undefined) => { {{ categoryComparisons?.total?.productCost ? formatAmount(categoryComparisons?.total?.productCost) : '-' }} {{ categoryComparisons?.total?.shippingCost ? formatAmount(categoryComparisons?.total?.shippingCost) : '-' }} {{ categoryComparisons?.total?.otherCost ? formatAmount(categoryComparisons?.total?.otherCost) : '-' }} + {{ categoryComparisons?.total?.totalCost != null ? formatAmount(categoryComparisons?.total?.totalCost) : '-' }} {{ categoryComparisons?.total?.refundAmount ? formatAmount(categoryComparisons?.total?.refundAmount) : '-' }} {{ categoryComparisons?.total?.totalPromotionFee ? formatAmount(categoryComparisons?.total?.totalPromotionFee) : '-' }} {{ categoryComparisons?.total?.brushFee ? formatAmount(categoryComparisons?.total?.brushFee) : '-' }} diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/PlatformSummaryCard.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/PlatformSummaryCard.vue index d3bb5a3b..e69287d9 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/PlatformSummaryCard.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/PlatformSummaryCard.vue @@ -58,6 +58,7 @@ const platformData = computed(() => { productCost: p.productCost ?? 0, shippingCost: p.shippingCost ?? 0, otherCost: p.otherCost ?? 0, + totalCost: p.totalCost ?? 0, refundAmount: p.refundAmount ?? 0, totalPromotionFee: p.totalPromotionFee ?? 0, brushFee: p.brushFee ?? 0, @@ -191,7 +192,7 @@ const sortedData = computed(() => { 成本费用维度 @@ -218,6 +219,7 @@ const sortedData = computed(() => { 商品成本 运费 其他成本 + 总成本 退款金额 推广费 刷单费用 @@ -275,6 +277,7 @@ const sortedData = computed(() => { {{ formatAmount(p.productCost) }} {{ formatAmount(p.shippingCost) }} {{ formatAmount(p.otherCost) }} + {{ formatAmount(p.totalCost) }} {{ formatAmount(p.refundAmount) }} {{ formatAmount(p.totalPromotionFee) }} {{ formatAmount(p.brushFee) }} @@ -310,6 +313,7 @@ const sortedData = computed(() => { {{ totalData.productCost ? formatAmount(totalData.productCost) : '-' }} {{ totalData.shippingCost ? formatAmount(totalData.shippingCost) : '-' }} {{ totalData.otherCost ? formatAmount(totalData.otherCost) : '-' }} + {{ totalData.totalCost != null ? formatAmount(totalData.totalCost) : '-' }} {{ totalData.refundAmount ? formatAmount(totalData.refundAmount) : '-' }} {{ totalData.totalPromotionFee ? formatAmount(totalData.totalPromotionFee) : '-' }} {{ totalData.brushFee ? formatAmount(totalData.brushFee) : '-' }} @@ -335,7 +339,7 @@ const sortedData = computed(() => { - 暂无数据 + 暂无数据 diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue index cb56e341..4bd558ce 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/components/ShopComparisonTable.vue @@ -142,7 +142,7 @@ const formatPercentPlain = (value: number | undefined) => { 经营规模维度 成本费用维度 @@ -170,6 +170,7 @@ const formatPercentPlain = (value: number | undefined) => { 商品成本 运费 其他成本 + 总成本 退款金额 @@ -280,6 +281,11 @@ const formatPercentPlain = (value: number | undefined) => { shop.otherCost ? formatAmount(shop.otherCost) : '-' }} + + {{ + shop.totalCost != null ? formatAmount(shop.totalCost) : '-' + }} + {{ shop.refundAmount ? formatAmount(shop.refundAmount) : '-' @@ -329,7 +335,7 @@ const formatPercentPlain = (value: number | undefined) => { - + 暂无数据 @@ -351,6 +357,7 @@ const formatPercentPlain = (value: number | undefined) => { {{ shopComparisons?.total?.productCost ? formatAmount(shopComparisons?.total?.productCost) : '-' }} {{ shopComparisons?.total?.shippingCost ? formatAmount(shopComparisons?.total?.shippingCost) : '-' }} {{ shopComparisons?.total?.otherCost ? formatAmount(shopComparisons?.total?.otherCost) : '-' }} + {{ shopComparisons?.total?.totalCost != null ? formatAmount(shopComparisons?.total?.totalCost) : '-' }} {{ shopComparisons?.total?.refundAmount ? formatAmount(shopComparisons?.total?.refundAmount) : '-' }} {{ shopComparisons?.total?.totalPromotionFee ? formatAmount(shopComparisons?.total?.totalPromotionFee) : '-' }} {{ shopComparisons?.total?.brushFee ? formatAmount(shopComparisons?.total?.brushFee) : '-' }}