From 159d1c881d1bf3194ce6fe5cf74e88a29798c636 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Fri, 14 Mar 2025 16:27:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E6=97=97=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 106 +- src/main/webapp/views/product/chaqi.jsp | 1818 +++++++++++++++++ src/main/webapp/views/product/stickers.jsp | 94 +- 3 files changed, 1986 insertions(+), 32 deletions(-) create mode 100644 src/main/webapp/views/product/chaqi.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index bdd698c..2414f22 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -306,22 +306,79 @@ public class ProductService { priceList = StickersDoublePrice.getPrice(length, width, count, number); return priceList; } else if ("插旗".equals(dto.getStickerKind())) { - dto.setKindValue("0"); - dto.setLength(length); - dto.setWidth(width); - area = length * width / 10000; - if (length > 20 && length < 21) { - length = Math.ceil(length); + if (!"250克白卡纸对裱".equals(kind)) { + dto.setKindValue("0"); + dto.setLength(length); + dto.setWidth(width); area = length * width / 10000; - } - if (width > 20 && width < 21) { - width = Math.ceil(width); - area = length * width / 10000; - } - priceList = normalSticker(dto, "0", number, area, width, length, count, oldKind, priceList); + if (length > 20 && length < 21) { + length = Math.ceil(length); + area = length * width / 10000; + } + if (width > 20 && width < 21) { + width = Math.ceil(width); + area = length * width / 10000; + } + priceList = normalSticker(dto, "0", number, area, width, length, count, oldKind, priceList); - if (priceList.size() >= 3) { - priceList = priceList.subList(0, 3); + if (priceList.size() >= 3) { + priceList = priceList.subList(0, 3); + } + } else { + area = length * width; + int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000}; + int[][] prices = { + {172, 209, 209, 209, 209, 209, 209, 209, 313, 365, 382, 400, 435}, + {192, 209, 209, 209, 209, 209, 261, 278, 400, 504, 522, 556, 609}, + {382, 418, 418, 418, 418, 418, 418, 418, 678, 800, 835, 922, 1009}, + {470, 504, 504, 539, 556, 556, 591, 626, 887, 1078, 1130, 1252, 1373}, + {556, 591, 591, 696, 747, 922, 973, 1078, 1443, 1721, 1843, 2017, 2208}, + {783, 817, 817, 1009, 1199, 1495, 1582, 1947, 2625, 3199, 3477, 3703, 4085}, + {1217, 1287, 1287, 1599, 1982, 2486, 2921, 3651, 5007, 6119, 6259, 7197, 7910}, + }; + double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60}; + for (int j = 0; j < count_list.length; j++) { + if (priceList.size() > 2) { + break; + } + int item_count = count_list[j]; + if (count > item_count) { + continue; + } + int count_index = Arrays.binarySearch(count_list, item_count); + int startIndex = 0; + int endIndex = 0; + for (int i = 0; i < areas.length; i++) { + if (area > areas[i]) { + startIndex = endIndex; + endIndex = Math.min(i + 1, areas.length - 1); + } + } + if (count_index >= 0) { + Product pro = new Product(); + double price = 0; + int[] price_list = prices[count_index]; + if (startIndex == endIndex) { + price = (price_list[endIndex] / areas[endIndex]) * area; + } else { + price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex]; + } + if ("6.5".equals(dto.getToothpick_size())) { + price = price + (item_count * 0.1); + } + if ("10".equals(dto.getToothpick_size())) { + price = price + (item_count * 0.1); + } + if ("12".equals(dto.getToothpick_size())) { + price = price + (item_count * 0.14); + } + pro.setCount(item_count); + pro.setPrice(Math.ceil(price * number)); + priceList.add(pro); + } + } + + return priceList; } // return priceList; @@ -571,10 +628,10 @@ public class ProductService { } else if ("10".equals(dto.getKind())) {// 吸管套 int min = getNum(length, width); // if (min > 1) { - String[] xgtCraft = {"模切"}; - dto.setCraft(xgtCraft); - priceList = getHekaPrice(min, dto, priceList, count); - getCraft(dto, priceList, length * 10, width * 10, min); + String[] xgtCraft = {"模切"}; + dto.setCraft(xgtCraft); + priceList = getHekaPrice(min, dto, priceList, count); + getCraft(dto, priceList, length * 10, width * 10, min); /*} else { if ("6.5*5.4".equals(dto.getSize())) { dto.setKindValue("0"); @@ -2822,23 +2879,28 @@ public class ProductService { product.setWeight(df.format(wei * product.getCount() * number)); } } + if ("1".equals(kind) || "2".equals(kind) || "3".equals(kind)) { + //priceList = new PriceUtils().getFbPrice(dto, number, width, length, count, priceList); + } } return priceList; // 扇子 case "18": if (dto.getKindValue().equals("5")) { dto.setKindValue("0"); - if (count <= 10000) + if (count <= 10000) { priceList = productMapper.getThanPrice(dto); - else + } else { priceList = productMapper.thanThousandPrice(dto); + } dto.setKindValue("5"); } else if (!dto.getKindValue().equals("4")) { - if (count <= 10000) + if (count <= 10000) { priceList = productMapper.getThanPrice(dto); - else + } else { priceList = productMapper.thanThousandPrice(dto); + } } else { String[] list = dto.getCraft(); if (list == null) { diff --git a/src/main/webapp/views/product/chaqi.jsp b/src/main/webapp/views/product/chaqi.jsp new file mode 100644 index 0000000..b6f5e04 --- /dev/null +++ b/src/main/webapp/views/product/chaqi.jsp @@ -0,0 +1,1818 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + Insert title here + <%@include file="/views/common.jsp" %> + + + + +
+
+

