修改帆布袋,外卖盒。方巾
This commit is contained in:
@@ -1350,7 +1350,7 @@ public class ProductService {
|
||||
double addPrice = 5;
|
||||
|
||||
List<String> craft_list = dto.getCraft() != null ? new ArrayList<>(Arrays.asList(dto.getCraft())) : new ArrayList<>();
|
||||
if (craft_list.contains("压痕")) {
|
||||
if (craft_list.contains("压痕") && ((width <= 10 && length <= 7) || (width <= 7 && length <= 10))) {
|
||||
craft_list.remove("压痕");
|
||||
craft_list.add("异形模切");
|
||||
}
|
||||
@@ -4926,12 +4926,15 @@ public class ProductService {
|
||||
double[][] prices_list = {
|
||||
{450, 880, 1700, 3250, 5380, 10000, 14728, 23685, 43103},
|
||||
};
|
||||
|
||||
double mini_price = 450;
|
||||
int pre_count = 0;
|
||||
double base_price = 0;
|
||||
Product pro = new Product();
|
||||
for (int i = 0; i < count_list.length; i++) {
|
||||
double price = prices_list[0][i];
|
||||
|
||||
int item_count = count_list[i];
|
||||
base_price = prices_list[0][i] / item_count;
|
||||
if (item_count < count) {
|
||||
pre_count = item_count;
|
||||
continue;
|
||||
@@ -4940,23 +4943,33 @@ public class ProductService {
|
||||
break;
|
||||
}
|
||||
//数量小于50
|
||||
Product pro = new Product();
|
||||
if (pre_count > 0 && count > pre_count) {
|
||||
double base_price = prices_list[0][i - 1] / pre_count;
|
||||
|
||||
if ((priceList.size() == 0) && count != item_count && count > pre_count) {
|
||||
if (pre_count > 0) {
|
||||
base_price = prices_list[0][i - 1] / pre_count;
|
||||
}
|
||||
pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setWeight(df.format(0.005 * count * dto.getNumber()));
|
||||
pro.setPrice(Math.ceil(base_price * count * dto.getNumber()));
|
||||
pro.setPrice(Math.max(Math.ceil(base_price * count * dto.getNumber()), mini_price));
|
||||
priceList.add(pro);
|
||||
}
|
||||
base_price = prices_list[0][i] / item_count;
|
||||
pro = new Product();
|
||||
pro.setCount(item_count);
|
||||
pro.setWeight(df.format(0.005 * item_count * dto.getNumber()));
|
||||
pro.setPrice(Math.ceil(price * dto.getNumber()));
|
||||
pro.setPrice(Math.max(Math.ceil(base_price * item_count * dto.getNumber()), mini_price));
|
||||
priceList.add(pro);
|
||||
pre_count = item_count;
|
||||
|
||||
}
|
||||
if (priceList.size() == 0) {
|
||||
pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setWeight(df.format(0.005 * count * dto.getNumber()));
|
||||
pro.setPrice(Math.max(Math.ceil(base_price * count * dto.getNumber()), mini_price));
|
||||
priceList.add(pro);
|
||||
}
|
||||
}
|
||||
if (carft_list.contains("UV印刷")) {
|
||||
int pre_count = 0;
|
||||
@@ -5370,16 +5383,29 @@ public class ProductService {
|
||||
width = width / 100;
|
||||
double area = length * width;
|
||||
double basePrice = 0;
|
||||
if (area < 1) {
|
||||
basePrice = 166;
|
||||
} else if (area < 2) {
|
||||
basePrice = 160;
|
||||
} else if (area < 5) {
|
||||
basePrice = 150;
|
||||
} else if (area < 10) {
|
||||
basePrice = 120;
|
||||
} else {
|
||||
basePrice = 100;
|
||||
if ("1".equals(dto.getKind())) {
|
||||
if (area < 1) {
|
||||
basePrice = 166;
|
||||
} else if (area < 2) {
|
||||
basePrice = 160;
|
||||
} else if (area < 5) {
|
||||
basePrice = 150;
|
||||
} else if (area < 10) {
|
||||
basePrice = 120;
|
||||
} else {
|
||||
basePrice = 100;
|
||||
}
|
||||
}
|
||||
//反光贴
|
||||
if ("2".equals(dto.getKind())) {
|
||||
minPrice = 30;
|
||||
if (area <= 1) {
|
||||
basePrice = 138;
|
||||
} else if (area <= 2) {
|
||||
basePrice = 110;
|
||||
} else {
|
||||
basePrice = 100;
|
||||
}
|
||||
}
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
Product pro = new Product();
|
||||
|
||||
Reference in New Issue
Block a user