新增手举牌

This commit is contained in:
2026-08-03 15:07:39 +08:00
parent c95d699292
commit ffe86433a8
2 changed files with 336 additions and 1 deletions
@@ -4457,12 +4457,51 @@ public class ProductService {
case "弹弹乐":
priceList = getPianoMusicPrice(dto, width, length, height);
return chucklePrice(role, priceList, dto);
case "手举牌":
priceList = getHoldSignPrice(dto, width, length, height);
return chucklePrice(role, priceList, dto);
default:
break;
}
return null;
}
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<>();
int count = dto.getCount();
int number = dto.getNumber();
double area = width * length * count * number / 10000;
double mini_price = 30;
double price = 0;
if (area <= 0.03) { // 0.01 A 0.03
price = 267 * area;
} else if (area <= 0.06) { // 0.03 < A 0.06
price = 8.01 + 175 * (area - 0.03);
} else if (area <= 0.12) { // 0.06 < A 0.12
price = 13.26 + 89 * (area - 0.06);
} else if (area <= 0.25) { // 0.12 < A 0.25
price = 18.60 + 80 * (area - 0.12);
} else if (area <= 0.64) { // 0.25 < A 0.64
price = 29.00 + 70 * (area - 0.25);
} else if (area <= 1.44) { // 0.64 < A 1.44
price = 56.30 + 60 * (area - 0.64);
} else if (area <= 2.56) { // 1.44 < A 2.56
price = 104.30 + 50 * (area - 1.44);
} else if (area <= 5.76) { // 2.56 < A 5.76
price = 160.30 + 42 * (area - 2.56);
} else { // 5.76 < A 10.24
price = 294.70 + 36.7 * (area - 5.76);
}
double design_price = number * 10;
Product pro = new Product();
pro.setCount(count);
pro.setPrice(Math.max(Math.ceil(price), mini_price) + design_price);
priceList.add(pro);
return priceList;
}
private List<Product> getPianoMusicPrice(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<>();
@@ -5100,7 +5139,7 @@ public class ProductService {
if (craft_list.contains("彩色") && craft_list.contains("双面")) {
prices = new double[][]{
{233, 277, 336, 454, 838, 1472, 3543, 6929, 33115, 63272},
{316, 293, 372, 530, 985, 1758, 4229, 8272, 39543, 75558},
{316, 393, 472, 530, 985, 1758, 4229, 8272, 39543, 75558},
{325, 333, 411, 568, 1058, 1901, 4572, 8943, 42758, 81700},
{333, 355, 446, 628, 1161, 2100, 5043, 9872, 47258, 90300},
{366, 406, 517, 740, 1397, 2558, 6143, 12029, 57543, 109958},