From fc8ac0f2ce7d582ec0f4bbc93c1247ce744bdb0a Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Mon, 15 Sep 2025 15:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=AE=E5=88=AE=E5=8D=A1?= =?UTF-8?q?=E6=89=93=E7=A0=81=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 5894300..ed8ffab 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -688,14 +688,29 @@ public class ProductService { for (Product product : priceList) { double carft_price = 0; if (craftList.contains("压痕")) { - carft_price += Math.max(0.02 * product.getCount(), 10) * number; + carft_price += Math.max(0.02 * product.getCount(), 10); } if (craftList.contains("压点线")) { - carft_price += Math.max(0.02 * product.getCount(), 10) * number; + carft_price += Math.max(0.02 * product.getCount(), 10); } if (craftList.contains("圆角")) { - carft_price += Math.max(0.02 * product.getCount(), 10) * number; + carft_price += Math.max(0.02 * product.getCount(), 10); } + if (craftList.contains("打码")) { + double danjia = 0.0; + // 5000张以上,一张10分 + if (dto.getCount() > 5000) { + danjia = 0.1; + } else { + danjia = 0.1; + } + if ("上下编码".equals(dto.getBianma())) { + carft_price += Math.ceil((danjia * product.getCount() * 2 > 120 ? danjia * product.getCount() * 2 : 120)); + } else { + carft_price += Math.ceil((danjia * product.getCount())); + } + } + carft_price = Math.ceil(carft_price * number); //腰封的模切费单独计算 product.setPrice(Math.ceil((product.getPrice() + carft_price))); product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86)); @@ -1405,7 +1420,9 @@ public class ProductService { // 根据款数重新算价格 for (Product product : priceList) { product.setPrice(Math.ceil(product.getPrice() * number)); + product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.3 * 0.86)); } + return priceList; } if ("雅柔".equals(kind) || "萱姿".equals(kind)) { @@ -1506,7 +1523,7 @@ public class ProductService { } else { product.setPrice(Math.floor(product.getPrice() * number * min)); } - + product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.5)); } return priceList; } else if ("草香".equals(kind) || "芳怡".equals(kind)) { @@ -1581,12 +1598,12 @@ public class ProductService { if ("1".equals(dto.getKindValue())) { // 给产品加上重量 扣除出血的4毫米 for (Product product : priceList) { - product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86)); + product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86)); } } else { // 给产品加上重量 for (Product product : priceList) { - product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86)); + product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86)); } } @@ -1675,7 +1692,7 @@ public class ProductService { // int tzWei = Integer.parseInt(Pattern.compile("[^0-9]").matcher(kind).replaceAll("").trim());// 获取材质中的克数 int tzWei = 300;// 获取材质中的克数 for (Product product : priceList) { - product.setWeight(df.format(tzWei / 1000 * length * width * product.getCount() / 10000 * number)); + product.setWeight(df.format(tzWei / 1000.0 * length * width * product.getCount() / 10000.0 * number)); } return priceList; // 合版封套