From ee45648ae2a00200c357731ed6213ceb630b2d52 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Thu, 26 Sep 2024 14:34:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=8A=E7=BA=A7=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E8=BD=BD=E4=BD=93=E5=AF=BC=E5=87=BA=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issued/CarrierIssuedController.java | 25 +++++++++++ .../system/carrierIssued/carrierIssued.html | 3 ++ .../system/domain/carrier/TdCarrier.java | 23 ++++++---- .../domain/carrier/TdCarrierIssued.java | 42 ++++++++++++------- 4 files changed, 68 insertions(+), 25 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java index 7075a3f..59aab20 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java @@ -5,8 +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.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.carrier.TdCarrier; import com.ruoyi.system.domain.carrier.TdCarrierIssued; import com.ruoyi.web.controller.manager.CarrierIssuedManager; +import com.ruoyi.web.controller.manager.SysAreaManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -34,6 +37,10 @@ public class CarrierIssuedController extends BaseController { private CarrierIssuedManager carrierIssuedManager; + @Resource + private SysAreaManager sysAreaManager; + + @RequiresPermissions("system:carrierIssued:view") @GetMapping() public String carrierIssued() { @@ -55,6 +62,24 @@ public class CarrierIssuedController extends BaseController { } + /** + * 导出文件下发列表 + */ + @RequiresPermissions("system:carrierIssued:export") + @Log(title = "国家秘密载体", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(TdCarrierIssued tdCarrierIssued) { + List carriers = carrierIssuedManager.selectTdCarrierList(tdCarrierIssued); + carriers.forEach(tdCarrier1 -> { + tdCarrier1.setAreaCity(sysAreaManager.getAreaName(tdCarrier1.getAreaCity())); + tdCarrier1.setAreaDistrict(sysAreaManager.getAreaName(tdCarrier1.getAreaDistrict())); + }); + ExcelUtil util = new ExcelUtil<>(TdCarrierIssued.class); + return util.exportExcel(carriers, "国家秘密载体数据"); + } + + /** * 新增载体 */ diff --git a/ruoyi-admin/src/main/resources/templates/system/carrierIssued/carrierIssued.html b/ruoyi-admin/src/main/resources/templates/system/carrierIssued/carrierIssued.html index 190457a..f65f628 100644 --- a/ruoyi-admin/src/main/resources/templates/system/carrierIssued/carrierIssued.html +++ b/ruoyi-admin/src/main/resources/templates/system/carrierIssued/carrierIssued.html @@ -56,6 +56,9 @@ 删除 + + 导出 +
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrier.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrier.java index 72ad83a..9877f31 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrier.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrier.java @@ -39,7 +39,7 @@ public class TdCarrier extends BaseEntity { /** * 载体类型 */ - @Excel(name = "载体类型") + @Excel(name = "载体类型",readConverterExp = "1=纸介质,2=光介质,3=磁介质,4=半导体") private String carrierLevel; /** @@ -78,6 +78,19 @@ public class TdCarrier extends BaseEntity { @Excel(name = "发放范围") private String carrierContent; + + /** + * 市州 + */ + @Excel(name = "市州") + private String areaCity; + + /** + * 区县 + */ + @Excel(name = "区县") + private String areaDistrict; + /** * 接收单位 */ @@ -183,15 +196,7 @@ public class TdCarrier extends BaseEntity { */ private String status; - /** - * 市州 - */ - private String areaCity; - /** - * 区县 - */ - private String areaDistrict; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrierIssued.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrierIssued.java index b132dcf..1c772ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrierIssued.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/carrier/TdCarrierIssued.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.util.Date; +import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -23,40 +24,65 @@ public class TdCarrierIssued extends BaseEntity { @TableId private String id; + + /** + * 载体名称 + */ + @Excel(name = "载体名称") + private String carrierName; + /** * 载体数量 */ + @Excel(name = "载体数量") private String carrierCount; /** * 载体类型 */ + @Excel(name = "载体类型",readConverterExp = "1=纸介质,2=光介质,3=磁介质,4=半导体") private String carrierLevel; /** * 紧急程度 */ + @Excel(name = "紧急程度",readConverterExp = "0=普通,1=紧急,2=加急") private String carrierExtent; /** * 密级 */ + @Excel(name = "密级",readConverterExp = "0=秘密,1=机密,2=绝密") private String carrierSecret; /** * 编号 */ + @Excel(name = "编号") private String carrierNumber; /** * 保密期限 */ + @Excel(name = "保密期限") private String carrierTerm; /** * 发放范围 */ + @Excel(name = "发放范围") private String carrierContent; + /** + * 市州 + */ + @Excel(name = "市州") + private String areaCity; + + /** + * 区县 + */ + @Excel(name = "区县") + private String areaDistrict; /** * 使用要求 @@ -138,22 +164,6 @@ public class TdCarrierIssued extends BaseEntity { */ private String status; - - /** - * 载体名称 - */ - private String carrierName; - - /** - * 市州 - */ - private String areaCity; - - /** - * 区县 - */ - private String areaDistrict; - /** * 维护旁站人员 */