Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
open-platform-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 24ec49d5
authored
Jan 05, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]设备导入
1 parent
82de0504
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
src/main/java/com/glsx/controller/DeviceMgrController.java
src/main/java/com/glsx/controller/DeviceMgrController.java
View file @
24ec49d
...
@@ -11,7 +11,7 @@ import cn.com.glsx.openplatform.vo.DeviceImportVo;
...
@@ -11,7 +11,7 @@ import cn.com.glsx.openplatform.vo.DeviceImportVo;
import
cn.com.glsx.openplatform.vo.DeviceVo
;
import
cn.com.glsx.openplatform.vo.DeviceVo
;
import
cn.com.glsx.openplatform.vo.R
;
import
cn.com.glsx.openplatform.vo.R
;
import
cn.hutool.db.Page
;
import
cn.hutool.db.Page
;
import
com.glsx.
poi.util
.ExcelUtil
;
import
com.glsx.
excel.poi
.ExcelUtil
;
import
org.apache.poi.poifs.filesystem.OfficeXmlFileException
;
import
org.apache.poi.poifs.filesystem.OfficeXmlFileException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -69,8 +69,7 @@ public class DeviceMgrController {
...
@@ -69,8 +69,7 @@ public class DeviceMgrController {
//加载导入的文件
//加载导入的文件
InputStream
input
=
unloadFile
(
httpRequest
,
"file"
);
InputStream
input
=
unloadFile
(
httpRequest
,
"file"
);
//加载导入数据
//加载导入数据
ExcelUtil
<
DeviceImportVo
>
excelUtil
=
new
ExcelUtil
<
DeviceImportVo
>(
DeviceImportVo
.
class
);
List
<
DeviceImportVo
>
list
=
ExcelUtil
.
importData
(
input
,
DeviceImportVo
.
class
);
Collection
<
DeviceImportVo
>
list
=
excelUtil
.
importExcel
(
input
);
Map
<
String
,
Object
>
desimap
=
deviceMgrService
.
importDevice
(
list
);
Map
<
String
,
Object
>
desimap
=
deviceMgrService
.
importDevice
(
list
);
int
successCount
=
desimap
.
get
(
"successCount"
)
==
null
?
0
:
Integer
.
parseInt
(
desimap
.
get
(
"successCount"
)
+
""
);
int
successCount
=
desimap
.
get
(
"successCount"
)
==
null
?
0
:
Integer
.
parseInt
(
desimap
.
get
(
"successCount"
)
+
""
);
map
.
put
(
"successCount"
,
successCount
);
map
.
put
(
"successCount"
,
successCount
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment