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(); //物料合计