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 82de0504
authored
Jan 05, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]设备导入修改
1 parent
8fa33065
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
src/main/java/com/glsx/controller/DeviceMgrController.java
src/main/java/com/glsx/controller/DeviceMgrController.java
View file @
82de050
...
@@ -64,6 +64,7 @@ public class DeviceMgrController {
...
@@ -64,6 +64,7 @@ public class DeviceMgrController {
@ResponseBody
@ResponseBody
public
R
importDeviceList
(
HttpServletRequest
httpRequest
){
public
R
importDeviceList
(
HttpServletRequest
httpRequest
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
message
;
try
{
try
{
//加载导入的文件
//加载导入的文件
InputStream
input
=
unloadFile
(
httpRequest
,
"file"
);
InputStream
input
=
unloadFile
(
httpRequest
,
"file"
);
...
@@ -75,17 +76,15 @@ public class DeviceMgrController {
...
@@ -75,17 +76,15 @@ public class DeviceMgrController {
map
.
put
(
"successCount"
,
successCount
);
map
.
put
(
"successCount"
,
successCount
);
map
.
put
(
"errorCount"
,
list
.
size
()
-
successCount
);
map
.
put
(
"errorCount"
,
list
.
size
()
-
successCount
);
map
.
put
(
"errorMessage"
,
desimap
.
get
(
"errorMessage"
));
map
.
put
(
"errorMessage"
,
desimap
.
get
(
"errorMessage"
));
return
R
.
ok
().
data
(
map
);
}
catch
(
OfficeXmlFileException
e
)
{
}
catch
(
OfficeXmlFileException
e
)
{
map
.
put
(
"successCount"
,
0
);
LOGGER
.
info
(
"异常信息,{}"
,
e
);
map
.
put
(
"errorCount"
,
0
);
message
=
"上传文件出错,无法解析参数,请检查文件是否有误"
;
map
.
put
(
"errorMessage"
,
"上传文件出错,无法解析参数,请检查文件是否有误"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
info
(
"异常信息,{}"
,
e
);
map
.
put
(
"successCount"
,
0
);
message
=
"系统异常,请联系管理员处理"
;
map
.
put
(
"errorCount"
,
0
);
map
.
put
(
"errorMessage"
,
"系统异常,请联系管理员处理"
);
}
}
return
R
.
ok
().
data
(
map
);
return
R
.
error
(
message
);
}
}
/**
/**
...
...
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