From f2592686f8aa92b45965ad828a7e62a7e437e7ab Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Mon, 27 Jul 2026 15:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AB=8B=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 72 +++- .../webapp/views/product/standingSign.jsp | 329 ++++++++++++++++++ 2 files changed, 400 insertions(+), 1 deletion(-) create mode 100644 src/main/webapp/views/product/standingSign.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index ddbddd6..1c3cab1 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4431,12 +4431,82 @@ public class ProductService { case "沙滩旗": priceList = getBeachFlagPrice(dto, width, length); return chucklePrice(role, priceList, dto); + case "立牌": + priceList = getStandingSignPrice(dto, width, length); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getStandingSignPrice(Product dto, Double width, Double length) { + List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List priceList = new ArrayList<>(); + + int count = dto.getCount(); + int number = dto.getNumber(); + + double area = length * width; + int[] counts = {1, 5, 10, 20, 30, 50, 100}; + double[] areas = {25, 36, 49, 64, 100, 144, 215, 400}; + + double[][] prices = { + {30.0, 30.0, 30.0, 65.0, 100.0, 170.0, 328.0}, + {30.0, 30.0, 45.0, 83.0, 126.0, 205.0, 396.0}, + {30.0, 30.0, 55.0, 103.0, 150.0, 255.0, 480.0}, + {30.0, 40.0, 68.0, 123.0, 188.0, 305.0, 580.0}, + {30.0, 48.0, 90.0, 165.0, 242.0, 405.0, 780.0}, + {30.0, 65.0, 126.0, 245.0, 360.0, 580.0, 1073.0}, + {30.0, 105.0, 205.0, 378.0, 562.0, 893.0, 1738.0}, + {40.0, 190.0, 375.0, 740.0, 950.0, 1846.0, 3546.0} + }; + + if (craft_list.contains("双面")) { + prices = new double[][]{ + {35.0, 35.0, 35.0, 65.0, 100.0, 170.0, 328.0}, + {35.0, 35.0, 45.0, 83.0, 126.0, 205.0, 396.0}, + {35.0, 35.0, 55.0, 103.0, 150.0, 255.0, 480.0}, + {35.0, 45.0, 68.0, 123.0, 188.0, 305.0, 580.0}, + {35.0, 48.0, 90.0, 165.0, 242.0, 405.0, 780.0}, + {35.0, 65.0, 126.0, 245.0, 360.0, 580.0, 1073.0}, + {35.0, 105.0, 205.0, 378.0, 562.0, 893.0, 1738.0}, + {45.0, 190.0, 375.0, 740.0, 950.0, 1846.0, 3546.0} + }; + } + int area_index = 0; + for (int i = 0; i < areas.length; i++) { + if (area <= areas[i]) { + area_index = i; + break; + } + } + double base_price = 0; + for (int i = 0; i < counts.length; i++) { + if (count > counts[i]) { + continue; + } + if (priceList.size() > 2) { + break; + } + int itemCount = priceList.size() == 0 ? count : counts[i]; + base_price = prices[area_index][Math.max(i, 0)]; + Product pro = new Product(); + pro.setCount(itemCount); + pro.setNumber(dto.getNumber()); + pro.setPrice(Math.ceil(base_price * number)); + priceList.add(pro); + } + if (priceList.size() == 0) { + Product pro = new Product(); + pro.setCount(count); + pro.setNumber(number); + pro.setPrice(Math.ceil(prices[area_index][prices[area_index].length - 1] / counts[counts.length - 1] * count * number)); + priceList.add(pro); + } + return priceList; + } + private List getBeachFlagPrice(Product dto, Double width, Double length) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); @@ -6643,7 +6713,7 @@ public class ProductService { } if (priceList.size() == 0) { Product pro = new Product(); - pro.setCount(count); + pro.setCount(dto.getCount()); pro.setNumber(number); pro.setPrice(Math.ceil((double) prices[prices.length - 1] / counts[counts.length - 1] * Math.max(min_count, count) + craft_price)); priceList.add(pro); diff --git a/src/main/webapp/views/product/standingSign.jsp b/src/main/webapp/views/product/standingSign.jsp new file mode 100644 index 0000000..4b157d1 --- /dev/null +++ b/src/main/webapp/views/product/standingSign.jsp @@ -0,0 +1,329 @@ +<%@ 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/厘米) +

+
+ +
+

+ 厚度 +

+
+ +
+

+ 数量(个) +

+
+ +
+

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 印面: + + +
+
+ 裁切工艺: + +
+
+ 特殊效果: + +
+
+ 常见工艺: + +
+
+
+ + +
+
+
+ + +
+

计算结果- + +

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