新增金属微章

This commit is contained in:
2025-11-14 17:24:46 +08:00
parent 3700a33cb8
commit 44060ca68a
2 changed files with 275 additions and 310 deletions
@@ -4699,156 +4699,9 @@ public class ProductService {
priceList.add(pro);
return priceList;
case "奖牌":
String kindValue = dto.getKindValue();
String name = dto.getKind1Value();
price = 0.0;
Double zhongliang = 0.0;
if ("水晶".equals(kindValue)) {
if ("酸洗五角星".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("炫彩刀片".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("金色刀片".equals(name)) {
price = Math.ceil(120 * dto.getCount());
zhongliang = 2.9;
}
if ("尖角".equals(name)) {
price = Math.ceil(160 * dto.getCount());
zhongliang = 2.3;
}
if ("斜面6角星".equals(name)) {
price = Math.ceil(90 * dto.getCount());
zhongliang = 2.6;
}
if ("八角".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 3.1;
}
if ("蓝色梦想".equals(name)) {
price = Math.ceil(120 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色三条线".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色弯弯".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.2;
}
if ("斜面5角星".equals(name)) {
price = Math.ceil(88 * dto.getCount());
zhongliang = 2.5;
}
if ("麦穗圆型".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("酸洗凹面".equals(name)) {
price = Math.ceil(118 * dto.getCount());
zhongliang = 2.9;
}
if ("月牙".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("大拇指".equals(name)) {
price = Math.ceil(60 * dto.getCount());
zhongliang = 2.9;
}
if ("宝剑".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色五角星".equals(name)) {
price = Math.ceil(128 * dto.getCount());
zhongliang = 2.9;
}
} else {
List<String> carfts = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
if ("20*25".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(33 * dto.getCount());
} else {
price = Math.ceil(39 * dto.getCount());
}
zhongliang = 1.3;
}
if ("24*31".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(36 * dto.getCount());
} else {
price = Math.ceil(45 * dto.getCount());
}
zhongliang = 1.6;
}
if ("25*35".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(39 * dto.getCount());
} else {
price = Math.ceil(54 * dto.getCount());
}
zhongliang = 1.7;
}
if ("30*40".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(42 * dto.getCount());
} else {
price = Math.ceil(66 * dto.getCount());
}
zhongliang = 2.7;
}
if ("35*50".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(57 * dto.getCount());
} else {
price = Math.ceil(75 * dto.getCount());
}
zhongliang = 3.6;
}
if ("40*60".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(75 * dto.getCount());
} else {
price = Math.ceil(108 * dto.getCount());
}
zhongliang = 4.8;
}
}
pro = new Product();
pro.setCount(count);
pro.setPrice(price * number);
pro.setWeight(df.format(Math.ceil(zhongliang * dto.getCount() * number)));
priceList.add(pro);
return priceList;
return getMedalPrice(dto, width, length);
case "防伪标":
carft_list = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
int[][] prices = {
{176, 176, 176, 176, 176, 176, 176, 176, 180, 184, 192, 192, 202, 228, 228},
{180, 180, 182, 184, 186, 188, 196, 206, 240, 260, 274, 286, 306, 344, 360},
{184, 184, 184, 194, 214, 228, 264, 290, 358, 408, 434, 466, 506, 572, 650},
{190, 202, 210, 224, 256, 282, 332, 374, 478, 554, 590, 660, 716, 814, 942},
{200, 232, 254, 290, 338, 392, 468, 544, 728, 864, 920, 1046, 1138, 1298, 1520},
{226, 312, 368, 452, 550, 672, 814, 980, 1358, 1636, 1746, 2008, 2190, 2502, 2970},
{274, 470, 594, 784, 988, 1250, 1518, 1854, 2614, 3184, 3398, 3936, 4298, 4916, 5872},
};
int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000};
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
area = length * width;
priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * 1.3));
}
if (carft_list.contains("印白墨")) {
priceList = PriceUtils.getYinBaiPrice(priceList, width, length);
}
return priceList;
return getantiLabelPrice(dto, width, length);
case "透卡":
return getPETPrice(dto, width, length);
case "澜达海报":
@@ -4867,12 +4720,88 @@ public class ProductService {
return getLingmoPrice(dto, width, length);
case "香薰卡":
return getaromatherapyPrice(dto, width, length);
case "金属微章":
return getbadgePrice(dto, width, length);
default:
break;
}
return null;
}
private List<Product> getbadgePrice(Product dto, Double width, Double length) {
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
int count = dto.getCount();
int number = dto.getNumber();
double[][] prices_list = {
{450, 880, 1700, 3250, 5380, 10000, 14728, 23685, 43103},
};
int[] count_list = {
50, 100, 200, 500, 1000, 2000, 3000, 5000, 10000
};
int pre_count = 0;
for (int i = 0; i < count_list.length; i++) {
double price = prices_list[0][i];
int item_count = count_list[i];
if (item_count < count) {
pre_count = item_count;
continue;
}
if (priceList.size() > 2) {
break;
}
//数量小于50
Product pro = new Product();
if (pre_count > 0 && count > pre_count) {
double base_price = prices_list[0][i - 1] / pre_count;
pro = new Product();
pro.setCount(count);
pro.setWeight(df.format(0.005 * count * dto.getNumber()));
pro.setPrice(Math.ceil(base_price * count * dto.getNumber()));
priceList.add(pro);
}
pro = new Product();
pro.setCount(item_count);
pro.setWeight(df.format(0.005 * item_count * dto.getNumber()));
pro.setPrice(Math.ceil(price * dto.getNumber()));
priceList.add(pro);
pre_count = item_count;
}
return priceList;
}
private List<Product> getantiLabelPrice(Product dto, Double width, Double length) {
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
int count = dto.getCount();
int number = dto.getNumber();
int[][] prices = {
{176, 176, 176, 176, 176, 176, 176, 176, 180, 184, 192, 192, 202, 228, 228},
{180, 180, 182, 184, 186, 188, 196, 206, 240, 260, 274, 286, 306, 344, 360},
{184, 184, 184, 194, 214, 228, 264, 290, 358, 408, 434, 466, 506, 572, 650},
{190, 202, 210, 224, 256, 282, 332, 374, 478, 554, 590, 660, 716, 814, 942},
{200, 232, 254, 290, 338, 392, 468, 544, 728, 864, 920, 1046, 1138, 1298, 1520},
{226, 312, 368, 452, 550, 672, 814, 980, 1358, 1636, 1746, 2008, 2190, 2502, 2970},
{274, 470, 594, 784, 988, 1250, 1518, 1854, 2614, 3184, 3398, 3936, 4298, 4916, 5872},
};
int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000};
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
double area = length * width;
priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * 1.3));
}
if (carft_list.contains("印白墨")) {
priceList = PriceUtils.getYinBaiPrice(priceList, width, length);
}
return priceList;
}
private List<Product> getaromatherapyPrice(Product dto, Double width, Double length) {
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
List<Product> priceList = new ArrayList<>();
@@ -5232,6 +5161,138 @@ public class ProductService {
return priceList;
}
private List<Product> getMedalPrice(Product dto, Double width, Double length) {
String kindValue = dto.getKindValue();
String name = dto.getKind1Value();
double price = 0.0;
Double zhongliang = 0.0;
List<Product> priceList = new ArrayList<>();
int count = dto.getCount();
int number = dto.getNumber();
if ("水晶".equals(kindValue)) {
if ("酸洗五角星".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("炫彩刀片".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("金色刀片".equals(name)) {
price = Math.ceil(120 * dto.getCount());
zhongliang = 2.9;
}
if ("尖角".equals(name)) {
price = Math.ceil(160 * dto.getCount());
zhongliang = 2.3;
}
if ("斜面6角星".equals(name)) {
price = Math.ceil(90 * dto.getCount());
zhongliang = 2.6;
}
if ("八角".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 3.1;
}
if ("蓝色梦想".equals(name)) {
price = Math.ceil(120 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色三条线".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色弯弯".equals(name)) {
price = Math.ceil(98 * dto.getCount());
zhongliang = 2.2;
}
if ("斜面5角星".equals(name)) {
price = Math.ceil(88 * dto.getCount());
zhongliang = 2.5;
}
if ("麦穗圆型".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("酸洗凹面".equals(name)) {
price = Math.ceil(118 * dto.getCount());
zhongliang = 2.9;
}
if ("月牙".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("大拇指".equals(name)) {
price = Math.ceil(60 * dto.getCount());
zhongliang = 2.9;
}
if ("宝剑".equals(name)) {
price = Math.ceil(108 * dto.getCount());
zhongliang = 2.9;
}
if ("蓝色五角星".equals(name)) {
price = Math.ceil(128 * dto.getCount());
zhongliang = 2.9;
}
} else {
List<String> carfts = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
if ("20*25".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(33 * dto.getCount());
} else {
price = Math.ceil(39 * dto.getCount());
}
zhongliang = 1.3;
}
if ("24*31".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(36 * dto.getCount());
} else {
price = Math.ceil(45 * dto.getCount());
}
zhongliang = 1.6;
}
if ("25*35".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(39 * dto.getCount());
} else {
price = Math.ceil(54 * dto.getCount());
}
zhongliang = 1.7;
}
if ("30*40".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(42 * dto.getCount());
} else {
price = Math.ceil(66 * dto.getCount());
}
zhongliang = 2.7;
}
if ("35*50".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(57 * dto.getCount());
} else {
price = Math.ceil(75 * dto.getCount());
}
zhongliang = 3.6;
}
if ("40*60".equals(dto.getSize())) {
if (carfts.contains("直边")) {
price = Math.ceil(75 * dto.getCount());
} else {
price = Math.ceil(108 * dto.getCount());
}
zhongliang = 4.8;
}
}
Product pro = new Product();
pro.setCount(count);
pro.setPrice(price * number);
pro.setWeight(df.format(Math.ceil(zhongliang * dto.getCount() * number)));
priceList.add(pro);
return priceList;
}
private List<Product> getLeiseDiaoPrice(Product dto, double length, double width) {
double[] prices = new double[]{170, 233, 370, 537, 643, 843, 1613, 3117, 4847};
int[] count_list = new int[]{500, 1000, 2000, 3000, 4000, 5000, 10000, 20000, 30000};