Commit 8a390378 authored by 周昊's avatar 周昊
Browse files

1、开发pc端导出项目风险清单表excel文件接口

parent 09164130
Loading
Loading
Loading
Loading
+46 −46
Original line number Diff line number Diff line
package com.censoft.censoftrongtong.controller;

import cn.hutool.core.util.StrUtil;
import com.censoft.censoftrongtong.domain.*;
import com.censoft.censoftrongtong.domain.dto.*;
import com.censoft.censoftrongtong.enums.RiskPlanStatusType;
@@ -16,12 +15,13 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysUploadFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
+15 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;

import cn.hutool.core.convert.Convert;
import com.censoft.censoftrongtong.domain.RiskPlan;
import com.censoft.censoftrongtong.domain.dto.RiskInherentListExportDto;
import com.censoft.censoftrongtong.domain.dto.RiskNotificationExportWordDto;
import com.censoft.censoftrongtong.service.IRiskPlanInherentListService;
import com.censoft.censoftrongtong.service.IRiskPlanService;
@@ -128,4 +129,18 @@ public class RiskPlanController extends BaseController
        WordUtil word = new WordUtil();
        word.exportWord(request, response,dataMap,"风险告知卡");
    }


    /**
     * 导出项目风险清单表
     */
    @GetMapping("/exportExcel/InherentList/{inherentId}")
    public void export(@PathVariable Long inherentId, HttpServletResponse response) {
        try {
            List<RiskInherentListExportDto> dtos = riskPlanInherentListService.getPlanInherentListByPlanId(inherentId);
            riskPlanInherentListService.exportPlanInherentList(response,dtos);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
+123 −0
Original line number Diff line number Diff line
package com.censoft.censoftrongtong.domain.dto;

import lombok.Data;

/**
 * 固有风险清单库对象 risk_inherent_list
 *
 * @author ruoyi
 * @date 2023-06-26
 */
@Data
public class RiskInherentListExportDto {

    /**
     * 项目信息-区域公司
     */
    private String deptName;

    /**
     * 项目名称
     */
    private String projectName;

    /**
     * 所属城市
     */
    private String city;

    /**
     * 项目业态
     */
    private String businessFormat;

    /**
     * 项目类型
     */
    private String type;

    /**
     * 项目风险清单-固有风险风险清单
     */
    private String inherentName;

    /**
     * 固有风险风险等级
     */
    private String inherentLevel;

    /**
     * 现有风险风险清单
     */
    private String existingName;

    /**
     * 现有风险风险等级
     */
    private String existingLevel;

    /**
     * 风险点位置
     */
    private String presenceLocation;

    /**
     * 可能导致的事故后果
     */
    private String listType;

    /**
     * 项目整体风险等级-固有风险
     */
    private String inherentProjectLevel;

    /**
     * 现有风险
     */
    private String existingProjectLevel;

    /**
     * 风险管控-应采取的管控措施
     */
    private String inherentMeasuresAdministration;

    /**
     * 已采取的管控措施
     */
    private String existingMeasuresAdministration;

    /**
     * 管控责任单位
     */
    private String measuresDeptName;

    /**
     * 管控责任人
     */
    private String measuresUserName;

    /**
     * 人员联系方式
     */
    private String measuresUserPhone;

    /**
     * 重大危险源管理-重大危险源名称
     */
    private String hazardSourceName;

    /**
     * 是否存在重大危险源
     */
    private String majorHazardSource;

    /**
     * 重大危险源描述
     */
    private String majorHazardDescription;

    /**
     * 判定依据
     */
    private String referenceBasis;
}
+3 −4
Original line number Diff line number Diff line
@@ -2,10 +2,7 @@ package com.censoft.censoftrongtong.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.RiskNotificationExportWordDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppExistingListDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDetailsDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDto;
import com.censoft.censoftrongtong.domain.dto.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@@ -75,4 +72,6 @@ public interface RiskPlanInherentListMapper extends BaseMapper<RiskPlanInherentL
    List<RiskPlanAppExistingListDto> getExistingListByInherentId(@Param("inherentId") Long inherentId);

    RiskNotificationExportWordDto getRiskNotificationExportWordDto(@Param("inherentId") Long inherentId);

    List<RiskInherentListExportDto> getPlanInherentListByPlanId(@Param("planId") Long planId);
}
+7 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
@@ -72,4 +75,8 @@ public interface IRiskPlanInherentListService extends IService<RiskPlanInherentL
    List<RiskPlanAppExistingListDto> getExistingListByInherentId(Long inherentId);

    RiskNotificationExportWordDto getRiskNotificationExportWordDto(Long inherentId);

    void exportPlanInherentList(HttpServletResponse response,List<RiskInherentListExportDto> dtos) throws IOException;

    List<RiskInherentListExportDto> getPlanInherentListByPlanId(Long planId);
}
Loading