新增沙滩旗

This commit is contained in:
2026-07-27 11:40:20 +08:00
parent 1e056a10de
commit 67fdad896c
3 changed files with 396 additions and 15 deletions
@@ -4428,12 +4428,56 @@ public class ProductService {
case "夹板":
priceList = getSplintPrice(dto, width, length);
return chucklePrice(role, priceList, dto);
case "沙滩旗":
priceList = getBeachFlagPrice(dto, width, length);
return chucklePrice(role, priceList, dto);
default:
break;
}
return null;
}
private List<Product> getBeachFlagPrice(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 base_price = 0;
int sizeIndex = 0;
if (Math.max(length, width) == 200 && Math.min(length, width) == 50) {
sizeIndex = 0;
}
if (Math.max(length, width) == 240 && Math.min(length, width) == 60) {
sizeIndex = 1;
}
if (Math.max(length, width) == 340 && Math.min(length, width) == 70) {
sizeIndex = 2;
}
if (Math.max(length, width) == 410 && Math.min(length, width) == 80) {
sizeIndex = 3;
}
double[][] prices = {
{115.50, 129.50, 168.50, 209.50},
{115.50, 129.50, 168.50, 209.50},
{129.00, 149.00, 200.67, 253.67},
};
if (craft_list.contains("水滴型")) {
prices = new double[][]{
{115.50, 129.50, 168.50, 209.50},
{115.50, 129.50, 168.50, 209.50},
{129.00, 149.00, 200.67, 253.67},
};
}
Product pro = new Product();
pro.setCount(count);
pro.setNumber(number);
pro.setPrice(Math.ceil((Math.max(prices[Integer.parseInt(dto.getKind())][sizeIndex] * count * number, 30))));
priceList.add(pro);
return priceList;
}
private List<Product> getSplintPrice(Product dto, Double width, Double length) {
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
@@ -4668,12 +4712,13 @@ public class ProductService {
return priceList;
} else if ("5".equals(dto.getK())) {
int[] counts = {100, 200, 500, 1000, 2000, 5000, 10000, 50000, 100000};
int[] counts = {100, 200, 300, 500, 1000, 2000, 5000, 10000, 50000, 100000};
double[][] prices = {
{140, 190, 380, 690, 1330, 3110, 5980, 27540, 51430},
{150, 230, 460, 850, 1640, 3790, 7320, 34060, 64290},
{160, 240, 500, 930, 1790, 4170, 8060, 36960, 70000},
{170, 270, 560, 1040, 2000, 4700, 8960, 41310, 78580},
{140, 190, 253, 380, 690, 1330, 3110, 5980, 27540, 51430},
{150, 230, 307, 460, 850, 1640, 3790, 7320, 34060, 64290},
{160, 240, 327, 500, 930, 1790, 4170, 8060, 36960, 70000},
{170, 270, 367, 560, 1040, 2000, 4700, 8960, 41310, 78580},
{200, 320, 440, 680, 1290, 2490, 4960, 11200, 51600, 98160},
};
if (craft_list.contains("单色") && craft_list.contains("双面")) {
prices = new double[][]{
@@ -4686,19 +4731,20 @@ public class ProductService {
}
if (craft_list.contains("彩色") && craft_list.contains("单面")) {
prices = new double[][]{
{150, 198, 363, 691, 1329, 3215, 6286, 30001, 57143},
{166, 214, 439, 838, 1615, 3858, 7572, 36429, 70000},
{175, 253, 477, 911, 1758, 4215, 8286, 39286, 75715},
{183, 276, 537, 1014, 1958, 4715, 9286, 44286, 85715},
{150, 198, 253, 363, 691, 1329, 3215, 6286, 30001, 57143},
{166, 214, 289, 439, 838, 1615, 3858, 7572, 36429, 70000},
{175, 253, 328, 477, 911, 1758, 4215, 8286, 39286, 75715},
{183, 276, 363, 537, 1014, 1958, 4715, 9286, 44286, 85715},
{215, 343, 445, 650, 1215, 2415, 5800, 11430, 54570, 105715},
};
}
if (craft_list.contains("彩色") && craft_list.contains("双面")) {
prices = new double[][]{
{233, 277, 454, 838, 1472, 3543, 6929, 33115, 63272},
{316, 293, 530, 985, 1758, 4229, 8272, 39543, 75558},
{325, 333, 568, 1058, 1901, 4572, 8943, 42758, 81700},
{333, 355, 628, 1161, 2100, 5043, 9872, 47258, 90300},
{366, 406, 740, 1397, 2558, 6143, 12029, 57543, 109958},
{233, 277, 336, 454, 838, 1472, 3543, 6929, 33115, 63272},
{316, 293, 372, 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},
};
}
double baseRate = 0;