3:新增贺卡工艺配件尺寸价格4:新增餐垫纸工艺5:新增产品
This commit is contained in:
@@ -1003,6 +1003,15 @@ public class ProductService {
|
||||
if ("8*12".equals(dto.getToothpick_size())) {
|
||||
carft_base_price = 19;
|
||||
}
|
||||
if ("17*6".equals(dto.getToothpick_size())) {
|
||||
carft_base_price = 30;
|
||||
}
|
||||
if ("12*7".equals(dto.getToothpick_size())) {
|
||||
carft_base_price = 17;
|
||||
}
|
||||
if ("12*10".equals(dto.getToothpick_size())) {
|
||||
carft_base_price = 23;
|
||||
}
|
||||
carft_price += carft_base_price * Math.ceil(product.getCount() / 1000.0);
|
||||
}
|
||||
//腰封的模切费单独计算
|
||||
@@ -3982,6 +3991,7 @@ public class ProductService {
|
||||
return priceList;
|
||||
case "餐垫纸":
|
||||
priceList = new PriceUtils().getPlaceMatPrice(kind, length, width, count);
|
||||
craft_list = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
|
||||
// 根据款数重新算价格
|
||||
for (Product product : priceList) {
|
||||
if (kind.equals("0")) {
|
||||
@@ -3989,8 +3999,12 @@ public class ProductService {
|
||||
} else {
|
||||
wei = 0.05;
|
||||
}
|
||||
|
||||
product.setWeight(df.format(length * width * product.getCount() / 10000 * number * wei));
|
||||
product.setPrice(Math.ceil(product.getPrice() * number * 1.3));
|
||||
if (craft_list.contains("异形模切")) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * 1.9));
|
||||
}
|
||||
}
|
||||
return priceList;
|
||||
case "节目单":
|
||||
@@ -4754,12 +4768,51 @@ public class ProductService {
|
||||
return getJiadaoPrice(dto, length, width);
|
||||
case "特光不干胶":
|
||||
return getLightPrice(dto, length, width);
|
||||
case "淋膜纸":
|
||||
return getLingmoPrice(dto, width, length);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getLingmoPrice(Product dto, Double width, Double length) {
|
||||
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
String[] sizes = {"21*29", "36*24", "36*26", "42*28.5"};
|
||||
double[][] prices = new double[][]{
|
||||
{1150, 1950, 1950, 3300, 6150},
|
||||
{1350, 2050, 2550, 4050, 7200},
|
||||
{1450, 2100, 2650, 4250, 7500},
|
||||
{1700, 2750, 3600, 6000, 11000},
|
||||
};
|
||||
int count_list[] = {10000, 20000, 30000, 50000, 100000};
|
||||
int current_int = Arrays.binarySearch(sizes, dto.getSize());
|
||||
double[] prices_list = prices[current_int];
|
||||
List<Product> list = new ArrayList<>();
|
||||
for (int i = 0; i < count_list.length; i++) {
|
||||
double price = prices_list[i];
|
||||
|
||||
int item_count = count_list[i];
|
||||
|
||||
if (item_count < dto.getCount()) {
|
||||
continue;
|
||||
}
|
||||
if (list.size() > 2) {
|
||||
break;
|
||||
}
|
||||
double craft_price = 0;
|
||||
if (dto.getCo_number() >= 2) {
|
||||
craft_price = 150 * (dto.getCo_number() - 1);
|
||||
}
|
||||
Product pro = new Product();
|
||||
pro.setCount(item_count);
|
||||
pro.setWeight(df.format(0.005 * item_count * dto.getNumber()));
|
||||
pro.setPrice(Math.ceil(price * dto.getNumber() + craft_price));
|
||||
list.add(pro);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<Product> getLightPrice(Product dto, Double width, Double length) {
|
||||
List<String> carftList = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
double[][] prices = new double[][]{
|
||||
|
||||
@@ -2537,6 +2537,8 @@ public class PriceUtils {
|
||||
pro.setPrice(Math.ceil(priceArr[i] * beishu - countArr[i] * 0.02));
|
||||
} else if ("0".equals(kind)) {// 80克
|
||||
pro.setPrice(Math.ceil(priceArr[i] * beishu));
|
||||
} else if ("2".equals(kind)) {// 100克
|
||||
pro.setPrice(Math.ceil(priceArr[i] * beishu * 1.5));
|
||||
}
|
||||
list.add(pro);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user