PDFCheckBox.java 3.77 KB
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 "";
    }
}