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