Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PRMS
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
zhengfunan
PRMS
Commits
9c56cb40
Commit
9c56cb40
authored
Jan 14, 2021
by
gaozhentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改拓扑图参数
parent
e7da0b4c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
15 deletions
+35
-15
FlowLine.java
src/main/java/com/yingxin/prms/domain/FlowLine.java
+9
-0
Manager.java
src/main/java/com/yingxin/prms/service/business/Manager.java
+24
-13
FlowDaoImpl.java
src/main/java/com/yingxin/prms/service/dao/FlowDaoImpl.java
+2
-2
No files found.
src/main/java/com/yingxin/prms/domain/FlowLine.java
View file @
9c56cb40
...
@@ -23,6 +23,7 @@ public class FlowLine {
...
@@ -23,6 +23,7 @@ public class FlowLine {
@Column
(
"coordinate_right"
)
@Column
(
"coordinate_right"
)
String
coordinateRight
;
//右坐标
String
coordinateRight
;
//右坐标
String
points
;
//坐标
String
points
;
//坐标
String
color
;
//坐标
public
String
getPoints
()
{
public
String
getPoints
()
{
return
points
;
return
points
;
...
@@ -32,6 +33,14 @@ public class FlowLine {
...
@@ -32,6 +33,14 @@ public class FlowLine {
this
.
points
=
points
;
this
.
points
=
points
;
}
}
public
String
getColor
()
{
return
color
;
}
public
void
setColor
(
String
color
)
{
this
.
color
=
color
;
}
public
String
getCluster_name_left
()
{
public
String
getCluster_name_left
()
{
return
cluster_name_left
;
return
cluster_name_left
;
}
}
...
...
src/main/java/com/yingxin/prms/service/business/Manager.java
View file @
9c56cb40
...
@@ -405,6 +405,12 @@ public class Manager {
...
@@ -405,6 +405,12 @@ public class Manager {
long
faultCount
=
0
;
long
faultCount
=
0
;
try
{
try
{
faultCount
=
getFaultCount
(
node
.
getServerPath
());
faultCount
=
getFaultCount
(
node
.
getServerPath
());
if
(
faultCount
>
0
){
/* machine浅色图标 clusterFault错误图标 clusterNormal正常图标 */
nodeDto
.
setCategory
(
"clusterFault"
);
}
else
{
nodeDto
.
setCategory
(
"clusterNormal"
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
faultCount
=
0
;
faultCount
=
0
;
}
}
...
@@ -413,7 +419,6 @@ public class Manager {
...
@@ -413,7 +419,6 @@ public class Manager {
nodeDto
.
setUrl
(
node
.
getServerPath
());
nodeDto
.
setUrl
(
node
.
getServerPath
());
nodeDto
.
setServerName
(
node
.
getCluster_name
());
nodeDto
.
setServerName
(
node
.
getCluster_name
());
nodeDto
.
setText
(
node
.
getCluster_name
());
nodeDto
.
setText
(
node
.
getCluster_name
());
nodeDto
.
setCategory
(
node
.
getMark
());
nodeDto
.
setPos
(
node
.
getCoordinate
());
nodeDto
.
setPos
(
node
.
getCoordinate
());
nodeDtos
.
add
(
nodeDto
);
nodeDtos
.
add
(
nodeDto
);
}
}
...
@@ -424,7 +429,15 @@ public class Manager {
...
@@ -424,7 +429,15 @@ public class Manager {
lineDto
.
setTo
(
line
.
getClusterNameRight
());
lineDto
.
setTo
(
line
.
getClusterNameRight
());
lineDto
.
setFromSpot
(
line
.
getCoordinateLeft
());
lineDto
.
setFromSpot
(
line
.
getCoordinateLeft
());
lineDto
.
setToSpot
(
line
.
getCoordinateRight
());
lineDto
.
setToSpot
(
line
.
getCoordinateRight
());
lineDto
.
setColor
(
"#008000"
);
lineDto
.
setColor
(
line
.
getColor
());
String
point
=
line
.
getPoints
();
if
(
point
!=
null
&&
point
.
length
()>
0
){
point
=
point
.
substring
(
1
,
point
.
length
()-
2
);
List
points
=
Arrays
.
asList
(
point
.
split
(
","
));
lineDto
.
setPoints
(
points
);
}
else
{
lineDto
.
setPoints
(
null
);
}
lineDtos
.
add
(
lineDto
);
lineDtos
.
add
(
lineDto
);
}
}
result
.
put
(
"class"
,
"GraphLinksModel"
);
result
.
put
(
"class"
,
"GraphLinksModel"
);
...
@@ -448,18 +461,16 @@ public class Manager {
...
@@ -448,18 +461,16 @@ public class Manager {
public
Map
saveTopology
(
String
json
)
{
public
Map
saveTopology
(
String
json
)
{
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
json
);
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
json
);
List
<
Map
<
String
,
String
>>
list
=
jsonObject
.
getJSONArray
(
"list"
);
List
<
Map
<
String
,
String
>>
nodeList
=
jsonObject
.
getJSONArray
(
"nodeDataArray"
);
for
(
Map
<
String
,
String
>
map
:
list
){
List
<
Map
<
String
,
String
>>
linkList
=
jsonObject
.
getJSONArray
(
"linkDataArray"
);
for
(
Map
<
String
,
String
>
map
:
nodeList
){
if
(
map
!=
null
&&
!
map
.
isEmpty
()){
flowDao
.
updateNode
(
map
.
get
(
"serverName"
),
map
.
get
(
"pos"
),
map
.
get
(
"category"
));
}
}
for
(
Map
<
String
,
String
>
map
:
linkList
){
if
(
map
!=
null
&&
!
map
.
isEmpty
()){
if
(
map
!=
null
&&
!
map
.
isEmpty
()){
flowDao
.
updateNode
(
map
.
get
(
"clusterName"
),
map
.
get
(
"coordinate"
),
map
.
get
(
"mark"
));
flowDao
.
updateLine
(
map
.
get
(
"from"
),
map
.
get
(
"to"
),
map
.
get
(
"points"
),
map
.
get
(
"color"
));
flowDao
.
updateLine
(
map
.
get
(
"clusterNameLeft"
),
map
.
get
(
"clusterNameRight"
),
map
.
get
(
"points"
));
// String id = UUID.randomUUID().toString();
// FlowLine flowLine = new FlowLine();
// flowLine.setClusterNameLeft(map.get("clusterNameLeft"));
// flowLine.setClusterNameRight(map.get("clusterNameRight"));
// flowLine.setCoordinateLeft(map.get("coordinateLeft"));
// flowLine.setCoordinateRight(map.get("coordinateRight"));
// flowDao.insertLine(flowLine);
}
}
}
}
Map
result
=
new
HashMap
();
Map
result
=
new
HashMap
();
...
...
src/main/java/com/yingxin/prms/service/dao/FlowDaoImpl.java
View file @
9c56cb40
...
@@ -51,8 +51,8 @@ public class FlowDaoImpl {
...
@@ -51,8 +51,8 @@ public class FlowDaoImpl {
template
.
getCqlOperations
().
execute
(
cql
);
template
.
getCqlOperations
().
execute
(
cql
);
}
}
public
void
updateLine
(
String
clusterNameLeft
,
String
clusterNameRight
,
String
points
)
{
public
void
updateLine
(
String
clusterNameLeft
,
String
clusterNameRight
,
String
points
,
String
color
)
{
String
cql
=
"UPDATE ctid_prof.flowline SET points='"
+
points
+
"' "
+
String
cql
=
"UPDATE ctid_prof.flowline SET points='"
+
points
+
"'
,color ='"
+
color
+
"'
"
+
"where cluster_name_left='"
+
clusterNameLeft
+
"' and cluster_name_right='"
+
clusterNameRight
+
"'"
;
"where cluster_name_left='"
+
clusterNameLeft
+
"' and cluster_name_right='"
+
clusterNameRight
+
"'"
;
template
.
getCqlOperations
().
execute
(
cql
);
template
.
getCqlOperations
().
execute
(
cql
);
}
}
...
...
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