/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.filing.filingImages.service;

import com.google.common.collect.Lists;
import com.jeeplus.common.config.Global;
import com.jeeplus.common.utils.PropertiesLoader;
import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.core.web.Servlets;
import com.jeeplus.modules.filing.approvalStage.entity.ApprovalStage;
import com.jeeplus.modules.filing.approvalStage.entity.EarlyStage;
import com.jeeplus.modules.filing.approvalStage.entity.StudyStage;
import com.jeeplus.modules.filing.approvalStage.mapper.ApprovalStageMapper;
import com.jeeplus.modules.filing.approvalStage.mapper.EarlyStageMapper;
import com.jeeplus.modules.filing.approvalStage.mapper.StudyStageMapper;
import com.jeeplus.modules.filing.basicInformation.entity.BasicInformation;
import com.jeeplus.modules.filing.basicInformation.mapper.BasicInformationMapper;
import com.jeeplus.modules.filing.constructionStage.entity.ConstructionStage;
import com.jeeplus.modules.filing.constructionStage.mapper.ConstructionStageMapper;
import com.jeeplus.modules.filing.earlyEngineering.entity.*;
import com.jeeplus.modules.filing.earlyEngineering.mapper.*;
import com.jeeplus.modules.filing.filingImages.entity.FilingImages;
import com.jeeplus.modules.filing.filingImages.mapper.FilingImagesMapper;
import com.jeeplus.modules.filing.filingImages.utils.ZipCompressUtil;
import com.jeeplus.modules.filing.summary.entity.Summary;
import com.jeeplus.modules.filing.summary.mapper.SummaryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

import static com.jeeplus.common.config.Global.SYS_TYPE;

/**
 * 图片管理Service
 *
 * @author qy
 * @version 2021-03-25
 */
@Service
@Transactional(readOnly = true)
public class FilingImagesService extends CrudService<FilingImagesMapper, FilingImages> {

    @Autowired
    private BasicInformationMapper basicInformationMapper;


    @Autowired
    private ApprovalStageMapper approvalStageMapper;


    @Autowired
    private EarlyStageMapper earlyStageMapper;

    @Autowired
    private StudyStageMapper studyStageMapper;

    @Autowired
    private DesignStageMapper designStageMapper;

    @Autowired
    private ReviewStageMapper reviewStageMapper;

    @Autowired
    private BiddingContractMapper biddingContractMapper;

    @Autowired
    private ApplicationForMapper applicationForMapper;

    @Autowired
    private EarlyEngineeringMapper earlyEngineeringMapper;

    @Autowired
    private ConstructionStageMapper constructionStageMapper;

    @Autowired
    private SummaryMapper summaryMapper;

    /**
     * 属性文件加载对象
     */
    private static PropertiesLoader loader = new PropertiesLoader("/properties/jeeplus.properties");

    public List<FilingImages> findByProjectId(String id) {
        return mapper.findByProjectId(id);
    }



