新增电线胶
This commit is contained in:
@@ -4791,12 +4791,37 @@ public class ProductService {
|
||||
return getPaperBowlPrice(dto, width, length);
|
||||
case "挂画":
|
||||
return getWallPaintingPrice(dto, width, length);
|
||||
case "电线胶":
|
||||
return getWireTapePrice(dto, width, length);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getWireTapePrice(Product dto, Double width, Double length) {
|
||||
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();
|
||||
double[] areas = {1, 2, 4, 10, 25, 48.60, 81, 100, 126, 170, 230, 294, 450, 598.50, 900};
|
||||
int[][] prices = {
|
||||
{75, 78, 78, 84, 160, 171, 256, 298, 349, 453, 529, 604, 851, 944, 1322},
|
||||
{78, 78, 93, 120, 222, 241, 304, 370, 452, 591, 711, 776, 1085, 1293, 1889},
|
||||
{106, 115, 142, 221, 310, 354, 506, 594, 708, 877, 1063, 1206, 1771, 2165, 3163},
|
||||
{160, 177, 196, 327, 444, 515, 681, 829, 1017, 1302, 1506, 1742, 2479, 3102, 4492},
|
||||
{192, 208, 278, 494, 555, 633, 1041, 1214, 1473, 1753, 2298, 2602, 3908, 4971, 7155},
|
||||
{324, 374, 476, 816, 936, 1190, 1934, 2322, 2720, 3230, 4250, 5016, 7396, 9350, 13600},
|
||||
{484, 583, 833, 1333, 1667, 2251, 3333, 3833, 4749, 6167, 8084, 9667, 14475, 18333, 26667},
|
||||
};
|
||||
int[] counts = {500, 1000, 2000, 3000, 5000, 10000, 20000};
|
||||
priceList = getAreaCenterPrice(counts, count, width * length, prices, areas, number);
|
||||
for (Product product : priceList) {
|
||||
product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3));
|
||||
}
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getWallPaintingPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user