Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
1a2a5d18
Commit
1a2a5d18
authored
Feb 15, 2022
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加excle 导出时的权限过滤
parent
3cd111fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+36
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
1a2a5d18
...
...
@@ -83,7 +83,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience
;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment
;
...
...
@@ -212,6 +211,12 @@ public class ExcelServiceImpl {
}
public
void
commonExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
boolean
authFalg
=
false
;
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
bizOrgCode
)){
authFalg
=
true
;
}
switch
(
excelDto
.
getType
())
{
case
"WHP"
:
...
...
@@ -249,6 +254,11 @@ public class ExcelServiceImpl {
FireExpertsDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
"SYXX"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
WaterResourceDto
.
class
,
dataSourcesImpl
,
false
);
break
;
}
List
<
WaterResourceDto
>
waterResourceDtoList
=
null
;
if
(
par
.
size
()>
0
)
{
waterResourceDtoList
=
waterResourceServiceImpl
.
exportToExcel
(
true
,
par
.
containsKey
(
"name"
)?
par
.
get
(
"name"
).
toString
():
null
,
...
...
@@ -271,11 +281,21 @@ public class ExcelServiceImpl {
AircraftDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
"XFDW"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
FireTeamDto
.
class
,
dataSourcesImpl
,
false
);
break
;
}
List
<
FireTeamDto
>
fireTeamDtoList
=
fireTeamService
.
queryFireTeamForList
(
false
,
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireTeamDtoList
,
FireTeamDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
"WXXFZ"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
FireStationDto
.
class
,
null
,
false
);
break
;
}
String
nameString
=
null
;
Long
bizCompanyId
=
null
;
if
(
par
!=
null
&&
par
.
size
()>
0
)
{
...
...
@@ -287,6 +307,11 @@ public class ExcelServiceImpl {
FireStationDto
.
class
,
null
,
false
);
break
;
case
"XFRY"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
FirefightersExcelDto
.
class
,
null
,
false
);
break
;
}
List
<
FirefightersExcelDto
>
firefightersExcelDtoList
=
firefightersService
.
exportToExcel
(
false
,
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
firefightersExcelDtoList
,
FirefightersExcelDto
.
class
,
null
,
false
);
...
...
@@ -298,6 +323,11 @@ public class ExcelServiceImpl {
maintenancePersonExcelDtoList
,
MaintenancePersonExcleDto
.
class
,
null
,
false
);
break
;
case
"KEYSITE"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
KeySiteExcleDto
.
class
,
null
,
false
);
break
;
}
List
<
KeySiteExcleDto
>
keySiteDtoList
=
null
;
if
(
par
.
size
()>
0
)
{
keySiteDtoList
=
keySiteService
.
exportToExcel
(
par
.
containsKey
(
"name"
)?
par
.
get
(
"name"
).
toString
():
null
,
...
...
@@ -313,6 +343,11 @@ public class ExcelServiceImpl {
KeySiteExcleDto
.
class
,
null
,
false
);
break
;
case
"JCDWRY"
:
if
(
authFalg
)
{
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
OrgUsrExcelDto
.
class
,
null
,
false
);
break
;
}
List
<
OrgUsrExcelDto
>
orgUsrList
=
orgUsrService
.
exportToExcel
(
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
orgUsrList
,
OrgUsrExcelDto
.
class
,
null
,
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment