From 02f8b03f644758ad1c19b0da04fb57b734a2ee6b Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Tue, 21 Jul 2026 16:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EUV=E7=A3=81=E5=90=B8=E8=B4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 328 ++++++++++++++---- .../lingtao/net/util/SwzStickersPrice.java | 6 +- src/main/webapp/views/product/coupon.jsp | 106 +++++- .../webapp/views/product/magneticSticker.jsp | 305 ++++++++++++++++ .../webapp/views/product/woodPulpCotton.jsp | 2 +- 5 files changed, 667 insertions(+), 80 deletions(-) create mode 100644 src/main/webapp/views/product/magneticSticker.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 79fa6fe..edccebd 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -2881,6 +2881,78 @@ public class ProductService { dto2.setWeight(df.format(number * (length / 100) * (width / 100) * av_count * 0.3 * 0.86)); dto2.setPrice(Math.ceil(price)); priceList.add(dto2); + } else if ("反转胶片".equals(dto.getKind())) { + double unitPrice = 0; + double base_price = 52; + if ("0".equals(dto.getKindValue())) { + if (count <= 10) { + unitPrice = 300; + unitPrice = new PriceUtils().calcByTargetN(10, 300, 10, 300, count); + } else if (count <= 200) { + unitPrice = 275; + unitPrice = new PriceUtils().calcByTargetN(10, 300, 200, 275, count); + } else if (count <= 500) { + unitPrice = 250; + unitPrice = new PriceUtils().calcByTargetN(200, 275, 500, 250, count); + } else if (count <= 1000) { + unitPrice = 220; + unitPrice = new PriceUtils().calcByTargetN(500, 250, 1000, 220, count); + } else if (count <= 5000) { + unitPrice = 196; + unitPrice = new PriceUtils().calcByTargetN(1000, 220, 5000, 196, count); + } else if (count <= 10000) { + unitPrice = 171; + unitPrice = new PriceUtils().calcByTargetN(5000, 196, 10000, 171, count); + } else if (count <= 30000) { + unitPrice = 144; + unitPrice = new PriceUtils().calcByTargetN(10000, 171, 30000, 144, count); + } else if (count <= 50000) { + unitPrice = 130; + unitPrice = new PriceUtils().calcByTargetN(30000, 144, 50000, 130, count); + } else { + unitPrice = 122 * count; + } + } else { + if (count <= 10) { + unitPrice = 315; + unitPrice = new PriceUtils().calcByTargetN(10, 315, 10, 315, count); + } else if (count <= 200) { + unitPrice = 290; + unitPrice = new PriceUtils().calcByTargetN(10, 315, 200, 290, count); + } else if (count <= 500) { + unitPrice = 265; + unitPrice = new PriceUtils().calcByTargetN(200, 290, 500, 265, count); + } else if (count <= 1000) { + unitPrice = 235; + unitPrice = new PriceUtils().calcByTargetN(500, 265, 1000, 235, count); + } else if (count <= 5000) { + unitPrice = 210; + unitPrice = new PriceUtils().calcByTargetN(1000, 235, 5000, 210, count); + } else if (count <= 10000) { + unitPrice = 185; + unitPrice = new PriceUtils().calcByTargetN(5000, 210, 10000, 185, count); + } else if (count <= 30000) { + unitPrice = 169; + unitPrice = new PriceUtils().calcByTargetN(10000, 185, 30000, 169, count); + } else if (count <= 50000) { + unitPrice = 145; + unitPrice = new PriceUtils().calcByTargetN(30000, 169, 50000, 145, count); + } else { + unitPrice = 135 * count; + } + } + double design_price = number * 8; + double price = Math.ceil(Math.max(unitPrice * length * width / 10000 * number, base_price) + design_price); + + if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装OPP袋")) { + price += Math.ceil(Math.max(count * 0.2 * number, 5)); + } + + Product dto2 = new Product(); + dto2.setCount(count); + dto2.setWeight(df.format(number * (length / 100) * (width / 100) * count * 0.3 * 0.86)); + dto2.setPrice(Math.ceil(price)); + priceList.add(dto2); } else if (!StringUtils.isEmpty(crafts) && crafts[crafts.length - 1].indexOf("烫金") > -1) { // 出血(一边2毫米) length = length * 10 + 4; @@ -3172,44 +3244,44 @@ public class ProductService { } } } - - if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) { - if (number > 1) { - double designFee = 0; - if (role.contains("1053")) { - designFee = 5; - } - if (dto.getP() == 1) { - designFee += 0.6; - } else { - if (!dto.getProTypeLabel().equals("婚礼报纸") && !dto.getProTypeLabel().equals("菜单")) { - designFee += 5.5; + if (!"反转胶片".equals(dto.getKind())) { + if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) { + if (number > 1) { + double designFee = 0; + if (role.contains("1053")) { + designFee = 5; } - if (dto.getProTypeLabel().equals("菜单") || dto.getProTypeLabel().equals("婚礼报纸")) { - designFee += 17; + if (dto.getP() == 1) { + designFee += 0.6; + } else { + if (!dto.getProTypeLabel().equals("婚礼报纸") && !dto.getProTypeLabel().equals("菜单")) { + designFee += 5.5; + } + if (dto.getProTypeLabel().equals("菜单") || dto.getProTypeLabel().equals("婚礼报纸")) { + designFee += 17; + } + } + + designFee = designFee * (number - 1); + for (Product product : priceList) { + product.setPrice(Math.ceil(product.getPrice() + designFee)); } } + } else { - designFee = designFee * (number - 1); - for (Product product : priceList) { - product.setPrice(Math.ceil(product.getPrice() + designFee)); - } - } - } else { - - //第二款开始的设计费按照式设计内容 - if (!dto.getProTypeLabel().equals("婚礼报纸") && !dto.getProTypeLabel().equals("菜单") && number > 1) { - double desFee = 0; - if (dto.getP() == 1) { - desFee = 0.6; - } else if (dto.getP() == 2 || dto.getP() == 3) { - desFee = 1; - } else if (dto.getP() == 4) { - desFee = 1.2; - } else if (dto.getP() == 5) { - desFee = 2; - } else { - desFee = 5.5; + //第二款开始的设计费按照式设计内容 + if (!dto.getProTypeLabel().equals("婚礼报纸") && !dto.getProTypeLabel().equals("菜单") && number > 1) { + double desFee = 0; + if (dto.getP() == 1) { + desFee = 0.6; + } else if (dto.getP() == 2 || dto.getP() == 3) { + desFee = 1; + } else if (dto.getP() == 4) { + desFee = 1.2; + } else if (dto.getP() == 5) { + desFee = 2; + } else { + desFee = 5.5; // int min = getNumAdd((length - 4) / 10, (width - 4) / 10); // if (min == 1) { // desFee = 7; @@ -3223,10 +3295,11 @@ public class ProductService { // if (min == 4) { // desFee = 18; // } - } + } - for (Product product : priceList) { - product.setPrice(Math.floor(product.getPrice() + desFee * (number - 1))); + for (Product product : priceList) { + product.setPrice(Math.floor(product.getPrice() + desFee * (number - 1))); + } } } } @@ -4542,12 +4615,106 @@ public class ProductService { case "木浆棉": priceList = getWoodPulpCottonPrice(dto, width, length); return chucklePrice(role, priceList, dto); + case "UV磁吸贴": + priceList = getMagneticStickerPrice(dto, width, length); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getMagneticStickerPrice(Product dto, Double width, Double length) { + List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List priceList = new ArrayList<>(); + + int count = dto.getCount(); + int number = dto.getNumber(); + double basePrice = 0; + int startN = 0; + int endN = 0; + double hightPrice = 0; + double lowPrice = 0; + + if (count <= 10) { + startN = 10; + endN = 10; + hightPrice = 200; + lowPrice = 200; + } else if (count <= 20) { + startN = 10; + endN = 20; + hightPrice = 200; + lowPrice = 182; + } else if (count <= 50) { + startN = 20; + endN = 50; + hightPrice = 182; + lowPrice = 166; + } else if (count <= 100) { + startN = 50; + endN = 100; + hightPrice = 166; + lowPrice = 153; + } else if (count <= 200) { + startN = 100; + endN = 200; + hightPrice = 153; + lowPrice = 145; + } else if (count <= 500) { + startN = 200; + endN = 500; + hightPrice = 145; + lowPrice = 138; + } else if (count <= 1000) { + startN = 500; + endN = 1000; + hightPrice = 138; + lowPrice = 132; + } else if (count <= 2000) { + startN = 1000; + endN = 2000; + hightPrice = 132; + lowPrice = 126; + } else if (count <= 5000) { + startN = 2000; + endN = 5000; + hightPrice = 126; + lowPrice = 120; + } else if (count <= 10000) { + startN = 5000; + endN = 10000; + hightPrice = 120; + lowPrice = 116; + } else if (count <= 20000) { + startN = 10000; + endN = 20000; + hightPrice = 116; + lowPrice = 111; + } else if (count <= 50000) { + startN = 20000; + endN = 50000; + hightPrice = 111; + lowPrice = 103; + } + basePrice = new PriceUtils().calcByTargetN(startN, hightPrice, endN, lowPrice, count); + if (count > 50000) { + basePrice = 97 * count; + } + + if (craft_list.contains("模切")) { + basePrice = basePrice * 1.2; + } + double design_price = Math.ceil((number) * 5); + + Product pro = new Product(); + pro.setCount(count); + pro.setNumber(number); + pro.setPrice(Math.ceil((Math.max(basePrice * width * length / 10000 * number, 25) + design_price))); + priceList.add(pro); + return priceList; + } + private List getWoodPulpCottonPrice(Product dto, Double width, Double length) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); @@ -4555,42 +4722,55 @@ public class ProductService { int count = dto.getCount(); int number = dto.getNumber(); - double paperLength = 420; - double paperWith = 297; - - width = width * 10 + 4; - length = length * 10 + 4; - // 一张l/w 大的纸张能做多少个此类尺寸的产品 - double max = Math.max(Math.floor(paperLength / length) * Math.floor(paperWith / width), Math.floor(paperLength / width) * Math.floor(paperWith / length)); - // 报的数量需要多少张大纸 // 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个 - int num = (int) Math.ceil(count * number / Math.max(max, 1)); + int num = count; double basePrice = 0; - if (num <= 100) { - basePrice = 40; - basePrice = new PriceUtils().calcByTargetN(100, 40, 100, 40, num); - } else if (num <= 300) { - basePrice = 35; - basePrice = new PriceUtils().calcByTargetN(100, 40, 300, 35, num); - } else if (num <= 500) { - basePrice = 30; - basePrice = new PriceUtils().calcByTargetN(300, 35, 500, 30, num); - } else if (num <= 1000) { - basePrice = 28; - basePrice = new PriceUtils().calcByTargetN(500, 35, 1000, 28, num); - } else if (num <= 2000) { - basePrice = 26; - basePrice = new PriceUtils().calcByTargetN(1000, 28, 2000, 26, num); - } else if (num <= 5000) { - basePrice = 24; - basePrice = new PriceUtils().calcByTargetN(2000, 26, 5000, 24, num); - } else if (num <= 10000) { - basePrice = 22; - basePrice = new PriceUtils().calcByTargetN(5000, 24, 10000, 22, num); - } else { - basePrice = 20 * num; + int startN = 0; + int endN = 0; + double hightPrice = 0; + double lowPrice = 0; + if (num < 100) { + startN = 99; + endN = 99; + hightPrice = 500; + lowPrice = 500; + } else if (num < 200) { + startN = 99; + endN = 199; + hightPrice = 500; + lowPrice = 445; + } else if (num < 500) { + startN = 199; + endN = 499; + hightPrice = 445; + lowPrice = 425; + } else if (num < 1000) { + startN = 499; + endN = 999; + hightPrice = 425; + lowPrice = 360; + } else if (num < 5000) { + startN = 999; + endN = 4999; + hightPrice = 360; + lowPrice = 320; + } else if (num < 10000) { + startN = 4999; + endN = 9999; + hightPrice = 320; + lowPrice = 300; + } else if (num < 50000) { + startN = 9999; + endN = 49999; + hightPrice = 300; + lowPrice = 280; + } + basePrice = new PriceUtils().calcByTargetN(startN, hightPrice, endN, lowPrice, num); + if (num >= 50000) { + basePrice = 260 * num; //basePrice = new PriceUtils().calcByTargetN(10000, 20, 10000, 20, num); } + double craftPrice = 0; double craftBasePrice = 0; double craftMiniPrice = 0; @@ -4611,10 +4791,12 @@ public class ProductService { craftBasePrice = 0.15; craftPrice += Math.max(craftBasePrice * count, 5); } + + double design_price = Math.ceil((number) * 30); Product pro = new Product(); pro.setCount(count); pro.setNumber(number); - pro.setPrice(Math.ceil((Math.max(basePrice, 80) + Math.max(craftPrice, craftMiniPrice) * number))); + pro.setPrice(Math.ceil((Math.max(basePrice * width * length / 10000 * number, 60) + Math.max(craftPrice, craftMiniPrice) * number) + design_price)); priceList.add(pro); return priceList; @@ -4660,7 +4842,7 @@ public class ProductService { break; } int itemCount = priceList.size() == 0 ? count : counts[i]; - base_price = prices[area_index][Math.max(itemCount == count ? i - 1 : i, 0)]; + base_price = prices[area_index][Math.max(i, 0)]; Product pro = new Product(); pro.setCount(itemCount); pro.setNumber(dto.getNumber()); @@ -5389,6 +5571,10 @@ public class ProductService { rate_item = 0.88; } else if (count <= 2000) { rate_item = 0.85; + } else if (count <= 5000) { + rate_item = 0.8; + } else { + rate_item = 0.75; } if ("18".equals(dto.getKindValue()) && count < 10) { price = 150; diff --git a/src/main/java/lingtao/net/util/SwzStickersPrice.java b/src/main/java/lingtao/net/util/SwzStickersPrice.java index 4532dfb..3c94a4a 100644 --- a/src/main/java/lingtao/net/util/SwzStickersPrice.java +++ b/src/main/java/lingtao/net/util/SwzStickersPrice.java @@ -43,7 +43,11 @@ public class SwzStickersPrice { // 报的数量需要多少张大纸 int num = (int) Math.ceil(count / max); - price = 50 + (num - 1) * 5.5; + double base_price = 5.5; + if(num >50){ + base_price = 4; + } + price = 50 + (num - 1) * base_price; } else {//激凸、烫金工艺一样价格 //20刀模费,20版费,5mm出血,7.5元/平方 price = (length + 0.5) * (width + 0.5) * count / 10000 * 7.5 + 40; diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 6d6cf08..9949c6d 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -97,6 +97,7 @@ + + @@ -169,7 +176,7 @@ -<%-- --%> + <%-- --%>

材质

@@ -906,6 +913,30 @@ +