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
9ff72a72
Commit
9ff72a72
authored
Jan 11, 2022
by
wuqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/1/11 吴卿华 更新EXCEL上传功能, 增加两种图形算法,优化生成速度
parent
f9bd15b9
Show whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
734 additions
and
2323 deletions
+734
-2323
pom.xml
pom.xml
+2
-3
GajzApplication.java
src/main/java/com/example/gajz/GajzApplication.java
+0
-1
TimeConFig.java
src/main/java/com/example/gajz/config/TimeConFig.java
+24
-0
TEST.java
...main/java/com/example/gajz/transferrelationship/TEST.java
+0
-46
DiagramSpotParam.java
...ajz/transferrelationship/bean/param/DiagramSpotParam.java
+24
-0
Dot.java
...com/example/gajz/transferrelationship/bean/param/Dot.java
+2
-2
EchartsUserVo.java
...mple/gajz/transferrelationship/bean/vo/EchartsUserVo.java
+2
-2
SearchRelationshipVo.java
...jz/transferrelationship/bean/vo/SearchRelationshipVo.java
+2
-2
Colour.java
.../com/example/gajz/transferrelationship/config/Colour.java
+1
-1
TransferRelationshipController.java
...lationship/controller/TransferRelationshipController.java
+16
-9
TransferRelationshipMapper.java
.../transferrelationship/dao/TransferRelationshipMapper.java
+20
-0
HugeCollectionProperties.java
...elationship/hugegraphclient/HugeCollectionProperties.java
+0
-348
SingleExample.java
...z/transferrelationship/hugegraphclient/SingleExample.java
+0
-155
test.java
...ample/gajz/transferrelationship/hugegraphclient/test.java
+0
-36
HelloWorldExample.java
...le/gajz/transferrelationship/neo4j/HelloWorldExample.java
+0
-66
test.java
...ava/com/example/gajz/transferrelationship/neo4j/test.java
+0
-36
CircularAlgorithm.java
...errelationship/relationalalgorithm/CircularAlgorithm.java
+266
-0
DispersionDiagram.java
...errelationship/relationalalgorithm/DispersionDiagram.java
+265
-0
RelationalAlgorithm.java
...relationship/relationalalgorithm/RelationalAlgorithm.java
+38
-102
TransferLocation.java
...ferrelationship/relationalalgorithm/TransferLocation.java
+4
-4
TransferRelationshipService.java
...sferrelationship/service/TransferRelationshipService.java
+3
-4
TransferRelationshipServiceImpl.java
.../service/serviceImpl/TransferRelationshipServiceImpl.java
+33
-208
ThreadsMultipleVerticesEight.java
...sferrelationship/thread/ThreadsMultipleVerticesEight.java
+0
-43
ThreadsMultipleVerticesEleven.java
...ferrelationship/thread/ThreadsMultipleVerticesEleven.java
+0
-43
ThreadsMultipleVerticesFive.java
...nsferrelationship/thread/ThreadsMultipleVerticesFive.java
+0
-42
ThreadsMultipleVerticesFour.java
...nsferrelationship/thread/ThreadsMultipleVerticesFour.java
+0
-41
ThreadsMultipleVerticesNine.java
...nsferrelationship/thread/ThreadsMultipleVerticesNine.java
+0
-43
ThreadsMultipleVerticesOne.java
...ansferrelationship/thread/ThreadsMultipleVerticesOne.java
+0
-42
ThreadsMultipleVerticesSeven.java
...sferrelationship/thread/ThreadsMultipleVerticesSeven.java
+0
-42
ThreadsMultipleVerticesSix.java
...ansferrelationship/thread/ThreadsMultipleVerticesSix.java
+0
-43
ThreadsMultipleVerticesTen.java
...ansferrelationship/thread/ThreadsMultipleVerticesTen.java
+0
-43
ThreadsMultipleVerticesThree.java
...sferrelationship/thread/ThreadsMultipleVerticesThree.java
+0
-42
ThreadsMultipleVerticesTwelve.java
...ferrelationship/thread/ThreadsMultipleVerticesTwelve.java
+0
-43
ThreadsMultipleVerticesTwo.java
...ansferrelationship/thread/ThreadsMultipleVerticesTwo.java
+0
-42
TransferAccountsEight.java
...jz/transferrelationship/thread/TransferAccountsEight.java
+0
-38
TransferAccountsEighteen.java
...transferrelationship/thread/TransferAccountsEighteen.java
+0
-40
TransferAccountsEleven.java
...z/transferrelationship/thread/TransferAccountsEleven.java
+0
-41
TransferAccountsFifteen.java
.../transferrelationship/thread/TransferAccountsFifteen.java
+0
-40
TransferAccountsFive.java
...ajz/transferrelationship/thread/TransferAccountsFive.java
+0
-37
TransferAccountsFour.java
...ajz/transferrelationship/thread/TransferAccountsFour.java
+0
-39
TransferAccountsFourteen.java
...transferrelationship/thread/TransferAccountsFourteen.java
+0
-42
TransferAccountsNine.java
...ajz/transferrelationship/thread/TransferAccountsNine.java
+0
-37
TransferAccountsNineteen.java
...transferrelationship/thread/TransferAccountsNineteen.java
+0
-40
TransferAccountsOne.java
...gajz/transferrelationship/thread/TransferAccountsOne.java
+0
-38
TransferAccountsSeven.java
...jz/transferrelationship/thread/TransferAccountsSeven.java
+0
-38
TransferAccountsSeventeen.java
...ransferrelationship/thread/TransferAccountsSeventeen.java
+0
-42
TransferAccountsSix.java
...gajz/transferrelationship/thread/TransferAccountsSix.java
+0
-40
TransferAccountsSixteen.java
.../transferrelationship/thread/TransferAccountsSixteen.java
+0
-40
TransferAccountsTen.java
...gajz/transferrelationship/thread/TransferAccountsTen.java
+0
-38
TransferAccountsThirteen.java
...transferrelationship/thread/TransferAccountsThirteen.java
+0
-40
TransferAccountsThree.java
...jz/transferrelationship/thread/TransferAccountsThree.java
+0
-37
TransferAccountsTwelve.java
...z/transferrelationship/thread/TransferAccountsTwelve.java
+0
-41
TransferAccountsTwenty.java
...z/transferrelationship/thread/TransferAccountsTwenty.java
+0
-40
TransferAccountsTwo.java
...gajz/transferrelationship/thread/TransferAccountsTwo.java
+0
-38
application.properties
src/main/resources/application.properties
+1
-0
application.yml
src/main/resources/application.yml
+1
-0
TransferRelationshipMapper.xml
src/main/resources/mapper/TransferRelationshipMapper.xml
+30
-3
No files found.
pom.xml
View file @
9ff72a72
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<!--
mybatis
数据库依赖-->
<!--
连接
数据库依赖-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
...
@@ -61,7 +61,6 @@
...
@@ -61,7 +61,6 @@
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.19
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.assertj
</groupId>
<groupId>
org.assertj
</groupId>
...
...
src/main/java/com/example/gajz/GajzApplication.java
View file @
9ff72a72
package
com
.
example
.
gajz
;
package
com
.
example
.
gajz
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
src/main/java/com/example/gajz/config/TimeConFig.java
0 → 100644
View file @
9ff72a72
package
com
.
example
.
gajz
.
config
;
import
org.neo4j.cypher.internal.frontend.v2_3.ast.functions.Str
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* 时间工具类
*/
public
class
TimeConFig
{
/**
* 获取String类型当前时间
* @return
*/
public
String
getDateTime
(){
Date
date
=
new
Date
();
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd :hh:mm:ss"
);
String
DateTime
=
dateFormat
.
format
(
date
);
return
DateTime
;
}
}
src/main/java/com/example/gajz/transferrelationship/TEST.java
deleted
100644 → 0
View file @
f9bd15b9
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/bean/param/DiagramSpotParam.java
0 → 100644
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* 关系图 点位置生成 参数封装类
*/
@Data
@ToString
public
class
DiagramSpotParam
{
/**
* numerical 参数
* 传0不重新刷新 数据从Redis里面取出
* 传1重新刷新 数据从数据库里取出 并且重新生成位置
*/
private
String
numerical
;
/**
* drawingNumber 参数
* 传数字 是代表对应的各种图形算法
*/
private
int
drawingNumber
;
}
src/main/java/com/example/gajz/transferrelationship/bean/param/Dot.java
View file @
9ff72a72
...
@@ -27,12 +27,12 @@ public class Dot {
...
@@ -27,12 +27,12 @@ public class Dot {
/**
/**
* 圆点x轴
* 圆点x轴
*/
*/
private
int
x
;
private
double
x
;
/**
/**
* 圆点y轴
* 圆点y轴
*/
*/
private
int
y
;
private
double
y
;
/**
/**
* 圆点大小
* 圆点大小
...
...
src/main/java/com/example/gajz/transferrelationship/bean/vo/EchartsUserVo.java
View file @
9ff72a72
...
@@ -18,10 +18,10 @@ public class EchartsUserVo {
...
@@ -18,10 +18,10 @@ public class EchartsUserVo {
/**
/**
* x轴
* x轴
*/
*/
private
int
x
;
private
double
x
;
/**
/**
* y轴
* y轴
*/
*/
private
int
y
;
private
double
y
;
}
}
src/main/java/com/example/gajz/transferrelationship/bean/vo/SearchRelationshipVo.java
View file @
9ff72a72
...
@@ -49,12 +49,12 @@ public class SearchRelationshipVo {
...
@@ -49,12 +49,12 @@ public class SearchRelationshipVo {
/**
/**
* x轴
* x轴
*/
*/
private
int
x
;
private
double
x
;
/**
/**
* y轴
* y轴
*/
*/
private
int
y
;
private
double
y
;
/**
/**
* 层级
* 层级
...
...
src/main/java/com/example/gajz/transferrelationship/
neo4j
/Colour.java
→
src/main/java/com/example/gajz/transferrelationship/
config
/Colour.java
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
neo4j
;
package
com
.
example
.
gajz
.
transferrelationship
.
config
;
import
java.awt.*
;
import
java.awt.*
;
import
java.util.Random
;
import
java.util.Random
;
...
...
src/main/java/com/example/gajz/transferrelationship/controller/TransferRelationshipController.java
View file @
9ff72a72
...
@@ -3,10 +3,11 @@ import com.alibaba.excel.EasyExcel;
...
@@ -3,10 +3,11 @@ import com.alibaba.excel.EasyExcel;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.example.gajz.config.TimeConFig
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.ResultCode
;
import
com.example.gajz.result.ResultCode
;
import
com.example.gajz.transferrelationship.bean.dto.data
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.param.DiagramSpotParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.vo.EchartsUserVo
;
import
com.example.gajz.transferrelationship.bean.vo.EchartsUserVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
...
@@ -23,30 +24,36 @@ import java.util.List;
...
@@ -23,30 +24,36 @@ import java.util.List;
/**
/**
* @author lenovo
* @author lenovo
*/
*/
/**跨域注解*/
@CrossOrigin
(
origins
=
"*"
)
@CrossOrigin
(
origins
=
"*"
)
@Controller
@Controller
public
class
TransferRelationshipController
{
public
class
TransferRelationshipController
{
@Autowired
@Autowired
TransferRelationshipService
transferRelationshipService
;
private
TransferRelationshipService
transferRelationshipService
;
/**
/**
* 转账关系
* 转账关系
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
"
/
edge"
)
@RequestMapping
(
"edge"
)
private
List
<
data
>
edge
(){
private
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
(){
List
<
data
>
edge
=
transferRelationshipService
.
edge
();
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
=
transferRelationshipService
.
edge
();
return
edge
;
return
edge
;
}
}
/**
/**
* 点
* 点
* numerical 参数
* 传0不重新刷新 数据从Redis里面取出
* 传1重新刷新 数据从数据库里取出 并且重新生成位置
* drawingNumber 参数
* 传数字 是代表对应的各种图形算法
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
"/diagramSpot"
)
@RequestMapping
(
"/diagramSpot"
)
private
List
diagramSpot
(){
private
List
diagramSpot
(
DiagramSpotParam
diagramSpotParam
){
List
list
=
transferRelationshipService
.
diagramSpot
();
List
list
=
transferRelationshipService
.
diagramSpot
(
diagramSpotParam
);
return
list
;
return
list
;
}
}
...
@@ -94,7 +101,7 @@ public class TransferRelationshipController {
...
@@ -94,7 +101,7 @@ public class TransferRelationshipController {
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
"/specificLocation"
)
@RequestMapping
(
"/specificLocation"
)
private
Result
specificLocation
(
String
id
){
private
Result
specificLocation
(
@RequestParam
(
"id"
)
String
id
){
Result
result
=
transferRelationshipService
.
specificLocation
(
id
);
Result
result
=
transferRelationshipService
.
specificLocation
(
id
);
return
result
;
return
result
;
}
}
...
@@ -311,7 +318,7 @@ public class TransferRelationshipController {
...
@@ -311,7 +318,7 @@ public class TransferRelationshipController {
}
}
}
}
}).
sheet
().
doRead
();
//sheet()参数指定,默认读取第一张工作表
}).
sheet
().
doRead
();
//sheet()参数指定,默认读取第一张工作表
return
new
Result
(
ResultCode
.
SUCCESS
,
eSerialsList
);
return
new
Result
(
ResultCode
.
SUCCESS
);
}
}
...
...
src/main/java/com/example/gajz/transferrelationship/dao/TransferRelationshipMapper.java
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
dao
;
package
com
.
example
.
gajz
.
transferrelationship
.
dao
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.param.data
;
import
com.example.gajz.transferrelationship.bean.vo.CenterPointVo
;
import
com.example.gajz.transferrelationship.bean.vo.CenterPointVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.bean.vo.TransferCardVo
;
import
com.example.gajz.transferrelationship.bean.vo.TransferCardVo
;
...
@@ -125,4 +126,23 @@ public interface TransferRelationshipMapper {
...
@@ -125,4 +126,23 @@ public interface TransferRelationshipMapper {
* @return
* @return
*/
*/
List
<
CenterPointVo
>
centerPointMethod
(
List
<
TransferCardVo
>
transferCardVoList
,
String
bankCardNo
);
List
<
CenterPointVo
>
centerPointMethod
(
List
<
TransferCardVo
>
transferCardVoList
,
String
bankCardNo
);
/**
* 查询共有多少点 根据点的数量决定生成随机范围大小
* @return
*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
selectNumberPoints
();
/**
* 查询拥有多人转账关系的点
* @return
*/
List
<
TransferCardVo
>
selectmanyPeople
();
/**
* 查询与中心点所有相关联的点
* @param bankCardNo
* @return
*/
List
<
data
>
correlationPoint
(
String
bankCardNo
);
}
}
src/main/java/com/example/gajz/transferrelationship/hugegraphclient/HugeCollectionProperties.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
hugegraphclient
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.driver.SchemaManager
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
com.example.gajz.transferrelationship.thread.*
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* HugeGraph
* @author lenovo
*/
@Service
public
class
HugeCollectionProperties
{
/**
* 创建转账人 集合顶点 转账人集合关系方法
*/
public
void
createCollectionProperties
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
try
{
//创建属性
SchemaManager
schema
=
hugeClient
.
schema
();
schema
.
propertyKey
(
"卡号"
).
asText
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"转账次数"
).
asText
().
ifNotExist
().
create
();
//创建集合顶点
/**设置顶点名称*/
schema
.
vertexLabel
(
"单独转账交易人数"
)
/**设置主键为传入*/
.
useCustomizeNumberId
()
/**设置顶点属性*/
.
properties
(
"转账次数"
)
/**判断设置顶点 如果已经存在就不创建*/
.
ifNotExist
().
create
();
//创建转账人顶点
/**设置顶点名称*/
schema
.
vertexLabel
(
"转账人"
)
/**设置主键为传入*/
.
useCustomizeNumberId
()
/**判断设置顶点 如果已经存在就不创建*/
.
ifNotExist
().
create
();
//创建边
/**设置边名称*/
schema
.
edgeLabel
(
"转账"
)
/**起点顶点*/
.
sourceLabel
(
"转账人"
)
/**终点顶点*/
.
targetLabel
(
"单独转账交易人数"
)
/**边参数*/
.
properties
(
"转账次数"
)
.
ifNotExist
()
.
create
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonVos
.
size
();
i
++){
/**添加集合顶点数据*/
Vertex
aggregate
=
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonVos
.
get
(
i
).
getId
(),
T
.
label
,
"单独转账交易人数"
,
/**设置转账次数*/
"转账次数"
,
transferredPersonVos
.
get
(
i
).
getNumber
());
/**添加转账人顶点数据*/
Vertex
transferor
=
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonVos
.
get
(
i
).
getBankCardNo
(),
T
.
label
,
"转账人"
);
//创建转账关系
transferor
.
addEdge
(
"转账"
,
aggregate
,
"转账次数"
,
transferredPersonVos
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
}
catch
(
Exception
e
){
hugeClient
.
close
();
}
}
/**
* 创建多条收款人顶点方法
*/
public
void
createMultiplePayees
(
List
<
TransferredPersonVo
>
multiplePayeesList
){
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"收款人导入开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
try
{
//创建属性
SchemaManager
schema
=
hugeClient
.
schema
();
schema
.
propertyKey
(
"收款次数"
).
asText
().
ifNotExist
().
create
();
//创建集合顶点
/**设置顶点名称*/
schema
.
vertexLabel
(
"收款人"
)
/**设置主键为传入*/
.
useCustomizeStringId
()
/**设置顶点属性*/
.
properties
(
"收款次数"
)
/**判断设置顶点 如果已经存在就不创建*/
.
ifNotExist
().
create
();
hugeClient
.
close
();
//每个线程执行多少条
int
numberExecution
=(
multiplePayeesList
.
size
()/
12
)+
1
;
//导入线程1
ThreadsMultipleVerticesOne
transferAccountsOne
=
new
ThreadsMultipleVerticesOne
();
transferAccountsOne
.
ThreadsMultipleVerticesOneList
(
multiplePayeesList
.
subList
(
0
,
numberExecution
));
Thread
ThreadOne
=
new
Thread
(
transferAccountsOne
);
ThreadOne
.
start
();
//导入线程2
ThreadsMultipleVerticesTwo
transferAccountsTwo
=
new
ThreadsMultipleVerticesTwo
();
transferAccountsTwo
.
ThreadsMultipleVerticesTwoList
(
multiplePayeesList
.
subList
(
numberExecution
,
numberExecution
*
2
));
Thread
ThreadTwo
=
new
Thread
(
transferAccountsTwo
);
ThreadTwo
.
start
();
//导入线程3
ThreadsMultipleVerticesThree
transferAccountsThree
=
new
ThreadsMultipleVerticesThree
();
transferAccountsThree
.
ThreadsMultipleVerticesThreeList
(
multiplePayeesList
.
subList
(
numberExecution
*
2
,
numberExecution
*
3
));
Thread
ThreadThree
=
new
Thread
(
transferAccountsThree
);
ThreadThree
.
start
();
//导入线程4
ThreadsMultipleVerticesFour
transferAccountsFour
=
new
ThreadsMultipleVerticesFour
();
transferAccountsFour
.
ThreadsMultipleVerticesFourList
(
multiplePayeesList
.
subList
(
numberExecution
*
3
,
numberExecution
*
4
));
Thread
ThreadFour
=
new
Thread
(
transferAccountsFour
);
ThreadFour
.
start
();
//导入线程5
ThreadsMultipleVerticesFive
transferAccountsFive
=
new
ThreadsMultipleVerticesFive
();
transferAccountsFive
.
ThreadsMultipleVerticesFiveList
(
multiplePayeesList
.
subList
(
numberExecution
*
4
,
numberExecution
*
5
));
Thread
ThreadFive
=
new
Thread
(
transferAccountsFive
);
ThreadFive
.
start
();
//导入线程6
ThreadsMultipleVerticesSix
transferAccountsSix
=
new
ThreadsMultipleVerticesSix
();
transferAccountsSix
.
ThreadsMultipleVerticesSixList
(
multiplePayeesList
.
subList
(
numberExecution
*
5
,
numberExecution
*
6
));
Thread
ThreadSix
=
new
Thread
(
transferAccountsSix
);
ThreadSix
.
start
();
//导入线程7
ThreadsMultipleVerticesSeven
transferAccountsSeven
=
new
ThreadsMultipleVerticesSeven
();
transferAccountsSeven
.
ThreadsMultipleVerticesSevenList
(
multiplePayeesList
.
subList
(
numberExecution
*
6
,
numberExecution
*
7
));
Thread
ThreadSeven
=
new
Thread
(
transferAccountsSeven
);
ThreadSeven
.
start
();
//导入线程8
ThreadsMultipleVerticesEight
transferAccountsEight
=
new
ThreadsMultipleVerticesEight
();
transferAccountsEight
.
ThreadsMultipleVerticesEightList
(
multiplePayeesList
.
subList
(
numberExecution
*
7
,
numberExecution
*
8
));
Thread
ThreadEight
=
new
Thread
(
transferAccountsEight
);
ThreadEight
.
start
();
//导入线程9
ThreadsMultipleVerticesNine
transferAccountsNine
=
new
ThreadsMultipleVerticesNine
();
transferAccountsNine
.
ThreadsMultipleVerticesNineList
(
multiplePayeesList
.
subList
(
numberExecution
*
8
,
numberExecution
*
9
));
Thread
ThreadNine
=
new
Thread
(
transferAccountsNine
);
ThreadNine
.
start
();
//导入线程10
ThreadsMultipleVerticesTen
transferAccountsTen
=
new
ThreadsMultipleVerticesTen
();
transferAccountsTen
.
ThreadsMultipleVerticesTenList
(
multiplePayeesList
.
subList
(
numberExecution
*
9
,
numberExecution
*
10
));
Thread
ThreadTen
=
new
Thread
(
transferAccountsTen
);
ThreadTen
.
start
();
//线程11
ThreadsMultipleVerticesEleven
threadsMultipleVerticesEleven
=
new
ThreadsMultipleVerticesEleven
();
threadsMultipleVerticesEleven
.
ThreadsMultipleVerticesElevenList
(
multiplePayeesList
.
subList
(
numberExecution
*
10
,
numberExecution
*
11
));
Thread
ThreadEleven
=
new
Thread
(
threadsMultipleVerticesEleven
);
ThreadEleven
.
start
();
//线程12
ThreadsMultipleVerticesTwelve
threadsMultipleVerticesTwelve
=
new
ThreadsMultipleVerticesTwelve
();
threadsMultipleVerticesTwelve
.
ThreadsMultipleVerticesTwelveList
(
multiplePayeesList
.
subList
(
numberExecution
*
11
,
multiplePayeesList
.
size
()));
Thread
ThreadTwelve
=
new
Thread
(
threadsMultipleVerticesTwelve
);
ThreadTwelve
.
start
();
//等待线程
ThreadOne
.
join
();
ThreadTwo
.
join
();
ThreadThree
.
join
();
ThreadFour
.
join
();
ThreadFive
.
join
();
ThreadSix
.
join
();
ThreadSeven
.
join
();
ThreadEight
.
join
();
ThreadNine
.
join
();
ThreadTen
.
join
();
ThreadEleven
.
join
();
ThreadTwelve
.
join
();
System
.
out
.
println
(
"收款人导入结束"
+
df
.
format
(
new
Date
()));
}
catch
(
Exception
e
){
hugeClient
.
close
();
}
}
/**
* 创建 转账人与收款人边
* @param transferCollectionList
*/
public
void
transferCollectionRelationship
(
List
<
TransferredPersonVo
>
transferCollectionList
){
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"转账关系导入开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
try
{
//创建属性
SchemaManager
schema
=
hugeClient
.
schema
();
//创建边
/**设置边名称*/
schema
.
edgeLabel
(
"多人转账"
)
/**起点顶点*/
.
sourceLabel
(
"转账人"
)
/**终点顶点*/
.
targetLabel
(
"收款人"
)
/**边参数*/
.
properties
(
"转账次数"
)
.
ifNotExist
()
.
create
();
hugeClient
.
close
();
// GraphManager graph = hugeClient.graph();
//每个线程执行多少条
int
numberExecution
=
transferCollectionList
.
size
()/
20
;
//线程1
TransferAccountsOne
transferAccountsOne
=
new
TransferAccountsOne
();
transferAccountsOne
.
TransferAccountsOneList
(
transferCollectionList
.
subList
(
0
,
numberExecution
));
Thread
ThreadOne
=
new
Thread
(
transferAccountsOne
);
ThreadOne
.
start
();
//线程2
TransferAccountsTwo
transferAccountsTwo
=
new
TransferAccountsTwo
();
transferAccountsTwo
.
TransferAccountsTwoList
(
transferCollectionList
.
subList
(
numberExecution
,
numberExecution
*
2
));
Thread
ThreadTwo
=
new
Thread
(
transferAccountsTwo
);
ThreadTwo
.
start
();
//线程3
TransferAccountsThree
transferAccountsThree
=
new
TransferAccountsThree
();
transferAccountsThree
.
TransferAccountsThreeList
(
transferCollectionList
.
subList
(
numberExecution
*
2
,
numberExecution
*
3
));
Thread
ThreadThree
=
new
Thread
(
transferAccountsThree
);
ThreadThree
.
start
();
//线程4
TransferAccountsFour
transferAccountsFour
=
new
TransferAccountsFour
();
transferAccountsFour
.
TransferAccountsFourList
(
transferCollectionList
.
subList
(
numberExecution
*
3
,
numberExecution
*
4
));
Thread
ThreadFour
=
new
Thread
(
transferAccountsFour
);
ThreadFour
.
start
();
//线程5
TransferAccountsFive
transferAccountsFive
=
new
TransferAccountsFive
();
transferAccountsFive
.
TransferAccountsFiveList
(
transferCollectionList
.
subList
(
numberExecution
*
4
,
numberExecution
*
5
));
Thread
ThreadFive
=
new
Thread
(
transferAccountsFive
);
ThreadFive
.
start
();
//线程6
TransferAccountsSix
transferAccountsSix
=
new
TransferAccountsSix
();
transferAccountsSix
.
TransferAccountsSixList
(
transferCollectionList
.
subList
(
numberExecution
*
5
,
numberExecution
*
6
));
Thread
ThreadSix
=
new
Thread
(
transferAccountsSix
);
ThreadSix
.
start
();
//线程7
TransferAccountsSeven
transferAccountsSeven
=
new
TransferAccountsSeven
();
transferAccountsSeven
.
TransferAccountsSevenList
(
transferCollectionList
.
subList
(
numberExecution
*
6
,
numberExecution
*
7
));
Thread
ThreadSeven
=
new
Thread
(
transferAccountsSeven
);
ThreadSeven
.
start
();
//线程8
TransferAccountsEight
transferAccountsEight
=
new
TransferAccountsEight
();
transferAccountsEight
.
TransferAccountsEightList
(
transferCollectionList
.
subList
(
numberExecution
*
7
,
numberExecution
*
8
));
Thread
ThreadEight
=
new
Thread
(
transferAccountsEight
);
ThreadEight
.
start
();
//线程9
TransferAccountsNine
transferAccountsNine
=
new
TransferAccountsNine
();
transferAccountsNine
.
TransferAccountsNineList
(
transferCollectionList
.
subList
(
numberExecution
*
8
,
numberExecution
*
9
));
Thread
ThreadNine
=
new
Thread
(
transferAccountsNine
);
ThreadNine
.
start
();
//线程10
TransferAccountsTen
transferAccountsTen
=
new
TransferAccountsTen
();
transferAccountsTen
.
TransferAccountsTenList
(
transferCollectionList
.
subList
(
numberExecution
*
9
,
numberExecution
*
10
));
Thread
ThreadTen
=
new
Thread
(
transferAccountsTen
);
ThreadTen
.
start
();
//线程11
TransferAccountsEleven
transferAccountsEleven
=
new
TransferAccountsEleven
();
transferAccountsEleven
.
TransferAccountsElevenList
(
transferCollectionList
.
subList
(
numberExecution
*
10
,
numberExecution
*
11
));
Thread
ThreadEleven
=
new
Thread
(
transferAccountsEleven
);
ThreadEleven
.
start
();
//线程12
TransferAccountsTwelve
transferAccountsTwelve
=
new
TransferAccountsTwelve
();
transferAccountsTwelve
.
TransferAccountsTwelveList
(
transferCollectionList
.
subList
(
numberExecution
*
11
,
numberExecution
*
12
));
Thread
ThreadTwelve
=
new
Thread
(
transferAccountsTwelve
);
ThreadTwelve
.
start
();
//线程13
TransferAccountsThirteen
transferAccountsThirteen
=
new
TransferAccountsThirteen
();
transferAccountsThirteen
.
TransferAccountsThirteenList
(
transferCollectionList
.
subList
(
numberExecution
*
12
,
numberExecution
*
13
));
Thread
ThreadThirteen
=
new
Thread
(
transferAccountsThirteen
);
ThreadThirteen
.
start
();
//线程14
TransferAccountsFourteen
transferAccountsFourteen
=
new
TransferAccountsFourteen
();
transferAccountsFourteen
.
TransferAccountsFourteenList
(
transferCollectionList
.
subList
(
numberExecution
*
13
,
numberExecution
*
14
));
Thread
ThreadFourteen
=
new
Thread
(
transferAccountsFourteen
);
ThreadFourteen
.
start
();
//线程15
TransferAccountsFifteen
transferAccountsFifteen
=
new
TransferAccountsFifteen
();
transferAccountsFifteen
.
TransferAccountsFifteenList
(
transferCollectionList
.
subList
(
numberExecution
*
14
,
numberExecution
*
15
));
Thread
ThreadFifteen
=
new
Thread
(
transferAccountsFifteen
);
ThreadFifteen
.
start
();
//线程16
TransferAccountsSixteen
transferAccountsSixteen
=
new
TransferAccountsSixteen
();
transferAccountsSixteen
.
TransferAccountsSixteenList
(
transferCollectionList
.
subList
(
numberExecution
*
15
,
numberExecution
*
16
));
Thread
ThreadSixteen
=
new
Thread
(
transferAccountsSixteen
);
ThreadSixteen
.
start
();
//线程17
TransferAccountsSeventeen
transferAccountsSeventeen
=
new
TransferAccountsSeventeen
();
transferAccountsSeventeen
.
TransferAccountsSeventeenList
(
transferCollectionList
.
subList
(
numberExecution
*
16
,
numberExecution
*
17
));
Thread
ThreadSeventeen
=
new
Thread
(
transferAccountsSeventeen
);
ThreadSeventeen
.
start
();
//线程18
TransferAccountsEighteen
transferAccountsEighteen
=
new
TransferAccountsEighteen
();
transferAccountsEighteen
.
TransferAccountsEighteenList
(
transferCollectionList
.
subList
(
numberExecution
*
17
,
numberExecution
*
18
));
Thread
ThreadEighteen
=
new
Thread
(
transferAccountsEighteen
);
ThreadEighteen
.
start
();
//线程19
TransferAccountsNineteen
transferAccountsNineteen
=
new
TransferAccountsNineteen
();
transferAccountsNineteen
.
TransferAccountsNineteenList
(
transferCollectionList
.
subList
(
numberExecution
*
18
,
numberExecution
*
19
));
Thread
ThreadNineteen
=
new
Thread
(
transferAccountsNineteen
);
ThreadNineteen
.
start
();
//线程20
TransferAccountsTwenty
transferAccountsTwenty
=
new
TransferAccountsTwenty
();
transferAccountsTwenty
.
TransferAccountsTwentyList
(
transferCollectionList
.
subList
(
numberExecution
*
19
,
transferCollectionList
.
size
()));
Thread
ThreadTwenty
=
new
Thread
(
transferAccountsTwenty
);
ThreadTwenty
.
start
();
//等待线程
ThreadOne
.
join
();
ThreadTwo
.
join
();
ThreadThree
.
join
();
ThreadFour
.
join
();
ThreadFive
.
join
();
ThreadSix
.
join
();
ThreadSeven
.
join
();
ThreadEight
.
join
();
ThreadNine
.
join
();
ThreadTen
.
join
();
ThreadEleven
.
join
();
ThreadTwelve
.
join
();
ThreadThirteen
.
join
();
ThreadFourteen
.
join
();
ThreadFifteen
.
join
();
ThreadSixteen
.
join
();
ThreadSeventeen
.
join
();
ThreadEighteen
.
join
();
ThreadNineteen
.
join
();
ThreadTwenty
.
join
();
System
.
out
.
println
(
"转账关系导入结束"
+
df
.
format
(
new
Date
()));
}
catch
(
Exception
e
){
System
.
out
.
println
(
e
);
hugeClient
.
close
();
}
}
}
\ No newline at end of file
src/main/java/com/example/gajz/transferrelationship/hugegraphclient/SingleExample.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
hugegraphclient
;
import
com.baidu.hugegraph.driver.*
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
java.io.IOException
;
/**
* @author lenovo
*/
public
class
SingleExample
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// If connect failed will throw a exception.
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
try
{
SchemaManager
schema
=
hugeClient
.
schema
();
//删除顶点
// schema.propertyKey("姓名").remove();
// schema.propertyKey("卡号").remove();
// schema.propertyKey("转账次数").remove();
// schema.propertyKey("转账金额").remove();
//创建属性
// schema.propertyKey("姓名").asText().ifNotExist().create();
// schema.propertyKey("卡号").asText().ifNotExist().create();
// schema.propertyKey("转账次数").asText().ifNotExist().create();
// schema.propertyKey("转账金额").asText().ifNotExist().create();
schema
.
propertyKey
(
"name"
).
asText
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"age"
).
asInt
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"city"
).
asText
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"weight"
).
asDouble
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"lang"
).
asText
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"date"
).
asDate
().
ifNotExist
().
create
();
schema
.
propertyKey
(
"price"
).
asInt
().
ifNotExist
().
create
();
schema
.
vertexLabel
(
"person"
)
.
properties
(
"name"
,
"age"
,
"city"
)
.
primaryKeys
(
"name"
)
.
ifNotExist
()
.
create
();
schema
.
vertexLabel
(
"software"
)
.
properties
(
"name"
,
"lang"
,
"price"
)
.
primaryKeys
(
"name"
)
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"personByCity"
)
.
onV
(
"person"
)
.
by
(
"city"
)
.
secondary
()
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"personByAgeAndCity"
)
.
onV
(
"person"
)
.
by
(
"age"
,
"city"
)
.
secondary
()
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"softwareByPrice"
)
.
onV
(
"software"
)
.
by
(
"price"
)
.
range
()
.
ifNotExist
()
.
create
();
schema
.
edgeLabel
(
"knows"
)
.
sourceLabel
(
"person"
)
.
targetLabel
(
"person"
)
.
properties
(
"date"
,
"weight"
)
.
ifNotExist
()
.
create
();
schema
.
edgeLabel
(
"created"
)
.
sourceLabel
(
"person"
).
targetLabel
(
"software"
)
.
properties
(
"date"
,
"weight"
)
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"createdByDate"
)
.
onE
(
"created"
)
.
by
(
"date"
)
.
secondary
()
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"createdByWeight"
)
.
onE
(
"created"
)
.
by
(
"weight"
)
.
range
()
.
ifNotExist
()
.
create
();
schema
.
indexLabel
(
"knowsByWeight"
)
.
onE
(
"knows"
)
.
by
(
"weight"
)
.
range
()
.
ifNotExist
()
.
create
();
GraphManager
graph
=
hugeClient
.
graph
();
Vertex
marko
=
graph
.
addVertex
(
T
.
label
,
"person"
,
"name"
,
"marko"
,
"age"
,
29
,
"city"
,
"Beijing"
);
Vertex
vadas
=
graph
.
addVertex
(
T
.
label
,
"person"
,
"name"
,
"vadas"
,
"age"
,
27
,
"city"
,
"Hongkong"
);
Vertex
lop
=
graph
.
addVertex
(
T
.
label
,
"software"
,
"name"
,
"lop"
,
"lang"
,
"java"
,
"price"
,
328
);
Vertex
josh
=
graph
.
addVertex
(
T
.
label
,
"person"
,
"name"
,
"josh"
,
"age"
,
32
,
"city"
,
"Beijing"
);
Vertex
ripple
=
graph
.
addVertex
(
T
.
label
,
"software"
,
"name"
,
"ripple"
,
"lang"
,
"java"
,
"price"
,
199
);
Vertex
peter
=
graph
.
addVertex
(
T
.
label
,
"person"
,
"name"
,
"peter"
,
"age"
,
35
,
"city"
,
"Shanghai"
);
//
marko
.
addEdge
(
"knows"
,
vadas
,
"date"
,
"2016-01-10"
,
"weight"
,
0.5
);
// marko.addEdge("knows", josh, "date", "2013-02-20", "weight", 1.0);
// marko.addEdge("created", lop, "date", "2017-12-10", "weight", 0.4);
// josh.addEdge("created", lop, "date", "2009-11-11", "weight", 0.4);
// josh.addEdge("created", ripple, "date", "2017-12-10", "weight", 1.0);
// peter.addEdge("created", lop, "date", "2017-03-24", "weight", 0.2);
// GremlinManager gremlin = hugeClient.gremlin();
// System.out.println("==== Path ====");
// ResultSet resultSet = gremlin.gremlin("g.V().outE().path()").execute();
// Iterator<Result> results = resultSet.iterator();
// results.forEachRemaining(result -> {
// System.out.println(result.getObject().getClass());
// Object object = result.getObject();
// if (object instanceof Vertex) {
// System.out.println(((Vertex) object).id());
// } else if (object instanceof Edge) {
// System.out.println(((Edge) object).id());
// } else if (object instanceof Path) {
// List<Object> elements = ((Path) object).objects();
// elements.forEach(element -> {
// System.out.println(element.getClass());
// System.out.println(element);
// });
// } else {
// System.out.println(object);
// }
// });
hugeClient
.
close
();
}
catch
(
Exception
e
){
hugeClient
.
close
();
}
}
}
src/main/java/com/example/gajz/transferrelationship/hugegraphclient/test.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
hugegraphclient
;
public
class
test
{
public
static
void
main
(
String
[]
args
)
{
Test2
test2
=
new
Test2
();
Test3
test3
=
new
Test3
();
test2
.
ts2
(
1
);
Thread
thread
=
new
Thread
(
test2
);
Thread
thread1
=
new
Thread
(
test3
);
thread
.
start
();
thread1
.
start
();
}
}
class
Test2
implements
Runnable
{
private
int
t2
;
public
void
ts2
(
int
s
){
t2
=
s
;
}
@Override
public
void
run
()
{
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
System
.
out
.
println
(
"------Test2"
+
this
.
t2
);
}
}
}
class
Test3
implements
Runnable
{
@Override
public
void
run
()
{
for
(
int
i
=
0
;
i
<
1000
;
i
++){
System
.
out
.
println
(
"Test3------"
);
}
}
}
src/main/java/com/example/gajz/transferrelationship/neo4j/HelloWorldExample.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
neo4j
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferCardVo
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
org.neo4j.driver.AuthTokens
;
import
org.neo4j.driver.Driver
;
import
org.neo4j.driver.GraphDatabase
;
import
org.neo4j.driver.Result
;
import
org.neo4j.driver.Session
;
import
org.neo4j.driver.Transaction
;
import
org.neo4j.driver.TransactionWork
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
static
org
.
neo4j
.
driver
.
Values
.
parameters
;
public
class
HelloWorldExample
implements
AutoCloseable
{
private
final
Driver
driver
;
public
HelloWorldExample
(
String
uri
,
String
user
,
String
password
)
{
driver
=
GraphDatabase
.
driver
(
uri
,
AuthTokens
.
basic
(
user
,
password
)
);
}
@Override
public
void
close
()
throws
Exception
{
driver
.
close
();
}
public
void
printGreeting
(
final
String
message
)
{
try
(
Session
session
=
driver
.
session
()
)
{
String
greeting
=
session
.
writeTransaction
(
new
TransactionWork
<
String
>()
{
@Override
public
String
execute
(
Transaction
tx
)
{
Result
result
=
tx
.
run
(
"CREATE (a:Greeting) "
+
"SET a.message = $message "
+
"RETURN a.message + ', from node ' + id(a)"
,
parameters
(
"message"
,
message
)
);
return
result
.
single
().
get
(
0
).
asString
();
}
}
);
System
.
out
.
println
(
greeting
);
}
}
public
static
void
main
(
List
<
TransferredPersonVo
>
args
)
throws
Exception
{
try
(
HelloWorldExample
greeter
=
new
HelloWorldExample
(
"bolt://localhost:7687"
,
"neo4j"
,
"123456"
)
)
{
System
.
out
.
println
(
args
.
size
());
for
(
int
i
=
0
;
i
<
args
.
size
();
i
++){
System
.
out
.
println
(
i
);
greeter
.
printGreeting
(
args
.
get
(
i
).
getEndCardNo
());
}
}
}
}
\ No newline at end of file
src/main/java/com/example/gajz/transferrelationship/neo4j/test.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
neo4j
;
import
com.example.gajz.redis.ConFigRedis
;
import
redis.clients.jedis.Jedis
;
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
);
}
}
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
);
}
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/CircularAlgorithm.java
0 → 100644
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
relationalalgorithm
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.example.gajz.redis.ConFigRedis
;
import
com.example.gajz.transferrelationship.bean.vo.Test
;
import
com.example.gajz.transferrelationship.bean.vo.TransferCardVo
;
import
com.example.gajz.transferrelationship.config.Colour
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
org.springframework.stereotype.Component
;
import
redis.clients.jedis.Jedis
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* 关系图 - 圆形图形算法工具类
*/
@Component
public
class
CircularAlgorithm
{
/**关系图数据持久层*/
@Resource
TransferRelationshipMapper
transferRelationshipMapper
;
public
static
CircularAlgorithm
test
;
@PostConstruct
public
void
init
(){
test
=
this
;
test
.
transferRelationshipMapper
=
transferRelationshipMapper
;
}
/**
* 圆形图形算法
* @param numerical
* @return
*/
public
List
circularAlgorithm
(
String
numerical
){
/**最终返回值list*/
List
list
=
new
ArrayList
();
/**查询点数有多少*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
dataList1
=
transferRelationshipMapper
.
selectNumberPoints
();
/**开启Redis连接*/
Jedis
conn
=
ConFigRedis
.
getConn
();
String
time
=
conn
.
get
(
"TimeQuantity"
);
/**
* 判断数据库里面的点数是否有变动 如果有变动就重新生成图形
* 并且清空Redis数据库数据 重新放入新的生成后数据
*/
if
(
time
!=
null
&&
"null"
.
equals
(
numerical
)){
//如果数量相等代表数据库没有变动 就从Redis里面获取数据
if
(
Integer
.
parseInt
(
time
)
==
dataList1
.
size
()){
String
listQuantity
=
conn
.
get
(
"ListQuantity"
);
List
<
Test
>
dataArr
=
JSON
.
parseArray
(
listQuantity
,
Test
.
class
);
for
(
Test
test:
dataArr
){
list
.
add
(
test
);
}
conn
.
close
();
return
list
;
}
}
//Redis存储圆点数量
conn
.
set
(
"TimeQuantity"
,
String
.
valueOf
(
dataList1
.
size
()));
/**已经存在的点 会存储到map里面*/
HashMap
hashMap
=
new
HashMap
();
//查询转账人(中心点)信息
List
<
TransferCardVo
>
transferCardVos
=
transferRelationshipMapper
.
selectTransferCard
();
/**------------------------------------查询共有多少点 根据点的数量决定生成随机范围大小--------------------------------*/
double
range
=
Math
.
ceil
(
dataList1
.
size
()/
50000.00
);
double
numberRanges
=
range
*
6000
;
/**------------------------------------查询共有多少点 根据点的数量决定生成随机范围大小--------------------------------*/
/**----------------------------------计算中心点位置 开始------------------------------------*/
/**计算中心点方法*/
// List<CenterPointVo> centerPointVoList = calculationCenterPoint.CenterPointMethod(transferCardVos);
/**----------------------------------计算中心点位置 结束------------------------------------*/
/**---------------------------------查询拥有多人转账关系的点 开始--------------------------------*/
// List<TransferCardVo> transferCardVos1 = transferRelationshipMapper.selectmanyPeople();
// for (int i=0;i<transferCardVos1.size();i++){
// //生成颜色
// Colour colour=new Colour();
// String code=colour.getColour();
// Test test=new Test();
// test.setId(transferCardVos1.get(i).getBankCardNo());
// test.setName(transferCardVos1.get(i).getName());
// test.setColor(code);
// test.setSize(7);
// test.setX((float)(Math.random()*numberRanges));
// test.setY((float)(Math.random()*numberRanges));
// list.add(test);
// }
/**---------------------------------查询拥有多人转账关系的点 结束--------------------------------*/
double
centerPointX
=
0
;
double
centerPointY
=
0
;
//存储所有大圆的四角X Y轴数据
HashMap
xyMap
=
new
HashMap
();
/** 中心点*/
for
(
int
i
=
0
;
i
<
transferCardVos
.
size
();
i
++){
//是否重叠
boolean
overlap
=
false
;
//生成颜色
Colour
colour
=
new
Colour
();
String
code
=
colour
.
getColour
();
Test
test
=
new
Test
();
test
.
setId
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
test
.
setX
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setName
(
transferCardVos
.
get
(
i
).
getName
());
test
.
setColor
(
code
);
centerPointX
=
test
.
getX
();
centerPointY
=
test
.
getY
();
/**查询被转账人全部信息*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
transfer
=
transferRelationshipMapper
.
correlationPoint
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
/** -----------------------------------------------------------------------------------------*/
if
(
transfer
.
size
()==
0
||
transfer
.
size
()<=
100
){
test
.
setSize
(
10
);
}
else
if
(
transfer
.
size
()>=
100
){
test
.
setSize
(
transfer
.
size
()/
100
);
}
list
.
add
(
test
);
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
/**算大圈半径专用 总数*/
int
bigTotal
=
transfer
.
size
();
/**算大圈半径专用 每圈点数*/
int
bigBase
=
20
;
for
(
int
n
=
1
;
bigTotal
>
0
;
n
++){
bigTotal
=
bigTotal
-
bigBase
;
bigBase
=
bigBase
+
50
;
}
/** 大圆最后一圈半径 每份多少点数 */
int
bigPointsPerShare
=
bigBase
/
4
;
/**大圆最后一圈半径 相等于大圈半径 点数*距离 */
int
fullCircleRadius
=
bigPointsPerShare
*
2
;
/** -------------------------------------------------------------------*/
if
(
i
==
0
){
xyMap
.
put
(
i
+
"zX"
,(
centerPointX
-
fullCircleRadius
));
//圆左X轴
xyMap
.
put
(
i
+
"zY"
,
centerPointY
);
//圆左Y轴
xyMap
.
put
(
i
+
"yX"
,(
centerPointX
+
fullCircleRadius
));
//圆右X轴
xyMap
.
put
(
i
+
"yY"
,
centerPointY
);
//圆右Y轴
xyMap
.
put
(
i
+
"sX"
,
centerPointX
);
//圆上X轴
xyMap
.
put
(
i
+
"sY"
,(
centerPointY
-
fullCircleRadius
));
//圆上Y轴
xyMap
.
put
(
i
+
"xX"
,
centerPointX
);
//圆下X轴
xyMap
.
put
(
i
+
"xY"
,(
centerPointY
+
fullCircleRadius
));
//圆下Y轴
list
.
add
(
test
);
overlap
=
true
;
}
else
{
for
(
int
p
=
0
;
p
<
i
;
p
++){
double
zX
=
(
double
)
xyMap
.
get
(
p
+
"zX"
);
double
yX
=
(
double
)
xyMap
.
get
(
p
+
"yX"
);
double
sY
=
(
double
)
xyMap
.
get
(
p
+
"sY"
);
double
xY
=
(
double
)
xyMap
.
get
(
p
+
"xY"
);
if
(((
zX
>(
centerPointX
-
fullCircleRadius
)&&
zX
>(
centerPointX
+
fullCircleRadius
))
||(
yX
<(
centerPointX
-
fullCircleRadius
)&&
yX
<(
centerPointX
+
fullCircleRadius
)))
||
((
sY
>(
centerPointY
-
fullCircleRadius
)&&
sY
>(
centerPointY
+
fullCircleRadius
))
||(
xY
<(
centerPointY
-
fullCircleRadius
)&&
xY
<(
centerPointY
+
fullCircleRadius
)))){
if
(
p
==
i
-
1
)
{
xyMap
.
put
(
i
+
"zX"
,
(
centerPointX
-
fullCircleRadius
));
//圆左X轴
xyMap
.
put
(
i
+
"zY"
,
centerPointY
);
//圆左Y轴
xyMap
.
put
(
i
+
"yX"
,
(
centerPointX
+
fullCircleRadius
));
//圆右X轴
xyMap
.
put
(
i
+
"yY"
,
centerPointY
);
//圆右Y轴
xyMap
.
put
(
i
+
"sX"
,
centerPointX
);
//圆上X轴
xyMap
.
put
(
i
+
"sY"
,
(
centerPointY
-
fullCircleRadius
));
//圆上Y轴
xyMap
.
put
(
i
+
"xX"
,
centerPointX
);
//圆下X轴
xyMap
.
put
(
i
+
"xY"
,
(
centerPointY
+
fullCircleRadius
));
//圆下Y轴
/** 将中心点X Y轴拼接 并存入Redis中*/
// String position=test.getX()+"Y"+test.getY();
// conn.set(test.getId(),position);
list
.
add
(
test
);
overlap
=
true
;
}
}
else
{
//设置已经碰撞
overlap
=
false
;
break
;
}
}
}
if
(!
overlap
){
i
--;
continue
;
}
/**将没有重复的值 存储到这个list里面*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
dataList
=
new
ArrayList
<>();
/**循环下级数据 将下级数据存入list中*/
for
(
int
p
=
0
;
p
<
transfer
.
size
();
p
++){
Object
targets
=
hashMap
.
get
(
transfer
.
get
(
p
).
getTarget
());
if
(
targets
==
null
)
{
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
data
=
new
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
();
data
.
setName
(
transfer
.
get
(
p
).
getName
());
data
.
setTarget
(
transfer
.
get
(
p
).
getTarget
());
data
.
setTransferTimes
(
transfer
.
get
(
p
).
getTransferTimes
());
dataList
.
add
(
data
);
hashMap
.
put
(
transfer
.
get
(
p
).
getTarget
(),
transfer
.
get
(
p
).
getTarget
());
}
}
/**循环次数*/
int
numberCycles
=
0
;
/**每圈点数 动态变化 */
int
base
=
40
;
/**总数*/
int
total
=
dataList
.
size
();
/**圆圈层数 每循环一次 就是一圈*/
for
(
int
y
=
1
;
total
>
0
;
y
++){
/**圆分成四份 每份多少点数*/
float
pointsPerShare
=
base
;
/**每份点数 / 90度 算出每个点数的度数*/
double
eachDegree
=
360
/
pointsPerShare
;
/**小圆半径 点数X距离*/
double
circleRadius
=
15
*
y
;
/**点大小*/
double
pointSize
=
2
;
if
(
base
<=
total
){
for
(
int
t
=
0
;
t
<
base
;
t
++){
Test
test1
=
new
Test
();
//算出A角度数 (每份点数-t)* 每点度数
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegree
);
//Y轴
double
Y
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
//X轴
double
X
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getTarget
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
+
X
);
test1
.
setY
(
centerPointY
-
Y
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
list
.
add
(
test1
);
numberCycles
++;
}
total
=
total
-
base
;
base
=
base
+(
40
);
continue
;
}
if
(
base
>
0
){
/**每份点数 / 90度 算出每个点数的度数*/
double
eachDegrees
=
360
/
pointsPerShare
;
for
(
int
t
=
0
;
numberCycles
<
dataList
.
size
();
t
++){
Test
test1
=
new
Test
();
//算出A角度数 (每份点数-t)* 每点度数
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegrees
);
//Y轴
double
Y
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
//X轴
double
X
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getTarget
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
+
Y
);
test1
.
setY
(
centerPointY
-
X
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
list
.
add
(
test1
);
numberCycles
++;
}
break
;
}
}
}
/**Reids存储最新圆点数据*/
conn
.
set
(
"ListQuantity"
,
JSONArray
.
toJSONString
(
list
));
conn
.
close
();
return
list
;
}
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/DispersionDiagram.java
0 → 100644
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
relationalalgorithm
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.example.gajz.redis.ConFigRedis
;
import
com.example.gajz.transferrelationship.bean.vo.Test
;
import
com.example.gajz.transferrelationship.bean.vo.TransferCardVo
;
import
com.example.gajz.transferrelationship.config.Colour
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
redis.clients.jedis.Jedis
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* 关系图 - 分散图形算法工具类
*/
@Component
public
class
DispersionDiagram
{
/**关系图数据持久层*/
@Resource
TransferRelationshipMapper
transferRelationshipMapper
;
public
static
DispersionDiagram
test
;
@PostConstruct
public
void
init
(){
test
=
this
;
test
.
transferRelationshipMapper
=
transferRelationshipMapper
;
}
/**
* 分散图形算法
* @param numerical
*/
public
List
dispersionDiagram
(
String
numerical
){
/**最终返回值list*/
List
list
=
new
ArrayList
();
/**查询点数有多少*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
dataList1
=
transferRelationshipMapper
.
selectNumberPoints
();
/**开启Redis连接*/
Jedis
conn
=
ConFigRedis
.
getConn
();
String
time
=
conn
.
get
(
"TimeQuantity"
);
/**
* 判断数据库里面的点数是否有变动 如果有变动就重新生成图形
* 并且清空Redis数据库数据 重新放入新的生成后数据
*/
if
(
time
!=
null
&&
"null"
.
equals
(
numerical
)){
//如果数量相等代表数据库没有变动 就从Redis里面获取数据
if
(
Integer
.
parseInt
(
time
)
==
dataList1
.
size
()){
String
listQuantity
=
conn
.
get
(
"ListQuantity"
);
List
<
Test
>
dataArr
=
JSON
.
parseArray
(
listQuantity
,
Test
.
class
);
for
(
Test
test:
dataArr
){
list
.
add
(
test
);
}
conn
.
close
();
return
list
;
}
}
//Redis存储圆点数量
conn
.
set
(
"TimeQuantity"
,
String
.
valueOf
(
dataList1
.
size
()));
/**已经存在的点 会存储到map里面*/
HashMap
hashMap
=
new
HashMap
();
//查询转账人(中心点)信息
List
<
TransferCardVo
>
transferCardVos
=
transferRelationshipMapper
.
selectTransferCard
();
/**------------------------------------查询共有多少点 根据点的数量决定生成随机范围大小--------------------------------*/
double
range
=
Math
.
ceil
(
dataList1
.
size
()/
50000.00
);
double
numberRanges
=
range
*
5000
;
/**------------------------------------查询共有多少点 根据点的数量决定生成随机范围大小--------------------------------*/
/**----------------------------------计算中心点位置 开始------------------------------------*/
/**计算中心点方法*/
// List<CenterPointVo> centerPointVoList = calculationCenterPoint.CenterPointMethod(transferCardVos);
/**----------------------------------计算中心点位置 结束------------------------------------*/
/**---------------------------------查询拥有多人转账关系的点 开始--------------------------------*/
List
<
TransferCardVo
>
transferCardVos1
=
transferRelationshipMapper
.
selectmanyPeople
();
for
(
int
i
=
0
;
i
<
transferCardVos1
.
size
();
i
++){
//生成颜色
Colour
colour
=
new
Colour
();
String
code
=
colour
.
getColour
();
Test
test
=
new
Test
();
test
.
setId
(
transferCardVos1
.
get
(
i
).
getBankCardNo
());
test
.
setName
(
transferCardVos1
.
get
(
i
).
getName
());
test
.
setColor
(
code
);
test
.
setSize
(
7
);
test
.
setX
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
list
.
add
(
test
);
}
/**---------------------------------查询拥有多人转账关系的点 结束--------------------------------*/
double
centerPointX
=
0
;
double
centerPointY
=
0
;
//存储所有大圆的四角X Y轴数据
HashMap
xyMap
=
new
HashMap
();
/** 中心点*/
for
(
int
i
=
0
;
i
<
transferCardVos
.
size
();
i
++){
//是否重叠
boolean
overlap
=
false
;
//生成颜色
Colour
colour
=
new
Colour
();
String
code
=
colour
.
getColour
();
Test
test
=
new
Test
();
test
.
setId
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
test
.
setX
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setName
(
transferCardVos
.
get
(
i
).
getName
());
test
.
setColor
(
code
);
centerPointX
=
test
.
getX
();
centerPointY
=
test
.
getY
();
/**查询被转账人全部信息*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
transfer
=
transferRelationshipMapper
.
transferRelationship
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
/** -----------------------------------------------------------------------------------------*/
if
(
transfer
.
size
()==
0
||
transfer
.
size
()<=
100
){
test
.
setSize
(
10
);
}
else
if
(
transfer
.
size
()>=
100
){
test
.
setSize
(
transfer
.
size
()/
100
);
}
list
.
add
(
test
);
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
// /**算大圈半径专用 总数*/
// int bigTotal = transfer.size();
//
// /**算大圈半径专用 每圈点数*/
// int bigBase = 20;
// for (int n=1;bigTotal>0;n++){
// bigTotal = bigTotal-bigBase;
// bigBase = bigBase+50;
// }
// /** 大圆最后一圈半径 每份多少点数 */
// int bigPointsPerShare = bigBase/4;
// /**大圆最后一圈半径 相等于大圈半径 点数*距离 */
// int fullCircleRadius =bigPointsPerShare*2;
/** -------------------------------------------------------------------*/
// if (i==0){
// xyMap.put(i+"zX",(centerPointX-fullCircleRadius)); //圆左X轴
// xyMap.put(i+"zY",centerPointY); //圆左Y轴
// xyMap.put(i+"yX",(centerPointX+fullCircleRadius)); //圆右X轴
// xyMap.put(i+"yY",centerPointY); //圆右Y轴
// xyMap.put(i+"sX",centerPointX); //圆上X轴
// xyMap.put(i+"sY",(centerPointY-fullCircleRadius)); //圆上Y轴
// xyMap.put(i+"xX",centerPointX); //圆下X轴
// xyMap.put(i+"xY",(centerPointY+fullCircleRadius)); //圆下Y轴
// list.add(test);
// overlap=true;
// }else {
// for (int p=0;p<i;p++){
// double zX = (double) xyMap.get(p + "zX");
// double yX = (double) xyMap.get(p + "yX");
// double sY = (double) xyMap.get(p + "sY");
// double xY = (double) xyMap.get(p + "xY");
// if(((zX>(centerPointX-fullCircleRadius)&&zX>(centerPointX+fullCircleRadius)) ||(yX<(centerPointX-fullCircleRadius)&&yX<(centerPointX+fullCircleRadius)))
// ||
// ((sY>(centerPointY-fullCircleRadius)&&sY>(centerPointY+fullCircleRadius)) ||(xY<(centerPointY-fullCircleRadius)&&xY<(centerPointY+fullCircleRadius)))){
// if (p==i-1) {
// xyMap.put(i + "zX", (centerPointX-fullCircleRadius)); //圆左X轴
// xyMap.put(i + "zY", centerPointY); //圆左Y轴
// xyMap.put(i + "yX", (centerPointX+fullCircleRadius)); //圆右X轴
// xyMap.put(i + "yY", centerPointY); //圆右Y轴
// xyMap.put(i + "sX", centerPointX); //圆上X轴
// xyMap.put(i + "sY", (centerPointY-fullCircleRadius)); //圆上Y轴
// xyMap.put(i + "xX", centerPointX); //圆下X轴
// xyMap.put(i + "xY", (centerPointY+fullCircleRadius)); //圆下Y轴
// /** 将中心点X Y轴拼接 并存入Redis中*/
//// String position=test.getX()+"Y"+test.getY();
//// conn.set(test.getId(),position);
// list.add(test);
// overlap=true;
// }
// }else {
// //设置已经碰撞
// overlap=false;
// break;
// }
// }
// }
// if (!overlap){
// i--;
// continue;
// }
// /**将没有重复的值 存储到这个list里面*/
// List<com.example.gajz.transferrelationship.bean.param.data> dataList=new ArrayList<>();
// /**循环下级数据 将下级数据存入list中*/
// for (int p=0;p<transfer.size();p++){
// Object targets = hashMap.get(transfer.get(p).getTarget());
// if (targets==null) {
// com.example.gajz.transferrelationship.bean.param.data data = new com.example.gajz.transferrelationship.bean.param.data();
// data.setName(transfer.get(p).getName());
// data.setTarget(transfer.get(p).getTarget());
// data.setTransferTimes(transfer.get(p).getTransferTimes());
// dataList.add(data);
// hashMap.put(transfer.get(p).getTarget(), transfer.get(p).getTarget());
// }
// }
// /**循环次数*/
// int numberCycles =0;
// /**每圈点数 动态变化 */
// int base = 40;
// /**总数*/
// int total = dataList.size();
// /**圆圈层数 每循环一次 就是一圈*/
// for (int y=1;total>0;y++){
// /**圆分成四份 每份多少点数*/
// float pointsPerShare = base;
// /**每份点数 / 90度 算出每个点数的度数*/
// double eachDegree=360/pointsPerShare;
// /**小圆半径 点数X距离*/
// double circleRadius=15*y;
// /**点大小*/
// double pointSize =2;
// if (base<=total){
// for (int t=0;t<base;t++){
// Test test1=new Test();
// //算出A角度数 (每份点数-t)* 每点度数
// double Adegrees = (double) ((pointsPerShare-t) * eachDegree);
// //Y轴
// double Y= (double) (circleRadius*Math.cos(Adegrees));
// //X轴
// double X= (double) (circleRadius*Math.sin(Adegrees));
// test1.setId(dataList.get(numberCycles).getTarget());
// test1.setName(dataList.get(numberCycles).getName());
// test1.setX(centerPointX+X);
// test1.setY(centerPointY-Y);
// test1.setColor(code);
// test1.setSize(pointSize);
//// list.add(test1);
// numberCycles++;
// }
// total=total-base;
// base = base+(40);
// continue;
// }
// if (base>0){
// /**每份点数 / 90度 算出每个点数的度数*/
// double eachDegrees=360 /pointsPerShare;
// for (int t=0;numberCycles<dataList.size();t++){
// Test test1=new Test();
// //算出A角度数 (每份点数-t)* 每点度数
// double Adegrees = (double) ((pointsPerShare-t) * eachDegrees);
// //Y轴
// double Y= (double) (circleRadius*Math.sin(Adegrees));
// //X轴
// double X= (double) (circleRadius*Math.cos(Adegrees));
// test1.setId(dataList.get(numberCycles).getTarget());
// test1.setName(dataList.get(numberCycles).getName());
// test1.setX(centerPointX+Y);
// test1.setY(centerPointY-X);
// test1.setColor(code);
// test1.setSize(pointSize);
//// list.add(test1);
// numberCycles++;
// }
// break;
// }
// }
}
/**Reids存储最新圆点数据*/
conn
.
set
(
"ListQuantity"
,
JSONArray
.
toJSONString
(
list
));
conn
.
close
();
return
list
;
}
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/RelationalAlgorithm.java
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
relationalalgorithm
;
package
com
.
example
.
gajz
.
transferrelationship
.
relationalalgorithm
;
import
com.example.gajz.transferrelationship.bean.param.Dot
;
import
com.example.gajz.transferrelationship.bean.param.Dot
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.
neo4j
.Colour
;
import
com.example.gajz.transferrelationship.
config
.Colour
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -18,12 +18,10 @@ public class RelationalAlgorithm {
...
@@ -18,12 +18,10 @@ public class RelationalAlgorithm {
/**----------------------------公共使用值------------------------------*/
/**----------------------------公共使用值------------------------------*/
/**存放中心点list*/
/**存放中心点list*/
List
<
Dot
>
centerPointList
=
new
ArrayList
<>();
List
<
Dot
>
centerPointList
=
new
ArrayList
<>();
/**已经存在的点 会存储到map里面*/
HashMap
hashMap
=
new
HashMap
();
//查询转账人(中心点)信息
//查询转账人(中心点)信息
List
list
=
new
ArrayList
();
List
list
=
new
ArrayList
();
int
centerPointX
=
0
;
double
centerPointX
=
0
;
int
centerPointY
=
0
;
double
centerPointY
=
0
;
//存储所有大圆的四角X Y轴数据
//存储所有大圆的四角X Y轴数据
HashMap
xyMap
=
new
HashMap
();
HashMap
xyMap
=
new
HashMap
();
/**---------------------------------------------------------------------*/
/**---------------------------------------------------------------------*/
...
@@ -39,8 +37,6 @@ public class RelationalAlgorithm {
...
@@ -39,8 +37,6 @@ public class RelationalAlgorithm {
centerPointList
.
add
(
dot
);
centerPointList
.
add
(
dot
);
}
}
}
}
// System.out.println("共有"+centerPointList.size()+"个中心点");
/**循环中心点*/
/**循环中心点*/
for
(
int
i
=
0
;
i
<
centerPointList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
centerPointList
.
size
();
i
++){
//是否重叠
//是否重叠
...
@@ -97,21 +93,14 @@ public class RelationalAlgorithm {
...
@@ -97,21 +93,14 @@ public class RelationalAlgorithm {
dot
.
setSize
(
2
);
dot
.
setSize
(
2
);
}
}
/**每圈点数 动态变化 */
int
base
=
8
;
/**总数*/
int
total
=
dataList
.
size
();
/**循环次数*/
int
numberCycles
=
0
;
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
/**算大圈半径专用 总数*/
/**算大圈半径专用 总数*/
int
bigTotal
=
dataList
.
size
();
int
bigTotal
=
dataList
.
size
();
/**算大圈半径专用 每圈点数*/
/**算大圈半径专用 每圈点数*/
int
bigBase
=
8
;
int
bigBase
=
20
;
for
(
int
n
=
1
;
bigTotal
>
0
;
n
++){
for
(
int
n
=
1
;
bigTotal
>
0
;
n
++){
bigTotal
=
bigTotal
-
bigBase
;
bigTotal
=
bigTotal
-
bigBase
;
bigBase
=
bigBase
+
2
0
;
bigBase
=
bigBase
+
5
0
;
}
}
/** 大圆最后一圈半径 每份多少点数 */
/** 大圆最后一圈半径 每份多少点数 */
int
bigPointsPerShare
=
bigBase
/
4
;
int
bigPointsPerShare
=
bigBase
/
4
;
...
@@ -130,10 +119,10 @@ public class RelationalAlgorithm {
...
@@ -130,10 +119,10 @@ public class RelationalAlgorithm {
overlap
=
true
;
overlap
=
true
;
}
else
{
}
else
{
for
(
int
p
=
0
;
p
<
i
;
p
++){
for
(
int
p
=
0
;
p
<
i
;
p
++){
int
zX
=
(
int
)
xyMap
.
get
(
p
+
"zX"
);
double
zX
=
(
double
)
xyMap
.
get
(
p
+
"zX"
);
int
yX
=
(
int
)
xyMap
.
get
(
p
+
"yX"
);
double
yX
=
(
double
)
xyMap
.
get
(
p
+
"yX"
);
int
sY
=
(
int
)
xyMap
.
get
(
p
+
"sY"
);
double
sY
=
(
double
)
xyMap
.
get
(
p
+
"sY"
);
int
xY
=
(
int
)
xyMap
.
get
(
p
+
"xY"
);
double
xY
=
(
double
)
xyMap
.
get
(
p
+
"xY"
);
if
(
((
zX
>(
centerPointX
-
fullCircleRadius
)&&
zX
>(
centerPointX
+
fullCircleRadius
))
||(
yX
<(
centerPointX
-
fullCircleRadius
)&&
yX
<(
centerPointX
+
fullCircleRadius
)))
if
(
((
zX
>(
centerPointX
-
fullCircleRadius
)&&
zX
>(
centerPointX
+
fullCircleRadius
))
||(
yX
<(
centerPointX
-
fullCircleRadius
)&&
yX
<(
centerPointX
+
fullCircleRadius
)))
||
||
((
sY
>(
centerPointY
-
fullCircleRadius
)&&
sY
>(
centerPointY
+
fullCircleRadius
))
||(
xY
<(
centerPointY
-
fullCircleRadius
)&&
xY
<(
centerPointY
+
fullCircleRadius
)))
){
((
sY
>(
centerPointY
-
fullCircleRadius
)&&
sY
>(
centerPointY
+
fullCircleRadius
))
||(
xY
<(
centerPointY
-
fullCircleRadius
)&&
xY
<(
centerPointY
+
fullCircleRadius
)))
){
...
@@ -163,65 +152,39 @@ public class RelationalAlgorithm {
...
@@ -163,65 +152,39 @@ public class RelationalAlgorithm {
continue
;
continue
;
}
}
/**每圈点数 动态变化 */
int
base
=
40
;
/**总数*/
int
total
=
dataList
.
size
();
/**循环次数*/
int
numberCycles
=
0
;
/**圆圈层数 每循环一次 就是一圈*/
/**圆圈层数 每循环一次 就是一圈*/
for
(
int
y
=
1
;
total
>
0
;
y
++){
for
(
int
y
=
1
;
total
>
0
;
y
++){
/**点之间 x轴y轴间隔距离*/
int
distance
=
2
;
/**圆分成四份 每份多少点数*/
/**圆分成四份 每份多少点数*/
int
pointsPerShare
=
base
/
4
;
float
pointsPerShare
=
base
;
/**每份点数 算出每个点数的度数*/
double
eachDegree
=
360
/
pointsPerShare
;
/**小圆半径 点数X距离*/
/**小圆半径 点数X距离*/
int
circleRadius
=
pointsPerShare
*
distance
;
double
circleRadius
=
15
*
y
;
/**右下角逐渐递减*/
int
lowerRight
=
0
;
/**左下角逐渐递减*/
int
lowerLeft
=
0
;
/**左上角逐渐递减*/
int
upperLeft
=
0
;
/**点大小*/
/**点大小*/
double
pointSize
=
1
;
double
pointSize
=
1
;
if
(
base
<=
total
){
if
(
base
<=
total
){
for
(
int
t
=
0
;
t
<
base
;
t
++){
for
(
int
t
=
0
;
t
<
base
;
t
++){
Dot
test1
=
new
Dot
();
Dot
test1
=
new
Dot
();
if
(
t
<
pointsPerShare
){
//算出A角度数 (每份点数-t)* 每点度数
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegree
);
//Y轴
double
Y
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
//X轴
double
X
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
(
distance
*
t
)+
centerPoint
X
);
test1
.
setX
(
centerPointX
+
X
);
test1
.
setY
(
(
centerPointY
-
circleRadius
)+(
distance
*
t
)
);
test1
.
setY
(
centerPointY
-
Y
);
test1
.
setColor
(
code
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setSize
(
pointSize
);
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
}
else
if
(
t
<=
pointsPerShare
*
2
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
((
centerPointX
+
circleRadius
)-(
distance
*
lowerRight
));
test1
.
setY
(
centerPointY
+(
lowerRight
*
distance
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
lowerRight
++;
}
else
if
(
t
<=
pointsPerShare
*
3
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
((
centerPointX
-
circleRadius
)+(
distance
*
lowerLeft
));
test1
.
setY
(
centerPointY
+(
distance
*
lowerLeft
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
lowerLeft
++;
}
else
if
(
t
<=
pointsPerShare
*
4
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
-(
distance
*
upperLeft
));
test1
.
setY
((
centerPointY
-
circleRadius
)+(
distance
*
upperLeft
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
upperLeft
++;
}
// /** 将其他点 X Y轴拼接 并存入Redis中*/
// /** 将其他点 X Y轴拼接 并存入Redis中*/
// String position=test1.getX()+"Y"+test1.getY();
// String position=test1.getX()+"Y"+test1.getY();
// conn.set(test1.getId(),position);
// conn.set(test1.getId(),position);
...
@@ -229,55 +192,28 @@ public class RelationalAlgorithm {
...
@@ -229,55 +192,28 @@ public class RelationalAlgorithm {
numberCycles
++;
numberCycles
++;
}
}
total
=
total
-
base
;
total
=
total
-
base
;
base
=
base
+
2
0
;
base
=
base
+
4
0
;
continue
;
continue
;
}
}
if
(
base
>
0
){
if
(
base
>
0
){
/** 算出每个点数的度数*/
double
eachDegrees
=
360
/
pointsPerShare
;
for
(
int
t
=
0
;
numberCycles
<
dataList
.
size
();
t
++){
for
(
int
t
=
0
;
numberCycles
<
dataList
.
size
();
t
++){
Dot
test1
=
new
Dot
();
Dot
test1
=
new
Dot
();
if
(
t
<
pointsPerShare
){
//算出A角度数 (每份点数-t)* 每点度数
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegrees
);
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
//Y轴
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
double
Y
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
test1
.
setX
((
distance
*
t
)+
centerPointX
);
//X轴
test1
.
setY
((
centerPointY
-
circleRadius
)+(
distance
*
t
));
double
X
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
}
else
if
(
t
<=
pointsPerShare
*
2
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
((
centerPointX
+
circleRadius
)-(
distance
*
lowerRight
));
test1
.
setY
(
centerPointY
+(
lowerRight
*
distance
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
lowerRight
++;
}
else
if
(
t
<=
pointsPerShare
*
3
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
(
centerPointX
-
circleRadius
)+(
distance
*
lowerLeft
)
);
test1
.
setX
(
centerPointX
+
Y
);
test1
.
setY
(
centerPointY
+(
distance
*
lowerLeft
)
);
test1
.
setY
(
centerPointY
-
X
);
test1
.
setColor
(
code
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setSize
(
pointSize
);
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
lowerLeft
++;
}
else
if
(
t
<=
pointsPerShare
*
4
){
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getId
());
test1
.
setRelationship
(
dataList
.
get
(
numberCycles
).
getRelationship
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
-(
distance
*
upperLeft
));
test1
.
setY
((
centerPointY
-
circleRadius
)+(
distance
*
upperLeft
));
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
test1
.
setTransferTimes
(
dataList
.
get
(
numberCycles
).
getTransferTimes
());
upperLeft
++;
}
// /** 将其他点 X Y轴拼接 并存入Redis中*/
// String position=test1.getX()+"Y"+test1.getY();
// conn.set(test1.getId(),position);
list
.
add
(
test1
);
list
.
add
(
test1
);
numberCycles
++;
numberCycles
++;
}
}
...
...
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/TransferLocation.java
View file @
9ff72a72
...
@@ -96,8 +96,8 @@ public class TransferLocation {
...
@@ -96,8 +96,8 @@ public class TransferLocation {
searchRelationshipVoList
.
get
(
i
).
setY
(
300
);
searchRelationshipVoList
.
get
(
i
).
setY
(
300
);
searchRelationshipVoList
.
get
(
i
).
setX
(
300
);
searchRelationshipVoList
.
get
(
i
).
setX
(
300
);
searList
.
add
(
searchRelationshipVoList
.
get
(
i
));
searList
.
add
(
searchRelationshipVoList
.
get
(
i
));
int
centerPointX
=
searchRelationshipVoList
.
get
(
i
).
getX
();
double
centerPointX
=
searchRelationshipVoList
.
get
(
i
).
getX
();
int
centerPointY
=
searchRelationshipVoList
.
get
(
i
).
getY
();
double
centerPointY
=
searchRelationshipVoList
.
get
(
i
).
getY
();
/**循环次数*/
/**循环次数*/
int
numberCycles
=
0
;
int
numberCycles
=
0
;
/**循环下级点数 计算下级X Y轴位置*/
/**循环下级点数 计算下级X Y轴位置*/
...
@@ -192,8 +192,8 @@ public class TransferLocation {
...
@@ -192,8 +192,8 @@ public class TransferLocation {
for
(
int
f
=
0
;
f
<
searList
.
size
();
f
++){
for
(
int
f
=
0
;
f
<
searList
.
size
();
f
++){
/**中心点对比已经存储好的返回值 获取X Y轴*/
/**中心点对比已经存储好的返回值 获取X Y轴*/
if
(
cardNumber
.
equals
(
searList
.
get
(
f
).
getCardNumber
())){
if
(
cardNumber
.
equals
(
searList
.
get
(
f
).
getCardNumber
())){
int
centerPointX
=
searList
.
get
(
f
).
getX
();
double
centerPointX
=
searList
.
get
(
f
).
getX
();
int
centerPointY
=
searList
.
get
(
f
).
getY
();
double
centerPointY
=
searList
.
get
(
f
).
getY
();
/**循环次数*/
/**循环次数*/
int
numberCycles
=
0
;
int
numberCycles
=
0
;
/**循环下级点数 计算下级X Y轴位置*/
/**循环下级点数 计算下级X Y轴位置*/
...
...
src/main/java/com/example/gajz/transferrelationship/service/TransferRelationshipService.java
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
service
;
package
com
.
example
.
gajz
.
transferrelationship
.
service
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.transferrelationship.bean.dto.data
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.param.D
ot
;
import
com.example.gajz.transferrelationship.bean.param.D
iagramSpotParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -18,14 +17,14 @@ public interface TransferRelationshipService {
...
@@ -18,14 +17,14 @@ public interface TransferRelationshipService {
* 边
* 边
* @return
* @return
*/
*/
List
<
data
>
edge
();
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
();
/**
/**
* 点
* 点
* @return
* @return
*/
*/
List
diagramSpot
();
List
diagramSpot
(
DiagramSpotParam
diagramSpotParam
);
/**
/**
...
...
src/main/java/com/example/gajz/transferrelationship/service/serviceImpl/TransferRelationshipServiceImpl.java
View file @
9ff72a72
package
com
.
example
.
gajz
.
transferrelationship
.
service
.
serviceImpl
;
package
com
.
example
.
gajz
.
transferrelationship
.
service
.
serviceImpl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.example.gajz.redis.ConFigRedis
;
import
com.example.gajz.redis.ConFigRedis
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.ResultCode
;
import
com.example.gajz.result.ResultCode
;
import
com.example.gajz.transferrelationship.bean.dto.*
;
import
com.example.gajz.transferrelationship.bean.dto.*
;
import
com.example.gajz.transferrelationship.bean.echarts.lineStyle
;
import
com.example.gajz.transferrelationship.bean.echarts.lineStyle
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.param.DiagramSpotParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.vo.*
;
import
com.example.gajz.transferrelationship.bean.vo.*
;
import
com.example.gajz.transferrelationship.config.Colour
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
com.example.gajz.transferrelationship.hugegraphclient.HugeCollectionProperties
;
import
com.example.gajz.transferrelationship.relationalalgorithm.*
;
import
com.example.gajz.transferrelationship.neo4j.Colour
;
import
com.example.gajz.transferrelationship.relationalalgorithm.CalculationCenterPoint
;
import
com.example.gajz.transferrelationship.relationalalgorithm.RelationalAlgorithm
;
import
com.example.gajz.transferrelationship.relationalalgorithm.TransferLocation
;
import
com.example.gajz.transferrelationship.service.TransferRelationshipService
;
import
com.example.gajz.transferrelationship.service.TransferRelationshipService
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.
validation.annotation.Validated
;
import
org.springframework.
web.bind.annotation.RequestParam
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.Jedis
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -27,26 +28,32 @@ import java.util.List;
...
@@ -27,26 +28,32 @@ import java.util.List;
/**
/**
* @author lenovo
* @author lenovo
*/
*/
@Validated
@Service
@Service
public
class
TransferRelationshipServiceImpl
implements
TransferRelationshipService
{
public
class
TransferRelationshipServiceImpl
implements
TransferRelationshipService
{
/**关系图 数据持久层*/
@Autowired
@Autowired
TransferRelationshipMapper
transferRelationshipMapper
;
TransferRelationshipMapper
transferRelationshipMapper
;
/**HugeGraph*/
@Autowired
HugeCollectionProperties
hugeCollectionProperties
;
/**计算中心点位置工具类*/
@Autowired
@Autowired
CalculationCenterPoint
calculationCenterPoint
;
CalculationCenterPoint
calculationCenterPoint
;
/**关系图 - 分散图形算法工具类*/
@Autowired
DispersionDiagram
dispersionDiagram
;
/**关系图 - 圆形图形算法工具类*/
@Autowired
CircularAlgorithm
circularAlgorithm
;
/**
/**
* 转账关系
* 转账关系
* @return
* @return
*/
*/
@Override
@Override
public
List
<
data
>
edge
()
{
public
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
()
{
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
=
transferRelationshipMapper
.
edge
();
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
edge
=
transferRelationshipMapper
.
edge
();
List
transList
=
new
ArrayList
<>();
List
transList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
edge
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
edge
.
size
();
i
++){
...
@@ -79,188 +86,15 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -79,188 +86,15 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
* 点
* 点
*/
*/
@Override
@Override
public
List
diagramSpot
()
{
public
List
diagramSpot
(
DiagramSpotParam
diagramSpotParam
)
{
/**已经存在的点 会存储到map里面*/
if
(
diagramSpotParam
.
getDrawingNumber
()==
1
){
/**分散图形算法 */
HashMap
hashMap
=
new
HashMap
();
List
list
=
dispersionDiagram
.
dispersionDiagram
(
diagramSpotParam
.
getNumerical
());
//查询转账人(中心点)信息
List
<
TransferCardVo
>
transferCardVos
=
transferRelationshipMapper
.
selectTransferCard
();
/**----------------------------------计算中心点位置 开始------------------------------------*/
/**计算中心点方法*/
// List<CenterPointVo> centerPointVoList = calculationCenterPoint.CenterPointMethod(transferCardVos);
/**----------------------------------计算中心点位置 结束------------------------------------*/
List
list
=
new
ArrayList
();
double
centerPointX
=
0
;
double
centerPointY
=
0
;
//重复次数
int
repeatFrequency
=
0
;
//存储所有大圆的四角X Y轴数据
HashMap
xyMap
=
new
HashMap
();
/** 中心点*/
for
(
int
i
=
0
;
i
<
transferCardVos
.
size
();
i
++){
//是否重叠
boolean
overlap
=
false
;
//生成颜色
Colour
colour
=
new
Colour
();
String
code
=
colour
.
getColour
();
Test
test
=
new
Test
();
test
.
setId
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
test
.
setX
((
float
)(
Math
.
random
()*
5000
));
test
.
setY
((
float
)(
Math
.
random
()*
5000
));
test
.
setName
(
transferCardVos
.
get
(
i
).
getName
());
test
.
setColor
(
code
);
centerPointX
=
test
.
getX
();
centerPointY
=
test
.
getY
();
/** -----------------------------去掉被转账人对应中心点重复出现点 代码--------------------------------*/
/**查询被转账人全部信息*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
transfer
=
transferRelationshipMapper
.
transferRelationship
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
/** -----------------------------------------------------------------------------------------*/
if
(
transfer
.
size
()==
0
||
transfer
.
size
()<=
100
){
test
.
setSize
(
2
);
}
else
if
(
transfer
.
size
()>=
100
){
test
.
setSize
(
2
);
}
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
/**算大圈半径专用 总数*/
int
bigTotal
=
transfer
.
size
();
/**算大圈半径专用 每圈点数*/
int
bigBase
=
20
;
for
(
int
n
=
1
;
bigTotal
>
0
;
n
++){
bigTotal
=
bigTotal
-
bigBase
;
bigBase
=
bigBase
+
50
;
}
/** 大圆最后一圈半径 每份多少点数 */
int
bigPointsPerShare
=
bigBase
/
4
;
/**大圆最后一圈半径 相等于大圈半径 点数*距离 */
int
fullCircleRadius
=
bigPointsPerShare
*
2
;
/** -------------------------------------------------------------------*/
if
(
i
==
0
){
xyMap
.
put
(
i
+
"zX"
,(
centerPointX
-
fullCircleRadius
));
//圆左X轴
xyMap
.
put
(
i
+
"zY"
,
centerPointY
);
//圆左Y轴
xyMap
.
put
(
i
+
"yX"
,(
centerPointX
+
fullCircleRadius
));
//圆右X轴
xyMap
.
put
(
i
+
"yY"
,
centerPointY
);
//圆右Y轴
xyMap
.
put
(
i
+
"sX"
,
centerPointX
);
//圆上X轴
xyMap
.
put
(
i
+
"sY"
,(
centerPointY
-
fullCircleRadius
));
//圆上Y轴
xyMap
.
put
(
i
+
"xX"
,
centerPointX
);
//圆下X轴
xyMap
.
put
(
i
+
"xY"
,(
centerPointY
+
fullCircleRadius
));
//圆下Y轴
list
.
add
(
test
);
overlap
=
true
;
}
else
{
for
(
int
p
=
0
;
p
<
i
;
p
++){
double
zX
=
(
double
)
xyMap
.
get
(
p
+
"zX"
);
double
yX
=
(
double
)
xyMap
.
get
(
p
+
"yX"
);
double
sY
=
(
double
)
xyMap
.
get
(
p
+
"sY"
);
double
xY
=
(
double
)
xyMap
.
get
(
p
+
"xY"
);
if
(((
zX
>(
centerPointX
-
fullCircleRadius
)&&
zX
>(
centerPointX
+
fullCircleRadius
))
||(
yX
<(
centerPointX
-
fullCircleRadius
)&&
yX
<(
centerPointX
+
fullCircleRadius
)))
||
((
sY
>(
centerPointY
-
fullCircleRadius
)&&
sY
>(
centerPointY
+
fullCircleRadius
))
||(
xY
<(
centerPointY
-
fullCircleRadius
)&&
xY
<(
centerPointY
+
fullCircleRadius
)))){
if
(
p
==
i
-
1
)
{
xyMap
.
put
(
i
+
"zX"
,
(
centerPointX
-
fullCircleRadius
));
//圆左X轴
xyMap
.
put
(
i
+
"zY"
,
centerPointY
);
//圆左Y轴
xyMap
.
put
(
i
+
"yX"
,
(
centerPointX
+
fullCircleRadius
));
//圆右X轴
xyMap
.
put
(
i
+
"yY"
,
centerPointY
);
//圆右Y轴
xyMap
.
put
(
i
+
"sX"
,
centerPointX
);
//圆上X轴
xyMap
.
put
(
i
+
"sY"
,
(
centerPointY
-
fullCircleRadius
));
//圆上Y轴
xyMap
.
put
(
i
+
"xX"
,
centerPointX
);
//圆下X轴
xyMap
.
put
(
i
+
"xY"
,
(
centerPointY
+
fullCircleRadius
));
//圆下Y轴
/** 将中心点X Y轴拼接 并存入Redis中*/
// String position=test.getX()+"Y"+test.getY();
// conn.set(test.getId(),position);
list
.
add
(
test
);
overlap
=
true
;
repeatFrequency
=
0
;
}
}
else
{
//设置碰撞次数
repeatFrequency
++;
//设置已经碰撞
overlap
=
false
;
break
;
}
}
}
if
(!
overlap
){
i
--;
continue
;
}
/**将没有重复的值 存储到这个list里面*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
dataList
=
new
ArrayList
<>();
/**循环下级数据 将下级数据存入list中*/
for
(
int
p
=
0
;
p
<
transfer
.
size
();
p
++){
Object
targets
=
hashMap
.
get
(
transfer
.
get
(
p
).
getTarget
());
if
(
targets
==
null
)
{
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
data
=
new
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
();
data
.
setName
(
transfer
.
get
(
p
).
getName
());
data
.
setTarget
(
transfer
.
get
(
p
).
getTarget
());
data
.
setTransferTimes
(
transfer
.
get
(
p
).
getTransferTimes
());
dataList
.
add
(
data
);
hashMap
.
put
(
transfer
.
get
(
p
).
getTarget
(),
transfer
.
get
(
p
).
getTarget
());
}
}
/**循环次数*/
int
numberCycles
=
0
;
/**每圈点数 动态变化 */
int
base
=
40
;
/**总数*/
int
total
=
dataList
.
size
();
/**圆圈层数 每循环一次 就是一圈*/
for
(
int
y
=
1
;
total
>
0
;
y
++){
/**圆分成四份 每份多少点数*/
float
pointsPerShare
=
base
;
/**每份点数 / 90度 算出每个点数的度数*/
double
eachDegree
=
360
/
pointsPerShare
;
/**小圆半径 点数X距离*/
double
circleRadius
=
15
*
y
;
/**点大小*/
double
pointSize
=
1
;
if
(
base
<=
total
){
for
(
int
t
=
0
;
t
<
base
;
t
++){
Test
test1
=
new
Test
();
//算出A角度数 (每份点数-t)* 每点度数
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegree
);
//Y轴
double
a
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
//X轴
double
b
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getTarget
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
+
b
);
test1
.
setY
(
centerPointY
-
a
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
list
.
add
(
test1
);
numberCycles
++;
}
total
=
total
-
base
;
base
=
base
+(
40
);
continue
;
}
if
(
base
>
0
){
/**每份点数 / 90度 算出每个点数的度数*/
double
eachDegrees
=
90
/
pointsPerShare
;
for
(
int
t
=
0
;
numberCycles
<
dataList
.
size
();
t
++){
Test
test1
=
new
Test
();
//算出A角度数 (每份点数-t)* 每点度数
double
Adegrees
=
(
double
)
((
pointsPerShare
-
t
)
*
eachDegrees
);
//Y轴
double
a
=
(
double
)
(
circleRadius
*
Math
.
sin
(
Adegrees
));
//X轴
double
b
=
(
double
)
(
circleRadius
*
Math
.
cos
(
Adegrees
));
test1
.
setId
(
dataList
.
get
(
numberCycles
).
getTarget
());
test1
.
setName
(
dataList
.
get
(
numberCycles
).
getName
());
test1
.
setX
(
centerPointX
+
b
);
test1
.
setY
(
centerPointY
-
a
);
test1
.
setColor
(
code
);
test1
.
setSize
(
pointSize
);
list
.
add
(
test1
);
numberCycles
++;
}
break
;
}
}
}
return
list
;
return
list
;
}
else
if
(
diagramSpotParam
.
getDrawingNumber
()==
0
){
/**圆形图形算法*/
List
list
=
circularAlgorithm
.
circularAlgorithm
(
diagramSpotParam
.
getNumerical
());
return
list
;
}
return
null
;
}
}
/**
/**
...
@@ -270,7 +104,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -270,7 +104,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
*/
*/
@Override
@Override
public
Result
searchRelationship
(
String
cardnumbe
)
{
public
Result
searchRelationship
(
String
cardnumbe
)
{
try
{
//
try {
//查询搜索人信息 转账人
//查询搜索人信息 转账人
List
<
SearchRelationshipVo
>
searchRelationshipVos1
=
transferRelationshipMapper
.
personalInformationTransferor
(
cardnumbe
);
List
<
SearchRelationshipVo
>
searchRelationshipVos1
=
transferRelationshipMapper
.
personalInformationTransferor
(
cardnumbe
);
//查询搜索人信息 被转账人
//查询搜索人信息 被转账人
...
@@ -407,9 +241,9 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -407,9 +241,9 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
redis
.
close
();
redis
.
close
();
List
list
=
relationalAlgorithm
.
searchPresentation
(
searchRelationshipVoList
,
intFlag
);
List
list
=
relationalAlgorithm
.
searchPresentation
(
searchRelationshipVoList
,
intFlag
);
return
new
Result
(
ResultCode
.
SUCCESS
,
list
);
return
new
Result
(
ResultCode
.
SUCCESS
,
list
);
}
catch
(
Exception
e
){
//
}catch (Exception e){
return
new
Result
(
ResultCode
.
FAIL
);
//
return new Result(ResultCode.FAIL);
}
//
}
}
}
/**
/**
...
@@ -436,6 +270,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -436,6 +270,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
echartsUserVo
.
setY
(
Integer
.
parseInt
(
Y
));
echartsUserVo
.
setY
(
Integer
.
parseInt
(
Y
));
return
new
Result
(
ResultCode
.
SUCCESS
,
echartsUserVo
);
return
new
Result
(
ResultCode
.
SUCCESS
,
echartsUserVo
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
System
.
out
.
println
(
e
);
return
new
Result
(
ResultCode
.
FAIL
);
return
new
Result
(
ResultCode
.
FAIL
);
}
}
}
}
...
@@ -463,7 +298,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -463,7 +298,7 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
* @return
* @return
*/
*/
@Override
@Override
public
Result
pointSearch
(
String
name
)
{
public
Result
pointSearch
(
@RequestParam
(
"name"
)
String
name
)
{
try
{
try
{
boolean
numeric
=
StringUtils
.
isNumeric
(
name
);
boolean
numeric
=
StringUtils
.
isNumeric
(
name
);
String
cardNumber
=
null
;
String
cardNumber
=
null
;
...
@@ -923,14 +758,4 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -923,14 +758,4 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
}
}
return
new
Result
(
ResultCode
.
SUCCESS
,
echartsTrBetweenTwoPersonsVosList
);
return
new
Result
(
ResultCode
.
SUCCESS
,
echartsTrBetweenTwoPersonsVosList
);
}
}
// y:3,角度:121.09090828895569,Y轴:-6.261220312519955,X轴:44.56228360618526
// y:3,角度:117.81818103790283,Y轴:0.38053923723796884,X轴:-44.998390969999384
public
static
void
main
(
String
[]
args
){
double
jiao
=
117.81818103790283
;
double
a
=
Math
.
cos
(
jiao
)*
33
;
double
b
=
Math
.
sin
(
jiao
)*
33
;
System
.
out
.
println
(
a
+
"-"
+
b
);
}
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesEight.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程8
* @author lenovo
*/
public
class
ThreadsMultipleVerticesEight
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesEightList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程8开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程8结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesEleven.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程11
* @author lenovo
*/
public
class
ThreadsMultipleVerticesEleven
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesElevenList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程11开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程11结束"
+
df
.
format
(
new
Date
()));
hugeClient
.
close
();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesFive.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程5
* @author lenovo
*/
public
class
ThreadsMultipleVerticesFive
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesFiveList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程5开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程5结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesFour.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程4
* @author lenovo
*/
public
class
ThreadsMultipleVerticesFour
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesFourList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程4开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程4结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesNine.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程9
* @author lenovo
*/
public
class
ThreadsMultipleVerticesNine
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesNineList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程9开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程9结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesOne.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程1
* @author lenovo
*/
public
class
ThreadsMultipleVerticesOne
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesOneList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程1开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程1结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesSeven.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程7
* @author lenovo
*/
public
class
ThreadsMultipleVerticesSeven
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesSevenList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程7开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程7结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesSix.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程6
* @author lenovo
*/
public
class
ThreadsMultipleVerticesSix
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesSixList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程6开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程6结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesTen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程10
* @author lenovo
*/
public
class
ThreadsMultipleVerticesTen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesTenList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程10开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程10结束"
+
df
.
format
(
new
Date
()));
hugeClient
.
close
();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesThree.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程3
* @author lenovo
*/
public
class
ThreadsMultipleVerticesThree
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesThreeList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程3开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程3结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesTwelve.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程12
* @author lenovo
*/
public
class
ThreadsMultipleVerticesTwelve
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesTwelveList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程12开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程12结束"
+
df
.
format
(
new
Date
()));
hugeClient
.
close
();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/ThreadsMultipleVerticesTwo.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.constant.T
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 收款人顶点数据导入线程2
* @author lenovo
*/
public
class
ThreadsMultipleVerticesTwo
implements
Runnable
{
List
<
TransferredPersonVo
>
transferredPersonList
;
public
void
ThreadsMultipleVerticesTwoList
(
List
<
TransferredPersonVo
>
transferredPersonVos
){
this
.
transferredPersonList
=
transferredPersonVos
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"顶点数据导入线程2开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferredPersonList
.
size
();
i
++){
/**添加收款人顶点数据*/
graph
.
addVertex
(
/**设置ID*/
T
.
id
,
transferredPersonList
.
get
(
i
).
getEndCardNo
(),
T
.
label
,
"收款人"
,
/**设置收款次数*/
"收款次数"
,
transferredPersonList
.
get
(
i
).
getNumber
());
}
System
.
out
.
println
(
"顶点数据导入线程2结束"
+
df
.
format
(
new
Date
()));
// hugeClient.close();
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsEight.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系8号线程
* @author lenovo
*/
public
class
TransferAccountsEight
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsEightList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程8开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程8结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsEighteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系18号线程
* @author lenovo
*/
public
class
TransferAccountsEighteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsEighteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程18开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程18结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsEleven.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系11号线程
* @author lenovo
*/
public
class
TransferAccountsEleven
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsElevenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程11开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程11结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsFifteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系15号线程
* @author lenovo
*/
public
class
TransferAccountsFifteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsFifteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程15开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程15结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsFive.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author lenovo
*/
public
class
TransferAccountsFive
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsFiveList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程5开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程5结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsFour.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author lenovo
*/
public
class
TransferAccountsFour
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsFourList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程4开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程4结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsFourteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系14号线程
* @author lenovo
*/
public
class
TransferAccountsFourteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsFourteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程14开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程14结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsNine.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系9号线程
* @author lenovo
*/
public
class
TransferAccountsNine
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsNineList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程9开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程9结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsNineteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系19号线程
* @author lenovo
*/
public
class
TransferAccountsNineteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsNineteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程19开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程19结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsOne.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author lenovo
*/
public
class
TransferAccountsOne
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsOneList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
System
.
out
.
println
(
transferCollectionList
.
size
());
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程1开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程1结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsSeven.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系7号线程
* @author lenovo
*/
public
class
TransferAccountsSeven
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsSevenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程7开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程7结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsSeventeen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系17号线程
* @author lenovo
*/
public
class
TransferAccountsSeventeen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsSeventeenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程17开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程17结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsSix.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 线程6
* @author lenovo
*/
public
class
TransferAccountsSix
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsSixList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程6开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程6结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsSixteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系16号线程
* @author lenovo
*/
public
class
TransferAccountsSixteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsSixteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程16开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程16结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsTen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系10号线程
* @author lenovo
*/
public
class
TransferAccountsTen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsTenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程10开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程10结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsThirteen.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系13号线程
* @author lenovo
*/
public
class
TransferAccountsThirteen
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsThirteenList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程13开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程13结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsThree.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author lenovo
*/
public
class
TransferAccountsThree
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsThreeList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程3开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程3结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsTwelve.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系12号线程
* @author lenovo
*/
public
class
TransferAccountsTwelve
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsTwelveList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程12开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程12结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsTwenty.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 导入转账关系20号线程
* @author lenovo
*/
public
class
TransferAccountsTwenty
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsTwentyList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程20开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程20结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/java/com/example/gajz/transferrelationship/thread/TransferAccountsTwo.java
deleted
100644 → 0
View file @
f9bd15b9
package
com
.
example
.
gajz
.
transferrelationship
.
thread
;
import
com.baidu.hugegraph.driver.GraphManager
;
import
com.baidu.hugegraph.driver.HugeClient
;
import
com.baidu.hugegraph.structure.graph.Vertex
;
import
com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author lenovo
*/
public
class
TransferAccountsTwo
implements
Runnable
{
List
<
TransferredPersonVo
>
transferList
;
public
void
TransferAccountsTwoList
(
List
<
TransferredPersonVo
>
transferCollectionList
){
this
.
transferList
=
transferCollectionList
;
}
@Override
public
void
run
()
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
System
.
out
.
println
(
"线程2开始"
+
df
.
format
(
new
Date
()));
HugeClient
hugeClient
=
HugeClient
.
builder
(
"http://36.148.1.253:8289"
,
"hugegraph2"
)
/*** 默认未开启用户权限*/
.
configUser
(
"**"
,
"**"
)
.
build
();
GraphManager
graph
=
hugeClient
.
graph
();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++){
Vertex
transferor
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getBankCardNo
());
Vertex
payee
=
graph
.
getVertex
(
transferList
.
get
(
i
).
getEndCardNo
());
//创建转账关系
transferor
.
addEdge
(
"多人转账"
,
payee
,
"转账次数"
,
transferList
.
get
(
i
).
getNumber
());
}
hugeClient
.
close
();
System
.
out
.
println
(
"线程2结束"
+
df
.
format
(
new
Date
()));
}
}
src/main/resources/application.properties
View file @
9ff72a72
...
@@ -13,3 +13,4 @@ server.port=8090
...
@@ -13,3 +13,4 @@ server.port=8090
spring.servlet.multipart.max-file-size
=
50MB
spring.servlet.multipart.max-file-size
=
50MB
#设置单次请求文件的总大小
#设置单次请求文件的总大小
spring.servlet.multipart.max-request-size
=
50MB
spring.servlet.multipart.max-request-size
=
50MB
src/main/resources/application.yml
View file @
9ff72a72
...
@@ -50,3 +50,4 @@ spring:
...
@@ -50,3 +50,4 @@ spring:
#logging:
#logging:
## level:
## level:
## com.example.demo.mapper: DEBUG
## com.example.demo.mapper: DEBUG
src/main/resources/mapper/TransferRelationshipMapper.xml
View file @
9ff72a72
...
@@ -17,12 +17,25 @@
...
@@ -17,12 +17,25 @@
<!--查询被转账人全部信息-->
<!--查询被转账人全部信息-->
<select
id=
"
transferRelationship
"
resultType=
"com.example.gajz.transferrelationship.bean.param.data"
>
<select
id=
"
correlationPoint
"
resultType=
"com.example.gajz.transferrelationship.bean.param.data"
>
select distinct end_account_name as name,end_card_no as target from abc_statement where bank_card_no=#{bankCardNo}
select distinct end_account_name as name,end_card_no as target from abc_statement where bank_card_no=#{bankCardNo}
HAVING end_card_no not in
HAVING end_card_no not in
(select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null)
(select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null)
</select>
</select>
<!--查询被转账人全部信息 只查询跟中心点有关系的被转账人信息-->
<select
id=
"transferRelationship"
resultType=
"com.example.gajz.transferrelationship.bean.param.data"
>
select end_account_name as name,end_card_no as target from (
select end_account_name,bank_card_no,end_card_no from (
select count(id),end_account_name,bank_card_no,end_card_no from abc_statement
where bank_card_no is not null and end_card_no is not null
GROUP BY bank_card_no, end_card_no ) a
group by a.end_card_no HAVING count(end_card_no)=1 ) b
where b.bank_card_no=#{bankCardNo}
HAVING b.end_card_no not in
(select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null)
</select>
<!--关系图搜索接口 查询搜索人转账关系-->
<!--关系图搜索接口 查询搜索人转账关系-->
<select
id=
"transferRecord"
resultType=
"com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo"
>
<select
id=
"transferRecord"
resultType=
"com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo"
>
select "转账" as relationship,end_account_name as name,end_card_no as cardNumber from abc_statement
select "转账" as relationship,end_account_name as name,end_card_no as cardNumber from abc_statement
...
@@ -161,5 +174,19 @@
...
@@ -161,5 +174,19 @@
)
)
</select>
</select>
<!--查询共有多少点 根据点的数量决定生成随机范围大小-->
<select
id=
"selectNumberPoints"
resultType=
"com.example.gajz.transferrelationship.bean.param.data"
>
SELECT bank_card_no as source,end_card_no as target FROM `abc_statement` where bank_card_no is not null and bank_card_no != '' and end_card_no is not null
group by source ,target
</select>
<!--查询拥有多人转账关系的点-->
<select
id=
"selectmanyPeople"
resultType=
"com.example.gajz.transferrelationship.bean.vo.TransferCardVo"
>
select end_account_name as name,end_card_no as bankCardNo from (
select count(id),end_account_name,bank_card_no,end_card_no from abc_statement
where bank_card_no is not null and end_card_no is not null
GROUP BY bank_card_no, end_card_no ) a
group by a.end_card_no HAVING count(end_card_no)>1
</select>
</mapper>
</mapper>
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