package com.yunyan.business.document.y23.budget;

import cn.hutool.core.math.MathUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.yunyan.business.constant.TemplateEpType;
import com.yunyan.business.document.EasyExcelFinalListener;
import com.yunyan.business.document.utils.ReadExcelUtil;
import com.yunyan.business.document.y23.budget.pojo.budgetY23.*;
import com.yunyan.business.document.y23.budget.pojo.budgetY23.table.*;
import com.yunyan.common.exception.ServiceException;
import com.yunyan.common.utils.NumberFormatUtils;
import com.yunyan.common.utils.StringUtils;
import lombok.Data;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;

/**
 * 决算表的读取
 */
@Slf4j
public class ReadBudgetExcelY23Utils {

    public static String fileName = "D:\\code\\gx-final-account\\doc\\excel\\决算系统传入批复数据后导出表格.xls";


    /**
     * 读取 决算excel的数据
     * @return
     */
    @Deprecated
    public static BudgetDataVo getSheetInfos(MultipartFile file, String fileName) throws IOException {
        return getSheetInfos(file, fileName, null, "", "");
    }

    /**
     * 读取 excel数据
     * 只需传一种方式， 当传文件时，直接读取文件
     * @param file 文件实体
     * @param fileName 文件路径名
     * @return
     * @throws IOException
     */
    public static BudgetDataVo getSheetInfos(MultipartFile file, String fileName, Integer lastYearFlag, String year, String templateExportType) throws IOException {
        // step1. 读取excel内容
        EasyExcelFinalListener easyExcelFinalListener = new EasyExcelFinalListener();
        ExcelReaderBuilder read = new ExcelReaderBuilder();
        //        ExcelReaderBuilder read = EasyExcelFactory.read(file.getInputStream(), easyExcelListener);
        if(null != file) {
            read = EasyExcelFactory.read(file.getInputStream(), easyExcelFinalListener).registerConverter(new CellStringNumberConverter());
        } else if(StringUtils.isNotBlank(fileName)) {
            read = EasyExcelFactory.read(fileName, easyExcelFinalListener).registerConverter(new CellStringNumberConverter());
        } else {
            throw new ServiceException("文件读取异常");
        }

        ExcelReader excelReader = read.build();
        // step2. 获取各个sheet页信息
        List<ReadSheet> sheets = excelReader.excelExecutor().sheetList();
        // step3. 获取各个Shhet页表格内容存于map
        Map<Integer, List<LinkedHashMap<Integer, String>>> sheetInfos = new HashMap<>(sheets.size());
        for (ReadSheet sheet : sheets) {
            Integer sheetNo = sheet.getSheetNo();
            String sheetName =  sheet.getSheetName();
            excelReader.read(sheet);
            if(null != lastYearFlag && lastYearFlag == 1 ) {
                /*if(sheetNo.equals(0) || sheetNo.equals(10)) {
                    sheetInfos.put(sheetNo, easyExcelFinalListener.getListMap());
                }*/
                //加首页的 sheetNo + 1
                sheetInfos.put(sheetNo + 1, easyExcelFinalListener.getListMap());
            } else {
                sheetInfos.put(sheetNo, easyExcelFinalListener.getListMap());
            }

        }

        BudgetDataVo vo = new BudgetDataVo();
        //初始化
        vo.setTableVo(new BudgetTableVo());
        vo.setExplainVo(new BudgetExplainP3Vo());
        vo.setYear(year);
        vo.setLastYearFlag(lastYearFlag);

        ReadBudgetExcelY23Utils readFinalExcelY22Utils = new ReadBudgetExcelY23Utils();
        readFinalExcelY22Utils.saveExcelInfo(sheetInfos, vo, templateExportType);

//        log.debug("sheetInfo [{}]", sheetInfos);
        return vo;
    }


    /**
     * 读取各个sheet表格的数据
     * @param sheetInfos
     */
    public void saveExcelInfo(Map<Integer, List<LinkedHashMap<Integer, String>>> sheetInfos, BudgetDataVo vo, String templateExportType) {
        for (Integer sheetNo : sheetInfos.keySet()) {
            List<LinkedHashMap<Integer, String>> maps = sheetInfos.get(sheetNo);
            // 不同sheet页数据处理方式不同
            switch (sheetNo) {
                case 1:
                    //表1 部门收支总体情况表
                    setT1Report(maps, vo);
                    break;
                case 2:
                    //表2 部门收入总体情况表
                    setT2Report(maps, vo, templateExportType);
                    break;
                case 3:
                    //表3 部门支出总体情况表
                    setT3Report(maps, vo);
                    break;
                case 4:
                    //表4 财政拨款收支总体情况表
                    setT4Report(maps, vo, templateExportType);
                    break;
                case 5:
                    //表5 一般公共预算支出情况表
                    setT5Report(maps, vo);
                    break;
                case 6:
                    //表6 部门收支总体情况表
                    setT6Report(maps, vo);
                    break;
                case 7:
                    //表7 部门收支总体情况表
                    setT7Report(maps, vo, templateExportType);
                    break;
                case 8:
                    //表8 政府性基金预算支出情况表
                    setT8Report(maps, vo);
                    break;
                case 9:
                    //表9 部门收支总体情况表
                    setT9Report(maps, vo);
                    break;

                default:
                    break;
            }
        }
        //log.debug("运行结果 [{}]", JSONUtil.toJsonStr(vo));
//        iBzjBaseInfoService.saveSettlementMothReport(settlementMothReportSaveDTO);
    }

