修改多种价格,新增多种工艺

This commit is contained in:
2026-03-21 15:11:27 +08:00
parent 928a247c10
commit fd44d8f3e3
7 changed files with 394 additions and 246 deletions
@@ -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) {