edit
This commit is contained in:
@@ -168,4 +168,6 @@ public class Product {
|
||||
private Integer co_number;
|
||||
private Integer shen_type;
|
||||
private String shen_color;
|
||||
private String[] jtcolor;//击凸颜色
|
||||
private String tcolor;//烫金颜色
|
||||
}
|
||||
@@ -112,11 +112,11 @@ public class ProductController {
|
||||
}
|
||||
} else {
|
||||
if (product.getNumber() != null && product.getNumber() > 1) {
|
||||
if ("专版打印".equals(product.getStickerKind()) || "少数量".equals(product.getCouponKind())) {
|
||||
// if ("专版打印".equals(product.getStickerKind()) || "少数量".equals(product.getCouponKind())) {
|
||||
if (request.getParameter("desType") != null && !"".equals(request.getParameter("desType"))) {
|
||||
product.setP(Integer.valueOf(request.getParameter("desType")));
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
List<Product> proList = productService.getThanPrice(product, user.getRole());
|
||||
|
||||
@@ -549,7 +549,7 @@ public class ProductService {
|
||||
case "2":
|
||||
// 单个产品的面积
|
||||
area = (length + 0.3) * (width + 0.3) / 10000;
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai());
|
||||
priceList = new PriceUtils().rollLabelPrice(kind, area, count, dto.getCraft(), dto.getYinbai(), dto.getCraftTang(), getStickersTanBasePrice(area * 10000));
|
||||
// 根据款数重新算价格/计算重量
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.floor(product.getPrice() * number));
|
||||
@@ -2822,7 +2822,7 @@ public class ProductService {
|
||||
if ("0".equals(kind)) {
|
||||
priceList = new PosterPrice().acountPrice00(kind2, area, count, number);
|
||||
} else if ("1".equals(kind)) {// 室内写真
|
||||
priceList = new PosterPrice().acountPrice01(kind2, area, count, number);
|
||||
priceList = new PosterPrice().acountPrice01(kind2, area, count, number, width * 100, length * 100);
|
||||
} else if ("2".equals(kind)) {// 户外写真
|
||||
if ("24".equals(kind2)) {
|
||||
double base_price = 0;
|
||||
@@ -2900,14 +2900,12 @@ public class ProductService {
|
||||
|
||||
} else {
|
||||
|
||||
priceList = new PosterPrice().acountPrice02(kind2, area, count, number);
|
||||
priceList = new PosterPrice().acountPrice02(kind2, area, count, number, width * 100, length * 100);
|
||||
}
|
||||
} else if ("3".equals(kind)) {// 布
|
||||
if (kind2.equals("11") || kind2.equals("12") || kind2.equals("13")) {
|
||||
priceList = new PriceUtils().getDbPrice(kind2, width, length, count, priceList);
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * number));
|
||||
}
|
||||
priceList = new PriceUtils().getDbPrice(kind2, width * 100, length * 100, count, priceList, number);
|
||||
|
||||
} else if (kind2.equals("10")) {
|
||||
length *= 100;
|
||||
width *= 100;
|
||||
@@ -2927,12 +2925,13 @@ public class ProductService {
|
||||
product.setWeight(df.format(0.075 * length * width * product.getCount() / 10000 * number));
|
||||
}
|
||||
} else {
|
||||
priceList = new PosterPrice().acountPrice03(kind2, length, width, area, count, number, dto.getCraftBu());
|
||||
priceList = new PosterPrice().acountPrice03(kind2, length * 100, width * 100, area, count, number, dto.getCraftBu());
|
||||
}
|
||||
|
||||
// 7.27 海报、合版封套 *1.15
|
||||
// 除550灯布/双喷布
|
||||
if (!"1".equals(kind2) && !"7".equals(kind2) && !"11".equals(kind2) && !"12".equals(kind2) && !"10".equals(kind2) && !"6".equals(kind2) && !"13".equals(kind2)) {
|
||||
List<String> kind2_list = Arrays.asList("1", "2", "6", "7", "8", "10", "11", "12", "13");
|
||||
if (!kind2_list.contains(kind2)) {
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.ceil(product.getPrice() * 1.15));
|
||||
}
|
||||
@@ -2956,9 +2955,6 @@ public class ProductService {
|
||||
product.setWeight(df.format(wei * product.getCount() * number));
|
||||
}
|
||||
}
|
||||
if ("1".equals(kind) || "2".equals(kind) || "3".equals(kind)) {
|
||||
//priceList = new PriceUtils().getFbPrice(dto, number, width, length, count, priceList);
|
||||
}
|
||||
}
|
||||
return priceList;
|
||||
// 扇子
|
||||
@@ -3509,6 +3505,50 @@ public class ProductService {
|
||||
for (Product product : priceList) {
|
||||
product.setPrice(Math.floor(product.getPrice() * 1.3));
|
||||
}
|
||||
} else if ("10".equals(kind) || "11".equals(kind)) {
|
||||
int[] count_list = {50, 100, 200, 500, 1000};
|
||||
double[] jitu = {};
|
||||
double[] jitu_add = {};
|
||||
double[] tang = {};
|
||||
double[] yaao = {};
|
||||
if ("10".equals(kind)) {
|
||||
jitu = new double[]{267, 317, 450, 733, 1200};
|
||||
jitu_add = new double[]{190, 210, 250, 320, 440};
|
||||
tang = new double[]{250, 283, 383, 650, 980};
|
||||
yaao = new double[]{250, 267, 383, 617, 950};
|
||||
} else if ("11".equals(kind)) {
|
||||
jitu = new double[]{267, 317, 417, 667, 1080};
|
||||
jitu_add = new double[]{95, 105, 125, 160, 220};
|
||||
tang = new double[]{250, 300, 350, 583, 930};
|
||||
yaao = new double[]{250, 283, 317, 533, 900};
|
||||
}
|
||||
craft_list = Arrays.asList(dto.getCraft());
|
||||
for (int i = 0; i < count_list.length; i++) {
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
int count_item = count_list[i];
|
||||
if (count > count_item) {
|
||||
continue;
|
||||
}
|
||||
Product product = new Product();
|
||||
product.setCount(count_item);
|
||||
if (craft_list.contains("击凸")) {
|
||||
product.setPrice(jitu[i]);
|
||||
if (dto.getJtcolor() != null && dto.getJtcolor().length > 1) {
|
||||
product.setPrice(jitu[i] + jitu_add[i]);
|
||||
}
|
||||
}
|
||||
if (craft_list.contains("烫金")) {
|
||||
product.setPrice(tang[i]);
|
||||
}
|
||||
if (craft_list.contains("无色压凹")) {
|
||||
product.setPrice(yaao[i]);
|
||||
}
|
||||
|
||||
priceList.add(product);
|
||||
}
|
||||
|
||||
} else {
|
||||
priceList = new PriceUtils().tags600Price(dto, kind, kind2, area, count);
|
||||
// 服装吊牌里面的900克吊牌把价格*1.3倍
|
||||
@@ -4105,6 +4145,39 @@ public class ProductService {
|
||||
pro.setWeight(df.format(Math.ceil(zhongliang * dto.getCount() * number)));
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
case "防伪标":
|
||||
int[][] prices = {
|
||||
{176, 176, 176, 176, 176, 176, 176, 176, 180, 184, 192, 192, 202, 228, 228},
|
||||
{180, 180, 182, 184, 186, 188, 196, 206, 240, 260, 274, 286, 306, 344, 360},
|
||||
{184, 184, 184, 194, 214, 228, 264, 290, 358, 408, 434, 466, 506, 572, 650},
|
||||
{190, 202, 210, 224, 256, 282, 332, 374, 478, 554, 590, 660, 716, 814, 942},
|
||||
{200, 232, 254, 290, 338, 392, 468, 544, 728, 864, 920, 1046, 1138, 1298, 1520},
|
||||
{226, 312, 368, 452, 550, 672, 814, 980, 1358, 1636, 1746, 2008, 2190, 2502, 2970},
|
||||
{274, 470, 594, 784, 988, 1250, 1518, 1854, 2614, 3184, 3398, 3936, 4298, 4916, 5872},
|
||||
};
|
||||
int[] count_list = {500, 1000, 2000, 3000, 5000, 10000, 20000};
|
||||
double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
|
||||
|
||||
area = length * width;
|
||||
for (int i = 0; i < count_list.length; i++) {
|
||||
int count_item = count_list[i];
|
||||
if (priceList.size() > 2) {
|
||||
break;
|
||||
}
|
||||
if (count > count_item) {
|
||||
continue;
|
||||
}
|
||||
int count_index = Arrays.binarySearch(count_list, count_item);
|
||||
price = 0;
|
||||
if (count_index >= 0) {
|
||||
price = new PriceUtils().TablePrice(area, prices[count_index], areas);
|
||||
}
|
||||
Product product = new Product();
|
||||
product.setCount(count_item);
|
||||
product.setPrice(Math.ceil(price * number));
|
||||
priceList.add(product);
|
||||
}
|
||||
return priceList;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -133,238 +133,183 @@ public class PosterPrice {
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public List<Product> acountPrice01(String kind2, Double area, int count, Integer number) {
|
||||
public List<Product> acountPrice01(String kind2, Double area, int count, Integer number, double width, double length) {
|
||||
// 最低收费
|
||||
double price = 0.0;
|
||||
// 单价
|
||||
double danjia = 0.0;
|
||||
String weight = "0";
|
||||
DecimalFormat DecimalFormat = new DecimalFormat("#.#####");
|
||||
double[] areas = {};
|
||||
double[] prices = {};
|
||||
double last_price = 0;
|
||||
double min_price = 0;
|
||||
switch (kind2) {
|
||||
// 高精室内写真
|
||||
case "2":
|
||||
areas = new double[]{2, 5, 10, 20, 50};
|
||||
prices = new double[]{50, 45, 32, 28, 25};
|
||||
last_price = 23;
|
||||
min_price = 50;
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 50;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 45;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 32;
|
||||
} else if (area > 10 && area <= 20) {
|
||||
danjia = 28;
|
||||
} else if (area > 20 && area <= 50) {
|
||||
danjia = 25;
|
||||
} else {
|
||||
danjia = 23;
|
||||
}
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
break;
|
||||
// pp纸(室内)
|
||||
case "3":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 62;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 45;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 35;
|
||||
} else {
|
||||
danjia = 28;
|
||||
}
|
||||
price = area * danjia > 70 ? area * danjia : 70;
|
||||
areas = new double[]{2, 5, 10};
|
||||
prices = new double[]{62, 45, 35};
|
||||
last_price = 28;
|
||||
min_price = 70;
|
||||
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.113 * number));
|
||||
break;
|
||||
// 直喷PVC
|
||||
case "5":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 70;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 55;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 45;
|
||||
} else {
|
||||
danjia = 40;
|
||||
}
|
||||
price = area * danjia > 100 ? area * danjia : 100;
|
||||
areas = new double[]{2, 5, 10};
|
||||
prices = new double[]{70, 55, 45};
|
||||
last_price = 40;
|
||||
min_price = 100;
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.113 * number));
|
||||
break;
|
||||
// 高精室内相纸
|
||||
case "6":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 70;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 60;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 45;
|
||||
} else {
|
||||
danjia = 40;
|
||||
}
|
||||
price = area * danjia > 90 ? area * danjia : 90;
|
||||
areas = new double[]{2, 5, 10};
|
||||
prices = new double[]{70, 60, 45};
|
||||
last_price = 40;
|
||||
min_price = 90;
|
||||
break;
|
||||
// 单透
|
||||
case "7":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 75;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 65;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 55;
|
||||
} else {
|
||||
danjia = 45;
|
||||
}
|
||||
price = area * danjia > 100 ? area * danjia : 100;
|
||||
areas = new double[]{2, 5, 10};
|
||||
prices = new double[]{75, 65, 55};
|
||||
last_price = 45;
|
||||
min_price = 100;
|
||||
break;
|
||||
// 静电贴
|
||||
case "8":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 1) {
|
||||
danjia = 70;
|
||||
} else if (area > 1 && area <= 2) {
|
||||
danjia = 68;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 65;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 63;
|
||||
} else {
|
||||
danjia = 60;
|
||||
}
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
areas = new double[]{1, 2, 5, 10};
|
||||
prices = new double[]{70, 68, 65, 63};
|
||||
last_price = 60;
|
||||
min_price = 50;
|
||||
break;
|
||||
// 软膜
|
||||
case "14":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 70;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 65;
|
||||
} else {
|
||||
danjia = 60;
|
||||
}
|
||||
price = area * danjia > 100 ? area * danjia : 100;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{70, 65};
|
||||
last_price = 60;
|
||||
min_price = 100;
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.113 * number));
|
||||
break;
|
||||
// 地贴(复防滑膜)
|
||||
case "15":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 75;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 65;
|
||||
} else {
|
||||
danjia = 55;
|
||||
}
|
||||
price = area * danjia > 100 ? area * danjia : 100;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{75, 65};
|
||||
last_price = 55;
|
||||
min_price = 100;
|
||||
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.113 * number));
|
||||
break;
|
||||
// UV高透车贴(含白墨)
|
||||
case "16":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 160;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 150;
|
||||
} else {
|
||||
danjia = 140;
|
||||
}
|
||||
price = area * danjia > 160 ? area * danjia : 160;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{160, 150};
|
||||
last_price = 140;
|
||||
min_price = 160;
|
||||
|
||||
break;
|
||||
// UV高透车贴(不含白墨)
|
||||
case "17":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 150;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 140;
|
||||
} else {
|
||||
danjia = 130;
|
||||
}
|
||||
price = area * danjia > 160 ? area * danjia : 160;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{150, 140};
|
||||
last_price = 130;
|
||||
min_price = 160;
|
||||
|
||||
break;
|
||||
// 高透贴
|
||||
case "18":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 110;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 100;
|
||||
} else {
|
||||
danjia = 90;
|
||||
}
|
||||
price = area * danjia > 130 ? area * danjia : 130;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{110, 100};
|
||||
last_price = 90;
|
||||
min_price = 130;
|
||||
|
||||
break;
|
||||
// 防撞条腰线UV透明喷膜(含白墨)
|
||||
case "19":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 130;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 130;
|
||||
} else {
|
||||
danjia = 110;
|
||||
}
|
||||
price = area * danjia > 80 ? area * danjia : 80;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{130, 130};
|
||||
last_price = 110;
|
||||
min_price = 80;
|
||||
|
||||
break;
|
||||
// 防撞条腰线UV磨砂贴(含白墨)
|
||||
case "20":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 140;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 130;
|
||||
} else {
|
||||
danjia = 120;
|
||||
}
|
||||
price = area * danjia > 80 ? area * danjia : 80;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{140, 130};
|
||||
last_price = 120;
|
||||
min_price = 80;
|
||||
|
||||
break;
|
||||
// 防撞条腰线粗哑膜磨砂贴(不含白墨)
|
||||
case "21":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 115;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 105;
|
||||
} else {
|
||||
danjia = 100;
|
||||
}
|
||||
price = area * danjia > 80 ? area * danjia : 80;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{115, 105};
|
||||
last_price = 100;
|
||||
min_price = 80;
|
||||
|
||||
break;
|
||||
// 防撞条腰线磨砂镂空(粗哑膜刻字)
|
||||
case "22":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 150;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 140;
|
||||
} else {
|
||||
danjia = 130;
|
||||
}
|
||||
price = area * danjia > 100 ? area * danjia : 100;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{150, 140};
|
||||
last_price = 130;
|
||||
min_price = 100;
|
||||
|
||||
break;
|
||||
// 防撞条腰线即时贴刻字
|
||||
case "23":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 120;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 110;
|
||||
} else {
|
||||
danjia = 100;
|
||||
}
|
||||
price = area * danjia > 70 ? area * danjia : 70;
|
||||
areas = new double[]{5, 10};
|
||||
prices = new double[]{120, 110};
|
||||
last_price = 100;
|
||||
min_price = 70;
|
||||
|
||||
break;
|
||||
case "24":
|
||||
price = area * 380 > 380 ? area * 380 : 380;
|
||||
break;
|
||||
}
|
||||
if (!"24".equals(kind2)) {
|
||||
if (width * length < 40 * 50) {
|
||||
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
|
||||
} else {
|
||||
danjia = last_price;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area <= areas[i]) {
|
||||
danjia = prices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
price = Math.max(area * danjia, min_price);
|
||||
}
|
||||
}
|
||||
|
||||
Product pro = new Product();
|
||||
List<Product> list = new ArrayList<Product>();
|
||||
pro.setCount(count);
|
||||
// 价格 = 面积 * 单价 + (款数-1) * 40
|
||||
if (number > 1) {
|
||||
if (number > 1 && width * length >= 40 * 50) {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price));
|
||||
@@ -383,115 +328,96 @@ public class PosterPrice {
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public List<Product> acountPrice02(String kind2, Double area, int count, Integer number) {
|
||||
public List<Product> acountPrice02(String kind2, Double area, int count, Integer number, double width, double length) {
|
||||
double price = 0.0;
|
||||
double danjia = 0.0;
|
||||
String weight = "0";
|
||||
DecimalFormat DecimalFormat = new DecimalFormat("#.#####");
|
||||
double[] areas = {};
|
||||
double[] prices = {};
|
||||
double last_price = 0;
|
||||
double min_price = 0;
|
||||
|
||||
switch (kind2) {
|
||||
// 户外写真白胶(国产)
|
||||
case "0":
|
||||
areas = new double[]{2, 5, 7, 8, 10, 20, 50};
|
||||
prices = new double[]{55, 45, 40, 37, 31, 29, 27};
|
||||
last_price = 26;
|
||||
min_price = 50;
|
||||
// 根据面积得到单价
|
||||
if (area <= 2) {
|
||||
danjia = 55;
|
||||
} else if (area <= 5) {
|
||||
danjia = 45;
|
||||
} else if (area <= 7) {
|
||||
danjia = 40;
|
||||
} else if (area <= 8) {
|
||||
danjia = 37;
|
||||
} else if (area <= 10) {
|
||||
danjia = 31;
|
||||
} else if (area <= 20) {
|
||||
danjia = 29;
|
||||
} else if (area <= 50) {
|
||||
danjia = 27;
|
||||
} else {
|
||||
danjia = 26;
|
||||
}
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.24 * number));
|
||||
break;
|
||||
// 户外写真黑胶(国产)
|
||||
case "1":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 56;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 45;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 36;
|
||||
} else {
|
||||
danjia = 30;
|
||||
}
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
areas = new double[]{2, 5, 7, 8, 10, 20, 50};
|
||||
prices = new double[]{55, 45, 40, 37, 31, 29, 27};
|
||||
last_price = 26;
|
||||
min_price = 50;
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.25 * number));
|
||||
break;
|
||||
// 户外写真可移白胶、黑胶
|
||||
case "2":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 60;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 55;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 50;
|
||||
} else {
|
||||
danjia = 35;
|
||||
}
|
||||
price = area * danjia > 85 ? area * danjia : 85;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{60, 55, 50};
|
||||
last_price = 35;
|
||||
min_price = 50;
|
||||
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.14 * number));
|
||||
break;
|
||||
// 户外写真喷膜
|
||||
case "3":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 65;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 50;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 45;
|
||||
} else {
|
||||
danjia = 35;
|
||||
}
|
||||
price = area * danjia > 80 ? area * danjia : 80;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{65, 50, 45};
|
||||
last_price = 35;
|
||||
min_price = 80;
|
||||
|
||||
break;
|
||||
// 户外写真灯片
|
||||
case "5":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 68;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 50;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 40;
|
||||
} else {
|
||||
danjia = 30;
|
||||
}
|
||||
price = area * danjia > 90 ? area * danjia : 90;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{68, 50, 40};
|
||||
last_price = 30;
|
||||
min_price = 90;
|
||||
|
||||
|
||||
break;
|
||||
// 车贴(白胶)
|
||||
case "6":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 50;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 40;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 30;
|
||||
} else {
|
||||
danjia = 25;
|
||||
}
|
||||
price = area * danjia > 80 ? area * danjia : 80;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{50, 40, 30};
|
||||
last_price = 25;
|
||||
min_price = 80;
|
||||
|
||||
weight = String.valueOf(DecimalFormat.format(area * 0.24 * number));
|
||||
break;
|
||||
}
|
||||
|
||||
if (width * length < 40 * 50) {
|
||||
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
|
||||
} else {
|
||||
danjia = last_price;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area <= areas[i]) {
|
||||
danjia = prices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
price = Math.max(area * danjia, min_price);
|
||||
}
|
||||
Product pro = new Product();
|
||||
List<Product> list = new ArrayList<Product>();
|
||||
pro.setCount(count);
|
||||
// 价格 = 面积 * 单价 + (款数-1) * 40
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
if (number > 1 && width * length >= 40 * 50) {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price));
|
||||
}
|
||||
pro.setWeight(weight);
|
||||
list.add(pro);
|
||||
return list;
|
||||
@@ -513,45 +439,38 @@ public class PosterPrice {
|
||||
Integer number, String craftBu) {
|
||||
double price = 0.0;
|
||||
double danjia = 0.0;
|
||||
double[] areas = {};
|
||||
double[] prices = {};
|
||||
double last_price = 0;
|
||||
double min_price = 0;
|
||||
switch (kind2) {
|
||||
// 550灯布
|
||||
case "1":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 30;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 28;
|
||||
} else {
|
||||
danjia = 25;
|
||||
}
|
||||
price = area * danjia > 60 ? area * danjia : 60;
|
||||
areas = new double[]{5, 10,};
|
||||
prices = new double[]{30, 28};
|
||||
last_price = 25;
|
||||
min_price = 60;
|
||||
|
||||
break;
|
||||
// 黑底布
|
||||
case "2":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 5) {
|
||||
danjia = 40;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 34;
|
||||
} else {
|
||||
danjia = 30;
|
||||
}
|
||||
price = area * danjia > 70 ? area * danjia : 70;
|
||||
areas = new double[]{5, 10,};
|
||||
prices = new double[]{40, 34};
|
||||
last_price = 30;
|
||||
min_price = 70;
|
||||
|
||||
break;
|
||||
|
||||
// 写真布
|
||||
case "6":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 30;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 28;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 25;
|
||||
} else {
|
||||
danjia = 23;
|
||||
}
|
||||
price = area * danjia > 50 ? area * danjia : 50;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{30, 28, 25};
|
||||
last_price = 23;
|
||||
min_price = 50;
|
||||
|
||||
break;
|
||||
// 双喷布
|
||||
case "7":
|
||||
@@ -588,30 +507,20 @@ public class PosterPrice {
|
||||
// 油画布
|
||||
case "8":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 80;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 75;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 60;
|
||||
} else {
|
||||
danjia = 35;
|
||||
}
|
||||
price = area * danjia > 130 ? area * danjia : 130;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{80, 75, 60};
|
||||
last_price = 35;
|
||||
min_price = 130;
|
||||
|
||||
break;
|
||||
// 墙纸
|
||||
case "9":
|
||||
// 根据面积得到单价
|
||||
if (area > 0 && area <= 2) {
|
||||
danjia = 70;
|
||||
} else if (area > 2 && area <= 5) {
|
||||
danjia = 60;
|
||||
} else if (area > 5 && area <= 10) {
|
||||
danjia = 50;
|
||||
} else {
|
||||
danjia = 35;
|
||||
}
|
||||
price = area * danjia > 105 ? area * danjia : 105;
|
||||
areas = new double[]{2, 5, 10,};
|
||||
prices = new double[]{70, 60, 50};
|
||||
last_price = 35;
|
||||
min_price = 105;
|
||||
|
||||
break;
|
||||
// 旗帜布
|
||||
case "10":
|
||||
@@ -671,10 +580,35 @@ public class PosterPrice {
|
||||
|
||||
break;
|
||||
}
|
||||
if (!"7".equals(kind2) && !"10".equals(kind2)) {
|
||||
if (width * length < 40 * 50) {
|
||||
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
|
||||
} else {
|
||||
danjia = last_price;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area <= areas[i]) {
|
||||
danjia = prices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
price = Math.max(area * danjia, min_price);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Product pro = new Product();
|
||||
List<Product> list = new ArrayList<Product>();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
if (!"7".equals(kind2) && !"10".equals(kind2)) {
|
||||
if (number > 1 && width * length >= 40 * 50) {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price));
|
||||
}
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
}
|
||||
|
||||
list.add(pro);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,11 @@ public class PriceUtils {
|
||||
* @param area
|
||||
* @param count
|
||||
* @param craft
|
||||
* @param tang
|
||||
* @param yinbai
|
||||
* @return
|
||||
*/
|
||||
public List<Product> rollLabelPrice(String kind, Double area, int count, String[] craft, String yinbai) {
|
||||
public List<Product> rollLabelPrice(String kind, Double area, int count, String[] craft, String yinbai, String tang, double[] tangPrices) {
|
||||
List<Product> list = new ArrayList<Product>();
|
||||
Product pro = new Product();
|
||||
// 最低收费
|
||||
@@ -151,19 +152,30 @@ public class PriceUtils {
|
||||
if (!StringUtils.isEmpty(craft)) {
|
||||
if ("大雪花镭射膜".equals(craft[0])) {
|
||||
danjia = danjia + 1;
|
||||
} else if ("覆哑膜".equals(craft[0])) {
|
||||
danjia = danjia + 0.8;
|
||||
} else {
|
||||
danjia = danjia + 0.6;
|
||||
}
|
||||
}
|
||||
price = Math
|
||||
.ceil(area * danjia + yinrPrice + count * 0.01 > lowerPrice ? area * danjia + yinrPrice + count * 0.01
|
||||
: lowerPrice);
|
||||
price = Math.ceil(Math.max(area * danjia + yinrPrice + count * 0.01, lowerPrice));
|
||||
// 如果有印白工艺:2元一平方,最低收费200元
|
||||
if (!StringUtils.isEmpty(yinbai)) {
|
||||
price = price + (area * 2 > 200 ? area * 2 : 200);
|
||||
}
|
||||
double tang_price = 0;
|
||||
|
||||
if (!StringUtils.isEmpty(tang) && "烫金".equals(tang)) {
|
||||
int[] bigCountArr = {500, 1000, 2000, 3000, 5000, 10000};
|
||||
|
||||
for (int i = 0; i < bigCountArr.length; i++) {
|
||||
if (count >= bigCountArr[i]) {
|
||||
tang_price = price + tangPrices[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
pro.setCount(count);
|
||||
pro.setPrice(price);
|
||||
pro.setPrice(Math.max(tang_price, price));
|
||||
list.add(pro);
|
||||
|
||||
/*
|
||||
@@ -3008,6 +3020,60 @@ public class PriceUtils {
|
||||
return price;
|
||||
}
|
||||
|
||||
public double getTestPrice(double length, double width, int count, int number,
|
||||
double[] areas, double[] prices, double minPrice, double lastPrice) {
|
||||
final int total = count * number;
|
||||
|
||||
for (int i = 1; i <= total; i++) {
|
||||
double currentPrice = new PriceUtils().getOptimizedPrice(
|
||||
length,
|
||||
width,
|
||||
i, // 当前数量
|
||||
1, // number 参数固定为1
|
||||
areas,
|
||||
prices,
|
||||
minPrice,
|
||||
lastPrice
|
||||
);
|
||||
|
||||
if (currentPrice > minPrice) {
|
||||
// 计算累加价格:基础价 + 剩余项*6
|
||||
return minPrice + (total - i + 1) * 6;
|
||||
}
|
||||
}
|
||||
// 未触发条件时返回基础最低价
|
||||
return minPrice;
|
||||
}
|
||||
|
||||
public double getOptimizedPrice(double length, double width, int count, int number,
|
||||
double[] areas, double[] prices, double minPrice, double lastPrice) {
|
||||
final double area = length * width * count / 10000;
|
||||
final boolean isSmallArea = area <= 0.2;
|
||||
|
||||
// 计算调整后的面积值
|
||||
final double adjustedArea = isSmallArea ? area * number : area;
|
||||
|
||||
// 确定单价基准
|
||||
double unitPrice = isSmallArea ? minPrice : lastPrice;
|
||||
if (!isSmallArea) {
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (adjustedArea <= areas[i]) {
|
||||
unitPrice = prices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 计算基础价格
|
||||
double basePrice = isSmallArea ? minPrice : adjustedArea * unitPrice;
|
||||
|
||||
// 应用数量系数
|
||||
double finalPrice = (area > 0.2) ? basePrice * number : basePrice;
|
||||
|
||||
// 确保最低价格并取整
|
||||
return Math.ceil(Math.max(finalPrice, minPrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 亚克力计算
|
||||
*
|
||||
@@ -3124,50 +3190,54 @@ public class PriceUtils {
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public List<Product> getDbPrice(String kind, Double width, Double length, int count, List<Product> list) {
|
||||
public List<Product> getDbPrice(String kind, Double width, Double length, int count, List<Product> list, int number) {
|
||||
//11-550灯布 12-520灯布 13-550黑底灯布
|
||||
Product pro = new Product();
|
||||
double price = 0, dj = 0;
|
||||
double area = length * width * count;
|
||||
if (kind.equals("11")) {
|
||||
if (area <= 5) {
|
||||
dj = 20;
|
||||
} else if (area <= 10) {
|
||||
dj = 18;
|
||||
} else if (area > 10) {
|
||||
dj = 17;
|
||||
}
|
||||
} else if (kind.equals("12")) {
|
||||
if (area <= 5) {
|
||||
dj = 16;
|
||||
} else if (area <= 10) {
|
||||
dj = 12;
|
||||
} else if (area > 10) {
|
||||
dj = 10;
|
||||
}
|
||||
double area = length * width * count / 10000;
|
||||
double[] areas = {};
|
||||
double[] prices = {};
|
||||
double last_price = 0;
|
||||
double min_price = 0;
|
||||
|
||||
if ("11".equals(kind)) {
|
||||
areas = new double[]{5, 10,};
|
||||
prices = new double[]{20, 18};
|
||||
last_price = 17;
|
||||
min_price = 55;
|
||||
|
||||
} else if ("12".equals(kind)) {
|
||||
areas = new double[]{5, 10,};
|
||||
prices = new double[]{16, 12};
|
||||
last_price = 10;
|
||||
min_price = 50;
|
||||
|
||||
} else {
|
||||
if (area <= 5) {
|
||||
dj = 24;
|
||||
} else if (area <= 10) {
|
||||
dj = 20;
|
||||
} else if (area > 10) {
|
||||
dj = 18;
|
||||
}
|
||||
areas = new double[]{5, 10,};
|
||||
prices = new double[]{24, 20};
|
||||
last_price = 18;
|
||||
min_price = 60;
|
||||
|
||||
}
|
||||
|
||||
|
||||
price = area * dj;
|
||||
if (area >= 7 && area <= 10) {
|
||||
price = price * 0.9;
|
||||
}
|
||||
if (kind.equals("11")) {
|
||||
price = Math.ceil(price > 55 ? price : 55);
|
||||
} else if (kind.equals("12")) {
|
||||
price = Math.ceil(price > 50 ? price : 50);
|
||||
if (width * length < 40 * 50) {
|
||||
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
|
||||
} else {
|
||||
price = Math.ceil(price > 60 ? price : 60);
|
||||
dj = last_price;
|
||||
for (int i = 0; i < areas.length; i++) {
|
||||
if (area <= areas[i]) {
|
||||
dj = prices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
price = Math.max(area * dj, min_price);
|
||||
}
|
||||
|
||||
if (number > 1 && width * length >= 40 * 50) {
|
||||
pro.setPrice(Math.ceil(price * number));
|
||||
} else {
|
||||
pro.setPrice(Math.ceil(price));
|
||||
}
|
||||
pro.setPrice(price);
|
||||
pro.setCount(count);
|
||||
list.add(pro);
|
||||
|
||||
|
||||
@@ -62,8 +62,19 @@ public class ZsPrice {
|
||||
price += num * 10;
|
||||
}
|
||||
|
||||
|
||||
if (number > 1) {
|
||||
price += 10 * number;
|
||||
double desFee = 0;
|
||||
if (dto.getP() == 1 || dto.getP() == 2 || dto.getP() == 3) {
|
||||
desFee = 3;
|
||||
} else if (dto.getP() == 4) {
|
||||
desFee = 5;
|
||||
} else if (dto.getP() == 5) {
|
||||
desFee = 6;
|
||||
} else {
|
||||
desFee = 8;
|
||||
}
|
||||
price += desFee * (number - 1);
|
||||
}
|
||||
|
||||
Product pro = new Product();
|
||||
|
||||
Reference in New Issue
Block a user