From b66c025cf8efa459c8c797b96ebefbf19c8b2129 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Wed, 4 Mar 2026 14:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 45 +++++-------------- src/main/webapp/views/product/coupon.jsp | 8 +++- src/main/webapp/views/product/metal.jsp | 2 +- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index f1c7e2e..4b88f6d 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -1642,6 +1642,7 @@ public class ProductService { if (craft_list.contains("双面烫镭射银")) { rate = rate * 1.8; } + dto2 = new Product(); dto2.setCount(count_list[i]); dto2.setPrice(Math.ceil(prices[i] * rate)); @@ -1665,7 +1666,12 @@ public class ProductService { int min = getNum(length, width); for (Product product : priceList) { - product.setPrice(Math.floor(product.getPrice() * number * min)); + 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)); } return priceList; @@ -1726,7 +1732,8 @@ public class ProductService { if (i < count) { continue; } - int num = (int) Math.ceil(i * number / max); +// int num = (int) Math.ceil(i * number / max); + int num = (int) Math.ceil(i / max); // 婚礼卡 price = fixPrice + (num - 1) * zhang + designFee + cutFee; @@ -1751,36 +1758,8 @@ public class ProductService { } //第二款开始的设计费按照式设计内容 - if (number > 1) { - double desFee = 0; - if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) { - if (dto.getP() == 1) { - desFee = 0.6 * (number - 1); - } else { - desFee = 5.5 * (number - 1); - - } - for (Product product : priceList) { - product.setPrice(Math.ceil(product.getPrice() + desFee)); - } - } else { - - if (dto.getP() == 1) { - desFee = 0.6; - } else if (dto.getP() == 2 || dto.getP() == 3) { - desFee = 0.8; - } else if (dto.getP() == 4) { - desFee = 1.2; - } else if (dto.getP() == 5) { - desFee = 2; - } else { - desFee = 5; - } - for (Product product : priceList) { - product.setPrice(Math.floor(product.getPrice() + desFee * (number - 1))); - } - } - + for (Product product : priceList) { + product.setPrice(Math.ceil(product.getPrice() * number)); } return priceList; } else { @@ -7162,7 +7141,7 @@ public class ProductService { double price = 0; for (int i = 0; i < bigCountArr.length; i++) { if (product.getCount() >= bigCountArr[i]) { - price = productPrice + basePrice[i]; + price = productPrice + basePrice[i] * number; } } product.setPrice(Math.max(price, productPrice)); diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 6ad55c6..a4c770e 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -1424,7 +1424,7 @@ $("#z4_craft").find(":input").attr("disabled", true); $("#peijian_ui .scolor").hide(); $("#peijian_ui").find(":input").attr("disabled", true); - if (data.value == 2) { + if (data.value == 2 && couponKind != "少数量") { $("#peijian_ui form")[0].reset(); $("#peijian_ui").show(); $("#peijian_ui input").attr("disabled", false); @@ -3157,7 +3157,11 @@ return; } if ($(this).val() === '配尼龙绳' || $(this).val() === '穿尼龙绳') { - arr.push($(this).val() + "-" + $("select[name='shen_color'] option:selected").val()) + let shenColor = $("select[name='shen_color'] option:selected").val(); + if (couponKind == "少数量") { + shenColor = $("#lesspeijian select[name='shen_color'] option:selected").val(); + } + arr.push($(this).val() + "-" + shenColor) return; } if ($(this).val() === '流苏') { diff --git a/src/main/webapp/views/product/metal.jsp b/src/main/webapp/views/product/metal.jsp index d3b629d..53c357f 100644 --- a/src/main/webapp/views/product/metal.jsp +++ b/src/main/webapp/views/product/metal.jsp @@ -407,7 +407,7 @@ if (craftZhuan > most) { $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox"); $(data.elem).prop("checked", false); - layer.msg('[专金 - 专银]不能同时选择!', {offset: ['300px', '300px']}, {icon: 5}); + layer.msg('其他工艺不能同时选择!', {offset: ['300px', '300px']}, {icon: 5}); return false; } if (craft_list.indexOf("烫金") > -1) {