插旗

+

+ + 使用方法:选择对应的产品种类。输入正确的尺寸、数量后点击“计算”出价格(自动复制); + +
+
+<%-- --%> + +<%-- --%> + <%-- --%> + + <%-- --%> +
+
+
+
+

+ 品种 +

+ +
+ + + +
+
+ +
+

+ 尺寸(CM/厘米) 输入格式: 长 * 宽 +

+
+ +
+ +

+ 数量(个) +

+
+ +
+ + + +
+ + + +

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+
+
+
+

+ 工艺 +

+
+ + + + + + + |     + + + + |     + + + + + |     + + + + + |     + + + +
+
+ 排废 : + + +
+
+ + +
+
+ 烫金 : + + +
+
+ 凹凸 : + + + + + +
+
+
+ + + +
+
+ + +
+

计算结果- + +

+
+ + <%@include file="../acountExpressFee.jsp" %> +
+ +
+
+
+
+
+
+ +
+
+ + +<%@include file="/views/copyResult.jsp" %> + + \ No newline at end of file diff --git a/src/main/webapp/views/product/stickers.jsp b/src/main/webapp/views/product/stickers.jsp index 58366ea..af483fc 100644 --- a/src/main/webapp/views/product/stickers.jsp +++ b/src/main/webapp/views/product/stickers.jsp @@ -28,7 +28,7 @@ <%-- --%> - +<%-- --%> <%-- --%> @@ -117,6 +117,7 @@ @@ -276,17 +277,24 @@

+ checked="checked"/> + + + + + |     + + |     - - - + + + |     |     - - + + + + @@ -485,6 +495,18 @@ $(".n_mq").hide(); $('.pf input').prop("checked", false); $('.n_mq input').prop("disabled", true); + $(".caiqie").hide(); + $(".fm input[value='覆亮膜']").attr("checked", "checked"); + $(".ui_cq select[name='count']").empty().append(` + + + + + + + + + `) if (stickerKind == "常用种类") { // 切换为品种单选框 $(".kindValueRadio").show(); @@ -765,6 +787,8 @@ } } + } else if (kindvalue == "250克白卡纸对裱") { + html += "广东:(3-4天发货) 中通 圆通 顺丰;" } } return html; @@ -881,9 +905,44 @@ $(".ui_guagua").prop('disabled', 'disabled'); $(".ui_guaguasize").hide(); } + + $(".peishua").show(); + $(".peishua").find(":input").attr("disabled", false); + $(".cha_fm").hide(); + $(".cha_fm").find(":input").attr("disabled", true); + $(".caiqie").hide(); + $(".ui_cq select[name='count']").empty().append(` + + + + + + + + + `) if (data.value == "铜版纸不干胶") { $(".ui_guagua2").show(); $(".ui_guagua2").removeAttr('disabled'); + + } else if (data.value == "250克白卡纸对裱") { + $(".fm input").removeAttr('checked'); + $(".ui_guagua2").hide(); + $(".caiqie").show(); + $(".cha_fm").show(); + $(".cha_fm").find(":input").attr("disabled", false); + $(".peishua").hide(); + $(".peishua").find(":input").attr("disabled", true); + $("input[name='craft']").prop('checked', false); + $(".cha_fm input").prop('checked', true); + $(".ui_guagua2").prop('disabled', 'disabled'); + $(".ui_cq select[name='count']").empty().append(` + + + + + + `) } else { $(".ui_guagua2").hide(); $("input[name='craft']").prop('checked', false); @@ -977,7 +1036,8 @@ $("#remark").append(remark); kValue = $("#kindValue").val() getProductImage(kValue) - + $(".cha_fm").hide(); + $(".cha_fm").find(":input").attr("disabled", true); if (data.value == 0 || data.value == 2) { // 5.11:专版打印没有烫金工艺了,全部禁用、隐藏 // 5.18:专版打印恢复烫金工艺 @@ -1315,6 +1375,8 @@ var kindValue = $("#kindValue1").val() } else if (stickerKind == '专版打印') { var kindValue = $("#kindValue").val() + } else if (stickerKind[0] == '插旗') { + var kindValue = $("#kindValue3").val() } else { var kindValue = $("#kindValue2").val() } @@ -1447,6 +1509,18 @@ // } } } + if (stickerKind[0] == "插旗" && kindValue == "250克白卡纸对裱") { + if ((size.split("*")[0] < 1 || size.split("*")[1] < 1)) { + layer.msg("插卡-250克白卡纸对裱不能小于10*10MM", {offset: ['300px', '300px']}, function () { + }); + return false; + } + if ((size.split("*")[0] > 9 || size.split("*")[1] > 9)) { + layer.msg("插卡-250克白卡纸对裱不能大于90*90MM", {offset: ['300px', '300px']}, function () { + }); + return false; + } + } if (kindValue != 0 && kindValue != 1 && kindValue != 2 && kindValue != "拉丝金" && kindValue != "拉丝银" && kindValue != "格底珠光膜" && kindValue != "PP合成纸") {