package com.ruoyi.project.ticket.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.deepoove.poi.data.TextRenderData;
import com.deepoove.poi.data.Texts;
import com.deepoove.poi.data.style.Style;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.project.common.controller.WordController;
import com.ruoyi.project.configuration.mapper.TMatterMapper;
import com.ruoyi.project.ticket.domain.PermitRelation;
import com.ruoyi.project.ticket.domain.TTicketId;
import com.ruoyi.project.ticket.service.ITPermitRelationService;
import io.jsonwebtoken.lang.Objects;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.ticket.domain.TPermitFireWork;
import com.ruoyi.project.ticket.service.ITPermitFireWorkService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

import javax.annotation.Resource;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2022-02-23
 */
@RestController
@RequestMapping("/ticket/firework")
public class TPermitFireWorkController extends BaseController {
    @Autowired
    private ITPermitFireWorkService tPermitFireWorkService;
    @Autowired
    private WordController wordController;
    @Autowired
    private ITPermitRelationService itPermitRelationService;
    @Autowired
    private TTicketIdController tTicketIdController;
    @Resource
    private TMatterMapper tMatterMapper;

    /**
     * 查询【动火作业票】列表
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:list')")
    @GetMapping("/list")
    public TableDataInfo list(TPermitFireWork tPermitFireWork) {
        startPage();
        List<TPermitFireWork> list = tPermitFireWorkService.selectTPermitFireWorkList(tPermitFireWork);
        return getDataTable(list);
    }

    /**
     * 导出【动火作业票】列表
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:export')")
    @Log(title = "【动火作业票】", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TPermitFireWork tPermitFireWork) {
        List<TPermitFireWork> list = tPermitFireWorkService.selectTPermitFireWorkList(tPermitFireWork);
        ExcelUtil<TPermitFireWork> util = new ExcelUtil<TPermitFireWork>(TPermitFireWork.class);
        return util.exportExcel(list, "permit");
    }

    /**
     * 获取【动火作业票】详细信息
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:query')")
    @GetMapping(value = "/{hId}")
    public AjaxResult getInfo(@PathVariable("hId") Long hId) {
        return AjaxResult.success(tPermitFireWorkService.selectTPermitFireWorkById(hId));
    }

    /**
     * 新增【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:add')")
    @Log(title = "【动火作业票】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TPermitFireWork tPermitFireWork) {
        TTicketId tTicketId = new TTicketId();
        tTicketId.setId(1l);
        Long ticketId = tTicketIdController.createId(tTicketId);
        logger.info("ticketId:" + ticketId);
        tPermitFireWork.sethId(ticketId);
        try {
            //生成word
            //渲染文本
            Map<String, Object> params = getWordData(tPermitFireWork);
            // 模板路径
            String templatePath = "static/word/fireTicket.docx";
            // 生成word的路径
            String fileDir = RuoYiConfig.getProfile() + "/" + "ticketWord";
            // 生成word的文件
            String fileName = "H" + ticketId + ".docx";
            String wordPath = this.wordController.createWord(templatePath, fileDir, fileName, params);
            tPermitFireWork.setWordUrl(wordPath);
            //使用流的方式转换PDF
            String fileName2 = "H" + ticketId + ".pdf";
            String pdfPath = this.wordController.createPDF(fileDir, fileName, fileName2, params);
            tPermitFireWork.setPdfUrl(pdfPath);
        } catch (IOException e) {
            logger.error("生成文件失败");
        }
        tPermitFireWorkService.insertTPermitFireWork(tPermitFireWork);
        //保存危害工作许可证关联数据
//        PermitRelation permitRelation = new PermitRelation();
//        permitRelation.setPermitId(tPermitFireWork.gethId());
//        permitRelation.setPermitType("H");
//        permitRelation.setPermitStatus(1L);
//        this.itPermitRelationService.add(permitRelation);
        return AjaxResult.success(ticketId);
    }

    /**
     * 修改【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:edit')")
    @Log(title = "【动火作业票】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TPermitFireWork tPermitFireWork) {
        try {
            //生成word
            //渲染文本
            Map<String, Object> params = getWordData(tPermitFireWork);
            // 模板路径
            String templatePath = "static/word/fireTicket.docx";
            // 生成word的路径
            String fileDir = RuoYiConfig.getProfile() + "/" + "ticketWord";
            // 生成word的文件
            String fileName = "H" + tPermitFireWork.gethId() + ".docx";
            String wordPath = this.wordController.createWord(templatePath, fileDir, fileName, params);
            tPermitFireWork.setWordUrl(wordPath);
            //使用流的方式转换PDF
            String fileName2 = "H" + tPermitFireWork.gethId() + ".pdf";
            String pdfPath = this.wordController.createPDF(fileDir, fileName, fileName2, params);
            tPermitFireWork.setPdfUrl(pdfPath);
        } catch (IOException e) {
            logger.error("生成文件失败");
        }
        return toAjax(tPermitFireWorkService.updateTPermitFireWork(tPermitFireWork));
    }

    /**
     * 删除【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('ticket:permit:remove')")
    @Log(title = "【动火作业票】", businessType = BusinessType.DELETE)
    @DeleteMapping("/{hIds}")
    public AjaxResult remove(@PathVariable Long[] hIds) {
        return toAjax(tPermitFireWorkService.deleteTPermitFireWorkByIds(hIds));
    }


    public Map<String, Object> getWordData(TPermitFireWork tPermitFireWork) {
        Map<String, Object> params = new HashMap<>();
        //region 渲染文本
        params.put("hId", Texts.of(tPermitFireWork.gethId().toString()).fontSize(7).bold().create());
        params.put("aEquipmentName", Texts.of(tPermitFireWork.getaEquipmentName()).fontSize(7).bold().create());
        params.put("aEquipmentLeader", Texts.of(tPermitFireWork.getaEquipmentLeader()).fontSize(7).bold().create());
        params.put("aEquipmentTel", Texts.of(tPermitFireWork.getaEquipmentTel()).fontSize(7).bold().create());
        params.put("aEquipmentOffice", Texts.of(tPermitFireWork.getaEquipmentOffice()).fontSize(7).bold().create());
        params.put("aConstructionName", Texts.of(tPermitFireWork.getaConstructionName()).fontSize(7).bold().create());
        params.put("aConstructionLeader", Texts.of(tPermitFireWork.getaConstructionLeader()).fontSize(7).bold().create());
        params.put("aConstructionTel", Texts.of(tPermitFireWork.getaConstructionTel()).fontSize(7).bold().create());
        params.put("aConstructionOffice", Texts.of(tPermitFireWork.getaConstructionOffice()).fontSize(7).bold().create());
        params.put("aContractorName", Texts.of(tPermitFireWork.getaContractorName()).fontSize(7).bold().create());
        params.put("aContractorLeader", Texts.of(tPermitFireWork.getaContractorLeader()).fontSize(7).bold().create());
        params.put("aContractorTel", Texts.of(tPermitFireWork.getaContractorTel()).fontSize(7).bold().create());
        params.put("aContractorOffice", Texts.of(tPermitFireWork.getaContractorOffice()).fontSize(7).bold().create());

        getCheck(params, tPermitFireWork.getaIsNeedSafeLiaison().toString(), "aIsNSL1", "aIsNSL2");
        params.put("aSafeLiaisonName", Texts.of(tPermitFireWork.getaSafeLiaisonName()).fontSize(7).bold().create());
        params.put("aSafeLiaisonSign", Texts.of(tPermitFireWork.getaSafeLiaisonSign()).fontSize(7).bold().create());
        params.put("aSafeLiaisonTel", Texts.of(tPermitFireWork.getaSafeLiaisonTel()).fontSize(7).bold().create());
        params.put("aSafeLiaisonOffice", Texts.of(tPermitFireWork.getaSafeLiaisonOffice()).fontSize(7).bold().create());
        // B 栏
        params.put("bDeviceName", Texts.of(tPermitFireWork.getbDeviceName()).fontSize(7).bold().create());
        params.put("bAreaNo", Texts.of(tPermitFireWork.getbAreaNo()).fontSize(7).bold().create());
        params.put("bWorkContent", Texts.of(tPermitFireWork.getbWorkContent()).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getbFireWorkGrade()), "bFWG1", "bFWG2", "bFWG3");
        if (tPermitFireWork.getbValidityStartTime() != null) {
            params.put("bValidityStartTime", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分", tPermitFireWork.getbValidityStartTime())).fontSize(7).bold().create());
        } else {
            params.put("bValidityStartTime", Texts.of("    年    月    日    时    分").fontSize(7).bold().create());
        }
        if (tPermitFireWork.getbValidityEndTime() != null) {
            params.put("bValidityEndTime", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分", tPermitFireWork.getbValidityEndTime())).fontSize(7).bold().create());
        } else {
            params.put("bValidityEndTime", Texts.of("    年    月    日    时    分").fontSize(7).bold().create());
        }
        // C栏
        getCheck(params, tPermitFireWork.getcHarmMatterName() == null ? null : "1", "cIYD");
        getCheck(params, checkParam(tPermitFireWork.getcIsFacilityHazards()), "cIFH");
        getCheck(params, checkParam(tPermitFireWork.getcIsEquipmentHazards()), "cIID");
        params.put("cHarmMatterName", Texts.of(checkParam(tPermitFireWork.getcHarmMatterName())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getcIsGhs()), "cIG1", "cIG2");
        getCheck(params, checkParam(tPermitFireWork.getcIsToxic()), "cIT");
        getCheck(params, checkParam(tPermitFireWork.getcIsFlammable()), "cIF");
        getCheck(params, checkParam(tPermitFireWork.getcIsOxidizing()), "cIO");
        getCheck(params, checkParam(tPermitFireWork.getcIsExplosive()), "cIE");
        getCheck(params, checkParam(tPermitFireWork.getcIsCorrosive()), "cIC");
        getCheck(params, checkParam(tPermitFireWork.getcIsIrritantToxic()), "cIIT");
        getCheck(params, checkParam(tPermitFireWork.getcIsHealthHazard()), "cIHH");
        getCheck(params, checkParam(tPermitFireWork.getcIsCompressedGas()), "cICG");
        getCheck(params, checkParam(tPermitFireWork.getcIsEnvironmentalHazard()), "cIEH");
        getCheck(params, checkParam(tPermitFireWork.getcIsHighTemp()), "cIHT");
        getCheck(params, checkParam(tPermitFireWork.getcIsLowTemp()), "cILT");
        getCheck(params, checkParam(tPermitFireWork.getcIsPosPressure()), "cIPP");
        getCheck(params, checkParam(tPermitFireWork.getcIsNegPressure()), "cINP");
        getCheck(params, checkParam(tPermitFireWork.getcIsMovingParts()), "cIMP");
        getCheck(params, checkParam(tPermitFireWork.getcIsHotSurfaces()), "cIHS");
        getCheck(params, checkParam(tPermitFireWork.getcIsColdSurfaces()), "cICS");
        getCheck(params, checkParam(tPermitFireWork.getcIsVoltages()), "cIV");
        getCheck(params, checkParam(tPermitFireWork.getcIsWorkProtective()), "cIWP");
        getCheck(params, checkParam(tPermitFireWork.getcIsDeviceToBlast()), "cIDTB");
        getCheck(params, checkParam(tPermitFireWork.getcIsHazardsProd()), "cIHP");
        params.put("cIsHazardsProdContent", Texts.of(checkParam(tPermitFireWork.getcIsHazardsProdContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getcIsWorkToFire()), "cIWTF");
        getCheck(params, checkParam(tPermitFireWork.getcIsWorkToBlast()), "cIWTB");
        getCheck(params, checkParam(tPermitFireWork.getcIsWorkToEnvir()), "cIWTE");
        getCheck(params, checkParam(tPermitFireWork.getcIsOtherFire()), "cIOF");
        getCheck(params, checkParam(tPermitFireWork.getcIsOtherId()), "cIOI");
        params.put("cOtherId", Texts.of(checkParam(tPermitFireWork.getcOtherId())).fontSize(7).bold().create());
        params.put("cOtherFireContent", Texts.of(checkParam(tPermitFireWork.getcOtherFireContent())).fontSize(7).bold().create());
        // D栏
        getCheck(params, checkParam(tPermitFireWork.getdIsDivide()), "dIsDivide1", "dIsDivide2");
        params.put("dDivideContent", Texts.of(checkParam(tPermitFireWork.getdDivideContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsSlicing()), "dIsSlicing1", "dIsSlicing2");
        params.put("dSlicingContent", Texts.of(checkParam(tPermitFireWork.getdSlicingContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsOpenSafe()), "dIsOpenSafe1", "dIsOpenSafe2");
        getCheck(params, checkParam(tPermitFireWork.getdIsBreakIncl()), "dIsBreakIncl1", "dIsBreakIncl2");
        params.put("dBreakInclContent", Texts.of(checkParam(tPermitFireWork.getdBreakInclContent())).fontSize(7).bold().create());
        params.put("dEleCircuitNo", Texts.of(checkParam(tPermitFireWork.getdEleCircuitNo())).fontSize(7).bold().create());
        params.put("dInsTagNo", Texts.of(checkParam(tPermitFireWork.getdInsTagNo())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsBreakIncl()), "dIsRadioactiveSources1", "dIsRadioactiveSources2");
        getCheck(params, checkParam(tPermitFireWork.getdIsBreakIncl()), "dIsOtherEquSafe1", "dIsOtherEquSafe2");
        params.put("dIsOtherEquSafeContent", Texts.of(checkParam(tPermitFireWork.getdIsOtherEquSafeContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsDepress()), "dIsDepress1", "dIsDepress2");
        getCheck(params, checkParam(tPermitFireWork.getdIsSingleBlocking()), "dIsSingleBlocking1", "dIsSingleBlocking2");
        getCheck(params, checkParam(tPermitFireWork.getdIsDoubleBlock()), "dIsDoubleBlock1", "dIsDoubleBlock2");
        getCheck(params, checkParam(tPermitFireWork.getdIsLockoutUsing()), "dIsLockoutUsing1", "dIsLockoutUsing2");
        params.put("dLockoutUsingContent", Texts.of(checkParam(tPermitFireWork.getdLockoutUsingContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsRemovePipe()), "dIsRemovePipe1", "dIsRemovePipe2");
        getCheck(params, checkParam(tPermitFireWork.getdIsDisPipes()), "dIsDisPipes1", "dIsDisPipes2");
        getCheck(params, checkParam(tPermitFireWork.getdIsInsertBlindPlage()), "dIsInsertBlindPlage1", "dIsInsertBlindPlage2");
        getCheck(params, checkParam(tPermitFireWork.getdIsMecSecure()), "dIsMecSecure1", "dIsMecSecure2");
        params.put("dMecSecureContent", Texts.of(checkParam(tPermitFireWork.getdMecSecureContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsClean()), "dIsClean1", "dIsClean2");
        params.put("dCleanContent", Texts.of(checkParam(tPermitFireWork.getdCleanContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsFlush()), "dIsFlush1", "dIsFlush2");
        params.put("dFlushContent", Texts.of(checkParam(tPermitFireWork.getdFlushContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsFloodWater()), "dIsFloodWater1", "dIsFloodWater2");
        getCheck(params, checkParam(tPermitFireWork.getdIsProInertGas()), "dIsProInertGas1", "dIsProInertGas2");
        params.put("dProInertGasContent", Texts.of(checkParam(tPermitFireWork.getdProInertGasContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsGasAnalysis()), "dIsGasAnalysis1", "dIsGasAnalysis2");
        params.put("dGasAnalysisContent", Texts.of(checkParam(tPermitFireWork.getdGasAnalysisContent())).fontSize(7).bold().create());
        params.put("dOtherDevSafeContent", Texts.of(checkParam(tPermitFireWork.getdOtherDevSafeContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsOtherDevSafe()), "dIsOtherDevSafe1", "dIsOtherDevSafe2");
        getCheck(params, checkParam(tPermitFireWork.getdIsSiteDemarcation()), "dIsSiteDemarcation1", "dIsSiteDemarcation2");
        params.put("dSiteDemarcationContent", Texts.of(checkParam(tPermitFireWork.getdSiteDemarcationContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsCloseTrucks()), "dIsCloseTrucks1", "dIsCloseTrucks2");
        getCheck(params, checkParam(tPermitFireWork.getdIsDistance()), "dIsDistance1", "dIsDistance2");
        params.put("dDistanceContent", Texts.of(checkParam(tPermitFireWork.getdDistanceContent())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitFireWork.getdIsCleanCover()), "dIsCleanCover1", "dIsCleanCover2");
        getCheck(params, checkParam(tPermitFireWork.getdIsLeakFlanges()), "dIsLeakFlanges1", "dIsLeakFlanges2");
        getCheck(params, checkParam(tPermitFireWork.getdIsCleanAround()), "dIsCleanAround1", "dIsCleanAround2");
        getCheck(params, checkParam(tPermitFireWork.getdIsMecVen()), "dIsMecVen");
        getCheck(params, checkParam(tPermitFireWork.getdIsNaturalVen()), "dIsNaturalVen");
        getCheck(params, checkParam(tPermitFireWork.getdIsVentilate()), "dIsVentilate1", "dIsVentilate2");
        getCheck(params, checkParam(tPermitFireWork.getdIsGasDetection()), "dIsGasDetection1", "dIsGasDetection2");
        getCheck(params, checkParam(tPermitFireWork.getdIsOtherAreaSafe()), "dIsOtherAreaSafe1", "dIsOtherAreaSafe2");
        getCheck(params, checkParam(tPermitFireWork.getdIsAlarmSystems()), "dIsAlarmSystems1", "dIsAlarmSystems2");
        getCheck(params, checkParam(tPermitFireWork.getdIsOtherMeasure()), "dIsOtherMeasure1", "dIsOtherMeasure2");
        params.put("dNaturalVenContent", Texts.of(checkParam(tPermitFireWork.getdNaturalVenContent())).fontSize(7).bold().create());
        params.put("dMecVenContent", Texts.of(checkParam(tPermitFireWork.getdMecVenContent())).fontSize(7).bold().create());
        params.put("dGasDetectionContent", Texts.of(checkParam(tPermitFireWork.getdGasDetectionContent())).fontSize(7).bold().create());
        params.put("dOtherAreaSafeContent", Texts.of(checkParam(tPermitFireWork.getdOtherAreaSafeContent())).fontSize(7).bold().create());
        params.put("dAlarmSystemsContent", Texts.of(checkParam(tPermitFireWork.getdAlarmSystemsContent())).fontSize(7).bold().create());
        params.put("dOtherMeasureContent", Texts.of(checkParam(tPermitFireWork.getdOtherMeasureContent())).fontSize(7).bold().create());
        params.put("dDangerArea61", Texts.of(checkParam(tPermitFireWork.getdDangerArea61())).fontSize(7).bold().create());
        params.put("dDangerArea62", Texts.of(checkParam(tPermitFireWork.getdDangerArea62())).fontSize(7).bold().create());
        params.put("dDangerLeader61", Texts.of(checkParam(tPermitFireWork.getdDangerLeader61())).fontSize(7).bold().create());
        params.put("dDangerLeaderDate61", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getdDangerLeaderDate61())).fontSize(7).bold().create());
        params.put("dDangerOffice61", Texts.of(checkParam(tPermitFireWork.getdDangerOffice61())).fontSize(7).bold().create());
        params.put("dDangerOfficeTel61", Texts.of(checkParam(tPermitFireWork.getdDangerOfficeTel61())).fontSize(7).bold().create());
        params.put("dDangerOtherMeasure61", Texts.of(checkParam(tPermitFireWork.getdDangerOtherMeasure61())).fontSize(7).bold().create());
        params.put("dDangerLeader62", Texts.of(checkParam(tPermitFireWork.getdDangerLeader62())).fontSize(7).bold().create());
        params.put("dDangerLeaderDate62", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getdDangerLeaderDate62())).fontSize(7).bold().create());
        params.put("dDangerOffice62", Texts.of(checkParam(tPermitFireWork.getdDangerOffice62())).fontSize(7).bold().create());
        params.put("dDangerOfficeTel62", Texts.of(checkParam(tPermitFireWork.getdDangerOfficeTel62())).fontSize(7).bold().create());
        params.put("dDangerOtherMeasure62", Texts.of(checkParam(tPermitFireWork.getdDangerOtherMeasure62())).fontSize(7).bold().create());
        params.put("dPartakeBriefingSign", Texts.of(checkParam(tPermitFireWork.getdPartakeBriefingSign())).fontSize(7).bold().create());
        params.put("dPartakeBriefingDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getdPartakeBriefingDate())).fontSize(7).bold().create());
        params.put("dSafeImplSign11", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign11())).fontSize(7).bold().create());
        params.put("dSafeImplDate11", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate11())).fontSize(7).bold().create());
        params.put("dSafeImplSign12", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign12())).fontSize(7).bold().create());
        params.put("dSafeImplDate12", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate12())).fontSize(7).bold().create());
        params.put("dSafeImplSign21", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign21())).fontSize(7).bold().create());
        params.put("dSafeImplDate21", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate21())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign21", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign21())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate21", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate21())).fontSize(7).bold().create());
        params.put("dSafeImplSign22", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign22())).fontSize(7).bold().create());
        params.put("dSafeImplDate22", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate22())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign22", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign22())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate22", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate22())).fontSize(7).bold().create());
        params.put("dSafeImplSign23", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign23())).fontSize(7).bold().create());
        params.put("dSafeImplDate23", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate23())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign23", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign23())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate23", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate23())).fontSize(7).bold().create());
        params.put("dSafeImplSign24", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign24())).fontSize(7).bold().create());
        params.put("dSafeImplDate24", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate24())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign24", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign24())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate24", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate24())).fontSize(7).bold().create());
        params.put("dSafeImplSign31", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign31())).fontSize(7).bold().create());
        params.put("dSafeImplDate31", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate31())).fontSize(7).bold().create());
        params.put("dSafeImplSign32", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign32())).fontSize(7).bold().create());
        params.put("dSafeImplDate32", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate32())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign32", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign32())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate32", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate32())).fontSize(7).bold().create());
        params.put("dSafeImplDate33", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate33())).fontSize(7).bold().create());
        params.put("dSafeImplSign33", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign33())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign33", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign33())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate33", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate33())).fontSize(7).bold().create());
        params.put("dSafeImplDate34", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate34())).fontSize(7).bold().create());
        params.put("dSafeImplSign34", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign34())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign34", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign34())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate34", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate34())).fontSize(7).bold().create());
        params.put("dSafeImplDate35", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate35())).fontSize(7).bold().create());
        params.put("dSafeImplSign35", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign35())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign35", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign35())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate35", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate35())).fontSize(7).bold().create());
        params.put("dSafeImplDate36", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate36())).fontSize(7).bold().create());
        params.put("dSafeImplSign36", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign36())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign36", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign36())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate36", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate36())).fontSize(7).bold().create());
        params.put("dSafeImplDate37", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate37())).fontSize(7).bold().create());
        params.put("dSafeImplSign37", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign37())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign37", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign37())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate37", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate37())).fontSize(7).bold().create());
        params.put("dSafeImplDate38", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate38())).fontSize(7).bold().create());
        params.put("dSafeImplSign38", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign38())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign38", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign38())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate38", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate38())).fontSize(7).bold().create());
        params.put("dSafeImplDate39", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate39())).fontSize(7).bold().create());
        params.put("dSafeImplSign39", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign39())).fontSize(7).bold().create());
        params.put("dSafeImplDate310", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate310())).fontSize(7).bold().create());
        params.put("dSafeImplSign310", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign310())).fontSize(7).bold().create());
        params.put("dSafeImplDate311", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate311())).fontSize(7).bold().create());
        params.put("dSafeImplSign311", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign311())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign311", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign311())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate311", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate311())).fontSize(7).bold().create());
        params.put("dSafeImplDate312", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate312())).fontSize(7).bold().create());
        params.put("dSafeImplSign312", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign312())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign312", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign312())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate312", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate312())).fontSize(7).bold().create());
        params.put("dSafeImplDate313", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate313())).fontSize(7).bold().create());
        params.put("dSafeImplSign313", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign313())).fontSize(7).bold().create());
        params.put("dSafeImplDate314", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate314())).fontSize(7).bold().create());
        params.put("dSafeImplSign314", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign314())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign314", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign314())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate314", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate314())).fontSize(7).bold().create());
        params.put("dSafeImplSign41", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign41())).fontSize(7).bold().create());
        params.put("dSafeImplDate41", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate41())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign41", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign41())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate41", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate41())).fontSize(7).bold().create());
        params.put("dSafeImplSign42", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign42())).fontSize(7).bold().create());
        params.put("dSafeImplDate42", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate42())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign42", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign42())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate42", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate42())).fontSize(7).bold().create());
        params.put("dSafeImplSign43", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign43())).fontSize(7).bold().create());
        params.put("dSafeImplDate43", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate43())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign44", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign44())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate44", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate44())).fontSize(7).bold().create());
        params.put("dSafeImplSign44", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign44())).fontSize(7).bold().create());
        params.put("dSafeImplDate44", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate44())).fontSize(7).bold().create());
        params.put("dSafeImplSign45", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign45())).fontSize(7).bold().create());
        params.put("dSafeImplDate45", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate45())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign45", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign45())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate45", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate45())).fontSize(7).bold().create());
        params.put("dSafeImplSign46", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign46())).fontSize(7).bold().create());
        params.put("dSafeImplDate46", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate46())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign46", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign46())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate46", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate46())).fontSize(7).bold().create());
        params.put("dSafeImplSign47", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign47())).fontSize(7).bold().create());
        params.put("dSafeImplDate47", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate47())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign47", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign47())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate47", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate47())).fontSize(7).bold().create());
        params.put("dSafeImplSign48", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign48())).fontSize(7).bold().create());
        params.put("dSafeImplDate48", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate48())).fontSize(7).bold().create());
        params.put("dSafeImplSign49", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign49())).fontSize(7).bold().create());
        params.put("dSafeImplDate49", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate49())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign49", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign49())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate49", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate49())).fontSize(7).bold().create());
        params.put("dSafeImplSign51", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign51())).fontSize(7).bold().create());
        params.put("dSafeImplDate51", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate51())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign51", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign51())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate51", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate51())).fontSize(7).bold().create());
        params.put("dSafeImplSign52", Texts.of(checkParam(tPermitFireWork.getdSafeImplSign52())).fontSize(7).bold().create());
        params.put("dSafeImplDate52", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeImplDate52())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign52", Texts.of(checkParam(tPermitFireWork.getdSafeLiftedSign52())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate52", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitFireWork.getdSafeLiftedDate52())).fontSize(7).bold().create());

        //E栏
        getCheck(params, checkParam(tPermitFireWork.geteIsPresent()), "eIsPresent1", "eIsPresent2");
        getCheck(params, checkParam(tPermitFireWork.geteIsRequiredPpe()), "eIsRequiredPpe1", "eIsRequiredPpe2");
        getCheck(params, checkParam(tPermitFireWork.geteIsSafeGoggles()), "eIsSafeGoggles");
        getCheck(params, checkParam(tPermitFireWork.geteIsFaceShield()), "eIsFaceShield");
        getCheck(params, checkParam(tPermitFireWork.geteIsOther21()), "eIsOther21");
        getCheck(params, checkParam(tPermitFireWork.geteIsRubberBoots()), "eIsRubberBoots");
        getCheck(params, checkParam(tPermitFireWork.geteIsRubberApron()), "eIsRubberApron");
        getCheck(params, checkParam(tPermitFireWork.geteIsOther23()), "eIsOther23");
        getCheck(params, checkParam(tPermitFireWork.geteIsCheckInertGasPro()), "eIsCheckInertGasPro");
        getCheck(params, checkParam(tPermitFireWork.geteIsNaturalVen()), "eIsNaturalVen");
        getCheck(params, checkParam(tPermitFireWork.geteIsMecVen()), "eIsMecVen");
        getCheck(params, checkParam(tPermitFireWork.geteIsWaterPro()), "eIsWaterPro");
        getCheck(params, checkParam(tPermitFireWork.geteIsFaceSafe()), "eIsFaceSafe1", "eIsFaceSafe2");
        getCheck(params, checkParam(tPermitFireWork.geteIsProtectGloves()), "eIsProtectGloves1", "eIsProtectGloves2");
        getCheck(params, checkParam(tPermitFireWork.geteIsFeetSafe()), "eIsFeetSafe1", "eIsFeetSafe2");
        getCheck(params, checkParam(tPermitFireWork.geteIsProtectSuit()), "eIsProtectSuit1", "eIsProtectSuit2");
        getCheck(params, checkParam(tPermitFireWork.geteIsResProtect()), "eIsResProtect1", "eIsResProtect2");
        getCheck(params, checkParam(tPermitFireWork.geteIsHearProtect()), "eIsHearProtect1", "eIsHearProtect2");
        getCheck(params, checkParam(tPermitFireWork.geteIsFallArrest()), "eIsFallArrest1", "eIsFallArrest2");
        getCheck(params, checkParam(tPermitFireWork.geteIsOtherProtect()), "eIsOtherProtect1", "eIsOtherProtect2");
        getCheck(params, checkParam(tPermitFireWork.geteIsContineCheckAir()), "eIsContineCheckAir1", "eIsContineCheckAir2");
        getCheck(params, checkParam(tPermitFireWork.geteIsKeepWet()), "eIsKeepWet1", "eIsKeepWet2");
        getCheck(params, checkParam(tPermitFireWork.geteIsKeepCheck()), "eIsKeepCheck1", "eIsKeepCheck2");
        getCheck(params, checkParam(tPermitFireWork.geteIsFireWaterPipe()), "eIsFireWaterPipe1", "eIsFireWaterPipe2");
        getCheck(params, checkParam(tPermitFireWork.geteIsProFireExt()), "eIsProFireExt1", "eIsProFireExt2");
        getCheck(params, checkParam(tPermitFireWork.geteIsCapture()), "eIsCapture1", "eIsCapture2");
        getCheck(params, checkParam(tPermitFireWork.geteIsVentilate()), "eIsVentilate1", "eIsVentilate2");
        getCheck(params, checkParam(tPermitFireWork.geteIsExxtractDust()), "eIsExxtractDust1", "eIsExxtractDust2");
        getCheck(params, checkParam(tPermitFireWork.geteIsAnalyzeAir()), "eIsAnalyzeAir1", "eIsAnalyzeAir2");
        params.put("ePpeContent", Texts.of(checkParam(tPermitFireWork.getePpeContent())).fontSize(7).bold().create());
        params.put("eOther21Content", Texts.of(checkParam(tPermitFireWork.geteOther21Content())).fontSize(7).bold().create());
        params.put("eProtectGlovesContent", Texts.of(checkParam(tPermitFireWork.geteProtectGlovesContent())).fontSize(7).bold().create());
        params.put("eIsOther23Content", Texts.of(checkParam(tPermitFireWork.geteIsOther23Content())).fontSize(7).bold().create());
        params.put("eProtectSuitContent", Texts.of(checkParam(tPermitFireWork.geteProtectSuitContent())).fontSize(7).bold().create());
        params.put("eResProtectContent", Texts.of(checkParam(tPermitFireWork.geteResProtectContent())).fontSize(7).bold().create());
        params.put("eHearProtectContent", Texts.of(checkParam(tPermitFireWork.geteHearProtectContent())).fontSize(7).bold().create());
        params.put("eFallArrestContent", Texts.of(checkParam(tPermitFireWork.geteFallArrestContent())).fontSize(7).bold().create());
        params.put("eOtherProtectContent", Texts.of(checkParam(tPermitFireWork.geteOtherProtectContent())).fontSize(7).bold().create());
        params.put("eFireExtNum", Texts.of(checkParam(tPermitFireWork.geteFireExtNum())).fontSize(7).bold().create());
        params.put("eFireExtType", Texts.of(checkParam(tPermitFireWork.geteFireExtType())).fontSize(7).bold().create());
        params.put("eLeaderUnit", Texts.of(checkParam(tPermitFireWork.geteLeaderUnit())).fontSize(7).bold().create());
        params.put("eLeaderName", Texts.of(checkParam(tPermitFireWork.geteLeaderName())).fontSize(7).bold().create());
        params.put("eMecVenContent", Texts.of(checkParam(tPermitFireWork.geteMecVenContent())).fontSize(7).bold().create());
        params.put("eNaturalVenContent", Texts.of(checkParam(tPermitFireWork.geteNaturalVenContent())).fontSize(7).bold().create());
        params.put("eAnalyzeAirContent", Texts.of(checkParam(tPermitFireWork.geteAnalyzeAirContent())).fontSize(7).bold().create());
        params.put("eAnalyzeAirInterval", Texts.of(checkParam(tPermitFireWork.geteAnalyzeAirInterval())).fontSize(7).bold().create());

        //F栏
        getCheck(params, checkParam(tPermitFireWork.getfIsFireEndCheck()), "fIsFireEndCheck1", "fIsFireEndCheck2");
        getCheck(params, checkParam(tPermitFireWork.getfIsNoticeD()), "fIsNoticeD1", "fIsNoticeD2");
        getCheck(params, checkParam(tPermitFireWork.getfIsOtherSafeMeasures()), "fIsOtherSafeMeasures1", "fIsOtherSafeMeasures2");
        params.put("fProfessional", Texts.of(checkParam(tPermitFireWork.getfProfessional())).fontSize(7).bold().create());
        params.put("fOtherSafeMeasuresContent", Texts.of(checkParam(tPermitFireWork.getfOtherSafeMeasuresContent())).fontSize(7).bold().create());

        //G栏
        getCheck(params, checkParam(tPermitFireWork.getgIsSpecialAssessment()), "gIsSpecialAssessment1", "gIsSpecialAssessment2");
        params.put("gSpecialAssessment", Texts.of(checkParam(tPermitFireWork.getgSpecialAssessment())).fontSize(7).bold().create());
        params.put("gFirstSign", Texts.of(checkParam(tPermitFireWork.getgFirstSign())).fontSize(7).bold().create());
        params.put("gFirstDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getgFirstDate())).fontSize(7).bold().create());
        params.put("gSecondSign", Texts.of(checkParam(tPermitFireWork.getgSecondSign())).fontSize(7).bold().create());
        params.put("gSecondDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getgSecondDate())).fontSize(7).bold().create());
        params.put("gThirdSign", Texts.of(checkParam(tPermitFireWork.getgThirdSign())).fontSize(7).bold().create());
        params.put("gThirdDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getgThirdDate())).fontSize(7).bold().create());

        //H栏
        params.put("hSafeMesSign", Texts.of(checkParam(tPermitFireWork.gethSafeMesSign())).fontSize(7).bold().create());
        params.put("hSafeMesDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.gethSafeMesDate())).fontSize(7).bold().create());
        params.put("hSafeMesA4Sign", Texts.of(checkParam(tPermitFireWork.gethSafeMesA4Sign())).fontSize(7).bold().create());
        params.put("hSafeMesA4Date", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.gethSafeMesA4Date())).fontSize(7).bold().create());

        //I栏
        params.put("iOneASign", Texts.of(checkParam(tPermitFireWork.getiOneASign())).fontSize(7).bold().create());
        params.put("iOneADate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getiOneADate())).fontSize(7).bold().create());
        params.put("iOneBSign", Texts.of(checkParam(tPermitFireWork.getiOneBSign())).fontSize(7).bold().create());
        params.put("iOneBDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getiOneBDate())).fontSize(7).bold().create());

        //J栏
        params.put("jOneBSign", Texts.of(checkParam(tPermitFireWork.getjOneBSign())).fontSize(7).bold().create());
        params.put("jOneBDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getjOneBDate())).fontSize(7).bold().create());
        params.put("jResMemberSign", Texts.of(checkParam(tPermitFireWork.getjResMemberSign())).fontSize(7).bold().create());
        params.put("jResMemberDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getjResMemberDate())).fontSize(7).bold().create());
        params.put("jEISign", Texts.of(checkParam(tPermitFireWork.getjEISign())).fontSize(7).bold().create());
        params.put("jEIDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getjEIDate())).fontSize(7).bold().create());

        // K栏
        params.put("kConfirmSign", Texts.of(checkParam(tPermitFireWork.getkConfirmSign())).fontSize(7).bold().create());
        params.put("kConfirmDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getkConfirmDate())).fontSize(7).bold().create());

        //L栏
        params.put("lNoticeSign", Texts.of(checkParam(tPermitFireWork.getlNoticeSign())).fontSize(7).bold().create());
        params.put("lNoticeDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getlNoticeDate())).fontSize(7).bold().create());

        //M栏
        params.put("mAssessDSign", Texts.of(checkParam(tPermitFireWork.getmAssessDSign())).fontSize(7).bold().create());
        params.put("mAssessDDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitFireWork.getmAssessDDate())).fontSize(7).bold().create());
        params.put("mAssessDContent", Texts.of(checkParam(tPermitFireWork.getmAssessDContent())).fontSize(7).bold().create());
        params.put("mOtherLicenceOne", Texts.of(checkParam(tPermitFireWork.getmOtherLicenceOne())).fontSize(7).bold().create());
        params.put("mOtherLicenceTwo", Texts.of(checkParam(tPermitFireWork.getmOtherLicenceTwo())).fontSize(7).bold().create());
        params.put("mOtherLicenceThree", Texts.of(checkParam(tPermitFireWork.getmOtherLicenceThree())).fontSize(7).bold().create());

        //endregion
        return params;
    }

    public String checkParam(Object param) {
        return param == null || param == "" ? "" : param.toString();
    }
/*
    // 勾选框判断渲染
    public void getCheck(Map<String, Object> params, String ticketWord, String check1) {
        if ("1".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
        } else if ("2".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        } else {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        }
    }

    // 勾选框判断渲染
    public void getCheck(Map<String, Object> params, String ticketWord, String check1, String check2) {
        if ("1".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        } else if ("2".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
        } else {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        }
    }

    public void getCheck(Map<String, Object> params, String ticketWord, String check1, String check2, String check3) {
        if ("1".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check3, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        } else if ("2".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
            params.put(check3, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        } else if ("3".equals(ticketWord)) {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check3, new TextRenderData("\u00FE", new Style("Wingdings", 7)));
        } else {
            params.put(check1, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check2, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            params.put(check3, new TextRenderData("\u006F", new Style("Wingdings", 7)));
        }
    }*/

    /**
     * 勾选框判断渲染
     *
     * @param params     源对象
     * @param ticketWord 字段值
     * @param check      word中要替换的字段
     */
    public void getCheck(Map<String, Object> params, String ticketWord, String... check) {
        // 没选择||值大于总选择框的数量||值==0  ->不打勾
        if (StringUtils.isEmpty(ticketWord) || Integer.parseInt(ticketWord) > check.length || Integer.parseInt(ticketWord) == 0) {
            for (String s : check) {
                params.put(s, new TextRenderData("\u006F", new Style("Wingdings", 7)));
            }
            return;
        }

        // 仅对选择的框打勾其他的不打勾
        for (int i = 0; i < check.length; i++) {
            if (i != Integer.parseInt(ticketWord) - 1)
                params.put(check[i], new TextRenderData("\u006F", new Style("Wingdings", 7)));
        }
        params.put(check[Integer.parseInt(ticketWord) - 1], new TextRenderData("\u00FE", new Style("Wingdings", 7)));
    }
}
