新增滴胶转印贴
This commit is contained in:
@@ -4469,12 +4469,50 @@ public class ProductService {
|
||||
case "地垫":
|
||||
priceList = getFloorMatPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "滴胶转印贴":
|
||||
priceList = getDippingPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getDippingPrice(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 max_width = 290;
|
||||
int max_length = 400;
|
||||
width = width * 10 + 4;
|
||||
length = length * 10 + 4;
|
||||
double max = 1;
|
||||
|
||||
if (length == max_width + 4 || length == max_length + 4 || width == max_width + 4 || width == max_length + 4) {
|
||||
max = Math.max(Math.floor(max_width / (length - 4)) * Math.floor(max_length / (width - 4)), Math.floor(max_width / (width - 4)) * Math.floor(max_length / (length - 4)));
|
||||
} else {
|
||||
max = Math.max(Math.floor(max_width / length) * Math.floor(max_length / width), Math.floor(max_width / width) * Math.floor(max_length / length));
|
||||
}
|
||||
max = Math.max(max, 1);
|
||||
// 报的数量需要多少张大纸
|
||||
// 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
|
||||
double num = Math.ceil(count * number / max);
|
||||
|
||||
int[] counts = {1, 2, 3, 10, 50, 100, 200, 300, 400, 500};
|
||||
double[] prices = {233.4, 233.4, 257.2, 857.2, 3500, 4000, 5000, 7500, 10000, 12500};
|
||||
|
||||
double price = new PriceUtils().TableCountCenterPrice((int) num, prices, counts);
|
||||
double design_price = number * 8;
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(Math.ceil(price) + design_price);
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getFloorMatPrice(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<>();
|
||||
@@ -9861,6 +9899,38 @@ public class ProductService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("特种纸名片".equals(dto.getProTypeValue()) && craftList.contains("异形模切")) {// 200-500张按照原有的价格乘以3倍 1000-5000张按照原有的价格乘以2.4倍 5000-10000张按照原有的价格乘以2倍
|
||||
double[] prices = {1560, 1720, 2320, 5840, 8520, 9680, 12900};
|
||||
int[] counts = {200, 500, 1000, 2000, 3000, 5000, 10000};
|
||||
int num = getNum(width, length);
|
||||
double[][] prices_area = {
|
||||
{112, 152, 208, 376, 552, 888, 1328},
|
||||
{200, 280, 380, 688, 1000, 1620, 2420},
|
||||
{272, 376, 500, 912, 1320, 2140, 3100},
|
||||
{328, 448, 600, 1088, 1576, 2440, 3600},
|
||||
{380, 520, 696, 1260, 1832, 2740, 4100},
|
||||
{480, 640, 880, 1520, 2040, 3200, 4800},
|
||||
{600, 760, 1040, 2000, 2760, 3920, 5700},
|
||||
{720, 880, 1200, 2480, 3480, 4640, 6600},
|
||||
{840, 1000, 1360, 2960, 4200, 5360, 7500},
|
||||
{960, 1120, 1520, 3440, 4920, 6080, 8400},
|
||||
{1080, 1240, 1680, 3920, 5640, 6800, 9300},
|
||||
{1200, 1360, 1840, 4400, 6360, 7520, 10200},
|
||||
{1320, 1480, 2000, 4880, 7080, 8240, 11100},
|
||||
{1440, 1600, 2160, 5360, 7800, 8960, 12000},
|
||||
};
|
||||
if (num < 15) {
|
||||
prices = prices_area[num - 1];
|
||||
}
|
||||
for (Product product : priceList) {
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
if (counts[i] == product.getCount()) {
|
||||
product.setPrice(prices[i] * dto.getNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (craftList.contains("压痕")) {
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() + Math.max(0.03 * product.getCount(), 20)));
|
||||
@@ -10051,38 +10121,7 @@ public class ProductService {
|
||||
product.setPrice(Math.ceil(product.getPrice() + (0.05 * product.getCount() > 50 ? 0.05 * product.getCount() : 50)));
|
||||
}
|
||||
}
|
||||
if ("特种纸名片".equals(dto.getProTypeValue()) && craftList.contains("异形模切")) {// 200-500张按照原有的价格乘以3倍 1000-5000张按照原有的价格乘以2.4倍 5000-10000张按照原有的价格乘以2倍
|
||||
double[] prices = {1560, 1720, 2320, 5840, 8520, 9680, 12900};
|
||||
int[] counts = {200, 500, 1000, 2000, 3000, 5000, 10000};
|
||||
int num = getNum(width, length);
|
||||
double[][] prices_area = {
|
||||
{112, 152, 208, 376, 552, 888, 1328},
|
||||
{200, 280, 380, 688, 1000, 1620, 2420},
|
||||
{272, 376, 500, 912, 1320, 2140, 3100},
|
||||
{328, 448, 600, 1088, 1576, 2440, 3600},
|
||||
{380, 520, 696, 1260, 1832, 2740, 4100},
|
||||
{480, 640, 880, 1520, 2040, 3200, 4800},
|
||||
{600, 760, 1040, 2000, 2760, 3920, 5700},
|
||||
{720, 880, 1200, 2480, 3480, 4640, 6600},
|
||||
{840, 1000, 1360, 2960, 4200, 5360, 7500},
|
||||
{960, 1120, 1520, 3440, 4920, 6080, 8400},
|
||||
{1080, 1240, 1680, 3920, 5640, 6800, 9300},
|
||||
{1200, 1360, 1840, 4400, 6360, 7520, 10200},
|
||||
{1320, 1480, 2000, 4880, 7080, 8240, 11100},
|
||||
{1440, 1600, 2160, 5360, 7800, 8960, 12000},
|
||||
};
|
||||
if (num < 15) {
|
||||
prices = prices_area[num - 1];
|
||||
}
|
||||
for (Product product : priceList) {
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
if (counts[i] == product.getCount()) {
|
||||
product.setPrice(prices[i] * dto.getNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (craftList.contains("异形")) {// 广告扇工艺(选了异形,每把+3毛钱
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() + 0.3 * product.getCount()));
|
||||
|
||||
Reference in New Issue
Block a user