diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java index 15b7d4d..9b02148 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java @@ -5,10 +5,11 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.TdCheck; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.check.TdCheckReport; import com.ruoyi.system.domain.check.dto.TdCheckReportDTO; import com.ruoyi.web.controller.manager.CheckReportManager; +import com.ruoyi.web.controller.manager.SysAreaManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -36,6 +37,9 @@ public class CheckReportController extends BaseController { @Resource private CheckReportManager checkReportManager; + @Resource + private SysAreaManager sysAreaManager; + @RequiresPermissions("system:check:view") @GetMapping() public String place() { @@ -54,6 +58,22 @@ public class CheckReportController extends BaseController { return getDataTable(tdCheckReports); } + /** + * 导出检查报告管理列表 + */ + @RequiresPermissions("system:check:export") + @Log(title = "检查报告", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(TdCheckReport tdCheckReport) { + List tdCheckReports = checkReportManager.selectTdCheckReportList(tdCheckReport); + tdCheckReports.forEach(tdCheck1 -> { + tdCheck1.setFramework(sysAreaManager.getAreaName(tdCheck1.getFramework())); + tdCheck1.setArea(sysAreaManager.getAreaName(tdCheck1.getArea())); + }); + ExcelUtil util = new ExcelUtil(TdCheckReport.class); + return util.exportExcel(tdCheckReports, "检查报告管理数据"); + } /** * 新增检查报告 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java index 434821e..2a2d462 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.util.Date; + +import com.ruoyi.common.annotation.Excel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -28,46 +30,57 @@ public class TdCheckReport implements Serializable { /** * 报告人员 */ + @Excel(name = "报告人员") private String adduser; /** * 报告人单位 */ + @Excel(name = "报告人单位") private String depart; /** * 检查开始时间 */ + @Excel(name = "检查开始时间", width = 30, dateFormat = "yyyy-MM-dd") private Date checkStartTime; /** * 检查结束时间 */ + @Excel(name = "检查结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date checkEndTime; /** * 检查类型(0.自检 1.保密局检查) */ + @Excel(name = "检查类型", readConverterExp = "0=自检,1=保密局检查") private String checkType; - /** - * 地区 - */ - private String area; /** * 市州 */ + @Excel(name = "所属市州") private String framework; + /** + * 地区 + */ + @Excel(name = "所属区县") + private String area; + + /** * 检查状态(0:通过1:未通过2:待检查) */ + @Excel(name = "检查状态", readConverterExp = "0=通过,1=未通过,2=待检查") private String checkState; /** * 检查人名 */ + @Excel(name = "检查人名") private String checkName; /**