From 6ddf69dfc8c2059d82027ba9c85cbf4f242a6e70 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Thu, 13 Nov 2025 09:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A6=99=E8=96=B0=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 75 +++ .../webapp/views/product/aromatherapyCard.jsp | 441 ++++++++++++++++++ src/main/webapp/views/product/badge.jsp | 441 ++++++++++++++++++ 3 files changed, 957 insertions(+) create mode 100644 src/main/webapp/views/product/aromatherapyCard.jsp create mode 100644 src/main/webapp/views/product/badge.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 1595726..205e396 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -1742,6 +1742,16 @@ public class ProductService { for (Product product : priceList) { product.setPrice(Math.ceil(product.getPrice() * number * min * zhekou)); } + //直角的价格 按照报价系统乘以2.3 异形的按照报价系统的价格乘以1.5哈 + if ("金绒".equals(kind) && craft_list.contains("白墨")) { + for (Product product : priceList) { + if (craft_list.contains("异形模切")) { + product.setPrice(Math.ceil(product.getPrice() * 1.5)); + } else { + product.setPrice(Math.ceil(product.getPrice() * 2.3)); + } + } + } if ("芳怡".equals(kind) || "草香".equals(kind)) { for (Product product : priceList) { product.setPrice(Math.floor(product.getPrice() * 1.5)); @@ -2627,6 +2637,7 @@ public class ProductService { // 1006 1003 1005 1037 1058 1002 1033 1045 卓盛 航和 米笛儿 竹范 领淘文具 榆家 涛莱 拼多多uv单独报价 List crafts = new ArrayList<>(dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft())); crafts.remove("刮板"); + crafts.remove("哑光"); if (crafts.size() > 0 && "烫金".equals(crafts.get(0))) { crafts.remove(0); } @@ -4854,12 +4865,76 @@ public class ProductService { return getLightPrice(dto, length, width); case "淋膜纸": return getLingmoPrice(dto, width, length); + case "香薰卡": + return getaromatherapyPrice(dto, width, length); default: break; } return null; } + private List getaromatherapyPrice(Product dto, Double width, Double length) { + List carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List priceList = new ArrayList<>(); + //大纸尺寸 + double max_width = 290; + double max_length = 390; + double base_price = 21; + double min_price = 50; + if ("2".equals(dto.getKind())) { + max_width = 420; + max_length = 310; + base_price = 30; + min_price = 60; + } + if ("3".equals(dto.getKind())) { + max_width = 420; + max_length = 310; + base_price = 35; + min_price = 60; + } + width = width * 10 + 4; + length = length * 10 + 4; + + double max = 1; + + if (length == max_width + 4 || length == max_length + 4 || width == max_width + 4 || width == max_length + 4) { + max = Math.max(Math.floor(max_width / (length - 4)) * Math.floor(max_length / (width - 4)), Math.floor(max_width / (width - 4)) * Math.floor(max_length / (length - 4))); + } else { + max = Math.max(Math.floor(max_width / length) * Math.floor(max_length / width), Math.floor(max_width / width) * Math.floor(max_length / length)); + } + max = Math.max(max, 1); + // 报的数量需要多少张大纸 + // 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个 + double num = Math.ceil(dto.getCount() * dto.getNumber() / max); + double craft_price = 0; + if (carftList.contains("单独包装")) { + craft_price += Math.ceil(0.2 * dto.getCount() * dto.getNumber()); + } + if (carftList.contains("真空包装")) { + craft_price += Math.ceil(0.35 * dto.getCount() * dto.getNumber()); + } + if (carftList.contains("配涤纶丝带")) { + craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber()); + } + if (carftList.contains("配吊牌绳")) { + craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber()); + } + if (carftList.contains("配弹力绳")) { + craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber()); + } + if (carftList.contains("穿涤纶丝带") || carftList.contains("穿吊牌绳") || carftList.contains("穿弹力绳")) { + craft_price += Math.ceil(0.15 * dto.getCount() * dto.getNumber()); + } + Product pro = new Product(); + pro.setPrice(Math.ceil(Math.max(base_price * num, min_price) + craft_price)); + pro.setCount(dto.getCount()); + pro.setNumber(dto.getNumber()); + pro.setWeight(df.format(dto.getNumber() * (length - 4) / 1000 * (width - 4) / 1000 * dto.getCount() * 0.2 * 0.86)); + priceList.add(pro); + return priceList; + } + private List getLingmoPrice(Product dto, Double width, Double length) { List carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); String[] sizes = {"21*29", "36*24", "36*26", "42*28.5"}; diff --git a/src/main/webapp/views/product/aromatherapyCard.jsp b/src/main/webapp/views/product/aromatherapyCard.jsp new file mode 100644 index 0000000..d75d46e --- /dev/null +++ b/src/main/webapp/views/product/aromatherapyCard.jsp @@ -0,0 +1,441 @@ +<%@ 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 diff --git a/src/main/webapp/views/product/badge.jsp b/src/main/webapp/views/product/badge.jsp new file mode 100644 index 0000000..1e2033e --- /dev/null +++ b/src/main/webapp/views/product/badge.jsp @@ -0,0 +1,441 @@ +<%@ 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