From 1929ebbfa3c35d489b7e9020add91ef37430a63d Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Tue, 3 Feb 2026 14:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=B7=E8=BD=AC=E5=8D=B0?= =?UTF-8?q?=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 | 5 +-- .../java/lingtao/net/util/PriceUtils.java | 42 +++++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 3ffd2bf..a991d65 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -2675,7 +2675,6 @@ public class ProductService { num = Math.max(Math.floor(paperLength / length) * Math.floor(paperWidth / width), Math.floor(paperLength / width) * Math.floor(paperWidth / length)); } - double baseCount = Math.max(Math.ceil(dto.getCount() * dto.getNumber() / num), 1); double countNum = Math.max(Math.ceil(dto.getNumber() / num), 1); int coNumber = dto.getCo_number() == null ? 1 : dto.getCo_number(); @@ -2683,7 +2682,7 @@ public class ProductService { coNumber = 1; } - double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum, width * length * dto.getCount() * number); + double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum, width * length * dto.getCount() * number, number); Product pro = new Product(); pro.setCount(dto.getCount()); @@ -2698,7 +2697,7 @@ public class ProductService { } baseCount = Math.max(Math.ceil(quantitySteps[i] * dto.getNumber() / num), 1); countNum = Math.max(Math.ceil(dto.getNumber() / num), 1); - double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum, width * length * quantitySteps[i] * number); + double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum, width * length * quantitySteps[i] * number, number); pro = new Product(); diff --git a/src/main/java/lingtao/net/util/PriceUtils.java b/src/main/java/lingtao/net/util/PriceUtils.java index 4f8e01d..f7baf31 100644 --- a/src/main/java/lingtao/net/util/PriceUtils.java +++ b/src/main/java/lingtao/net/util/PriceUtils.java @@ -3685,7 +3685,7 @@ public class PriceUtils { } - public double CalculatePrice(List craft_list, double count, int coNumber, double countNum, double area) { + public double CalculatePrice(List craft_list, double count, int coNumber, double countNum, double area, int number) { if (craft_list.contains("烫画")) { double basePrice = 0; area = area / 10000; @@ -3699,29 +3699,35 @@ public class PriceUtils { double price = 0; if (craft_list.contains("冷转印")) { double banfei = 200; - if (countNum > 1) { - price = 200 * countNum; - banfei = 0; - count = Math.abs(count - countNum); + double numCount = Math.max(Math.ceil(count / number), 1); + //单款数量少于5张的直接版费乘款数 + if (numCount > 5) { + if (countNum > 1) { + price = 200 * countNum; + banfei = 0; + count = Math.abs(count - countNum); - } - if (count > 0) { - if (count <= 5) { - price += 200; - } else if (count < 75) { - price += 14 * count + banfei; - } else { - if (count < 89) { - count = 89; - } - price += 14 * count; } - } + if (count > 0) { + if (count <= 5) { + price += 200; + } else if (count < 75) { + price += 14 * count + banfei; + } else { + if (count < 89) { + count = 89; + } + price += 14 * count; + } + } + } else { + price = 200 * countNum; + } price = price + (coNumber - 1) * 100; } - return price; + return Math.ceil(price); } public static List getYinBaiPrice(List productList, double width, double length) {