    /**
     * 通过项目id导出项目的核准附件
     *
     * @param idList
     */
    public String exportApproved(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        //通过id查询出所有的项目信息
        List<ApprovalStage> byIdList = approvalStageMapper.findByIdList(idList);
        //循环遍历，判断项目是否存在
        for (ApprovalStage a :
                byIdList) {
            File dirFile = null;
            List<FilingImages> filingImagesList = null;
            List<FilingImages> exportList = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String approvedAnnex = a.getApprovedAnnex();
            if (null!=approvedAnnex && !"".equals(approvedAnnex)) {
                dirFile = new File(downloadPath + "/核准阶段");
                if (approvedAnnex.contains("|")) {
                    String[] split = approvedAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("核准附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(approvedAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("核准附件");
                    exportList.add(filingImages);
                }
                if (exportList.size() > 0) {
                    this.disposeFileList(exportList, dirFile.getPath());
                }
            }
        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 项目相应文件批量下载并压缩
     *
     * @param idList
     */
    public String exportStudy(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<StudyStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<StudyStage> byIdList = studyStageMapper.findAllStudy(idList);

        for (StudyStage a :
                byIdList) {
            allList.add(a);
            List<StudyStage> childList = studyStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (StudyStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }

        //循环遍历，判断项目是否存在
        for (StudyStage a :
                allList) {
            File dirFile = null;
            List<FilingImages> filingImagesList = null;
            List<FilingImages> exportList = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String studyAppendix = a.getStudyAppendix();
            if (null!=studyAppendix && !"".equals(studyAppendix)) {
                dirFile = new File(downloadPath + "/可研阶段");
                if (studyAppendix.contains("|")) {
                    String[] split = studyAppendix.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("可研附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(studyAppendix);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("可研附件");
                    exportList.add(filingImages);
                }
                if (exportList.size() > 0) {
                    this.disposeFileList(exportList, dirFile.getPath());
                }
            }
        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 项目相应文件批量下载并压缩
     *
     * @param idList
     */
    public String exportStudyStage(List<String> idList,String purpose) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        List<String> allIdList = new ArrayList<>();
        //通过id查询出
        //通过id查询出所有有关联的id
        for (String projectId : idList) {
            allIdList.add(projectId);
            BasicInformation one = basicInformationMapper.findOne(projectId);
            List<BasicInformation> childByCode = null;
            try {
                childByCode = basicInformationMapper.findChildByCode(one.getProjectCode());
            } catch (Exception e) {
                e.printStackTrace();
            }
            for (BasicInformation b :
                    childByCode) {
                allIdList.add(b.getId());
            }
        }

        //遍历项目id并查询对应数据信息
        for (String projectId : allIdList) {
            //通过id查询项目信息
            BasicInformation one = basicInformationMapper.findOne(projectId);
            String projectCode = one.getProjectCode();
            //通过项目信息获取附件信息
            List<String> byCode = mapper.findAllPurpose(projectCode);
            File dirFile = null;
            List<FilingImages> filingImagesList = null;
            List<FilingImages> exportList = new ArrayList<>();
            String downloadPath = path + "/" + one.getProjectCode();
            for (String a :
                    byCode) {
                switch (a) {
                    case "核准附件":
                        dirFile = new File(downloadPath + "/核准阶段");
                        filingImagesList = Lists.newArrayList();
                        filingImagesList = mapper.findAllUpload(one.getProjectCode(), a);
                        for (FilingImages filing :
                                filingImagesList) {
                            if (filing.getImgPath().contains("|")) {
                                String[] split = filing.getImgPath().split("\\|");
                                for (int i = 0; i < split.length; i++) {
                                    FilingImages filingImages = new FilingImages();
                                    filingImages.setImgPath(split[i]);
                                    filingImages.setProjectCode(filing.getProjectCode());
                                    filingImages.setPurpose(filing.getPurpose());
                                    exportList.add(filingImages);
                                }

                            } else {
                                exportList.add(filing);
                            }
                        }
                        this.disposeFileList(exportList, dirFile.getPath());
                        break;
                    case "可研附件":
                        dirFile = new File(downloadPath + "/可研阶段");
                        filingImagesList = Lists.newArrayList();
                        filingImagesList = mapper.findAllUpload(one.getProjectCode(), a);
                        for (FilingImages filing :
                                filingImagesList) {
                            if (filing.getImgPath().contains("|")) {
                                String[] split = filing.getImgPath().split("\\|");
                                for (int i = 0; i < split.length; i++) {
                                    FilingImages filingImages = new FilingImages();
                                    filingImages.setImgPath(split[i]);
                                    filingImages.setProjectCode(filing.getProjectCode());
                                    filingImages.setPurpose(filing.getPurpose());
                                    exportList.add(filingImages);
                                }

                            } else {
                                exportList.add(filing);
                            }
                        }
                        this.disposeFileList(exportList, dirFile.getPath());
                        break;
                    case "初设附件":
                        dirFile = new File(downloadPath + "/初设阶段");
                        break;
                }
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 处理文件信息
     *
     * @param downloadPath
     */
    public void disposeFileList(List<FilingImages> filingImages, String downloadPath) throws IOException {
        ZipCompressUtil zipCompressUtil = new ZipCompressUtil();
        String FILE_PREFIX = loader.getProperty("linux.file.store.prefix");
        if (SYS_TYPE.equals("1")) {
            for (FilingImages info : filingImages) {
                zipCompressUtil.downloadRuralProject(info.getImgPath().substring(0, info.getImgPath().lastIndexOf("/")), info.getImgPath().substring(info.getImgPath().lastIndexOf("/") + 1, info.getImgPath().length()), downloadPath);
            }
        } else {
            for (FilingImages info : filingImages) {
                zipCompressUtil.downloadRuralProject(FILE_PREFIX+info.getImgPath().substring(0, info.getImgPath().lastIndexOf("/")), info.getImgPath().substring(info.getImgPath().lastIndexOf("/") + 1, info.getImgPath().length()), downloadPath);
            }
        }

    }

    /**
     * 下载压缩文件
     *
     * @param filePath
     * @param response
     */
    public void downloadZipFile(String filePath, HttpServletResponse response) {
        File file = new File(filePath);
        //取得文件名。
        String fileName = file.getName();
        InputStream in = null;
        try {
            fileName = URLEncoder.encode(fileName, "UTF8");
            in = new FileInputStream(file);
            response.reset();//重置 响应头
            response.setCharacterEncoding("UTF-8");
            response.setContentType("application/x-download");
            response.setHeader("Content-disposition", "attachment; filename=" + fileName);

            byte[] b = new byte[1024];
            int len;
            while ((len = in.read(b)) > 0) {
                response.getOutputStream().write(b, 0, len);
            }
            in.close();
            response.getOutputStream().close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            //路径是个文件且不为空时删除文件
            if (file.isFile() && file.exists()) {
                file.delete();
            }
        }
    }


    /**
     * 通过项目id导出项目的核准附件
     *
     * @param idList
     */
    public String exportEarlyStage(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<EarlyStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<EarlyStage> byIdList = earlyStageMapper.findAllStudy(idList);

        for (EarlyStage a :
                byIdList) {
            allList.add(a);
            List<EarlyStage> childList = earlyStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (EarlyStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (EarlyStage a :
                allList) {
            File dirFile = null;
            File dirFile2 = null;
            List<FilingImages> filingImagesList = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String approvedAnnex = a.getApprovedAnnex();
            if (null!=approvedAnnex && !"".equals(approvedAnnex)) {
                dirFile = new File(downloadPath + "/核准阶段");
                if (approvedAnnex.contains("|")) {
                    String[] split = approvedAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("核准附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(approvedAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("核准附件");
                    exportList.add(filingImages);
                }
            }
            String studyAppendix = a.getStudyAppendix();
            if (null!=studyAppendix && !"".equals(studyAppendix)) {
                dirFile2 = new File(downloadPath + "/可研阶段");
                if (studyAppendix.contains("|")) {
                    String[] split = studyAppendix.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("核准附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(studyAppendix);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("可研附件");
                    exportList2.add(filingImages);
                }
            }
            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile2.getPath());
            }
        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 通过项目id导出项目的初设阶段
     *
     * @param idList
     */
    public String exportDesignStage(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<DesignStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<DesignStage> byIdList = designStageMapper.findAll(idList);

        for (DesignStage a :
                byIdList) {
            allList.add(a);
            List<DesignStage> childList = designStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (DesignStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (DesignStage a :
                allList) {
            File dirFile = null;
            List<FilingImages> filingImagesList = null;
            List<FilingImages> exportList = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String designAnnex = a.getPreDesignAnnex();
            if (null!=designAnnex && !"".equals(designAnnex)) {
                dirFile = new File(downloadPath + "/初设阶段");
                if (designAnnex.contains("|")) {
                    String[] split = designAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("初设附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(designAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("初设附件");
                    exportList.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 通过项目id导出项目的招标与合同管理
     *
     * @param idList
     */
    public String exportBiddingContract(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<BiddingContract> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<BiddingContract> byIdList = biddingContractMapper.findAll(idList);

        for (BiddingContract a :
                byIdList) {
            allList.add(a);
            List<BiddingContract> childList = biddingContractMapper.findChildList(a);
            if (childList.size() > 0) {
                for (BiddingContract b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (BiddingContract a :
                allList) {
            File dirFile = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            List<FilingImages> exportList3 = new ArrayList<>();
            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String letterDesign = a.getLetterDesign();
            String disigningContract = a.getDisigningContract();
            String ownerDapartment = a.getOwnerDapartment();
            String inspectionControl = a.getInspectionControl();
            String letterAcceptance = a.getLetterAcceptance();
            String conContract = a.getConContract();
            String otherContracts = a.getOtherContracts();


            if (null!=letterDesign && !"".equals(letterDesign)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (letterDesign.contains("|")) {
                    String[] split = letterDesign.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterDesign);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList.add(filingImages);
                }
            }

            if (null!=disigningContract && !"".equals(disigningContract)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (disigningContract.contains("|")) {
                    String[] split = disigningContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(disigningContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList2.add(filingImages);
                }
            }

            if (null!=ownerDapartment && !"".equals(ownerDapartment)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (ownerDapartment.contains("|")) {
                    String[] split = ownerDapartment.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(ownerDapartment);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList3.add(filingImages);
                }
            }

            if (null!=inspectionControl && !"".equals(inspectionControl)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (inspectionControl.contains("|")) {
                    String[] split = inspectionControl.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(inspectionControl);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=letterAcceptance && !"".equals(letterAcceptance)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (letterAcceptance.contains("|")) {
                    String[] split = letterAcceptance.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterAcceptance);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=conContract && !"".equals(conContract)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (conContract.contains("|")) {
                    String[] split = conContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=otherContracts && !"".equals(otherContracts)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (otherContracts.contains("|")) {
                    String[] split = otherContracts.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(otherContracts);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList7.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile.getPath());
            }
            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile.getPath());
            }
            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 通过项目id导出项目的保健审批
     * @param idList
     */
    public String exportApplicationFor(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ApplicationFor> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ApplicationFor> byIdList = applicationForMapper.findAll(idList);

        for (ApplicationFor a :
                byIdList) {
            allList.add(a);
            List<ApplicationFor> childList = applicationForMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ApplicationFor b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ApplicationFor a :
                allList) {
            File dirFile = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            List<FilingImages> exportList3 = new ArrayList<>();
            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            List<FilingImages> exportList8 = new ArrayList<>();
            List<FilingImages> exportList9 = new ArrayList<>();
            List<FilingImages> exportList10 = new ArrayList<>();
            List<FilingImages> exportList11 = new ArrayList<>();
            List<FilingImages> exportList12 = new ArrayList<>();
            List<FilingImages> exportList13 = new ArrayList<>();
            List<FilingImages> exportList14 = new ArrayList<>();
            List<FilingImages> exportList15 = new ArrayList<>();
            List<FilingImages> exportList16 = new ArrayList<>();
            List<FilingImages> exportList17 = new ArrayList<>();
            List<FilingImages> exportList18 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String landAnnex = a.getLandAnnex();
            String eiaAnnex = a.getEiaAnnex();
            String acceptanceAnnex = a.getAcceptanceAnnex();
            String replyAnnex = a.getReplyAnnex();
            String soilannex = a.getSoilannex();
            String depositAnnex = a.getDepositAnnex();
            String recordAnnex = a.getRecordAnnex();
            String siteProposalAnnex = a.getSiteProposalAnnex();
            String planningAnnex = a.getPlanningAnnex();
            String usePlanAnnex = a.getUsePlanAnnex();
            String requisitonAnnex = a.getRequisitonAnnex();
            String conLandAnnex = a.getConLandAnnex();
            String transferAnnex = a.getTransferAnnex();
            String certificateAnnex = a.getCertificateAnnex();
            String permitAnnex = a.getPermitAnnex();
            String fireProAnnex = a.getFireProAnnex();
            String fireAccAnnex = a.getFireAccAnnex();
            String estateAnnex = a.getEstateAnnex();


            if (null!=landAnnex && !"".equals(landAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (landAnnex.contains("|")) {
                    String[] split = landAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(landAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList.add(filingImages);
                }
            }

            if (null!=eiaAnnex && !"".equals(eiaAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (eiaAnnex.contains("|")) {
                    String[] split = eiaAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(eiaAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList2.add(filingImages);
                }
            }

            if (null!=acceptanceAnnex && !"".equals(acceptanceAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (acceptanceAnnex.contains("|")) {
                    String[] split = acceptanceAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(acceptanceAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList3.add(filingImages);
                }
            }

            if (null!=replyAnnex && !"".equals(replyAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (replyAnnex.contains("|")) {
                    String[] split = replyAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(replyAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=soilannex && !"".equals(soilannex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (soilannex.contains("|")) {
                    String[] split = soilannex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(soilannex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=depositAnnex && !"".equals(depositAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (depositAnnex.contains("|")) {
                    String[] split = depositAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(depositAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=recordAnnex && !"".equals(recordAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (recordAnnex.contains("|")) {
                    String[] split = recordAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(recordAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList7.add(filingImages);
                }
            }

            if (null!=siteProposalAnnex && !"".equals(siteProposalAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (siteProposalAnnex.contains("|")) {
                    String[] split = siteProposalAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList8.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(siteProposalAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList8.add(filingImages);
                }
            }

            if (null!=planningAnnex && !"".equals(planningAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (planningAnnex.contains("|")) {
                    String[] split = planningAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList9.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(planningAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList9.add(filingImages);
                }
            }

            if (null!=usePlanAnnex && !"".equals(usePlanAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (usePlanAnnex.contains("|")) {
                    String[] split = usePlanAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList10.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(usePlanAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList10.add(filingImages);
                }
            }

            if (null!=requisitonAnnex && !"".equals(requisitonAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (requisitonAnnex.contains("|")) {
                    String[] split = requisitonAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList11.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(requisitonAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList11.add(filingImages);
                }
            }

            if (null!=conLandAnnex && !"".equals(conLandAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (conLandAnnex.contains("|")) {
                    String[] split = conLandAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList12.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conLandAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList12.add(filingImages);
                }
            }

            if (null!=transferAnnex && !"".equals(transferAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (transferAnnex.contains("|")) {
                    String[] split = transferAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList13.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(transferAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList13.add(filingImages);
                }
            }

            if (null!=certificateAnnex && !"".equals(certificateAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (certificateAnnex.contains("|")) {
                    String[] split = certificateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList14.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(certificateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList14.add(filingImages);
                }
            }

            if (null!=permitAnnex && !"".equals(permitAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (permitAnnex.contains("|")) {
                    String[] split = permitAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList15.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(permitAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList15.add(filingImages);
                }
            }

            if (null!=fireProAnnex && !"".equals(fireProAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (fireProAnnex.contains("|")) {
                    String[] split = fireProAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList16.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireProAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList16.add(filingImages);
                }
            }

            if (null!=fireAccAnnex && !"".equals(fireAccAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (fireAccAnnex.contains("|")) {
                    String[] split = fireAccAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList17.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireAccAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList17.add(filingImages);
                }
            }

            if (null!=estateAnnex && !"".equals(estateAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (estateAnnex.contains("|")) {
                    String[] split = estateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList18.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(estateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList18.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile.getPath());
            }
            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile.getPath());
            }
            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile.getPath());
            }
            if (exportList8.size() > 0) {
                this.disposeFileList(exportList8, dirFile.getPath());
            }
            if (exportList9.size() > 0) {
                this.disposeFileList(exportList9, dirFile.getPath());
            }
            if (exportList10.size() > 0) {
                this.disposeFileList(exportList10, dirFile.getPath());
            }
            if (exportList11.size() > 0) {
                this.disposeFileList(exportList11, dirFile.getPath());
            }
            if (exportList12.size() > 0) {
                this.disposeFileList(exportList12, dirFile.getPath());
            }
            if (exportList13.size() > 0) {
                this.disposeFileList(exportList13, dirFile.getPath());
            }
            if (exportList14.size() > 0) {
                this.disposeFileList(exportList14, dirFile.getPath());
            }
            if (exportList15.size() > 0) {
                this.disposeFileList(exportList15, dirFile.getPath());
            }
            if (exportList16.size() > 0) {
                this.disposeFileList(exportList16, dirFile.getPath());
            }
            if (exportList17.size() > 0) {
                this.disposeFileList(exportList17, dirFile.getPath());
            }
            if (exportList18.size() > 0) {
                this.disposeFileList(exportList18, dirFile.getPath());
            }


        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的初设阶段
     *
     * @param idList
     */
    public String exportEarlyEngineering(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<EarlyEngineering> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<EarlyEngineering> byIdList = earlyEngineeringMapper.findAll(idList);

        for (EarlyEngineering a :
                byIdList) {
            allList.add(a);
            List<EarlyEngineering> childList = earlyEngineeringMapper.findChildList(a);
            if (childList.size() > 0) {
                for (EarlyEngineering b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (EarlyEngineering a :
                allList) {
            File dirFile = null;
            File dirFile2 = null;
            File dirFile3 = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            List<FilingImages> exportList3 = new ArrayList<>();
            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            List<FilingImages> exportList8 = new ArrayList<>();
            List<FilingImages> exportList9  = new ArrayList<>();
            List<FilingImages> exportList10  = new ArrayList<>();
            List<FilingImages> exportList11  = new ArrayList<>();
            List<FilingImages> exportList12 = new ArrayList<>();
            List<FilingImages> exportList13 = new ArrayList<>();
            List<FilingImages> exportList14 = new ArrayList<>();
            List<FilingImages> exportList15 = new ArrayList<>();
            List<FilingImages> exportList16 = new ArrayList<>();
            List<FilingImages> exportList17 = new ArrayList<>();
            List<FilingImages> exportList18 = new ArrayList<>();
            List<FilingImages> exportList19 = new ArrayList<>();
            List<FilingImages> exportList20 = new ArrayList<>();
            List<FilingImages> exportList21 = new ArrayList<>();
            List<FilingImages> exportList22 = new ArrayList<>();
            List<FilingImages> exportList23 = new ArrayList<>();
            List<FilingImages> exportList24 = new ArrayList<>();
            List<FilingImages> exportList25 = new ArrayList<>();
            List<FilingImages> exportList26 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String designAnnex = a.getPreDesignAnnex();
            String letterDesign = a.getLetterDesign();
            String disigningContract = a.getDisigningContract();
            String ownerDapartment = a.getOwnerDapartment();
            String inspectionControl = a.getInspectionControl();
            String letterAcceptance = a.getLetterAcceptance();
            String conContract = a.getConContract();
            String otherContracts = a.getOtherContracts();
            String landAnnex = a.getLandAnnex();
            String eiaAnnex = a.getEiaAnnex();
            String acceptanceAnnex = a.getAcceptanceAnnex();
            String replyAnnex = a.getReplyAnnex();
            String soilannex = a.getSoilannex();
            String depositAnnex = a.getDepositAnnex();
            String recordAnnex = a.getRecordAnnex();
            String siteProposalAnnex = a.getSiteProposalAnnex();
            String planningAnnex = a.getPlanningAnnex();
            String usePlanAnnex = a.getUsePlanAnnex();
            String requisitonAnnex = a.getRequisitonAnnex();
            String conLandAnnex = a.getConLandAnnex();
            String transferAnnex = a.getTransferAnnex();
            String certificateAnnex = a.getCertificateAnnex();
            String permitAnnex = a.getPermitAnnex();
            String fireProAnnex = a.getFireProAnnex();
            String fireAccAnnex = a.getFireAccAnnex();
            String estateAnnex = a.getEstateAnnex();


            if (null!=designAnnex && !"".equals(designAnnex)) {
                dirFile3 = new File(downloadPath + "/初设阶段");
                if (designAnnex.contains("|")) {
                    String[] split = designAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("初设附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(designAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("初设附件");
                    exportList.add(filingImages);
                }
            }

            if (null!=letterDesign && !"".equals(letterDesign)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (letterDesign.contains("|")) {
                    String[] split = letterDesign.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterDesign);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList2.add(filingImages);
                }
            }

            if (null!=disigningContract && !"".equals(disigningContract)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (disigningContract.contains("|")) {
                    String[] split = disigningContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(disigningContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList3.add(filingImages);
                }
            }

            if (null!=ownerDapartment && !"".equals(ownerDapartment)) {
                dirFile = new File(downloadPath + "/招标与合同管理");
                if (ownerDapartment.contains("|")) {
                    String[] split = ownerDapartment.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(ownerDapartment);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=inspectionControl && !"".equals(inspectionControl)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (inspectionControl.contains("|")) {
                    String[] split = inspectionControl.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(inspectionControl);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=letterAcceptance && !"".equals(letterAcceptance)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (letterAcceptance.contains("|")) {
                    String[] split = letterAcceptance.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterAcceptance);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=conContract && !"".equals(conContract)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (conContract.contains("|")) {
                    String[] split = conContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList7.add(filingImages);
                }
            }

            if (null!=otherContracts && !"".equals(otherContracts)) {
                dirFile2 = new File(downloadPath + "/招标与合同管理");
                if (otherContracts.contains("|")) {
                    String[] split = otherContracts.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList8.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(otherContracts);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList8.add(filingImages);
                }
            }

            if (null!=landAnnex && !"".equals(landAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (landAnnex.contains("|")) {
                    String[] split = landAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList9.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(landAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList9.add(filingImages);
                }
            }

            if (null!=eiaAnnex && !"".equals(eiaAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (eiaAnnex.contains("|")) {
                    String[] split = eiaAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList10.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(eiaAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList10.add(filingImages);
                }
            }

            if (null!=acceptanceAnnex && !"".equals(acceptanceAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (acceptanceAnnex.contains("|")) {
                    String[] split = acceptanceAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList11.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(acceptanceAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList11.add(filingImages);
                }
            }

            if (null!=replyAnnex && !"".equals(replyAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (replyAnnex.contains("|")) {
                    String[] split = replyAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList12.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(replyAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList12.add(filingImages);
                }
            }

            if (null!=soilannex && !"".equals(soilannex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (soilannex.contains("|")) {
                    String[] split = soilannex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList13.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(soilannex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList13.add(filingImages);
                }
            }

            if (null!=depositAnnex && !"".equals(depositAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (depositAnnex.contains("|")) {
                    String[] split = depositAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList14.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(depositAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList14.add(filingImages);
                }
            }

            if (null!=recordAnnex && !"".equals(recordAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (recordAnnex.contains("|")) {
                    String[] split = recordAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList15.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(recordAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList15.add(filingImages);
                }
            }

            if (null!=siteProposalAnnex && !"".equals(siteProposalAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (siteProposalAnnex.contains("|")) {
                    String[] split = siteProposalAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList16.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(siteProposalAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList16.add(filingImages);
                }
            }

            if (null!=planningAnnex && !"".equals(planningAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (planningAnnex.contains("|")) {
                    String[] split = planningAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList17.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(planningAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList17.add(filingImages);
                }
            }

            if (null!=usePlanAnnex && !"".equals(usePlanAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (usePlanAnnex.contains("|")) {
                    String[] split = usePlanAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList18.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(usePlanAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList18.add(filingImages);
                }
            }

            if (null!=requisitonAnnex && !"".equals(requisitonAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (requisitonAnnex.contains("|")) {
                    String[] split = requisitonAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList19.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(requisitonAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList19.add(filingImages);
                }
            }

            if (null!=conLandAnnex && !"".equals(conLandAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (conLandAnnex.contains("|")) {
                    String[] split = conLandAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList20.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conLandAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList20.add(filingImages);
                }
            }

            if (null!=transferAnnex && !"".equals(transferAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (transferAnnex.contains("|")) {
                    String[] split = transferAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList21.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(transferAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList21.add(filingImages);
                }
            }

            if (null!=certificateAnnex && !"".equals(certificateAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (certificateAnnex.contains("|")) {
                    String[] split = certificateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList22.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(certificateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList22.add(filingImages);
                }
            }

            if (null!=permitAnnex && !"".equals(permitAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (permitAnnex.contains("|")) {
                    String[] split = permitAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList23.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(permitAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList23.add(filingImages);
                }
            }

            if (null!=fireProAnnex && !"".equals(fireProAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (fireProAnnex.contains("|")) {
                    String[] split = fireProAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList24.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireProAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList24.add(filingImages);
                }
            }

            if (null!=fireAccAnnex && !"".equals(fireAccAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (fireAccAnnex.contains("|")) {
                    String[] split = fireAccAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList25.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireAccAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList25.add(filingImages);
                }
            }

            if (null!=estateAnnex && !"".equals(estateAnnex)) {
                dirFile = new File(downloadPath + "/报建审批");
                if (estateAnnex.contains("|")) {
                    String[] split = estateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList26.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(estateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList26.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile3.getPath());
            }

            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile2.getPath());
            }
            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile2.getPath());
            }
            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile2.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile2.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile2.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile2.getPath());
            }
            if (exportList8.size() > 0) {
                this.disposeFileList(exportList8, dirFile2.getPath());
            }
            if (exportList9.size() > 0) {
                this.disposeFileList(exportList9, dirFile.getPath());
            }
            if (exportList10.size() > 0) {
                this.disposeFileList(exportList10, dirFile.getPath());
            }
            if (exportList11.size() > 0) {
                this.disposeFileList(exportList11, dirFile.getPath());
            }
            if (exportList12.size() > 0) {
                this.disposeFileList(exportList12, dirFile.getPath());
            }
            if (exportList13.size() > 0) {
                this.disposeFileList(exportList13, dirFile.getPath());
            }
            if (exportList14.size() > 0) {
                this.disposeFileList(exportList14, dirFile.getPath());
            }
            if (exportList15.size() > 0) {
                this.disposeFileList(exportList15, dirFile.getPath());
            }
            if (exportList16.size() > 0) {
                this.disposeFileList(exportList16, dirFile.getPath());
            }
            if (exportList17.size() > 0) {
                this.disposeFileList(exportList17, dirFile.getPath());
            }
            if (exportList18.size() > 0) {
                this.disposeFileList(exportList18, dirFile.getPath());
            }
            if (exportList19.size() > 0) {
                this.disposeFileList(exportList19, dirFile.getPath());
            }
            if (exportList20.size() > 0) {
                this.disposeFileList(exportList20, dirFile.getPath());
            }
            if (exportList21.size() > 0) {
                this.disposeFileList(exportList21, dirFile.getPath());
            }
            if (exportList22.size() > 0) {
                this.disposeFileList(exportList22, dirFile.getPath());
            }
            if (exportList23.size() > 0) {
                this.disposeFileList(exportList23, dirFile.getPath());
            }
            if (exportList24.size() > 0) {
                this.disposeFileList(exportList24, dirFile.getPath());
            }
            if (exportList25.size() > 0) {
                this.disposeFileList(exportList25, dirFile.getPath());
            }
            if (exportList26.size() > 0) {
                this.disposeFileList(exportList26, dirFile.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }


    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportConstructionStage(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile = null;
            File dirFile2 = null;
            File dirFile3 = null;
            File dirFile4 = null;
            File dirFile5 = null;
            File dirFile6 = null;
            File dirFile7 = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            List<FilingImages> exportList3 = new ArrayList<>();
            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            List<FilingImages> exportList8 = new ArrayList<>();
            List<FilingImages> exportList9 = new ArrayList<>();
            List<FilingImages> exportList10 = new ArrayList<>();
            List<FilingImages> exportList11 = new ArrayList<>();
            List<FilingImages> exportList12 = new ArrayList<>();
            List<FilingImages> exportList13 = new ArrayList<>();
            List<FilingImages> exportList14 = new ArrayList<>();
            List<FilingImages> exportList15 = new ArrayList<>();
            List<FilingImages> exportList16 = new ArrayList<>();
            List<FilingImages> exportList17 = new ArrayList<>();
            List<FilingImages> exportList18 = new ArrayList<>();
            List<FilingImages> exportList19 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String commReport = a.getCommReport();
            String compLetion = a.getCompLetion();
            String cossReport = a.getCossReport();
            String enclosure = a.getEnclosure();
            String scheduleCivil = a.getScheduleCivil();
            String scheduleElectrical = a.getScheduleElectrical();
            String scheduleDebugging = a.getScheduleDebugging();
            String scheduleCheck = a.getScheduleCheck();
            String scheduleCumulative = a.getScheduleCumulative();
            String openingCommittee = a.getOpeningCommittee();
            String engineeringHonors = a.getEngineeringHonors();
            String settAuditReport = a.getSettAuditReport();
            String accAuditReport = a.getAccAuditReport();
            String standardProduction = a.getStandardProduction();
            String fiveParty = a.getFiveParty();
            String mettingMinutes = a.getMettingMinutes();
            String deductionForm = a.getDeductionForm();
            String returnAndScrap = a.getReturnAndScrap();
            String importantAccessories = a.getImportantAccessories();


            if (null!=commReport && !"".equals(commReport)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (commReport.contains("|")) {
                    String[] split = commReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(commReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList.add(filingImages);
                }
            }

            if (null!=compLetion && !"".equals(compLetion)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (compLetion.contains("|")) {
                    String[] split = compLetion.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(compLetion);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList2.add(filingImages);
                }
            }

            if (null!=cossReport && !"".equals(cossReport)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (cossReport.contains("|")) {
                    String[] split = cossReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(cossReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList3.add(filingImages);
                }
            }

            if (null!=enclosure && !"".equals(enclosure)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (enclosure.contains("|")) {
                    String[] split = enclosure.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(enclosure);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=scheduleCivil && !"".equals(scheduleCivil)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCivil.contains("|")) {
                    String[] split = scheduleCivil.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCivil);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=scheduleElectrical && !"".equals(scheduleElectrical)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleElectrical.contains("|")) {
                    String[] split = scheduleElectrical.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleElectrical);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=scheduleDebugging && !"".equals(scheduleDebugging)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleDebugging.contains("|")) {
                    String[] split = scheduleDebugging.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleDebugging);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList7.add(filingImages);
                }
            }

            if (null!=scheduleCheck && !"".equals(scheduleCheck)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCheck.contains("|")) {
                    String[] split = scheduleCheck.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList8.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCheck);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList8.add(filingImages);
                }
            }

            if (null!=scheduleCumulative && !"".equals(scheduleCumulative)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCumulative.contains("|")) {
                    String[] split = scheduleCumulative.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList9.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCumulative);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList9.add(filingImages);
                }
            }

            if (null!=openingCommittee && !"".equals(openingCommittee)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (openingCommittee.contains("|")) {
                    String[] split = openingCommittee.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList10.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(openingCommittee);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList10.add(filingImages);
                }
            }


            if (null!=engineeringHonors && !"".equals(engineeringHonors)) {
                dirFile3 = new File(downloadPath + "/安全质量管理");
                if (engineeringHonors.contains("|")) {
                    String[] split = engineeringHonors.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全质量管理附件");
                        exportList11.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(engineeringHonors);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全质量管理附件");
                    exportList11.add(filingImages);
                }
            }


            if (null!=settAuditReport && !"".equals(settAuditReport)) {
                dirFile4 = new File(downloadPath + "/造价管理");
                if (settAuditReport.contains("|")) {
                    String[] split = settAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList12.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(settAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList12.add(filingImages);
                }
            }


            if (null!=accAuditReport && !"".equals(accAuditReport)) {
                dirFile4 = new File(downloadPath + "/造价管理");
                if (accAuditReport.contains("|")) {
                    String[] split = accAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList13.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(accAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList13.add(filingImages);
                }
            }


            if (null!=standardProduction && !"".equals(standardProduction)) {
                dirFile5 = new File(downloadPath + "/质量管理");
                if (standardProduction.contains("|")) {
                    String[] split = standardProduction.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList14.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(standardProduction);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList14.add(filingImages);
                }
            }


            if (null!=fiveParty && !"".equals(fiveParty)) {
                dirFile5 = new File(downloadPath + "/质量管理");
                if (fiveParty.contains("|")) {
                    String[] split = fiveParty.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList15.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fiveParty);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList15.add(filingImages);
                }
            }


            if (null!=mettingMinutes && !"".equals(mettingMinutes)) {
                dirFile6 = new File(downloadPath + "/安全管理");
                if (mettingMinutes.contains("|")) {
                    String[] split = mettingMinutes.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList16.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(mettingMinutes);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList16.add(filingImages);
                }
            }


            if (null!=deductionForm && !"".equals(deductionForm)) {
                dirFile6 = new File(downloadPath + "/安全管理");
                if (deductionForm.contains("|")) {
                    String[] split = deductionForm.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList17.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(deductionForm);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList17.add(filingImages);
                }
            }


            if (null!=returnAndScrap && !"".equals(returnAndScrap)) {
                dirFile7 = new File(downloadPath + "/其他");
                if (returnAndScrap.contains("|")) {
                    String[] split = returnAndScrap.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList18.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(returnAndScrap);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList18.add(filingImages);
                }
            }

            if (null!=importantAccessories && !"".equals(importantAccessories)) {
                dirFile7 = new File(downloadPath + "/其他");
                if (importantAccessories.contains("|")) {
                    String[] split = importantAccessories.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList19.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(importantAccessories);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList19.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile.getPath());
            }
            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile.getPath());
            }
            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile2.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile2.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile2.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile2.getPath());
            }
            if (exportList8.size() > 0) {
                this.disposeFileList(exportList8, dirFile2.getPath());
            }
            if (exportList9.size() > 0) {
                this.disposeFileList(exportList9, dirFile2.getPath());
            }
            if (exportList10.size() > 0) {
                this.disposeFileList(exportList10, dirFile2.getPath());
            }
            if (exportList11.size() > 0) {
                this.disposeFileList(exportList11, dirFile3.getPath());
            }
            if (exportList12.size() > 0) {
                this.disposeFileList(exportList12, dirFile4.getPath());
            }
            if (exportList13.size() > 0) {
                this.disposeFileList(exportList13, dirFile4.getPath());
            }
            if (exportList14.size() > 0) {
                this.disposeFileList(exportList14, dirFile5.getPath());
            }
            if (exportList15.size() > 0) {
                this.disposeFileList(exportList15, dirFile5.getPath());
            }
            if (exportList16.size() > 0) {
                this.disposeFileList(exportList16, dirFile6.getPath());
            }
            if (exportList17.size() > 0) {
                this.disposeFileList(exportList17, dirFile6.getPath());
            }
            if (exportList18.size() > 0) {
                this.disposeFileList(exportList18, dirFile7.getPath());
            }
            if (exportList19.size() > 0) {
                this.disposeFileList(exportList19, dirFile7.getPath());
            }


        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportStartUp(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            List<FilingImages> exportList3 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String commReport = a.getCommReport();
            String compLetion = a.getCompLetion();
            String cossReport = a.getCossReport();



            if (null!=commReport && !"".equals(commReport)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (commReport.contains("|")) {
                    String[] split = commReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(commReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList.add(filingImages);
                }
            }

            if (null!=compLetion && !"".equals(compLetion)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (compLetion.contains("|")) {
                    String[] split = compLetion.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(compLetion);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList2.add(filingImages);
                }
            }

            if (null!=cossReport && !"".equals(cossReport)) {
                dirFile = new File(downloadPath + "/开竣工管理");
                if (cossReport.contains("|")) {
                    String[] split = cossReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(cossReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList3.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile.getPath());
            }
            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportCostManagment(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile4 = null;
            List<FilingImages> exportList12 = new ArrayList<>();
            List<FilingImages> exportList13 = new ArrayList<>();

            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String settAuditReport = a.getSettAuditReport();
            String accAuditReport = a.getAccAuditReport();

            if (null!=settAuditReport && !"".equals(settAuditReport)) {
                dirFile4 = new File(downloadPath + "/造价管理");
                if (settAuditReport.contains("|")) {
                    String[] split = settAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList12.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(settAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList12.add(filingImages);
                }
            }


            if (null!=accAuditReport && !"".equals(accAuditReport)) {
                dirFile4 = new File(downloadPath + "/造价管理");
                if (accAuditReport.contains("|")) {
                    String[] split = accAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList13.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(accAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList13.add(filingImages);
                }
            }

            if (exportList12.size() > 0) {
                this.disposeFileList(exportList12, dirFile4.getPath());
            }
            if (exportList13.size() > 0) {
                this.disposeFileList(exportList13, dirFile4.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportProjectOther(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile7 = null;
            List<FilingImages> exportList18 = new ArrayList<>();
            List<FilingImages> exportList19 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String returnAndScrap = a.getReturnAndScrap();
            String importantAccessories = a.getImportantAccessories();

            if (null!=returnAndScrap && !"".equals(returnAndScrap)) {
                dirFile7 = new File(downloadPath + "/其他");
                if (returnAndScrap.contains("|")) {
                    String[] split = returnAndScrap.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList18.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(returnAndScrap);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList18.add(filingImages);
                }
            }

            if (null!=importantAccessories && !"".equals(importantAccessories)) {
                dirFile7 = new File(downloadPath + "/其他");
                if (importantAccessories.contains("|")) {
                    String[] split = importantAccessories.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList19.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(importantAccessories);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList19.add(filingImages);
                }
            }

            if (exportList18.size() > 0) {
                this.disposeFileList(exportList18, dirFile7.getPath());
            }
            if (exportList19.size() > 0) {
                this.disposeFileList(exportList19, dirFile7.getPath());
            }


        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportProjectSchedule(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {

            File dirFile2 = null;


            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            List<FilingImages> exportList8 = new ArrayList<>();
            List<FilingImages> exportList9 = new ArrayList<>();
            List<FilingImages> exportList10 = new ArrayList<>();

            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String enclosure = a.getEnclosure();
            String scheduleCivil = a.getScheduleCivil();
            String scheduleElectrical = a.getScheduleElectrical();
            String scheduleDebugging = a.getScheduleDebugging();
            String scheduleCheck = a.getScheduleCheck();
            String scheduleCumulative = a.getScheduleCumulative();
            String openingCommittee = a.getOpeningCommittee();

            if (null!=enclosure && !"".equals(enclosure)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (enclosure.contains("|")) {
                    String[] split = enclosure.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(enclosure);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=scheduleCivil && !"".equals(scheduleCivil)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCivil.contains("|")) {
                    String[] split = scheduleCivil.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCivil);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=scheduleElectrical && !"".equals(scheduleElectrical)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleElectrical.contains("|")) {
                    String[] split = scheduleElectrical.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleElectrical);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=scheduleDebugging && !"".equals(scheduleDebugging)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleDebugging.contains("|")) {
                    String[] split = scheduleDebugging.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleDebugging);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList7.add(filingImages);
                }
            }

            if (null!=scheduleCheck && !"".equals(scheduleCheck)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCheck.contains("|")) {
                    String[] split = scheduleCheck.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList8.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCheck);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList8.add(filingImages);
                }
            }

            if (null!=scheduleCumulative && !"".equals(scheduleCumulative)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (scheduleCumulative.contains("|")) {
                    String[] split = scheduleCumulative.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList9.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCumulative);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList9.add(filingImages);
                }
            }

            if (null!=openingCommittee && !"".equals(openingCommittee)) {
                dirFile2 = new File(downloadPath + "/工程进度管理");
                if (openingCommittee.contains("|")) {
                    String[] split = openingCommittee.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList10.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(openingCommittee);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList10.add(filingImages);
                }
            }


            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile2.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile2.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile2.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile2.getPath());
            }
            if (exportList8.size() > 0) {
                this.disposeFileList(exportList8, dirFile2.getPath());
            }
            if (exportList9.size() > 0) {
                this.disposeFileList(exportList9, dirFile2.getPath());
            }
            if (exportList10.size() > 0) {
                this.disposeFileList(exportList10, dirFile2.getPath());
            }


        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportQulityAssurance(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile5 = null;
            List<FilingImages> exportList14 = new ArrayList<>();
            List<FilingImages> exportList15 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String standardProduction = a.getStandardProduction();
            String fiveParty = a.getFiveParty();

            if (null!=standardProduction && !"".equals(standardProduction)) {
                dirFile5 = new File(downloadPath + "/质量管理");
                if (standardProduction.contains("|")) {
                    String[] split = standardProduction.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList14.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(standardProduction);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList14.add(filingImages);
                }
            }


            if (null!=fiveParty && !"".equals(fiveParty)) {
                dirFile5 = new File(downloadPath + "/质量管理");
                if (fiveParty.contains("|")) {
                    String[] split = fiveParty.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList15.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fiveParty);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList15.add(filingImages);
                }
            }

            if (exportList14.size() > 0) {
                this.disposeFileList(exportList14, dirFile5.getPath());
            }
            if (exportList15.size() > 0) {
                this.disposeFileList(exportList15, dirFile5.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportSafetyQuality(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile3 = null;
            List<FilingImages> exportList11 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();

            String engineeringHonors = a.getEngineeringHonors();

            if (null!=engineeringHonors && !"".equals(engineeringHonors)) {
                dirFile3 = new File(downloadPath + "/安全质量管理");
                if (engineeringHonors.contains("|")) {
                    String[] split = engineeringHonors.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全质量管理附件");
                        exportList11.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(engineeringHonors);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全质量管理附件");
                    exportList11.add(filingImages);
                }
            }

            if (exportList11.size() > 0) {
                this.disposeFileList(exportList11, dirFile3.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目的工程建设阶段
     *
     * @param idList
     */
    public String exportSecurityManagment(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<ConstructionStage> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<ConstructionStage> byIdList = constructionStageMapper.findAll(idList);

        for (ConstructionStage a :
                byIdList) {
            allList.add(a);
            List<ConstructionStage> childList = constructionStageMapper.findChildList(a);
            if (childList.size() > 0) {
                for (ConstructionStage b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (ConstructionStage a :
                allList) {
            File dirFile6 = null;
            List<FilingImages> exportList16 = new ArrayList<>();
            List<FilingImages> exportList17 = new ArrayList<>();
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            String mettingMinutes = a.getMettingMinutes();
            String deductionForm = a.getDeductionForm();



            if (null!=mettingMinutes && !"".equals(mettingMinutes)) {
                dirFile6 = new File(downloadPath + "/安全管理");
                if (mettingMinutes.contains("|")) {
                    String[] split = mettingMinutes.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList16.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(mettingMinutes);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList16.add(filingImages);
                }
            }


            if (null!=deductionForm && !"".equals(deductionForm)) {
                dirFile6 = new File(downloadPath + "/安全管理");
                if (deductionForm.contains("|")) {
                    String[] split = deductionForm.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList17.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(deductionForm);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList17.add(filingImages);
                }
            }
            if (exportList16.size() > 0) {
                this.disposeFileList(exportList16, dirFile6.getPath());
            }
            if (exportList17.size() > 0) {
                this.disposeFileList(exportList17, dirFile6.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }

    /**
     * 通过项目id导出项目汇总所有
     *
     * @param idList
     */
    public String exportSummary(List<String> idList) throws Exception {
        //设置下载的压缩包名（固定字符+时间戳）
        long timeMillis = System.currentTimeMillis();
        String fileLocality = "项目附件_" + timeMillis;
        //判定当前系统
        String path = Global.getPath();
        path = path + "/" + fileLocality;
        //检查该路径对应的目录是否存在. 如果不存在则创建目录
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        List<Summary> allList = new ArrayList<>();
        //通过id查询出所有的项目信息
        List<Summary> byIdList = summaryMapper.findAll(idList);

        for (Summary a :
                byIdList) {
            allList.add(a);
            List<Summary> childList = summaryMapper.findChildList(a);
            if (childList.size() > 0) {
                for (Summary b :
                        childList) {
                    b.setProjectCode(a.getProjectCode());
                    b.setEntryName(a.getEntryName());
                    allList.add(b);
                }
            }
        }
        //循环遍历，判断项目是否存在
        for (Summary a :
                allList) {
            String downloadPath = path + "/" + a.getProjectCode()  + a.getEntryName();
            /****************项目前期阶段*****************/
            File dirFile = null;
            File dirFile2 = null;
            List<FilingImages> exportList = new ArrayList<>();
            List<FilingImages> exportList2 = new ArrayList<>();
            String approvedAnnex = a.getApprovedAnnex();
            String studyAppendix = a.getStudyAppendix();
            if (null!=approvedAnnex && !"".equals(approvedAnnex)) {
                dirFile = new File(downloadPath + "/核准阶段");
                if (approvedAnnex.contains("|")) {
                    String[] split = approvedAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("核准附件");
                        exportList.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(approvedAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("核准附件");
                    exportList.add(filingImages);
                }
            }
            if (null!=studyAppendix && !"".equals(studyAppendix)) {
                dirFile2 = new File(downloadPath + "/可研阶段");
                if (studyAppendix.contains("|")) {
                    String[] split = studyAppendix.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("核准附件");
                        exportList2.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(studyAppendix);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("可研附件");
                    exportList2.add(filingImages);
                }
            }

            if (exportList.size() > 0) {
                this.disposeFileList(exportList, dirFile.getPath());
            }
            if (exportList2.size() > 0) {
                this.disposeFileList(exportList2, dirFile2.getPath());
            }
            /*****************工程前期阶段*******************/
            File dirFile3 = null;
            File dirFile4 = null;
            File dirFile5 = null;
            List<FilingImages> exportList3 = new ArrayList<>();
            List<FilingImages> exportList4 = new ArrayList<>();
            List<FilingImages> exportList5 = new ArrayList<>();
            List<FilingImages> exportList6 = new ArrayList<>();
            List<FilingImages> exportList7 = new ArrayList<>();
            List<FilingImages> exportList8 = new ArrayList<>();
            List<FilingImages> exportList9 = new ArrayList<>();
            List<FilingImages> exportList10 = new ArrayList<>();
            List<FilingImages> exportList11  = new ArrayList<>();
            List<FilingImages> exportList12  = new ArrayList<>();
            List<FilingImages> exportList13  = new ArrayList<>();
            List<FilingImages> exportList14 = new ArrayList<>();
            List<FilingImages> exportList15 = new ArrayList<>();
            List<FilingImages> exportList16 = new ArrayList<>();
            List<FilingImages> exportList17 = new ArrayList<>();
            List<FilingImages> exportList18 = new ArrayList<>();
            List<FilingImages> exportList19 = new ArrayList<>();
            List<FilingImages> exportList20 = new ArrayList<>();
            List<FilingImages> exportList21 = new ArrayList<>();
            List<FilingImages> exportList22 = new ArrayList<>();
            List<FilingImages> exportList23 = new ArrayList<>();
            List<FilingImages> exportList24 = new ArrayList<>();
            List<FilingImages> exportList25 = new ArrayList<>();
            List<FilingImages> exportList26 = new ArrayList<>();
            List<FilingImages> exportList27 = new ArrayList<>();
            List<FilingImages> exportList28 = new ArrayList<>();

            String designAnnex = a.getPreDesignAnnex();
            String letterDesign = a.getLetterDesign();
            String disigningContract = a.getDisigningContract();
            String ownerDapartment = a.getOwnerDapartment();
            String inspectionControl = a.getInspectionControl();
            String letterAcceptance = a.getLetterAcceptance();
            String conContract = a.getConContract();
            String otherContracts = a.getOtherContracts();
            String landAnnex = a.getLandAnnex();
            String eiaAnnex = a.getEiaAnnex();
            String acceptanceAnnex = a.getAcceptanceAnnex();
            String replyAnnex = a.getReplyAnnex();
            String soilannex = a.getSoilannex();
            String depositAnnex = a.getDepositAnnex();
            String recordAnnex = a.getRecordAnnex();
            String siteProposalAnnex = a.getSiteProposalAnnex();
            String planningAnnex = a.getPlanningAnnex();
            String usePlanAnnex = a.getUsePlanAnnex();
            String requisitonAnnex = a.getRequisitonAnnex();
            String conLandAnnex = a.getConLandAnnex();
            String transferAnnex = a.getTransferAnnex();
            String certificateAnnex = a.getCertificateAnnex();
            String permitAnnex = a.getPermitAnnex();
            String fireProAnnex = a.getFireProAnnex();
            String fireAccAnnex = a.getFireAccAnnex();
            String estateAnnex = a.getEstateAnnex();


            if (null!=designAnnex && !"".equals(designAnnex)) {
                dirFile5 = new File(downloadPath + "/初设阶段");
                if (designAnnex.contains("|")) {
                    String[] split = designAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("初设附件");
                        exportList3.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(designAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("初设附件");
                    exportList3.add(filingImages);
                }
            }

            if (null!=letterDesign && !"".equals(letterDesign)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (letterDesign.contains("|")) {
                    String[] split = letterDesign.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList4.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterDesign);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList4.add(filingImages);
                }
            }

            if (null!=disigningContract && !"".equals(disigningContract)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (disigningContract.contains("|")) {
                    String[] split = disigningContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList5.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(disigningContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList5.add(filingImages);
                }
            }

            if (null!=ownerDapartment && !"".equals(ownerDapartment)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (ownerDapartment.contains("|")) {
                    String[] split = ownerDapartment.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList6.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(ownerDapartment);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList6.add(filingImages);
                }
            }

            if (null!=inspectionControl && !"".equals(inspectionControl)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (inspectionControl.contains("|")) {
                    String[] split = inspectionControl.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList7.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(inspectionControl);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList7.add(filingImages);
                }
            }

            if (null!=letterAcceptance && !"".equals(letterAcceptance)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (letterAcceptance.contains("|")) {
                    String[] split = letterAcceptance.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList8.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(letterAcceptance);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList8.add(filingImages);
                }
            }

            if (null!=conContract && !"".equals(conContract)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (conContract.contains("|")) {
                    String[] split = conContract.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList9.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conContract);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList9.add(filingImages);
                }
            }

            if (null!=otherContracts && !"".equals(otherContracts)) {
                dirFile4 = new File(downloadPath + "/招标与合同管理");
                if (otherContracts.contains("|")) {
                    String[] split = otherContracts.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("招标与合同管理附件");
                        exportList10.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(otherContracts);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("招标与合同管理附件");
                    exportList10.add(filingImages);
                }
            }

            if (null!=landAnnex && !"".equals(landAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (landAnnex.contains("|")) {
                    String[] split = landAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList11.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(landAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList11.add(filingImages);
                }
            }

            if (null!=eiaAnnex && !"".equals(eiaAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (eiaAnnex.contains("|")) {
                    String[] split = eiaAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList12.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(eiaAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList12.add(filingImages);
                }
            }

            if (null!=acceptanceAnnex && !"".equals(acceptanceAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (acceptanceAnnex.contains("|")) {
                    String[] split = acceptanceAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList13.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(acceptanceAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList13.add(filingImages);
                }
            }

            if (null!=replyAnnex && !"".equals(replyAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (replyAnnex.contains("|")) {
                    String[] split = replyAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList14.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(replyAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList14.add(filingImages);
                }
            }

            if (null!=soilannex && !"".equals(soilannex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (soilannex.contains("|")) {
                    String[] split = soilannex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList15.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(soilannex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList15.add(filingImages);
                }
            }

            if (null!=depositAnnex && !"".equals(depositAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (depositAnnex.contains("|")) {
                    String[] split = depositAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList16.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(depositAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList16.add(filingImages);
                }
            }

            if (null!=recordAnnex && !"".equals(recordAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (recordAnnex.contains("|")) {
                    String[] split = recordAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList17.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(recordAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList17.add(filingImages);
                }
            }

            if (null!=siteProposalAnnex && !"".equals(siteProposalAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (siteProposalAnnex.contains("|")) {
                    String[] split = siteProposalAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList18.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(siteProposalAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList18.add(filingImages);
                }
            }

            if (null!=planningAnnex && !"".equals(planningAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (planningAnnex.contains("|")) {
                    String[] split = planningAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList19.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(planningAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList19.add(filingImages);
                }
            }

            if (null!=usePlanAnnex && !"".equals(usePlanAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (usePlanAnnex.contains("|")) {
                    String[] split = usePlanAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList20.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(usePlanAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList20.add(filingImages);
                }
            }

            if (null!=requisitonAnnex && !"".equals(requisitonAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (requisitonAnnex.contains("|")) {
                    String[] split = requisitonAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList21.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(requisitonAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList21.add(filingImages);
                }
            }

            if (null!=conLandAnnex && !"".equals(conLandAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (conLandAnnex.contains("|")) {
                    String[] split = conLandAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList22.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(conLandAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList22.add(filingImages);
                }
            }

            if (null!=transferAnnex && !"".equals(transferAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (transferAnnex.contains("|")) {
                    String[] split = transferAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList23.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(transferAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList23.add(filingImages);
                }
            }

            if (null!=certificateAnnex && !"".equals(certificateAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (certificateAnnex.contains("|")) {
                    String[] split = certificateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList24.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(certificateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList24.add(filingImages);
                }
            }

            if (null!=permitAnnex && !"".equals(permitAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (permitAnnex.contains("|")) {
                    String[] split = permitAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList25.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(permitAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList25.add(filingImages);
                }
            }

            if (null!=fireProAnnex && !"".equals(fireProAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (fireProAnnex.contains("|")) {
                    String[] split = fireProAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList26.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireProAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList26.add(filingImages);
                }
            }

            if (null!=fireAccAnnex && !"".equals(fireAccAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (fireAccAnnex.contains("|")) {
                    String[] split = fireAccAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList27.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fireAccAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList27.add(filingImages);
                }
            }

            if (null!=estateAnnex && !"".equals(estateAnnex)) {
                dirFile3 = new File(downloadPath + "/报建审批");
                if (estateAnnex.contains("|")) {
                    String[] split = estateAnnex.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("报建审批附件");
                        exportList28.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(estateAnnex);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("报建审批附件");
                    exportList28.add(filingImages);
                }
            }

            if (exportList3.size() > 0) {
                this.disposeFileList(exportList3, dirFile5.getPath());
            }

            if (exportList4.size() > 0) {
                this.disposeFileList(exportList4, dirFile4.getPath());
            }
            if (exportList5.size() > 0) {
                this.disposeFileList(exportList5, dirFile4.getPath());
            }
            if (exportList6.size() > 0) {
                this.disposeFileList(exportList6, dirFile4.getPath());
            }
            if (exportList7.size() > 0) {
                this.disposeFileList(exportList7, dirFile4.getPath());
            }
            if (exportList8.size() > 0) {
                this.disposeFileList(exportList8, dirFile4.getPath());
            }
            if (exportList9.size() > 0) {
                this.disposeFileList(exportList9, dirFile4.getPath());
            }
            if (exportList10.size() > 0) {
                this.disposeFileList(exportList10, dirFile4.getPath());
            }
            if (exportList11.size() > 0) {
                this.disposeFileList(exportList11, dirFile3.getPath());
            }
            if (exportList12.size() > 0) {
                this.disposeFileList(exportList12, dirFile3.getPath());
            }
            if (exportList13.size() > 0) {
                this.disposeFileList(exportList13, dirFile3.getPath());
            }
            if (exportList14.size() > 0) {
                this.disposeFileList(exportList14, dirFile3.getPath());
            }
            if (exportList15.size() > 0) {
                this.disposeFileList(exportList15, dirFile3.getPath());
            }
            if (exportList16.size() > 0) {
                this.disposeFileList(exportList16, dirFile3.getPath());
            }
            if (exportList17.size() > 0) {
                this.disposeFileList(exportList17, dirFile3.getPath());
            }
            if (exportList18.size() > 0) {
                this.disposeFileList(exportList18, dirFile3.getPath());
            }
            if (exportList19.size() > 0) {
                this.disposeFileList(exportList19, dirFile3.getPath());
            }
            if (exportList20.size() > 0) {
                this.disposeFileList(exportList20, dirFile3.getPath());
            }
            if (exportList21.size() > 0) {
                this.disposeFileList(exportList21, dirFile3.getPath());
            }
            if (exportList22.size() > 0) {
                this.disposeFileList(exportList22, dirFile3.getPath());
            }
            if (exportList23.size() > 0) {
                this.disposeFileList(exportList23, dirFile3.getPath());
            }
            if (exportList24.size() > 0) {
                this.disposeFileList(exportList24, dirFile3.getPath());
            }
            if (exportList25.size() > 0) {
                this.disposeFileList(exportList25, dirFile3.getPath());
            }
            if (exportList26.size() > 0) {
                this.disposeFileList(exportList26, dirFile3.getPath());
            }
            if (exportList27.size() > 0) {
                this.disposeFileList(exportList27, dirFile3.getPath());
            }
            if (exportList28.size() > 0) {
                this.disposeFileList(exportList28, dirFile3.getPath());
            }


            /*****************工程建设阶段*******************/
            File dirFile6 = null;
            File dirFile7 = null;
            File dirFile8 = null;
            File dirFile9 = null;
            File dirFile10 = null;
            File dirFile11 = null;
            File dirFile12 = null;
            List<FilingImages> exportList29 = new ArrayList<>();
            List<FilingImages> exportList30 = new ArrayList<>();
            List<FilingImages> exportList31 = new ArrayList<>();
            List<FilingImages> exportList32 = new ArrayList<>();
            List<FilingImages> exportList33 = new ArrayList<>();
            List<FilingImages> exportList34 = new ArrayList<>();
            List<FilingImages> exportList35 = new ArrayList<>();
            List<FilingImages> exportList36 = new ArrayList<>();
            List<FilingImages> exportList37 = new ArrayList<>();
            List<FilingImages> exportList38 = new ArrayList<>();
            List<FilingImages> exportList39 = new ArrayList<>();
            List<FilingImages> exportList40 = new ArrayList<>();
            List<FilingImages> exportList41 = new ArrayList<>();
            List<FilingImages> exportList42 = new ArrayList<>();
            List<FilingImages> exportList43 = new ArrayList<>();
            List<FilingImages> exportList44 = new ArrayList<>();
            List<FilingImages> exportList45 = new ArrayList<>();
            List<FilingImages> exportList46 = new ArrayList<>();
            List<FilingImages> exportList47 = new ArrayList<>();

            String commReport = a.getCommReport();
            String compLetion = a.getCompLetion();
            String cossReport = a.getCossReport();
            String enclosure = a.getEnclosure();
            String scheduleCivil = a.getScheduleCivil();
            String scheduleElectrical = a.getScheduleElectrical();
            String scheduleDebugging = a.getScheduleDebugging();
            String scheduleCheck = a.getScheduleCheck();
            String scheduleCumulative = a.getScheduleCumulative();
            String openingCommittee = a.getOpeningCommittee();
            String engineeringHonors = a.getEngineeringHonors();
            String settAuditReport = a.getSettAuditReport();
            String accAuditReport = a.getAccAuditReport();
            String standardProduction = a.getStandardProduction();
            String fiveParty = a.getFiveParty();
            String mettingMinutes = a.getMettingMinutes();
            String deductionForm = a.getDeductionForm();
            String returnAndScrap = a.getReturnAndScrap();
            String importantAccessories = a.getImportantAccessories();


            if (null!=commReport && !"".equals(commReport)) {
                dirFile6 = new File(downloadPath + "/开竣工管理");
                if (commReport.contains("|")) {
                    String[] split = commReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList29.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(commReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList29.add(filingImages);
                }
            }

            if (null!=compLetion && !"".equals(compLetion)) {
                dirFile6 = new File(downloadPath + "/开竣工管理");
                if (compLetion.contains("|")) {
                    String[] split = compLetion.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList30.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(compLetion);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList30.add(filingImages);
                }
            }

            if (null!=cossReport && !"".equals(cossReport)) {
                dirFile6 = new File(downloadPath + "/开竣工管理");
                if (cossReport.contains("|")) {
                    String[] split = cossReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("开竣工管理附件");
                        exportList31.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(cossReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("开竣工管理附件");
                    exportList31.add(filingImages);
                }
            }

            if (null!=enclosure && !"".equals(enclosure)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (enclosure.contains("|")) {
                    String[] split = enclosure.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList32.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(enclosure);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList32.add(filingImages);
                }
            }

            if (null!=scheduleCivil && !"".equals(scheduleCivil)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (scheduleCivil.contains("|")) {
                    String[] split = scheduleCivil.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList33.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCivil);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList33.add(filingImages);
                }
            }

            if (null!=scheduleElectrical && !"".equals(scheduleElectrical)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (scheduleElectrical.contains("|")) {
                    String[] split = scheduleElectrical.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList34.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleElectrical);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList34.add(filingImages);
                }
            }

            if (null!=scheduleDebugging && !"".equals(scheduleDebugging)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (scheduleDebugging.contains("|")) {
                    String[] split = scheduleDebugging.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList35.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleDebugging);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList35.add(filingImages);
                }
            }

            if (null!=scheduleCheck && !"".equals(scheduleCheck)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (scheduleCheck.contains("|")) {
                    String[] split = scheduleCheck.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList36.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCheck);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList36.add(filingImages);
                }
            }

            if (null!=scheduleCumulative && !"".equals(scheduleCumulative)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (scheduleCumulative.contains("|")) {
                    String[] split = scheduleCumulative.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList37.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(scheduleCumulative);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList37.add(filingImages);
                }
            }

            if (null!=openingCommittee && !"".equals(openingCommittee)) {
                dirFile7 = new File(downloadPath + "/工程进度管理");
                if (openingCommittee.contains("|")) {
                    String[] split = openingCommittee.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("工程进度管理附件");
                        exportList38.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(openingCommittee);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("工程进度管理附件");
                    exportList38.add(filingImages);
                }
            }


            if (null!=engineeringHonors && !"".equals(engineeringHonors)) {
                dirFile8 = new File(downloadPath + "/安全质量管理");
                if (engineeringHonors.contains("|")) {
                    String[] split = engineeringHonors.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全质量管理附件");
                        exportList39.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(engineeringHonors);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全质量管理附件");
                    exportList39.add(filingImages);
                }
            }


            if (null!=settAuditReport && !"".equals(settAuditReport)) {
                dirFile9 = new File(downloadPath + "/造价管理");
                if (settAuditReport.contains("|")) {
                    String[] split = settAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList40.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(settAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList40.add(filingImages);
                }
            }


            if (null!=accAuditReport && !"".equals(accAuditReport)) {
                dirFile9 = new File(downloadPath + "/造价管理");
                if (accAuditReport.contains("|")) {
                    String[] split = accAuditReport.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("造价管理附件");
                        exportList41.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(accAuditReport);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("造价管理附件");
                    exportList41.add(filingImages);
                }
            }


            if (null!=standardProduction && !"".equals(standardProduction)) {
                dirFile10 = new File(downloadPath + "/质量管理");
                if (standardProduction.contains("|")) {
                    String[] split = standardProduction.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList42.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(standardProduction);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList42.add(filingImages);
                }
            }


            if (null!=fiveParty && !"".equals(fiveParty)) {
                dirFile10 = new File(downloadPath + "/质量管理");
                if (fiveParty.contains("|")) {
                    String[] split = fiveParty.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("质量管理附件");
                        exportList43.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(fiveParty);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("质量管理附件");
                    exportList43.add(filingImages);
                }
            }


            if (null!=mettingMinutes && !"".equals(mettingMinutes)) {
                dirFile11 = new File(downloadPath + "/安全管理");
                if (mettingMinutes.contains("|")) {
                    String[] split = mettingMinutes.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList44.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(mettingMinutes);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList44.add(filingImages);
                }
            }


            if (null!=deductionForm && !"".equals(deductionForm)) {
                dirFile11 = new File(downloadPath + "/安全管理");
                if (deductionForm.contains("|")) {
                    String[] split = deductionForm.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("安全管理附件");
                        exportList45.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(deductionForm);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("安全管理附件");
                    exportList45.add(filingImages);
                }
            }


            if (null!=returnAndScrap && !"".equals(returnAndScrap)) {
                dirFile12 = new File(downloadPath + "/其他");
                if (returnAndScrap.contains("|")) {
                    String[] split = returnAndScrap.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList46.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(returnAndScrap);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList46.add(filingImages);
                }
            }

            if (null!=importantAccessories && !"".equals(importantAccessories)) {
                dirFile12 = new File(downloadPath + "/其他");
                if (importantAccessories.contains("|")) {
                    String[] split = importantAccessories.split("\\|");
                    for (int i = 0; i < split.length; i++) {
                        FilingImages filingImages = new FilingImages();
                        filingImages.setImgPath(split[i]);
                        filingImages.setProjectCode(a.getProjectCode());
                        filingImages.setPurpose("其他附件");
                        exportList47.add(filingImages);
                    }
                } else {
                    FilingImages filingImages = new FilingImages();
                    filingImages.setImgPath(importantAccessories);
                    filingImages.setProjectCode(a.getProjectCode());
                    filingImages.setPurpose("其他附件");
                    exportList47.add(filingImages);
                }
            }

            if (exportList29.size() > 0) {
                this.disposeFileList(exportList29, dirFile6.getPath());
            }
            if (exportList30.size() > 0) {
                this.disposeFileList(exportList30, dirFile6.getPath());
            }
            if (exportList31.size() > 0) {
                this.disposeFileList(exportList31, dirFile6.getPath());
            }
            if (exportList32.size() > 0) {
                this.disposeFileList(exportList32, dirFile7.getPath());
            }
            if (exportList33.size() > 0) {
                this.disposeFileList(exportList33, dirFile7.getPath());
            }
            if (exportList34.size() > 0) {
                this.disposeFileList(exportList34, dirFile7.getPath());
            }
            if (exportList35.size() > 0) {
                this.disposeFileList(exportList35, dirFile7.getPath());
            }
            if (exportList36.size() > 0) {
                this.disposeFileList(exportList36, dirFile7.getPath());
            }
            if (exportList37.size() > 0) {
                this.disposeFileList(exportList37, dirFile7.getPath());
            }
            if (exportList38.size() > 0) {
                this.disposeFileList(exportList38, dirFile7.getPath());
            }
            if (exportList39.size() > 0) {
                this.disposeFileList(exportList39, dirFile8.getPath());
            }
            if (exportList40.size() > 0) {
                this.disposeFileList(exportList40, dirFile9.getPath());
            }
            if (exportList41.size() > 0) {
                this.disposeFileList(exportList41, dirFile9.getPath());
            }
            if (exportList42.size() > 0) {
                this.disposeFileList(exportList42, dirFile10.getPath());
            }
            if (exportList43.size() > 0) {
                this.disposeFileList(exportList43, dirFile10.getPath());
            }
            if (exportList44.size() > 0) {
                this.disposeFileList(exportList44, dirFile11.getPath());
            }
            if (exportList45.size() > 0) {
                this.disposeFileList(exportList45, dirFile11.getPath());
            }
            if (exportList46.size() > 0) {
                this.disposeFileList(exportList46, dirFile12.getPath());
            }
            if (exportList47.size() > 0) {
                this.disposeFileList(exportList47, dirFile12.getPath());
            }

        }
        //处理完之后进行打包压缩并删除之前的文件
        ZipCompressUtil zipUtil = new ZipCompressUtil();
        File resultFile = new File(path);
        File file = zipUtil.zipCompress(resultFile, true);
        return file.getPath();
    }
}