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.ticket.domain.TTicketId;
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.TPermitWorkHigh;
import com.ruoyi.project.ticket.service.ITPermitWorkHighService;
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;

/**
 * 高处工作票Controller
 *
 * @author ruoyi
 * @date 2023-05-11
 */
@RestController
@RequestMapping("/ticket/high")
public class TPermitWorkHighController extends BaseController {
    @Autowired
    private ITPermitWorkHighService tPermitWorkHighService;
    @Autowired
    private TTicketIdController tTicketIdController;
    @Autowired
    private WordController wordController;

    /**
     * 查询高处工作票列表
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:list')")
    @GetMapping("/list")
    public TableDataInfo list(TPermitWorkHigh tPermitWorkHigh) {
        startPage();
        List<TPermitWorkHigh> list = tPermitWorkHighService.selectTPermitWorkHighList(tPermitWorkHigh);
        return getDataTable(list);
    }

    /**
     * 导出高处工作票列表
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:export')")
    @Log(title = "高处工作票", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TPermitWorkHigh tPermitWorkHigh) {
        List<TPermitWorkHigh> list = tPermitWorkHighService.selectTPermitWorkHighList(tPermitWorkHigh);
        ExcelUtil<TPermitWorkHigh> util = new ExcelUtil<TPermitWorkHigh>(TPermitWorkHigh.class);
        return util.exportExcel(list, "high");
    }

    /**
     * 获取高处工作票详细信息
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:query')")
    @GetMapping(value = "/{whId}")
    public AjaxResult getInfo(@PathVariable("whId") Long whId) {
        return AjaxResult.success(tPermitWorkHighService.selectTPermitWorkHighById(whId));
    }

    /**
     * 新增高处工作票
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:add')")
    @Log(title = "高处工作票", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TPermitWorkHigh tPermitWorkHigh) {
        TTicketId tTicketId = new TTicketId();
        tTicketId.setId(1l);
        Long ticketId = tTicketIdController.createId(tTicketId);
        logger.info("ticketId:" + ticketId);
        tPermitWorkHigh.setWhId(ticketId);
        try {
            //生成word
            //渲染文本
            Map<String, Object> params = getWordData(tPermitWorkHigh);
            // 模板路径
            String templatePath = "static/word/highTicket.docx";
            // 生成word的路径
            String fileDir = RuoYiConfig.getProfile() + "/" + "ticketWord";
            // 生成word的文件
            String fileName = "WH" + ticketId + ".docx";
            String wordPath = this.wordController.createWord(templatePath, fileDir, fileName, params);
            tPermitWorkHigh.setWordUrl(wordPath);
            //使用流的方式转换PDF
            String fileName2 = "WH" + ticketId + ".pdf";
            String pdfPath = this.wordController.createPDF(fileDir, fileName, fileName2, params);
            tPermitWorkHigh.setPdfUrl(pdfPath);
        } catch (IOException e) {
            logger.error("生成文件失败");
        }
        tPermitWorkHighService.insertTPermitWorkHigh(tPermitWorkHigh);
        return AjaxResult.success(tPermitWorkHigh);
    }

    /**
     * 修改高处工作票
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:edit')")
    @Log(title = "高处工作票", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TPermitWorkHigh tPermitWorkHigh) {
        try {
            //生成word
            //渲染文本
            Map<String, Object> params = getWordData(tPermitWorkHigh);
            // 模板路径
            String templatePath = "static/word/highTicket.docx";
            // 生成word的路径
            String fileDir = RuoYiConfig.getProfile() + "/" + "ticketWord";
            // 生成word的文件
            String fileName = "H" + tPermitWorkHigh.getWhId() + ".docx";
            String wordPath = this.wordController.createWord(templatePath, fileDir, fileName, params);
            tPermitWorkHigh.setWordUrl(wordPath);
            //使用流的方式转换PDF
            String fileName2 = "H" + tPermitWorkHigh.getWhId() + ".pdf";
            String pdfPath = this.wordController.createPDF(fileDir, fileName, fileName2, params);
            tPermitWorkHigh.setPdfUrl(pdfPath);
        } catch (IOException e) {
            logger.error("生成文件失败");
        }
        return toAjax(tPermitWorkHighService.updateTPermitWorkHigh(tPermitWorkHigh));
    }

    /**
     * 删除高处工作票
     */
    @PreAuthorize("@ss.hasPermi('ticket:high:remove')")
    @Log(title = "高处工作票", businessType = BusinessType.DELETE)
    @DeleteMapping("/{whIds}")
    public AjaxResult remove(@PathVariable Long[] whIds) {
        return toAjax(tPermitWorkHighService.deleteTPermitWorkHighByIds(whIds));
    }

