Merge branch 'main' into temp

This commit is contained in:
2025-06-14 14:03:47 +08:00
2 changed files with 25 additions and 13 deletions
@@ -2543,19 +2543,20 @@ public class ProductService {
}
//一张大纸能放几个
double num = Math.min(Math.floor(paperLength / length) * Math.floor(paperWidth / width), Math.floor(paperLength / width) * Math.floor(paperWidth / length));
double num = Math.max(Math.min(Math.floor(paperLength / length) * Math.floor(paperWidth / width), Math.floor(paperLength / width) * Math.floor(paperWidth / length)), 1);
if (craft_list.contains("烫画")) {
num = Math.max(Math.ceil(paperLength / length) * Math.ceil(paperWidth / width), Math.ceil(paperLength / width) * Math.ceil(paperWidth / length));
}
double baseCount = Math.max(Math.ceil(dto.getCount() * dto.getNumber() / num), 1);
double countNum = Math.max(Math.ceil(dto.getNumber() / num), 1);
int coNumber = dto.getCo_number();
if (coNumber <= 0) {
coNumber = 1;
}
double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber);
double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum);
Product pro = new Product();
pro.setCount(dto.getCount());
@@ -2569,7 +2570,8 @@ public class ProductService {
break;
}
baseCount = Math.max(Math.ceil(quantitySteps[i] * dto.getNumber() / num), 1);
double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber);
countNum = Math.max(Math.ceil(dto.getNumber() / num), 1);
double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber, countNum);
pro = new Product();
@@ -2578,9 +2580,9 @@ public class ProductService {
priceList.add(pro);
}
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
}
// for (Product product : priceList) {
// product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
// }
return priceList;
}