From d622d5b937170ff8fb58c3fc32adabbf44fb1d85 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Sat, 20 Dec 2025 16:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BA=B8=E7=A2=97=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=85=B0=E5=B0=81=E5=B7=A5=E8=89=BA=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8D=E5=B9=B2=E8=83=B6=E5=B7=A5=E8=89=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 103 +++++- src/main/webapp/views/product/coupon.jsp | 3 +- src/main/webapp/views/product/paperBowl.jsp | 331 ++++++++++++++++++ src/main/webapp/views/product/stickers.jsp | 9 + 4 files changed, 439 insertions(+), 7 deletions(-) create mode 100644 src/main/webapp/views/product/paperBowl.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 6c473dd..559ba51 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -388,14 +388,36 @@ public class ProductService { kind = "2"; } else if ("15".equals(kind) || "16".equals(kind)) { List craft_list = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>(); - priceList = new SwzStickersPrice().getPrice(count, length, width, number, dto.getCraftTang()); - for (Product product : priceList) { - double rate = 1; - if (craft_list.contains("有色激凸")) { - rate = 1.8; + + if ("15".equals(kind) && dto.getCraftTang().contains("彩色印刷+烫金")) { + double[][] prices = new double[][]{ + {403, 503, 503, 503, 543, 582, 582, 582, 620, 620, 660, 698, 775, 775, 852.5, 853, 853}, + {520, 520, 520, 520, 560, 600, 600, 600, 640, 640, 680, 720, 800, 800, 880, 880, 880}, + {600, 600, 600, 600, 637.5, 675, 675, 675, 750, 750, 825, 862.5, 975, 975, 1050, 1050, 1125}, + {625, 625, 625, 625, 662.5, 700, 700, 700, 775, 775, 850, 887.5, 1000, 1000, 1075, 1075, 1150}, + {652, 652, 652, 652, 725, 762, 762, 762, 870, 870, 942, 978, 1051, 1051, 1087, 1087, 1196}, + {798, 798, 798, 798, 943, 1015, 1015, 1015, 1087, 1087, 1196, 1196, 1341, 1341, 1450, 1450, 1631}, + {910, 910, 910, 910, 1120, 1155, 1225, 1225, 1400, 1470, 1575, 1575, 1680, 1680, 1855, 1925, 2100}, + }; + int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000}; + double[] areas = new double[]{9, 12.25, 16, 20.25, 25, 30.25, 36, 42.25, 49, 56.25, 64, 72.25, 81, 90.25, 100, 110.25, 121}; + area = (length + 0.4) * (width + 0.4);//加上4毫出血 + priceList = getAreaNextPrice(count_list, dto.getCount(), area, prices, areas, dto.getNumber()); + for (Product product : priceList) { + product.setPrice(Math.ceil(product.getPrice() * 0.8)); + product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3)); + } + } else { + priceList = new SwzStickersPrice().getPrice(count, length, width, number, dto.getCraftTang()); + for (Product product : priceList) { + double rate = 1; + if (craft_list.contains("有色激凸")) { + rate = 1.8; + } + product.setPrice(Math.ceil(product.getPrice() * number * rate)); } - product.setPrice(Math.ceil(product.getPrice() * number * rate)); } + return priceList; } // 查询出来的价格集合 @@ -951,6 +973,10 @@ public class ProductService { } } } + if ("1".equals(dto.getKind())) { + dto.setLengthTang(length); + dto.setWidthTang(width); + } getCraft(dto, priceList, length * 10, width * 10, min); // 刮刮膜增加价格 if (dto.getKind().equals("13")) { @@ -4760,12 +4786,77 @@ public class ProductService { return getWristBandPrice(dto, width, length); case "手提塑料袋": return getPlasticBagPrice(dto, width, length); + case "纸碗": + return getPaperBowlPrice(dto, width, length); default: break; } return null; } + 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<>(); + int count = dto.getCount(); + int number = dto.getNumber(); + int[] counts = {1200, 2400, 3600, 4800, 6000, 10000}; + double[][] prices = { + {605, 1141, 1557, 2053, 2353, 3557}, + {633, 1195, 1641, 2164, 2491, 3788}, + {653, 1235, 1699, 2243, 2588, 3951}, + }; + int sizeIndex = 0; + String size = dto.getSize(); + if ("165*64*145".equals(size)) { + sizeIndex = 1; + } + if ("165*75*142".equals(size)) { + sizeIndex = 2; + } + double carftPrice = 0; + if (craft_list.contains("ops盖")) { + carftPrice = 0.102; + } + if (craft_list.contains("pp盖")) { + carftPrice = 0.125; + } + if (craft_list.contains("牛皮纸盖")) { + carftPrice = 0.139; + } + if (craft_list.contains("白卡纸盖")) { + carftPrice = 0.113; + } + for (int i = 0; i < counts.length; i++) { + int itemCount = counts[i]; + if (itemCount < count) { + continue; + } + if (priceList.size() > 2) { + break; + } + if (craft_list.contains("金箔") || craft_list.contains("铝箔")) { + carftPrice += 0.115; + } + Product pro = new Product(); + pro.setCount(priceList.size() == 0 ? count : itemCount); + pro.setPrice(Math.ceil((prices[sizeIndex][i] + carftPrice * itemCount) * number)); + pro.setNumber(number); + priceList.add(pro); + } + if (priceList.size() == 0) { + if (craft_list.contains("金箔") || craft_list.contains("铝箔")) { + carftPrice += 0.115; + } + + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.ceil((prices[sizeIndex][prices[sizeIndex].length - 1] / counts[counts.length - 1] + carftPrice) * count * number)); + pro.setNumber(number); + priceList.add(pro); + } + return priceList; + } + private List getPlasticBagPrice(Product dto, Double width, Double length) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 1b4c7dc..9cf1ea7 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -565,6 +565,7 @@ +