价格取整
This commit is contained in:
@@ -45,7 +45,7 @@ public class PVCStickersPrice {
|
|||||||
} else if (product.getCount() == 100000) {
|
} else if (product.getCount() == 100000) {
|
||||||
price = 700;
|
price = 700;
|
||||||
}
|
}
|
||||||
product.setPrice(product.getPrice() + price);
|
product.setPrice(Math.ceil(product.getPrice() + price));
|
||||||
}
|
}
|
||||||
} else if ((length <= 9 && width <= 5.4) || (length <= 5.4 && width <= 9)) {
|
} else if ((length <= 9 && width <= 5.4) || (length <= 5.4 && width <= 9)) {
|
||||||
for (Product product : stickersList) {
|
for (Product product : stickersList) {
|
||||||
@@ -78,7 +78,7 @@ public class PVCStickersPrice {
|
|||||||
} else if (product.getCount() == 100000) {
|
} else if (product.getCount() == 100000) {
|
||||||
price = 1500;
|
price = 1500;
|
||||||
}
|
}
|
||||||
product.setPrice(product.getPrice() + price);
|
product.setPrice(Math.ceil(product.getPrice() + price));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (Product product : stickersList) {
|
for (Product product : stickersList) {
|
||||||
@@ -99,7 +99,7 @@ public class PVCStickersPrice {
|
|||||||
} else {
|
} else {
|
||||||
price = 3;
|
price = 3;
|
||||||
}
|
}
|
||||||
product.setPrice(product.getPrice() + (price * area > 50 ? price * area : 50));
|
product.setPrice(Math.ceil(product.getPrice() + (price * area > 50 ? price * area : 50)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return stickersList;
|
return stickersList;
|
||||||
|
|||||||
@@ -2322,7 +2322,7 @@ public class PriceUtils {
|
|||||||
// 根据款数重新算价格
|
// 根据款数重新算价格
|
||||||
for (Product product : list) {
|
for (Product product : list) {
|
||||||
product.setWeight(df.format(length * width * product.getCount() / 10000 * 0.3 * number));
|
product.setWeight(df.format(length * width * product.getCount() / 10000 * 0.3 * number));
|
||||||
product.setPrice(Math.floor(product.getPrice() * number));
|
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||||
}
|
}
|
||||||
} else if ("双面印刷".equals(craftShua)) {
|
} else if ("双面印刷".equals(craftShua)) {
|
||||||
// 数量
|
// 数量
|
||||||
@@ -2341,7 +2341,7 @@ public class PriceUtils {
|
|||||||
}
|
}
|
||||||
// 根据款数重新算价格
|
// 根据款数重新算价格
|
||||||
for (Product product : list) {
|
for (Product product : list) {
|
||||||
product.setPrice(Math.floor(product.getPrice() * number));
|
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2398,7 +2398,7 @@ public class PriceUtils {
|
|||||||
price = fixPrice + (num - 5 > 0 ? num - 5 : 0) * zhang + designFee * number + 0.1 * count * number;
|
price = fixPrice + (num - 5 > 0 ? num - 5 : 0) * zhang + designFee * number + 0.1 * count * number;
|
||||||
Product dto = new Product();
|
Product dto = new Product();
|
||||||
dto.setCount(count);
|
dto.setCount(count);
|
||||||
dto.setPrice(price);
|
dto.setPrice(Math.ceil(price));
|
||||||
list.add(dto);
|
list.add(dto);
|
||||||
} else {
|
} else {
|
||||||
// 数量
|
// 数量
|
||||||
@@ -2418,7 +2418,7 @@ public class PriceUtils {
|
|||||||
// 根据款数重新算价格
|
// 根据款数重新算价格
|
||||||
for (Product product : list) {
|
for (Product product : list) {
|
||||||
product.setWeight(df.format(weight));
|
product.setWeight(df.format(weight));
|
||||||
product.setPrice(Math.floor(product.getPrice() * number));
|
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user