edit
This commit is contained in:
@@ -53,6 +53,7 @@ public class Product {
|
||||
private String kind1Label;
|
||||
|
||||
private String kind2Value;
|
||||
private String kindValue2;
|
||||
|
||||
private String kind2Label;
|
||||
|
||||
@@ -117,6 +118,8 @@ public class Product {
|
||||
private Integer zheye;
|
||||
// 宣传单压痕数
|
||||
private Integer yaheng;
|
||||
private Integer dadianxian;
|
||||
private Integer maxian;
|
||||
// 便签本种类标识--联单/便签本
|
||||
private String notePaperKind;
|
||||
// 画册P数
|
||||
|
||||
@@ -346,23 +346,11 @@ public class ProductService {
|
||||
continue;
|
||||
}
|
||||
int count_index = Arrays.binarySearch(count_list, item_count);
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area > areas[i]) {
|
||||
startIndex = endIndex;
|
||||
endIndex = Math.min(i + 1, areas.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (count_index >= 0) {
|
||||
Product pro = new Product();
|
||||
double price = 0;
|
||||
int[] price_list = prices[count_index];
|
||||
if (startIndex == endIndex) {
|
||||
price = (price_list[endIndex] / areas[endIndex]) * area;
|
||||
} else {
|
||||
price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
|
||||
}
|
||||
double price = new PriceUtils().TablePrice(area, prices[count_index], areas);
|
||||
|
||||
if ("6.5".equals(dto.getToothpick_size())) {
|
||||
price = price + (item_count * 0.1);
|
||||
}
|
||||
@@ -676,6 +664,95 @@ public class ProductService {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ("10".equals(dto.getKindValue2())) {
|
||||
area = length * width;
|
||||
int[][] prices = {
|
||||
{106, 106, 106, 106, 106, 107, 108, 109, 116, 130, 131, 133, 142, 193, 195, 198, 246, 430, 438, 557, 573},
|
||||
{139, 139, 139, 139, 143, 145, 147, 160, 162, 171, 176, 179, 205, 255, 260, 266, 279, 490, 497, 628, 632,},
|
||||
{226, 237, 245, 253, 255, 256, 258, 265, 269, 280, 290, 310, 325, 395, 410, 445, 453, 650, 721, 914, 920},
|
||||
{313, 342, 343, 375, 380, 385, 390, 395, 398, 400, 405, 409, 418, 540, 545, 555, 620, 811, 836, 1056, 1128},
|
||||
{465, 510, 515, 553, 559, 565, 571, 581, 587, 599, 610, 615, 629, 810, 820, 830, 921, 1200, 1250, 1580, 1685},
|
||||
{760, 809, 836, 865, 873, 878, 882, 890, 900, 913, 923, 930, 955, 1208, 1258, 1330, 1500, 1646, 2044, 2086, 2788},
|
||||
{1395, 1412, 1423, 1434, 1454, 1489, 1524, 1530, 1532, 1540, 1545, 1559, 1632, 2210, 2240, 2440, 2850, 3100, 3786, 3866, 5116},
|
||||
};
|
||||
int[][] tang_prices = {
|
||||
{122, 129, 136, 150, 179, 193},
|
||||
{122, 129, 136, 150, 179, 193},
|
||||
{170, 177, 184, 211, 252, 279},
|
||||
{247, 273, 299, 338, 403, 355},
|
||||
{304, 353, 378, 440, 539, 614},
|
||||
{448, 508, 569, 666, 823, 968},
|
||||
{873, 991, 1109, 1298, 1605, 1888}
|
||||
};
|
||||
double[] areas = {16, 25, 30, 35, 36, 40, 45, 48.60, 49, 54, 64, 81, 97.20, 100, 145.80, 172.8, 194.4, 224, 288, 294, 400};
|
||||
double[] tang_areas = {50, 100, 150, 250, 350, 450};
|
||||
int[] count_list = {200, 500, 1000, 2000, 3000, 5000, 10000};
|
||||
List<String> craft_list = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
|
||||
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);
|
||||
double price = 0;
|
||||
double carft_price = 0;
|
||||
double min_carft = 0;
|
||||
if (count_index >= 0) {
|
||||
price = new PriceUtils().TablePrice(area, prices[count_index], areas);
|
||||
|
||||
if (craft_list.contains("打孔")) {
|
||||
carft_price += Math.max(0.03 * item_count, 30);
|
||||
}
|
||||
if (craft_list.contains("压痕")) {
|
||||
carft_price += 0.03 * dto.getYaheng() * item_count;
|
||||
}
|
||||
if (craft_list.contains("打点线")) {
|
||||
carft_price += 0.02 * dto.getDadianxian() * item_count;
|
||||
}
|
||||
if (craft_list.contains("打码")) {
|
||||
carft_price += Math.max(0.05 * dto.getMaxian() * item_count, 15);
|
||||
}
|
||||
if (craft_list.contains("配葫芦针")) {
|
||||
carft_price += Math.max(0.016 * item_count, 10);
|
||||
}
|
||||
if (craft_list.contains("配流苏")) {
|
||||
carft_price += Math.max(0.15 * item_count, 30);
|
||||
}
|
||||
if (craft_list.contains("穿流苏")) {
|
||||
carft_price += Math.max(0.5 * item_count, 100);
|
||||
}
|
||||
if (craft_list.contains("配尼龙绳")) {
|
||||
if ("红色绳子".equals(dto.getShen_color())) {
|
||||
carft_price += Math.max(0.009 * item_count, 10);
|
||||
} else {
|
||||
carft_price += Math.max(0.03 * item_count, 3);
|
||||
}
|
||||
}
|
||||
if (craft_list.contains("穿尼龙绳")) {
|
||||
carft_price += Math.max(0.2 * item_count, 40);
|
||||
}
|
||||
double tang_price = 0;
|
||||
if (craft_list.contains("单面烫金") || craft_list.contains("双面烫金")) {
|
||||
tang_price = new PriceUtils().TablePrice(area, tang_prices[count_index], tang_areas);
|
||||
if (craft_list.contains("双面烫金")) {
|
||||
tang_price = tang_price * 2;
|
||||
}
|
||||
}
|
||||
|
||||
carft_price += tang_price;
|
||||
}
|
||||
|
||||
Product product = new Product();
|
||||
product.setCount(item_count);
|
||||
product.setPrice(Math.ceil((price + carft_price) * number));
|
||||
priceList.add(product);
|
||||
|
||||
}
|
||||
return priceList;
|
||||
}
|
||||
int min = getNum(length, width);
|
||||
priceList = getHekaPrice(min, dto, priceList, count);
|
||||
getCraft(dto, priceList, length * 10, width * 10, min);
|
||||
|
||||
@@ -220,16 +220,18 @@ public class PosterPrice {
|
||||
// 静电贴
|
||||
case "8":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 80;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
if (area > 0 && area <= 1) {
|
||||
danjia = 70;
|
||||
} else if (area > 1 && area <= 2) {
|
||||
danjia = 68;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 65;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 60;
|
||||
danjia = 63;
|
||||
} else {
|
||||
danjia = 45;
|
||||
danjia = 60;
|
||||
}
|
||||
price = area * danjia > 105 ? area * danjia : 105;
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
break;
|
||||
// 软膜
|
||||
case "14":
|
||||
|
||||
@@ -3321,4 +3321,22 @@ public class PriceUtils {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public double TablePrice(double area, int[] price_list, double[] areas) {
|
||||
double price = 0;
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area > areas[i]) {
|
||||
startIndex = endIndex;
|
||||
endIndex = Math.min(i + 1, areas.length - 1);
|
||||
}
|
||||
}
|
||||
if (startIndex == endIndex) {
|
||||
price = (price_list[endIndex] / areas[endIndex]) * area;
|
||||
} else {
|
||||
price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
|
||||
}
|
||||
return price;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user