Browse Source

新增刮刮卡打码价格

zhuyiyi 3 tháng trước cách đây
mục cha
commit
fc8ac0f2ce
1 tập tin đã thay đổi với 24 bổ sung7 xóa
  1. 24 7
      src/main/java/lingtao/net/service/ProductService.java

+ 24 - 7
src/main/java/lingtao/net/service/ProductService.java

@@ -688,14 +688,29 @@ public class ProductService {
                     for (Product product : priceList) {
                         double carft_price = 0;
                         if (craftList.contains("压痕")) {
-                            carft_price += Math.max(0.02 * product.getCount(), 10) * number;
+                            carft_price += Math.max(0.02 * product.getCount(), 10);
                         }
                         if (craftList.contains("压点线")) {
-                            carft_price += Math.max(0.02 * product.getCount(), 10) * number;
+                            carft_price += Math.max(0.02 * product.getCount(), 10);
                         }
                         if (craftList.contains("圆角")) {
-                            carft_price += Math.max(0.02 * product.getCount(), 10) * number;
+                            carft_price += Math.max(0.02 * product.getCount(), 10);
                         }
+                        if (craftList.contains("打码")) {
+                            double danjia = 0.0;
+                            // 5000张以上,一张10分
+                            if (dto.getCount() > 5000) {
+                                danjia = 0.1;
+                            } else {
+                                danjia = 0.1;
+                            }
+                            if ("上下编码".equals(dto.getBianma())) {
+                                carft_price += Math.ceil((danjia * product.getCount() * 2 > 120 ? danjia * product.getCount() * 2 : 120));
+                            } else {
+                                carft_price += Math.ceil((danjia * product.getCount()));
+                            }
+                        }
+                        carft_price = Math.ceil(carft_price * number);
                         //腰封的模切费单独计算
                         product.setPrice(Math.ceil((product.getPrice() + carft_price)));
                         product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86));
@@ -1405,7 +1420,9 @@ public class ProductService {
                     // 根据款数重新算价格
                     for (Product product : priceList) {
                         product.setPrice(Math.ceil(product.getPrice() * number));
+                        product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.3 * 0.86));
                     }
+
                     return priceList;
                 }
                 if ("雅柔".equals(kind) || "萱姿".equals(kind)) {
@@ -1506,7 +1523,7 @@ public class ProductService {
                         } else {
                             product.setPrice(Math.floor(product.getPrice() * number * min));
                         }
-
+                        product.setWeight(df.format(number * (length) / 100 * (width) / 100 * product.getCount() * 0.5));
                     }
                     return priceList;
                 } else if ("草香".equals(kind) || "芳怡".equals(kind)) {
@@ -1581,12 +1598,12 @@ public class ProductService {
                     if ("1".equals(dto.getKindValue())) {
                         // 给产品加上重量 扣除出血的4毫米
                         for (Product product : priceList) {
-                            product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86));
+                            product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86));
                         }
                     } else {
                         // 给产品加上重量
                         for (Product product : priceList) {
-                            product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86));
+                            product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86));
                         }
                     }
 
@@ -1675,7 +1692,7 @@ public class ProductService {
 //                int tzWei = Integer.parseInt(Pattern.compile("[^0-9]").matcher(kind).replaceAll("").trim());// 获取材质中的克数
                 int tzWei = 300;// 获取材质中的克数
                 for (Product product : priceList) {
-                    product.setWeight(df.format(tzWei / 1000 * length * width * product.getCount() / 10000 * number));
+                    product.setWeight(df.format(tzWei / 1000.0 * length * width * product.getCount() / 10000.0 * number));
                 }
                 return priceList;
             // 合版封套