    /**
     * 读取  (表一)
     * @param maps
     * @param vo
     */
    private void setT1Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {

        BudgetP3p1Vo p3p1Vo = new BudgetP3p1Vo();
        vo.getExplainVo().setP3p1Vo(p3p1Vo);
        List<BudgetP3p1ItemVo> inList = new ArrayList<>();
        List<BudgetP3p1ItemVo> expenditureList = new ArrayList<>();
        p3p1Vo.setInList(inList);
        p3p1Vo.setExpenditureList(expenditureList);

        //p3p2的项
        BudgetP3p2Vo p3p2vo = new BudgetP3p2Vo();
        vo.getExplainVo().setP3p2Vo(p3p2vo);
        List<BudgetP3p2ItemVo> list = new ArrayList<>();
        p3p2vo.setList(list);

        //p3p2 是否有子级的记录
        BudgetP3p2ItemVo p2p2ItemRecordVo = null;

        //p3p3
        BudgetP3p3Vo p3p3vo = new BudgetP3p3Vo();
        List<BudgetP3p3ItemVo> p3p3FuncList = new ArrayList<>();
        p3p3vo.setFuncList(p3p3FuncList);
        p3p3vo.setBaseList(new ArrayList<>());
        p3p3vo.setProjectList(new ArrayList<>());
        vo.getExplainVo().setP3p3Vo(p3p3vo);

        //p2p1
        BudgetP2p1Vo p2p1Vo = new BudgetP2p1Vo();
        p2p1Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p1Vo(p2p1Vo);

        /**
         * 收入的
         */
        boolean isInListFlag = false;

        /**
         * 支出的
         */
        boolean isExpenditureListFlag = false;

        //p2p1的表格 标记
        boolean isTableListFlag = false;

        for (LinkedHashMap<Integer, String> map : maps) {

            //项目名-收入
            String f0aName =  map.getOrDefault(0, "");
            //项目名-支出
            String f2cName2 =  map.getOrDefault(2, "");
            //金额 收入
            String f1bNum =  map.getOrDefault(1, "");
            //金额 支出
            String f3dNum =  map.getOrDefault(3, "");

            if( !isInListFlag && StringUtils.isNotBlank(map.getOrDefault(0, "")) &&  map.getOrDefault(0, "").startsWith("一、")  ) {
                //if( map.containsValue("项    目") && "项   目".equals(map.getOrDefault(0, "")) ) {
                isInListFlag = true;
                isTableListFlag = true;
            }

            if(map.containsValue("收  入  总  计")) {
                //本 年 收 入 合 计
                String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0");
                p3p1Vo.setTotalIn(itemTotal);

                //本 年 支 出 合 计
                String itemTotal2 = ReadExcelUtil.strNumFormat(f3dNum,  "0");
                p3p1Vo.setTotalExpenditure(itemTotal2);

            }
            if(map.containsValue("本 年 收 入 合 计")) {
                p3p1Vo.setTotalYear(ReadExcelUtil.mapNumFormat(map, 1, ""));
            }

            if (isInListFlag && StringUtils.isBlank(map.getOrDefault(0, "")) ) {
                //结束
                isInListFlag = false;
            }
            if (isExpenditureListFlag && StringUtils.isBlank(map.getOrDefault(2, "")) ) {
                //结束
                isExpenditureListFlag = false;
            }


            //读取项目的list 收入 支出的明细
            if(isInListFlag) {

                //p2p1 收入名
                if( StringUtils.isNotBlank(f0aName) && map.getOrDefault(0, "").contains(BudgetY23Util.SEPARATE_STR) && !StringUtils.isNumeric(f0aName.substring(0, f0aName.indexOf(BudgetY23Util.SEPARATE_STR))) ) {

                    String itemName = ReadExcelUtil.getMapSubString(map, 0, BudgetY23Util.SEPARATE_STR);
                    //String nameStr = BudgetY23Util.getStrJoin(p3p1Vo.getIncomeNameStr(), itemName, BudgetY23Util.SEPARATE_STR);
                    String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");

                    //p3p1Vo.setIncomeNameStr(nameStr);

                    //p3p1 收入
                    BudgetP3p1ItemVo p3p1ItemVo = new BudgetP3p1ItemVo();
                    p3p1ItemVo.setTotal(itemTotal);
                    p3p1ItemVo.setName(itemName);
                    if(StringUtils.isNotBlank(f1bNum)) {
                    //if(StringUtils.isNotBlank(itemTotal)) {
                        inList.add(p3p1ItemVo);
                    }


                    //p2p2 item 收入
                    BudgetP3p2ItemVo p2p2ItemVo = new BudgetP3p2ItemVo();
                    p2p2ItemVo.setTotal(itemTotal);
                    p2p2ItemVo.setName(itemName);
                    //if(StringUtils.isNotBlank(f1bNum)) {
                    if(StringUtils.isNotBlank(itemTotal)) {
                        //取表2中的
                        //list.add(p2p2ItemVo);
                    }

                    //更新 带有子级的信息
                    p2p2ItemRecordVo = p2p2ItemVo;
                } else {
                    //记录子级项信息
                    String subItemName = ReadExcelUtil.getMapSubString(map, 0, "）");
                    if(StringUtils.isNotBlank(subItemName) && subItemName.equals("上级补助") && null != p2p2ItemRecordVo ) {
                        BudgetP3p2ItemSubVo subVo = new BudgetP3p2ItemSubVo();
                        subVo.setName(subItemName);
                        String subTotal = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 1, "0");
                        subVo.setTotal(subTotal);
                        //p2p2ItemRecordVo.setSubVo(subVo);
                    }

                }
            }

            if(isExpenditureListFlag) {
                ////p2p1 支出名
                if(map.getOrDefault(2, "").contains(BudgetY23Util.SEPARATE_STR)) {
                    String itemName = ReadExcelUtil.getMapSubString(map, 2, BudgetY23Util.SEPARATE_STR);
                    //String nameStr = BudgetY23Util.getStrJoin(p3p1Vo.getExpenditureNameStr(), itemName, BudgetY23Util.SEPARATE_STR);
                    String itemTotal = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");

                    //p3p1Vo.setExpenditureNameStr(nameStr);

                    if(StringUtils.isNotBlank(f3dNum)) {
                        BudgetP3p3ItemVo p3p3ItemVo = new BudgetP3p3ItemVo();
                        p3p3ItemVo.setName(itemName);
                        p3p3ItemVo.setTotal(itemTotal);
                        p3p3FuncList.add(p3p3ItemVo);
                    }

                    //p3p1 支出
                    BudgetP3p1ItemVo p3p1ItemVo = new BudgetP3p1ItemVo();
                    p3p1ItemVo.setTotal(itemTotal);
                    p3p1ItemVo.setName(itemName);
                    if(StringUtils.isNotBlank(f3dNum)) {
                        expenditureList.add(p3p1ItemVo);
                    }
                }
            }

            if(map.containsValue("上年结转结余") && map.getOrDefault(0, "").equals("上年结转结余") ) {
                p3p1Vo.setLastYearEnd(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 1, "0"));

                if(StringUtils.isNotBlank(map.getOrDefault(0, ""))) {
                    //收入名 不为 空值时
                    String itemName = ReadExcelUtil.getMapSubString(map, 0, BudgetY23Util.SEPARATE_STR);
                    /*String nameStr = BudgetY23Util.getStrJoin(p3p1Vo.getIncomeNameStr(), itemName, BudgetY23Util.SEPARATE_STR);
                    p3p1Vo.setIncomeNameStr(nameStr);*/

                    //收入预算数
                    String amountF1 = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 1, "0");

                    //上年 结转 不放入
                    /*BudgetP3p2ItemVo p2p2ItemVo = new BudgetP3p2ItemVo();
                    p2p2ItemVo.setTotal(amountF1);
                    p2p2ItemVo.setName(itemName);
                    list.add(p2p2ItemVo);*/
                }

                String itemName = map.getOrDefault(0, "");
                String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");

