diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 588289f..e6d365a 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -15,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; +import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.*; import java.util.regex.Pattern; @@ -2379,8 +2380,8 @@ public class ProductService { if (dto.getCraft() != null && craft_list.size() > 0 && (craft_list.contains("冷转印") || craft_list.contains("烫画"))) { int[] quantitySteps = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000}; double paperLength = 0, paperWidth = 0; - length += 0.6; - width += 0.6; + length = BigDecimal.valueOf(length).add(BigDecimal.valueOf(0.6)).doubleValue(); + width = BigDecimal.valueOf(width).add(BigDecimal.valueOf(0.6)).doubleValue(); if (craft_list.contains("冷转印")) { paperLength = 20; paperWidth = 27; @@ -2390,7 +2391,7 @@ public class ProductService { paperWidth = 57; } //一张大纸能放几个 - double num = Math.max(Math.ceil(paperLength / length) * Math.ceil(paperWidth / width), Math.ceil(paperLength / width) * Math.ceil(paperWidth / length)); + double num = Math.min(Math.floor(paperLength / length) * Math.floor(paperWidth / width), Math.floor(paperLength / width) * Math.floor(paperWidth / length)); double baseCount = Math.max(Math.ceil(dto.getCount() * dto.getNumber() / num), 1); @@ -2777,6 +2778,29 @@ public class ProductService { } } } + if (dto.getCraft() != null && ("异形卡片".equals(dto.getKind()) || "直角卡片".equals(dto.getKind()) || "贺卡".equals(dto.getKind()) || "特种纸名片".equals(dto.getKind()))) { + double peijianPrice = 0; + if (Arrays.binarySearch(dto.getCraft(), "配葫芦针") > -1) { + peijianPrice = 0.03; + } + if (Arrays.binarySearch(dto.getCraft(), "配棉绳") > -1) { + peijianPrice = 0.05; + } + if (Arrays.binarySearch(dto.getCraft(), "配尼龙绳") > -1) { + peijianPrice = 0.01; + if ("红色绳子".equals(dto.getShen_color())) { + peijianPrice = 0.02; + } + } + if (Arrays.binarySearch(dto.getCraft(), "配弹力绳") > -1) { + peijianPrice = 0.05; + } + for (Product product : priceList) { + if (peijianPrice > 0) { + product.setPrice(Math.ceil(product.getPrice() + peijianPrice * dto.getCount() * dto.getNumber() + 5)); + } + } + } if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) { if (number > 1) { double designFee = 0; diff --git a/src/main/java/lingtao/net/util/PriceUtils.java b/src/main/java/lingtao/net/util/PriceUtils.java index 3b0455b..65b095d 100644 --- a/src/main/java/lingtao/net/util/PriceUtils.java +++ b/src/main/java/lingtao/net/util/PriceUtils.java @@ -3449,9 +3449,9 @@ public class PriceUtils { if (count <= 5) { price = 260; } else if (count < 100) { - price = 12 * count + 200; + price = 14 * count + 200; } else { - price = 14 * count; + price = 12 * count; } price = price + (coNumber - 1) * 100; } diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 76d70ca..ce994cb 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -43,6 +43,9 @@ right: 40px; } + #lesspeijian .layui-form-select .layui-edge { + right: 40px; + }