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 @@ + +
材质
+