                BudgetP3p1ItemVo p3p1ItemVo = new BudgetP3p1ItemVo();
                p3p1ItemVo.setTotal(itemTotal);
                p3p1ItemVo.setName(itemName);
                if(StringUtils.isNotBlank(f1bNum)) {
                    inList.add(p3p1ItemVo);
                }
            }


            //p2p1的表格记录
            if(isTableListFlag) {
                String itemTotal = StringUtils.isNotBlank(f1bNum) ? ReadExcelUtil.strNumFormat(f1bNum,  "0.00") : "0.00";
                //本 年 支 出 合 计
                String itemTotal2 = StringUtils.isNotBlank(f3dNum) ? ReadExcelUtil.strNumFormat(f3dNum,  "0.00") : "0.00";

                BudgetP2p1ItemVo p2p1ItemVo = new BudgetP2p1ItemVo();
                p2p1ItemVo.setNameIn(f0aName);
                p2p1ItemVo.setTotalIn(itemTotal);
                p2p1ItemVo.setNameExpenditure(f2cName2);
                p2p1ItemVo.setTotalExpenditure(itemTotal2);
                p2p1Vo.getList().add(p2p1ItemVo);
            }


            //项    目  中间的空格不一致
            /*if( map.containsValue("一、") && "一、".equals(map.getOrDefault(0, "")) ) {
            //if( map.containsValue("项    目") && "项   目".equals(map.getOrDefault(0, "")) ) {
                isInListFlag = true;
                isTableListFlag = true;
            }*/

            if(map.containsValue("项   目（按支出功能科目分类）")) {
                isExpenditureListFlag = true;
            }

        }

        //复制 p3p1 到 p3p2
        p3p2vo.setTotal(p3p1Vo.getTotalIn());
        p3p2vo.setTotalYear(p3p1Vo.getTotalYear());
        p3p2vo.setLastYearEnd(p3p1Vo.getLastYearEnd());
        log.debug("结束");

    }

    /**
     * 读取 表2
     * @param maps
     * @param vo
     */
    private void setT2Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo, String templateExportType) {

        //p2p2
        BudgetP2p2Vo p2p2Vo = new BudgetP2p2Vo();
        p2p2Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p2Vo(p2p2Vo);


        //p3p2
        BudgetP3p2Vo p3p2Vo = vo.getExplainVo().getP3p2Vo();
        List<BudgetP3p2ItemVo> p3p2ItemVoList = p3p2Vo.getList();

        //全 list
        boolean isTableListFlag = false;

        for (LinkedHashMap<Integer, String> map : maps) {
            if(map.containsValue("合计") && map.getOrDefault(1, "").equals("合计")) {
                isTableListFlag = true;

            }

            if(map.containsValue("合计") && map.getOrDefault(1, "").equals("合计")) {

                //p2p2 item 收入 一般公共预算
                String total1 = ReadExcelUtil.mapNumFormat(map, 4, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo = new BudgetP3p2ItemVo();
                p2p2ItemVo.setTotal(total1);
                //类型4加  收入
                p2p2ItemVo.setName("一般公共预算收入");


                //p2p2 item 收入 政府性基金预算
                String total2 = ReadExcelUtil.mapNumFormat(map, 5, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo2 = new BudgetP3p2ItemVo();
                p2p2ItemVo2.setTotal(total2);
                //类型4加  收入
                p2p2ItemVo2.setName("政府性基金预算收入");

                //p2p2 item 收入 一般公共预算
                String total3 = ReadExcelUtil.mapNumFormat(map, 6, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo3 = new BudgetP3p2ItemVo();
                p2p2ItemVo3.setTotal(total3);
                p2p2ItemVo3.setName("国有资本经营预算");

                //p2p2 item 收入 财政专户管理资金
                String total4 = ReadExcelUtil.mapNumFormat(map, 7, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo4 = new BudgetP3p2ItemVo();
                p2p2ItemVo4.setTotal(total4);
                p2p2ItemVo4.setName("财政专户管理资金");

                //单位资金
                //p2p2 item 收入 单位资金
                String total5 = ReadExcelUtil.mapNumFormat(map, 8, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo5 = new BudgetP3p2ItemVo();
                p2p2ItemVo5.setTotal(total5);
                p2p2ItemVo5.setName("单位资金");

                String total6 = ReadExcelUtil.mapNumFormat(map, 9, "0.00");
                BudgetP3p2ItemVo p2p2ItemVo6 = new BudgetP3p2ItemVo();
                p2p2ItemVo6.setTotal(total6);
                p2p2ItemVo6.setName("上年结转结余");

                //凭祥的 测试调整 , 只加有数据的项
                if(TemplateEpType.Y2024BT4.getCode().equals(templateExportType)) {
                    if (!"0.00".equals(total1)) {
                        p3p2ItemVoList.add(p2p2ItemVo);
                    }
                    if (!"0.00".equals(total2)) {
                        p3p2ItemVoList.add(p2p2ItemVo2);
                    }
                    if (!"0.00".equals(total3)) {
                        p3p2ItemVoList.add(p2p2ItemVo3);
                    }
                    if (!"0.00".equals(total4)) {
                        p3p2ItemVoList.add(p2p2ItemVo4);
                    }
                    if (!"0.00".equals(total5)) {
                        p3p2ItemVoList.add(p2p2ItemVo5);
                    }
                    if (!"0.00".equals(total6)) {
                        p3p2ItemVoList.add(p2p2ItemVo6);
                    }
                } else {
                    p3p2ItemVoList.add(p2p2ItemVo);
                    p3p2ItemVoList.add(p2p2ItemVo2);
                    p3p2ItemVoList.add(p2p2ItemVo3);
                    p3p2ItemVoList.add(p2p2ItemVo4);
                    p3p2ItemVoList.add(p2p2ItemVo5);
                    p3p2ItemVoList.add(p2p2ItemVo6);
                }

            }



            if(isTableListFlag) {
                BudgetP2p2ItemVo p2p2ItemVo = new BudgetP2p2ItemVo();
                p2p2ItemVo.setDeptCode(map.getOrDefault(0, ""));
                p2p2ItemVo.setDeptName(map.getOrDefault(1, ""));
                p2p2ItemVo.setTotal1(ReadExcelUtil.mapNumFormat(map, 2, ""));
                p2p2ItemVo.setTotalYear2(ReadExcelUtil.mapNumFormat(map, 3, ""));
                p2p2ItemVo.setPublicYear3(ReadExcelUtil.mapNumFormat(map, 4, ""));
                p2p2ItemVo.setGovYear4(ReadExcelUtil.mapNumFormat(map, 5, ""));
                p2p2ItemVo.setTotalYear5(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p2ItemVo.setManageYear6(ReadExcelUtil.mapNumFormat(map, 7, ""));
                p2p2ItemVo.setDeptYear7(ReadExcelUtil.mapNumFormat(map, 8, ""));
                p2p2ItemVo.setTotalRest8(ReadExcelUtil.mapNumFormat(map, 9, ""));
                p2p2ItemVo.setPublicRest9(ReadExcelUtil.mapNumFormat(map, 10, ""));
                p2p2ItemVo.setGovRest10(ReadExcelUtil.mapNumFormat(map, 11, ""));
                p2p2ItemVo.setTotalRest11(ReadExcelUtil.mapNumFormat(map, 12, ""));
                p2p2ItemVo.setManageRest12(ReadExcelUtil.mapNumFormat(map, 13, ""));
                p2p2ItemVo.setDeptRest13(ReadExcelUtil.mapNumFormat(map, 14, ""));
                p2p2Vo.getList().add(p2p2ItemVo);
            }

        }
        log.debug("测试");
    }

    /**
     * 读取 表3
     * @param maps
     * @param vo
     */
    private void setT3Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {
        //p3p3
        BudgetP3p3Vo p3p3vo = vo.getExplainVo().getP3p3Vo();
        //vo.getExplainVo().setP3p3Vo(p3p3vo);
        List<BudgetP3p3DeptVo> p3p3DeptVoList = new ArrayList<>();
        p3p3vo.setDeptList(p3p3DeptVoList);

        //p2p3
        BudgetP2p3Vo p2p3Vo = new BudgetP2p3Vo();
        p2p3Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p3Vo(p2p3Vo);

        //全 list
        boolean isTableListFlag = false;

        //子级单位
        BudgetP3p3DeptVo p3p3DeptVo = new BudgetP3p3DeptVo();

        //记录部门的数量
        int deptNum = 0;

        for (LinkedHashMap<Integer, String> map : maps) {
            //科目编码1
            String f0aCode1 =  map.getOrDefault(0, "");
            //科目编码2
            String f1bCode2 =  map.getOrDefault(1, "");
            //科目编码3
            String f2cCode3 =  map.getOrDefault(2, "");
            //单位编码
            String f3dDeptCode =  map.getOrDefault(3, "");
            //单位名称(功能分类科目名称)
            String f4eItemName =  map.getOrDefault(4, "");




            //标记 查询部门
            if(isTableListFlag) {
                //总计
                String totalItem = ReadExcelUtil.mapNumFormat(map, 5, "0.00");
                //基本
                String baseItem = ReadExcelUtil.mapNumFormat(map, 6, "0.00");
                //项目
                String projectItem = ReadExcelUtil.mapNumFormat(map, 7, "0.00");

                //查询 子级单位的
                if(StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                    //先存上次的子级单位
                    /*if(null != subDeptVo) {
                        subDeptList.add(subDeptVo);
                    }*/
                    //新记录
                    p3p3DeptVo = new BudgetP3p3DeptVo();
                    p3p3DeptVo.setDeptName(f4eItemName);
                    p3p3DeptVo.setDeptCode(f3dDeptCode);
                    p3p3DeptVo.setTotal(totalItem);
                    p3p3DeptVo.setBase(baseItem);
                    p3p3DeptVo.setProject(projectItem);
                    p3p3DeptVo.setList(new ArrayList<>());
                    //存子级单位
                    p3p3DeptVoList.add(p3p3DeptVo);
                }

                //存单位的 item
                if(StringUtils.isNotBlank(f1bCode2) && StringUtils.isBlank(f3dDeptCode) && null != p3p3DeptVo ) {
                    //子级单位的科目项
                    BudgetP3p3DeptItemVo deptItemVo = new BudgetP3p3DeptItemVo();
                    //有时格式错误会出现 小数点(第一列 都是 数值转文本,  3个编码的单位后加的 是 单文本, 引起错误) subDeptItemVo.setCode(f0a + f1b + f2c);
                    //deptItemVo.setCode( f0aCode1.replace(".0", "") + f1bCode2.replace(".0", "") + f2cCode3.replace(".0", ""));
                    deptItemVo.setCode1( f0aCode1);
                    deptItemVo.setName(f4eItemName);
                    deptItemVo.setTotal(totalItem);
                    deptItemVo.setBase(baseItem);
                    deptItemVo.setProject(projectItem);
                    p3p3DeptVo.getList().add(deptItemVo);
                }

            }

            if(map.containsValue("合计") && map.getOrDefault(4, "").equals("合计")) {
                //合计
                String total = ReadExcelUtil.mapNumFormat(map, 5, "0.00");
                String base = ReadExcelUtil.mapNumFormat(map, 6, "0.00");
                String project = ReadExcelUtil.mapNumFormat(map, 7, "0.00");

                /*String operation = ReadExcelUtil.mapNumFormat(map, 8, "0.00");
                String parent = ReadExcelUtil.mapNumFormat(map, 9, "0.00");
                String subsidiary = ReadExcelUtil.mapNumFormat(map, 10, "0.00");*/

                p3p3vo.setTotal(total);
                p3p3vo.setBase(base);
                p3p3vo.setProject(project);
                //deptFlag = true;

                isTableListFlag = true;
            }

            //读取 全部的列
            if(isTableListFlag) {
                BudgetP2p3ItemVo p2p3ItemVo = new BudgetP2p3ItemVo();
                p2p3ItemVo.setCode1(map.getOrDefault(0, ""));
                p2p3ItemVo.setCode2(map.getOrDefault(1, ""));
                p2p3ItemVo.setCode3(map.getOrDefault(2, ""));
                p2p3ItemVo.setDeptCode(map.getOrDefault(3, ""));
                p2p3ItemVo.setItemName(map.getOrDefault(4, ""));
                p2p3ItemVo.setTotal(ReadExcelUtil.mapNumFormat(map, 5, ""));
                p2p3ItemVo.setBaseTotal(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p3ItemVo.setProjectTotal(ReadExcelUtil.mapNumFormat(map, 7, ""));
                p2p3ItemVo.setOperation(ReadExcelUtil.mapNumFormat(map, 8, ""));
                p2p3ItemVo.setParent(ReadExcelUtil.mapNumFormat(map, 9, ""));
                p2p3ItemVo.setSubsidiary(ReadExcelUtil.mapNumFormat(map, 10, ""));
                p2p3Vo.getList().add(p2p3ItemVo);
            }

        }

        //p3p3 除掉第一个部门
        if(!p3p3DeptVoList.isEmpty() && p3p3DeptVoList.size() > 1 ) {
            p3p3DeptVoList = p3p3DeptVoList.subList(1, p3p3DeptVoList.size());
            p3p3vo.setDeptList(p3p3DeptVoList);
        } else if(!p3p3DeptVoList.isEmpty() && p3p3DeptVoList.size() == 1 ) {
            p3p3DeptVoList = new ArrayList<>();
            p3p3vo.setDeptList(p3p3DeptVoList);
        }

        //取表一的 科目, 占比支出总预算,同比 todo 或放在同比时 处理
        /*List<BudgetP3p2ItemVo> p2p2ItemList = vo.getExplainVo().getP3p2Vo().getList();
        for (BudgetP3p2ItemVo p2p2ItemVo : p2p2ItemList ) {
            BudgetP3p3ItemVo p2p3ItemVo = new BudgetP3p3ItemVo();
            p2p3ItemVo.setName(p2p2ItemVo.getName());
            p2p3ItemVo.setTotal(p2p2ItemVo.getTotal());
            //ratio compare todo
            list.add(p2p3ItemVo);
        }*/

        log.debug("结束");
    }

    /**
     * 读取 表4
     * @param maps
     * @param vo
     */
    private void setT4Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo, String templateExportType ) {

        //p3p4
        BudgetP3p4Vo p3p4Vo = new BudgetP3p4Vo();
        vo.getExplainVo().setP3p4Vo(p3p4Vo);

        //项目名-收入  标记
        boolean incomeListFlag = false;
        //项目名-支出  标记
        boolean expenditureListFlag = false;


        //收入
        BudgetP3p4SubItemVo incomeVo = new BudgetP3p4SubItemVo();
        incomeVo.setList(new ArrayList<>());
        //支出
        BudgetP3p4SubItemVo expenditureVo = new BudgetP3p4SubItemVo();
        expenditureVo.setList(new ArrayList<>());
        p3p4Vo.setIncomeVo(incomeVo);
        p3p4Vo.setExpenditureVo(expenditureVo);

        //p2p4
        BudgetP2p4Vo p2p4Vo = new BudgetP2p4Vo();
        p2p4Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p4Vo(p2p4Vo);

        //全 list
        boolean isTableListFlag = false;
        //上年结转标记开始
        boolean isLastYearResFlag = false;

        for (LinkedHashMap<Integer, String> map : maps) {
            //项目名-收入
            String f0aName =  map.getOrDefault(0, "");
            //项目名-支出
            String f2cName2 =  map.getOrDefault(2, "");
            //金额 收入
            String f1bNum =  map.getOrDefault(1, "");
            //金额 支出
            String f3dNum =  map.getOrDefault(3, "");

            //因为 24 23年的 项 目 栏的空格不一样
            if( !isTableListFlag && StringUtils.isNotBlank(map.getOrDefault(0, "")) &&  map.getOrDefault(0, "").startsWith("一、")  ) {
                isTableListFlag = true;
            }

            if(  f0aName.contains("、上年结转结余")) {
                incomeListFlag = false;

                String itemName = ReadExcelUtil.getMapSubString(map, 0, BudgetY23Util.SEPARATE_STR);
                String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");

                if(!TemplateEpType.Y2024BT4.getCode().equals(templateExportType)) {
                    //上年结转结余 也记录
                    BudgetP3p4ItemVo itemVo = new BudgetP3p4ItemVo();
                    itemVo.setName(itemName);
                    itemVo.setTotal(itemTotal);
                    incomeVo.getList().add(itemVo);

                    //桂平 模板加总数
                    String yearTotal =  incomeVo.getTotal().replace(",", "");
                    BigDecimal sumYearTotal = NumberUtil.add(yearTotal, itemTotal.replace(",", ""));
                    incomeVo.setTotal(ReadExcelUtil.strNumFormat(sumYearTotal.toString(), "0.00"));
                }

            }

            //预算2024类型4 拨款结转
            if(TemplateEpType.Y2024BT4.getCode().equals(templateExportType) && isLastYearResFlag && StringUtils.isBlank(f0aName)) {
                isLastYearResFlag = false;
            }
            if(TemplateEpType.Y2024BT4.getCode().equals(templateExportType) && isLastYearResFlag && f0aName.contains("）")) {
                String itemName = ReadExcelUtil.getMapSubString(map, 0, "）");
                String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");

                //上年结转结余 也记录
                BudgetP3p4ItemVo itemVo = new BudgetP3p4ItemVo();
                itemVo.setName(itemName + "拨款结转");
                itemVo.setTotal(itemTotal);
                if(!"0.00".equals(itemTotal)) {
                    incomeVo.getList().add(itemVo);
                }

                //桂平 模板加总数
                String yearTotal =  incomeVo.getTotal().replace(",", "");
                BigDecimal sumYearTotal = NumberUtil.add(yearTotal, itemTotal.replace(",", ""));
                incomeVo.setTotal(ReadExcelUtil.strNumFormat(sumYearTotal.toString(), "0.00"));
            }


            if(f0aName.contains("、上年结转结余")) {
                isLastYearResFlag = true;
            }

            if( f2cName2.contains("、结转下年支出")) {
                expenditureListFlag = false;
                String itemName = ReadExcelUtil.getMapSubString(map, 2, "）");
                String itemTotal = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 3, "0");
                /*String nameStr = BudgetY23Util.getStrJoin(p3p4Vo.getExpenditureStr(), itemName, BudgetY23Util.SEPARATE_STR);
                p3p4Vo.setExpenditureStr(nameStr);*/
            }

            if(incomeListFlag) {
                //收入
                //if(f0aName.contains("）") && StringUtils.isNotBlank(f1bNum)) {
                if(f0aName.contains("）") ) {
                    String itemName = ReadExcelUtil.getMapSubString(map, 0, "）");
                    String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");

                    BudgetP3p4ItemVo itemVo = new BudgetP3p4ItemVo();
                    itemVo.setName(itemName + "拨款");
                    itemVo.setTotal(itemTotal);
                    //凭祥 只加 > 0
                    if(TemplateEpType.Y2024BT4.getCode().equals(templateExportType)) {
                        if(!"0.00".equals(itemTotal)) {
                            incomeVo.getList().add(itemVo);
                        }
                    } else {
                        incomeVo.getList().add(itemVo);
                    }


                    /*if(!itemTotal.equals("0")) {
                        String tempStr = String.format("%s %s 元", itemName, itemTotal);
                        String nameStr = BudgetY23Util.getStrJoin(p3p4Vo.getIncomeStr(), tempStr, BudgetY23Util.SEPARATE_STR);
                        p3p4Vo.setIncomeStr(nameStr);
                    }*/
                }
            }

            if(expenditureListFlag) {
                //支出
                if(f2cName2.contains("）") && StringUtils.isNotBlank(f3dNum) ) {
                    String itemName = ReadExcelUtil.getMapSubString(map, 2, "）");
                    //String itemTotal = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 3, "0");
                    String itemTotal = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");

                    BudgetP3p4ItemVo itemVo = new BudgetP3p4ItemVo();
                    itemVo.setName(itemName);
                    itemVo.setTotal(itemTotal);
                    //凭祥 只加 > 0
                    if(TemplateEpType.Y2024BT4.getCode().equals(templateExportType)) {
                        if(!"0.00".equals(itemTotal)) {
                            expenditureVo.getList().add(itemVo);
                        }
                    } else {
                        expenditureVo.getList().add(itemVo);
                    }

                    /*if(!itemTotal.equals("0")) {
                        String tempStr = String.format("%s %s 元", itemName, itemTotal);
                        String nameStr = BudgetY23Util.getStrJoin(p3p4Vo.getExpenditureStr(), tempStr, BudgetY23Util.SEPARATE_STR);
                        p3p4Vo.setExpenditureStr(nameStr);
                    }*/
                }
            }

            //全 list
            if(isTableListFlag) {
                String itemTotal = StringUtils.isNotBlank(f1bNum) ? ReadExcelUtil.strNumFormat(f1bNum,  "0.00") : "";
                String itemTotal2 = StringUtils.isNotBlank(f3dNum) ? ReadExcelUtil.strNumFormat(f3dNum,  "0.00") : "";

                BudgetP2p1ItemVo p2p1ItemVo = new BudgetP2p1ItemVo();
                p2p1ItemVo.setNameIn(f0aName);
                p2p1ItemVo.setTotalIn(itemTotal);
                p2p1ItemVo.setNameExpenditure(f2cName2);
                p2p1ItemVo.setTotalExpenditure(itemTotal2);
                p2p4Vo.getList().add(p2p1ItemVo);
            }

            //读取 本年的收入
            if(map.containsValue("一、本年收入") && "一、本年收入".equals(map.getOrDefault(0, ""))) {
                String itemTotal = ReadExcelUtil.strNumFormat(f1bNum,  "0.00");
                incomeVo.setTotal(itemTotal);
            }

            //读取 本年的支出
            if(map.containsValue("一、本年支出") && "一、本年支出".equals(map.getOrDefault(2, ""))) {
                String itemTotal = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");
                expenditureVo.setTotal(itemTotal);
            }

            if(map.containsValue("一、本年收入") && map.containsValue("一、本年支出")) {
                incomeListFlag = true;
                expenditureListFlag = true;
            }

            //24和23的不一样
            /*if( map.containsValue("项   目") && "项   目".equals(map.getOrDefault(0, "")) ) {
                isTableListFlag = true;
            }*/


        }


        log.debug("结束");
    }

    /**
     * 读取  (表5)
     * @param maps
     * @param vo
     */
    private void setT5Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {

        BudgetP3p5Vo p3p5Vo = new BudgetP3p5Vo();
        vo.getExplainVo().setP3p5Vo(p3p5Vo);

        //所属单位 list
        List<BudgetP3p5SubDeptVo> subDeptList = new ArrayList<>();
        p3p5Vo.setSubDeptList(subDeptList);
        //子级单位
        BudgetP3p5SubDeptVo subDeptVo = new BudgetP3p5SubDeptVo();

        //主管部门的查询 标记
        boolean deptFlag = false;

        //子级单位的 查询 标记
        boolean deptSubFlag = false;

        //p3p5的项
        List<BudgetP3p5ItemVo> list = new ArrayList<>();
        p3p5Vo.setList(list);

        //全 list
        boolean isTableListFlag = false;
        //p2p5
        BudgetP2p5Vo p2p5Vo = new BudgetP2p5Vo();
        p2p5Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p5Vo(p2p5Vo);


        for (LinkedHashMap<Integer, String> map : maps) {

            //科目编码1
            String f0aCode1 =  map.getOrDefault(0, "");
            //科目编码2
            String f1bCode2 =  map.getOrDefault(1, "");
            //科目编码3
            String f2cCode3 =  map.getOrDefault(2, "");
            //单位编码
            String f3dDeptCode =  map.getOrDefault(3, "");
            //单位名称(功能分类科目名称)
            String f4eItemName =  map.getOrDefault(4, "");
            String f5dItemValue =  map.getOrDefault(5, "");
            //基本支出
            String f6BaseValue =  map.getOrDefault(6, "");
            //项目支出
            String f9ProjectValue =  map.getOrDefault(9, "");

            if(deptSubFlag && StringUtils.isNotBlank(f1bCode2) && StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                //子级单位的结束
                deptSubFlag = false;
            }

            if(deptSubFlag) {
                //子级单位的读取
                //合计
                String total = ReadExcelUtil.strNumFormat(f5dItemValue, "0.00");
                String base = ReadExcelUtil.strNumFormat(f6BaseValue, "0.00");
                String project = ReadExcelUtil.strNumFormat(f9ProjectValue, "0.00");

                //记录总的项 加起来 新版y24的读取
                if(StringUtils.isNotBlank(f2cCode3) && StringUtils.isNotBlank(f4eItemName)  ) {
                    //先查询 旧的有没有
                    BudgetP3p5ItemVo p3p5ItemVo = list.stream().filter(i-> null!= i && f0aCode1.equals(i.getCode1()) && f1bCode2.equals(i.getCode2()) && f2cCode3.equals(i.getCode3()) ).findFirst().orElse(null);
                    if(null != p3p5ItemVo) {
                        BigDecimal subTotal = NumberUtil.add(p3p5ItemVo.getTotal().replace(",", ""), f5dItemValue);
                        p3p5ItemVo.setTotal(NumberFormatUtils.addThousandSeparatorForInteger(subTotal));
                        //基本
                        BigDecimal subTotal2 = NumberUtil.add(p3p5ItemVo.getBase().replace(",", ""), f6BaseValue);
                        p3p5ItemVo.setBase(NumberFormatUtils.addThousandSeparatorForInteger(subTotal2));
                        //项目支出
                        BigDecimal subTotal3 = NumberUtil.add(p3p5ItemVo.getProject().replace(",", ""), f9ProjectValue);
                        p3p5ItemVo.setProject(NumberFormatUtils.addThousandSeparatorForInteger(subTotal3));

                    } else {
                        p3p5ItemVo = new BudgetP3p5ItemVo();
                        p3p5ItemVo.setCode1(f0aCode1);
                        p3p5ItemVo.setCode2(f1bCode2);
                        p3p5ItemVo.setCode3(f2cCode3);
                        p3p5ItemVo.setName3(f4eItemName);
                        p3p5ItemVo.setTotal(total);
                        p3p5ItemVo.setBase(base);
                        p3p5ItemVo.setProject(project);
                        list.add(p3p5ItemVo);
                    }
                }

                //todo 有多个单位, 如何读取

                //查询 子级单位的
                if(StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                    //先存上次的子级单位
                    /*if(null != subDeptVo) {
                        subDeptList.add(subDeptVo);
                    }*/

                    String totalPublic = ReadExcelUtil.mapNumFormat(map, 8, "0.00");

                    //新记录
                    subDeptVo = new BudgetP3p5SubDeptVo();
                    subDeptVo.setDeptName(f4eItemName);
                    subDeptVo.setDeptCode(f3dDeptCode);
                    subDeptVo.setTotal(total);
                    subDeptVo.setTotalPublic(totalPublic);
                    subDeptVo.setList(new ArrayList<>());
                    //存子级单位
                    subDeptList.add(subDeptVo);
                }

                if(StringUtils.isNotBlank(f1bCode2) && StringUtils.isBlank(f3dDeptCode) && null != subDeptVo ) {
                    //子级单位的科目项
                    BudgetP3p5SubDeptItemVo subDeptItemVo = new BudgetP3p5SubDeptItemVo();
                    //有时格式错误会出现 小数点(第一列 都是 数值转文本,  3个编码的单位后加的 是 单文本, 引起错误) subDeptItemVo.setCode(f0a + f1b + f2c);
                    subDeptItemVo.setCode( f0aCode1.replace(".0", "") + f1bCode2.replace(".0", "") + f2cCode3.replace(".0", ""));
                    subDeptItemVo.setName(f4eItemName);
                    subDeptItemVo.setTotal(total);
                    subDeptVo.getList().add(subDeptItemVo);

                    //todo map 中记录 再相加
                }
            }


            /*if(deptFlag) {
                // 废弃, 读取 主管部门的, 不这样读取
                //合计 基本 项目 的总计
                String total = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 5, "0");
                String base = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 6, "0");
                String project = ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 9, "0");

                p3p5Vo.setDeptName(f4e);
                p3p5Vo.setDeptCode(f3d);
                p3p5Vo.setTotal(total);
                p3p5Vo.setBase(base);
                p3p5Vo.setProject(project);

                //查询 子级单位
                deptFlag = false;
                deptSubFlag = true;
            }*/


            if(map.containsValue("合计") && map.getOrDefault(4, "").equals("合计")) {
                deptFlag = true;
                deptSubFlag = true;

                //读取 合计行
                String total = ReadExcelUtil.strNumFormat(f5dItemValue, "0.00");
                String base = ReadExcelUtil.strNumFormat(map.getOrDefault(6, "0.00"), "0.00");
                String project = ReadExcelUtil.strNumFormat(map.getOrDefault(9, "0.00"), "0.00");
                p3p5Vo.setTotal(total);
                p3p5Vo.setBase(base);
                p3p5Vo.setProject(project);

                isTableListFlag = true;
            }

            //全部 list
            if(isTableListFlag) {
                BudgetP2p5ItemVo p2p5ItemVo = new BudgetP2p5ItemVo();
                p2p5ItemVo.setCode1(f0aCode1);
                p2p5ItemVo.setCode2(f1bCode2);
                p2p5ItemVo.setCode3(f2cCode3);
                p2p5ItemVo.setDeptCode(f3dDeptCode);
                p2p5ItemVo.setItemName(f4eItemName);
                p2p5ItemVo.setTotal(ReadExcelUtil.strNumFormat(f5dItemValue, ""));
                p2p5ItemVo.setBaseTotal(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p5ItemVo.setPersonTotal(ReadExcelUtil.mapNumFormat(map, 7, ""));
                p2p5ItemVo.setPublicTotal(ReadExcelUtil.mapNumFormat(map, 8, ""));
                p2p5ItemVo.setProjectTotal(ReadExcelUtil.mapNumFormat(map, 9, ""));
                p2p5Vo.getList().add(p2p5ItemVo);
            }


        }


        log.debug("结束");

    }

    /**
     * 读取 表6
     * @param maps
     * @param vo
     */
    private void setT6Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {

        //p2p6
        BudgetP3p6Vo p3p6Vo = new BudgetP3p6Vo();
        vo.getExplainVo().setP3p6Vo(p3p6Vo);

        //人员经费
        BudgetP3p6SubItemVo personVo = new BudgetP3p6SubItemVo();
        personVo.setList(new ArrayList<>());

        //公用经费
        BudgetP3p6SubItemVo publicVo = new BudgetP3p6SubItemVo();
        publicVo.setList(new ArrayList<>());

        //关联
        p3p6Vo.setPersonVo(personVo);
        p3p6Vo.setPublicVo(publicVo);

        //记录类的信息
        String personC1Name = "";
        String personC1Code = "";
        String publiceC1Name = "";
        String publiceC1Code = "";

        //项的 list的查询
        boolean listItemFlag = false;

        //p3p3
        List<BudgetP3p3ItemVo> p3p3BaseList = vo.getExplainVo().getP3p3Vo().getBaseList();
        List<BudgetP3p3ItemVo> p3p3ProjectList = vo.getExplainVo().getP3p3Vo().getProjectList();

        //全 list
        boolean isTableListFlag = false;
        //p2p6
        BudgetP2p6Vo p2p6Vo = new BudgetP2p6Vo();
        p2p6Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p6Vo(p2p6Vo);

        //p3p10p1
        BudgetP3p10Vo p3p10Vo = vo.getExplainVo().getP3p10Vo();
        if(null == p3p10Vo) {
            p3p10Vo = new BudgetP3p10Vo();
            vo.getExplainVo().setP3p10Vo(p3p10Vo);
        }
        BudgetP3p10p1Vo p10p1Vo = p3p10Vo.getP1Vo();
        if(null == p10p1Vo) {
            p10p1Vo = new BudgetP3p10p1Vo();
            vo.getExplainVo().getP3p10Vo().setP1Vo(p10p1Vo);
        }
        //302 商品和服务支出
        BudgetP3p10p1ItemVo p3p10p1ItemVoTp4 = new BudgetP3p10p1ItemVo();
        p3p10p1ItemVoTp4.setChangeItemVo(new BudgetP3ChangeItemVo());
        p10p1Vo.setOperationItemVoTp4(p3p10p1ItemVoTp4);
        vo.getExplainVo().getP3p10Vo().getP1Vo().setOperationItemVoTp4(p3p10p1ItemVoTp4);



        for (LinkedHashMap<Integer, String> map : maps) {
            //类 的编码
            String f0aCode1 =  map.getOrDefault(0, "");
            //款 的编码
            String f1bCode2 =  map.getOrDefault(1, "");
            //项名
            String itemName =  map.getOrDefault(2, "");
            //合计列的金额
            String f3dNum =  map.getOrDefault(3, "");
            //人员
            String f4eNum =  map.getOrDefault(4, "");
            //公用
            String f5fNum =  map.getOrDefault(5, "");

            if(listItemFlag) {
                if(StringUtils.isBlank(f1bCode2) && StringUtils.isBlank(itemName) ) {
                    listItemFlag = false;
                }
            }
            //记录大类的信息
            if(listItemFlag) {
                if(StringUtils.isNotBlank(f0aCode1) && StringUtils.isBlank(f1bCode2) && StringUtils.isNotBlank(f4eNum) ) {
                    personC1Name = itemName;
                    personC1Code = f0aCode1;
                }
                if(StringUtils.isNotBlank(f0aCode1) && StringUtils.isBlank(f1bCode2) && StringUtils.isNotBlank(f5fNum) ) {
                    publiceC1Name = itemName;
                    publiceC1Code = f0aCode1;
                }
                //记录大类的值
                if(StringUtils.isNotBlank(f0aCode1) && StringUtils.isBlank(f1bCode2) && StringUtils.isNotBlank(f3dNum)  ) {
                    String total = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");

                    BudgetP3p3ItemVo p3p3ItemVo = new BudgetP3p3ItemVo();
                    p3p3ItemVo.setName(itemName);
                    p3p3ItemVo.setTotal(total);
                    p3p3BaseList.add(p3p3ItemVo);
                }

            }

            //记录 302 商品服务 大类的信息
            if(listItemFlag) {
                //记录大类的值 302 商品服务 大类的信息
                if(StringUtils.isNotBlank(f0aCode1) && StringUtils.isBlank(f1bCode2) && StringUtils.isNotBlank(f3dNum) && "302".equals(f0aCode1)  ) {
                    String total = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");
                    p3p10p1ItemVoTp4.setTotal(total);
                }

            }


            if(listItemFlag && StringUtils.isNotBlank(f1bCode2) &&  StringUtils.isNotBlank(itemName) ) {
                String personTotal = ReadExcelUtil.strNumFormat(f4eNum,  "0.00");
                if(StringUtils.isNotBlank(f4eNum)) {
                    BudgetP3p6ItemVo itemVo = new BudgetP3p6ItemVo();
                    itemVo.setName2(itemName);
                    itemVo.setCode2(f1bCode2);
                    itemVo.setName1(personC1Name);
                    itemVo.setCode1(personC1Code);
                    itemVo.setTotal(personTotal);
                    personVo.getList().add(itemVo);

                    /*String nameStr = BudgetY23Util.getStrJoin(p3p6Vo.getPersonStr(), itemName, BudgetY23Util.SEPARATE_STR);
                    p3p6Vo.setPersonStr(nameStr);*/
                }

                String publicTotal = ReadExcelUtil.strNumFormat(f5fNum,  "0.00");
                if( StringUtils.isNotBlank(f5fNum) ) {
                    BudgetP3p6ItemVo itemVo = new BudgetP3p6ItemVo();
                    itemVo.setName2(itemName);
                    itemVo.setCode2(f1bCode2);
                    itemVo.setName1(publiceC1Name);
                    itemVo.setCode1(publiceC1Code);
                    itemVo.setTotal(publicTotal);
                    publicVo.getList().add(itemVo);

                    /*String nameStr = BudgetY23Util.getStrJoin(p3p6Vo.getPublicStr(), itemName, BudgetY23Util.SEPARATE_STR);
                    p3p6Vo.setPublicStr(nameStr);*/
                }
            }


            if(map.containsValue("合计") && map.getOrDefault(2, "").equals("合计")) {
                //合计
                String total = ReadExcelUtil.strNumFormat(f3dNum,  "0.00");
                String personTotal = ReadExcelUtil.strNumFormat(f4eNum,  "0.00");
                String publicTotal = ReadExcelUtil.strNumFormat(f5fNum,  "0.00");

                p3p6Vo.setTotal(total);
                p3p6Vo.setPerson(personTotal);
                p3p6Vo.setPublicTotal(publicTotal);

                personVo.setTotal(personTotal);
                publicVo.setTotal(publicTotal);

                listItemFlag = true;
                isTableListFlag = true;
            }

            if(isTableListFlag) {
                BudgetP2p6ItemVo p2p6ItemVo = new BudgetP2p6ItemVo();
                p2p6ItemVo.setCode1(f0aCode1);
                p2p6ItemVo.setCode2(f1bCode2);
                p2p6ItemVo.setItemName(itemName);
                p2p6ItemVo.setTotal(ReadExcelUtil.strNumFormat(f3dNum, ""));
                p2p6ItemVo.setPersonTotal(ReadExcelUtil.strNumFormat(f4eNum, ""));
                p2p6ItemVo.setPublicTotal(ReadExcelUtil.strNumFormat(f5fNum, ""));
                p2p6Vo.getList().add(p2p6ItemVo);
            }

        }

        log.debug("结束");
    }

    /**
     * 读取 表7
     * @param maps
     * @param vo
     */
    private void setT7Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo, String templateExportType ) {

        //todo 需 清楚 如何读取
        //p3p7
        BudgetP3p7Vo p3p7Vo = new BudgetP3p7Vo();
        vo.getExplainVo().setP3p7Vo(p3p7Vo);
        //循环中 取值

        int rowType = 0;
        String year = vo.getYear();

        //全 list
        boolean isTableListFlag = false;
        //p2p7
        BudgetP2p7Vo p2p7Vo = new BudgetP2p7Vo();
        p2p7Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p7Vo(p2p7Vo);

        Integer carBuyKey = 7;
        Integer carOperateKey = 8;
        //不是凭祥 或者 天等时, 读取去年会反着来
        if(!TemplateEpType.Y2024BT4.getCode().equals(templateExportType) && !TemplateEpType.Y2024BT5.getCode().equals(templateExportType)) {
            if(StringUtils.isNotBlank(year) && null != vo.getLastYearFlag() && 1 == vo.getLastYearFlag() && "2024".equals(year)) {
                carBuyKey = 8;
                carOperateKey = 7;
            }
        }

        for (LinkedHashMap<Integer, String> map : maps) {

            //一般公共预算资金
            if(rowType == 0 ) {
                if((map.containsValue("合计") && map.getOrDefault(1, "").equals("合计"))) {
                    rowType = 1;
                    //合计行先不取 全口径先取  一般公共预算资金 中的

                    isTableListFlag = true;
                }

                //取消 直接取 合计行
                if(map.containsValue("一般公共预算资金") && map.getOrDefault(2, "").equals("一般公共预算资金")
                        && StringUtils.isBlank(map.getOrDefault(1, "")) ) {
                    rowType = 2;
                }
            }

            if(rowType > 0) {
                String total =  ReadExcelUtil.strNumFormat(map.getOrDefault(4, "0.00"),  "0.00");
                String abroad = ReadExcelUtil.strNumFormat(map.getOrDefault(5, "0.00"),  "0.00");
                String car = ReadExcelUtil.strNumFormat(map.getOrDefault(6, "0.00"),  "0.00");
                String carBuy = ReadExcelUtil.strNumFormat(map.getOrDefault(carBuyKey, "0.00"),  "0.00");
                String carOperate = ReadExcelUtil.strNumFormat(map.getOrDefault(carOperateKey, "0.00"),  "0.00");
                String reception = ReadExcelUtil.strNumFormat(map.getOrDefault(9, "0.00"),  "0.00");

                BudgetP3p7PartVo pVo = new BudgetP3p7PartVo();

                BudgetP3p7PartItemVo abroadVo = new BudgetP3p7PartItemVo();
                BudgetP3p7PartItemVo receptionVo = new BudgetP3p7PartItemVo();
                BudgetP3p7PartItemVo carVo = new BudgetP3p7PartItemVo();
                BudgetP3p7PartItemVo carOperateVo = new BudgetP3p7PartItemVo();
                BudgetP3p7PartItemVo carBuyVo = new BudgetP3p7PartItemVo();

                abroadVo.setTotal(abroad);
                carVo.setTotal(car);
                carOperateVo.setTotal(carOperate);
                carBuyVo.setTotal(carBuy);
                receptionVo.setTotal(reception);

                pVo.setTotal(total);
                pVo.setAbroadVo(abroadVo);
                pVo.setReceptionVo(receptionVo);
                pVo.setCarVo(carVo);
                pVo.setCarOperateVo(carOperateVo);
                pVo.setCarBuyVo(carBuyVo);

                if(rowType == 1) {
                    //合计行 全口径先取  一般公共预算资金 中的
                    //p3p7Vo.setP1Vo(pVo);
                    rowType = 0;
                    p3p7Vo.setP1Vo(pVo);
                    p3p7Vo.setP2Vo(pVo);
                    rowType = -1;
                } else if(rowType == 2) {
                    //一般公共预算资金 取消 查询
                    p3p7Vo.setP1Vo(pVo);
                    p3p7Vo.setP2Vo(pVo);
                    rowType = -1;
                    //break;
                }
            }

            if(isTableListFlag) {
                BudgetP2p7ItemVo p2p7ItemVo = new BudgetP2p7ItemVo();
                p2p7ItemVo.setDeptCode(map.getOrDefault(0, ""));
                p2p7ItemVo.setDeptName(map.getOrDefault(1, ""));
                p2p7ItemVo.setItemName(map.getOrDefault(2, ""));
                p2p7ItemVo.setTotal1(ReadExcelUtil.mapNumFormat(map, 3, ""));
                p2p7ItemVo.setTotal2(ReadExcelUtil.mapNumFormat(map, 4, ""));
                p2p7ItemVo.setAbroad3(ReadExcelUtil.mapNumFormat(map, 5, ""));
                p2p7ItemVo.setCar4(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p7ItemVo.setCarOperate5(ReadExcelUtil.mapNumFormat(map, carOperateKey, ""));
                p2p7ItemVo.setCarBuy6(ReadExcelUtil.mapNumFormat(map, carBuyKey, ""));
                p2p7ItemVo.setReceptio7(ReadExcelUtil.mapNumFormat(map, 9, ""));
                p2p7ItemVo.setMeeting8(ReadExcelUtil.mapNumFormat(map, 10, ""));
                p2p7ItemVo.setTrain9(ReadExcelUtil.mapNumFormat(map, 11, ""));
                p2p7ItemVo.setTrain10(ReadExcelUtil.mapNumFormat(map, 12, ""));
                p2p7ItemVo.setTrain11(ReadExcelUtil.mapNumFormat(map, 13, ""));
                p2p7Vo.getList().add(p2p7ItemVo);
            }
        }


        log.debug("结束");
    }

    /**
     * 读取 表8
     * @param maps
     * @param vo
     */
    private void setT8Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {
        BudgetP3p8Vo tvo = new BudgetP3p8Vo();
        List<BudgetP3p8ItemVo> tvoList = new ArrayList<>();
        //tvo.getExplainVo().setList(tvoList);

        // 是否读取项目的List
        boolean isListFlag = false;
        //标题行
        boolean isListHeadFlag = false;

        //p8部分 所属单位 list
        List<BudgetP3p8DeptVo> deptList = new ArrayList<>();
        tvo.setDeptList(deptList);
        //p3p8的项
        List<BudgetP3p8ItemVo> list = new ArrayList<>();
        tvo.setList(list);

        //子级单位
        BudgetP3p8DeptVo subDeptVo = new BudgetP3p8DeptVo();

        //子级单位的 查询 标记
        boolean deptSubFlag = false;

        //单位第一个
        boolean isHeadDeptFlag = false;

        //总计行的前一行
        boolean isTotalRowPreFlag = false;
        //总计行
        boolean isTotalRowFlag = false;

        //全 list
        boolean isTableListFlag = false;
        //p2p8
        BudgetP2p8Vo p2p8Vo = new BudgetP2p8Vo();
        p2p8Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p8Vo(p2p8Vo);

        for (LinkedHashMap<Integer, String> map : maps) {
            //科目编码1
            String f0aCode1 =  map.getOrDefault(0, "");
            //科目编码2
            String f1bCode2 =  map.getOrDefault(1, "");
            //科目编码3
            String f2cCode3 =  map.getOrDefault(2, "");
            //单位编码
            String f3dDeptCode =  map.getOrDefault(3, "");
            //单位名称(功能分类科目名称)
            String f4eItemName =  map.getOrDefault(4, "");
            String f5dItemValue =  map.getOrDefault(5, "");

            if(isListFlag && StringUtils.isNotBlank(f1bCode2) && StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                //子级单位的结束
                isListFlag = false;
                //break;
            }

            if(isListFlag) {
                //子级单位的读取
                //合计
                String total = ReadExcelUtil.strNumFormat(map.getOrDefault(5, "0.00"), "0.00");

                //总单位
                /*if(isHeadDeptFlag) {
                    isHeadDeptFlag = false;
                    tvo.setTotal(total);
                }*/


                //记录总的项 加起来 新版y24的读取
                if(StringUtils.isNotBlank(f2cCode3) && StringUtils.isNotBlank(f4eItemName)  ) {
                    //先查询 旧的有没有
                    BudgetP3p8ItemVo p3p8ItemVo = list.stream().filter(i-> null!= i && f0aCode1.equals(i.getCode1()) && f1bCode2.equals(i.getCode2()) && f2cCode3.equals(i.getCode3()) ).findFirst().orElse(null);
                    if(null != p3p8ItemVo) {
                        BigDecimal subTotal = NumberUtil.add(p3p8ItemVo.getTotal().replace(",", ""), f5dItemValue);
                        p3p8ItemVo.setTotal(NumberFormatUtils.addThousandSeparatorForInteger(subTotal));
                    } else {
                        p3p8ItemVo = new BudgetP3p8ItemVo();
                        //23年的数据会有 .0 读取时
                        p3p8ItemVo.setCode1(f0aCode1.replace(".0", ""));
                        p3p8ItemVo.setCode2(f1bCode2.replace(".0", ""));
                        p3p8ItemVo.setCode3(f2cCode3.replace(".0", ""));
                        p3p8ItemVo.setName3(f4eItemName);
                        p3p8ItemVo.setTotal(total);
                        list.add(p3p8ItemVo);
                    }
                }


                //查询 子级单位的
                if(StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                    //先存上次的子级单位
                    /*if(null != subDeptVo) {
                        subDeptList.add(subDeptVo);
                    }*/

                    //新记录
                    subDeptVo = new BudgetP3p8DeptVo();
                    subDeptVo.setDeptName(f4eItemName);
                    subDeptVo.setDeptCode(f3dDeptCode);
                    subDeptVo.setTotal(total);
                    subDeptVo.setList(new ArrayList<>());
                    //存子级单位
                    deptList.add(subDeptVo);
                }

                if(StringUtils.isNotBlank(f1bCode2) && StringUtils.isBlank(f3dDeptCode) && null != subDeptVo ) {
                    //子级单位的科目项
                    BudgetP3p8DeptItemVo subDeptItemVo = new BudgetP3p8DeptItemVo();
                    subDeptItemVo.setCode(f0aCode1 + f1bCode2 + f2cCode3);
                    subDeptItemVo.setName(f4eItemName);
                    subDeptItemVo.setTotal(total);
                    subDeptVo.getList().add(subDeptItemVo);

                    //todo map 中记录 再相加
                }
            }



            if(isListFlag) {
                /*BudgetP3p8ItemVo itemVo = new BudgetP3p8ItemVo();
                itemVo.setCode(String.format("%s%s%s", map.getOrDefault(0, ""), map.getOrDefault(1, ""), map.getOrDefault(2, "")));
                itemVo.setDeptCode(map.getOrDefault(3, ""));
                itemVo.setTotal(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 5, "0"));
                itemVo.setBase(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 6, "0"));
                itemVo.setProject(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 7, "0"));
                tvoList.add(itemVo);*/
                //continue;
            }


            //if( !isListFlag && map.containsValue("合计") && map.containsKey(4) &&  "合计".equals(map.getOrDefault(4, "")) ) {
            if( isTotalRowPreFlag ) {
                //合计
                String total = ReadExcelUtil.strNumFormat(map.getOrDefault(5, "0.00"), "0.00");

                //总计行
                tvo.setTotal(total);

                isTotalRowPreFlag = false;
                isListFlag = true;

                isTableListFlag = true;
            }

            //标题行
            if( map.containsValue("**") && map.containsKey(0) &&  "**".equals(map.get(0)) ) {
                //isListHeadFlag = false;
                isTotalRowPreFlag = true;
            }

            //合计栏
            /*if( map.containsValue("合计") && map.containsKey(5) &&  "合计".equals(map.getOrDefault(5, "")) ) {
                isListHeadFlag = false;
                isListFlag = true;
            }*/


            if(isTableListFlag) {
                BudgetP2p3ItemVo p2p3ItemVo = new BudgetP2p3ItemVo();
                p2p3ItemVo.setCode1(map.getOrDefault(0, ""));
                p2p3ItemVo.setCode2(map.getOrDefault(1, ""));
                p2p3ItemVo.setCode3(map.getOrDefault(2, ""));
                p2p3ItemVo.setDeptCode(map.getOrDefault(3, ""));
                p2p3ItemVo.setItemName(map.getOrDefault(4, ""));
                p2p3ItemVo.setTotal(ReadExcelUtil.mapNumFormat(map, 5, ""));
                p2p3ItemVo.setBaseTotal(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p3ItemVo.setProjectTotal(ReadExcelUtil.mapNumFormat(map, 7, ""));
                p2p8Vo.getList().add(p2p3ItemVo);
            }

        }

        vo.getExplainVo().setP3p8Vo(tvo);

    }

    /**
     * 读取 表9
     * @param maps
     * @param vo
     */
    private void setT9Report(List<LinkedHashMap<Integer, String>> maps, BudgetDataVo vo ) {
        BudgetP3p8Vo tvo = new BudgetP3p8Vo();
        List<BudgetP3p8ItemVo> tvoList = new ArrayList<>();
        //tvo.getExplainVo().setList(tvoList);

        // 是否读取项目的List
        boolean isListFlag = false;
        //标题行
        boolean isListHeadFlag = false;

        //p8部分 所属单位 list
        List<BudgetP3p8DeptVo> deptList = new ArrayList<>();
        tvo.setDeptList(deptList);
        //p3p8的项
        List<BudgetP3p8ItemVo> list = new ArrayList<>();
        tvo.setList(list);

        //子级单位
        BudgetP3p8DeptVo subDeptVo = new BudgetP3p8DeptVo();

        //子级单位的 查询 标记
        boolean deptSubFlag = false;

        //单位第一个
        boolean isHeadDeptFlag = false;

        //全 list
        boolean isTableListFlag = false;
        //p2p8
        BudgetP2p9Vo p2p9Vo = new BudgetP2p9Vo();
        p2p9Vo.setList(new ArrayList<>());
        vo.getTableVo().setP2p9Vo(p2p9Vo);

        //总计行的前一行
        boolean isTotalRowPreFlag = false;

        for (LinkedHashMap<Integer, String> map : maps) {
            //科目编码1
            String f0aCode1 =  map.getOrDefault(0, "");
            //科目编码2
            String f1bCode2 =  map.getOrDefault(1, "");
            //科目编码3
            String f2cCode3 =  map.getOrDefault(2, "");
            //单位编码
            String f3dDeptCode =  map.getOrDefault(3, "");
            //单位名称(功能分类科目名称)
            String f4eItemName =  map.getOrDefault(4, "");
            String f5dItemValue =  map.getOrDefault(5, "");

            if(isListFlag && StringUtils.isNotBlank(f1bCode2) && StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                //子级单位的结束
                isListFlag = false;
                //break;
            }

            if(isListFlag) {
                //子级单位的读取
                //合计
                String total = ReadExcelUtil.strNumFormat(map.getOrDefault(5, "0.00"), "0.00");

                //总单位
                /*if(isHeadDeptFlag) {
                    isHeadDeptFlag = false;
                    tvo.setTotal(total);
                }*/

                //记录总的项 加起来 新版y24的读取
                if(StringUtils.isNotBlank(f2cCode3) && StringUtils.isNotBlank(f4eItemName)  ) {
                    //先查询 旧的有没有
                    BudgetP3p8ItemVo p3p8ItemVo = list.stream().filter(i-> null!= i && f0aCode1.equals(i.getCode1()) && f1bCode2.equals(i.getCode2()) && f2cCode3.equals(i.getCode3()) ).findFirst().orElse(null);
                    if(null != p3p8ItemVo) {
                        BigDecimal subTotal = NumberUtil.add(p3p8ItemVo.getTotal().replace(",", ""), f5dItemValue);
                        p3p8ItemVo.setTotal(NumberFormatUtils.addThousandSeparatorForInteger(subTotal));
                    } else {
                        p3p8ItemVo = new BudgetP3p8ItemVo();
                        p3p8ItemVo.setCode1(f0aCode1.replace(".0", ""));
                        p3p8ItemVo.setCode2(f1bCode2.replace(".0", ""));
                        p3p8ItemVo.setCode3(f2cCode3.replace(".0", ""));
                        p3p8ItemVo.setName3(f4eItemName);
                        p3p8ItemVo.setTotal(total);
                        list.add(p3p8ItemVo);
                    }
                }

                //查询 子级单位的
                if(StringUtils.isNotBlank(f3dDeptCode) && StringUtils.isNotBlank(f4eItemName) ) {
                    //先存上次的子级单位
                    /*if(null != subDeptVo) {
                        subDeptList.add(subDeptVo);
                    }*/

                    //新记录
                    subDeptVo = new BudgetP3p8DeptVo();
                    subDeptVo.setDeptName(f4eItemName);
                    subDeptVo.setDeptCode(f3dDeptCode);
                    subDeptVo.setTotal(total);
                    subDeptVo.setList(new ArrayList<>());
                    //存子级单位
                    deptList.add(subDeptVo);
                }

                if(StringUtils.isNotBlank(f1bCode2) && StringUtils.isBlank(f3dDeptCode) && null != subDeptVo ) {
                    //子级单位的科目项
                    BudgetP3p8DeptItemVo subDeptItemVo = new BudgetP3p8DeptItemVo();
                    subDeptItemVo.setCode(f0aCode1 + f1bCode2 + f2cCode3);
                    subDeptItemVo.setName(f4eItemName);
                    subDeptItemVo.setTotal(total);
                    subDeptVo.getList().add(subDeptItemVo);

                    //todo map 中记录 再相加
                }
            }



            if(isListFlag) {
                /*BudgetP3p8ItemVo itemVo = new BudgetP3p8ItemVo();
                itemVo.setCode(String.format("%s%s%s", map.getOrDefault(0, ""), map.getOrDefault(1, ""), map.getOrDefault(2, "")));
                itemVo.setDeptCode(map.getOrDefault(3, ""));
                itemVo.setTotal(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 5, "0"));
                itemVo.setBase(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 6, "0"));
                itemVo.setProject(ReadExcelUtil.getMapNumFormatInThousandsYuan(map, 7, "0"));
                tvoList.add(itemVo);*/
                //continue;
            }

            //if( !isListFlag && map.containsValue("合计") && map.containsKey(4) &&  "合计".equals(map.getOrDefault(4, "")) ) {
            if( isTotalRowPreFlag ) {
                //合计
                String total = ReadExcelUtil.strNumFormat(map.getOrDefault(5, "0.00"), "0.00");

                //总计行
                tvo.setTotal(total);

                isTotalRowPreFlag = false;
                isListFlag = true;

                isTableListFlag = true;
            }

            //标题行
            if( map.containsValue("**") && map.containsKey(0) &&  "**".equals(map.get(0)) ) {
                //isListHeadFlag = false;
                isTotalRowPreFlag = true;
            }


            if(isTableListFlag) {
                BudgetP2p3ItemVo p2p3ItemVo = new BudgetP2p3ItemVo();
                p2p3ItemVo.setCode1(map.getOrDefault(0, ""));
                p2p3ItemVo.setCode2(map.getOrDefault(1, ""));
                p2p3ItemVo.setCode3(map.getOrDefault(2, ""));
                p2p3ItemVo.setDeptCode(map.getOrDefault(3, ""));
                p2p3ItemVo.setItemName(map.getOrDefault(4, ""));
                p2p3ItemVo.setTotal(ReadExcelUtil.mapNumFormat(map, 5, ""));
                p2p3ItemVo.setBaseTotal(ReadExcelUtil.mapNumFormat(map, 6, ""));
                p2p3ItemVo.setProjectTotal(ReadExcelUtil.mapNumFormat(map, 7, ""));
                p2p9Vo.getList().add(p2p3ItemVo);
            }

        }

        vo.getExplainVo().setP3p9Vo(tvo);
    }

}
