修改多种价格,新增多种工艺
This commit is contained in:
@@ -2786,6 +2786,12 @@ public class ProductService {
|
||||
if (craft_list.size() > 0 && craft_list.contains("绳子")) {
|
||||
price += Math.max(5, Math.ceil(0.1 * number * count));
|
||||
}
|
||||
if (craft_list.size() > 0 && craft_list.contains("葫芦针")) {
|
||||
price += Math.max(Math.ceil(0.04 * number * count), 5);
|
||||
}
|
||||
if (craft_list.size() > 0 && craft_list.contains("棉绳")) {
|
||||
price += Math.max(Math.ceil(0.1 * number * count), 5);
|
||||
}
|
||||
Product dto2 = new Product();
|
||||
dto2.setCount(av_count);
|
||||
dto2.setWeight(df.format(number * (length / 100) * (width / 100) * av_count * 0.3 * 0.86));
|
||||
@@ -3943,19 +3949,7 @@ public class ProductService {
|
||||
return priceList;
|
||||
// 暖心贴
|
||||
case "27":
|
||||
priceList = productMapper.getThanPrice(dto);
|
||||
/*
|
||||
* if (priceList.size() >= 4) { priceList = priceList.subList(0, 4); }
|
||||
*/
|
||||
// 产品价格倍数
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple()));
|
||||
}
|
||||
// 根据款数重新算价格
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.floor(product.getPrice() * number));
|
||||
}
|
||||
return priceList;
|
||||
return getWarmStickerPrice(dto, width, length);
|
||||
// 彩色信纸
|
||||
case "彩色信纸":
|
||||
length = length * 10;
|
||||
@@ -4801,6 +4795,58 @@ public class ProductService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getWarmStickerPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
if ("自定义".equals(dto.getStickerKind())) {
|
||||
|
||||
int[][] prices = {
|
||||
{85, 85, 85, 145, 200, 400},
|
||||
{85, 85, 85, 150, 233, 233},
|
||||
{85, 85, 85, 222, 336, 673},
|
||||
};
|
||||
int[] counts = {5, 10, 20, 50, 100, 200};
|
||||
int price_index = 0;
|
||||
if (width == 7.5 && length > 7.5) {
|
||||
price_index = 1;
|
||||
}
|
||||
if ((width == 10 && length == 7.5) || (length == 10 && width == 7.5)) {
|
||||
price_index = 2;
|
||||
}
|
||||
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int itemCount = counts[i];
|
||||
if (count > itemCount) {
|
||||
continue;
|
||||
}
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
Product pro = new Product();
|
||||
pro.setPrice(Math.ceil(prices[price_index][i]));
|
||||
pro.setCount(itemCount);
|
||||
pro.setNumber(number);
|
||||
priceList.add(pro);
|
||||
}
|
||||
|
||||
} else {
|
||||
priceList = productMapper.getThanPrice(dto);
|
||||
|
||||
// 产品价格倍数
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple()));
|
||||
}
|
||||
|
||||
}
|
||||
// 根据款数重新算价格
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||
}
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getTearingJoyPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
@@ -4912,6 +4958,9 @@ public class ProductService {
|
||||
pro.setPrice(Math.ceil((double) prices[prices.length - 1] / counts[counts.length - 1] * Math.max(min_count, count) + craft_price));
|
||||
priceList.add(pro);
|
||||
}
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||
}
|
||||
return priceList;
|
||||
}
|
||||
|
||||
@@ -6139,7 +6188,7 @@ public class ProductService {
|
||||
if (area <= 0.25) {
|
||||
price = basePrice * dto.getCount() * area * dto.getNumber() + dto.getNumber() + 6;
|
||||
}
|
||||
pro.setPrice(Math.ceil(Math.max(price, minPrice)));
|
||||
pro.setPrice(Math.ceil(Math.max(price * 1.2, minPrice)));
|
||||
pro.setCount(dto.getCount());
|
||||
pro.setWeight(df.format(area * 0.25 * number));
|
||||
priceList.add(pro);
|
||||
@@ -7209,7 +7258,6 @@ public class ProductService {
|
||||
if (dto.getN_mq_num() >= 200) {
|
||||
base_price = 10;
|
||||
}
|
||||
base_price += 4;
|
||||
for (Product product : stickersList) {
|
||||
double price = product.getPrice();
|
||||
product.setPrice(price + ((dto.getN_mq_num() - 1) * base_price));
|
||||
@@ -7254,9 +7302,15 @@ public class ProductService {
|
||||
// }
|
||||
// }
|
||||
|
||||
if ("印白墨".equals(dto.getYinbai()) && !"6".equals(kind) && !"拉丝银".equals(kind) && !"银平光".equals(kind)) {
|
||||
if ("印白墨".equals(dto.getYinbai()) && !"6".equals(kind) && !"3".equals(kind) && !"拉丝银".equals(kind) && !"银平光".equals(kind)) {
|
||||
stickersList = new PVCStickersPrice().acountYinbaiPrice(length, width, stickersList);
|
||||
}
|
||||
if ("印白墨".equals(dto.getYinbai()) && "3".equals(kind)) {
|
||||
for (Product product : stickersList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() + Math.max(150, 100 + 0.12 * product.getCount())));
|
||||
}
|
||||
//max(150, 0.5 * (长 + 出血 * 2) * (宽 + 出血 * 2) / 10000 * 数量) * 款数
|
||||
}
|
||||
// 价格*款数 铜版纸放到外面执行
|
||||
if (!"0".equals(dto.getKindValue()) && !"1".equals(kind)) {
|
||||
if (number > 1) {
|
||||
|
||||
@@ -332,7 +332,7 @@ public class PosterPrice {
|
||||
if (number > 1 && width * length >= 40 * 50) {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price ));
|
||||
pro.setPrice(Math.ceil(price));
|
||||
}
|
||||
pro.setWeight(weight);
|
||||
list.add(pro);
|
||||
@@ -372,9 +372,9 @@ public class PosterPrice {
|
||||
case "1":
|
||||
// 根据面积得到单价
|
||||
areas = new double[]{2, 5, 7, 8, 10, 20, 50};
|
||||
prices = new double[]{55, 45, 40, 37, 31, 29, 27};
|
||||
prices = new double[]{50, 40, 35, 32, 26, 24, 22};
|
||||
last_price = 26;
|
||||
min_price += 50 + 15;
|
||||
min_price += 50 - 5;
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.25 * number));
|
||||
break;
|
||||
// 户外写真可移白胶、黑胶
|
||||
|
||||
@@ -2174,7 +2174,7 @@ public class PriceUtils {
|
||||
if (dto.getN_mq_num() > 0) {
|
||||
price += 10 * dto.getN_mq_num();
|
||||
}
|
||||
price = Math.ceil(price + (number - 1) * 8);
|
||||
price = Math.ceil(price + (number - 1) * 5);
|
||||
pro.setCount(count / number);
|
||||
pro.setPrice(price);
|
||||
list.add(pro);
|
||||
@@ -3694,7 +3694,8 @@ public class PriceUtils {
|
||||
} else {
|
||||
basePrice = 70;
|
||||
}
|
||||
return Math.max(Math.ceil(area * basePrice), 50);
|
||||
|
||||
return Math.max(Math.ceil(area * basePrice * 1.2), 50);
|
||||
}
|
||||
double price = 0;
|
||||
if (craft_list.contains("冷转印")) {
|
||||
@@ -3721,7 +3722,7 @@ public class PriceUtils {
|
||||
price = price + (coNumber - 1) * 100;
|
||||
}
|
||||
|
||||
return Math.ceil(price);
|
||||
return Math.ceil(price * 0.9);
|
||||
}
|
||||
|
||||
public static List<Product> getYinBaiPrice(List<Product> productList, double width, double length) {
|
||||
|
||||
Reference in New Issue
Block a user