From c8ef763cbd482b56c7499b4c6d71aaa9514d5386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Wed, 20 Nov 2024 16:20:32 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E6=94=B9=E5=9B=BD=E7=A8=8E?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=AF=B9=E8=B1=A1=E7=89=A9=E6=96=99=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E6=95=B0=E9=87=8F=E5=90=88=E8=AE=A1=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BAint=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AF=B9=E8=B1=A1=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=92=8C=E6=95=B0=E9=87=8F=E5=90=88=E8=AE=A1=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=B8=BAint=EF=BC=9B=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?service=E4=B8=AD=E5=90=88=E8=AE=A1=E5=AD=97=E6=AE=B5=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=AF=AD=E5=8F=A5=E7=B1=BB=E5=9E=8B=E4=B8=BAint?= =?UTF-8?q?=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E5=8D=95servic?= =?UTF-8?q?e=E4=B8=AD=E5=90=88=E8=AE=A1=E5=AD=97=E6=AE=B5=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=AF=AD=E5=8F=A5=E7=B1=BB=E5=9E=8B=E4=B8=BAint?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial/domain/FinancialTaxInvoice.java | 12 ++++++------ .../com/ruoyi/system/domain/SysSalesOrder.java | 12 ++++++------ .../impl/SysSalesShippingInformServiceImpl.java | 16 ++++++++-------- .../impl/WarehouseOutOrderServiceImpl.java | 14 +++++++------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java index c534355a..a76ac3da 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java @@ -101,11 +101,11 @@ public class FinancialTaxInvoice extends BaseEntity /** 物料数合计 */ @Excel(name = "物料数合计") - private Long materialSum; + private int materialSum; /** 数量合计 */ @Excel(name = "数量合计") - private Long enterpriseSum; + private int enterpriseSum; /** 不含税总价(RMB) */ @Excel(name = "不含税总价(RMB)") @@ -399,19 +399,19 @@ public class FinancialTaxInvoice extends BaseEntity } - public Long getMaterialSum() { + public int getMaterialSum() { return materialSum; } - public void setMaterialSum(Long materialSum) { + public void setMaterialSum(int materialSum) { this.materialSum = materialSum; } - public Long getEnterpriseSum() { + public int getEnterpriseSum() { return enterpriseSum; } - public void setEnterpriseSum(Long enterpriseSum) { + public void setEnterpriseSum(int enterpriseSum) { this.enterpriseSum = enterpriseSum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java index 03043a8b..bf9512ac 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java @@ -74,10 +74,10 @@ public class SysSalesOrder extends BaseEntity { private String customerPhone; /*物料合计*/ @Excel(name = "物料合计") - private Long materialSum; + private int materialSum; /*数量合计*/ @Excel(name = "数量合计") - private Long enterpriseSum; + private int enterpriseSum; /*不含税单价(RMB)*/ @Excel(name = "不含税单价(RMB)") private Double noRmbPrice; @@ -365,19 +365,19 @@ public class SysSalesOrder extends BaseEntity { this.customerPhone = customerPhone; } - public Long getMaterialSum() { + public int getMaterialSum() { return materialSum; } - public void setMaterialSum(Long materialSum) { + public void setMaterialSum(int materialSum) { this.materialSum = materialSum; } - public Long getEnterpriseSum() { + public int getEnterpriseSum() { return enterpriseSum; } - public void setEnterpriseSum(Long enterpriseSum) { + public void setEnterpriseSum(int enterpriseSum) { this.enterpriseSum = enterpriseSum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index 2beee9e4..10da0763 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -246,21 +246,21 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor .filter(Objects::nonNull).mapToDouble(SysSalesOrder::getRmbTaxSum).sum(); // 计算所有订单的物料合计 - long totalMaterialSum = sysSalesOrders.stream() - .mapToLong(order -> order.getMaterialSum() != null ? order.getMaterialSum() : 0L) - .sum(); + int totalMaterialSum = sysSalesOrders.stream() + .filter(Objects::nonNull).mapToInt(SysSalesOrder::getMaterialSum).sum(); + // 计算所有订单的数量合计 - long totalEnterpriseSum = sysSalesOrders.stream() - .mapToLong(order -> order.getEnterpriseSum() != null ? order.getEnterpriseSum() : 0L) - .sum(); + int totalEnterpriseSum = sysSalesOrders.stream() + .filter(Objects::nonNull).mapToInt(SysSalesOrder::getEnterpriseSum).sum(); + // 设置到sysSalesShippingInform对象中 sysSalesShippingInform.setAllPriceExcludingTaxDollar(BigDecimal.valueOf(totalNoUsdSum)); sysSalesShippingInform.setAllPriceExcludingTaxRmb(BigDecimal.valueOf(totalNoRmbSum)); sysSalesShippingInform.setAllPriceIncludesTax(BigDecimal.valueOf(totalRmbTaxSum)); - sysSalesShippingInform.setMaterialSum(Math.toIntExact(totalMaterialSum)); - sysSalesShippingInform.setEnterpriseSum(Math.toIntExact(totalEnterpriseSum)); + sysSalesShippingInform.setMaterialSum(totalMaterialSum); + sysSalesShippingInform.setEnterpriseSum(totalEnterpriseSum); sysSalesShippingInform.setCustomerContact(sysSalesOrder.getCustomerDelivery()); sysSalesShippingInform.setContactNumber(sysSalesOrder.getDeliveryPhone()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java index 47f62c85..3fbc9435 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java @@ -1010,14 +1010,14 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService // 计算所有订单的物料合计 - long totalMaterialSum = sysSalesOrders.stream() - .mapToLong(order -> order.getMaterialSum() != null ? order.getMaterialSum() : 0L) - .sum(); + int totalMaterialSum = sysSalesOrders.stream() + .filter(Objects::nonNull).mapToInt(SysSalesOrder::getMaterialSum).sum(); + + + // 计算所有订单的数量合计 + int totalEnterpriseSum = sysSalesOrders.stream() + .filter(Objects::nonNull).mapToInt(SysSalesOrder::getEnterpriseSum).sum(); - // 计算所有订单的企业合计 - long totalEnterpriseSum = sysSalesOrders.stream() - .mapToLong(order -> order.getEnterpriseSum() != null ? order.getEnterpriseSum() : 0L) - .sum(); //物料合计