diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 9ab4d68..588289f 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -2375,6 +2375,59 @@ public class ProductService { } } } else if ("UV转印贴".equals(dto.getKind())) { + List craft_list = dto.getCraft() == null ? null : Arrays.asList(dto.getCraft()); + if (dto.getCraft() != null && craft_list.size() > 0 && (craft_list.contains("冷转印") || craft_list.contains("烫画"))) { + int[] quantitySteps = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000}; + double paperLength = 0, paperWidth = 0; + length += 0.6; + width += 0.6; + if (craft_list.contains("冷转印")) { + paperLength = 20; + paperWidth = 27; + } + if (craft_list.contains("烫画")) { + paperLength = 100; + paperWidth = 57; + } + //一张大纸能放几个 + double num = Math.max(Math.ceil(paperLength / length) * Math.ceil(paperWidth / width), Math.ceil(paperLength / width) * Math.ceil(paperWidth / length)); + + + double baseCount = Math.max(Math.ceil(dto.getCount() * dto.getNumber() / num), 1); + int coNumber = dto.getCo_number(); + if (coNumber <= 0) { + coNumber = 1; + } + + double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber); + + Product pro = new Product(); + pro.setCount(dto.getCount()); + pro.setPrice(price); + priceList.add(pro); + for (int i = 0; i < quantitySteps.length; i++) { + if (dto.getCount() >= quantitySteps[i]) { + continue; + } + if (priceList.size() >= 4) { + break; + } + baseCount = Math.max(Math.ceil(quantitySteps[i] * dto.getNumber() / num), 1); + double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber); + + pro = new Product(); + + pro.setCount(quantitySteps[i]); + pro.setPrice(currentPrice); + priceList.add(pro); + } + + for (Product product : priceList) { + product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5)); + } + + return priceList; + } if (length <= 2) { length = 2.0; } @@ -5349,11 +5402,11 @@ public class ProductService { } if (craftList.contains("打码")) { double danjia = 0.0; - // 5000张以上,一张5分 + // 5000张以上,一张10分 if (dto.getCount() > 5000) { - danjia = 0.04; + danjia = 0.1; } else { - danjia = 0.04; + danjia = 0.1; } if ("上下编码".equals(dto.getBianma())) { for (Product product : priceList) { diff --git a/src/main/java/lingtao/net/util/PriceUtils.java b/src/main/java/lingtao/net/util/PriceUtils.java index 0fa8115..3b0455b 100644 --- a/src/main/java/lingtao/net/util/PriceUtils.java +++ b/src/main/java/lingtao/net/util/PriceUtils.java @@ -3439,4 +3439,23 @@ public class PriceUtils { } return price; } + + public double CalculatePrice(List craft_list, double count, int coNumber) { + if (craft_list.contains("烫画")) { + return (int) count * 120; + } + double price = 0; + if (craft_list.contains("冷转印")) { + if (count <= 5) { + price = 260; + } else if (count < 100) { + price = 12 * count + 200; + } else { + price = 14 * count; + } + price = price + (coNumber - 1) * 100; + } + + return price; + } } diff --git a/src/main/webapp/views/main.jsp b/src/main/webapp/views/main.jsp index cdd2783..858e039 100644 --- a/src/main/webapp/views/main.jsp +++ b/src/main/webapp/views/main.jsp @@ -428,9 +428,7 @@
-
【新增】金属标-UV转印贴-添加烫金工艺
-
【新增】卡片-腰封-吸管套-添加250克牛皮纸
-
【调整】不干胶-不干胶-隐藏双面印不干胶选项
+
【新增】不干胶新增划线工艺 客户需要划线工艺的 划线工艺必选
@@ -438,7 +436,8 @@ .swiper-slide { color: orange; display: flex; - font-size: 16px; + font-weight: bold; + font-size: 20px; align-items: center; justify-content: center; } diff --git a/src/main/webapp/views/product/metal.jsp b/src/main/webapp/views/product/metal.jsp index 9639393..7330a67 100644 --- a/src/main/webapp/views/product/metal.jsp +++ b/src/main/webapp/views/product/metal.jsp @@ -9,6 +9,9 @@
@@ -134,6 +137,10 @@

工艺

+
+ +
@@ -163,8 +170,22 @@ class="craftZhuan">
- + + +
@@ -323,6 +344,13 @@ layer.msg('[专金 - 专银]不能同时选择!', {offset: ['300px', '300px']}, {icon: 5}); return false; } + if (data.value == "冷转印") { + if ($(data.elem).is(":checked")) { + $("#sehu_number").show(); + } else { + $("#sehu_number").hide(); + } + } getProductImage() }) @@ -363,16 +391,36 @@ return false; } } else { - if ((size.split("*")[0] > 500 || size.split("*")[1] > 58) && (size.split("*")[0] > 58 || size.split("*")[1] > 500)) { + if (craftShua != "" && craftShua != "烫画" && (size.split("*")[0] > 500 || size.split("*")[1] > 58) && (size.split("*")[0] > 58 || size.split("*")[1] > 500)) { layer.msg("【UV转印贴】尺寸不能超过500*58 cm", {offset: ['300px', '300px']}, function () { }); return false; } - if (craftShua != "" && craftShua != "双面贴" && (size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[0] > 28.5 || size.split("*")[1] > 42)) { + if (craftShua != "" && craftShua == "冷转印" && (size.split("*")[0] > 20 || size.split("*")[1] > 27) && (size.split("*")[0] > 27 || size.split("*")[1] > 20)) { + layer.msg("【UV转印贴】冷转印工艺尺寸不能超过20*27 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } + if (craftShua != "" && craftShua == "烫画" && (size.split("*")[0] > 100 || size.split("*")[1] > 57) && (size.split("*")[0] > 57 || size.split("*")[1] > 100)) { + layer.msg("【UV转印贴】烫画工艺尺寸不能超过100*57 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } + if (craftShua != "" && craftShua != "双面贴" && craftShua != "烫画" && craftShua != "冷转印" && (size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[0] > 28.5 || size.split("*")[1] > 42)) { layer.msg("【UV转印贴】带工艺尺寸不能超过42*28.5 cm", {offset: ['300px', '300px']}, function () { }); return false; } + if (craftShua != "" && craftShua == "冷转印" && (size.split("*")[0] < 0.3 || size.split("*")[1] < 0.3)) { + layer.msg("【UV转印贴】冷转印工艺尺寸不能小于0.3*0.3 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } + if (craftShua != "" && craftShua == "烫画" && (size.split("*")[0] < 0.3 || size.split("*")[1] < 0.3)) { + layer.msg("【UV转印贴】烫画工艺尺寸不能小于0.3*0.3 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } } $.ajax({ url: "${path}/getThanSum", @@ -399,7 +447,12 @@ } } } else { - var span_result = 'UV转印贴 - ' + craftShua + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n'; + if (craftShua.includes("冷转印")) { + let co_count = $("select[name='co_number'] option:selected").val(); + craftShua.push(co_count + "色数"); + } + craftShua = craftShua.filter(item => item !== null && item != ""); + var span_result = 'UV转印贴 - ' + craftShua.join(" - ") + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n'; if (number > 1) { let numberType = $("#desType option:selected").text(); span_result += "款数:" + number + "-" + numberType + "\n";