新增防油手提袋
This commit is contained in:
@@ -4460,12 +4460,77 @@ public class ProductService {
|
||||
case "手举牌":
|
||||
priceList = getHoldSignPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "防油纸袋":
|
||||
priceList = getOilProofPaperPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getOilProofPaperPrice(Product dto, Double width, Double length, Double height) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
|
||||
int[] counts = {20000, 30000, 50000, 100000, 200000};
|
||||
double[] rates = {0.4, 0.38, 0.35, 0.32, 0.3};
|
||||
double area = Math.max(width, length) * (Math.min(width, length) + dto.getXx());
|
||||
|
||||
double[] base_prices = {0.0202 + area * 0.0001304, 0.0202 + area * 0.0001304, 0.0182 + area * 0.0001304, 0.0162 + area * 0.0001304, 0.0142 + area * 0.0001304};
|
||||
double[] prices = {0.6, 0.62, 0.65, 0.68, 0.7};
|
||||
int leftIdx = 0;
|
||||
int rightIdx = 0;
|
||||
if (count <= counts[0]) {
|
||||
leftIdx = rightIdx = 0;
|
||||
} else if (count >= counts[counts.length - 1]) {
|
||||
leftIdx = rightIdx = counts.length - 1;
|
||||
} else {
|
||||
// 找到第一个大于 Q 的档位索引
|
||||
int i = 0;
|
||||
while (i < counts.length && counts[i] < count) {
|
||||
i++;
|
||||
}
|
||||
leftIdx = i - 1;
|
||||
rightIdx = i;
|
||||
}
|
||||
double price = 0;
|
||||
if (leftIdx == rightIdx) {
|
||||
price = Math.ceil(base_prices[leftIdx] / prices[leftIdx] * count);
|
||||
} else {
|
||||
double base_count = (count - counts[leftIdx]) / (counts[rightIdx] - counts[leftIdx]);
|
||||
price = Math.ceil(((base_prices[leftIdx] + (base_count) * (base_prices[rightIdx] - base_prices[leftIdx]) + area * 0.0001304) / (1 - (rates[leftIdx] + (base_count) * (rates[rightIdx] - rates[leftIdx]))) * count) / 10) * 10;
|
||||
}
|
||||
double color_price = 0;
|
||||
double base_color_price = 150;
|
||||
if (area <= 462) {
|
||||
base_color_price = 150;
|
||||
} else if (area <= 728) {
|
||||
base_color_price = 200;
|
||||
} else {
|
||||
base_color_price = 250;
|
||||
}
|
||||
if (craft_list.contains("单色")) {
|
||||
color_price = base_color_price * 1;
|
||||
} else if (craft_list.contains("两色")) {
|
||||
color_price = base_color_price * 2;
|
||||
} else if (craft_list.contains("三色")) {
|
||||
color_price = base_color_price * 3;
|
||||
} else if (craft_list.contains("四色")) {
|
||||
color_price = base_color_price * 4;
|
||||
}
|
||||
|
||||
double design_price = 0;
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(Math.max(Math.ceil(price), 0) * number + design_price + color_price);
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getHoldSignPrice(Product dto, Double width, Double length, Double height) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
@@ -7675,7 +7740,7 @@ public class ProductService {
|
||||
price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
|
||||
|
||||
}
|
||||
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
||||
|
||||
return price;
|
||||
}
|
||||
|
||||
@@ -7695,11 +7760,16 @@ public class ProductService {
|
||||
if (carft_list.contains("激光") && carft_list.contains("滴胶")) {
|
||||
price = price * 1.3;
|
||||
}
|
||||
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
||||
|
||||
if (carft_list.contains("二层旋转")) {
|
||||
price += getOtherFridgePrice(dto.getLengthSize(), dto.getWidthSize(), dto, 0, carft_list);
|
||||
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
||||
|
||||
}
|
||||
if (carft_list.contains("三层旋转")) {
|
||||
price += getOtherFridgePrice(dto.getLengthTang(), dto.getWidthTang(), dto, 0, carft_list);
|
||||
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
||||
}
|
||||
weight = df.format(width * length * 4.17 * dto.getCount() * 0.1 * number / 1000 * Double.parseDouble(cailiao));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user