    public Map<String, Object> getWordData(TPermitWorkHigh tPermitWorkHigh) {
        Map<String, Object> params = new HashMap<>();
        //region 渲染文本
        params.put("whId", Texts.of(tPermitWorkHigh.getWhId().toString()).fontSize(7).bold().create());
        params.put("aEquipmentName", Texts.of(tPermitWorkHigh.getaEquipmentName()).fontSize(7).bold().create());
        params.put("aEquipmentLeader", Texts.of(tPermitWorkHigh.getaEquipmentLeader()).fontSize(7).bold().create());
        params.put("aEquipmentTel", Texts.of(tPermitWorkHigh.getaEquipmentTel()).fontSize(7).bold().create());
        params.put("aEquipmentOffice", Texts.of(tPermitWorkHigh.getaEquipmentOffice()).fontSize(7).bold().create());
        params.put("aConstructionName", Texts.of(tPermitWorkHigh.getaConstructionName()).fontSize(7).bold().create());
        params.put("aConstructionLeader", Texts.of(tPermitWorkHigh.getaConstructionLeader()).fontSize(7).bold().create());
        params.put("aConstructionTel", Texts.of(tPermitWorkHigh.getaConstructionTel()).fontSize(7).bold().create());
        params.put("aConstructionOffice", Texts.of(tPermitWorkHigh.getaConstructionOffice()).fontSize(7).bold().create());
        params.put("aContractorName", Texts.of(tPermitWorkHigh.getaContractorName()).fontSize(7).bold().create());
        params.put("aContractorLeader", Texts.of(tPermitWorkHigh.getaContractorLeader()).fontSize(7).bold().create());
        params.put("aContractorTel", Texts.of(tPermitWorkHigh.getaContractorTel()).fontSize(7).bold().create());
        params.put("aContractorOffice", Texts.of(tPermitWorkHigh.getaContractorOffice()).fontSize(7).bold().create());
        getCheck(params, tPermitWorkHigh.getaIsNeedSafeLiaison(), "aIsNSL1", "aIsNSL2");
        params.put("aSafeLiaisonName", Texts.of(tPermitWorkHigh.getaSafeLiaisonName()).fontSize(7).bold().create());
        params.put("aSafeLiaisonSign", Texts.of(tPermitWorkHigh.getaSafeLiaisonSign()).fontSize(7).bold().create());
        params.put("aSafeLiaisonTel", Texts.of(tPermitWorkHigh.getaSafeLiaisonTel()).fontSize(7).bold().create());
        params.put("aSafeLiaisonOffice", Texts.of(tPermitWorkHigh.getaSafeLiaisonOffice()).fontSize(7).bold().create());
        // B 栏
        params.put("bDeviceName", Texts.of(tPermitWorkHigh.getbDeviceName()).fontSize(7).bold().create());
        params.put("bAreaNo", Texts.of(tPermitWorkHigh.getbAreaNo()).fontSize(7).bold().create());
        params.put("bWorkContent", Texts.of(tPermitWorkHigh.getbWorkContent()).fontSize(7).bold().create());
        getCheck(params, tPermitWorkHigh.getbHeight(), "bHeight1", "bHeight2", "bHeight3", "bHeight4");
        getCheck(params, tPermitWorkHigh.getbWorkLevel(), "bWorkLevel1", "bWorkLevel2", "bWorkLevel3", "bWorkLevel4");
        if (tPermitWorkHigh.getbValidityStartTime() != null) {
            params.put("bValidityStartTime", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分", tPermitWorkHigh.getbValidityStartTime())).fontSize(7).bold().create());
        } else {
            params.put("bValidityStartTime", Texts.of("    年    月    日    时    分").fontSize(7).bold().create());
        }
        if (tPermitWorkHigh.getbValidityEndTime() != null) {
            params.put("bValidityEndTime", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分", tPermitWorkHigh.getbValidityEndTime())).fontSize(7).bold().create());
        } else {
            params.put("bValidityEndTime", Texts.of("    年    月    日    时    分").fontSize(7).bold().create());
        }

        // C栏
        getCheck(params, tPermitWorkHigh.getcHarmMatterName() == null ? null : "1", "cIYD");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsFacilityHazards()), "cIFH");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsEquipmentHazards()), "cIID");
        params.put("cHarmMatterName", Texts.of(checkParam(tPermitWorkHigh.getcHarmMatterName())).fontSize(7).bold().create());
        getCheck(params, checkParam(tPermitWorkHigh.getcIsGhs()), "cIG1", "cIG2");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsToxic()), "cIT");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsFlammable()), "cIF");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsOxidizing()), "cIO");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsExplosive()), "cIE");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsCorrosive()), "cIC");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsIrritantToxic()), "cIIT");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsHealthHazard()), "cIHH");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsCompressedGas()), "cICG");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsEnvironmentalHazard()), "cIEH");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsHighTemp()), "cIHT");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsLowTemp()), "cILT");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsPosPressure()), "cIPP");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsNegPressure()), "cINP");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsMovingParts()), "cIMP");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsHotSurfaces()), "cIHS");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsColdSurfaces()), "cICS");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsVoltages()), "cIV");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsWorkProtective()), "cIWP");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsHazardsProd()), "cIHP");
        getCheck(params, checkParam(tPermitWorkHigh.getcOtherId()), "cIOI");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsOtherDanger()), "cIOD");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsDrain()), "cIsDrain");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsFall()), "cIsFall");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsLighting()), "cIsLighting");
        getCheck(params, checkParam(tPermitWorkHigh.getcIsRay()), "cIsRay");
        params.put("cIsHazardsProdContent", Texts.of(checkParam(tPermitWorkHigh.getcIsHazardsProdContent())).fontSize(7).bold().create());
        params.put("cOtherDangerContent", Texts.of(checkParam(tPermitWorkHigh.getcOtherDangerContent())).fontSize(7).bold().create());
        params.put("cOtherId", Texts.of(checkParam(tPermitWorkHigh.getcOtherId())).fontSize(7).bold().create());

        //E栏
        getCheck(params, checkParam(tPermitWorkHigh.geteIsPresent()), "eIsPresent1", "eIsPresent2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsRequiredPpe()), "eIsRequiredPpe1", "eIsRequiredPpe2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsSafeGoggles()), "eIsSafeGoggles1", "eIsSafeGoggles2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsFaceShield()), "eIsFaceShield1", "eIsFaceShield2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsProtectGloves()), "eIsProtectGloves1", "eIsProtectGloves2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsRubberBoots()), "eIsRubberBoots1", "eIsRubberBoots2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsRubberApron()), "eIsRubberApron1", "eIsRubberApron2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsProtectSuit()), "eIsProtectSuit1", "eIsProtectSuit2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsResProtect()), "eIsResProtect1", "eIsResProtect2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsFallArrest()), "eIsFallArrest1", "eIsFallArrest2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsOtherProtect()), "eIsOtherProtect1", "eIsOtherProtect2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsContinueMonitoring()), "eIsContinueMonitoring1", "eIsContinueMonitoring2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsNaturalVen()), "eIsNaturalVen1", "eIsNaturalVen2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsMecVen()), "eIsMecVen1", "eIsMecVen2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsExxtractDust()), "eIsExxtractDust1", "eIsExxtractDust2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsAnalyzeAir()), "eIsAnalyzeAir1", "eIsAnalyzeAir2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsOtherVen()), "eIsOtherVen1", "eIsOtherVen2");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsOtherSafety()), "eIsOtherSafety1", "eIsOtherSafety1");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsToolBag()), "eIsToolBag");
        getCheck(params, checkParam(tPermitWorkHigh.geteIsSafetyRope()), "eIsSafetyRope");
        params.put("ePpeContent", Texts.of(checkParam(tPermitWorkHigh.getePpeContent())).fontSize(7).bold().create());
        params.put("eProtectSuitContent", Texts.of(checkParam(tPermitWorkHigh.geteProtectSuitContent())).fontSize(7).bold().create());
        params.put("eProtectGlovesContent", Texts.of(checkParam(tPermitWorkHigh.geteProtectGlovesContent())).fontSize(7).bold().create());
        params.put("eResProtectContent", Texts.of(checkParam(tPermitWorkHigh.geteResProtectContent())).fontSize(7).bold().create());
        params.put("eFallArrestContent", Texts.of(checkParam(tPermitWorkHigh.geteFallArrestContent())).fontSize(7).bold().create());
        params.put("eOtherProtectContent", Texts.of(checkParam(tPermitWorkHigh.geteOtherProtectContent())).fontSize(7).bold().create());
        params.put("eSafeAttendant", Texts.of(checkParam(tPermitWorkHigh.geteSafeAttendant())).fontSize(7).bold().create());
        params.put("eSafeAttendantSign", Texts.of(checkParam(tPermitWorkHigh.geteSafeAttendantSign())).fontSize(7).bold().create());
        params.put("eNaturalVenContent", Texts.of(checkParam(tPermitWorkHigh.geteNaturalVenContent())).fontSize(7).bold().create());
        params.put("eMecVenContent", Texts.of(checkParam(tPermitWorkHigh.geteMecVenContent())).fontSize(7).bold().create());
        params.put("eAnalyzeAirContent", Texts.of(checkParam(tPermitWorkHigh.geteAnalyzeAirContent())).fontSize(7).bold().create());
        params.put("eAnalyzeAirInterval", Texts.of(checkParam(tPermitWorkHigh.geteAnalyzeAirInterval())).fontSize(7).bold().create());
        params.put("ePreventContent", Texts.of(checkParam(tPermitWorkHigh.getePreventContent())).fontSize(7).bold().create());
        params.put("eOtherVenContent", Texts.of(checkParam(tPermitWorkHigh.geteOtherVenContent())).fontSize(7).bold().create());
        params.put("eOtherSafetyContent", Texts.of(checkParam(tPermitWorkHigh.geteOtherSafetyContent())).fontSize(7).bold().create());
        params.put("dBreakInclContent", Texts.of(checkParam(tPermitWorkHigh.getdBreakInclContent())).fontSize(7).bold().create());
        params.put("dEleCircuitNo", Texts.of(checkParam(tPermitWorkHigh.getdEleCircuitNo())).fontSize(7).bold().create());
        params.put("dInsTagNo", Texts.of(checkParam(tPermitWorkHigh.getdInsTagNo())).fontSize(7).bold().create());
        params.put("dLockoutUsingContent", Texts.of(checkParam(tPermitWorkHigh.getdLockoutUsingContent())).fontSize(7).bold().create());
        params.put("dIsOtherEquSafeContent", Texts.of(checkParam(tPermitWorkHigh.getdIsOtherEquSafeContent())).fontSize(7).bold().create());
        params.put("dMecSecureContent", Texts.of(checkParam(tPermitWorkHigh.getdMecSecureContent())).fontSize(7).bold().create());
        params.put("dOtherSafePlantContent", Texts.of(checkParam(tPermitWorkHigh.getdOtherSafePlantContent())).fontSize(7).bold().create());
        params.put("dCleanContent", Texts.of(checkParam(tPermitWorkHigh.getdCleanContent())).fontSize(7).bold().create());
        params.put("dFlushContent", Texts.of(checkParam(tPermitWorkHigh.getdFlushContent())).fontSize(7).bold().create());
        params.put("dOtherCleanContent", Texts.of(checkParam(tPermitWorkHigh.getdOtherCleanContent())).fontSize(7).bold().create());
        params.put("dSiteDemarcationContent", Texts.of(checkParam(tPermitWorkHigh.getdSiteDemarcationContent())).fontSize(7).bold().create());
        params.put("dAreaCoverContent", Texts.of(checkParam(tPermitWorkHigh.getdAreaCoverContent())).fontSize(7).bold().create());
        params.put("dLeakDrainContent", Texts.of(checkParam(tPermitWorkHigh.getdLeakDrainContent())).fontSize(7).bold().create());
        params.put("dOtherLightContent", Texts.of(checkParam(tPermitWorkHigh.getdOtherLightContent())).fontSize(7).bold().create());
        params.put("dEffectUnit", Texts.of(checkParam(tPermitWorkHigh.getdEffectUnit())).fontSize(7).bold().create());
        params.put("dEffectLeader", Texts.of(checkParam(tPermitWorkHigh.getdEffectLeader())).fontSize(7).bold().create());
        params.put("dEffectMeasure", Texts.of(checkParam(tPermitWorkHigh.getdEffectMeasure())).fontSize(7).bold().create());
        params.put("dOtherSafeContent", Texts.of(checkParam(tPermitWorkHigh.getdOtherSafeContent())).fontSize(7).bold().create());
        params.put("dOtherMeasureContent", Texts.of(checkParam(tPermitWorkHigh.getdOtherMeasureContent())).fontSize(7).bold().create());
        params.put("dPartakeBriefingSign", Texts.of(checkParam(tPermitWorkHigh.getdPartakeBriefingSign())).fontSize(7).bold().create());
        params.put("dPartakeBriefingDate", Texts.of(checkParam(tPermitWorkHigh.getdPartakeBriefingDate())).fontSize(7).bold().create());
        params.put("dSafeImplSign11", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign11())).fontSize(7).bold().create());
        params.put("dSafeImplDate11", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate11())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign11", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign11())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate11", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate11())).fontSize(7).bold().create());
        params.put("dSafeImplSign12", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign12())).fontSize(7).bold().create());
        params.put("dSafeImplDate12", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate12())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign12", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign12())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate12", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate12())).fontSize(7).bold().create());
        params.put("dSafeImplSign13", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign13())).fontSize(7).bold().create());
        params.put("dSafeImplDate13", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate13())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign13", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign13())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate13", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate13())).fontSize(7).bold().create());
        params.put("dSafeImplSign14", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign14())).fontSize(7).bold().create());
        params.put("dSafeImplDate14", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate14())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign14", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign14())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate14", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate14())).fontSize(7).bold().create());
        params.put("dSafeImplSign21", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign21())).fontSize(7).bold().create());
        params.put("dSafeImplDate21", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate21())).fontSize(7).bold().create());
        params.put("dSafeImplSign22", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign22())).fontSize(7).bold().create());
        params.put("dSafeImplDate22", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate22())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign22", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign22())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate22", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate22())).fontSize(7).bold().create());
        params.put("dSafeImplSign23", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign23())).fontSize(7).bold().create());
        params.put("dSafeImplDate23", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate23())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign23", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign23())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate23", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate23())).fontSize(7).bold().create());
        params.put("dSafeImplSign24", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign24())).fontSize(7).bold().create());
        params.put("dSafeImplDate24", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate24())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign24", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign24())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate24", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate24())).fontSize(7).bold().create());
        params.put("dSafeImplSign25", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign25())).fontSize(7).bold().create());
        params.put("dSafeImplDate25", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate25())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign25", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign25())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate25", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate25())).fontSize(7).bold().create());
        params.put("dSafeImplSign26", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign26())).fontSize(7).bold().create());
        params.put("dSafeImplDate26", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate26())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign26", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign26())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate26", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate26())).fontSize(7).bold().create());
        params.put("dSafeImplSign27", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign27())).fontSize(7).bold().create());
        params.put("dSafeImplDate27", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate27())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign27", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign27())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate27", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate27())).fontSize(7).bold().create());
        params.put("dSafeImplSign28", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign28())).fontSize(7).bold().create());
        params.put("dSafeImplDate28", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate28())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign28", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign28())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate28", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate28())).fontSize(7).bold().create());
        params.put("dSafeImplSign29", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign29())).fontSize(7).bold().create());
        params.put("dSafeImplDate29", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate29())).fontSize(7).bold().create());
        params.put("dSafeImplSign210", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign210())).fontSize(7).bold().create());
        params.put("dSafeImplDate210", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate210())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign210", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign210())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate210", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate210())).fontSize(7).bold().create());
        params.put("dSafeImplSign31", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign31())).fontSize(7).bold().create());
        params.put("dSafeImplDate31", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate31())).fontSize(7).bold().create());
        params.put("dSafeImplSign32", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign32())).fontSize(7).bold().create());
        params.put("dSafeImplDate32", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate32())).fontSize(7).bold().create());
        params.put("dSafeImplSign33", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign33())).fontSize(7).bold().create());
        params.put("dSafeImplDate33", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate33())).fontSize(7).bold().create());
        params.put("dSafeImplSign34", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign34())).fontSize(7).bold().create());
        params.put("dSafeImplDate34", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate34())).fontSize(7).bold().create());
        params.put("dSafeImplSign41", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign41())).fontSize(7).bold().create());
        params.put("dSafeImplDate41", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate41())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign41", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign41())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate41", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate41())).fontSize(7).bold().create());
        params.put("dSafeImplSign42", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign42())).fontSize(7).bold().create());
        params.put("dSafeImplDate42", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate42())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign42", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign42())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate42", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate42())).fontSize(7).bold().create());
        params.put("dSafeImplSign43", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign43())).fontSize(7).bold().create());
        params.put("dSafeImplDate43", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate43())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign43", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign43())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate43", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate43())).fontSize(7).bold().create());
        params.put("dSafeImplSign44", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign44())).fontSize(7).bold().create());
        params.put("dSafeImplDate44", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate44())).fontSize(7).bold().create());
        params.put("dSafeImplSign45", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign45())).fontSize(7).bold().create());
        params.put("dSafeImplDate45", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate45())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign45", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign45())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate45", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate45())).fontSize(7).bold().create());
        params.put("dSafeImplSign46", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign46())).fontSize(7).bold().create());
        params.put("dSafeImplDate46", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate46())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign46", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign46())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate46", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate46())).fontSize(7).bold().create());
        params.put("dSafeImplSign47", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign47())).fontSize(7).bold().create());
        params.put("dSafeImplDate47", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate47())).fontSize(7).bold().create());
        params.put("dSafeLiftedSign47", Texts.of(checkParam(tPermitWorkHigh.getdSafeLiftedSign47())).fontSize(7).bold().create());
        params.put("dSafeLiftedDate47", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeLiftedDate47())).fontSize(7).bold().create());
        params.put("dSafeImplSign51", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign51())).fontSize(7).bold().create());
        params.put("dSafeImplDate51", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate51())).fontSize(7).bold().create());
        params.put("dSafeImplSign52", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign52())).fontSize(7).bold().create());
        params.put("dSafeImplDate52", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate52())).fontSize(7).bold().create());
        params.put("dSafeImplSign53", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign53())).fontSize(7).bold().create());
        params.put("dSafeImplDate53", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate53())).fontSize(7).bold().create());
        params.put("dSafeImplSign54", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign54())).fontSize(7).bold().create());
        params.put("dSafeImplDate54", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate54())).fontSize(7).bold().create());
        params.put("dSafeImplSign55", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign55())).fontSize(7).bold().create());
        params.put("dSafeImplDate55", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate55())).fontSize(7).bold().create());
        params.put("dSafeImplSign56", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign56())).fontSize(7).bold().create());
        params.put("dSafeImplDate56", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate56())).fontSize(7).bold().create());
        params.put("dSafeImplSign57", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign57())).fontSize(7).bold().create());
        params.put("dSafeImplDate57", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate57())).fontSize(7).bold().create());
        params.put("dSafeImplSign58", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign58())).fontSize(7).bold().create());
        params.put("dSafeImplDate58", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate58())).fontSize(7).bold().create());
        params.put("dSafeImplSign59", Texts.of(checkParam(tPermitWorkHigh.getdSafeImplSign59())).fontSize(7).bold().create());
        params.put("dSafeImplDate59", Texts.of(DateUtils.parseDateToStr("yyyy-MM-dd",tPermitWorkHigh.getdSafeImplDate59())).fontSize(7).bold().create());
        params.put("fAfterWorkSafeContent", Texts.of(checkParam(tPermitWorkHigh.getfAfterWorkSafeContent())).fontSize(7).bold().create());
        params.put("gFirstSign", Texts.of(checkParam(tPermitWorkHigh.getgFirstSign())).fontSize(7).bold().create());
        params.put("gFirstDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getgFirstDate())).fontSize(7).bold().create());
        params.put("gSecondSign", Texts.of(checkParam(tPermitWorkHigh.getgSecondSign())).fontSize(7).bold().create());
        params.put("gSecondDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getgSecondDate())).fontSize(7).bold().create());
        params.put("gThirdSign", Texts.of(checkParam(tPermitWorkHigh.getgThirdSign())).fontSize(7).bold().create());
        params.put("gThirdDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getgThirdDate())).fontSize(7).bold().create());
        params.put("gSpecialAssessment", Texts.of(checkParam(tPermitWorkHigh.getgSpecialAssessment())).fontSize(7).bold().create());
        params.put("hSafeMesSign", Texts.of(checkParam(tPermitWorkHigh.gethSafeMesSign())).fontSize(7).bold().create());
        params.put("hSafeMesDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.gethSafeMesDate())).fontSize(7).bold().create());
        params.put("hSafeMesA4Sign", Texts.of(checkParam(tPermitWorkHigh.gethSafeMesA4Sign())).fontSize(7).bold().create());
        params.put("hSafeMesA4Date", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.gethSafeMesA4Date())).fontSize(7).bold().create());
        params.put("iOneASign", Texts.of(checkParam(tPermitWorkHigh.getiOneASign())).fontSize(7).bold().create());
        params.put("iOneADate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getiOneADate())).fontSize(7).bold().create());
        params.put("iOneBSign", Texts.of(checkParam(tPermitWorkHigh.getiOneBSign())).fontSize(7).bold().create());
        params.put("iOneBDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getiOneBDate())).fontSize(7).bold().create());
        params.put("jOneBSign", Texts.of(checkParam(tPermitWorkHigh.getjOneBSign())).fontSize(7).bold().create());
        params.put("jOneBDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getjOneBDate())).fontSize(7).bold().create());
        params.put("jResMemberSign", Texts.of(checkParam(tPermitWorkHigh.getjResMemberSign())).fontSize(7).bold().create());
        params.put("jResMemberDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getjResMemberDate())).fontSize(7).bold().create());
        params.put("jEISign", Texts.of(checkParam(tPermitWorkHigh.getjEISign())).fontSize(7).bold().create());
        params.put("jEIDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getjEIDate())).fontSize(7).bold().create());
        params.put("kConfirmSign", Texts.of(checkParam(tPermitWorkHigh.getkConfirmSign())).fontSize(7).bold().create());
        params.put("kConfirmDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getkConfirmDate())).fontSize(7).bold().create());
        params.put("lNoticeSign", Texts.of(checkParam(tPermitWorkHigh.getlNoticeSign())).fontSize(7).bold().create());
        params.put("lNoticeDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getlNoticeDate())).fontSize(7).bold().create());
        params.put("mAssessDContent", Texts.of(checkParam(tPermitWorkHigh.getmAssessDContent())).fontSize(7).bold().create());
        params.put("mAssessDSign", Texts.of(checkParam(tPermitWorkHigh.getmAssessDSign())).fontSize(7).bold().create());
        params.put("mAssessDDate", Texts.of(DateUtils.parseDateToStr("yyyy年MM月dd日hh时mm分",tPermitWorkHigh.getmAssessDDate())).fontSize(7).bold().create());
        params.put("mOtherLicenceOne", Texts.of(checkParam(tPermitWorkHigh.getmOtherLicenceOne())).fontSize(7).bold().create());
        params.put("mOtherLicenceTwo", Texts.of(checkParam(tPermitWorkHigh.getmOtherLicenceTwo())).fontSize(7).bold().create());
        params.put("mOtherLicenceThree", Texts.of(checkParam(tPermitWorkHigh.getmOtherLicenceThree())).fontSize(7).bold().create());
        params.put("dIsolationDiagramContent", Texts.of(checkParam(tPermitWorkHigh.getdIsolationDiagramContent())).fontSize(7).bold().create());

        getCheck(params, checkParam(tPermitWorkHigh.getfIsOtherMeasure()), "fIsOtherMeasure1", "fIsOtherMeasure2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOpenSafe()), "dIsOpenSafe1", "dIsOpenSafe2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsDisFeeder()), "dIsDisFeeder1", "dIsDisFeeder2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsBreakIncl()), "dIsBreakIncl1", "dIsBreakIncl2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsRadioactiveSources()), "dIsRadioactiveSources1", "dIsRadioactiveSources2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOtherEquSafe()), "dIsOtherEquSafe1", "dIsOtherEquSafe2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsDepress()), "dIsDepress1", "dIsDepress2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsSingleBlocking()), "dIsSingleBlocking1", "dIsSingleBlocking2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsDoubleBlock()), "dIsDoubleBlock1", "dIsDoubleBlock2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsLockoutUsing()), "dIsLockoutUsing1", "dIsLockoutUsing2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsRemovePipe()), "dIsRemovePipe1", "dIsRemovePipe2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsDisPipes()), "dIsDisPipes1", "dIsDisPipes2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsInsertBlindPlage()), "dIsInsertBlindPlage1", "dIsInsertBlindPlage2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsMecSecure()), "dIsMecSecure1", "dIsMecSecure2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsIsolationDiagram()), "dIsIsolationDiagram1", "dIsIsolationDiagram2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOtherSafePlant()), "dIsOtherSafePlant1", "dIsOtherSafePlant2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsDrain()), "dIsDrain1", "dIsDrain2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsClean()), "dIsClean1", "dIsClean2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsFlush()), "dIsFlush1", "dIsFlush2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOhterClean()), "dIsOhterClean1", "dIsOhterClean2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsSiteDemarcation()), "dIsSiteDemarcation1", "dIsSiteDemarcation2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsAreaCover()), "dIsAreaCover1", "dIsAreaCover2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsCloseTrucks()), "dIsCloseTrucks1", "dIsCloseTrucks2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsLeakDrain()), "dIsLeakDrain1", "dIsLeakDrain2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOtherLight()), "dIsOtherLight1", "dIsOtherLight2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsEffect()), "dIsEffect1", "dIsEffect2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOtherSafe()), "dIsOtherSafe1", "dIsOtherSafe2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsScene()), "dIsScene1", "dIsScene2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsScaffold()), "dIsScaffold");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsProtectionNet()), "dIsProtectionNet");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsFence()), "dIsFence");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsSafetyRegulations()), "dIsSafetyRegulations1", "dIsSafetyRegulations2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsSafetyRope()), "dIsSafetyRope");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsFaller()), "dIsFaller");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsLamination()), "dIsLamination1", "dIsLamination2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsLightShed()), "dIsLightShed1", "dIsLightShed2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsSecure()), "dIsSecure1", "dIsSecure2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsPrepared()), "dIsPrepared1", "dIsPrepared2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIs30m()), "dIs30m1", "dIs30m2");
        getCheck(params, checkParam(tPermitWorkHigh.getdIsOtherMeasure()), "dIsOtherMeasure1", "dIsOtherMeasure2");
        getCheck(params, checkParam(tPermitWorkHigh.getfIsAfterWorkSafe()), "fIsAfterWorkSafe1", "fIsAfterWorkSafe2");
        getCheck(params, checkParam(tPermitWorkHigh.getgIsSpecialAssessment()), "gIsSpecialAssessment1", "gIsSpecialAssessment2");
        //endregion
        return params;
    }

    public String checkParam(Object param) {
        return param == null || param == "" ? "" : param.toString();
    }

    /**
     * 勾选框判断渲染
     *
     * @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)));
    }
}
