From 6352b8eab0d50203922157e9b5f57292af31db16 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Thu, 5 Mar 2026 10:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B4=A0=E4=BA=91=E6=9D=90?= =?UTF-8?q?=E8=B4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 209 +++++++++++------- .../webapp/views/product/specialCard2.jsp | 67 +++++- 2 files changed, 194 insertions(+), 82 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 4b88f6d..a80c724 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -1601,79 +1601,135 @@ public class ProductService { } else if ("素芸".equals(kind)) { int[] count_list = {100, 200, 400, 500, 1000, 2000, 3000, 5000, 10000}; double[] prices = {}; - prices = new double[]{144, 272, 528, 660, 1280, 2560, 3840, 6400, 12800}; + if ("500克".equals(dto.getKind())) { - if (craft_list.contains("击凸") || craft_list.contains("压凹") || (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { - prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; - } - if (craft_list.contains("圆角")) { - prices = new double[]{146, 276, 536, 670, 1300, 2600, 3900, 6500, 13000}; - } - if (craft_list.contains("圆角") && (craft_list.contains("击凸") || craft_list.contains("压凹"))) { - prices = new double[]{216, 366, 666, 820, 1550, 3100, 4600, 7800, 15500}; - } - if (craft_list.contains("圆角") && (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { - prices = new double[]{216, 366, 666, 820, 1550, 3100, 4600, 7800, 15500}; - } - if (craft_list.contains("异形模切") && (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { - prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; - } - if (craft_list.contains("异形模切") && (craft_list.contains("击凸") || craft_list.contains("压凹"))) { - prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; - } + prices = new double[]{144, 272, 528, 660, 1280, 2560, 3840, 6400, 12800}; - priceList = new ArrayList<>(); - Product dto2 = null; - - for (int i = 0; i < count_list.length; i++) { - double rate = 1.0; - if (count_list[i] < count) { - continue; + if (craft_list.contains("击凸") || craft_list.contains("压凹") || (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { + prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; } - if (priceList.size() > 2) { - break; + if (craft_list.contains("圆角")) { + prices = new double[]{146, 276, 536, 670, 1300, 2600, 3900, 6500, 13000}; } - if (count_list[i] >= 400) { - rate = 0.8; + if (craft_list.contains("圆角") && (craft_list.contains("击凸") || craft_list.contains("压凹"))) { + prices = new double[]{216, 366, 666, 820, 1550, 3100, 4600, 7800, 15500}; } - if (craft_list.contains("双面烫金")) { - rate = rate * 1.8; + if (craft_list.contains("圆角") && (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { + prices = new double[]{216, 366, 666, 820, 1550, 3100, 4600, 7800, 15500}; } - if (craft_list.contains("双面烫镭射银")) { - rate = rate * 1.8; + if (craft_list.contains("异形模切") && (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { + prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; + } + if (craft_list.contains("异形模切") && (craft_list.contains("击凸") || craft_list.contains("压凹"))) { + prices = new double[]{214, 362, 658, 810, 1530, 3060, 4590, 7650, 15300}; } - dto2 = new Product(); - dto2.setCount(count_list[i]); - dto2.setPrice(Math.ceil(prices[i] * rate)); - priceList.add(dto2); - } - if (craft_list.contains("打码")) { - double danjia = 0.0; - if (dto.getMaxian() == 1) { - danjia = 0.8; - } - if (dto.getMaxian() == 2) { - danjia = 1.6; - } - if (dto.getMaxian() == 3) { - danjia = 2.4; + priceList = new ArrayList<>(); + Product dto2 = null; + + for (int i = 0; i < count_list.length; i++) { + double rate = 1.0; + if (count_list[i] < count) { + continue; + } + if (priceList.size() > 2) { + break; + } + if (count_list[i] >= 400) { + rate = 0.8; + } + if (craft_list.contains("双面烫金")) { + rate = rate * 1.8; + } + if (craft_list.contains("双面烫镭射银")) { + rate = rate * 1.8; + } + + dto2 = new Product(); + dto2.setCount(count_list[i]); + dto2.setPrice(Math.ceil(prices[i] * rate)); + priceList.add(dto2); } + + + int min = getNum(length, width); for (Product product : priceList) { - product.setPrice(Math.ceil(product.getPrice() + product.getCount() * danjia)); + double mqPrice = 0; + + if (craft_list.contains("异形模切") && !(craft_list.contains("击凸") || craft_list.contains("压凹") || (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银")))) { + mqPrice = Math.ceil(15 * 0.01 * product.getCount() + 50); + } + product.setPrice(Math.floor(product.getPrice() * number * min + mqPrice)); + product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.5)); } } - int min = getNum(length, width); - for (Product product : priceList) { - double mqPrice = 0; + if ("300克".equals(dto.getKind())) { + + prices = new double[]{70, 140, 280, 350, 700, 1400, 2100, 3500, 7000}; + if ((width <= 9 && length <= 5.4) || (length <= 9 && width <= 5.4)) { + + } else if (width < 10 && length < 10) { + + prices = new double[]{128, 256, 512, 640, 1280, 2560, 3840, 6400, 12800}; + + } else { + + prices = new double[]{185, 370, 740, 925, 1850, 3700, 5550, 9250, 18500}; - if (craft_list.contains("异形模切") && !(craft_list.contains("击凸") || craft_list.contains("压凹") || (craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银")))) { - mqPrice = Math.ceil(15 * 0.01 * product.getCount() + 50); } - product.setPrice(Math.floor(product.getPrice() * number * min + mqPrice)); - product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.5)); + + priceList = new ArrayList<>(); + Product dto2 = null; + + for (int i = 0; i < count_list.length; i++) { + int itemCount = count_list[i]; + if (count_list[i] < count) { + continue; + } + if (priceList.size() > 2) { + break; + } + double craft_price = 0; + if (craft_list.contains("圆角")) { + craft_price += 4 * itemCount; + } + if ((craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) { + double tangPrice = 45 + 0.1 * itemCount; + if (craft_list.contains("双面烫金") || craft_list.contains("双面烫镭射银")) { + tangPrice = 45 * 2; + } + craft_price += tangPrice; + } + + if (craft_list.contains("异形模切")) { + craft_price += 60 + 0.1 * itemCount; + } + + if (craft_list.contains("击凸") || craft_list.contains("压凹")) { + craft_price += 52 + 0.1 * itemCount; + } + + if (craft_list.contains("打码")) { + double danjia = 0.0; + if (dto.getMaxian() == 1) { + danjia = 0.8; + } + if (dto.getMaxian() == 2) { + danjia = 1.6; + } + if (dto.getMaxian() == 3) { + danjia = 2.4; + } + craft_price += danjia * itemCount; + } + dto2 = new Product(); + dto2.setCount(count_list[i]); + dto2.setPrice(Math.ceil(prices[i] + craft_price)); + priceList.add(dto2); + } } + return priceList; } else if ("草香".equals(kind) || "芳怡".equals(kind)) { int[] count_list = {200, 500, 1000, 2000, 5000, 10000}; @@ -3841,7 +3897,7 @@ public class ProductService { } // 根据款数重新算价格 for (Product product : priceList) { - product.setWeight(df.format(0.38 * 0.0855 * 1.3 * 0.054 * product.getCount() * number)); + product.setWeight(df.format(0.38 * 0.0855 * 1.7 * 0.054 * product.getCount() * number)); product.setPrice(Math.floor(product.getPrice() * number)); } return priceList; @@ -3862,7 +3918,7 @@ public class ProductService { } else { wei = 0.84; } - product.setWeight(df.format(wei * length * width * product.getCount() / 10000 * 1.3 * number)); + product.setWeight(df.format(wei * length * width * product.getCount() / 10000 * 1.7 * number)); } return priceList; // 0.38PVC亮光异型卡片 @@ -3895,7 +3951,7 @@ public class ProductService { } product.setPrice(Math.floor(product.getPrice() * base * number)); - product.setWeight(df.format(wei * length * width * 1.3 * product.getCount() / 10000 * number)); + product.setWeight(df.format(wei * length * width * 1.7 * product.getCount() / 10000 * number)); } if (priceList.size() >= 4) { priceList = priceList.subList(0, 4); @@ -5583,22 +5639,27 @@ public class ProductService { if (carft_list.contains("UV印刷")) { int pre_count = 0; double miniprice = 400; - double mo_price = 250; - double base_price = 4.5; - if (width <= 4 && length <= 4) { - base_price = 4; - } - if (width > 6 || length > 6) { - base_price = 5.5; + double mo_price = 300; + double base_price = 3.5; + if (width <= 3 && length <= 3) { + + } else if (width <= 4 && length <= 4) { mo_price = 300; + base_price = 4; + } else if (width <= 5 && length <= 5) { + mo_price = 320; + base_price = 5; + } else if (width <= 6 && length <= 6) { + mo_price = 340; + base_price = 6; + } else if (width <= 7 && length <= 7) { + mo_price = 380; + base_price = 6.5; + } else if (width <= 8 && length <= 8) { + mo_price = 420; + base_price = 7; } - if (base_price < 4.5) { - if (count > 100 && count <= 500) { - base_price = 3.5; - } else if (count > 500) { - base_price = 3; - } - } + Product pro = new Product(); pro.setCount(count); pro.setWeight(df.format(0.005 * count * dto.getNumber())); diff --git a/src/main/webapp/views/product/specialCard2.jsp b/src/main/webapp/views/product/specialCard2.jsp index 797e231..0e23101 100644 --- a/src/main/webapp/views/product/specialCard2.jsp +++ b/src/main/webapp/views/product/specialCard2.jsp @@ -59,6 +59,13 @@ +
尺寸(CM/厘米) 输入格式: 长 * 宽
@@ -369,6 +376,8 @@ $("#mianka input").attr("disabled", true); $("#craft_layout").show() $("#craft_layout input").attr("disabled", false); + $(".suyun").hide(); + $(".suyun").find(":input").attr("disabled", true); if (data.value.length <= 4) { $("#noCraft").show(); $("#hasCraft").hide(); @@ -495,6 +504,8 @@ $("#hasCraft").find(":input").attr("disabled", true); $("#ui_ls_count").hide() $("#ui_ls_count").find(":input").attr("disabled", true); + $(".suyun").show(); + $(".suyun").find(":input").attr("disabled", false); } $("#baimo").find(":input").attr("disabled", true); $("#baimo").hide(); @@ -504,10 +515,31 @@ } form.render(); }) + + form.on("radio(kindSelect)", function (data) { + let colorHtml = ` + + + + + `; + $("input[name='craft'][value='压凹']").prop("checked", false); + $("#color_type").hide(); + $("#color_type").find("select").attr("disabled", true); + if (data.value == "300克") { + colorHtml = ``; + } + + $("#ccolor_type select[name='craft']").empty(); + $("#ccolor_type select[name='craft']").append(colorHtml); + form.render(); + }) + form.on("checkbox(mianka)", function (data) { let craft_list = []; let size = $(".sizeSpecialCard").val(); let kindValueSelect = $(".kindValueSelect option:checked").text(); + let kindValue = $("input[name='kind']:checked").val(); if (kindValueSelect != "500克拉丝闪银卡" && kindValueSelect != "500克拉丝闪金卡" && kindValueSelect != '素芸') { } else { @@ -567,7 +599,13 @@ return false; } } - + // if (kindValue == "300克" && craft_list.indexOf("压凹") > -1) { + // $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox"); + // $(data.elem).prop("checked", false); + // layer.msg("素芸300克无法选择压凹工艺", {offset: ['300px', '300px']}, function () { + // }); + // return false; + // } if (craft_list.indexOf("击凸") > -1 || craft_list.indexOf("压凹") > -1) { if (craft_list.indexOf("击凸") > -1) { $("#color_type select").empty().append(` @@ -599,7 +637,6 @@ $("#leishe_type").hide(); $("#leishe_type").find("select").attr("disabled", true); } - console.log(craft_list) form.render(); }) // 监听工艺 @@ -755,6 +792,7 @@ } // 特种纸名片材料 var kindValueSelect = $(".kindValueSelect option:checked").text(); + let kindValue = $("input[name='kind']:checked").val(); var size = $(".sizeSpecialCard").val(); var number = $("#number").val(); if (kindValueSelect != "500克拉丝闪银卡" && kindValueSelect != "500克拉丝闪金卡" && kindValueSelect != '素芸') { @@ -770,7 +808,7 @@ size = $("input[name='size']").val(); } if ((size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[0] > 28.5 || size.split("*")[1] > 42)) { - layer.msg("【特种纸名片-素芸】尺寸不能大于42*28.5 cm", {offset: ['300px', '300px']}, function () { + layer.msg("【特种纸名片】尺寸不能大于42*28.5 cm", {offset: ['300px', '300px']}, function () { }); return false; } @@ -780,10 +818,19 @@ }); return false; } - if ((size.split("*")[0] > 21 || size.split("*")[1] > 15) && (size.split("*")[0] > 15 || size.split("*")[1] > 21)) { - layer.msg("【特种纸名片-素芸】尺寸不能大于21*15 cm", {offset: ['300px', '300px']}, function () { - }); - return false; + if (kindValue == '500克') { + if ((size.split("*")[0] > 21 || size.split("*")[1] > 15) && (size.split("*")[0] > 15 || size.split("*")[1] > 21)) { + layer.msg("【特种纸名片-500克素芸】尺寸不能大于21*15 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } + } + if (kindValue == '300克') { + if ((size.split("*")[0] > 10 || size.split("*")[1] > 15) && (size.split("*")[0] > 15 || size.split("*")[1] > 10)) { + layer.msg("【特种纸名片-300克素芸】尺寸不能大于10*15 cm", {offset: ['300px', '300px']}, function () { + }); + return false; + } } } var arr = [] @@ -859,7 +906,11 @@ } var data = result.data.proList; arr = arrs; - var span_result = '特种纸名片(不配绳子)' + "-不覆膜-" + kindValueSelect + "-" + size + let kindValueSelectText = kindValueSelect; + if (kindValueSelectText == "素芸") { + kindValueSelectText = kindValue + kindValueSelectText; + } + var span_result = '特种纸名片' + "-" + kindValueSelectText + "-" + size + "厘米-(同款内容) \n" + "工艺 :" + arr + "\n" if (number > 1) { if (window.parent.system_isPdd) {