diff --git a/src/main/java/lingtao/net/controller/ProductController.java b/src/main/java/lingtao/net/controller/ProductController.java index 742a8af..dba3822 100644 --- a/src/main/java/lingtao/net/controller/ProductController.java +++ b/src/main/java/lingtao/net/controller/ProductController.java @@ -103,7 +103,9 @@ public class ProductController { product.setRole(user.getRole()); if ("菜单".equals(product.getProTypeLabel())) { - product.setSize(product.getSize1().replace(",", "")); + if (product.getSize1() != null) { + product.setSize(product.getSize1().replace(",", "")); + } String s = request.getParameter("kindValue5"); product.setKind1Value(s); product.setSize(request.getParameter("ui_menu_size")); diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 19f2fe2..7a0d824 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4623,70 +4623,140 @@ public class ProductService { } return priceList; case "透卡": - return getPETPrice(dto, width, length); case "澜达海报": - //铜版纸200g (售价) - prices = new int[][]{ - {90, 90, 90, 90, 90, 94, 94, 94, 94}, - {100, 100, 100, 100, 100, 187, 187, 187, 187}, - {140, 140, 140, 140, 140, 280, 280, 280, 280}, - {187, 187, 187, 187, 187, 374, 374, 374, 374}, - {234, 234, 234, 234, 234, 467, 467, 467, 467}, - {467, 467, 467, 467, 467, 934, 934, 934, 934}, - {934, 934, 934, 934, 934, 1867, 1867, 1867, 1867}, - {2334, 2334, 2334, 2334, 2334, 4667, 4667, 4667, 4667}, - {4667, 4667, 4667, 4667, 4667, 9334, 9334, 9334, 9334}, - {9334, 9334, 9334, 9334, 9334, 18667, 18667, 18667, 18667}, - {23334, 23334, 23334, 23334, 23334, 46667, 46667, 46667, 46667}, - }; - if ("2".equals(dto.getKind())) { - prices = new int[][]{ - {90, 90, 90, 90, 90, 107, 107, 107, 107}, - {100, 107, 107, 107, 107, 213, 213, 213, 213}, - {120, 160, 160, 160, 160, 320, 320, 320, 320}, - {150, 213, 213, 213, 213, 427, 427, 427, 427}, - {139, 267, 267, 267, 267, 533, 533, 533, 533}, - {267, 533, 533, 533, 533, 1067, 1067, 1067, 1067}, - {533, 1067, 1067, 1067, 1067, 2133, 2133, 2133, 2133}, - {1333, 2667, 2667, 2667, 2667, 5333, 5333, 5333, 5333}, - {2667, 5333, 5333, 5333, 5333, 10667, 10667, 10667, 10667}, - {5333, 10667, 10667, 10667, 10667, 21333, 21333, 21333, 21333}, - {13333, 26667, 26667, 26667, 26667, 53333, 53333, 53333, 53333}, - }; - } - if ("3".equals(dto.getKind())) { - prices = new int[][]{ - {90, 90, 90, 90, 90, 150, 150, 150, 150}, - {100, 140, 140, 150, 150, 300, 300, 300, 300}, - {110, 207, 207, 223, 223, 447, 447, 447, 447}, - {140, 277, 277, 300, 300, 597, 597, 597, 597}, - {180, 347, 347, 373, 373, 747, 747, 747, 747}, - {347, 693, 693, 747, 747, 1493, 1493, 1493, 1493}, - {693, 1387, 1387, 1493, 1493, 2987, 2987, 2987, 2987}, - {1733, 3467, 3467, 3733, 3733, 7467, 7467, 7467, 7467}, - {3467, 6933, 6933, 7467, 7467, 14933, 14933, 14933, 14933}, - {6933, 13867, 13867, 14933, 14933, 29867, 29867, 29867, 29867}, - {17333, 34667, 34667, 37333, 37333, 74667, 74667, 74667, 74667}, - }; - } - count_list = new int[]{10, 20, 30, 40, 50, 100, 200, 500, 1000, 2000, 5000}; - areas = new double[]{1197, 1716, 2394, 2596, 3430, 3467.1, 4788, 5192, 6860}; - area = length * width; - - return getAreaCenterPrice(count_list, count, area, prices, areas, number); + return getDalanPrice(dto, width, length); case "水标": return getShuibiaoPrice(dto, length, width); case "镭射吊牌": return getLeiseDiaoPrice(dto, length, width); case "刻字车贴": return getCheTiePrice(dto, length, width); + case "胶带": + return getJiadaoPrice(dto, length, width); default: break; } return null; } + private List getDalanPrice(Product dto, Double width, Double length) { + //铜版纸200g (售价) + int[][] prices = new int[][]{ + {90, 90, 90, 90, 90, 94, 94, 94, 94}, + {100, 100, 100, 100, 100, 187, 187, 187, 187}, + {140, 140, 140, 140, 140, 280, 280, 280, 280}, + {187, 187, 187, 187, 187, 374, 374, 374, 374}, + {234, 234, 234, 234, 234, 467, 467, 467, 467}, + {467, 467, 467, 467, 467, 934, 934, 934, 934}, + {934, 934, 934, 934, 934, 1867, 1867, 1867, 1867}, + {2334, 2334, 2334, 2334, 2334, 4667, 4667, 4667, 4667}, + {4667, 4667, 4667, 4667, 4667, 9334, 9334, 9334, 9334}, + {9334, 9334, 9334, 9334, 9334, 18667, 18667, 18667, 18667}, + {23334, 23334, 23334, 23334, 23334, 46667, 46667, 46667, 46667}, + }; + if ("2".equals(dto.getKind())) { + prices = new int[][]{ + {90, 90, 90, 90, 90, 107, 107, 107, 107}, + {100, 107, 107, 107, 107, 213, 213, 213, 213}, + {120, 160, 160, 160, 160, 320, 320, 320, 320}, + {150, 213, 213, 213, 213, 427, 427, 427, 427}, + {139, 267, 267, 267, 267, 533, 533, 533, 533}, + {267, 533, 533, 533, 533, 1067, 1067, 1067, 1067}, + {533, 1067, 1067, 1067, 1067, 2133, 2133, 2133, 2133}, + {1333, 2667, 2667, 2667, 2667, 5333, 5333, 5333, 5333}, + {2667, 5333, 5333, 5333, 5333, 10667, 10667, 10667, 10667}, + {5333, 10667, 10667, 10667, 10667, 21333, 21333, 21333, 21333}, + {13333, 26667, 26667, 26667, 26667, 53333, 53333, 53333, 53333}, + }; + } + if ("3".equals(dto.getKind())) { + prices = new int[][]{ + {90, 90, 90, 90, 90, 150, 150, 150, 150}, + {100, 140, 140, 150, 150, 300, 300, 300, 300}, + {110, 207, 207, 223, 223, 447, 447, 447, 447}, + {140, 277, 277, 300, 300, 597, 597, 597, 597}, + {180, 347, 347, 373, 373, 747, 747, 747, 747}, + {347, 693, 693, 747, 747, 1493, 1493, 1493, 1493}, + {693, 1387, 1387, 1493, 1493, 2987, 2987, 2987, 2987}, + {1733, 3467, 3467, 3733, 3733, 7467, 7467, 7467, 7467}, + {3467, 6933, 6933, 7467, 7467, 14933, 14933, 14933, 14933}, + {6933, 13867, 13867, 14933, 14933, 29867, 29867, 29867, 29867}, + {17333, 34667, 34667, 37333, 37333, 74667, 74667, 74667, 74667}, + }; + } + int[] count_list = new int[]{10, 20, 30, 40, 50, 100, 200, 500, 1000, 2000, 5000}; + double[] areas = new double[]{1197, 1716, 2394, 2596, 3430, 3467.1, 4788, 5192, 6860}; + double area = length * width; + + return getAreaCenterPrice(count_list, dto.getCount(), area, prices, areas, dto.getNumber()); + } + + private List getJiadaoPrice(Product dto, Double length, Double width) { + double[][] prices = { + {90, 148, 240, 550}, + {100, 160, 250, 550}, + {110, 175, 258, 550}, + {120, 180, 266, 595}, + {130, 203, 290, 648}, + }; + int[] count_list = new int[]{12, 20, 40, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000}; + double[] lengths = {1.2, 1.5, 1.8, 2, 2.4}; + if ("2".equals(dto.getKind())) { + prices = new double[][]{ + {110, 236, 290, 587}, + {119, 240, 298, 587}, + {125, 240, 308, 587}, + {137, 240, 316, 630}, + {146, 254, 340, 681}, + }; + } + if ("3".equals(dto.getKind())) { + prices = new double[][]{ + {91, 158, 210, 234, 514}, + {91, 158, 210, 234, 514}, + {100, 168, 230, 242, 542}, + {100, 168, 230, 251, 550}, + {110, 175, 250, 275, 564}, + }; + count_list = new int[]{12, 20, 30, 40, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000}; + } + List list = new ArrayList<>(); + double last_price = 0; + int last_count = 0; + int current_int = Arrays.binarySearch(lengths, length); + double[] prices_list = prices[current_int]; + List carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + double craft_price = 0; + if (carftList.contains("切割机")) { + craft_price = Math.ceil(dto.getStickNum() * 15); + } + for (int i = 0; i < count_list.length; i++) { + double price = 0; + + int item_count = count_list[i]; + if (i < prices_list.length) { + price = last_price = prices_list[i]; + last_count = item_count; + } else { + price = last_price * Math.ceil(1.0 * item_count / last_count); + } + + if (item_count < dto.getCount()) { + continue; + } + if (list.size() > 2) { + break; + } + Product pro = new Product(); + pro.setCount(item_count); + pro.setPrice(Math.ceil(price * dto.getNumber() + craft_price)); + list.add(pro); + } + + return list; + } + private List getOtherHekaPrice(Product dto, double length, double width) { int[][] prices = { {79, 79, 79, 79, 79, 79, 79, 79, 79, 91, 92, 92, 95, 96, 135, 139, 152, 186, 340, 345, 435, 450}, diff --git a/src/main/webapp/views/product/tape.jsp b/src/main/webapp/views/product/tape.jsp new file mode 100644 index 0000000..aa5fcbf --- /dev/null +++ b/src/main/webapp/views/product/tape.jsp @@ -0,0 +1,388 @@ +<%@ 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/厘米)长度固定100米 +

+
+ +
+

+ 数量(卷) +

+
+ +
+

+ 颜色 +

+
+ +
+

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 配件: + + +
+
+
+
+ + +
+

计算结果- + +

+
+ + <%@include file="../acountExpressFee.jsp" %> +
+
+
+
+
+
+
+ +
+
+ +<%@include file="/views/copyResult.jsp" %> + + \ No newline at end of file