Commit 721b428e authored by 周昊's avatar 周昊

1、修改pc端导出word多个危险标识报错问题

parent 73fef44f
......@@ -3,6 +3,9 @@ package com.censoft.censoftrongtong.domain.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
/**
* @author 周昊
* @desc ...
......@@ -41,6 +44,11 @@ public class RiskNotificationExportWordDto {
*/
private String safetyWarningSigns;
/**
* 安全警示标志list
*/
private List<HashMap<String,String>> safetyWarningSignsList;
/**
* 应采取的管理措施
*/
......
......@@ -30,10 +30,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -239,7 +236,15 @@ public class RiskPlanInherentListServiceImpl
public RiskNotificationExportWordDto getRiskNotificationExportWordDto(Long inherentId) {
RiskNotificationExportWordDto dto = riskPlanInherentListMapper.getRiskNotificationExportWordDto(inherentId);
if (StrUtil.isNotBlank(dto.getSafetyWarningSigns())){
dto.setSafetyWarningSigns(WordUtil.getImageStr("D:\\ruoyi\\uploadPath\\upload\\警告标志\\"+dto.getSafetyWarningSigns()+".png"));
List<HashMap<String, String>> safetyWarningSignsList = Arrays.stream(dto.getSafetyWarningSigns().split(","))
.map(sign ->{
HashMap<String, String> map = new HashMap<>();
map.put("url",WordUtil.getImageStr("D:\\ruoyi\\uploadPath\\upload\\警告标志\\" + sign + ".png"));
return map;
}).collect(Collectors.toList());
dto.setSafetyWarningSignsList(safetyWarningSignsList);
}else {
dto.setSafetyWarningSignsList(new ArrayList<>());
}
return dto;
}
......
......@@ -838,29 +838,32 @@
w:val="2"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00566CAE"
wsp:rsidRPr="009370A0"
wsp:rsidRDefault="000B0B97"
wsp:rsidP="009370A0">
<#if safetyWarningSignsList?? && (safetyWarningSignsList?size > 0)>
<#list safetyWarningSignsList as useritem>
<w:p wsp:rsidR="00060D20" wsp:rsidRDefault="006A2E97">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:color w:val="000000"/>
<w:kern w:val="0"/>
<w:sz w:val="16"/>
<w:sz-cs w:val="16"/>
</w:rPr>
</w:pPr>
<w:r wsp:rsidRPr="000B0B97">
<w:r wsp:rsidRPr="006A2E97">
<w:rPr>
<w:rFonts w:ascii="Helvetica" w:h-ansi="Helvetica" w:cs="Helvetica"/>
<wx:font
wx:val="Helvetica"/>
<w:noProof/>
<w:color w:val="333333"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体"/>
<wx:font wx:val="宋体"/>
<w:color w:val="000000"/>
<w:kern w:val="0"/>
<w:sz w:val="30"/>
<w:sz-cs
w:val="30"/>
<w:sz w:val="16"/>
<w:sz-cs w:val="16"/>
</w:rPr>
<w:pict>
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75"
o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
......@@ -876,20 +879,65 @@
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t"
o:connecttype="rect"/>
<o:lock v:ext="edit"
aspectratio="t"/>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype>
<w:binData w:name="wordml://03000001.png" xml:space="preserve">${safetyWarningSigns}</w:binData>
<v:shape id="图片 1" o:spid="_x0000_i1025" type="#_x0000_t75"
style="width:66.6pt;height:58.8pt;visibility:visible;mso-wrap-style:square">
<v:imagedata src="wordml://03000001.png" o:title="" cropleft="2313f"
cropright="1808f"/>
<w:binData w:name="wordml://${useritem_index+1!''}.png"
xml:space="preserve">${useritem.url!''}</w:binData>
<v:shape id="_x0000_i1036" type="#_x0000_t75" style="width:64pt;height:77pt">
<v:imagedata src="wordml://${useritem_index+1!''}.png" o:title="20220114094601"/>
</v:shape>
</w:pict>
</w:r>
</w:p>
</#list>
<#else>
<w:p wsp:rsidR="00060D20" wsp:rsidRDefault="006A2E97">
<w:pPr>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:color w:val="000000"/>
<w:kern w:val="0"/>
<w:sz w:val="16"/>
<w:sz-cs w:val="16"/>
</w:rPr>
</w:pPr>
<w:r wsp:rsidRPr="006A2E97">
<w:rPr>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体"/>
<wx:font wx:val="宋体"/>
<w:color w:val="000000"/>
<w:kern w:val="0"/>
<w:sz w:val="16"/>
<w:sz-cs w:val="16"/>
</w:rPr>
<w:pict>
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype>
</w:pict>
</w:r>
</w:p>
</#if>
</w:tc>
<w:tc>
<w:tcPr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment