From 4f98d903124d365db8f03910219ed7c6f6c1a835 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 15 Aug 2024 14:54:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=A3=80=E6=9F=A5=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/check/CheckReportController.java | 22 ++++++++++++++++++- .../system/domain/check/TdCheckReport.java | 21 ++++++++++++++---- 2 files changed, 38 insertions(+), 5 deletions(-) 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; /**