新增手提袋烫金
This commit is contained in:
@@ -1983,6 +1983,7 @@ public class ProductService {
|
||||
// 牛皮纸手提袋
|
||||
case "11":
|
||||
List<Product> hanbagList = new ArrayList<Product>();
|
||||
craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
// 没有尺寸,就是常规,查询数据库
|
||||
if (StringUtils.isEmpty(size) && !dto.getK().equals("4")) {
|
||||
// 各常规尺寸展开的长宽--用于计算重量
|
||||
@@ -2097,9 +2098,11 @@ public class ProductService {
|
||||
|
||||
return priceList;
|
||||
}
|
||||
double sizeLength = 0.0;
|
||||
double sizeWidth = 0.0;
|
||||
// 厘米转成毫米
|
||||
length = length * 10;
|
||||
width = width * 10;
|
||||
sizeLength = length = length * 10;
|
||||
sizeWidth = width = width * 10;
|
||||
height = height * 10;
|
||||
length = (length + width) * 2 + 20;
|
||||
height = (height + (width / 2 + 20)) + 40;
|
||||
@@ -2163,6 +2166,14 @@ public class ProductService {
|
||||
}
|
||||
} else {
|
||||
for (Product product : priceList) {
|
||||
double craft_price = 0.0;
|
||||
if (craft_list.contains("烫金")) {
|
||||
craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number), 200);
|
||||
}
|
||||
if (craft_list.contains("双面")) {
|
||||
craft_price = Math.max(Math.ceil((sizeWidth + 2) * (sizeLength + 2) * 0.00015 * (product.getCount() + 50) * number * 2), 200);
|
||||
}
|
||||
product.setPrice(Math.ceil(product.getPrice() + craft_price));
|
||||
product.setWeight(df.format(number * length / 1000 * height / 1000 * product.getCount() * 0.25 * 1.25));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user