|
|
@@ -4658,31 +4658,103 @@ public class ProductService {
|
|
|
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
|
|
|
|
|
|
area = length * width;
|
|
|
- for (int i = 0; i < count_list.length; i++) {
|
|
|
- int count_item = count_list[i];
|
|
|
- if (priceList.size() > 2) {
|
|
|
- break;
|
|
|
- }
|
|
|
- if (count > count_item) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- int count_index = Arrays.binarySearch(count_list, count_item);
|
|
|
- price = 0;
|
|
|
- if (count_index >= 0) {
|
|
|
- price = new PriceUtils().TablePrice(area, prices[count_index], areas);
|
|
|
- }
|
|
|
- Product product = new Product();
|
|
|
- product.setCount(count_item);
|
|
|
- product.setPrice(Math.ceil(price * number));
|
|
|
- priceList.add(product);
|
|
|
- }
|
|
|
- return priceList;
|
|
|
+ return getAreaCenterPrice(count_list, count, area, prices, areas, number);
|
|
|
+ case "透卡":
|
|
|
+ prices = new int[][]{
|
|
|
+ {136, 163, 177, 190, 197, 227, 257, 303, 333, 407, 430},
|
|
|
+ {193, 250, 277, 300, 313, 373, 433, 530, 587, 733, 780},
|
|
|
+ {250, 337, 373, 410, 430, 520, 613, 757, 840, 1063, 1133},
|
|
|
+ {307, 423, 473, 523, 547, 670, 790, 983, 1097, 1390, 1483},
|
|
|
+ {333, 463, 520, 573, 603, 737, 873, 1090, 1210, 1540, 1643},
|
|
|
+ {490, 697, 783, 873, 917, 1133, 1350, 1693, 1890, 2417, 2580},
|
|
|
+ {533, 760, 857, 953, 1003, 1237, 1477, 1853, 2067, 2643, 2823},
|
|
|
+ {990, 1440, 1633, 1830, 1927, 2397, 2873, 3627, 4057, 5207, 5567},
|
|
|
+ {2007, 2943, 3347, 3747, 3950, 4927, 5910, 7473, 8367, 10743, 11490},
|
|
|
+ {3013, 4413, 5013, 5613, 5913, 7373, 8847, 11180, 12513, 14077, 16007},
|
|
|
+ };
|
|
|
+ count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000};
|
|
|
+ areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150};
|
|
|
+ area = length * width;
|
|
|
+ return getAreaCenterPrice(count_list, count, area, prices, areas, number);
|
|
|
+ case "澜达海报":
|
|
|
+ //铜版纸200g (售价)
|
|
|
+ prices = new int[][]{
|
|
|
+ {90, 90, 90, 90, 90, 94, 94, 94, 94},
|
|
|
+ {100, 100, 100, 100, 100, 187, 187, 187, 187},
|
|
|
+ {140, 140, 140, 140, 140, 280, 280, 280, 280},
|
|
|
+ {187, 187, 187, 187, 187, 374, 374, 374, 374},
|
|
|
+ {234, 234, 234, 234, 234, 467, 467, 467, 467},
|
|
|
+ {467, 467, 467, 467, 467, 934, 934, 934, 934},
|
|
|
+ {934, 934, 934, 934, 934, 1867, 1867, 1867, 1867},
|
|
|
+ {2334, 2334, 2334, 2334, 2334, 4667, 4667, 4667, 4667},
|
|
|
+ {4667, 4667, 4667, 4667, 4667, 9334, 9334, 9334, 9334},
|
|
|
+ {9334, 9334, 9334, 9334, 9334, 18667, 18667, 18667, 18667},
|
|
|
+ {23334, 23334, 23334, 23334, 23334, 46667, 46667, 46667, 46667},
|
|
|
+ };
|
|
|
+ if ("2".equals(dto.getKind())) {
|
|
|
+ prices = new int[][]{
|
|
|
+ {90, 90, 90, 90, 90, 107, 107, 107, 107},
|
|
|
+ {100, 107, 107, 107, 107, 213, 213, 213, 213},
|
|
|
+ {120, 160, 160, 160, 160, 320, 320, 320, 320},
|
|
|
+ {150, 213, 213, 213, 213, 427, 427, 427, 427},
|
|
|
+ {139, 267, 267, 267, 267, 533, 533, 533, 533},
|
|
|
+ {267, 533, 533, 533, 533, 1067, 1067, 1067, 1067},
|
|
|
+ {533, 1067, 1067, 1067, 1067, 2133, 2133, 2133, 2133},
|
|
|
+ {1333, 2667, 2667, 2667, 2667, 5333, 5333, 5333, 5333},
|
|
|
+ {2667, 5333, 5333, 5333, 5333, 10667, 10667, 10667, 10667},
|
|
|
+ {5333, 10667, 10667, 10667, 10667, 21333, 21333, 21333, 21333},
|
|
|
+ {13333, 26667, 26667, 26667, 26667, 53333, 53333, 53333, 53333},
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if ("3".equals(dto.getKind())) {
|
|
|
+ prices = new int[][]{
|
|
|
+ {90, 90, 90, 90, 90, 150, 150, 150, 150},
|
|
|
+ {100, 140, 140, 150, 150, 300, 300, 300, 300},
|
|
|
+ {110, 207, 207, 223, 223, 447, 447, 447, 447},
|
|
|
+ {140, 277, 277, 300, 300, 597, 597, 597, 597},
|
|
|
+ {180, 347, 347, 373, 373, 747, 747, 747, 747},
|
|
|
+ {347, 693, 693, 747, 747, 1493, 1493, 1493, 1493},
|
|
|
+ {693, 1387, 1387, 1493, 1493, 2987, 2987, 2987, 2987},
|
|
|
+ {1733, 3467, 3467, 3733, 3733, 7467, 7467, 7467, 7467},
|
|
|
+ {3467, 6933, 6933, 7467, 7467, 14933, 14933, 14933, 14933},
|
|
|
+ {6933, 13867, 13867, 14933, 14933, 29867, 29867, 29867, 29867},
|
|
|
+ {17333, 34667, 34667, 37333, 37333, 74667, 74667, 74667, 74667},
|
|
|
+ };
|
|
|
+ }
|
|
|
+ count_list = new int[]{10, 20, 30, 40, 50, 100, 200, 500, 1000, 2000, 5000};
|
|
|
+ areas = new double[]{1197, 1716, 2394, 2596, 3430, 3467.1, 4788, 5192, 6860};
|
|
|
+ area = length * width;
|
|
|
+
|
|
|
+ return getAreaCenterPrice(count_list, count, area, prices, areas, number);
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private List<Product> getAreaCenterPrice(int[] count_list, int count, double area, int[][] prices, double[] areas, int number) {
|
|
|
+ List<Product> priceList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < count_list.length; i++) {
|
|
|
+ int count_item = count_list[i];
|
|
|
+ if (priceList.size() > 2) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (count > count_item) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int count_index = Arrays.binarySearch(count_list, count_item);
|
|
|
+ double price = 0;
|
|
|
+ if (count_index >= 0) {
|
|
|
+ price = new PriceUtils().TablePrice(area, prices[count_index], areas);
|
|
|
+ }
|
|
|
+ Product product = new Product();
|
|
|
+ product.setCount(count_item);
|
|
|
+ product.setPrice(Math.ceil(price * number));
|
|
|
+ priceList.add(product);
|
|
|
+ }
|
|
|
+ return priceList;
|
|
|
+ }
|
|
|
+
|
|
|
private List<Product> lessSticker(Product dto, String kind, Integer number, Double width, Double length,
|
|
|
int count, List<Product> stickersList, String role) {
|
|
|
double price = 0.0;
|