From d2df533f65581f9bcce6a217a91ae3595c5060d5 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Wed, 5 Aug 2026 10:15:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9C=B0=E5=9E=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 43 ++ src/main/webapp/views/product/floorMat.jsp | 401 ++++++++++++++++++ 2 files changed, 444 insertions(+) create mode 100644 src/main/webapp/views/product/floorMat.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index a16fdbd..67a399f 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4466,12 +4466,55 @@ public class ProductService { case "扑克牌": priceList = getPegSolitairePrice(dto, width, length, height); return chucklePrice(role, priceList, dto); + case "地垫": + priceList = getFloorMatPrice(dto, width, length, height); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getFloorMatPrice(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 = {1, 5, 10, 20, 50, 100}; + + double[][] prices_area = { + {171.5, 150.0, 133.4, 120.0, 109.1, 100.0}, + {148.6, 130.0, 115.6, 104.0, 94.6, 86.7}, + {171.5, 150.0, 133.4, 120.0, 109.1, 100.0} + }; + double[][] base_prices_area = { + {51.5, 45.0, 40.1, 36.0, 32.8, 30.0}, + {48.9, 42.8, 38.1, 34.2, 31.1, 28.6}, + {51.5, 45.0, 40.1, 36.0, 32.8, 30.0} + }; + double craft_price = 0; + int price_index = 0; + if (craft_list.contains("不锁边")) { + price_index = 1; + } + if (craft_list.contains("异形")) { + price_index = 2; + } + if (craft_list.contains("OPP袋")) { + craft_price = 1 * count * number; + } + double price = new PriceUtils().TableCountCenterPrice(count, prices_area[price_index], counts); + double mini_price = new PriceUtils().TableCountCenterPrice(count, base_prices_area[price_index], counts); + double design_price = 0; + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.ceil(Math.max(price * length * width / 10000 * count, mini_price)) * number + design_price + craft_price); + priceList.add(pro); + return priceList; + } + private List getPegSolitairePrice(Product dto, Double width, Double length, Double height) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); diff --git a/src/main/webapp/views/product/floorMat.jsp b/src/main/webapp/views/product/floorMat.jsp new file mode 100644 index 0000000..ac94835 --- /dev/null +++ b/src/main/webapp/views/product/floorMat.jsp @@ -0,0 +1,401 @@ +<%@ 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