From f929755e733ac9a834e61d66a87f4447ed1763fa Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Tue, 6 May 2025 10:52:49 +0800 Subject: [PATCH] edit --- .../lingtao/net/service/ProductService.java | 30 +++++++------------ src/main/webapp/views/product/metal.jsp | 30 +++++++++++++++++++ src/main/webapp/views/product/stickers.jsp | 4 +++ 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index f593fe7..33b8407 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -676,15 +676,19 @@ public class ProductService { int tempNumber = dto.getNumber(); List craftList = null; if (!StringUtils.isEmpty(dto.getCraft())) { - craftList = Arrays.asList(dto.getCraft()); + craftList = new ArrayList<>(Arrays.asList(dto.getCraft())); } + Boolean isMq = false; if (craftList.contains("模切")) { dto.setNumber(1); + isMq = true; } priceList = new CouponPrice().getCouponPrice(min, dto, priceList, count, craftList); + craftList.remove("模切"); + dto.setCraft(craftList.toArray(new String[craftList.size()])); //getCraft(dto, priceList, length * 10, width * 10, min); - if (craftList.contains("模切")) { + if (isMq) { for (Product product : priceList) { product.setPrice(Math.floor(product.getPrice() * tempNumber)); product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86)); @@ -793,7 +797,7 @@ public class ProductService { double w1 = Math.ceil(width / 28.5); double l2 = Math.ceil(width / 21); double w2 = Math.ceil(length / 28.5); - min = (int) Math.min(l1 * w1, l2 * w2); + //min = (int) Math.min(l1 * w1, l2 * w2); int[][] prices = { {245, 580, 798, 1100, 1425}, @@ -854,9 +858,9 @@ public class ProductService { Product product = new Product(); product.setCount(item_count); product.setPrice(Math.ceil((price + carft_price) * number)); - priceList.add(product); +// priceList.add(product); } - return priceList; +// return priceList; } priceList = getHekaPrice(min, dto, priceList, count); getCraft(dto, priceList, length * 10, width * 10, min); @@ -2326,7 +2330,7 @@ public class ProductService { } } else { for (Product product : priceList) { - product.setPrice(product.getPrice() + number); + product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5)); } } // double base = number < 6 && number > 1 ? 5 : 0; @@ -2342,20 +2346,6 @@ public class ProductService { area = length * width * count / 10000; - // 根据款数重新算价格 -// if (number > 1) { -// for (Product product : priceList) { -// if (area <= 0.005) { -// if (count <= 5) { -// product.setPrice(Math.ceil(product.getPrice()) + 5 * number); -// } else { -// product.setPrice(Math.ceil(product.getPrice() * number)); -// } -// } else { -// product.setPrice(Math.ceil(product.getPrice() * number)); -// } -// } -// } /* * List priceList2 = new PriceUtils().UVStickerLessPrice(length, width, count, number, dto.getCraft()); // 比较哪个便宜 if ((priceList.get(0).getPrice() > priceList2.get(0).getPrice()) && priceList2.get(0).getPrice() > 0) { // Double minPrice = Math.min(priceList.get(0).getPrice(), // priceList2.get(0).getPrice()); priceList = new ArrayList(); Product product = new Product(); product.setCount(count); product.setPrice(priceList2.get(0).getPrice()); * product.setMsg("大张出货(2-3天发货)"); priceList.add(product); return priceList; } diff --git a/src/main/webapp/views/product/metal.jsp b/src/main/webapp/views/product/metal.jsp index 9393607..9639393 100644 --- a/src/main/webapp/views/product/metal.jsp +++ b/src/main/webapp/views/product/metal.jsp @@ -109,6 +109,20 @@ +

客户旺旺

@@ -191,6 +205,16 @@ var carousel = layui.carousel; var table = layui.table; + $("#number").on("input", function (e) { + var number = e.delegateTarget.value; + var kind = $("input[name='kind']:checked").val(); + if (kind == "UV转印贴" && number > 1) { + $("#ui_des").show(); + } else { + $("#ui_des").hide(); + } + }); + function getProductImage() { var html = " "; var remark = " "; @@ -247,6 +271,7 @@ }) form.on('radio(kind)', function (kindData) { getProductImage() + $("#ui_des").hide(); if (kindData.value == "金属标") { // 切换为品种单选框 $(".metal").show(); @@ -265,6 +290,9 @@ $(".count").find(":input").attr("disabled", false); $(".metal").hide(); $(".metal").find(":input").attr("disabled", true); + if ($("#number").val() > 1) { + $("#ui_des").show(); + } } form.render();//必须写 }) @@ -373,6 +401,8 @@ } else { var span_result = 'UV转印贴 - ' + craftShua + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n'; if (number > 1) { + let numberType = $("#desType option:selected").text(); + span_result += "款数:" + number + "-" + numberType + "\n"; for (let i = 0; i < data.length; i++) { span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n' data[i].number = number; diff --git a/src/main/webapp/views/product/stickers.jsp b/src/main/webapp/views/product/stickers.jsp index dc15a0b..6c5d1cf 100644 --- a/src/main/webapp/views/product/stickers.jsp +++ b/src/main/webapp/views/product/stickers.jsp @@ -1708,6 +1708,9 @@ craft_list.push($("input[name='craftQieType']:checked").val()) } var yaqian = '' + if ($("input[name='yinbai']:checked").val() != "") { + yaqian = $("input[name='yinbai']:checked").val(); + } if (stickerKind == "插旗") { if ($("input[name='craft']:checked").val() != null) { yinbai = $("input[name='craft']:checked").val() + ":6*18毫米"; @@ -1718,6 +1721,7 @@ craft_list.push(...craftMo) craft_list.push(...aotu) craft_list.push(...tangjin) + craft_list.push(...yinbai) craftList = craftMo + aotu + tangjin + yinbai; } if ($("input[name='craftPai']:checked").val() != "") {