修改双胶纸价格,新增刻字车贴

This commit is contained in:
2025-08-11 14:39:36 +08:00
parent 5261b455e8
commit d60df8d3e2
5 changed files with 367 additions and 7 deletions
@@ -1122,6 +1122,12 @@ public class ProductService {
}
}
}
for (int i = 0; i < priceList.size(); i++) {
if (priceList.get(i).getCount() == 500) {
priceList.get(i).setPrice(Math.floor(priceList.get(i + 1).getPrice() - 5));
}
}
// +棉绳钱 1分5一条
for (Product product : priceList) {
if (!StringUtils.isEmpty(dto.getCraftSheng()) && dto.getCraftSheng().contains("棉绳")) {
@@ -4649,12 +4655,43 @@ public class ProductService {
return getShuibiaoPrice(dto, length, width);
case "镭射吊牌":
return getLeiseDiaoPrice(dto, length, width);
case "刻字车贴":
return getCheTiePrice(dto, length, width);
default:
break;
}
return null;
}
private List<Product> getCheTiePrice(Product dto, double length, double width) {
double minPrice = 35;
length = length / 100;
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;
}
List<Product> priceList = new ArrayList<>();
Product pro = new Product();
double price = basePrice * dto.getCount() * area * dto.getNumber();
if (area <= 0.25) {
price = basePrice * dto.getCount() * area + dto.getNumber() + 6;
}
pro.setPrice(Math.ceil(Math.max(price, minPrice)));
pro.setCount(dto.getCount());
priceList.add(pro);
return priceList;
}
private List<Product> getLeiseDiaoPrice(Product dto, double length, double width) {
double[] prices = new double[]{170, 233, 370, 537, 643, 843, 1613, 3117, 4847};
int[] count_list = new int[]{500, 1000, 2000, 3000, 4000, 5000, 10000, 20000, 30000};
@@ -1045,9 +1045,9 @@ public class PriceUtils {
if (countArr[i] < count || list.size() > 3) {
continue;
}
if (countArr[i] == 500) {
/*if (countArr[i] == 500) {
continue;
}
}*/
pro = new Product();
if (countArr[i] == 500) {
shengzi = 20;