Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
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
liqin
chnmuseum-party
Commits
176e4872
Commit
176e4872
authored
Apr 09, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
729e12f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
TOrganService.java
...a/cn/wisenergy/chnmuseum/party/service/TOrganService.java
+1
-1
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+13
-7
TBoxOperationController.java
...nmuseum/party/web/controller/TBoxOperationController.java
+3
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/service/TOrganService.java
View file @
176e4872
...
...
@@ -17,7 +17,7 @@ public interface TOrganService extends IService<TOrgan> {
List
<
TOrgan
>
getTree
(
String
orgCode
);
boolean
batchUpload
(
List
excelList
);
boolean
batchUpload
(
List
excelList
)
throws
Exception
;
TOrgan
selectById
(
String
id
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
176e4872
...
...
@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.rmi.server.ExportException
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -59,8 +60,12 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
}
@Override
public
boolean
batchUpload
(
List
excelList
)
{
public
boolean
batchUpload
(
List
excelList
)
throws
Exception
{
boolean
flag
=
false
;
if
(
excelList
.
size
()<
1
){
throw
new
Exception
(
"文件没有正确数据!"
);
}
List
<
TOrgan
>
list1
=
list
();
HashMap
<
String
,
TOrgan
>
map1
=
new
HashMap
<>();
list1
.
stream
().
forEach
(
o
->
map1
.
put
(
o
.
getName
(),
o
));
...
...
@@ -69,7 +74,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
List
<
Map
<
String
,
Object
>>
mapList
=
organMapper
.
selectArea
();
mapList
.
stream
().
forEach
(
m
->
area
.
put
(
m
.
get
(
"name"
).
toString
(),
m
.
get
(
"id"
).
toString
()));
try
{
for
(
int
i
=
0
;
i
<
excelList
.
size
();
i
++)
{
Map
<
String
,
String
>
map
=
null
;
map
=
(
Map
<
String
,
String
>)
excelList
.
get
(
i
);
...
...
@@ -84,12 +89,9 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
ew
.
eq
(
"name"
,
organ
.
getName
());
List
<
TOrgan
>
list
=
list
(
ew
);
if
(
list
!=
null
&&
list
.
size
()>
0
&&
list
.
get
(
0
)!=
null
)
{
return
flag
;
throw
new
Exception
(
"机构名称不能重复!"
)
;
}
}
String
parent
=
map
.
get
(
"上级机构"
);
if
(
map1
.
get
(
parent
)==
null
){
organ
.
setParentId
(
"0"
);
...
...
@@ -108,9 +110,13 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
organ
.
setIsDeleted
(
false
);
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
LocalDateTime
.
now
());
flag
=
save
(
organ
);
flag
=
save
(
organ
);
// list.add(organ);
}
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"文件数据错误!"
);
}
// flag = saveBatch(list);
return
flag
;
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TBoxOperationController.java
View file @
176e4872
...
...
@@ -129,6 +129,9 @@ public class TBoxOperationController extends BaseController {
tBoxOperation
.
setPublicKey
(
rsaKeys
.
get
(
0
));
tBoxOperation
.
setPrivateKey
(
rsaKeys
.
get
(
1
));
}
if
(
3
==
tBoxOperation
.
getStatus
())
{
tBoxOperation
.
setMac
(
""
);
}
boolean
flag
=
tBoxOperationService
.
updateById
(
tBoxOperation
);
UpdateWrapper
<
TUser
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
eq
(
"org_id"
,
tBoxOperation
.
getOrganId
());
...
...
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