diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index f6e0793..702bc5c 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -5274,6 +5274,7 @@ public class ProductService { double[] rate_list = {0.75, 0.72, 0.70, 0.68, 0.65, 0.60, 0.58, 0.55, 0.50}; int[] counts = {200, 400, 600, 800, 1000, 2000, 3000, 5000, 10000}; double maxRate = 0.48; + int base_count = 50; if ("14".equals(dto.getKindValue())) { requstVo.setPaper("250克吸水棉纸"); if ("90*90圆形".equals(requstVo.getSize())) { @@ -5317,11 +5318,7 @@ public class ProductService { item.setParameters(Collections.singletonMap("颜色", dto.getTcolor())); craft.add(item); } - if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) { - rate_list = new double[]{0.70, 0.65, 0.60, 0.55, 0.50}; - counts = new int[]{50, 100, 200, 500, 1000}; - maxRate = 0.45; - } + if (craft_list.contains("双面")) { requstVo.setPrintSide(2); requstVo.setDoubleSideType("不同"); @@ -5354,20 +5351,42 @@ public class ProductService { craft.add(item); } requstVo.setCrafts(craft); + if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) { + requstVo.setNum(base_count); +// rate_list = new double[]{0.70, 0.68, 0.65, 0.62, 0.58}; +// counts = new int[]{50, 100, 200, 500, 1000}; +// maxRate = 0.55; + } ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo); - - for (int i = 0; i < counts.length; i++) { - if (counts[i] < count) { - continue; + double price = 0; + if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) { + double rate_item = 1; + if (count <= 100) { + rate_item = 0.95; + } else if (count <= 200) { + rate_item = 0.93; + } else if (count <= 500) { + rate_item = 0.90; + } else if (count <= 1000) { + rate_item = 0.88; + } else if (count <= 2000) { + rate_item = 0.85; } - base_rate = rate_list[i]; - break; + price = Math.ceil(result.getData().getPrice() / (1 - 0.7) / base_count * count * rate_item); + } else { + for (int i = 0; i < counts.length; i++) { + if (counts[i] < count) { + continue; + } + base_rate = rate_list[i]; + break; + } + if (base_rate == 0) { + base_rate = maxRate; + } + price = Math.ceil(result.getData().getPrice() / (1 - base_rate)); } - if (base_rate == 0) { - base_rate = maxRate; - } - double price = Math.ceil(result.getData().getPrice() / (1 - base_rate)); - double designPrice = 0; + double designPrice = (number - 1) * 8; Product product = new Product(); product.setPrice(Math.ceil(Math.max(price, min_pirce) + designPrice)); @@ -5398,7 +5417,9 @@ public class ProductService { double wei = 0; // 根据款数重新算价格 for (Product product : priceList) { - product.setPrice(Math.floor(product.getPrice() * number)); + if (!sdList.contains(dto.getKindValue())) { + product.setPrice(Math.floor(product.getPrice() * number)); + } if ("3".equals(kind)) { wei = 0.3; } else { @@ -7940,7 +7961,32 @@ public class ProductService { int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000, 20000}; double[] areas = new double[]{4, 6, 8, 10, 12, 14, 16, 25, 35, 45, 84, 120, 150, 200, 600, 1000, 2000, 2520}; double area = length * width; - return getAreaCenterPrice(count_list, dto.getCount(), area, prices, areas, dto.getNumber()); + int count = dto.getCount(); + if (dto.getCount() > 20000) { + count = 20000; + } + List productList = getAreaCenterPrice(count_list, count, area, prices, areas, dto.getNumber()); + if (dto.getCount() > 20000) { + for (Product product : productList) { + double rate = 1; + if (dto.getCount() == 30000) { + rate = 0.95; + } + if (dto.getCount() == 50000) { + rate = 0.93; + } + if (dto.getCount() == 100000) { + rate = 0.9; + } + if (dto.getCount() == 200000) { + rate = 0.88; + } + product.setCount(dto.getCount()); + product.setPrice(Math.ceil(product.getPrice() / 20000 * dto.getCount() * rate)); + } + } + + return productList; } private List normalSticker(Product dto, String kind, Integer number, Double area, Double width, Double diff --git a/src/main/webapp/views/product/stickers.jsp b/src/main/webapp/views/product/stickers.jsp index 1d851c7..c357cae 100644 --- a/src/main/webapp/views/product/stickers.jsp +++ b/src/main/webapp/views/product/stickers.jsp @@ -995,7 +995,11 @@ - `; + + + + + `; } else { $(".nofm").find(":input").attr("disabled", true); $('input[class = liangmo]').prop('checked', true);