From c1f0b35ceb605fc93e2678c14f86eeb26b3fb414 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Tue, 4 Aug 2026 11:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=98=B2=E6=B2=B9=E6=89=8B?= =?UTF-8?q?=E6=8F=90=E8=A2=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 72 +++- src/main/webapp/views/product/coupon.jsp | 1 - .../webapp/views/product/oilProofPaper.jsp | 354 ++++++++++++++++++ 3 files changed, 425 insertions(+), 2 deletions(-) create mode 100644 src/main/webapp/views/product/oilProofPaper.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index b81a44b..ca80e43 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4460,12 +4460,77 @@ public class ProductService { case "手举牌": priceList = getHoldSignPrice(dto, width, length, height); return chucklePrice(role, priceList, dto); + case "防油纸袋": + priceList = getOilProofPaperPrice(dto, width, length, height); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getOilProofPaperPrice(Product dto, Double width, Double length, Double height) { + List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List priceList = new ArrayList<>(); + + int count = dto.getCount(); + int number = dto.getNumber(); + + int[] counts = {20000, 30000, 50000, 100000, 200000}; + double[] rates = {0.4, 0.38, 0.35, 0.32, 0.3}; + double area = Math.max(width, length) * (Math.min(width, length) + dto.getXx()); + + double[] base_prices = {0.0202 + area * 0.0001304, 0.0202 + area * 0.0001304, 0.0182 + area * 0.0001304, 0.0162 + area * 0.0001304, 0.0142 + area * 0.0001304}; + double[] prices = {0.6, 0.62, 0.65, 0.68, 0.7}; + int leftIdx = 0; + int rightIdx = 0; + if (count <= counts[0]) { + leftIdx = rightIdx = 0; + } else if (count >= counts[counts.length - 1]) { + leftIdx = rightIdx = counts.length - 1; + } else { + // 找到第一个大于 Q 的档位索引 + int i = 0; + while (i < counts.length && counts[i] < count) { + i++; + } + leftIdx = i - 1; + rightIdx = i; + } + double price = 0; + if (leftIdx == rightIdx) { + price = Math.ceil(base_prices[leftIdx] / prices[leftIdx] * count); + } else { + double base_count = (count - counts[leftIdx]) / (counts[rightIdx] - counts[leftIdx]); + price = Math.ceil(((base_prices[leftIdx] + (base_count) * (base_prices[rightIdx] - base_prices[leftIdx]) + area * 0.0001304) / (1 - (rates[leftIdx] + (base_count) * (rates[rightIdx] - rates[leftIdx]))) * count) / 10) * 10; + } + double color_price = 0; + double base_color_price = 150; + if (area <= 462) { + base_color_price = 150; + } else if (area <= 728) { + base_color_price = 200; + } else { + base_color_price = 250; + } + if (craft_list.contains("单色")) { + color_price = base_color_price * 1; + } else if (craft_list.contains("两色")) { + color_price = base_color_price * 2; + } else if (craft_list.contains("三色")) { + color_price = base_color_price * 3; + } else if (craft_list.contains("四色")) { + color_price = base_color_price * 4; + } + + double design_price = 0; + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.max(Math.ceil(price), 0) * number + design_price + color_price); + priceList.add(pro); + return priceList; + } + private List getHoldSignPrice(Product dto, Double width, Double length, Double height) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); @@ -7675,7 +7740,7 @@ public class ProductService { price = PriceUtils.TableUnitPrice(area, prices, areas, last_price); } - price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8); + return price; } @@ -7695,11 +7760,16 @@ public class ProductService { if (carft_list.contains("激光") && carft_list.contains("滴胶")) { price = price * 1.3; } + price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8); + if (carft_list.contains("二层旋转")) { price += getOtherFridgePrice(dto.getLengthSize(), dto.getWidthSize(), dto, 0, carft_list); + price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8); + } if (carft_list.contains("三层旋转")) { price += getOtherFridgePrice(dto.getLengthTang(), dto.getWidthTang(), dto, 0, carft_list); + price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8); } weight = df.format(width * length * 4.17 * dto.getCount() * 0.1 * number / 1000 * Double.parseDouble(cailiao)); } diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 22607f1..3fe29f7 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -1656,7 +1656,6 @@ $("#z4_craft").show(); $("#peijian_ui").show(); $("#z4_craft").find(":input").attr("disabled", false); - $("#peijian_ui").find(":input").attr("disabled", false); $("#z4_craft .ui_double_fm").prop("checked", true); $('.ui_fm_l').find(":input").prop('checked', false); $('.ui_fm_l input[value="双面覆哑膜"]').prop('checked', true); diff --git a/src/main/webapp/views/product/oilProofPaper.jsp b/src/main/webapp/views/product/oilProofPaper.jsp new file mode 100644 index 0000000..89864c3 --- /dev/null +++ b/src/main/webapp/views/product/oilProofPaper.jsp @@ -0,0 +1,354 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + Insert title here + <%@include file="/views/common.jsp" %> + + + +
+
+

防油纸袋

+
+
+ +

+ 材质 +

+
+ +
+

+ 尺寸(CM/厘米) +

+
+ +
+

+ 侧宽(CM/厘米) 侧宽尺寸只能2-6cm之间 +

+
+ +
+
+
+

+ 数量(个) +

+
+ +
+
+
+

+ 自定义数量 +

+
+ +
+
+
+

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 印面: + + +
+
+ 印色: + + + + +
+
+
+ + +
+
+
+ + +
+

计算结果- + +

+
+ + <%@include file="../acountExpressFee.jsp" %> +
+
+
+
+
+
+
+ +
+
+ +<%@include file="/views/copyResult.jsp" %> + + \ No newline at end of file