From c2eb7afc08ad4b953daba2fbd994b4e70cbdf9c8 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 5 Nov 2024 17:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/purchase/domain/PurchaseCheckInfo.java | 2 +- .../service/impl/PurchaseCheckInfoServiceImpl.java | 10 +++++----- .../material/purchase/PurchaseCheckInfoMapper.xml | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java index 8726cd0b..75db7091 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/domain/PurchaseCheckInfo.java @@ -84,7 +84,7 @@ public class PurchaseCheckInfo extends BaseEntity { * 采购不含税价格 */ @ApiModelProperty(value = "采购不含税价格--外层Table字段") - private BigDecimal purchaseNoTaxPrice; + private BigDecimal purchasePrice; /** * 税率 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseCheckInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseCheckInfoServiceImpl.java index ee261d38..cce05603 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseCheckInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/purchase/service/impl/PurchaseCheckInfoServiceImpl.java @@ -105,7 +105,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService { // 采购物资数量 AtomicLong purchaseMaTotalNumber = new AtomicLong(0L); // 采购物资不含税价格 - AtomicReference purchaseMaTotalNoTaxPrice = new AtomicReference<>(BigDecimal.ZERO); + AtomicReference purchaseMaTotalPrice = new AtomicReference<>(BigDecimal.ZERO); // 执行for循环统计采购物资数量、价格 for (PurchaseCheckDetails detail : purchaseCheckDetails) { @@ -119,17 +119,17 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService { // 统计采购数量 purchaseMaTotalNumber.addAndGet(detail.getPurchaseNum()); // 采购物资数量乘以采购不含税价格 - purchaseMaTotalNoTaxPrice.updateAndGet(v -> v.add(new BigDecimal(detail.getPurchaseNum()).multiply(detail.getPurchasePrice()))); + purchaseMaTotalPrice.updateAndGet(v -> v.add(new BigDecimal(detail.getPurchaseNum()).multiply(detail.getPurchasePrice()))); } // 赋值统计出来的采购物资数量、不含税价格 purchaseCheckInfo.setPurchaseMaNumber(purchaseMaTotalNumber.get()); - purchaseCheckInfo.setPurchaseNoTaxPrice(purchaseMaTotalNoTaxPrice.get()); + purchaseCheckInfo.setPurchasePrice(purchaseMaTotalPrice.get()); // 通过不含税价格及税率,计算出含税价格并赋值 - if (purchaseCheckInfo.getTaxRate() != null && purchaseCheckInfo.getPurchaseNoTaxPrice() != null) { + if (purchaseCheckInfo.getTaxRate() != null && purchaseCheckInfo.getPurchasePrice() != null) { purchaseCheckInfo.setPurchaseTaxPrice( - calculateTaxPrice(purchaseMaTotalNoTaxPrice.get(), new BigDecimal(purchaseCheckInfo.getTaxRate())) + calculateTaxPrice(purchaseMaTotalPrice.get(), new BigDecimal(purchaseCheckInfo.getTaxRate())) ); } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseCheckInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseCheckInfoMapper.xml index 552f033d..278415ea 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseCheckInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/purchase/PurchaseCheckInfoMapper.xml @@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select - id, task_id, purchase_time, arrival_time, purchaser, create_by, + id, task_id, purchase_time, arrival_time, purchaser, tax_rate, reate_by, create_time, update_by, update_time, remark, company_id from purchase_check_info @@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select - pci.id, pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, + pci.id, pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.tax_rate, pci.create_by, pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id, t.task_status, t.task_type, t.code, su.user_name as create_user_name from @@ -52,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and purchase_time = #{purchaseTime} and arrival_time = #{arrivalTime} and purchaser = #{purchaser} + and tax_rate = #{taxRate} and company_id = #{companyId} @@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" purchase_time, arrival_time, purchaser, + tax_rate, create_by, create_time, update_by, @@ -80,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{purchaseTime}, #{arrivalTime}, #{purchaser}, + #{taxRate}, #{createBy}, #{createTime}, #{updateBy}, @@ -96,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" purchase_time = #{purchaseTime}, arrival_time = #{arrivalTime}, purchaser = #{purchaser}, + tax_rate = #{taxRate}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, @@ -124,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and pci.purchase_time = #{purchaseTime} and pci.arrival_time = #{arrivalTime} and pci.purchaser = #{purchaser} + and pci.tax_rate = #{taxRate}