Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tagManager
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanmw
tagManager
Commits
4c39dedc
Commit
4c39dedc
authored
Apr 20, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统管理导入导出接口修改代码提交
parent
9cbfe82a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1771 additions
and
36 deletions
+1771
-36
pom.xml
pom.xml
+6
-0
ExcelParser.java
src/main/java/com/keymobile/tagmanager/api/ExcelParser.java
+76
-36
SysApplication.java
...com/keymobile/tagmanager/model/system/SysApplication.java
+107
-0
SysConstruction.java
...om/keymobile/tagmanager/model/system/SysConstruction.java
+137
-0
SysFunction.java
...va/com/keymobile/tagmanager/model/system/SysFunction.java
+67
-0
SysInfo.java
...n/java/com/keymobile/tagmanager/model/system/SysInfo.java
+676
-0
SysOperations.java
.../com/keymobile/tagmanager/model/system/SysOperations.java
+167
-0
ExcelParserService.java
.../com/keymobile/tagmanager/service/ExcelParserService.java
+535
-0
No files found.
pom.xml
View file @
4c39dedc
...
@@ -169,6 +169,12 @@
...
@@ -169,6 +169,12 @@
<artifactId>
cas-security-spring-boot-starter
</artifactId>
<artifactId>
cas-security-spring-boot-starter
</artifactId>
<version>
1.0.0-beta-1
</version>
<version>
1.0.0-beta-1
</version>
</dependency>
</dependency>
<!-- gson -->
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
</dependency>
</dependencies>
</dependencies>
<dependencyManagement>
<dependencyManagement>
...
...
src/main/java/com/keymobile/tagmanager/api/ExcelParser.java
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
api
;
package
com
.
keymobile
.
tagmanager
.
api
;
import
cn.afterturn.easypoi.excel.ExcelImportUtil
;
import
cn.afterturn.easypoi.excel.ExcelImportUtil
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.result.ExcelImportResult
;
import
cn.afterturn.easypoi.excel.entity.result.ExcelImportResult
;
import
com.keymobile.tagmanager.model.SysTag
;
import
com.keymobile.tagmanager.logging.LogConstants
;
import
io.swagger.annotations.Api
;
import
com.keymobile.tagmanager.logging.LogManager
;
import
io.swagger.annotations.ApiOperation
;
import
com.keymobile.tagmanager.model.SysTag
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
com.keymobile.tagmanager.model.system.SysApplication
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.keymobile.tagmanager.model.system.SysConstruction
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.tagmanager.model.system.SysFunction
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.keymobile.tagmanager.model.system.SysInfo
;
import
com.keymobile.tagmanager.model.system.SysOperations
;
import
javax.servlet.http.HttpServletResponse
;
import
com.keymobile.tagmanager.service.ExcelParserService
;
import
java.util.List
;
import
io.swagger.annotations.Api
;
@Api
(
value
=
"Excel文件处理"
,
tags
=
"Excel文件处理"
)
import
io.swagger.annotations.ApiOperation
;
@RestController
@RequestMapping
(
value
=
"/Excel"
)
import
org.apache.commons.lang.StringUtils
;
public
class
ExcelParser
{
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
@ApiOperation
(
value
=
"解析Excel文件"
,
notes
=
"解析Excel文件"
)
import
org.springframework.web.bind.annotation.PostMapping
;
@PostMapping
(
"/parseExcel"
)
import
org.springframework.web.bind.annotation.RequestMapping
;
public
List
<
SysTag
>
importSystem
(
MultipartFile
file
,
HttpServletResponse
response
)
throws
Exception
{
import
org.springframework.web.bind.annotation.RequestParam
;
ImportParams
params
=
new
ImportParams
();
import
org.springframework.web.bind.annotation.RestController
;
params
.
setTitleRows
(
0
);
import
org.springframework.web.multipart.MultipartFile
;
params
.
setHeadRows
(
1
);
params
.
setNeedVerify
(
false
);
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
ExcelImportResult
<
SysTag
>
excelImportResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysTag
.
class
,
params
);
List
<
SysTag
>
sysTags
=
excelImportResult
.
getList
();
import
java.util.ArrayList
;
return
sysTags
;
import
java.util.List
;
}
@Api
(
value
=
"Excel文件处理"
,
tags
=
"Excel文件处理"
)
}
@RestController
@RequestMapping
(
value
=
"/Excel"
)
public
class
ExcelParser
{
@Autowired
private
ExcelParserService
excelParserService
;
@ApiOperation
(
value
=
"解析Excel文件"
,
notes
=
"解析Excel文件"
)
@PostMapping
(
"/parseExcel"
)
public
List
<
SysTag
>
importSystem
(
MultipartFile
file
,
HttpServletResponse
response
)
throws
Exception
{
ImportParams
params
=
new
ImportParams
();
params
.
setTitleRows
(
0
);
params
.
setHeadRows
(
1
);
params
.
setNeedVerify
(
false
);
ExcelImportResult
<
SysTag
>
excelImportResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysTag
.
class
,
params
);
List
<
SysTag
>
sysTags
=
excelImportResult
.
getList
();
return
sysTags
;
}
@ApiOperation
(
value
=
"解析系统Excel文件"
,
notes
=
"解析系统Excel文件"
)
@PostMapping
(
"/parseSysExcel"
)
public
List
<
SysInfo
>
importSystemExcel
(
MultipartFile
file
)
throws
Exception
{
return
excelParserService
.
importSystemExcel
(
file
);
}
@ApiOperation
(
value
=
"系统导出(系统id传参样式:4,9,10,23)"
,
notes
=
"系统导出(系统id传参样式:4,9,10,23)"
)
@GetMapping
(
value
=
"/exportSystemExcel"
)
public
void
exportSystem
(
@RequestParam
String
systemIdString
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
systemIdString
))
{
List
<
Long
>
systemIds
=
new
ArrayList
<>();
String
[]
systemId
=
systemIdString
.
split
(
","
);
for
(
String
sid
:
systemId
)
{
systemIds
.
add
(
Long
.
valueOf
(
sid
));
}
excelParserService
.
exportSystemExcel
(
systemIds
,
request
,
response
);
}
LogManager
.
logInfo
(
LogConstants
.
CTX_OPTFILETAG
,
"导出系统"
);
}
}
src/main/java/com/keymobile/tagmanager/model/system/SysApplication.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
model
.
system
;
import
java.io.Serializable
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.handler.inter.IExcelDataModel
;
import
cn.afterturn.easypoi.handler.inter.IExcelModel
;
public
class
SysApplication
implements
Serializable
,
IExcelModel
,
IExcelDataModel
{
@Excel
(
name
=
"系统代码"
,
orderNum
=
"1"
,
width
=
30
)
private
String
systemCode
;
@Excel
(
name
=
"业务牵头部门"
,
orderNum
=
"2"
,
width
=
30
)
private
String
informationApplicationDepartment
;
@Excel
(
name
=
"业务牵头部门联系人"
,
orderNum
=
"3"
,
width
=
30
)
private
String
fillingPerson
;
@Excel
(
name
=
"业务域"
,
orderNum
=
"4"
,
width
=
30
)
private
String
businessDomain
;
@Excel
(
name
=
"立项号"
,
orderNum
=
"5"
,
width
=
30
)
private
String
itemNo
;
@Excel
(
name
=
"无形资产主数据号"
,
orderNum
=
"6"
,
width
=
30
)
private
String
intangibleNo
;
@Excel
(
name
=
"开发支岀资产主数据号"
,
orderNum
=
"7"
,
width
=
30
)
private
String
devNo
;
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
String
getInformationApplicationDepartment
()
{
return
informationApplicationDepartment
;
}
public
void
setInformationApplicationDepartment
(
String
informationApplicationDepartment
)
{
this
.
informationApplicationDepartment
=
informationApplicationDepartment
;
}
public
String
getFillingPerson
()
{
return
fillingPerson
;
}
public
void
setFillingPerson
(
String
fillingPerson
)
{
this
.
fillingPerson
=
fillingPerson
;
}
public
String
getBusinessDomain
()
{
return
businessDomain
;
}
public
void
setBusinessDomain
(
String
businessDomain
)
{
this
.
businessDomain
=
businessDomain
;
}
public
String
getItemNo
()
{
return
itemNo
;
}
public
void
setItemNo
(
String
itemNo
)
{
this
.
itemNo
=
itemNo
;
}
public
String
getIntangibleNo
()
{
return
intangibleNo
;
}
public
void
setIntangibleNo
(
String
intangibleNo
)
{
this
.
intangibleNo
=
intangibleNo
;
}
public
String
getDevNo
()
{
return
devNo
;
}
public
void
setDevNo
(
String
devNo
)
{
this
.
devNo
=
devNo
;
}
@org
.
springframework
.
data
.
annotation
.
Transient
private
String
errMsg
;
@org
.
springframework
.
data
.
annotation
.
Transient
private
int
excelRowNum
;
@Override
public
String
getErrorMsg
()
{
return
errMsg
;
}
@Override
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errMsg
=
errorMsg
;
}
@Override
public
Integer
getRowNum
()
{
return
excelRowNum
;
}
@Override
public
void
setRowNum
(
Integer
rowNum
)
{
this
.
excelRowNum
=
rowNum
;
}
}
src/main/java/com/keymobile/tagmanager/model/system/SysConstruction.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
model
.
system
;
import
java.io.Serializable
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.handler.inter.IExcelDataModel
;
import
cn.afterturn.easypoi.handler.inter.IExcelModel
;
public
class
SysConstruction
implements
Serializable
,
IExcelModel
,
IExcelDataModel
{
@Excel
(
name
=
"系统代码"
,
orderNum
=
"1"
,
width
=
30
)
private
String
systemCode
;
@Excel
(
name
=
"系统建设实施方"
,
orderNum
=
"2"
,
width
=
30
)
private
String
constructionDepartment
;
@Excel
(
name
=
"系统建设实施方项目经理"
,
orderNum
=
"3"
,
width
=
30
)
private
String
personnelList
;
@Excel
(
name
=
"系统功能点"
,
orderNum
=
"4"
,
width
=
30
)
private
String
systemFunction
;
@Excel
(
name
=
"系统功能模块描述"
,
orderNum
=
"5"
,
width
=
30
)
private
String
moduleDescription
;
@Excel
(
name
=
"调用接口名称"
,
orderNum
=
"6"
,
width
=
30
)
private
String
callRelationship
;
@Excel
(
name
=
"系统上线时间"
,
orderNum
=
"7"
,
width
=
30
)
private
String
systemOnlineTime
;
@Excel
(
name
=
"项目实际投入人力(人/月)"
,
orderNum
=
"8"
,
width
=
30
)
private
String
projectHumanInput
;
@Excel
(
name
=
"项目实际投入金额(万元)"
,
orderNum
=
"9"
,
width
=
30
)
private
String
projectMoneyInput
;
@Excel
(
name
=
"项目过程文档存放地址"
,
orderNum
=
"10"
,
width
=
30
)
private
String
documents
;
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
String
getConstructionDepartment
()
{
return
constructionDepartment
;
}
public
void
setConstructionDepartment
(
String
constructionDepartment
)
{
this
.
constructionDepartment
=
constructionDepartment
;
}
public
String
getPersonnelList
()
{
return
personnelList
;
}
public
void
setPersonnelList
(
String
personnelList
)
{
this
.
personnelList
=
personnelList
;
}
public
String
getSystemFunction
()
{
return
systemFunction
;
}
public
void
setSystemFunction
(
String
systemFunction
)
{
this
.
systemFunction
=
systemFunction
;
}
public
String
getModuleDescription
()
{
return
moduleDescription
;
}
public
void
setModuleDescription
(
String
moduleDescription
)
{
this
.
moduleDescription
=
moduleDescription
;
}
public
String
getCallRelationship
()
{
return
callRelationship
;
}
public
void
setCallRelationship
(
String
callRelationship
)
{
this
.
callRelationship
=
callRelationship
;
}
public
String
getSystemOnlineTime
()
{
return
systemOnlineTime
;
}
public
void
setSystemOnlineTime
(
String
systemOnlineTime
)
{
this
.
systemOnlineTime
=
systemOnlineTime
;
}
public
String
getProjectHumanInput
()
{
return
projectHumanInput
;
}
public
void
setProjectHumanInput
(
String
projectHumanInput
)
{
this
.
projectHumanInput
=
projectHumanInput
;
}
public
String
getProjectMoneyInput
()
{
return
projectMoneyInput
;
}
public
void
setProjectMoneyInput
(
String
projectMoneyInput
)
{
this
.
projectMoneyInput
=
projectMoneyInput
;
}
public
String
getDocuments
()
{
return
documents
;
}
public
void
setDocuments
(
String
documents
)
{
this
.
documents
=
documents
;
}
@org
.
springframework
.
data
.
annotation
.
Transient
private
String
errMsg
;
@org
.
springframework
.
data
.
annotation
.
Transient
private
int
excelRowNum
;
@Override
public
String
getErrorMsg
()
{
return
errMsg
;
}
@Override
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errMsg
=
errorMsg
;
}
@Override
public
Integer
getRowNum
()
{
return
excelRowNum
;
}
@Override
public
void
setRowNum
(
Integer
rowNum
)
{
this
.
excelRowNum
=
rowNum
;
}
}
src/main/java/com/keymobile/tagmanager/model/system/SysFunction.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
model
.
system
;
import
java.io.Serializable
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.handler.inter.IExcelDataModel
;
import
cn.afterturn.easypoi.handler.inter.IExcelModel
;
public
class
SysFunction
implements
Serializable
,
IExcelModel
,
IExcelDataModel
{
@Excel
(
name
=
"系统代码"
,
orderNum
=
"1"
,
width
=
30
)
private
String
systemCode
;
@Excel
(
name
=
"系统功能点"
,
orderNum
=
"2"
,
width
=
30
)
private
String
systemFunction
;
@Excel
(
name
=
"备注"
,
orderNum
=
"3"
,
width
=
30
)
private
String
comment
;
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
String
getSystemFunction
()
{
return
systemFunction
;
}
public
void
setSystemFunction
(
String
systemFunction
)
{
this
.
systemFunction
=
systemFunction
;
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
}
@org
.
springframework
.
data
.
annotation
.
Transient
private
String
errMsg
;
@org
.
springframework
.
data
.
annotation
.
Transient
private
int
excelRowNum
;
@Override
public
String
getErrorMsg
()
{
return
errMsg
;
}
@Override
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errMsg
=
errorMsg
;
}
@Override
public
Integer
getRowNum
()
{
return
excelRowNum
;
}
@Override
public
void
setRowNum
(
Integer
rowNum
)
{
this
.
excelRowNum
=
rowNum
;
}
}
src/main/java/com/keymobile/tagmanager/model/system/SysInfo.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
model
.
system
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.persistence.Id
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.handler.inter.IExcelDataModel
;
import
cn.afterturn.easypoi.handler.inter.IExcelModel
;
public
class
SysInfo
implements
Serializable
,
IExcelModel
,
IExcelDataModel
{
@Id
private
String
id
;
@Excel
(
name
=
"英文名称"
,
orderNum
=
"1"
,
width
=
30
)
private
String
name
;
@Excel
(
name
=
"中文名称"
,
orderNum
=
"2"
,
width
=
30
)
private
String
cnName
;
@Excel
(
name
=
"说明"
,
orderNum
=
"3"
,
width
=
30
)
private
String
comment
;
@Excel
(
name
=
"序号"
,
orderNum
=
"4"
,
width
=
30
)
private
String
serialNumber
;
@Excel
(
name
=
"系统简称"
,
orderNum
=
"5"
,
width
=
30
)
private
String
sysDisplayName
;
@Excel
(
name
=
"系统代码"
,
orderNum
=
"6"
,
width
=
30
)
private
String
systemCode
;
@Excel
(
name
=
"曾用名/别名"
,
orderNum
=
"7"
,
width
=
30
)
private
String
alias
;
@Excel
(
name
=
"系统状态"
,
orderNum
=
"8"
,
width
=
30
)
private
String
systemState
;
@Excel
(
name
=
"系统类型"
,
orderNum
=
"9"
,
width
=
30
)
private
String
systemType
;
@Excel
(
name
=
"系统简介"
,
orderNum
=
"10"
,
width
=
30
)
private
String
systemIntroduction
;
@Excel
(
name
=
"所属领域"
,
orderNum
=
"11"
,
width
=
30
)
private
String
catalog
;
@Excel
(
name
=
"所属板块"
,
orderNum
=
"12"
,
width
=
30
)
private
String
plate
;
@Excel
(
name
=
"所属部门"
,
orderNum
=
"13"
,
width
=
30
)
private
String
dept
;
@Excel
(
name
=
"IP地址"
,
orderNum
=
"14"
,
width
=
30
)
private
String
ip
;
@Excel
(
name
=
"系统访问地址"
,
orderNum
=
"15"
,
width
=
30
)
private
String
URL
;
@Excel
(
name
=
"用户代表"
,
orderNum
=
"16"
,
width
=
30
)
private
String
contact
;
@Excel
(
name
=
"用户代表员工号"
,
orderNum
=
"17"
,
width
=
30
)
private
String
contactPeople
;
@Excel
(
name
=
"使用部门"
,
orderNum
=
"18"
,
width
=
30
)
private
String
organ
;
@Excel
(
name
=
"系统授权人数"
,
orderNum
=
"19"
,
width
=
30
)
private
String
systemPeople
;
@Excel
(
name
=
"其他说明项"
,
orderNum
=
"20"
,
width
=
30
)
private
String
otherInstructions
;
@Excel
(
name
=
"记录创建日期"
,
orderNum
=
"21"
,
width
=
30
)
private
String
recordCreationDate
;
@Excel
(
name
=
"记录更新日期"
,
orderNum
=
"22"
,
width
=
30
)
private
String
recordUpdateDate
;
private
List
<
SysFunction
>
sysFunction
=
new
ArrayList
<>();
private
List
<
SysApplication
>
sysApplication
=
new
ArrayList
<>();
private
List
<
SysConstruction
>
sysConstruction
=
new
ArrayList
<>();
private
List
<
SysOperations
>
sysOperations
=
new
ArrayList
<>();
public
String
getSysDisplayName
()
{
return
sysDisplayName
;
}
public
void
setSysDisplayName
(
String
sysDisplayName
)
{
this
.
sysDisplayName
=
sysDisplayName
;
}
public
List
<
SysFunction
>
getSysFunction
()
{
return
sysFunction
;
}
public
void
setSysFunction
(
List
<
SysFunction
>
sysFunction
)
{
this
.
sysFunction
.
addAll
(
sysFunction
);
}
public
List
<
SysApplication
>
getSysApplication
()
{
return
sysApplication
;
}
public
void
setSysApplication
(
List
<
SysApplication
>
sysApplication
)
{
this
.
sysApplication
.
addAll
(
sysApplication
);
}
public
List
<
SysConstruction
>
getSysConstruction
()
{
return
sysConstruction
;
}
public
void
setSysConstruction
(
List
<
SysConstruction
>
sysConstruction
)
{
this
.
sysConstruction
.
addAll
(
sysConstruction
);
}
public
List
<
SysOperations
>
getSysOperations
()
{
return
sysOperations
;
}
public
void
setSysOperations
(
List
<
SysOperations
>
sysOperations
)
{
this
.
sysOperations
.
addAll
(
sysOperations
);
}
private
String
informationApplicationDepartment
;
private
String
fillingPerson
;
private
String
businessDomain
;
private
String
itemNo
;
private
String
intangibleNo
;
private
String
devNo
;
private
String
constructionDepartment
;
private
String
personnelList
;
private
String
systemFunction
;
private
String
moduleDescription
;
private
String
callRelationship
;
private
String
systemOnlineTime
;
private
String
projectHumanInput
;
private
String
projectMoneyInput
;
private
String
documents
;
private
String
maintenanceClassification
;
private
String
importantSystem
;
private
String
securityProtectionLevel
;
private
String
operationDepartment
;
private
String
operationTime
;
private
String
operationPeoplea
;
private
String
operationPeopleb
;
private
String
systemUsePerMonth
;
private
String
userLoginPerMonth
;
private
String
needChangePerYear
;
private
String
wordOrderPerYear
;
private
String
systemOfflineTime
;
// @Excel(name = "业务流", orderNum = "12", width=30)
// private String businessFlow;
// @Excel(name = "业务系统编号", orderNum = "19", width=30)
// private String businessSystemNo;
// @Excel(name = "系统创建负责人", orderNum = "21", width=30)
// private String systemPersonInCharge;
// @Excel(name = "系统授权用户清单", orderNum = "23", width=30)
// private String userList;
// @Excel(name = "对应的能力块", orderNum = "27", width=30)
// private String capabilityBlock;
// @Excel(name = "主要数据", orderNum = "28", width=30)
// private String masterData;
// @Excel(name = "系统功能分类", orderNum = "29", width=30)
// private String functionClassification;
// @Excel(name = "服务对象", orderNum = "32", width=30)
// private String serviceObject;
// @Excel(name = "业务负责部门", orderNum = "33", width=30)
// private String businessDepartment;
// @Excel(name = "运行服务窗口", orderNum = "36", width=30)
// private String serviceWindow;
// @Excel(name = "应用系统主版本", orderNum = "39", width=30)
// private String mainVersion;
// @Excel(name = "节点名称", orderNum = "42", width=30)
// private String nodeName;
// @Excel(name = "硬件", orderNum = "43", width=30)
// private String hardware;
// @Excel(name = "系统软件及版本号", orderNum = "44", width=30)
// private String softwareAndVersionNo;
// @Excel(name = "部署地点", orderNum = "45", width=30)
// private String locationOfDeployment;
// @Excel(name = "灾备情况", orderNum = "46", width=30)
// private String disasterPreparedness;
// @Excel(name = "第三方连接", orderNum = "47", width=30)
// private String thirdPartyConnection;
// @Excel(name = "系统关联关系", orderNum = "48", width=30)
// private String systemAssociation;
// @Excel(name = "升级改造时间", orderNum = "52", width=30)
// private String upgradingTime;
// @Excel(name = "升级改造主要内容", orderNum = "53", width=30)
// private String mainContentsOfUpgrading;
// @Excel(name = "变更日期", orderNum = "54", width=30)
// private String dateOfChange;
// @Excel(name = "对口部门", orderNum = "55", width=30)
// private String counterpartSector;
// @Excel(name = "负责人", orderNum = "56", width=30)
// private String personInCharge;
// @Excel(name = "上线日期", orderNum = "59", width=30)
// private String onLineDate;
private
boolean
hasExtract
;
private
int
tableNum
;
private
int
columnNum
;
public
String
getPlate
()
{
return
plate
;
}
public
void
setPlate
(
String
plate
)
{
this
.
plate
=
plate
;
}
public
String
getContactPeople
()
{
return
contactPeople
;
}
public
void
setContactPeople
(
String
contactPeople
)
{
this
.
contactPeople
=
contactPeople
;
}
public
String
getSystemPeople
()
{
return
systemPeople
;
}
public
void
setSystemPeople
(
String
systemPeople
)
{
this
.
systemPeople
=
systemPeople
;
}
public
String
getOperationTime
()
{
return
operationTime
;
}
public
void
setOperationTime
(
String
operationTime
)
{
this
.
operationTime
=
operationTime
;
}
public
String
getOperationPeoplea
()
{
return
operationPeoplea
;
}
public
void
setOperationPeoplea
(
String
operationPeoplea
)
{
this
.
operationPeoplea
=
operationPeoplea
;
}
public
String
getOperationPeopleb
()
{
return
operationPeopleb
;
}
public
void
setOperationPeopleb
(
String
operationPeopleb
)
{
this
.
operationPeopleb
=
operationPeopleb
;
}
public
String
getSystemUsePerMonth
()
{
return
systemUsePerMonth
;
}
public
void
setSystemUsePerMonth
(
String
systemUsePerMonth
)
{
this
.
systemUsePerMonth
=
systemUsePerMonth
;
}
public
String
getUserLoginPerMonth
()
{
return
userLoginPerMonth
;
}
public
void
setUserLoginPerMonth
(
String
userLoginPerMonth
)
{
this
.
userLoginPerMonth
=
userLoginPerMonth
;
}
public
String
getNeedChangePerYear
()
{
return
needChangePerYear
;
}
public
void
setNeedChangePerYear
(
String
needChangePerYear
)
{
this
.
needChangePerYear
=
needChangePerYear
;
}
public
String
getWordOrderPerYear
()
{
return
wordOrderPerYear
;
}
public
void
setWordOrderPerYear
(
String
wordOrderPerYear
)
{
this
.
wordOrderPerYear
=
wordOrderPerYear
;
}
public
String
getProjectHumanInput
()
{
return
projectHumanInput
;
}
public
void
setProjectHumanInput
(
String
projectHumanInput
)
{
this
.
projectHumanInput
=
projectHumanInput
;
}
public
String
getProjectMoneyInput
()
{
return
projectMoneyInput
;
}
public
void
setProjectMoneyInput
(
String
projectMoneyInput
)
{
this
.
projectMoneyInput
=
projectMoneyInput
;
}
public
boolean
isHasExtract
()
{
return
hasExtract
;
}
public
void
setHasExtract
(
boolean
hasExtract
)
{
this
.
hasExtract
=
hasExtract
;
}
public
int
getTableNum
()
{
return
tableNum
;
}
public
void
setTableNum
(
int
tableNum
)
{
this
.
tableNum
=
tableNum
;
}
public
int
getColumnNum
()
{
return
columnNum
;
}
public
void
setColumnNum
(
int
columnNum
)
{
this
.
columnNum
=
columnNum
;
}
public
int
getExcelRowNum
()
{
return
excelRowNum
;
}
public
void
setExcelRowNum
(
int
excelRowNum
)
{
this
.
excelRowNum
=
excelRowNum
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCnName
()
{
return
cnName
;
}
public
void
setCnName
(
String
cnName
)
{
this
.
cnName
=
cnName
;
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
}
public
String
getSerialNumber
()
{
return
serialNumber
;
}
public
void
setSerialNumber
(
String
serialNumber
)
{
this
.
serialNumber
=
serialNumber
;
}
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
String
getSystemType
()
{
return
systemType
;
}
public
void
setSystemType
(
String
systemType
)
{
this
.
systemType
=
systemType
;
}
public
String
getAlias
()
{
return
alias
;
}
public
void
setAlias
(
String
alias
)
{
this
.
alias
=
alias
;
}
public
String
getDevNo
()
{
return
devNo
;
}
public
void
setDevNo
(
String
devNo
)
{
this
.
devNo
=
devNo
;
}
public
String
getIntangibleNo
()
{
return
intangibleNo
;
}
public
void
setIntangibleNo
(
String
intangibleNo
)
{
this
.
intangibleNo
=
intangibleNo
;
}
public
String
getItemNo
()
{
return
itemNo
;
}
public
void
setItemNo
(
String
itemNo
)
{
this
.
itemNo
=
itemNo
;
}
public
String
getBusinessDomain
()
{
return
businessDomain
;
}
public
void
setBusinessDomain
(
String
businessDomain
)
{
this
.
businessDomain
=
businessDomain
;
}
public
String
getCatalog
()
{
return
catalog
;
}
public
void
setCatalog
(
String
catalog
)
{
this
.
catalog
=
catalog
;
}
public
String
getDept
()
{
return
dept
;
}
public
void
setDept
(
String
dept
)
{
this
.
dept
=
dept
;
}
public
String
getSystemIntroduction
()
{
return
systemIntroduction
;
}
public
void
setSystemIntroduction
(
String
systemIntroduction
)
{
this
.
systemIntroduction
=
systemIntroduction
;
}
public
String
getURL
()
{
return
URL
;
}
public
void
setURL
(
String
uRL
)
{
URL
=
uRL
;
}
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getContact
()
{
return
contact
;
}
public
void
setContact
(
String
contact
)
{
this
.
contact
=
contact
;
}
public
String
getDocuments
()
{
return
documents
;
}
public
void
setDocuments
(
String
documents
)
{
this
.
documents
=
documents
;
}
public
String
getPersonnelList
()
{
return
personnelList
;
}
public
void
setPersonnelList
(
String
personnelList
)
{
this
.
personnelList
=
personnelList
;
}
public
String
getSystemFunction
()
{
return
systemFunction
;
}
public
void
setSystemFunction
(
String
systemFunction
)
{
this
.
systemFunction
=
systemFunction
;
}
public
String
getModuleDescription
()
{
return
moduleDescription
;
}
public
void
setModuleDescription
(
String
moduleDescription
)
{
this
.
moduleDescription
=
moduleDescription
;
}
public
String
getCallRelationship
()
{
return
callRelationship
;
}
public
void
setCallRelationship
(
String
callRelationship
)
{
this
.
callRelationship
=
callRelationship
;
}
public
String
getImportantSystem
()
{
return
importantSystem
;
}
public
void
setImportantSystem
(
String
importantSystem
)
{
this
.
importantSystem
=
importantSystem
;
}
public
String
getOrgan
()
{
return
organ
;
}
public
void
setOrgan
(
String
organ
)
{
this
.
organ
=
organ
;
}
public
String
getConstructionDepartment
()
{
return
constructionDepartment
;
}
public
void
setConstructionDepartment
(
String
constructionDepartment
)
{
this
.
constructionDepartment
=
constructionDepartment
;
}
public
String
getOperationDepartment
()
{
return
operationDepartment
;
}
public
void
setOperationDepartment
(
String
operationDepartment
)
{
this
.
operationDepartment
=
operationDepartment
;
}
public
String
getSystemOnlineTime
()
{
return
systemOnlineTime
;
}
public
void
setSystemOnlineTime
(
String
systemOnlineTime
)
{
this
.
systemOnlineTime
=
systemOnlineTime
;
}
public
String
getSystemOfflineTime
()
{
return
systemOfflineTime
;
}
public
void
setSystemOfflineTime
(
String
systemOfflineTime
)
{
this
.
systemOfflineTime
=
systemOfflineTime
;
}
public
String
getSecurityProtectionLevel
()
{
return
securityProtectionLevel
;
}
public
void
setSecurityProtectionLevel
(
String
securityProtectionLevel
)
{
this
.
securityProtectionLevel
=
securityProtectionLevel
;
}
public
String
getMaintenanceClassification
()
{
return
maintenanceClassification
;
}
public
void
setMaintenanceClassification
(
String
maintenanceClassification
)
{
this
.
maintenanceClassification
=
maintenanceClassification
;
}
public
String
getOtherInstructions
()
{
return
otherInstructions
;
}
public
void
setOtherInstructions
(
String
otherInstructions
)
{
this
.
otherInstructions
=
otherInstructions
;
}
public
String
getInformationApplicationDepartment
()
{
return
informationApplicationDepartment
;
}
public
void
setInformationApplicationDepartment
(
String
informationApplicationDepartment
)
{
this
.
informationApplicationDepartment
=
informationApplicationDepartment
;
}
public
String
getFillingPerson
()
{
return
fillingPerson
;
}
public
void
setFillingPerson
(
String
fillingPerson
)
{
this
.
fillingPerson
=
fillingPerson
;
}
public
String
getRecordCreationDate
()
{
return
recordCreationDate
;
}
public
void
setRecordCreationDate
(
String
recordCreationDate
)
{
this
.
recordCreationDate
=
recordCreationDate
;
}
public
String
getRecordUpdateDate
()
{
return
recordUpdateDate
;
}
public
void
setRecordUpdateDate
(
String
recordUpdateDate
)
{
this
.
recordUpdateDate
=
recordUpdateDate
;
}
public
String
getSystemState
()
{
return
systemState
;
}
public
void
setSystemState
(
String
systemState
)
{
this
.
systemState
=
systemState
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
// public String getBusinessFlow() {
// return businessFlow;
// }
// public void setBusinessFlow(String businessFlow) {
// this.businessFlow = businessFlow;
// }
// public String getBusinessSystemNo() {
// return businessSystemNo;
// }
// public void setBusinessSystemNo(String businessSystemNo) {
// this.businessSystemNo = businessSystemNo;
// }
// public String getSystemPersonInCharge() {
// return systemPersonInCharge;
// }
// public void setSystemPersonInCharge(String systemPersonInCharge) {
// this.systemPersonInCharge = systemPersonInCharge;
// }
// public String getUserList() {
// return userList;
// }
// public void setUserList(String userList) {
// this.userList = userList;
// }
// public String getCapabilityBlock() {
// return capabilityBlock;
// }
// public void setCapabilityBlock(String capabilityBlock) {
// this.capabilityBlock = capabilityBlock;
// }
// public String getMasterData() {
// return masterData;
// }
// public void setMasterData(String masterData) {
// this.masterData = masterData;
// }
// public String getFunctionClassification() {
// return functionClassification;
// }
// public void setFunctionClassification(String functionClassification) {
// this.functionClassification = functionClassification;
// }
// public String getServiceObject() {
// return serviceObject;
// }
// public void setServiceObject(String serviceObject) {
// this.serviceObject = serviceObject;
// }
// public String getBusinessDepartment() {
// return businessDepartment;
// }
// public void setBusinessDepartment(String businessDepartment) {
// this.businessDepartment = businessDepartment;
// }
// public String getServiceWindow() {
// return serviceWindow;
// }
// public void setServiceWindow(String serviceWindow) {
// this.serviceWindow = serviceWindow;
// }
// public String getMainVersion() {
// return mainVersion;
// }
// public void setMainVersion(String mainVersion) {
// this.mainVersion = mainVersion;
// }
// public String getNodeName() {
// return nodeName;
// }
// public void setNodeName(String nodeName) {
// this.nodeName = nodeName;
// }
// public String getHardware() {
// return hardware;
// }
// public void setHardware(String hardware) {
// this.hardware = hardware;
// }
// public String getSoftwareAndVersionNo() {
// return softwareAndVersionNo;
// }
// public void setSoftwareAndVersionNo(String softwareAndVersionNo) {
// this.softwareAndVersionNo = softwareAndVersionNo;
// }
// public String getLocationOfDeployment() {
// return locationOfDeployment;
// }
// public void setLocationOfDeployment(String locationOfDeployment) {
// this.locationOfDeployment = locationOfDeployment;
// }
// public String getDisasterPreparedness() {
// return disasterPreparedness;
// }
// public void setDisasterPreparedness(String disasterPreparedness) {
// this.disasterPreparedness = disasterPreparedness;
// }
// public String getThirdPartyConnection() {
// return thirdPartyConnection;
// }
// public void setThirdPartyConnection(String thirdPartyConnection) {
// this.thirdPartyConnection = thirdPartyConnection;
// }
// public String getSystemAssociation() {
// return systemAssociation;
// }
// public void setSystemAssociation(String systemAssociation) {
// this.systemAssociation = systemAssociation;
// }
// public String getUpgradingTime() {
// return upgradingTime;
// }
// public void setUpgradingTime(String upgradingTime) {
// this.upgradingTime = upgradingTime;
// }
// public String getMainContentsOfUpgrading() {
// return mainContentsOfUpgrading;
// }
// public void setMainContentsOfUpgrading(String mainContentsOfUpgrading) {
// this.mainContentsOfUpgrading = mainContentsOfUpgrading;
// }
// public String getDateOfChange() {
// return dateOfChange;
// }
// public void setDateOfChange(String dateOfChange) {
// this.dateOfChange = dateOfChange;
// }
// public String getCounterpartSector() {
// return counterpartSector;
// }
// public void setCounterpartSector(String counterpartSector) {
// this.counterpartSector = counterpartSector;
// }
// public String getPersonInCharge() {
// return personInCharge;
// }
// public void setPersonInCharge(String personInCharge) {
// this.personInCharge = personInCharge;
// }
// public String getOnLineDate() {
// return onLineDate;
// }
// public void setOnLineDate(String onLineDate) {
// this.onLineDate = onLineDate;
// }
@org
.
springframework
.
data
.
annotation
.
Transient
private
String
errMsg
;
@org
.
springframework
.
data
.
annotation
.
Transient
private
int
excelRowNum
;
@Override
public
String
getErrorMsg
()
{
return
errMsg
;
}
@Override
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errMsg
=
errorMsg
;
}
@Override
public
Integer
getRowNum
()
{
return
excelRowNum
;
}
@Override
public
void
setRowNum
(
Integer
rowNum
)
{
this
.
excelRowNum
=
rowNum
;
}
}
src/main/java/com/keymobile/tagmanager/model/system/SysOperations.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
model
.
system
;
import
java.io.Serializable
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.handler.inter.IExcelDataModel
;
import
cn.afterturn.easypoi.handler.inter.IExcelModel
;
public
class
SysOperations
implements
Serializable
,
IExcelModel
,
IExcelDataModel
{
@Excel
(
name
=
"系统代码"
,
orderNum
=
"1"
,
width
=
30
)
private
String
systemCode
;
@Excel
(
name
=
"运维类型"
,
orderNum
=
"2"
,
width
=
30
)
private
String
maintenanceClassification
;
@Excel
(
name
=
"系统定级"
,
orderNum
=
"3"
,
width
=
30
)
private
String
importantSystem
;
@Excel
(
name
=
"系统安全保护等级"
,
orderNum
=
"4"
,
width
=
30
)
private
String
securityProtectionLevel
;
@Excel
(
name
=
"系统运维实施方"
,
orderNum
=
"5"
,
width
=
30
)
private
String
operationDepartment
;
@Excel
(
name
=
"系统运维时间"
,
orderNum
=
"6"
,
width
=
30
)
private
String
operationTime
;
@Excel
(
name
=
"运维负责人A"
,
orderNum
=
"7"
,
width
=
30
)
private
String
operationPeoplea
;
@Excel
(
name
=
"运维负责人B"
,
orderNum
=
"8"
,
width
=
30
)
private
String
operationPeopleb
;
@Excel
(
name
=
"月均系统使用人数"
,
orderNum
=
"9"
,
width
=
30
)
private
String
systemUsePerMonth
;
@Excel
(
name
=
"月均用户登录次数"
,
orderNum
=
"10"
,
width
=
30
)
private
String
userLoginPerMonth
;
@Excel
(
name
=
"年均需求变更量"
,
orderNum
=
"11"
,
width
=
30
)
private
String
needChangePerYear
;
@Excel
(
name
=
"年均基础工单量"
,
orderNum
=
"12"
,
width
=
30
)
private
String
wordOrderPerYear
;
@Excel
(
name
=
"系统退役时间"
,
orderNum
=
"13"
,
width
=
30
)
private
String
systemOfflineTime
;
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
String
getMaintenanceClassification
()
{
return
maintenanceClassification
;
}
public
void
setMaintenanceClassification
(
String
maintenanceClassification
)
{
this
.
maintenanceClassification
=
maintenanceClassification
;
}
public
String
getImportantSystem
()
{
return
importantSystem
;
}
public
void
setImportantSystem
(
String
importantSystem
)
{
this
.
importantSystem
=
importantSystem
;
}
public
String
getSecurityProtectionLevel
()
{
return
securityProtectionLevel
;
}
public
void
setSecurityProtectionLevel
(
String
securityProtectionLevel
)
{
this
.
securityProtectionLevel
=
securityProtectionLevel
;
}
public
String
getOperationDepartment
()
{
return
operationDepartment
;
}
public
void
setOperationDepartment
(
String
operationDepartment
)
{
this
.
operationDepartment
=
operationDepartment
;
}
public
String
getOperationTime
()
{
return
operationTime
;
}
public
void
setOperationTime
(
String
operationTime
)
{
this
.
operationTime
=
operationTime
;
}
public
String
getOperationPeoplea
()
{
return
operationPeoplea
;
}
public
void
setOperationPeoplea
(
String
operationPeoplea
)
{
this
.
operationPeoplea
=
operationPeoplea
;
}
public
String
getOperationPeopleb
()
{
return
operationPeopleb
;
}
public
void
setOperationPeopleb
(
String
operationPeopleb
)
{
this
.
operationPeopleb
=
operationPeopleb
;
}
public
String
getSystemUsePerMonth
()
{
return
systemUsePerMonth
;
}
public
void
setSystemUsePerMonth
(
String
systemUsePerMonth
)
{
this
.
systemUsePerMonth
=
systemUsePerMonth
;
}
public
String
getUserLoginPerMonth
()
{
return
userLoginPerMonth
;
}
public
void
setUserLoginPerMonth
(
String
userLoginPerMonth
)
{
this
.
userLoginPerMonth
=
userLoginPerMonth
;
}
public
String
getNeedChangePerYear
()
{
return
needChangePerYear
;
}
public
void
setNeedChangePerYear
(
String
needChangePerYear
)
{
this
.
needChangePerYear
=
needChangePerYear
;
}
public
String
getWordOrderPerYear
()
{
return
wordOrderPerYear
;
}
public
void
setWordOrderPerYear
(
String
wordOrderPerYear
)
{
this
.
wordOrderPerYear
=
wordOrderPerYear
;
}
public
String
getSystemOfflineTime
()
{
return
systemOfflineTime
;
}
public
void
setSystemOfflineTime
(
String
systemOfflineTime
)
{
this
.
systemOfflineTime
=
systemOfflineTime
;
}
@org
.
springframework
.
data
.
annotation
.
Transient
private
String
errMsg
;
@org
.
springframework
.
data
.
annotation
.
Transient
private
int
excelRowNum
;
@Override
public
String
getErrorMsg
()
{
return
errMsg
;
}
@Override
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errMsg
=
errorMsg
;
}
@Override
public
Integer
getRowNum
()
{
return
excelRowNum
;
}
@Override
public
void
setRowNum
(
Integer
rowNum
)
{
this
.
excelRowNum
=
rowNum
;
}
}
src/main/java/com/keymobile/tagmanager/service/ExcelParserService.java
0 → 100644
View file @
4c39dedc
package
com
.
keymobile
.
tagmanager
.
service
;
import
java.io.BufferedOutputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.FillPatternType
;
import
org.apache.poi.ss.usermodel.Font
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.google.gson.Gson
;
import
com.keymobile.tagmanager.model.system.SysApplication
;
import
com.keymobile.tagmanager.model.system.SysConstruction
;
import
com.keymobile.tagmanager.model.system.SysFunction
;
import
com.keymobile.tagmanager.model.system.SysInfo
;
import
com.keymobile.tagmanager.model.system.SysOperations
;
import
com.keymobile.tagmanager.remote.AuthServiceClient
;
import
cn.afterturn.easypoi.excel.ExcelImportUtil
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.result.ExcelImportResult
;
import
cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult
;
import
cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler
;
@Service
public
class
ExcelParserService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ExcelParserService
.
class
);
@Autowired
private
AuthServiceClient
authService
;
public
List
<
SysInfo
>
importSystemExcel
(
MultipartFile
file
)
throws
Exception
{
List
<
SysInfo
>
sysInfos
=
new
ArrayList
<>();
List
<
SysFunction
>
sysFuns
=
new
ArrayList
<>();
List
<
SysApplication
>
sysApps
=
new
ArrayList
<>();
List
<
SysConstruction
>
sysCons
=
new
ArrayList
<>();
List
<
SysOperations
>
sysOpers
=
new
ArrayList
<>();
for
(
int
numSheet
=
0
;
numSheet
<=
4
;
numSheet
++)
{
ImportParams
params
=
new
ImportParams
();
params
.
setTitleRows
(
0
);
params
.
setHeadRows
(
1
);
params
.
setNeedVerify
(
true
);
params
.
setStartSheetIndex
(
numSheet
);
if
(
numSheet
==
0
)
{
params
.
setVerifyHandler
(
new
SysInfoVerifyHandler
());
ExcelImportResult
<
SysInfo
>
sysInfoResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysInfo
.
class
,
params
);
sysInfos
=
sysInfoResult
.
getList
();
}
if
(
numSheet
==
1
)
{
params
.
setVerifyHandler
(
new
SysFunVerifyHandler
());
ExcelImportResult
<
SysFunction
>
sysFunResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysFunction
.
class
,
params
);
sysFuns
=
sysFunResult
.
getList
();
}
if
(
numSheet
==
2
)
{
params
.
setVerifyHandler
(
new
SysAppVerifyHandler
());
ExcelImportResult
<
SysApplication
>
sysAppResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysApplication
.
class
,
params
);
sysApps
=
sysAppResult
.
getList
();
}
if
(
numSheet
==
3
)
{
params
.
setVerifyHandler
(
new
SysConsVerifyHandler
());
ExcelImportResult
<
SysConstruction
>
sysConsResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysConstruction
.
class
,
params
);
sysCons
=
sysConsResult
.
getList
();
}
if
(
numSheet
==
4
)
{
params
.
setVerifyHandler
(
new
SysOperVerifyHandler
());
ExcelImportResult
<
SysOperations
>
sysOpersResult
=
ExcelImportUtil
.
importExcelMore
(
file
.
getInputStream
(),
SysOperations
.
class
,
params
);
sysOpers
=
sysOpersResult
.
getList
();
}
}
//整合excel信息
for
(
SysInfo
sysInfo
:
sysInfos
)
{
for
(
SysFunction
sysFun
:
sysFuns
)
{
if
(
StringUtils
.
isNotBlank
(
sysInfo
.
getSystemCode
())&&
StringUtils
.
isNotBlank
(
sysFun
.
getSystemCode
())&&
sysInfo
.
getSystemCode
().
equals
(
sysFun
.
getSystemCode
()))
{
sysInfo
.
getSysFunction
().
add
(
sysFun
);
}
}
for
(
SysApplication
sysApp
:
sysApps
)
{
if
(
StringUtils
.
isNotBlank
(
sysInfo
.
getSystemCode
())&&
StringUtils
.
isNotBlank
(
sysApp
.
getSystemCode
())&&
sysInfo
.
getSystemCode
().
equals
(
sysApp
.
getSystemCode
()))
{
sysInfo
.
getSysApplication
().
add
(
sysApp
);
}
}
for
(
SysConstruction
sysCon
:
sysCons
)
{
if
(
StringUtils
.
isNotBlank
(
sysInfo
.
getSystemCode
())&&
StringUtils
.
isNotBlank
(
sysCon
.
getSystemCode
())&&
sysInfo
.
getSystemCode
().
equals
(
sysCon
.
getSystemCode
()))
{
sysInfo
.
getSysConstruction
().
add
(
sysCon
);
}
}
for
(
SysOperations
sysOper
:
sysOpers
)
{
if
(
StringUtils
.
isNotBlank
(
sysInfo
.
getSystemCode
())&&
StringUtils
.
isNotBlank
(
sysOper
.
getSystemCode
())&&
sysInfo
.
getSystemCode
().
equals
(
sysOper
.
getSystemCode
()))
{
sysInfo
.
getSysOperations
().
add
(
sysOper
);
}
}
}
return
sysInfos
;
}
//系统基本信息校验信息
class
SysInfoVerifyHandler
implements
IExcelVerifyHandler
<
SysInfo
>{
@Override
public
ExcelVerifyHandlerResult
verifyHandler
(
SysInfo
obj
)
{
ExcelVerifyHandlerResult
result
=
new
ExcelVerifyHandlerResult
(
true
);
if
(
StringUtils
.
isBlank
(
obj
.
getSystemCode
()))
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
"系统代码不能为空"
);
return
result
;
}
return
result
;
}
}
//系统主要功能校验
class
SysFunVerifyHandler
implements
IExcelVerifyHandler
<
SysFunction
>{
@Override
public
ExcelVerifyHandlerResult
verifyHandler
(
SysFunction
obj
)
{
ExcelVerifyHandlerResult
result
=
new
ExcelVerifyHandlerResult
(
true
);
if
(
StringUtils
.
isBlank
(
obj
.
getSystemCode
()))
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
"系统代码不能为空"
);
return
result
;
}
return
result
;
}
}
//系统申报信息校验
class
SysAppVerifyHandler
implements
IExcelVerifyHandler
<
SysApplication
>{
@Override
public
ExcelVerifyHandlerResult
verifyHandler
(
SysApplication
obj
)
{
ExcelVerifyHandlerResult
result
=
new
ExcelVerifyHandlerResult
(
true
);
if
(
StringUtils
.
isBlank
(
obj
.
getSystemCode
()))
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
"系统代码不能为空"
);
return
result
;
}
return
result
;
}
}
//系统建设信息校验
class
SysConsVerifyHandler
implements
IExcelVerifyHandler
<
SysConstruction
>{
@Override
public
ExcelVerifyHandlerResult
verifyHandler
(
SysConstruction
obj
)
{
ExcelVerifyHandlerResult
result
=
new
ExcelVerifyHandlerResult
(
true
);
if
(
StringUtils
.
isBlank
(
obj
.
getSystemCode
()))
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
"系统代码不能为空"
);
return
result
;
}
return
result
;
}
}
//系统运维信息校验
class
SysOperVerifyHandler
implements
IExcelVerifyHandler
<
SysOperations
>{
@Override
public
ExcelVerifyHandlerResult
verifyHandler
(
SysOperations
obj
)
{
ExcelVerifyHandlerResult
result
=
new
ExcelVerifyHandlerResult
(
true
);
if
(
StringUtils
.
isBlank
(
obj
.
getSystemCode
()))
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
"系统代码不能为空"
);
return
result
;
}
return
result
;
}
}
@SuppressWarnings
(
"unchecked"
)
public
void
exportSystemExcel
(
List
<
Long
>
systemIds
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
List
<
SysInfo
>
sysInfoList
=
new
ArrayList
<>();
List
<
SysFunction
>
sysFunList
=
new
ArrayList
<>();
List
<
SysApplication
>
sysAppList
=
new
ArrayList
<>();
List
<
SysConstruction
>
sysConsList
=
new
ArrayList
<>();
List
<
SysOperations
>
sysOperList
=
new
ArrayList
<>();
//循环根据系统id获取系统详细信息
for
(
Long
systemId
:
systemIds
)
{
Gson
gson
=
new
Gson
();
Map
<
String
,
Object
>
sysMap
=
authService
.
getScopes
(
0L
,
systemId
);
Map
<
String
,
Object
>
options
=
(
Map
<
String
,
Object
>)
sysMap
.
get
(
"options"
);
SysInfo
sysInfo
=
new
Gson
().
fromJson
(
gson
.
toJson
(
options
),
SysInfo
.
class
);
sysInfoList
.
add
(
sysInfo
);
if
(
StringUtils
.
isNotBlank
(
sysInfo
.
getSystemOfflineTime
()))
{
//兼容旧数据导出操作
this
.
exportSystemOldData
(
sysInfo
,
sysFunList
,
sysAppList
,
sysConsList
,
sysOperList
);
}
sysFunList
.
addAll
(
sysInfo
.
getSysFunction
());
sysAppList
.
addAll
(
sysInfo
.
getSysApplication
());
sysConsList
.
addAll
(
sysInfo
.
getSysConstruction
());
sysOperList
.
addAll
(
sysInfo
.
getSysOperations
());
}
Workbook
workbook
=
new
XSSFWorkbook
();
//创建HSSFWorkbook对象
this
.
createSysInfoSheetAndFillData
(
workbook
,
sysInfoList
);
this
.
createSysFunSheetAndFillData
(
workbook
,
sysFunList
);
this
.
createSysAppSheetAndFillData
(
workbook
,
sysAppList
);
this
.
createSysConsSheetAndFillData
(
workbook
,
sysConsList
);
this
.
createSysOperSheetAndFillData
(
workbook
,
sysOperList
);
this
.
responseWorkbook
(
workbook
,
"信息系统管理界面数据_"
,
request
,
response
);
}
private
void
createSysInfoSheetAndFillData
(
Workbook
workbook
,
List
<
SysInfo
>
sysInfoList
)
{
int
rowIndex
=
0
;
Sheet
sheet
=
workbook
.
createSheet
(
"基础信息"
);
Row
row
=
sheet
.
createRow
(
rowIndex
++);
String
[]
titleArray
=
{
"序号"
,
"系统简称"
,
"系统代码"
,
"中文名称"
,
"英文名称"
,
"曾用名/别名"
,
"系统状态"
,
"系统类型"
,
"系统简介"
,
"所属领域"
,
"所属板块"
,
"所属部门"
,
"IP地址"
,
"系统访问地址"
,
"用户代表"
,
"用户代表员工号"
,
"使用部门"
,
"系统授权人数"
,
"其他说明项"
,
"记录创建日期"
,
"记录更新日期"
};
this
.
excelTitleStyle
(
workbook
,
Arrays
.
asList
(
titleArray
),
row
,
sheet
);
this
.
fillSysInfoData
(
sysInfoList
,
row
,
sheet
,
rowIndex
,
authService
.
catalogs
(
0L
));
}
private
void
createSysFunSheetAndFillData
(
Workbook
workbook
,
List
<
SysFunction
>
sysFunList
)
{
int
rowIndex
=
0
;
Sheet
sheet
=
workbook
.
createSheet
(
"主要功能点"
);
Row
row
=
sheet
.
createRow
(
rowIndex
++);
String
[]
titleArray
=
{
"系统代码"
,
"系统功能点"
,
"备注"
};
this
.
excelTitleStyle
(
workbook
,
Arrays
.
asList
(
titleArray
),
row
,
sheet
);
this
.
fillSysFunData
(
sysFunList
,
row
,
sheet
,
rowIndex
);
}
private
void
createSysAppSheetAndFillData
(
Workbook
workbook
,
List
<
SysApplication
>
sysAppList
)
{
int
rowIndex
=
0
;
Sheet
sheet
=
workbook
.
createSheet
(
"申报信息"
);
Row
row
=
sheet
.
createRow
(
rowIndex
++);
String
[]
titleArray
=
{
"系统代码"
,
"业务牵头部门"
,
"业务牵头部门联系人"
,
"业务域"
,
"立项号"
,
"无形资产主数据号"
,
"开发支出资产主数据号"
};
this
.
excelTitleStyle
(
workbook
,
Arrays
.
asList
(
titleArray
),
row
,
sheet
);
this
.
fillSysAppData
(
sysAppList
,
row
,
sheet
,
rowIndex
);
}
private
void
createSysConsSheetAndFillData
(
Workbook
workbook
,
List
<
SysConstruction
>
sysConsList
)
{
int
rowIndex
=
0
;
Sheet
sheet
=
workbook
.
createSheet
(
"建设信息"
);
Row
row
=
sheet
.
createRow
(
rowIndex
++);
String
[]
titleArray
=
{
"系统代码"
,
"系统建设实施方"
,
"系统建设实施方项目经理"
,
"系统功能点"
,
"系统功能模块描述"
,
"调用接口名称"
,
"系统上线时间"
,
"项目实际投入人力(人/月)"
,
"项目实际投入金额(万元)"
,
"项目过程文档存放地址"
};
this
.
excelTitleStyle
(
workbook
,
Arrays
.
asList
(
titleArray
),
row
,
sheet
);
this
.
fillSysConsData
(
sysConsList
,
row
,
sheet
,
rowIndex
);
}
private
void
createSysOperSheetAndFillData
(
Workbook
workbook
,
List
<
SysOperations
>
sysOperList
)
{
int
rowIndex
=
0
;
Sheet
sheet
=
workbook
.
createSheet
(
"运维信息"
);
Row
row
=
sheet
.
createRow
(
rowIndex
++);
String
[]
titleArray
=
{
"系统代码"
,
"运维类型"
,
"系统定级"
,
"系统安全保护等级"
,
"系统运维实施方"
,
"系统运维时间"
,
"运维负责人A"
,
"运维负责人B"
,
"月均系统使用人数"
,
"月均用户登录次数"
,
"年均需求变更量"
,
"年均基础工单量"
,
"系统退役时间"
};
this
.
excelTitleStyle
(
workbook
,
Arrays
.
asList
(
titleArray
),
row
,
sheet
);
this
.
fillSysOperData
(
sysOperList
,
row
,
sheet
,
rowIndex
);
}
//填充系统基本信息
private
void
fillSysInfoData
(
List
<
SysInfo
>
sysInfoList
,
Row
row
,
Sheet
sheet
,
int
rowIndex
,
List
<
Map
<
String
,
Object
>>
catalogs
)
{
for
(
SysInfo
sysInfo:
sysInfoList
)
{
int
contentCellIndex
=
0
;
row
=
sheet
.
createRow
(
rowIndex
++);
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSerialNumber
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSysDisplayName
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSystemCode
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getCnName
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getName
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getAlias
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSystemState
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSystemType
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSystemIntroduction
());
contentCellIndex
++;
//author:zhangkb time:2020-3-20 desc:将模板转换成中文
String
catalog
=
sysInfo
.
getCatalog
();
if
(
StringUtils
.
isNotBlank
(
catalog
))
{
for
(
Map
<
String
,
Object
>
map
:
catalogs
)
{
if
(
Integer
.
parseInt
(
catalog
)==(
int
)
map
.
get
(
"catalogId"
))
{
catalog
=
map
.
get
(
"catalogName"
).
toString
();
break
;
}
}
}
row
.
createCell
(
contentCellIndex
).
setCellValue
(
catalog
);
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getPlate
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getDept
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getIp
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getURL
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getContact
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getContactPeople
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getOrgan
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getSystemPeople
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getOtherInstructions
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getRecordCreationDate
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysInfo
.
getRecordUpdateDate
());
}
}
//填充系统主要功能
private
void
fillSysFunData
(
List
<
SysFunction
>
sysFunList
,
Row
row
,
Sheet
sheet
,
int
rowIndex
)
{
for
(
SysFunction
sysFun:
sysFunList
)
{
int
contentCellIndex
=
0
;
row
=
sheet
.
createRow
(
rowIndex
++);
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysFun
.
getSystemCode
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysFun
.
getSystemFunction
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysFun
.
getComment
());
}
}
//填充系统申报信息
private
void
fillSysAppData
(
List
<
SysApplication
>
sysAppList
,
Row
row
,
Sheet
sheet
,
int
rowIndex
)
{
for
(
SysApplication
sysApp:
sysAppList
)
{
int
contentCellIndex
=
0
;
row
=
sheet
.
createRow
(
rowIndex
++);
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getSystemCode
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getInformationApplicationDepartment
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getFillingPerson
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getBusinessDomain
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getItemNo
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getIntangibleNo
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysApp
.
getDevNo
());
}
}
//填充系统建设信息
private
void
fillSysConsData
(
List
<
SysConstruction
>
sysConsList
,
Row
row
,
Sheet
sheet
,
int
rowIndex
)
{
for
(
SysConstruction
sysCons:
sysConsList
)
{
int
contentCellIndex
=
0
;
row
=
sheet
.
createRow
(
rowIndex
++);
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getSystemCode
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getConstructionDepartment
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getPersonnelList
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getSystemFunction
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getModuleDescription
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getCallRelationship
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getSystemOnlineTime
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getProjectHumanInput
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getProjectMoneyInput
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysCons
.
getDocuments
());
}
}
//填充系统运维信息
private
void
fillSysOperData
(
List
<
SysOperations
>
sysOperList
,
Row
row
,
Sheet
sheet
,
int
rowIndex
)
{
for
(
SysOperations
sysOper:
sysOperList
)
{
int
contentCellIndex
=
0
;
row
=
sheet
.
createRow
(
rowIndex
++);
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getSystemCode
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getMaintenanceClassification
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getImportantSystem
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getSecurityProtectionLevel
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getOperationDepartment
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getOperationTime
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getOperationPeoplea
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getOperationPeopleb
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getSystemUsePerMonth
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getUserLoginPerMonth
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getNeedChangePerYear
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getWordOrderPerYear
());
contentCellIndex
++;
row
.
createCell
(
contentCellIndex
).
setCellValue
(
sysOper
.
getSystemOfflineTime
());
}
}
private
void
excelTitleStyle
(
Workbook
workbook
,
List
<
String
>
titleList
,
Row
row
,
Sheet
sheet
)
{
//蓝色背景列
CellStyle
cellStyle
=
workbook
.
createCellStyle
();
cellStyle
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
cellStyle
.
setFillForegroundColor
((
short
)
34
);
// 设置背景色
cellStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// 居中
cellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
//垂直居中
Font
font
=
workbook
.
createFont
();
font
.
setFontName
(
"微软雅黑"
);
font
.
setFontHeightInPoints
((
short
)
10
);
//设置字体大小
//font.setColor((short) 1);
//font.setBoldweight();
cellStyle
.
setFont
(
font
);
int
cellIndex
=
0
;
row
.
setHeight
((
short
)
350
);
for
(
String
title
:
titleList
)
{
sheet
.
setColumnWidth
(
cellIndex
,
3500
);
//设置列宽
Cell
cell
=
row
.
createCell
(
cellIndex
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
title
==
null
?
""
:
title
);
}
}
private
void
responseWorkbook
(
Workbook
workbook
,
String
fileNameTitle
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
msie
=
"msie"
;
String
chrome
=
"chrome"
;
String
windows
=
"windows"
;
String
firefox
=
"firefox"
;
String
fileName
=
fileNameTitle
+
System
.
currentTimeMillis
()+
".xlsx"
;
String
browserType
=
request
.
getHeader
(
"User-Agent"
).
toLowerCase
();
if
(
browserType
.
contains
(
firefox
)
||
browserType
.
contains
(
chrome
))
{
fileName
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859-1"
);
}
else
if
(
browserType
.
contains
(
msie
)
||
browserType
.
contains
(
windows
))
{
fileName
=
URLEncoder
.
encode
(
fileName
,
"UTF-8"
);
}
else
{
fileName
=
new
String
(
fileName
.
getBytes
());
}
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
response
.
setContentType
(
"application/vnd.ms-excel;charset=UTF-8"
);
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
response
.
setHeader
(
"Cache-Control"
,
"no-cache"
);
response
.
setDateHeader
(
"Expires"
,
0
);
BufferedOutputStream
bufferedOutPut
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
workbook
.
write
(
bufferedOutPut
);
bufferedOutPut
.
flush
();
bufferedOutPut
.
close
();
}
//兼容旧数据系统导出
private
void
exportSystemOldData
(
SysInfo
sysInfo
,
List
<
SysFunction
>
sysFunList
,
List
<
SysApplication
>
sysAppList
,
List
<
SysConstruction
>
sysConsList
,
List
<
SysOperations
>
sysOperList
)
{
SysFunction
sysFun
=
new
SysFunction
();
sysFun
.
setSystemCode
(
sysInfo
.
getSystemCode
());
sysFun
.
setSystemFunction
(
sysInfo
.
getSystemFunction
());
sysFunList
.
add
(
sysFun
);
SysApplication
sysApp
=
new
SysApplication
();
sysApp
.
setSystemCode
(
sysInfo
.
getSystemCode
());
sysApp
.
setInformationApplicationDepartment
(
sysInfo
.
getInformationApplicationDepartment
());
sysApp
.
setFillingPerson
(
sysInfo
.
getFillingPerson
());
sysApp
.
setBusinessDomain
(
sysInfo
.
getBusinessDomain
());
sysApp
.
setItemNo
(
sysInfo
.
getItemNo
());
sysApp
.
setIntangibleNo
(
sysInfo
.
getIntangibleNo
());
sysApp
.
setDevNo
(
sysInfo
.
getDevNo
());
sysAppList
.
add
(
sysApp
);
SysConstruction
sysCons
=
new
SysConstruction
();
sysCons
.
setSystemCode
(
sysInfo
.
getSystemCode
());
sysCons
.
setConstructionDepartment
(
sysInfo
.
getConstructionDepartment
());
sysCons
.
setPersonnelList
(
sysInfo
.
getPersonnelList
());
sysCons
.
setSystemFunction
(
sysInfo
.
getSystemFunction
());
sysCons
.
setModuleDescription
(
sysInfo
.
getModuleDescription
());
sysCons
.
setCallRelationship
(
sysInfo
.
getCallRelationship
());
sysCons
.
setSystemOnlineTime
(
sysInfo
.
getSystemOnlineTime
());
sysCons
.
setProjectHumanInput
(
sysInfo
.
getProjectHumanInput
());
sysCons
.
setProjectMoneyInput
(
sysInfo
.
getProjectMoneyInput
());
sysCons
.
setDocuments
(
sysInfo
.
getDocuments
());
sysConsList
.
add
(
sysCons
);
SysOperations
sysOper
=
new
SysOperations
();
sysOper
.
setSystemCode
(
sysInfo
.
getSystemCode
());
sysOper
.
setMaintenanceClassification
(
sysInfo
.
getMaintenanceClassification
());
sysOper
.
setImportantSystem
(
sysInfo
.
getImportantSystem
());;
sysOper
.
setSecurityProtectionLevel
(
sysInfo
.
getSecurityProtectionLevel
());
sysOper
.
setOperationDepartment
(
sysInfo
.
getOperationDepartment
());
sysOper
.
setOperationTime
(
sysInfo
.
getOperationTime
());
sysOper
.
setOperationPeoplea
(
sysInfo
.
getOperationPeoplea
());
sysOper
.
setOperationPeopleb
(
sysInfo
.
getOperationPeopleb
());
sysOper
.
setSystemUsePerMonth
(
sysInfo
.
getSystemUsePerMonth
());
sysOper
.
setUserLoginPerMonth
(
sysInfo
.
getUserLoginPerMonth
());
sysOper
.
setNeedChangePerYear
(
sysInfo
.
getNeedChangePerYear
());
sysOper
.
setWordOrderPerYear
(
sysInfo
.
getWordOrderPerYear
());
sysOper
.
setSystemOfflineTime
(
sysInfo
.
getSystemOfflineTime
());
sysOperList
.
add
(
sysOper
);
}
}
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