package com.ruoyi.web.controller.project;


import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.flowable.service.IInvestmentOpportunityService;
import com.ruoyi.invest.domain.*;
import com.ruoyi.invest.service.*;
import com.ruoyi.system.service.ISysDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 项目池Controller
 *
 * @author ruoyi
 * @date 2024-02-21
 */
@Api(tags = "项目信息-阶段")
@RestController
@RequestMapping("/project")
public class ProjectController extends BaseController
{

    @Autowired
    private IInvestmentOpportunityService investmentOpportunityService;
    @Autowired
    private ITProjectInvestigateService tProjectInvestigateService;

    @Autowired
    private ITProjectInvestigatePersonService tProjectInvestigatePersonService;

    @Autowired
    private ITProjectMeetingService tProjectMeetingService;

    @Autowired
    private ITProjectScoringService tProjectScoringService;

    @Autowired
    private ISysDictDataService dictDataService;

    /**
     * 查询项目池列表
     */
    @ApiOperation("查询项目池列表")
    @GetMapping("/list")
    public TableDataInfo list(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");//数据未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool);
        return getDataTable(list);
    }
    /**
     * 导出项目池列表
     */
    @ApiOperation("导出项目池列表")
    @Log(title = "项目池列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportList")
    public void exportList(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");//数据未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if (StringUtils.isNotEmpty(n.getProjectStatus())&&"1".equals(n.getProjectStatus())) {
                        n.setProjectStatus("终止");
                    } else if (StringUtils.isNotEmpty(n.getProjectStatus())&&"2".equals(n.getProjectStatus())) {
                        n.setProjectStatus("观望");
                    } else {
                        n.setProjectStatus("正常");
                    }
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目池数据");
    }
    /**
     * 查询项目机会阶段项目信息
     */
    @ApiOperation("查询项目机会阶段列表")
    @GetMapping("/listInvestOppStage")
    public TableDataInfo listInvestOppStage(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");//数据未删除
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("1");//项目报备（项目机会）
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool);
        return getDataTable(list);
    }
    /**
     * 导出项目机会阶段列表
     */
    @ApiOperation("导出项目机会阶段列表")
    @Log(title = "项目机会阶段列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportInvestOppStage")
    public void exportInvestOppStage(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("1");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目机会阶段数据");
    }
    /**
     * 查询项目立项阶段项目信息
     */
    @ApiOperation("查询项目立项阶段列表")
    @GetMapping("/listApprovalStage")
    public TableDataInfo listApprovalStage(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("3");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    n.settProjectMeeting(tProjectMeetingService.listProjectPoolIdNew(n.getId(),"LX"));
                    if(null != n.gettProjectMeeting()){
                        n.settProjectScoring(tProjectScoringService.getCanScoringMeetingId(n.gettProjectMeeting().getId(),getUserId()));
                    }
                    return n;
                }).collect(Collectors.toList());
        return getDataTable(list);
    }
    /**
     * 导出项目立项阶段列表
     */
    @ApiOperation("导出项目立项阶段列表")
    @Log(title = "项目立项阶段列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportApprovalStage")
    public void exportApprovalStage(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("3");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目立项阶段数据");
    }
    /**
     * 查询项目背调阶段项目信息
     */
    @ApiOperation("查询项目背调阶段列表")
    @GetMapping("/listInvestigateStage")
    public TableDataInfo listInvestigateStage(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("4");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    n.settProjectInvestigate(tProjectInvestigateService.listProjectPoolIdNew(n.getId()));
                    if(null != n.gettProjectInvestigate()){
                        n.settProjectInvestigatePerson(tProjectInvestigatePersonService.selectByProjectInvestigateId(n.gettProjectInvestigate().getId(),getUserId()));
                    }
                    return n;
                }).collect(Collectors.toList());
        return getDataTable(list);
    }
    /**
     * 导出项目背调阶段列表
     */
    @ApiOperation("导出项目背调阶段列表")
    @Log(title = "项目背调阶段列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportInvestigateStage")
    public void exportInvestigateStage(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("4");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目背调阶段数据");
    }
    /**
     * 查询项目投决阶段项目信息
     */
    @ApiOperation("查询项目投决阶段列表")
    @GetMapping("/listDecisionStage")
    public TableDataInfo listDecisionStage(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("5");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool).stream().map(n -> {
            n.settProjectMeeting(tProjectMeetingService.listProjectPoolIdNew(n.getId(),"TJ"));
            if(null != n.gettProjectMeeting()){
                n.settProjectScoring(tProjectScoringService.getCanScoringMeetingId(n.gettProjectMeeting().getId(),getUserId()));
            }
            return n;
        }).collect(Collectors.toList());
        return getDataTable(list);
    }
    /**
     * 导出项目投决阶段列表
     */
    @ApiOperation("导出项目投决阶段列表")
    @Log(title = "项目投决阶段列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportDecisionStage")
    public void exportDecisionStage(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("5");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目投决阶段数据");
    }
    /**
     * 查询项目签约阶段项目信息
     */
    @ApiOperation("查询项目签约阶段列表")
    @GetMapping("/listSignStage")
    public TableDataInfo listSignStage(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("6");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool);
        return getDataTable(list);
    }
    /**
     * 导出项目签约阶段列表
     */
    @ApiOperation("导出项目签约阶段列表")
    @Log(title = "项目签约阶段列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportSignStage")
    public void exportSignStage(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");
        tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStage("6");
        tProjectPool.setProjectStatus("0");//项目机会状态非观望2、非终止1（也就是项目机会状态为正常0）
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "项目签约阶段数据");
    }
    //所有项目观望列表
    @ApiOperation("所有项目观望列表")
    @GetMapping("/allWatchlist")
    public TableDataInfo allWatchlist(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");//未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStatus("2");//项目机会状态为观望2
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool);
        return getDataTable(list);

    }
    /**
     * 导出所有项目终止列表
     */
    @ApiOperation("导出所有项目观望列表")
    @Log(title = "所有项目观望列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportAllWatch")
    public void exportAllWatch(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");//未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStatus("2");//项目机会状态为观望2
        List<TProjectPool> list=investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "所有项目观望数据");
    }
    /**
     * 查询所有项目终止列表
     */
    @ApiOperation("查询所有项目终止列表")
    @GetMapping("/allTerminationList")
    public TableDataInfo allTerminationList(TProjectPool tProjectPool)
    {
        startPage();
        tProjectPool.setDelFlag("0");//未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStatus("1");//项目机会状态为终止1
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool);
        return getDataTable(list);
    }
    /**
     * 导出所有项目终止列表
     */
    @ApiOperation("导出所有项目终止列表")
    @Log(title = "所有项目终止列表", businessType = BusinessType.EXPORT)
    @PostMapping("/exportAllTermination")
    public void exportAllTermination(HttpServletResponse response, TProjectPool tProjectPool)
    {
        tProjectPool.setDelFlag("0");//未删除
        //tProjectPool.setStatus(4);//流程状态非关闭
        tProjectPool.setProjectStatus("1");//项目机会状态为终止1
        List<TProjectPool> list = investmentOpportunityService.selectProjectList(tProjectPool)
                .stream().map(n -> {
                    if(null != n.gettProjectChannel()){
                        n.setChannel(n.gettProjectChannel().getChannelName());
                    }
                    if(StringUtils.isNotEmpty(n.getIndustry()))n.setIndustry(dictDataService.selectDictLabel("CUSTOMER_TRADE",n.getIndustry()));
                    if(null != n.gettProjectCompany()){
                        n.setCompany(n.gettProjectCompany().getCompanyName());
                    }
                    if(null != n.gettProjectContacts()){
                        n.setProjectContacts(n.gettProjectContacts().getName());
                    }
                    if(StringUtils.isNotEmpty(n.getInvestType()))n.setInvestType(dictDataService.selectDictLabel("INVEST_TYPE",n.getInvestType()));
                    if(StringUtils.isNotEmpty(n.getInvestPloy()))n.setInvestPloy(dictDataService.selectDictLabel("INVEST_PLOY",n.getInvestPloy()));
                    if(StringUtils.isNotEmpty(n.getInvestWorth()))n.setInvestWorth(dictDataService.selectDictLabel("INVEST_WORTH",n.getInvestWorth()));
                    if(StringUtils.isNotEmpty(n.getProjectStage()))n.setProjectStage(dictDataService.selectDictLabel("PROJECT_STAGE",n.getProjectStage()));
                    if(StringUtils.isNotEmpty(n.getProjectState()))n.setProjectState(dictDataService.selectDictLabel("PROJECT_STATE",n.getProjectState()));
                    return n;
                })
                .collect(Collectors.toList());
        ExcelUtil<TProjectPool> util = new ExcelUtil<TProjectPool>(TProjectPool.class);
        util.exportExcel(response, list, "所有项目终止数据");
    }

}
