From 8e1d6b51858d2225284d32793423042a69d1c5a5 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Fri, 26 Dec 2025 17:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8C=82=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 113 +++++- .../java/lingtao/net/util/PriceUtils.java | 9 +- src/main/webapp/views/product/tape.jsp | 2 - .../webapp/views/product/wallPainting.jsp | 341 ++++++++++++++++++ 4 files changed, 456 insertions(+), 9 deletions(-) create mode 100644 src/main/webapp/views/product/wallPainting.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 559ba51..72582d1 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -8,6 +8,7 @@ import lingtao.net.dao.ProductMapper; import lingtao.net.dao.QuoteLogMapper; import lingtao.net.util.*; import lingtao.net.vo.FunReturnVo; +import org.apache.commons.collections.map.HashedMap; import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -2978,7 +2979,7 @@ public class ProductService { designFee = 50; designFee9 = 60; } else { - designFee = 80; + designFee = 50; designFee9 = 80; } if ("腰封".equals(dto.getKind())) { @@ -4788,12 +4789,111 @@ public class ProductService { return getPlasticBagPrice(dto, width, length); case "纸碗": return getPaperBowlPrice(dto, width, length); + case "挂画": + return getWallPaintingPrice(dto, width, length); default: break; } return null; } + private List getWallPaintingPrice(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[][] prices = { + {45, 45, 55, 75}, + {40, 40, 45, 65} + }; + double area = length * width / 10000; + double price = 0, dj = 0; + double craft_price = 0; + + int index = 0; + String product_weight = ""; + Map craft_weight_map = new HashMap<>(); + craft_weight_map.put("30", 0.055); + craft_weight_map.put("40", 0.08); + craft_weight_map.put("50", 0.095); + craft_weight_map.put("60", 0.12); + craft_weight_map.put("70", 0.14); + craft_weight_map.put("80", 0.16); + craft_weight_map.put("90", 0.18); + craft_weight_map.put("100", 0.2); + long key = Math.round(length); + if ("贡缎布".equals(dto.getKind())) { + index = 1; + } + if ("30*50".equals(dto.getSize())) { + dj = prices[index][0]; + price = Math.ceil(count * dj); + } else if ("50*80".equals(dto.getSize())) { + dj = prices[index][1]; + price = Math.ceil(count * dj); + } else if ("60*100".equals(dto.getSize())) { + dj = prices[index][2]; + price = Math.ceil(count * dj); + } else if ("80*120".equals(dto.getSize())) { + dj = prices[index][3]; + price = Math.ceil(count * dj); + } else { + if ("贡缎布".equals(dto.getKind())) { + if (area < 0.25) { + dj = 40; + } else { + dj = 35; + } + area *= count; + price = Math.max(Math.ceil(area * dj), 40); + + } + if ("帆布".equals(dto.getKind())) { + dto.setStickerKind(""); + priceList = new PriceUtils().getFbPrice(dto, number, width, length, count, priceList); + } + Map craft_price_map = new HashMap<>(); + craft_price_map.put("30", 5.0); + craft_price_map.put("40", 6.0); + craft_price_map.put("50", 7.0); + craft_price_map.put("60", 8.0); + craft_price_map.put("70", 9.0); + craft_price_map.put("80", 10.0); + craft_price_map.put("90", 11.0); + craft_price_map.put("100", 12.0); + if (craft_price_map.containsKey(String.valueOf(key))) { + craft_price = craft_price_map.get(String.valueOf(key)); + if (craft_price > 0) { + craft_price = Math.ceil(craft_price * count * number); + } + } + + } + if (price > 0) { + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(price * number); + priceList.add(pro); + } + if (craft_weight_map.containsKey(String.valueOf(key))) { + double weight = craft_weight_map.get(String.valueOf(key)); + if ("贡缎布".equals(dto.getKind())) { + product_weight = (df.format(0.165 * length * width * count / 10000 * number + weight * count * number)); + + + } + if ("帆布".equals(dto.getKind())) { + product_weight = (df.format(length * width * count / 10000 * 0.28 * number + weight * count * number)); + } + + } + for (Product product : priceList) { + product.setPrice(product.getPrice() + craft_price); + product.setWeight(product_weight); + } + return priceList; + } + private List getPaperBowlPrice(Product dto, Double width, Double length) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); @@ -5197,18 +5297,26 @@ public class ProductService { int number = dto.getNumber(); //布钱 +人工+印刷+手提 Product pro = null; + double lastPrice = 0; for (int i = 0; i < counts.length; i++) { int itemCount = counts[i]; + double basePrice = unit_prices[base][i]; + + if (itemCount < count) { + lastPrice = basePrice; continue; } if (priceList.size() > 2) { break; } if (priceList.size() == 0 && itemCount != count) { + if (lastPrice > 0) { + basePrice = (lastPrice + basePrice) / 2; + } pro = new Product(); pro.setCount(count); - pro.setPrice(Math.ceil(unit_prices[base][i] * count * number)); + pro.setPrice(Math.ceil(basePrice * count * number)); priceList.add(pro); } pro = new Product(); @@ -5216,6 +5324,7 @@ public class ProductService { pro.setPrice(Math.ceil(unit_prices[base][i] * itemCount * number)); pro.setWeight(df.format(width * length * 1.8 * itemCount / 10000)); priceList.add(pro); + lastPrice = basePrice; } return priceList; diff --git a/src/main/java/lingtao/net/util/PriceUtils.java b/src/main/java/lingtao/net/util/PriceUtils.java index 6b8b1fd..0fa3393 100644 --- a/src/main/java/lingtao/net/util/PriceUtils.java +++ b/src/main/java/lingtao/net/util/PriceUtils.java @@ -2485,16 +2485,16 @@ public class PriceUtils { double area = length * width / 10000; double price = 0, dj = 0; if (area < 0.25) { - dj = 50; - } else { dj = 40; + } else { + dj = 35; } area *= count; if ("6".equals(kind2)) { price = price + 30; } - price = Math.ceil(area * dj > 58 ? area * dj : 58); + price = Math.ceil(area * dj > 40 ? area * dj : 40); pro.setCount(count); pro.setPrice(price * number); list.add(pro); @@ -3075,12 +3075,11 @@ public class PriceUtils { Product pro = new Product(); double price = 0, dj = 0; String[] craft = dto.getCraft(); - if (dto.getStickerKind().equals("套餐")) { + if ("套餐".equals(dto.getStickerKind())) { pro.setCount(count); pro.setPrice(198.0); list.add(pro); } else { - double area = length * width * count / 10000; double d = length * width * count / 10000; if (length == 100 && width == 45) { diff --git a/src/main/webapp/views/product/tape.jsp b/src/main/webapp/views/product/tape.jsp index dffe60d..fa3e203 100644 --- a/src/main/webapp/views/product/tape.jsp +++ b/src/main/webapp/views/product/tape.jsp @@ -234,8 +234,6 @@ - - `; } if (kind == '3') { diff --git a/src/main/webapp/views/product/wallPainting.jsp b/src/main/webapp/views/product/wallPainting.jsp new file mode 100644 index 0000000..5788e67 --- /dev/null +++ b/src/main/webapp/views/product/wallPainting.jsp @@ -0,0 +1,341 @@ +<%@ 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