修改杯垫价格
This commit is contained in:
@@ -5274,6 +5274,7 @@ public class ProductService {
|
|||||||
double[] rate_list = {0.75, 0.72, 0.70, 0.68, 0.65, 0.60, 0.58, 0.55, 0.50};
|
double[] rate_list = {0.75, 0.72, 0.70, 0.68, 0.65, 0.60, 0.58, 0.55, 0.50};
|
||||||
int[] counts = {200, 400, 600, 800, 1000, 2000, 3000, 5000, 10000};
|
int[] counts = {200, 400, 600, 800, 1000, 2000, 3000, 5000, 10000};
|
||||||
double maxRate = 0.48;
|
double maxRate = 0.48;
|
||||||
|
int base_count = 50;
|
||||||
if ("14".equals(dto.getKindValue())) {
|
if ("14".equals(dto.getKindValue())) {
|
||||||
requstVo.setPaper("250克吸水棉纸");
|
requstVo.setPaper("250克吸水棉纸");
|
||||||
if ("90*90圆形".equals(requstVo.getSize())) {
|
if ("90*90圆形".equals(requstVo.getSize())) {
|
||||||
@@ -5317,11 +5318,7 @@ public class ProductService {
|
|||||||
item.setParameters(Collections.singletonMap("颜色", dto.getTcolor()));
|
item.setParameters(Collections.singletonMap("颜色", dto.getTcolor()));
|
||||||
craft.add(item);
|
craft.add(item);
|
||||||
}
|
}
|
||||||
if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) {
|
|
||||||
rate_list = new double[]{0.70, 0.65, 0.60, 0.55, 0.50};
|
|
||||||
counts = new int[]{50, 100, 200, 500, 1000};
|
|
||||||
maxRate = 0.45;
|
|
||||||
}
|
|
||||||
if (craft_list.contains("双面")) {
|
if (craft_list.contains("双面")) {
|
||||||
requstVo.setPrintSide(2);
|
requstVo.setPrintSide(2);
|
||||||
requstVo.setDoubleSideType("不同");
|
requstVo.setDoubleSideType("不同");
|
||||||
@@ -5354,20 +5351,42 @@ public class ProductService {
|
|||||||
craft.add(item);
|
craft.add(item);
|
||||||
}
|
}
|
||||||
requstVo.setCrafts(craft);
|
requstVo.setCrafts(craft);
|
||||||
|
if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) {
|
||||||
|
requstVo.setNum(base_count);
|
||||||
|
// rate_list = new double[]{0.70, 0.68, 0.65, 0.62, 0.58};
|
||||||
|
// counts = new int[]{50, 100, 200, 500, 1000};
|
||||||
|
// maxRate = 0.55;
|
||||||
|
}
|
||||||
ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo);
|
ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo);
|
||||||
|
double price = 0;
|
||||||
for (int i = 0; i < counts.length; i++) {
|
if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) {
|
||||||
if (counts[i] < count) {
|
double rate_item = 1;
|
||||||
continue;
|
if (count <= 100) {
|
||||||
|
rate_item = 0.95;
|
||||||
|
} else if (count <= 200) {
|
||||||
|
rate_item = 0.93;
|
||||||
|
} else if (count <= 500) {
|
||||||
|
rate_item = 0.90;
|
||||||
|
} else if (count <= 1000) {
|
||||||
|
rate_item = 0.88;
|
||||||
|
} else if (count <= 2000) {
|
||||||
|
rate_item = 0.85;
|
||||||
}
|
}
|
||||||
base_rate = rate_list[i];
|
price = Math.ceil(result.getData().getPrice() / (1 - 0.7) / base_count * count * rate_item);
|
||||||
break;
|
} else {
|
||||||
|
for (int i = 0; i < counts.length; i++) {
|
||||||
|
if (counts[i] < count) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
base_rate = rate_list[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (base_rate == 0) {
|
||||||
|
base_rate = maxRate;
|
||||||
|
}
|
||||||
|
price = Math.ceil(result.getData().getPrice() / (1 - base_rate));
|
||||||
}
|
}
|
||||||
if (base_rate == 0) {
|
double designPrice = (number - 1) * 8;
|
||||||
base_rate = maxRate;
|
|
||||||
}
|
|
||||||
double price = Math.ceil(result.getData().getPrice() / (1 - base_rate));
|
|
||||||
double designPrice = 0;
|
|
||||||
|
|
||||||
Product product = new Product();
|
Product product = new Product();
|
||||||
product.setPrice(Math.ceil(Math.max(price, min_pirce) + designPrice));
|
product.setPrice(Math.ceil(Math.max(price, min_pirce) + designPrice));
|
||||||
@@ -5398,7 +5417,9 @@ public class ProductService {
|
|||||||
double wei = 0;
|
double wei = 0;
|
||||||
// 根据款数重新算价格
|
// 根据款数重新算价格
|
||||||
for (Product product : priceList) {
|
for (Product product : priceList) {
|
||||||
product.setPrice(Math.floor(product.getPrice() * number));
|
if (!sdList.contains(dto.getKindValue())) {
|
||||||
|
product.setPrice(Math.floor(product.getPrice() * number));
|
||||||
|
}
|
||||||
if ("3".equals(kind)) {
|
if ("3".equals(kind)) {
|
||||||
wei = 0.3;
|
wei = 0.3;
|
||||||
} else {
|
} else {
|
||||||
@@ -7940,7 +7961,32 @@ public class ProductService {
|
|||||||
int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000, 20000};
|
int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000, 20000};
|
||||||
double[] areas = new double[]{4, 6, 8, 10, 12, 14, 16, 25, 35, 45, 84, 120, 150, 200, 600, 1000, 2000, 2520};
|
double[] areas = new double[]{4, 6, 8, 10, 12, 14, 16, 25, 35, 45, 84, 120, 150, 200, 600, 1000, 2000, 2520};
|
||||||
double area = length * width;
|
double area = length * width;
|
||||||
return getAreaCenterPrice(count_list, dto.getCount(), area, prices, areas, dto.getNumber());
|
int count = dto.getCount();
|
||||||
|
if (dto.getCount() > 20000) {
|
||||||
|
count = 20000;
|
||||||
|
}
|
||||||
|
List<Product> productList = getAreaCenterPrice(count_list, count, area, prices, areas, dto.getNumber());
|
||||||
|
if (dto.getCount() > 20000) {
|
||||||
|
for (Product product : productList) {
|
||||||
|
double rate = 1;
|
||||||
|
if (dto.getCount() == 30000) {
|
||||||
|
rate = 0.95;
|
||||||
|
}
|
||||||
|
if (dto.getCount() == 50000) {
|
||||||
|
rate = 0.93;
|
||||||
|
}
|
||||||
|
if (dto.getCount() == 100000) {
|
||||||
|
rate = 0.9;
|
||||||
|
}
|
||||||
|
if (dto.getCount() == 200000) {
|
||||||
|
rate = 0.88;
|
||||||
|
}
|
||||||
|
product.setCount(dto.getCount());
|
||||||
|
product.setPrice(Math.ceil(product.getPrice() / 20000 * dto.getCount() * rate));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return productList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Product> normalSticker(Product dto, String kind, Integer number, Double area, Double width, Double
|
private List<Product> normalSticker(Product dto, String kind, Integer number, Double area, Double width, Double
|
||||||
|
|||||||
@@ -995,7 +995,11 @@
|
|||||||
<option value="3000">3000</option>
|
<option value="3000">3000</option>
|
||||||
<option value="5000">5000</option>
|
<option value="5000">5000</option>
|
||||||
<option value="10000">10000</option>
|
<option value="10000">10000</option>
|
||||||
<option value="20000">20000</option>`;
|
<option value="20000">20000</option>
|
||||||
|
<option value="30000">30000</option>
|
||||||
|
<option value="50000">50000</option>
|
||||||
|
<option value="100000">100000</option>
|
||||||
|
<option value="200000">200000</option>`;
|
||||||
} else {
|
} else {
|
||||||
$(".nofm").find(":input").attr("disabled", true);
|
$(".nofm").find(":input").attr("disabled", true);
|
||||||
$('input[class = liangmo]').prop('checked', true);
|
$('input[class = liangmo]').prop('checked', true);
|
||||||
|
|||||||
Reference in New Issue
Block a user