添加重量。修改扇子异形工艺

This commit is contained in:
2025-08-01 11:11:53 +08:00
parent 949fe99610
commit 28d4b5682a
3 changed files with 36 additions and 18 deletions
@@ -2578,6 +2578,7 @@ public class ProductService {
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
}
return priceList;
@@ -2606,9 +2607,9 @@ public class ProductService {
}
}
// double base = number < 6 && number > 1 ? 5 : 0;
// for (Product product : priceList) {
// product.setPrice(product.getPrice() + base);
// }
for (Product product : priceList) {
product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
}
/* } */
@@ -3515,7 +3516,14 @@ public class ProductService {
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple()));
}
if (!StringUtils.isEmpty(dto.getCraft())) {
List<String> craftList = Arrays.asList(dto.getCraft());
if (craftList.contains("异形")) {
for (Product product : priceList) {
product.setPrice(Math.floor(product.getPrice() * 1.2));
}
}
}
// 异形工艺
//getCraft(dto, priceList, null, null, 0);
@@ -3530,7 +3538,7 @@ public class ProductService {
product.setPrice(Math.floor(product.getPrice() * number));
}
// 根据款数重新算重量重量在数据库中
if (!StringUtils.isEmpty(priceList.get(0).getWeight())) {
if (priceList.size() > 0 && !StringUtils.isEmpty(priceList.get(0).getWeight())) {
for (Product product : priceList) {
product.setWeight(df.format(Double.valueOf(product.getWeight()) * number));
}
@@ -4712,7 +4720,12 @@ public class ProductService {
count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000};
areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150};
area = length * width;
return getAreaCenterPrice(count_list, count, area, prices, areas, number);
priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : priceList) {
product.setWeight(df.format(width / 100 * length / 100 * product.getCount() * 0.48 * 1.4));
}
return priceList;
case "澜达海报":
//铜版纸200g 售价
prices = new int[][]{
@@ -4825,7 +4838,11 @@ public class ProductService {
int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000};
double[] areas = new double[]{16, 25, 30.25, 36, 42.25, 49, 56.25, 64, 72.25, 81, 90.25, 100, 110.25, 121};
double area = length * width;
return getAreaCenterPrice(count_list, count, area, prices, areas, number);
List<Product> productList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : productList) {
product.setWeight(df.format(product.getCount() / (product.getCount() / (width * length / 10000) / 0.76 / 1.47) * product.getCount()));
}
return productList;
}
return new ArrayList<>();
}