新增镭射吊牌价格

This commit is contained in:
2025-08-04 15:28:34 +08:00
parent f6dda50c22
commit e23440a5e6
4 changed files with 359 additions and 2 deletions
@@ -4639,12 +4639,68 @@ public class ProductService {
return getAreaCenterPrice(count_list, count, area, prices, areas, number);
case "水标":
return getShuibiaoPrice(dto, length, width);
case "镭射吊牌":
return getLeiseDiaoPrice(dto, length, width);
default:
break;
}
return null;
}
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};
int num = getNum(width, length);
List<Product> priceList = new ArrayList<>();
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
for (int i = 0; i < count_list.length; i++) {
int count_item = count_list[i];
if (priceList.size() > 2) {
break;
}
if (dto.getCount() > count_item) {
continue;
}
double price = prices[i];
price = price + price * 0.9 * (num - 1);
Product product = new Product();
product.setCount(count_item);
product.setPrice(Math.ceil(price));
priceList.add(product);
}
for (Product product : priceList) {
int item_count = product.getCount();
double carft_price = 0;
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);
}
if (craft_list.contains("棉绳")) {
carft_price += Math.max(0.015 * item_count, 40);
}
product.setPrice(Math.ceil(product.getPrice() + carft_price) * dto.getNumber());
}
return priceList;
}
private List<Product> getShuibiaoPrice(Product dto, double length, double width) {
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
int count = dto.getCount();