Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
zhxf_java
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
葛齐林
zhxf_java
Commits
1639a4e7
Commit
1639a4e7
authored
May 12, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
dbbae009
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
41 deletions
+43
-41
LiResourceController.java
...n/modules/liresource/controller/LiResourceController.java
+42
-40
LiStationMapDao.java
...latform/admin/modules/liresource/dao/LiStationMapDao.java
+1
-1
No files found.
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/controller/LiResourceController.java
View file @
1639a4e7
...
...
@@ -493,50 +493,52 @@ public class LiResourceController extends AbstractController {
List
<
Map
<
String
,
Object
>>
nodes
=
new
ArrayList
<>();
for
(
LiStationMap
liStationMap
:
mapList
)
{
Map
<
String
,
Object
>
mapStationMap
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
liStationMap
),
Map
.
class
);
mapStationMap
.
put
(
"key"
,
UUID
.
randomUUID
());
mapStationMap
.
put
(
"level"
,
4
);
List
<
Map
<
String
,
Object
>>
childrenStationMap
=
new
ArrayList
<>();
for
(
SysDictionary
dic
:
dicList
)
{
Map
<
String
,
Object
>
mapDic
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
dic
),
Map
.
class
);
// 两个id拼接保证id的唯一性
mapDic
.
put
(
"id"
,
liStationMap
.
getId
()
+
dic
.
getId
());
mapDic
.
put
(
"code"
,
dic
.
getValue
());
mapDic
.
put
(
"stationId"
,
liStationMap
.
getStationId
());
mapDic
.
put
(
"tierId"
,
liStationMap
.
getId
());
mapDic
.
put
(
"key"
,
UUID
.
randomUUID
());
mapDic
.
put
(
"level"
,
5
);
if
(
liStationMap
.
getStationId
().
equals
(
liStation
.
getId
())){
Map
<
String
,
Object
>
mapStationMap
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
liStationMap
),
Map
.
class
);
mapStationMap
.
put
(
"key"
,
UUID
.
randomUUID
());
mapStationMap
.
put
(
"level"
,
4
);
List
<
Map
<
String
,
Object
>>
childrenStationMap
=
new
ArrayList
<>();
for
(
SysDictionary
dic
:
dicList
)
{
Map
<
String
,
Object
>
mapDic
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
dic
),
Map
.
class
);
// 两个id拼接保证id的唯一性
mapDic
.
put
(
"id"
,
liStationMap
.
getId
()
+
dic
.
getId
());
mapDic
.
put
(
"code"
,
dic
.
getValue
());
mapDic
.
put
(
"stationId"
,
liStationMap
.
getStationId
());
mapDic
.
put
(
"tierId"
,
liStationMap
.
getId
());
mapDic
.
put
(
"key"
,
UUID
.
randomUUID
());
mapDic
.
put
(
"level"
,
5
);
List
<
Map
<
String
,
Object
>>
childrenDic
=
new
ArrayList
<>();
Iterator
<
LiResource
>
iterator
=
resourceList
.
iterator
();
while
(
iterator
.
hasNext
())
{
LiResource
resource
=
iterator
.
next
();
if
(
dic
.
getId
().
equals
(
resource
.
getType
())
&&
liStationMap
.
getId
().
equals
(
resource
.
getTierId
()))
{
Map
<
String
,
Object
>
mapResource
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
resource
),
Map
.
class
);
mapResource
.
put
(
"cameraIds"
,
resource
.
getCameraIds
());
mapResource
.
put
(
"cameraNames"
,
resource
.
getCameraNames
());
mapResource
.
put
(
"level"
,
6
);
mapResource
.
put
(
"active"
,
false
);
mapResource
.
put
(
"cameraChange"
,
false
);
// 拖拽的唯一标识
mapResource
.
put
(
"key"
,
resource
.
getId
());
List
<
Map
<
String
,
Object
>>
childrenDic
=
new
ArrayList
<>();
Iterator
<
LiResource
>
iterator
=
resourceList
.
iterator
();
while
(
iterator
.
hasNext
())
{
LiResource
resource
=
iterator
.
next
();
if
(
dic
.
getId
().
equals
(
resource
.
getType
())
&&
liStationMap
.
getId
().
equals
(
resource
.
getTierId
()))
{
Map
<
String
,
Object
>
mapResource
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
resource
),
Map
.
class
);
mapResource
.
put
(
"cameraIds"
,
resource
.
getCameraIds
());
mapResource
.
put
(
"cameraNames"
,
resource
.
getCameraNames
());
mapResource
.
put
(
"level"
,
6
);
mapResource
.
put
(
"active"
,
false
);
mapResource
.
put
(
"cameraChange"
,
false
);
// 拖拽的唯一标识
mapResource
.
put
(
"key"
,
resource
.
getId
());
childrenDic
.
add
(
mapResource
);
iterator
.
remove
();
childrenDic
.
add
(
mapResource
);
iterator
.
remove
();
}
}
mapDic
.
put
(
"children"
,
childrenDic
);
/** 如果该子系统下无资源点,不展示*/
if
(
childrenDic
!=
null
&&
childrenDic
.
size
()
>
0
)
{
childrenStationMap
.
add
(
mapDic
);
}
}
mapDic
.
put
(
"children"
,
childrenDic
);
/** 如果该子系统下无资源点,不展示*/
if
(
childrenDic
!=
null
&&
childrenDic
.
size
()
>
0
)
{
childrenStationMap
.
add
(
mapDic
);
}
}
mapStationMap
.
put
(
"children"
,
childrenStationMap
);
if
(
liStationMap
.
getStationId
().
equals
(
liStation
.
getId
()))
{
nodes
.
add
(
mapStationMap
);
mapStationMap
.
put
(
"children"
,
childrenStationMap
);
if
(
liStationMap
.
getStationId
().
equals
(
liStation
.
getId
()))
{
nodes
.
add
(
mapStationMap
);
}
}
}
mapStation
.
put
(
"children"
,
nodes
);
...
...
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/dao/LiStationMapDao.java
View file @
1639a4e7
...
...
@@ -40,7 +40,7 @@ public interface LiStationMapDao extends MyBaseMapper<LiStationMap> {
* @param stationId
* @return
*/
List
<
LiStationMap
>
getListByStationId
(
String
stationId
);
List
<
LiStationMap
>
getListByStationId
(
@Param
(
"stationId"
)
String
stationId
);
List
<
Map
<
String
,
Object
>>
queryListByParam
(
LiStationMapModel
model
);
}
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