diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index b4e0950..2c85598 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -1447,7 +1447,7 @@ public class ProductService { if (!"素芸".equals(kind) && (craft_list.contains("单面烫金") || craft_list.contains("双面烫金"))) { int[] counts = new int[]{200, 500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000}; Map prices = null; - if (craft_list.contains("单面烫金") && !craft_list.contains("圆角") && !craft_list.contains("异形模切")) { + if (craft_list.contains("单面烫金") && !craft_list.contains("异形模切")) { prices = new HashMap<>(); prices.put("萱姿", new int[]{257, 329, 500, 863, 1278, 1692, 2106, 2520, 2934, 3348, 3762, 4177}); prices.put("岚蝶", new int[]{229, 263, 354, 571, 846, 1121, 1377, 1645, 1913, 2181, 2449, 2720}); @@ -1460,7 +1460,7 @@ public class ProductService { prices.put("芳怡", new int[]{455, 495, 957, 1691, 2365, 3195, 3777, 4431, 5085, 5739, 6939, 7048}); } - if (craft_list.contains("双面烫金") && !craft_list.contains("圆角") && !craft_list.contains("异形模切")) { + if (craft_list.contains("双面烫金") && !craft_list.contains("异形模切")) { prices = new HashMap<>(); prices.put("萱姿", new int[]{463, 592, 900, 1553, 2300, 3046, 3791, 4536, 5281, 6026, 6772, 7519}); prices.put("岚蝶", new int[]{412, 473, 637, 1028, 1523, 2018, 2479, 2961, 3443, 3926, 4408, 4896}); @@ -1473,32 +1473,32 @@ public class ProductService { prices.put("芳怡", new int[]{755, 755, 1379, 2367, 3245, 4425, 5109, 5935, 6771, 7597, 8433, 9269}); } - if (craft_list.contains("单面烫金") && craft_list.contains("圆角") && !craft_list.contains("异形模切")) { - prices = new HashMap<>(); - prices.put("萱姿", new int[]{368, 373, 647, 1187, 1560, 2010, 2385, 2731, 3078, 3425, 3771, 4117}); - prices.put("岚蝶", new int[]{355, 360, 484, 855, 1194, 1604, 1917, 2278, 2639, 3000, 3361, 3721}); - prices.put("皙贝", new int[]{355, 360, 484, 855, 1195, 1605, 1917, 2280, 2648, 3002, 3362, 3721}); - prices.put("琮纹", new int[]{355, 360, 484, 855, 1198, 1607, 1917, 2282, 2643, 3004, 3364, 3721}); - prices.put("睿狐", new int[]{355, 360, 484, 855, 1200, 1609, 1917, 2283, 2644, 3005, 3366, 3721}); - prices.put("溪雪", new int[]{368, 373, 547, 999, 1320, 1730, 2061, 2378, 2696, 3014, 3332, 3649}); - prices.put("玉蕊", new int[]{375, 380, 660, 1189, 1655, 2225, 2845, 3373, 3901, 4429, 4957, 5484}); - prices.put("金绒", new int[]{475, 480, 760, 1289, 1755, 2225, 2845, 3373, 3901, 4429, 4957, 5484}); - prices.put("芳怡", new int[]{546, 594, 1148, 2029, 2838, 3834, 4532, 5310, 6099, 6855, 7666, 8458}); - - } - if (craft_list.contains("双面烫金") && craft_list.contains("圆角") && !craft_list.contains("异形模切")) { - prices = new HashMap<>(); - prices.put("萱姿", new int[]{662, 671, 1165, 2137, 2808, 3618, 4293, 4916, 5540, 6165, 6800, 8200}); - prices.put("岚蝶", new int[]{639, 648, 871, 1539, 2149, 2887, 3451, 4100, 4750, 5400, 6050, 6698}); - prices.put("皙贝", new int[]{639, 648, 871, 1539, 2151, 2889, 3451, 4104, 4766, 5404, 6052, 6698}); - prices.put("琮纹", new int[]{639, 648, 871, 1539, 2156, 2893, 3451, 4108, 4757, 5407, 6055, 6698}); - prices.put("睿狐", new int[]{639, 648, 871, 1539, 2160, 2896, 3451, 4109, 4759, 5409, 6059, 6698}); - prices.put("溪雪", new int[]{662, 671, 985, 1798, 2376, 3114, 3710, 4280, 4853, 5425, 5998, 6568}); - prices.put("玉蕊", new int[]{675, 684, 1188, 2140, 2979, 4005, 5121, 6071, 7022, 7972, 8923, 9871}); - prices.put("金绒", new int[]{546, 594, 1148, 2029, 2838, 3834, 4532, 5310, 6099, 6855, 7666, 8458}); - prices.put("芳怡", new int[]{755, 755, 1379, 2367, 3245, 4425, 5109, 5935, 6771, 7597, 8433, 9269}); - - } +// if (craft_list.contains("单面烫金") && craft_list.contains("圆角") && !craft_list.contains("异形模切")) { +// prices = new HashMap<>(); +// prices.put("萱姿", new int[]{368, 373, 647, 1187, 1560, 2010, 2385, 2731, 3078, 3425, 3771, 4117}); +// prices.put("岚蝶", new int[]{355, 360, 484, 855, 1194, 1604, 1917, 2278, 2639, 3000, 3361, 3721}); +// prices.put("皙贝", new int[]{355, 360, 484, 855, 1195, 1605, 1917, 2280, 2648, 3002, 3362, 3721}); +// prices.put("琮纹", new int[]{355, 360, 484, 855, 1198, 1607, 1917, 2282, 2643, 3004, 3364, 3721}); +// prices.put("睿狐", new int[]{355, 360, 484, 855, 1200, 1609, 1917, 2283, 2644, 3005, 3366, 3721}); +// prices.put("溪雪", new int[]{368, 373, 547, 999, 1320, 1730, 2061, 2378, 2696, 3014, 3332, 3649}); +// prices.put("玉蕊", new int[]{375, 380, 660, 1189, 1655, 2225, 2845, 3373, 3901, 4429, 4957, 5484}); +// prices.put("金绒", new int[]{475, 480, 760, 1289, 1755, 2225, 2845, 3373, 3901, 4429, 4957, 5484}); +// prices.put("芳怡", new int[]{546, 594, 1148, 2029, 2838, 3834, 4532, 5310, 6099, 6855, 7666, 8458}); +// +// } +// if (craft_list.contains("双面烫金") && craft_list.contains("圆角") && !craft_list.contains("异形模切")) { +// prices = new HashMap<>(); +// prices.put("萱姿", new int[]{662, 671, 1165, 2137, 2808, 3618, 4293, 4916, 5540, 6165, 6800, 8200}); +// prices.put("岚蝶", new int[]{639, 648, 871, 1539, 2149, 2887, 3451, 4100, 4750, 5400, 6050, 6698}); +// prices.put("皙贝", new int[]{639, 648, 871, 1539, 2151, 2889, 3451, 4104, 4766, 5404, 6052, 6698}); +// prices.put("琮纹", new int[]{639, 648, 871, 1539, 2156, 2893, 3451, 4108, 4757, 5407, 6055, 6698}); +// prices.put("睿狐", new int[]{639, 648, 871, 1539, 2160, 2896, 3451, 4109, 4759, 5409, 6059, 6698}); +// prices.put("溪雪", new int[]{662, 671, 985, 1798, 2376, 3114, 3710, 4280, 4853, 5425, 5998, 6568}); +// prices.put("玉蕊", new int[]{675, 684, 1188, 2140, 2979, 4005, 5121, 6071, 7022, 7972, 8923, 9871}); +// prices.put("金绒", new int[]{546, 594, 1148, 2029, 2838, 3834, 4532, 5310, 6099, 6855, 7666, 8458}); +// prices.put("芳怡", new int[]{755, 755, 1379, 2367, 3245, 4425, 5109, 5935, 6771, 7597, 8433, 9269}); +// +// } if (craft_list.contains("单面烫金") && !craft_list.contains("圆角") && craft_list.contains("异形模切")) { prices = new HashMap<>(); prices.put("萱姿", new int[]{463, 592, 900, 1553, 2300, 3046, 3791, 4536, 5281, 6026, 6772, 7519}); @@ -4889,12 +4889,78 @@ public class ProductService { return getWireTapePrice(dto, width, length); case "包装纸": return getWrappingPaper(dto, width, length); + case "撕撕乐": + return getTearingJoyPrice(dto, width, length); default: break; } return null; } + private List getTearingJoyPrice(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 awards = dto.getAwards(); + int[][] prices = { + {900, 900, 1000, 1000}, + {950, 950, 1100, 1100}, + {1022, 1023, 1200, 1200}, + {1591, 1591, 1628, 1744}, + {1932, 1932, 1977, 2093}, + {2273, 2273, 2326, 2558}, + {3409, 3409, 3488, 3953}, + {5682, 5682, 5814, 6512}, + {11818, 11818, 12791, 13721}, + }; + if (craft_list.contains("单面哑膜")) { + prices = new int[][]{ + {1000, 1000, 1050, 1050}, + {1110, 1110, 1110, 1110}, + {1222, 1222, 1550, 1650}, + {1778, 1778, 1778, 1889}, + {2111, 2111, 2111, 2222}, + {2444, 2444, 2444, 2667}, + {3778, 3778, 3778, 4222}, + {6222, 6222, 6222, 6889}, + {13333, 13333, 13778, 15333}, + }; + } + int price_index = 0; + if ((width > 4.0 || length > 6.0) && (length > 4.0 || width > 6.0)) { + price_index = 1; + } + if ((width > 9.0 || length > 5.4) && (length > 9.0 || width > 5.4)) { + price_index = 2; + } + if ((width > 6.0 || length > 7.0) && (length > 6.0 || width > 7.0)) { + price_index = 3; + } + int[] counts = {200, 500, 1000, 2000, 3000, 5000, 10000, 20000, 50000}; + for (int i = 0; i < counts.length; i++) { + int itemCount = counts[i]; + if (count > itemCount) { + continue; + } + if (priceList.size() > 2) { + break; + } + double awards_price = 0; + if (itemCount <= 10000) { + if (awards > 5) { + awards_price = 30 * Math.max((awards - 5), 0); + } + } + Product pro = new Product(); + pro.setCount(itemCount); + pro.setNumber(number); + pro.setPrice(Math.ceil((prices[i][price_index] + awards_price) * number)); + priceList.add(pro); + } + return priceList; + } + private List getWrappingPaper(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/tearingJoy.jsp b/src/main/webapp/views/product/tearingJoy.jsp new file mode 100644 index 0000000..152fbdc --- /dev/null +++ b/src/main/webapp/views/product/tearingJoy.jsp @@ -0,0 +1,352 @@ +<%@ 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" %> + + + +
+
+

撕撕乐

+
+
+ +

+ 材质 +

+
+ +
+

+ 尺寸输入格式: 长 * 宽 +

+
+ +
+

+ 数量 +

+
+ +
+

+ 款数 +

+
+ +
+

+ 奖项 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 印面工艺: + +
+
+ 裁切工艺: + +
+
+ 常见工艺: + +
+
+ 覆膜工艺: + + +
+
+
+
+ + +
+

计算结果- + +

+
+ + <%@include file="../acountExpressFee.jsp" %> +
+
+
+
+
+
+
+ +
+
+ +<%@include file="/views/copyResult.jsp" %> + + \ No newline at end of file diff --git a/src/main/webapp/views/product/wrappingPaper.jsp b/src/main/webapp/views/product/wrappingPaper.jsp index 954bd51..4158e32 100644 --- a/src/main/webapp/views/product/wrappingPaper.jsp +++ b/src/main/webapp/views/product/wrappingPaper.jsp @@ -193,6 +193,23 @@ } } ); + + if (!craft_list.includes("单面")) { + $(data.elem).prop("checked", true); + layer.msg("印面工艺不能取消选择", {offset: ['300px', '300px']}, function () { + }); + form.render(); + return false; + } + + if (!craft_list.includes("直角裁切")) { + $(data.elem).prop("checked", true); + layer.msg("裁切工艺不能取消选择", {offset: ['300px', '300px']}, function () { + }); + form.render(); + return false; + } + const carft1 = carft_list1.filter(craft => craft_list.includes(craft)); if (carft1.length > 1) { $(data.elem).prop("checked", false);