zhuyiyi 7 months ago
parent
commit
3ced6c059a
1 changed files with 77 additions and 0 deletions
  1. 77 0
      src/main/java/lingtao/net/service/ProductService.java

+ 77 - 0
src/main/java/lingtao/net/service/ProductService.java

@@ -788,6 +788,76 @@ public class ProductService {
                         return priceList;
                     }
                     int min = getNum(length, width);
+                    if ("1".equals(dto.getKind()) && "2".equals(dto.getKindValue())) {
+                        double l1 = Math.ceil(length / 21);
+                        double w1 = Math.ceil(width / 28.5);
+                        double l2 = Math.ceil(width / 21);
+                        double w2 = Math.ceil(length / 28.5);
+                        min = (int) Math.min(l1 * w1, l2 * w2);
+
+                        int[][] prices = {
+                                {245, 580, 798, 1100, 1425},
+                                {420, 965, 1315, 1850, 2400},
+                                {780, 1768, 2390, 3255, 4350},
+                                {1120, 2572, 3450, 4726, 6330},
+                                {1465, 3336, 4480, 6138, 8190},
+                                {1810, 4100, 5510, 7550, 10050},
+                                {2149, 4872, 6538, 8892, 11860},
+                                {2488, 5644, 7566, 10234, 13670},
+                                {2827, 6416, 8594, 11576, 15480},
+                                {3166, 7188, 9622, 12918, 17290},
+                                {3505, 7960, 10650, 14260, 19100}
+                        };
+                        int[][] other_prices = {
+                                {335, 218, 302, 325, 1425},
+                                {545, 350, 535, 550, 2400},
+                                {988, 622, 865, 1095, 4350},
+                                {1452, 878, 1276, 1604, 6330},
+                                {1871, 1144, 1658, 2052, 8190},
+                                {2290, 1410, 2040, 2500, 10050},
+                                {2723, 1666, 2354, 2968, 11860},
+                                {3156, 1922, 2668, 3436, 13670},
+                                {3589, 2178, 2982, 3904, 15480},
+                                {4022, 2434, 3296, 4372, 17290},
+                                {4455, 2690, 3610, 4840, 19100}
+                        };
+                        int[] count_list = {500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000};
+                        area = width * length;
+                        for (int i = 0; i < count_list.length; i++) {
+                            int item_count = count_list[i];
+                            if (count > item_count) {
+                                continue;
+                            }
+                            if (priceList.size() > 2) {
+                                break;
+                            }
+                            int count_index = Arrays.binarySearch(count_list, item_count);
+                            int[] prices_list = prices[count_index];
+                            int[] other_prices_list = other_prices[count_index];
+
+                            double price = 0;
+                            if (min >= 6) {
+                                price = Math.ceil(prices_list[0] * min + (prices_list[0] * area / (598.5 * min)));
+                            } else {
+                                price = Math.ceil(prices_list[min - 1] + (other_prices_list[min - 1] * area / (598.5 * min)));
+                            }
+                            double carft_price = 0;
+                            if (craft_list.contains("模切")) {
+                                carft_price += Math.max(item_count * 0.06, 100);
+                            }
+                            if (craft_list.contains("糊成品")) {
+                                carft_price += item_count * 0.1;
+                            }
+                            if (craft_list.contains("糊半成品")) {
+                                carft_price += item_count * 0.15;
+                            }
+                            Product product = new Product();
+                            product.setCount(item_count);
+                            product.setPrice(Math.ceil((price + carft_price) * number));
+                            priceList.add(product);
+                        }
+                        return priceList;
+                    }
                     priceList = getHekaPrice(min, dto, priceList, count);
                     getCraft(dto, priceList, length * 10, width * 10, min);
                     // 刮刮膜增加价格
@@ -2254,6 +2324,10 @@ public class ProductService {
                         for (Product product : priceList) {
                             product.setPrice(product.getPrice() * number);
                         }
+                    } else {
+                        for (Product product : priceList) {
+                            product.setPrice(product.getPrice() + number);
+                        }
                     }
 //                    double base = number < 6 && number > 1 ? 5 : 0;
 //                    for (Product product : priceList) {
@@ -2537,6 +2611,9 @@ public class ProductService {
                     if ("腰封".equals(dto.getKind())) {
                         zhang = 8;
                     }
+                    if ("特种纸名片".equals(dto.getKind())) {
+                        zhang = 18;
+                    }
                     // 一张l/w 大的纸张能做多少个此类尺寸的产品
                     double max = 1;
                     if (length == 424 || length == 289 || width == 424 || width == 289) {