新增香薰卡

This commit is contained in:
2025-11-13 09:49:27 +08:00
parent 31ed14ceed
commit 6ddf69dfc8
3 changed files with 957 additions and 0 deletions
@@ -1742,6 +1742,16 @@ public class ProductService {
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * number * min * zhekou));
}
//直角的价格 按照报价系统乘以2.3 异形的按照报价系统的价格乘以1.5哈
if ("金绒".equals(kind) && craft_list.contains("白墨")) {
for (Product product : priceList) {
if (craft_list.contains("异形模切")) {
product.setPrice(Math.ceil(product.getPrice() * 1.5));
} else {
product.setPrice(Math.ceil(product.getPrice() * 2.3));
}
}
}
if ("芳怡".equals(kind) || "草香".equals(kind)) {
for (Product product : priceList) {
product.setPrice(Math.floor(product.getPrice() * 1.5));
@@ -2627,6 +2637,7 @@ public class ProductService {
// 1006 1003 1005 1037 1058 1002 1033 1045 卓盛 航和 米笛儿 竹范 领淘文具 榆家 涛莱 拼多多uv单独报价
List<String> crafts = new ArrayList<>(dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()));
crafts.remove("刮板");
crafts.remove("哑光");
if (crafts.size() > 0 && "烫金".equals(crafts.get(0))) {
crafts.remove(0);
}
@@ -4854,12 +4865,76 @@ public class ProductService {
return getLightPrice(dto, length, width);
case "淋膜纸":
return getLingmoPrice(dto, width, length);
case "香薰卡":
return getaromatherapyPrice(dto, width, length);
default:
break;
}
return null;
}
private List<Product> getaromatherapyPrice(Product dto, Double width, Double length) {
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
//大纸尺寸
double max_width = 290;
double max_length = 390;
double base_price = 21;
double min_price = 50;
if ("2".equals(dto.getKind())) {
max_width = 420;
max_length = 310;
base_price = 30;
min_price = 60;
}
if ("3".equals(dto.getKind())) {
max_width = 420;
max_length = 310;
base_price = 35;
min_price = 60;
}
width = width * 10 + 4;
length = length * 10 + 4;
double max = 1;
if (length == max_width + 4 || length == max_length + 4 || width == max_width + 4 || width == max_length + 4) {
max = Math.max(Math.floor(max_width / (length - 4)) * Math.floor(max_length / (width - 4)), Math.floor(max_width / (width - 4)) * Math.floor(max_length / (length - 4)));
} else {
max = Math.max(Math.floor(max_width / length) * Math.floor(max_length / width), Math.floor(max_width / width) * Math.floor(max_length / length));
}
max = Math.max(max, 1);
// 报的数量需要多少张大纸
// 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
double num = Math.ceil(dto.getCount() * dto.getNumber() / max);
double craft_price = 0;
if (carftList.contains("单独包装")) {
craft_price += Math.ceil(0.2 * dto.getCount() * dto.getNumber());
}
if (carftList.contains("真空包装")) {
craft_price += Math.ceil(0.35 * dto.getCount() * dto.getNumber());
}
if (carftList.contains("配涤纶丝带")) {
craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber());
}
if (carftList.contains("配吊牌绳")) {
craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber());
}
if (carftList.contains("配弹力绳")) {
craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber());
}
if (carftList.contains("穿涤纶丝带") || carftList.contains("穿吊牌绳") || carftList.contains("穿弹力绳")) {
craft_price += Math.ceil(0.15 * dto.getCount() * dto.getNumber());
}
Product pro = new Product();
pro.setPrice(Math.ceil(Math.max(base_price * num, min_price) + craft_price));
pro.setCount(dto.getCount());
pro.setNumber(dto.getNumber());
pro.setWeight(df.format(dto.getNumber() * (length - 4) / 1000 * (width - 4) / 1000 * dto.getCount() * 0.2 * 0.86));
priceList.add(pro);
return priceList;
}
private List<Product> getLingmoPrice(Product dto, Double width, Double length) {
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
String[] sizes = {"21*29", "36*24", "36*26", "42*28.5"};