Commit 42ee8357 authored by 周昊's avatar 周昊
Browse files

1、修改pc端导出项目风险清单表excel列表

2、修改pc端导出风险告知卡图片
parent 7f366b42
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -132,18 +132,22 @@ public class RiskPlanController extends BaseController
        RiskNotificationExportWordDto exportWordDto = riskPlanInherentListService.getRiskNotificationExportWordDto(inherentId);
        Map<String, Object> dataMap = Convert.convert(Map.class, exportWordDto);

        WordUtil word = new WordUtil();
        word.exportWord(request, response,dataMap,"风险告知卡");
        dataMap.put("title", "风险告知卡");
        dataMap.put("path", "D:/ruoyi/uploadPath/upload/");
        // 数据填装至模板,保存文件
        String name = WordUtil.createDoc(dataMap, "word.ftl");
        // word导出
        WordUtil.responseDownloadFile(request, response, "D:/ruoyi/uploadPath/upload/", name);
    }


    /**
     * 导出项目风险清单表
     */
    @PostMapping("/exportExcel/InherentList/{inherentId}")
    public void export(@PathVariable Long inherentId, HttpServletResponse response) {
    @PostMapping("/exportExcel/InherentList/{planId}")
    public void export(@PathVariable Long planId, HttpServletResponse response) {
        try {
            List<RiskInherentListExportDto> dtos = riskPlanInherentListService.getPlanInherentListByPlanId(inherentId);
            List<RiskInherentListExportDto> dtos = riskPlanInherentListService.getPlanInherentListByPlanId(planId);
            riskPlanInherentListService.exportPlanInherentList(response,dtos);
        } catch (IOException e) {
            e.printStackTrace();
+0 −1
Original line number Diff line number Diff line
@@ -59,6 +59,5 @@ public class RiskNotificationExportWordDto {
    /**
     * 应急措施
     */
    @TableField("measures_emergency")
    private String measuresEmergency;
}
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import com.censoft.censoftrongtong.mapper.RiskPlanTaskMapper;
import com.censoft.censoftrongtong.service.IRiskPlanInherentListService;
import com.censoft.censoftrongtong.service.IRiskPlanTaskService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.WordUtil;
import com.ruoyi.system.service.ISysUploadFileService;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
@@ -29,6 +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;
@@ -235,7 +237,11 @@ public class RiskPlanInherentListServiceImpl

    @Override
    public RiskNotificationExportWordDto getRiskNotificationExportWordDto(Long inherentId) {
        return riskPlanInherentListMapper.getRiskNotificationExportWordDto(inherentId);
        RiskNotificationExportWordDto dto = riskPlanInherentListMapper.getRiskNotificationExportWordDto(inherentId);
        if (StrUtil.isNotBlank(dto.getSafetyWarningSigns())){
            dto.setSafetyWarningSigns(WordUtil.getImageStr("D:\\ruoyi\\uploadPath\\upload\\警告标志\\"+dto.getSafetyWarningSigns()+".png"));
        }
        return dto;
    }

    @Override
+4 −2
Original line number Diff line number Diff line
@@ -423,7 +423,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                LEFT JOIN risk_plan_inherent_list rpil ON rpil.room_id = lr.id
                LEFT JOIN risk_plan_existing_list rpel ON rpel.inherent_id = rpil.id
        WHERE
            rp.id = #{planId}
--             rp.id = #{planId}
            rpil.plan_id = #{planId}
            AND rpil.id IS NOT NULL
            GROUP BY rpel.id
    </select>
</mapper>
 No newline at end of file
+1034 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading