From b0cfa75a98ce9e716e9d2e099fd1b57b9b42b2f6 Mon Sep 17 00:00:00 2001
From: ty <1577900710@qq.com>
Date: Thu, 1 Aug 2024 20:18:10 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E8=AF=81=E4=B9=A6?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BE=9D=E8=B5=96=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hzims-service/hzims-basic/pom.xml | 34 ++++++++++++++++++++++
.../controller/PresonManagementController.java | 8 +++--
.../hzims/basic/mapper/PersonManagemetMapper.java | 1 +
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/hzims-service/hzims-basic/pom.xml b/hzims-service/hzims-basic/pom.xml
index 16958bf..265b0bc 100644
--- a/hzims-service/hzims-basic/pom.xml
+++ b/hzims-service/hzims-basic/pom.xml
@@ -49,6 +49,40 @@
hzims-operational-api
+ com.alibaba
+ easyexcel-core
+ 3.3.2
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+ org.apache.poi
+ poi
+
+
+ org.apache.poi
+ poi-ooxml-schemas
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+ 5.2.3
+
+
+ org.apache.poi
+ poi
+ 5.2.3
+
+
+ org.apache.poi
+ poi-ooxml-schemas
+ 4.1.2
+
+
org.springframework.boot
spring-boot-starter-data-redis
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
index 86a0dc7..ed3691e 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
@@ -97,7 +97,7 @@ public class PresonManagementController extends BladeController {
@OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "档案管理")
- public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) {
+ public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) throws IOException {
try {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
@@ -111,8 +111,9 @@ public class PresonManagementController extends BladeController {
EasyExcel.write(response.getOutputStream(), PersonManagemetExportVo.class).autoCloseStream(Boolean.FALSE).sheet("档案管理报表")
.doWrite(list);
}
+ response.getOutputStream().close();
} catch (Exception e) {
- System.out.println("exportExcel = " + e);
+ e.printStackTrace();
// 重置response
response.reset();
response.setContentType("application/json");
@@ -122,9 +123,12 @@ public class PresonManagementController extends BladeController {
map.put("msg", "档案管理报表导出失败" + e.getMessage());
try {
response.getWriter().println(JSONUtil.toJsonStr(map));
+ response.getOutputStream().close();
} catch (IOException e3) {
+ response.getOutputStream().close();
throw new ServiceException( "发生异常 :" + e);
}
+
}
}
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
index d2123bc..e849f96 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
@@ -38,6 +38,7 @@ public interface PersonManagemetMapper extends UserDataScopeBaseMapper depetIds,
@Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
+ @UserDataAuth
List exportPersonManagemet(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,