新增冰箱贴背卡工艺

This commit is contained in:
2025-12-19 09:54:38 +08:00
parent 493749f355
commit 23465fcf3b
6 changed files with 147 additions and 14 deletions
@@ -4747,7 +4747,7 @@ public class ProductService {
case "金属微章":
return getbadgePrice(dto, width, length);
case "冰箱贴":
return getfridgePrice(dto, width, length);
return getfridgePrice(dto, width, length, role);
case "帆布袋":
return getCanvasBagPrice(dto, width, length);
case "外卖盒":
@@ -5130,7 +5130,7 @@ public class ProductService {
return priceList;
}
private List<Product> getfridgePrice(Product dto, Double width, Double length) {
private List<Product> getfridgePrice(Product dto, Double width, Double length, String role) {
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
String cailiao = dto.getCailiao();
@@ -5152,11 +5152,74 @@ public class ProductService {
last_price = 1100;
}
double price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
double card_price = 0;
if (carft_list.contains("背卡")) {
String card_size = dto.getSize1();
int card_count = dto.getShuliang();
int card_number = dto.getPinzhong();
double card_width = Double.parseDouble(card_size.split("\\*")[0]);
double card_length = Double.parseDouble(card_size.split("\\*")[1]);
// 出血一边2毫米
card_length = card_length * 10 + 4;
card_width = card_width * 10 + 4;
double fixPrice = 30.0;
double zhang = 6;
if (carft_list.contains("背卡异形模切")) {
fixPrice = 32.0;
zhang = 8;
}
double l = 420;
double w = 285;
double designFee = 0;
if ((card_length - 4 <= 90 && card_width - 4 <= 54) || (card_length - 4 <= 54 && card_width - 4 <= 90)) {
designFee = 8;
} else if ((card_length - 4 <= 210 && card_width - 4 <= 140) || (card_length - 4 <= 140 && card_width - 4 <= 210)) {
designFee = 15;
} else if ((card_length - 4 <= 285 && card_width - 4 - 4 <= 210) || (card_length - 4 <= 210 && card_width - 4 <= 285)) {
designFee = 35;
} else if ((card_length - 4 <= 420 && card_width - 4 <= 285) || (card_length - 4 <= 285 && card_width - 4 <= 420)) {
designFee = 50;
} else {
designFee = 80;
}
double max = 1;
if (card_length == 424 || card_length == 289 || card_width == 424 || card_width == 289) {
max = Math.max(Math.floor(l / (card_length - 4)) * Math.floor(w / (card_width - 4)), Math.floor(l / (card_width - 4)) * Math.floor(w / (card_length - 4)));
} else {
max = Math.max(Math.floor(l / card_length) * Math.floor(w / card_width), Math.floor(l / card_width) * Math.floor(w / card_length));
}
max = Math.max(max, 1);
// 报的数量需要多少张大纸
// 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
int num = (int) Math.ceil(card_count * card_number / max);
card_price = fixPrice + (num - 1) * zhang + designFee + 0.2 * card_number * card_count;
if (((card_width > 42 && card_length > 28.5) || (card_width > 28.5 && card_length > 42))) {
card_price = Math.max(Math.ceil(card_price * 0.85), fixPrice + designFee);
}
double desFee = 0;
if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) {
if (card_number > 1) {
desFee = 5.5 * (card_number - 1);
}
} else {
//第二款开始的设计费按照式设计内容
if (card_number > 1) {
desFee = 5.5;
}
}
card_price += desFee;
}
Product pro = new Product();
pro.setCount(dto.getCount());
pro.setNumber(dto.getNumber());
pro.setWeight(df.format(width * length * 4.17 * dto.getCount() * 0.1 / 1000 * Double.parseDouble(cailiao)));
pro.setPrice(Math.ceil(Math.max(price, min_price) + ((dto.getNumber() - 1) * 8)));
pro.setPrice(Math.ceil(Math.max(price, min_price) + ((dto.getNumber() - 1) * 8) + card_price));
priceList.add(pro);
return priceList;