Bladeren bron

修改插旗价格,修改手提袋烫金价格

zhuyiyi 1 maand geleden
bovenliggende
commit
b2d74bf0f3

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

@@ -548,8 +548,11 @@ public class ProductService {
                             if ("12".equals(dto.getToothpick_size())) {
                                 basePrice = basePrice + 0.02;
                             }
-
-                            product.setPrice(product.getPrice() + Math.max(Math.ceil(product.getCount() * basePrice), 5) * number);
+                            if ("常规".equals(dto.getKind2Value())) {
+                                product.setPrice(product.getPrice() + Math.max(Math.ceil(product.getCount() * basePrice), 5));
+                            } else {
+                                product.setPrice(product.getPrice() + Math.max(Math.ceil(product.getCount() * basePrice), 5) * number);
+                            }
                             if ("配牙签".equals(dto.getCraftShua()) && "6.5".equals(dto.getToothpick_size()) && ((width == 9 && length == 2.5) || length == 9 && width == 2.5)) {
                                 if (product.getCount() == 500) {
                                     double other_price = 60;
@@ -1571,20 +1574,23 @@ public class ProductService {
                     }
 
                     if ("300克".equals(dto.getKind())) {
-
+                        double sePrice = 5;
                         prices = new double[]{70, 140, 280, 350, 700, 1400, 2100, 3500, 7000};
                         if ((width <= 9 && length <= 5.4) || (length <= 9 && width <= 5.4)) {
 
                         } else if (width < 10 && length < 10) {
+                            sePrice = 10;
                             prices = new double[]{128, 256, 512, 640, 1280, 2560, 3840, 6400, 12800};
                         } else if ((width <= 10 && length <= 15) || (length <= 10 && width <= 15)) {
                             prices = new double[]{185, 370, 740, 925, 1850, 3700, 5550, 9250, 18500};
-
+                            sePrice = 15;
                         } else if (width < 15 && length < 15) {
                             prices = new double[]{300, 600, 1200, 1500, 3000, 6000, 9000, 15000, 30000};
+                            sePrice = 20;
                             // ((width <= 20 && length <= 15) || (length <= 20 && width <= 15))
                         } else {
                             prices = new double[]{450, 900, 1800, 2250, 4500, 9000, 13500, 22500, 45000};
+                            sePrice = 25;
                         }
 
                         priceList = new ArrayList<>();
@@ -1603,7 +1609,7 @@ public class ProductService {
                                 craft_price += 4 * itemCount / 100;
                             }
                             if (craft_list.contains("印刷颜色") && dto.getCo_number() != null && dto.getCo_number() > 0) {
-                                craft_price += 5 * (dto.getCo_number() - 1);
+                                craft_price += sePrice * (dto.getCo_number());
                             }
                             if ((craft_list.contains("单面烫金") || craft_list.contains("双面烫金") || craft_list.contains("烫镭射银"))) {
                                 double tangPrice = 45 + 0.1 * itemCount;
@@ -2302,10 +2308,12 @@ public class ProductService {
                         for (Product product : priceList) {
                             double craft_price = 0.0;
                             if (craft_list.contains("烫金")) {
-                                craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number), 200);
+                                craft_price = Math.ceil(300 + 0.5 * product.getCount());
+                                //craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number), 200);
                             }
                             if (craft_list.contains("双面")) {
-                                craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number * 2), 200);
+                                craft_price = Math.ceil(300 + 0.5 * product.getCount()) * 2;
+                                //craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number * 2), 200);
                             }
                             product.setPrice(Math.ceil(product.getPrice() + craft_price));
                             product.setWeight(df.format(number * length / 1000 * height / 1000 * product.getCount() * 0.25 * 1.25));

+ 2 - 2
src/main/java/lingtao/net/util/PriceUtils.java

@@ -1209,9 +1209,9 @@ public class PriceUtils {
                 pro.setPrice(Math.ceil((count / kai * price + 150 + 200 + 200) * m));
                 list.add(pro);
             } else {
+
                 pro.setCount(count);
-                pro.setPrice(Math.ceil(
-                        (count / kai * price + (150 + Math.ceil((count - 1000) / 1000) * 50) + 200 + count * 0.3) * m));
+                pro.setPrice(Math.ceil((count / kai * price + (150 + Math.ceil((count - 1000) / 1000) * 50) + 200 + count * 0.3) * m));
                 list.add(pro);
             }
         }