From 0701c0c60da55207bd60cac63c244a7e09081e34 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Mon, 13 Jul 2026 09:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=8D=E5=AD=90=E7=BA=B8?= =?UTF-8?q?=E6=9D=90=E8=B4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 143 ++++++++++-------- src/main/webapp/views/product/coupon.jsp | 106 ++++++++++++- 2 files changed, 182 insertions(+), 67 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 6769967..f6e0793 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -2766,73 +2766,98 @@ public class ProductService { int av_count = count; double unitPrice = 0; - if (count <= 50) { - unitPrice = 140; - } else if (count > 50 && count <= 100) { - unitPrice = 130; - } else if (count > 100 && count <= 200) { - unitPrice = 120; - } else if (count > 200 && count <= 500) { - unitPrice = 110; - } else if (count > 500 && count <= 1000) { - unitPrice = 100; - } else if (count > 1000 && count <= 2000) { - unitPrice = 95; - } else { - unitPrice = 90; - } - if ("4".equals(dto.getZ3type())) { + double price = 0; + if ("5".equals(dto.getZ3type())) { if (count <= 50) { - unitPrice = 160; + unitPrice = 4.4; + unitPrice = new PriceUtils().calcByTargetN(50, 4.4, 50, 4.4, count); } else if (count > 50 && count <= 100) { - unitPrice = 155; + unitPrice = 4.32; + unitPrice = new PriceUtils().calcByTargetN(50, 4.4, 100, 4.32, count); } else if (count > 100 && count <= 200) { - unitPrice = 150; - } else if (count > 200 && count <= 500) { - unitPrice = 145; - } else if (count > 500 && count <= 1000) { - unitPrice = 140; - } else if (count > 1000 && count <= 2000) { - unitPrice = 135; + unitPrice = 4.28; + unitPrice = new PriceUtils().calcByTargetN(100, 4.32, 200, 4.28, count); + } else if (count > 200 && count <= 1339) { + unitPrice = 4.26; + unitPrice = new PriceUtils().calcByTargetN(200, 4.28, 1339, 4.26, count); + } else if (count > 1339 && count <= 5021) { + unitPrice = 3.8; + unitPrice = new PriceUtils().calcByTargetN(1339, 4.26, 5021, 3.8, count); } else { + unitPrice = 3.2 * count; + } + price = Math.max(Math.ceil(unitPrice), 50) * number; + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) { + price += Math.ceil(Math.max(count * 0.3 * number, 5)); + } + } else { + + if (count <= 50) { + unitPrice = 140; + } else if (count > 50 && count <= 100) { unitPrice = 130; + } else if (count > 100 && count <= 200) { + unitPrice = 120; + } else if (count > 200 && count <= 500) { + unitPrice = 110; + } else if (count > 500 && count <= 1000) { + unitPrice = 100; + } else if (count > 1000 && count <= 2000) { + unitPrice = 95; + } else { + unitPrice = 90; + } + if ("4".equals(dto.getZ3type())) { + if (count <= 50) { + unitPrice = 160; + } else if (count > 50 && count <= 100) { + unitPrice = 155; + } else if (count > 100 && count <= 200) { + unitPrice = 150; + } else if (count > 200 && count <= 500) { + unitPrice = 145; + } else if (count > 500 && count <= 1000) { + unitPrice = 140; + } else if (count > 1000 && count <= 2000) { + unitPrice = 135; + } else { + unitPrice = 130; + } + } + price = Math.ceil((length * width * count * unitPrice) / 10000);//价格计算尺寸*数量*200/10000 + + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("编码")) {//起步价10 + price += Math.max(count * 0.5, 10); + } + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("打孔")) { + price += Math.max(count * 0.2, 10); + } + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("手撕线")) { + price += Math.max(count * 0.2, 10); + } + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("压痕")) { + price += Math.max(count * 0.2, 10); + } + + price = price * number;//款数翻倍 + price = Math.max(price, 50); + + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) { + price += Math.ceil(Math.max(count * 0.15 * number, 5)); + } + + craft_list = crafts != null ? Arrays.asList(crafts) : new ArrayList<>(); + if (craft_list.size() > 0 && craft_list.contains("绳子")) { + price += Math.max(5, Math.ceil(0.1 * number * count)); + } + if (craft_list.size() > 0 && craft_list.contains("葫芦针")) { + price += Math.max(Math.ceil(0.04 * number * count), 5); + } + if (craft_list.size() > 0 && craft_list.contains("棉绳")) { + price += Math.max(Math.ceil(0.1 * number * count), 5); } } - double price = Math.ceil((length * width * count * unitPrice) / 10000);//价格计算尺寸*数量*200/10000 - if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("编码")) {//起步价10 - price += Math.max(count * 0.5, 10); - } - if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("打孔")) { - price += Math.max(count * 0.2, 10); - } - if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("手撕线")) { - price += Math.max(count * 0.2, 10); - } - if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("压痕")) { - price += Math.max(count * 0.2, 10); - } - - price = price * number;//款数翻倍 - price = Math.max(price, 50); - - if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) { - price += Math.ceil(Math.max(count * 0.15 * number, 5)); - } - -// if ("4".equals(dto.getZ3type())) { -// price += 100; -// } - craft_list = crafts != null ? Arrays.asList(crafts) : new ArrayList<>(); - if (craft_list.size() > 0 && craft_list.contains("绳子")) { - price += Math.max(5, Math.ceil(0.1 * number * count)); - } - if (craft_list.size() > 0 && craft_list.contains("葫芦针")) { - price += Math.max(Math.ceil(0.04 * number * count), 5); - } - if (craft_list.size() > 0 && craft_list.contains("棉绳")) { - price += Math.max(Math.ceil(0.1 * number * count), 5); - } Product dto2 = new Product(); dto2.setCount(av_count); dto2.setWeight(df.format(number * (length / 100) * (width / 100) * av_count * 0.3 * 0.86)); diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index a693214..03df172 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -169,8 +169,15 @@ + +

材质

+
+ +
@@ -238,6 +245,11 @@
+ - -
覆膜工艺: @@ -1103,6 +1134,13 @@ if (craftValue != '') { data.craftValue = craftValue; } + if (kind == "种子纸") { + let z3type = $("input[name='z3type']:checked").val() + data.kind2Value = 400 + if(z3type == 5){ + data.kind2Value = 1000 + } + } $("#carousel").empty(); $("#remark").empty(); $.ajax({ @@ -1189,22 +1227,31 @@ $(".z3_craft_yh").show(); $(".z3_craft_bm").show(); $(".z3_craft_mq").show(); + $(".z3_craft_peiother").show(); + $(".z3_craft_shengz").show(); $("#3z_menpiao_size").hide(); $("#3z_kapian_size").hide(); $("#3z_yuan_size").hide(); $("#3z_chuang_size").hide(); + $("#3z_jiangpai_size").hide(); $(".z3_craft_ssx").hide(); + $(".scolor").hide(); + $(".scolor select").attr("disabled", true) + $(".gscolor").hide(); + $(".gscolor select").attr("disabled", true) $(".z3_craft_yh").hide(); $("#3z_menpiao_size select").attr("disabled", true) $("#3z_kapian_size select").attr("disabled", true) $("#3z_yuan_size select").attr("disabled", true) $("#3z_chuang_size select").attr("disabled", true) + $("#3z_jiangpai_size select").attr("disabled", true) $(".z3_craft input[name='craft']").prop("checked", false); $(".z3_craft input[name='craft']").prop("disabled", false); $("#3z_size").show(); $("#size").val($('select[name="z3size1"]:not(:disabled) option:checked').val());//尺寸重新赋值 $(".qt").hide() $("#3zValueForm").show(); + let html = ``; if (val == 0) { let menpiao_size = $("#3z_menpiao_size select option:selected").val(); @@ -1268,6 +1315,28 @@ $(".z3_craft_bm").show(); $(".z3_craft_mq").show(); } + if (val == 5) { + $("#3z_jiangpai_size").show(); + $("#3z_jiangpai_size select").attr("disabled", false) + if (!$('input[name="switchz3Size"]:checked').val()) { + $("#size").val($("#3z_jiangpai_size select option:selected").val()); + } + $(".z3_craft_yj").hide(); + $(".z3_craft_zj").hide(); + $(".z3_craft_bm").hide(); + $(".z3_craft_mq").show(); + $(".z3_craft_peiother").hide(); + $(".z3_craft_shengz").hide(); + $(".z3_craft_mq input").click(); + $(".z3_craft_dk input").click(); + $(".z3_craft_guasheng input").click(); + $(".gscolor").css("display", "inline-block") + $(".gscolor select").prop("disabled", false); + z3Craft($("#size").val()) + html = ``; + } + $("#material").empty().append(html); + getProductImage() form.render(); } @@ -1304,6 +1373,8 @@ $("#peijian_ui .tscolor select").prop("disabled", true); $("#peijian_ui .scolor").hide(); $("#peijian_ui .scolor select").prop("disabled", true); + $("#peijian_ui .gscolor").hide(); + $("#peijian_ui .gscolor select").prop("disabled", true); $("#peijian_ui .select_nilongshen").hide(); $("#peijian_ui .select_nilongshen select").prop("disabled", true); $("#peijian_ui .select_liusu").hide(); @@ -2496,6 +2567,7 @@ form.on('checkbox(z3Crafts)', (data) => { let value = data.value; let checked = $(data.elem).is(":checked"); + let z3type = $("input[name='z3type']:checked").val(); if (value == '直角' && $(".z3_craft_yj input[name='craft']").is(":checked")) { $(data.elem).prop("checked", false); @@ -2508,21 +2580,35 @@ if (value == '模切') { $(".z3_craft_yj input[name='craft']").prop("disabled", checked); $(".z3_craft_zj input[name='craft']").prop("disabled", checked); - $(".z3_craft_dk input[name='craft']").prop("disabled", checked); + if (z3type != 5) { + $(".z3_craft_dk input[name='craft']").prop("disabled", checked); + } $(".z3_craft_ssx input[name='craft']").prop("disabled", checked); $(".z3_craft_yh input[name='craft']").prop("disabled", checked); $(".z3_craft_bm input[name='craft']").prop("disabled", checked); } else { let other_list = ["圆角", "直角", "打孔", "编码"]; - if (other_list.indexOf(value) != -1 || (other_list.indexOf(value) != -1 && checked)) { - $(".z3_craft_mq input[name='craft']").prop("disabled", checked); + if (z3type != 5) { + if (other_list.indexOf(value) != -1 || (other_list.indexOf(value) != -1 && checked)) { + $(".z3_craft_mq input[name='craft']").prop("disabled", checked); + } } } let shengz = $(".shengz:checked").length; if (shengz == 1) { $(".scolor").css("display", "inline-block") + $(".scolor select").prop("disabled", false); } else { $(".scolor").hide() + $(".scolor select").prop("disabled", true); + } + let guasheng = $(".guasheng:checked").length; + if (guasheng == 1) { + $(".gscolor").css("display", "inline-block") + $(".gscolor select").prop("disabled", false); + } else { + $(".gscolor").hide() + $(".gscolor select").prop("disabled", true); } form.render(); }) @@ -3499,6 +3585,10 @@ arr.push($(this).val() + $("input[name='cropNumber']").val()); return; } + if ($(this).val() == "挂绳") { + arr.push($(".gscolor select option:selected").val() + $(this).val()); + return; + } if ($(this).val() == "内部模切") { return; }