修改撕撕乐价格
This commit is contained in:
@@ -5651,61 +5651,93 @@ public class ProductService {
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
int awards = dto.getAwards();
|
||||
int[][] prices = {
|
||||
{900, 900, 1000, 1000},
|
||||
{950, 950, 1100, 1100},
|
||||
{1022, 1023, 1200, 1200},
|
||||
{1591, 1591, 1628, 1744},
|
||||
{1932, 1932, 1977, 2093},
|
||||
{2273, 2273, 2326, 2558},
|
||||
{3409, 3409, 3488, 3953},
|
||||
{5682, 5682, 5814, 6512},
|
||||
{11818, 11818, 12791, 13721},
|
||||
};
|
||||
double mini_price = 1000;
|
||||
int[] prices = {80, 80, 75, 70, 65, 60, 55, 50, 45};
|
||||
if (craft_list.contains("单面哑膜")) {
|
||||
prices = new int[][]{
|
||||
{1000, 1000, 1050, 1050},
|
||||
{1110, 1110, 1110, 1110},
|
||||
{1222, 1222, 1550, 1650},
|
||||
{1778, 1778, 1778, 1889},
|
||||
{2111, 2111, 2111, 2222},
|
||||
{2444, 2444, 2444, 2667},
|
||||
{3778, 3778, 3778, 4222},
|
||||
{6222, 6222, 6222, 6889},
|
||||
{13333, 13333, 13778, 15333},
|
||||
};
|
||||
prices = new int[]{85, 85, 80, 75, 70, 65, 60, 55, 50};
|
||||
mini_price = 1100;
|
||||
}
|
||||
int price_index = 0;
|
||||
if ((width > 4.0 || length > 6.0) && (length > 4.0 || width > 6.0)) {
|
||||
price_index = 1;
|
||||
if (craft_list.contains("异形模切")) {
|
||||
mini_price += 300;
|
||||
|
||||
}
|
||||
if ((width > 9.0 || length > 5.4) && (length > 9.0 || width > 5.4)) {
|
||||
price_index = 2;
|
||||
}
|
||||
if ((width > 6.0 || length > 7.0) && (length > 6.0 || width > 7.0)) {
|
||||
price_index = 3;
|
||||
if (craft_list.contains("打码")) {
|
||||
mini_price += 250;
|
||||
|
||||
}
|
||||
int[] counts = {200, 500, 1000, 2000, 3000, 5000, 10000, 20000, 50000};
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int itemCount = counts[i];
|
||||
if (count > itemCount) {
|
||||
continue;
|
||||
}
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (count > counts[counts.length - 1]) {
|
||||
double awards_price = 0;
|
||||
if (itemCount <= 10000) {
|
||||
if (awards > 5) {
|
||||
awards_price = 30 * Math.max((awards - 5), 0);
|
||||
if (awards > 5) {
|
||||
awards_price = 30 * Math.max((awards - 5), 0);
|
||||
}
|
||||
double craft_price = 0;
|
||||
double craft_base = 0;
|
||||
if (craft_list.contains("异形模切")) {
|
||||
craft_base = 0.02;
|
||||
if (count >= 100000) {
|
||||
craft_base = 0.015;
|
||||
|
||||
}
|
||||
craft_price += craft_base * count;
|
||||
}
|
||||
if (craft_list.contains("打码")) {
|
||||
craft_base = 0.02;
|
||||
if (count >= 100000) {
|
||||
craft_base = 0.015;
|
||||
|
||||
}
|
||||
craft_price += craft_base * count;
|
||||
}
|
||||
Product pro = new Product();
|
||||
pro.setCount(itemCount);
|
||||
pro.setCount(count);
|
||||
pro.setNumber(number);
|
||||
pro.setPrice(Math.ceil((prices[i][price_index] + awards_price) * number));
|
||||
pro.setPrice(Math.ceil(Math.max((prices[prices.length - 1] * count * width * length / 10000 + awards_price + craft_price), mini_price) * number));
|
||||
priceList.add(pro);
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int itemCount = counts[i];
|
||||
if (count > itemCount) {
|
||||
continue;
|
||||
}
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
double awards_price = 0;
|
||||
if (itemCount <= 10000) {
|
||||
if (awards > 5) {
|
||||
awards_price = 30 * Math.max((awards - 5), 0);
|
||||
}
|
||||
}
|
||||
double craft_price = 0;
|
||||
double craft_base = 0;
|
||||
if (craft_list.contains("异形模切")) {
|
||||
craft_base = 0.025;
|
||||
if (itemCount >= 50000) {
|
||||
craft_base = 0.02;
|
||||
}
|
||||
|
||||
craft_price += craft_base * itemCount;
|
||||
}
|
||||
if (craft_list.contains("打码")) {
|
||||
craft_base = 0.03;
|
||||
if (itemCount >= 50000) {
|
||||
craft_base = 0.02;
|
||||
}
|
||||
|
||||
craft_price += craft_base * itemCount;
|
||||
}
|
||||
|
||||
Product pro = new Product();
|
||||
pro.setCount(itemCount);
|
||||
pro.setNumber(number);
|
||||
pro.setPrice(Math.ceil(Math.max((prices[i] * itemCount * width * length / 10000 + awards_price + craft_price), mini_price) * number));
|
||||
priceList.add(pro);
|
||||
}
|
||||
}
|
||||
|
||||
return priceList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user