package cn.palmte.work.utils.excel;

import cn.palmte.work.bean.*;
import cn.palmte.work.utils.Utils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import javax.servlet.ServletOutputStream;

public class ExportFinalExcelUtils {

    public void exportFinalExcel(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, int rowIndex, String sheetName, ServletOutputStream outputStream, String otherName, XSSFWorkbook workbook, CellStyle style, CellStyle style2) {
        // 遍历集合数据，产生数据行
        int index = rowIndex;
        XSSFSheet sheet = workbook.createSheet(sheetName);
        sheet.setDefaultColumnWidth((short)20);
        Font font3 = workbook.createFont();
        font3.setColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex());
        // 收入
        Row incomeRow = sheet.createRow(index++);
        createTitleRow(incomeRow, "收入", style);
        index = createIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index, style, style2);
        index = index + 3;
        // 成本
        Row costRow = sheet.createRow(index++);
        createTitleRow(costRow, "成本", style);
        index = createCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index, otherName, style, style2);
        index = index + 3;
        // 管理
        Row manageRow = sheet.createRow(index++);
        createTitleRow(manageRow, "管理", style);
        index = createManageRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index, style, style2);
        index = index + 3;
        // 利润率计算
        Row profitRow = sheet.createRow(index++);
        createTitleRow(profitRow, "利润率计算", style);
        index = createProfitRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index, style, style2);
        index = index + 3;
        // 现金流量表
        Row cashFLowRow = sheet.createRow(index++);
        createTitleRow(cashFLowRow, "现金流量表", style);
        createCashFlowRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index, style, style2);
    }


    private void createTitleRow(Row row, String titleName, CellStyle style) {
        Cell cell = row.createCell(0);
        cell.setCellStyle(style);
        cell.setCellType(CellType.STRING);
        cell.setCellValue(titleName);
    }

    private int createIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style, CellStyle style2) {
        createSubTitleIncomeRow(sheet, index++, style);
        createDeviceIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createEngineerIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createServiceIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createTotalIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        return index;
    }

    private void createSubTitleIncomeRow(XSSFSheet sheet, int index, CellStyle style) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("类别");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("费用");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("预算总额(元)");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style);
        fourthCell.setCellType(CellType.STRING);
        fourthCell.setCellValue("结算总额(元)");
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style);
        fifthCell.setCellType(CellType.STRING);
        fifthCell.setCellValue("决算总额(元)");
    }

    private void createDeviceIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("收入");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("设备类");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getIncomeDeviceTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getIncomeDeviceTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getIncomeDeviceFinalTotal()));
    }

    private void createEngineerIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("收入");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("工程类");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getIncomeEngineerTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getIncomeEngineerTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getIncomeEngineerFinalTotal()));
    }

    private void createServiceIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("收入");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("服务类");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getIncomeServiceTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getIncomeServiceTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getIncomeServiceFinalTotal()));
    }

    private void createTotalIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("合计");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getIncomeTotalTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getIncomeTotalTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getIncomeTotal()));
    }

    private int createCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, String otherName, CellStyle style, CellStyle style2) {
        createSubTitleCostRow(sheet, index++, style);
        createDeviceCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createEngineerCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createServiceCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createOtherCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createManageCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createOtherRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, otherName, style2);
        createTotalCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        return index;
    }

    private void createSubTitleCostRow(XSSFSheet sheet, int index, CellStyle style) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("类别");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("费用");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("费用项目");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style);
        fourthCell.setCellType(CellType.STRING);
        fourthCell.setCellValue("预算总额(元)");
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style);
        fifthCell.setCellType(CellType.STRING);
        fifthCell.setCellValue("结算总额(元)");
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style);
        sixthCell.setCellType(CellType.STRING);
        sixthCell.setCellValue("决算总额(元)");
    }

    private void createDeviceCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("采购成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("设备");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostPurchaseDeviceTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostPurchaseDeviceTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostPurchaseDeviceFinalTotal()));
    }

    private void createEngineerCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("采购成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("施工");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostPurchaseBuildTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostPurchaseBuildTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostPurchaseBuildFinalTotal()));
    }

    private void createServiceCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("采购成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("服务");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostPurchaseServiceTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostPurchaseServiceTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostPurchaseServiceFinalTotal()));
    }

    private void createOtherCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("采购成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("其他");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostPurchaseOtherTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostPurchaseOtherTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostPurchaseOtherFinalTotal()));
    }

    private void createManageCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("项目管理成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("项目管理成本");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostProjectManageTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostProjectManageFinalTotal()));
    }

    private void createOtherRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, String otherName, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("成本");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("其他");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue(otherName);
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostOtherOtherTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostOtherOtherTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostOtherFinalTotal()));
    }

    private void createTotalCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("合计");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(budgetBean.getCostTotalTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(settleBean.getCostTotalTaxExclude()));
        Cell sixthCell = row.createCell(5);
        sixthCell.setCellStyle(style2);
        sixthCell.setCellType(CellType.NUMERIC);
        sixthCell.setCellValue(Utils.format(finalBean.getCostTotal()));
    }

    private int createManageRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style, CellStyle style2) {
        createSubTitleManageRow(sheet, index++, style);
        createExpropriationRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createCompanyManageRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createCostIncomeTaxRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        return index;
    }

    private void createSubTitleManageRow(XSSFSheet sheet, int index, CellStyle style) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("类别");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("费用项目");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("预算总额(元)");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style);
        fourthCell.setCellType(CellType.STRING);
        fourthCell.setCellValue("结算总额(元)");
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style);
        fifthCell.setCellType(CellType.STRING);
        fifthCell.setCellValue("决算总额(元)");
    }

    private void createExpropriationRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("财务费用");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("资金占用成本");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getCostExpropriationTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getCostExpropriationTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getCostExpropriationFinalTotal()));
    }

    private void createCompanyManageRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("公司管理费用");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(budgetBean.getCostCompanyManageTaxExclude()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getCostCompanyManageTaxExclude()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getCostCompanyManageFinalTotal()));
    }

    private void createCostIncomeTaxRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("所得税费用");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("/");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(settleBean.getCostIncomeTax()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getCostIncomeTaxFinalTotal()));
    }

    private int createProfitRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style, CellStyle style2) {
        createSubTitleProfitRow(sheet, index++, style);
        createGrossProfitRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
//        createGrossProfitMarginRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createContributionProfitRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
//        createContributionProfitRateRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createNetProfitRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        return index;
    }

    private void createSubTitleProfitRow(XSSFSheet sheet, int index, CellStyle style) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("类别");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("预算总额(元)");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("结算总额(元)");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style);
        fourthCell.setCellType(CellType.STRING);
        fourthCell.setCellValue("决算总额(元)");
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style);
        fifthCell.setCellType(CellType.STRING);
        fifthCell.setCellValue("利润率(%)");
    }

    private void createGrossProfitRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("项目毛利");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(budgetBean.getProjectGrossProfit()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getProjectGrossProfit()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getGrossProfitFinalTotal()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getGrossProfitProfitMargin()));
    }

    private void createContributionProfitRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("项目贡献利润");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(budgetBean.getProjectContributionProfit()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getProjectContributionProfit()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getContributionMarginFinalTotal()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getContributionMarginProfitMargin()));
    }

    private void createNetProfitRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("项目净利润");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getNetProfit()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getNetMarginFinalTotal()));
        Cell fifthCell = row.createCell(4);
        fifthCell.setCellStyle(style2);
        fifthCell.setCellType(CellType.NUMERIC);
        fifthCell.setCellValue(Utils.format(finalBean.getNetMarginProfitMargin()));
    }


    private int createCashFlowRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style, CellStyle style2) {
        createSubTitleCashFlowRow(sheet, index++, style);
        createSaleIncomeCashRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createTaxReturnRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createEarnestMoneyIncomeRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createPurchaseCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createTaxCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createEarnestMoneyCostRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createNetCashFlowRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createCashInflowFromInvestingActivitiesRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createCashOutflowFromInvestingActivitiesRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createNetCashFromInvestingActivitiesRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createFinancingCapitalInflowRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createFinancingCapitalOutflowRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createFinancingCapitalCashflowRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        createNetIncreaseMonetaryFundsRow(budgetBean, cashFlowBean, settleBean, finalBean, sheet, index++, style2);
        return index;
    }

    private void createSubTitleCashFlowRow(XSSFSheet sheet, int index, CellStyle style) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("类别");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("预算总额(元)");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style);
        thirdCell.setCellType(CellType.STRING);
        thirdCell.setCellValue("结算总额(元)");
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style);
        fourthCell.setCellType(CellType.STRING);
        fourthCell.setCellValue("决算总额(元)");
    }

    private void createSaleIncomeCashRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("销售商品、提供劳务收到的现金");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getSaleIncomeCash()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getSaleIncomeCash()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getSaleIncomeCash()));
    }

    private void createTaxReturnRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("收到的税费返还");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getTaxReturn()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getTaxReturn()));
    }

    private void createEarnestMoneyIncomeRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("收到其他与经营活动有关的现金");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getEarnestMoneyIncome()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getEarnestMoneyIncome()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getEarnestMoneyIncome()));
    }

    private void createPurchaseCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("购买商品、接受劳务支付的现金");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getPurchaseCost()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getPurchaseCost()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getPurchaseCost()));
    }

    private void createTaxCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("支付的各项税费");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getTaxCost()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getTaxCost()));
    }

    private void createEarnestMoneyCostRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("支付其他与经营活动有关的现金");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getEarnestMoneyCost()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getEarnestMoneyCost()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getEarnestMoneyCost()));
    }

    private void createNetCashFlowRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("经营活动产生的现金流量净额");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getNetCashFlow()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getNetCashFlow()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getNetCashFlow()));
    }

    private void createCashInflowFromInvestingActivitiesRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("投资活动现金流入");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getCashInflowFromInvestingActivities()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getCashInflowFromInvestingActivities()));
    }

    private void createCashOutflowFromInvestingActivitiesRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("投资活动现金流出");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getCashOutflowFromInvestingActivities()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getCashOutflowFromInvestingActivities()));
    }

    private void createNetCashFromInvestingActivitiesRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("投资活动产生的现金流量净额");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.STRING);
        secondCell.setCellValue("/");
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getNetCashFromInvestingActivities()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getNetCashFromInvestingActivities()));
    }

    private void createFinancingCapitalInflowRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("融资资金流入");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getFinancingCapitalInflow()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getFinancingCapitalInflow()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getFinancingCapitalInflow()));
    }

    private void createFinancingCapitalOutflowRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("还款资金流出");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getFinancingCapitalOutflow()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getFinancingCapitalOutflow()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getFinancingCapitalOutflow()));
    }

    private void createFinancingCapitalCashflowRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("筹资活动产生的现金流量净额");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getFinancingCapitalCashflow()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getFinancingCapitalCashflow()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getFinancingCapitalCashflow()));
    }

    private void createNetIncreaseMonetaryFundsRow(BudgetBean budgetBean, CashFlowBean cashFlowBean, FormerBean settleBean, FinalBean finalBean, XSSFSheet sheet, int index, CellStyle style2) {
        Row row = sheet.createRow(index);
        Cell firstCell = row.createCell(0);
        firstCell.setCellStyle(style2);
        firstCell.setCellType(CellType.STRING);
        firstCell.setCellValue("货币资金净增加额");
        Cell secondCell = row.createCell(1);
        secondCell.setCellStyle(style2);
        secondCell.setCellType(CellType.NUMERIC);
        secondCell.setCellValue(Utils.format(cashFlowBean.getNetIncreaseMonetaryFunds()));
        Cell thirdCell = row.createCell(2);
        thirdCell.setCellStyle(style2);
        thirdCell.setCellType(CellType.NUMERIC);
        thirdCell.setCellValue(Utils.format(settleBean.getNetIncreaseMonetaryFunds()));
        Cell fourthCell = row.createCell(3);
        fourthCell.setCellStyle(style2);
        fourthCell.setCellType(CellType.NUMERIC);
        fourthCell.setCellValue(Utils.format(finalBean.getNetIncreaseMonetaryFunds()));
    }
}
