新增冰箱贴

This commit is contained in:
2025-11-19 16:05:22 +08:00
parent 32310477d6
commit 30af805f2f
2 changed files with 347 additions and 0 deletions
@@ -4733,12 +4733,45 @@ public class ProductService {
return getaromatherapyPrice(dto, width, length);
case "金属微章":
return getbadgePrice(dto, width, length);
case "冰箱贴":
return getfridgePrice(dto, width, length);
default:
break;
}
return null;
}
private List<Product> getfridgePrice(Product dto, Double width, Double length) {
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
String cailiao = dto.getCailiao();
double min_price = 50;
double last_price = 1000;
double area = width * length * dto.getCount() / 10000 * dto.getNumber();
double[] areas = {0, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 2, 3, 5, 7, 9, 10, 20, 50};
int[] prices = {0, 1500, 1480, 1450, 1400, 1380, 1350, 1200, 1100, 1080, 1050, 1000, 1000, 1000, 1000, 1000};
if ("2.3".equals(cailiao) && carft_list.contains("激光")) {
prices = new int[]{0, 1500, 1400, 1350, 1300, 1280, 1250, 1100, 1000, 950, 900, 850, 850, 850, 850, 850};
last_price = 850;
}
if ("4.6".equals(cailiao) && carft_list.contains("CNC")) {
prices = new int[]{0, 1600, 1500, 1480, 1450, 1400, 1380, 1350, 1300, 1250, 1200, 1200, 1200, 1200, 1200, 1200};
last_price = 1200;
}
if ("2.3".equals(cailiao) && carft_list.contains("CNC")) {
prices = new int[]{0, 1500, 1400, 1380, 1350, 1300, 1280, 1250, 1200, 1150, 1100, 1100, 1100, 1100, 1100, 1100};
last_price = 1100;
}
double price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
Product pro = new Product();
pro.setCount(dto.getCount());
pro.setNumber(dto.getNumber());
pro.setPrice(Math.ceil(Math.max(price, min_price) + ((dto.getNumber() - 1) * 8)));
priceList.add(pro);
return priceList;
}
private List<Product> getbadgePrice(Product dto, Double width, Double length) {
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
@@ -4747,6 +4780,7 @@ public class ProductService {
double[][] prices_list = {
{450, 880, 1700, 3250, 5380, 10000, 14728, 23685, 43103},
};
int[] count_list = {
50, 100, 200, 500, 1000, 2000, 3000, 5000, 10000
};