| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710 |
- package lingtao.net.util;
- import lingtao.net.bean.Product;
- import java.text.DecimalFormat;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * 海报价格
- */
- public class PosterPrice {
- /**
- * 裱板
- *
- * @param kind2
- * @param area
- * @param count
- * @param number
- * @return
- */
- public List<Product> acountPrice00(String kind2, Double area, int count, Integer number) {
- double danjia = 0.0;
- // 最低收费
- double price = 0.0;
- String weight = "0";
- DecimalFormat DecimalFormat = new DecimalFormat("#.#####");
- double areas = area;
- if (area < 40 * 50 / 10000.0) {
- areas = area * number;
- }
- double miniprice = 0;
- switch (kind2) {
- // 室内写真裱冷板
- case "0":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 64;
- } else if (area > 5 && area <= 10) {
- danjia = 60;
- } else {
- danjia = 52;
- }
- miniprice += 72;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 室内写真对裱冷板
- case "1":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 90;
- } else if (area > 5 && area <= 10) {
- danjia = 85;
- } else {
- danjia = 80;
- }
- miniprice += 95;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 室内写真裱冷板装小C边
- case "3":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 85;
- } else if (area > 5 && area <= 10) {
- danjia = 80;
- } else {
- danjia = 75;
- }
- miniprice += 90;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 户外写真裱冷板
- case "6":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 85;
- } else if (area > 5 && area <= 10) {
- danjia = 80;
- } else {
- danjia = 75;
- }
- miniprice += 90;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 户外写真对裱冷板
- case "7":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 95;
- } else if (area > 5 && area <= 10) {
- danjia = 90;
- } else {
- danjia = 85;
- }
- miniprice += 90;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 户外写真裱冷板装小C边
- case "8":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 100;
- } else if (area > 5 && area <= 10) {
- danjia = 95;
- } else {
- danjia = 90;
- }
- miniprice += 90;
- price = Math.max(areas * danjia, miniprice);
- break;
- // 背胶单裱3mmPVC(户内高清)
- case "12":
- // 根据面积得到单价
- if (area > 0 && area <= 5) {
- danjia = 105;
- } else if (area > 5 && area <= 10) {
- danjia = 100;
- } else {
- danjia = 95;
- }
- miniprice += 105;
- price = Math.max(areas * danjia, miniprice);
- break;
- }
- Product pro = new Product();
- List<Product> list = new ArrayList<Product>();
- weight = String.valueOf(DecimalFormat.format(area * 0.2 * number));
- pro.setWeight(weight);
- pro.setCount(count);
- // 价格 = 面积 * 单价 + (款数-1) * 40
- if (number > 1 && area >= 40 * 50 / 10000.0) {
- pro.setPrice(Math.ceil(price * number));
- } else {
- pro.setPrice(Math.ceil(price));
- }
- list.add(pro);
- return list;
- }
- /**
- * 室内写真
- *
- * @param kind2
- * @param area
- * @param count
- * @param number
- * @return
- */
- 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;
- // 根据面积得到单价
- break;
- // pp纸(室内)
- case "3":
- 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":
- // 根据面积得到单价
- 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":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10};
- prices = new double[]{70, 60, 45};
- last_price = 40;
- min_price += 90;
- break;
- // 单透
- case "7":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10};
- prices = new double[]{75, 65, 55};
- last_price = 45;
- min_price += 100;
- break;
- // 静电贴
- case "8":
- // 根据面积得到单价
- areas = new double[]{1, 2, 5, 10};
- prices = new double[]{80, 68, 65, 63};
- last_price = 60;
- min_price += 50;
- break;
- // 软膜
- case "14":
- // 根据面积得到单价
- 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":
- // 根据面积得到单价
- 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":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{160, 150};
- last_price = 140;
- min_price += 160;
- break;
- // UV高透车贴(不含白墨)
- case "17":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{150, 140};
- last_price = 130;
- min_price += 160;
- break;
- // 高透贴
- case "18":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{110, 100};
- last_price = 90;
- min_price += 130;
- break;
- // 防撞条腰线UV透明喷膜(含白墨)
- case "19":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{130, 130};
- last_price = 110;
- min_price += 80;
- break;
- // 防撞条腰线UV磨砂贴(含白墨)
- case "20":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{140, 130};
- last_price = 120;
- min_price += 80;
- break;
- // 防撞条腰线粗哑膜磨砂贴(不含白墨)
- case "21":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{115, 105};
- last_price = 100;
- min_price += 80;
- break;
- // 防撞条腰线磨砂镂空(粗哑膜刻字)
- case "22":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{150, 140};
- last_price = 130;
- min_price += 100;
- break;
- // 防撞条腰线即时贴刻字
- case "23":
- // 根据面积得到单价
- areas = new double[]{5, 10};
- prices = new double[]{120, 110};
- last_price = 100;
- min_price += 70;
- break;
- case "24":
- price = area * 380 > 380 + 15 ? area * 380 : 380 + 15;
- break;
- }
- if (!"24".equals(kind2)) {
- double area_jis = area;
- if (width * length < 40 * 50) {
- area_jis = area_jis * number;
- }
- // if ("8".equals(kind2) && 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_jis * danjia, min_price);
- // }
- }
- Product pro = new Product();
- List<Product> list = new ArrayList<Product>();
- pro.setCount(count);
- // 价格 = 面积 * 单价 + (款数-1) * 40
- 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;
- }
- /**
- * 户外写真
- *
- * @param kind2
- * @param area
- * @param count
- * @param number
- * @return
- */
- 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[]{50, 40, 35, 32, 26, 24, 22};
- last_price = 26;
- min_price += 50 -5;
- // 根据面积得到单价
- weight = String.valueOf(DecimalFormat.format(area * 0.24 * number));
- break;
- // 户外写真黑胶(国产)
- case "1":
- // 根据面积得到单价
- areas = new double[]{2, 5, 7, 8, 10, 20, 50};
- prices = new double[]{50, 40, 35, 32, 26, 24, 22};
- last_price = 26;
- min_price += 50 - 5;
- weight = String.valueOf(DecimalFormat.format(area * 0.25 * number));
- break;
- // 户外写真可移白胶、黑胶
- case "2":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{60, 55, 50};
- last_price = 35;
- min_price += 50 + 15;
- weight = String.valueOf(DecimalFormat.format(area * 0.14 * number));
- break;
- // 户外写真喷膜
- case "3":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{65, 50, 45};
- last_price = 35;
- min_price += 80;
- break;
- // 户外写真灯片
- case "5":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{68, 50, 40};
- last_price = 30;
- min_price += 90;
- break;
- // 车贴(白胶)
- case "6":
- // 根据面积得到单价
- 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
- 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;
- }
- /**
- * 布
- *
- * @param kind2
- * @param area
- * @param length
- * @param width
- * @param count
- * @param number
- * @param craftBu
- * @return
- */
- public List<Product> acountPrice03(String kind2, Double length, Double width, Double area, int count,
- 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":
- // 根据面积得到单价
- areas = new double[]{5, 10,};
- prices = new double[]{30, 28};
- last_price = 25;
- min_price = 60;
- break;
- // 黑底布
- case "2":
- // 根据面积得到单价
- areas = new double[]{5, 10,};
- prices = new double[]{40, 34};
- last_price = 30;
- min_price = 70;
- break;
- // 写真布
- case "6":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{30, 28, 25};
- last_price = 23;
- min_price = 50 + 15;
- break;
- // 双喷布
- case "7":
- Product pro = new Product();
- List<Product> list = new ArrayList<Product>();
- double minSize = Math.min(length, width);
- double maxSize = Math.max(length, width);
- area = length * width * count * number;
- /*if (count == 1) {
- if (minSize < 1.52) {
- minSize = 1.52;
- area = maxSize * minSize * count * number;
- }
- }*/
- // 根据宽得到单价
- if (minSize <= 1.52) {
- danjia = 50;
- } else {
- danjia = 65;
- }
- price = area * danjia > 50 + 15 ? area * danjia : 50 + 15;
- // 挂轴 每米12元
- if ("挂轴".equals(craftBu)) {
- price = price + (maxSize * 12 > 12 ? maxSize * 12 : 12);
- }
- pro.setCount(count);
- // 价格 = 面积 * 单价 + 款数 * 20
- pro.setPrice(Math.ceil(price + number * 20));
- list.add(pro);
- return list;
- // 油画布
- case "8":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{80, 75, 60};
- last_price = 35;
- min_price = 130;
- break;
- // 墙纸
- case "9":
- // 根据面积得到单价
- areas = new double[]{2, 5, 10,};
- prices = new double[]{70, 60, 50};
- last_price = 35;
- min_price = 105;
- break;
- // 旗帜布
- case "10":
- // 根据面积得到单价
- if ("双喷".equals(craftBu)) {
- if ((width == 50 && length == 300 || length == 50 && width == 300) && count == 1) {
- price = 53;
- } else if (area <= 1) {
- price = 53;
- } else if (area <= 2) {
- price = 43 * area;
- } else if (area <= 3) {
- price = 38 * area;
- } else if (area <= 4) {
- price = 33 * area;
- } else if (area <= 5) {
- price = 31 * area;
- } else if (area <= 10) {
- price = 28 * area;
- } else {
- price = 25 * area;
- }
- } else {
- if ((width == 50 && length == 300) && (length == 50 && width == 300) && count == 1) {
- price = 50;
- } else if (area <= 1) {
- price = 50;
- } else if (area <= 2) {
- price = 40 * area;
- } else if (area <= 3) {
- price = 35 * area;
- } else if (area <= 4) {
- price = 33 * area;
- } else if (area <= 5) {
- price = 28 * area;
- } else if (area <= 10) {
- price = 25 * area;
- } else {
- price = 23 * area;
- }
- }
-
- /*if (area > 0 && area <= 3) {
- danjia = 20;
- } else if (area > 3 && area <= 5) {
- danjia = 19;
- } else if (area > 5 && area <= 10) {
- danjia = 18;
- } else {
- danjia = 17;
- }
- if(area < 1.5) {
- price = area * danjia + (count * 10) > 35 ? area * danjia + (count * 10) : 35;
- }else {
- price = area * danjia * count > 35 ? area * danjia * count : 35;
- }*/
- 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);
- 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;
- }
- /**
- * 展架
- *
- * @param kind2
- * @param count
- * @param number
- * @return
- */
- public List<Product> acountPrice04(String kind2, int count, Integer number) {
- double price = 0.0;
- String weight = "0";
- DecimalFormat DecimalFormat = new DecimalFormat("#.#####");
- switch (kind2) {
- // 直喷PVC装美式展架180*80
- case "0":
- price = 120;
- break;
- // 直喷PVC装美式展架160*60
- case "1":
- price = 115;
- break;
- // PP纸装美式展架180*80
- case "2":
- price = 115;
- break;
- // PP纸装美式展架160*60
- case "3":
- price = 110;
- break;
- // 直喷PVC装门型展架180*80
- case "4":
- price = 158;
- break;
- // PP纸装门型展架180*80
- case "6":
- price = 140;
- break;
- // PP纸装门型展架160*60
- case "7":
- price = 135;
- break;
- // X展架180*80(不含画面)
- case "8":
- price = 55;
- break;
- // X展架160*60(不含画面)
- case "9":
- price = 50;
- break;
- // 门型展架180*80(不含画面)
- case "10":
- price = 75;
- break;
- // 门型展架160*60(不含画面)
- case "11":
- price = 70;
- break;
- // 直喷pvc铝合金易拉宝
- case "12":
- price = 108;
- break;
- // 直喷pvc塑钢易拉宝
- case "13":
- price = 118;
- break;
- }
- Product pro = new Product();
- List<Product> list = new ArrayList<Product>();
- pro.setCount(count);
- // 价格 = 个数 * 款数 * 单价 ===================+ (款数-1) * 40
- pro.setPrice(Math.ceil(count * number * price));// + (number - 1) * 40
- list.add(pro);
- return list;
- }
- }
|