修改天幕
This commit is contained in:
@@ -8,12 +8,12 @@ import java.util.List;
|
||||
|
||||
public class CanopyUtil {
|
||||
|
||||
public static List<Product> getPrice(Double area, int count, List<Product> priceList, String kindvalue, String craft) {
|
||||
public static List<Product> getPrice(Double area, int count, List<Product> priceList, String kindvalue, List<String> craft_list) {
|
||||
Product pro = null;
|
||||
double price = 0;
|
||||
area = area * count;//计算总面积
|
||||
double basePrice = 0;
|
||||
double[] priceArr = getBasePrice(kindvalue, craft);
|
||||
double[] priceArr = getBasePrice(kindvalue, craft_list);
|
||||
if (priceArr.length == 0) {
|
||||
return priceList;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class CanopyUtil {
|
||||
} else {
|
||||
basePrice = priceArr[3];
|
||||
}
|
||||
double mince = getMinPrice(kindvalue, craft);
|
||||
double mince = getMinPrice(kindvalue, craft_list);
|
||||
price = Math.ceil(basePrice * area);
|
||||
pro = new Product();
|
||||
pro.setCount(count);
|
||||
@@ -37,17 +37,16 @@ public class CanopyUtil {
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private static double[] getBasePrice(String kindvalue, String craft) {
|
||||
List<String> craftList = craft != null ? Collections.singletonList(craft) : new ArrayList<>();
|
||||
private static double[] getBasePrice(String kindvalue, List<String> craft) {
|
||||
if ("银胶涤纶布".equals(kindvalue)) {
|
||||
if (craftList.contains("定制")) {
|
||||
if (craft.contains("定制")) {
|
||||
return new double[]{27, 26, 25, 24.5};
|
||||
} else {
|
||||
return new double[]{12.5, 11.5, 11, 10};
|
||||
}
|
||||
}
|
||||
if ("黑胶涤纶布".equals(kindvalue)) {
|
||||
if (craftList.contains("定制")) {
|
||||
if (craft.contains("定制")) {
|
||||
return new double[]{29, 28, 27, 26};
|
||||
} else {
|
||||
return new double[]{14.5, 13.5, 13, 12};
|
||||
@@ -56,17 +55,16 @@ public class CanopyUtil {
|
||||
return new double[]{};
|
||||
}
|
||||
|
||||
private static double getMinPrice(String kindvalue, String craft) {
|
||||
List<String> craftList = craft != null ? Collections.singletonList(craft) : new ArrayList<>();
|
||||
private static double getMinPrice(String kindvalue, List<String> craft) {
|
||||
if ("银胶涤纶布".equals(kindvalue)) {
|
||||
if (craftList.contains("定制")) {
|
||||
if (craft.contains("定制")) {
|
||||
return 80;
|
||||
} else {
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
if ("黑胶涤纶布".equals(kindvalue)) {
|
||||
if (craftList.contains("定制")) {
|
||||
if (craft.contains("定制")) {
|
||||
return 80;
|
||||
} else {
|
||||
return 50;
|
||||
|
||||
Reference in New Issue
Block a user