新增封口贴
This commit is contained in:
@@ -420,7 +420,7 @@ public class ProductService {
|
||||
if ("18".equals(kind)) {
|
||||
kind = "7";
|
||||
}
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai(), dto.getCraftTang(), getStickersTanBasePrice(area * 10000));
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai(), dto.getCraftTang(), getStickersTanBasePrice(area * 10000), dto);
|
||||
// 根据款数重新算价格/计算重量
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.floor(product.getPrice() * number));
|
||||
@@ -645,7 +645,7 @@ public class ProductService {
|
||||
case "2":
|
||||
// 单个产品的面积
|
||||
area = (length + 0.3) * (width + 0.3) / 10000;
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai(), dto.getCraftTang(), getStickersTanBasePrice(area * 10000));
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai(), dto.getCraftTang(), getStickersTanBasePrice(area * 10000), dto);
|
||||
// 根据款数重新算价格/计算重量
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.floor(product.getPrice() * number));
|
||||
|
||||
@@ -27,9 +27,33 @@ public class PriceUtils {
|
||||
* @param yinbai
|
||||
* @return
|
||||
*/
|
||||
public List<Product> rollLabelPrice(String kind, Double area, int count, String[] craft, String yinbai, String tang, double[] tangPrices) {
|
||||
public List<Product> rollLabelPrice(String kind, Double area, int count, String[] craft, String yinbai, String tang, double[] tangPrices, Product dto) {
|
||||
List<Product> list = new ArrayList<Product>();
|
||||
Product pro = new Product();
|
||||
|
||||
if ("封口贴".equals(dto.getKind())) {
|
||||
int[] counts = {1000, 2000, 3000, 5000, 10000, 20000, 50000, 100000};
|
||||
double[] prices = {180, 260, 311, 400, 558, 650, 1100, 1800};
|
||||
if ("9*2".equals(dto.getSize())) {
|
||||
prices = new double[]{180, 260, 311, 400, 558, 650, 1100, 1800};
|
||||
}
|
||||
if ("10*2".equals(dto.getSize())) {
|
||||
prices = new double[]{220, 300, 337, 412, 600, 680, 1200, 1980};
|
||||
}
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
if (counts[i] < dto.getCount()) {
|
||||
continue;
|
||||
}
|
||||
if (list.size() > 2) {
|
||||
break;
|
||||
}
|
||||
pro = new Product();
|
||||
pro.setCount(counts[i]);
|
||||
pro.setPrice(prices[i] );
|
||||
list.add(pro);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
// 最低收费
|
||||
double lowerPrice = 0.0;
|
||||
// 印工价格
|
||||
@@ -281,8 +305,9 @@ public class PriceUtils {
|
||||
// 换成毫米每边+2
|
||||
length = length * 10 + 4;
|
||||
width = width * 10 + 4;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸能做多少个此类尺寸的不干胶
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
@@ -332,8 +357,9 @@ public class PriceUtils {
|
||||
// 换成毫米每边+2
|
||||
length = length * 10 + 4;
|
||||
width = width * 10 + 4;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸能做多少个此类尺寸的不干胶
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
@@ -1328,8 +1354,9 @@ public class PriceUtils {
|
||||
width = width * 10 + 2 * 1.5;
|
||||
// 数量*款数就是张数
|
||||
// count = count * number;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸29*19cm 能做多少个此类尺寸的金属标
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
@@ -1998,8 +2025,9 @@ public class PriceUtils {
|
||||
width = width * 10 + 2 * 1.5;
|
||||
// 数量*款数就是张数
|
||||
count = count * number;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸45*40cm 能做多少个此类尺寸的桌贴
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
@@ -2100,8 +2128,9 @@ public class PriceUtils {
|
||||
width = width * 10 + 2 * 3;
|
||||
// 数量 * 款数就是张数
|
||||
count = count * number;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸420*380mm 能做多少个此类尺寸的桌贴
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
@@ -3305,8 +3334,9 @@ public class PriceUtils {
|
||||
String kind = dto.getKind2Value();
|
||||
length = length * 10;
|
||||
width = width * 10;
|
||||
if ((length > l || width > w) && (length > w || width > l))
|
||||
if ((length > l || width > w) && (length > w || width > l)) {
|
||||
return null;
|
||||
}
|
||||
// 一张大纸能做多少个此类尺寸的不干胶
|
||||
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
|
||||
Math.floor(l / width) * Math.floor(w / length));
|
||||
|
||||
Reference in New Issue
Block a user