Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gong-an
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
Administrator
gong-an
Commits
6522b5e0
Commit
6522b5e0
authored
Dec 07, 2021
by
wuqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2021/12/7 吴卿华 1修改一级关系图展示形状为圆形 2修改颜色生成算法
parent
9f85871b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
398 additions
and
271 deletions
+398
-271
TEST.java
...main/java/com/example/gajz/transferrelationship/TEST.java
+46
-0
Colour.java
...a/com/example/gajz/transferrelationship/neo4j/Colour.java
+30
-21
test.java
...ava/com/example/gajz/transferrelationship/neo4j/test.java
+22
-9
CalculationCenterPoint.java
...ationship/relationalalgorithm/CalculationCenterPoint.java
+3
-6
TransferRelationshipServiceImpl.java
.../service/serviceImpl/TransferRelationshipServiceImpl.java
+297
-235
No files found.
src/main/java/com/example/gajz/transferrelationship/TEST.java
0 → 100644
View file @
6522b5e0
package
com
.
example
.
gajz
.
transferrelationship
;
import
org.junit.Test
;
import
java.awt.*
;
import
java.util.Random
;
public
class
TEST
{
public
static
void
main
(
String
[]
args
)
{
}
@Test
public
void
RandomHexColor_test
()
{
Random
random
=
new
Random
();
float
hue
=
random
.
nextFloat
();
float
saturation
=
(
random
.
nextInt
(
7000
)
+
4000
)
/
10000
f
;
float
luminance
=
1
f
;
Color
color
=
Color
.
getHSBColor
(
hue
,
saturation
,
luminance
);
System
.
out
.
println
(
color
);
System
.
out
.
println
(
"#"
+
Integer
.
toHexString
((
color
.
getRGB
()
&
0xffffff
)
|
0x1000000
).
substring
(
1
));
//红色
String
red
;
//绿色
String
green
;
//蓝色
String
blue
;
//生成红色颜色代码
red
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//生成绿色颜色代码
green
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//生成蓝色颜色代码
blue
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//判断红色代码的位数
red
=
red
.
length
()==
1
?
"0"
+
red
:
red
;
//判断绿色代码的位数
green
=
green
.
length
()==
1
?
"0"
+
green
:
green
;
//判断蓝色代码的位数
blue
=
blue
.
length
()==
1
?
"0"
+
blue
:
blue
;
//生成十六进制颜色值
String
color1
=
"0x"
+
red
+
green
+
blue
;
System
.
out
.
println
(
color1
);
}
}
src/main/java/com/example/gajz/transferrelationship/neo4j/Colour.java
View file @
6522b5e0
package
com
.
example
.
gajz
.
transferrelationship
.
neo4j
;
import
java.awt.*
;
import
java.util.Random
;
public
class
Colour
{
public
String
getColour
(){
//红色
String
red
;
//绿色
String
green
;
//蓝色
String
blue
;
//
//红色
//
String red;
//
//绿色
//
String green;
//
//蓝色
//
String blue;
//生成随机对象
Random
random
=
new
Random
();
//生成红色颜色代码
red
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//生成绿色颜色代码
green
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//生成蓝色颜色代码
blue
=
Integer
.
toHexString
(
random
.
nextInt
(
256
)).
toUpperCase
();
//判断红色代码的位数
red
=
red
.
length
()==
1
?
"0"
+
red
:
red
;
//判断绿色代码的位数
green
=
green
.
length
()==
1
?
"0"
+
green
:
green
;
//判断蓝色代码的位数
blue
=
blue
.
length
()==
1
?
"0"
+
blue
:
blue
;
//生成十六进制颜色值
String
color
=
"0x"
+
red
+
green
+
blue
;
return
color
;
// //生成红色颜色代码
// red = Integer.toHexString(random.nextInt(256)).toUpperCase();
// //生成绿色颜色代码
// green = Integer.toHexString(random.nextInt(256)).toUpperCase();
// //生成蓝色颜色代码
// blue = Integer.toHexString(random.nextInt(256)).toUpperCase();
// //判断红色代码的位数
// red = red.length()==1 ? "0" + red : red ;
// //判断绿色代码的位数
// green = green.length()==1 ? "0" + green : green ;
// //判断蓝色代码的位数
// blue = blue.length()==1 ? "0" + blue : blue ;
// //生成十六进制颜色值
// String color = "0x"+red+green+blue;
float
hue
=
random
.
nextFloat
();
float
saturation
=
(
random
.
nextInt
(
7000
)
+
4000
)
/
10000
f
;
float
luminance
=
1
f
;
Color
color1
=
Color
.
getHSBColor
(
hue
,
saturation
,
luminance
);
String
cos
=
"0x"
+
Integer
.
toHexString
((
color1
.
getRGB
()
&
0xffffff
)
|
0x1000000
).
substring
(
1
);
return
cos
;
}
}
src/main/java/com/example/gajz/transferrelationship/neo4j/test.java
View file @
6522b5e0
...
...
@@ -2,22 +2,35 @@ package com.example.gajz.transferrelationship.neo4j;
import
com.example.gajz.redis.ConFigRedis
;
import
redis.clients.jedis.Jedis
;
import
java.util.HashMap
;
import
java.util.Set
;
import
java.util.*
;
public
class
test
{
public
static
void
main
(
String
[]
args
)
{
int
START
=
1
;
int
END
=
100
;
Random
random
=
new
Random
();
for
(
int
idx
=
1
;
idx
<=
1
;
++
idx
){
showRandomInteger
(
START
,
END
,
random
);
}
}
HashMap
hashMap
=
new
HashMap
();
hashMap
.
put
(
"1"
,
"111"
);
hashMap
.
put
(
"2"
,
"222"
);
hashMap
.
put
(
"3"
,
"333"
);
hashMap
.
put
(
"4"
,
"444"
);
private
static
void
showRandomInteger
(
int
aStart
,
int
aEnd
,
Random
aRandom
){
if
(
aStart
>
aEnd
)
{
throw
new
IllegalArgumentException
(
"Start cannot exceed End."
);
}
//get the range, casting to long to avoid overflow problems
long
range
=
(
long
)
aEnd
-
(
long
)
aStart
+
1
;
// compute a fraction of the range, 0 <= frac < range
long
fraction
=
(
long
)(
range
*
aRandom
.
nextDouble
());
int
randomNumber
=
(
int
)(
fraction
+
aStart
);
log
(
"Generated : "
+
randomNumber
);
}
private
static
void
log
(
String
aMessage
){
System
.
out
.
println
(
aMessage
);
}
System
.
out
.
println
(
hashMap
.
size
());
}
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/CalculationCenterPoint.java
View file @
6522b5e0
...
...
@@ -273,8 +273,8 @@ public class CalculationCenterPoint {
CenterPointVo
centerPointVo1
=
new
CenterPointVo
();
centerPointVo1
.
setBankCardNo
(
transferCardVoList
.
get
(
p
).
getBankCardNo
());
centerPointVo1
.
setName
(
transferCardVoList
.
get
(
p
).
getName
());
centerPointVo1
.
setX
((
int
)(
Math
.
random
()*
2
000
));
centerPointVo1
.
setY
((
int
)(
Math
.
random
()*
2
000
));
centerPointVo1
.
setX
((
int
)(
Math
.
random
()*
1
000
));
centerPointVo1
.
setY
((
int
)(
Math
.
random
()*
1
000
));
temporaryList
.
add
(
centerPointVo1
);
repeat
.
put
(
transferCardVoList
.
get
(
p
).
getBankCardNo
(),
1
);
}
...
...
@@ -294,11 +294,8 @@ public class CalculationCenterPoint {
subordinateList
.
add
(
temporary
.
get
(
x
));
}
}
}
return
centerPointVoList
;
}
...
...
src/main/java/com/example/gajz/transferrelationship/service/serviceImpl/TransferRelationshipServiceImpl.java
View file @
6522b5e0
This diff is collapsed.
Click to expand it.
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