Blame view

PDFCheckBox.java 3.77 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
package com.zhongzhi.common.constant;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class PDFCheckBox {

    public static String getType(String type, String projectGroup) {
        if (StringUtils.isBlank(type) &&
                projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
            return "□方案设计类    □模型创意类   □虚拟演示类";
        } else if (StringUtils.isBlank(type) &&
                projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
            return "□服装与服饰类设计    □视觉传达类   □产品设计类";
        }

        String[] typeT = {"方案设计类", "模型创意类", "虚拟演示类"};
        String typeValue = "";
        if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
            List<String> typeList = Arrays.stream(typeT).collect(Collectors.toList());
            List<String> str = Arrays.stream(type.split(",")).collect(Collectors.toList());
            for (String s : typeList) {
                if (str.contains(s)) {
                    typeValue += "■" + s + "    ";
                } else {
                    typeValue += "□" + s + "    ";
                }
            }
            return typeValue;
        } else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
            if (type.equals("服装与服饰类设计")) {
                return "■服装与服饰类设计    □视觉传达类   □产品设计类";
            } else if (type.equals("视觉传达类")) {
                return "□服装与服饰类设计    ■视觉传达类   □产品设计类";
            } else if (type.equals("产品设计类")) {
                return "□服装与服饰类设计    □视觉传达类   ■产品设计类";
            } else {
                return "□服装与服饰类设计    □视觉传达类   □产品设计类";
            }
        }
        return "";
    }

    public static String getRoadshow( String projectGroup) {
        if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
            return "□模型展示    □数字化演示" +
                    "    □PPT演示    □其他";
        } else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
            return "□物化产品展示    □作品模型展示" +
                    "    □数字化演示    □PPT演示    □其他";
        }

        String[] roadshowT = {"模型展示", "数字化演示", "PPT演示", "其他"};
        String[] roadshowC = {"物化产品展示", "作品模型展示", "数字化演示", "PPT演示", "其他"};

//        List<String> str = Arrays.stream(roadshow.split(",")).collect(Collectors.toList());
        String roadshowValue = "";
        if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
            List<String> roadshowTList = Arrays.stream(roadshowT).collect(Collectors.toList());
            for (String s : roadshowTList) {
//                if (str.contains(s)) {
//                    roadshowValue += "■" + s + "    ";
//                } else {
//                    roadshowValue += "□" + s + "    ";
//                }
            }
            return roadshowValue;
        } else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
            List<String> roadshowCList = Arrays.stream(roadshowC).collect(Collectors.toList());
            for (String s : roadshowCList) {
//                if (str.contains(s)) {
//                    roadshowValue += "■" + s + "    ";
//                } else {
//                    roadshowValue += "□" + s + "    ";
//                }
            }
            return roadshowValue;
        }
        return "";
    }
}