package lingtao.net.util;

import lingtao.net.bean.Product;
import org.springframework.util.StringUtils;

import java.util.List;

public class BqPrice {
    public List<Product> getPrice(int count, Double length, List<Product> list, Integer number, String craftShua, String[] craft) {
        double dj = 0;
        if (length == 96 || length == 120) {
            if (craftShua.equals("单面印刷")) {
                dj = 45;
            } else {
                dj = 60;
            }
        } else if (length == 192) {
            if (craftShua.equals("单面印刷")) {
                dj = 57;
            } else {
                dj = 75;
            }
        } else if (length == 144) {
            if (craftShua.equals("单面印刷")) {
                dj = 49;
            } else {
                dj = 70;
            }
        } else if (length == 240) {
            if (craftShua.equals("单面印刷")) {
                dj = 96;
            } else {
                dj = 125;
            }
        } else {
            if (craftShua.equals("单面印刷")) {
                dj = 111;
            } else {
                dj = 144;
            }
        }

        if (!StringUtils.isEmpty(craft) && craft[0].equals("旗杆")) {
            dj += 15;
        }
        dj += 5;
        Product pro = new Product();
        pro.setPrice(Math.ceil(dj * count * number * 1.2));
        pro.setCount(count);
        list.add(pro);
        return list;
    }
}
