diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index ca80e43..a16fdbd 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4463,12 +4463,68 @@ public class ProductService { case "防油纸袋": priceList = getOilProofPaperPrice(dto, width, length, height); return chucklePrice(role, priceList, dto); + case "扑克牌": + priceList = getPegSolitairePrice(dto, width, length, height); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getPegSolitairePrice(Product dto, Double width, Double length, Double height) { + 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 = {1, 10, 50, 100, 200, 300, 400}; + double[][] prices_area = { + {180, 180, 380, 570, 990, 1590, 2020}, + {180, 180, 380, 570, 990, 1590, 2020} + }; + int currentIndex = 0; + if ("黑芯310克".equals(dto.getKind())) { + currentIndex = 1; + } + if ("合版".equals(dto.getKind2Value())) { + counts = new int[]{100, 200, 500, 1000, 2000, 5000, 10000, 20000, 30000, 50000, 100000}; + prices_area = new double[][]{ + {1370, 1600, 2350, 3620, 5990, 12450, 22940, 43810, 63290, 102330, 193850}, + {1550, 1830, 2690, 4150, 7020, 14700, 26860, 51430, 74540, 120940, 230770} + }; + if (dto.isSwitchSize()) { + if ("34.6*33.8".equals(dto.getSize1())) { + prices_area = new double[][]{ + {2550, 2770, 3550, 4920, 7580, 14860, 26640, 50330, 72250, 116490, 221030}, + {2620, 2870, 3710, 5180, 8080, 15980, 28520, 53890, 77360, 124730, 236650} + }; + } + if ("22.6*21.6".equals(dto.getSize1())) { + prices_area = new double[][]{ + {2570, 2810, 3650, 5110, 8000, 16050, 29090, 54960, 78900, 127220, 241370}, + {2640, 2910, 3810, 5370, 8500, 17180, 30980, 58530, 84020, 135470, 257030} + }; + } + if ("31.2*17.1".equals(dto.getSize1())) { + prices_area = new double[][]{ + {2570, 2800, 3630, 5080, 7900, 15690, 28510, 53860, 77310, 124660, 236520}, + {2640, 2900, 3700, 3660, 5150, 16810, 30390, 57420, 82430, 132910, 252180} + }; + } + } + } + + double price = new PriceUtils().TableCountCenterPrice(count, prices_area[currentIndex], counts); + double design_price = 0; + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.max(Math.ceil(price), 0) * number + design_price); + priceList.add(pro); + return priceList; + } + private List getOilProofPaperPrice(Product dto, Double width, Double length, Double height) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); diff --git a/src/main/webapp/views/product/pegSolitaire.jsp b/src/main/webapp/views/product/pegSolitaire.jsp new file mode 100644 index 0000000..5d4e465 --- /dev/null +++ b/src/main/webapp/views/product/pegSolitaire.jsp @@ -0,0 +1,408 @@ +<%@ 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/厘米) +

+
+ +
+

+ 牌盒子尺寸(CM/厘米) +

+
+ +
+ +
+
+

+ 数量(个) +

+
+ +
+
+
+

+ 自定义数量 +

+
+ +
+
+
+

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 印面: + +
+
+ 裁切: + +
+
+
+ + +
+
+
+ + +
+

计算结果- + +

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