新增扑克牌
This commit is contained in:
@@ -4463,12 +4463,68 @@ public class ProductService {
|
||||
case "防油纸袋":
|
||||
priceList = getOilProofPaperPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "扑克牌":
|
||||
priceList = getPegSolitairePrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getPegSolitairePrice(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 = {1, 10, 50, 100, 200, 300, 400};
|
||||
double[][] prices_area = {
|
||||
{180, 180, 380, 570, 990, 1590, 2020},
|
||||
{180, 180, 380, 570, 990, 1590, 2020}
|
||||
};
|
||||
int currentIndex = 0;
|
||||
if ("黑芯310克".equals(dto.getKind())) {
|
||||
currentIndex = 1;
|
||||
}
|
||||
if ("合版".equals(dto.getKind2Value())) {
|
||||
counts = new int[]{100, 200, 500, 1000, 2000, 5000, 10000, 20000, 30000, 50000, 100000};
|
||||
prices_area = new double[][]{
|
||||
{1370, 1600, 2350, 3620, 5990, 12450, 22940, 43810, 63290, 102330, 193850},
|
||||
{1550, 1830, 2690, 4150, 7020, 14700, 26860, 51430, 74540, 120940, 230770}
|
||||
};
|
||||
if (dto.isSwitchSize()) {
|
||||
if ("34.6*33.8".equals(dto.getSize1())) {
|
||||
prices_area = new double[][]{
|
||||
{2550, 2770, 3550, 4920, 7580, 14860, 26640, 50330, 72250, 116490, 221030},
|
||||
{2620, 2870, 3710, 5180, 8080, 15980, 28520, 53890, 77360, 124730, 236650}
|
||||
};
|
||||
}
|
||||
if ("22.6*21.6".equals(dto.getSize1())) {
|
||||
prices_area = new double[][]{
|
||||
{2570, 2810, 3650, 5110, 8000, 16050, 29090, 54960, 78900, 127220, 241370},
|
||||
{2640, 2910, 3810, 5370, 8500, 17180, 30980, 58530, 84020, 135470, 257030}
|
||||
};
|
||||
}
|
||||
if ("31.2*17.1".equals(dto.getSize1())) {
|
||||
prices_area = new double[][]{
|
||||
{2570, 2800, 3630, 5080, 7900, 15690, 28510, 53860, 77310, 124660, 236520},
|
||||
{2640, 2900, 3700, 3660, 5150, 16810, 30390, 57420, 82430, 132910, 252180}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double price = new PriceUtils().TableCountCenterPrice(count, prices_area[currentIndex], counts);
|
||||
double design_price = 0;
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(Math.max(Math.ceil(price), 0) * number + design_price);
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
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<>();
|
||||
|
||||
Reference in New Issue
Block a user