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
375cf55a
Commit
375cf55a
authored
Jan 14, 2022
by
wuqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/1/14 吴卿华
parent
9ff72a72
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
30 deletions
+113
-30
TimeConFig.java
src/main/java/com/example/gajz/config/TimeConFig.java
+0
-3
Colour.java
.../com/example/gajz/transferrelationship/config/Colour.java
+2
-0
PositionConfig.java
...mple/gajz/transferrelationship/config/PositionConfig.java
+24
-0
TransferRelationshipController.java
...lationship/controller/TransferRelationshipController.java
+0
-1
TransferRelationshipMapper.java
.../transferrelationship/dao/TransferRelationshipMapper.java
+7
-0
CircularAlgorithm.java
...errelationship/relationalalgorithm/CircularAlgorithm.java
+0
-1
DispersionDiagram.java
...errelationship/relationalalgorithm/DispersionDiagram.java
+67
-23
TransferRelationshipServiceImpl.java
.../service/serviceImpl/TransferRelationshipServiceImpl.java
+2
-2
TransferRelationshipMapper.xml
src/main/resources/mapper/TransferRelationshipMapper.xml
+11
-0
No files found.
src/main/java/com/example/gajz/config/TimeConFig.java
View file @
375cf55a
package
com
.
example
.
gajz
.
config
;
package
com
.
example
.
gajz
.
config
;
import
org.neo4j.cypher.internal.frontend.v2_3.ast.functions.Str
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
...
...
src/main/java/com/example/gajz/transferrelationship/config/Colour.java
View file @
375cf55a
...
@@ -37,4 +37,6 @@ public class Colour {
...
@@ -37,4 +37,6 @@ public class Colour {
String
cos
=
"0x"
+
Integer
.
toHexString
((
color1
.
getRGB
()
&
0xffffff
)
|
0x1000000
).
substring
(
1
);
String
cos
=
"0x"
+
Integer
.
toHexString
((
color1
.
getRGB
()
&
0xffffff
)
|
0x1000000
).
substring
(
1
);
return
cos
;
return
cos
;
}
}
}
}
src/main/java/com/example/gajz/transferrelationship/config/PositionConfig.java
0 → 100644
View file @
375cf55a
package
com
.
example
.
gajz
.
transferrelationship
.
config
;
import
java.util.Random
;
/**
* 位置生成测试工具类
*/
public
class
PositionConfig
{
public
static
void
main
(
String
[]
args
)
{
Random
random
=
new
Random
();
// int r = random.nextInt(500)+400; // random.nextInt(100)只能生成[0,100)
for
(
int
i
=
0
;
i
<
10
;
i
++){
/**(数据类型)(最小值+Math.random()*(最大值-最小值+1))*/
int
r
=
(
int
)
(
300
+
Math
.
random
()*(
600
-
300
+
1
));
System
.
out
.
println
(
r
);
}
}
}
src/main/java/com/example/gajz/transferrelationship/controller/TransferRelationshipController.java
View file @
375cf55a
...
@@ -3,7 +3,6 @@ import com.alibaba.excel.EasyExcel;
...
@@ -3,7 +3,6 @@ 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.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
...
...
src/main/java/com/example/gajz/transferrelationship/dao/TransferRelationshipMapper.java
View file @
375cf55a
...
@@ -145,4 +145,11 @@ public interface TransferRelationshipMapper {
...
@@ -145,4 +145,11 @@ public interface TransferRelationshipMapper {
* @return
* @return
*/
*/
List
<
data
>
correlationPoint
(
String
bankCardNo
);
List
<
data
>
correlationPoint
(
String
bankCardNo
);
/**
* 查询被转账人 多人转账关系数据方法
* @param bankCardNo
* @return
*/
List
<
TransferCardVo
>
selectmanyPeoples
(
String
bankCardNo
);
}
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/CircularAlgorithm.java
View file @
375cf55a
...
@@ -8,7 +8,6 @@ import com.example.gajz.transferrelationship.config.Colour;
...
@@ -8,7 +8,6 @@ import com.example.gajz.transferrelationship.config.Colour;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.Jedis
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
...
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/DispersionDiagram.java
View file @
375cf55a
...
@@ -7,7 +7,6 @@ import com.example.gajz.transferrelationship.bean.vo.TransferCardVo;
...
@@ -7,7 +7,6 @@ import com.example.gajz.transferrelationship.bean.vo.TransferCardVo;
import
com.example.gajz.transferrelationship.config.Colour
;
import
com.example.gajz.transferrelationship.config.Colour
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
com.example.gajz.transferrelationship.dao.TransferRelationshipMapper
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.Jedis
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -76,20 +75,20 @@ public class DispersionDiagram {
...
@@ -76,20 +75,20 @@ public class DispersionDiagram {
// List<CenterPointVo> centerPointVoList = calculationCenterPoint.CenterPointMethod(transferCardVos);
// List<CenterPointVo> centerPointVoList = calculationCenterPoint.CenterPointMethod(transferCardVos);
/**----------------------------------计算中心点位置 结束------------------------------------*/
/**----------------------------------计算中心点位置 结束------------------------------------*/
/**---------------------------------查询拥有多人转账关系的点 开始--------------------------------*/
/**---------------------------------查询拥有多人转账关系的点 开始--------------------------------*/
List
<
TransferCardVo
>
transferCardVos1
=
transferRelationshipMapper
.
selectmanyPeople
();
//
List<TransferCardVo> transferCardVos1 = transferRelationshipMapper.selectmanyPeople();
for
(
int
i
=
0
;
i
<
transferCardVos1
.
size
();
i
++){
//
for (int i=0;i<transferCardVos1.size();i++){
//生成颜色
////
//生成颜色
Colour
colour
=
new
Colour
();
////
Colour colour=new Colour();
String
code
=
colour
.
getColour
();
////
String code=colour.getColour();
Test
test
=
new
Test
();
////
Test test=new Test();
test
.
setId
(
transferCardVos1
.
get
(
i
).
getBankCardNo
());
////
test.setId(transferCardVos1.get(i).getBankCardNo());
test
.
setName
(
transferCardVos1
.
get
(
i
).
getName
());
////
test.setName(transferCardVos1.get(i).getName());
test
.
setColor
(
code
);
////
test.setColor(code);
test
.
setSize
(
7
);
////
test.setSize(7);
test
.
setX
((
float
)(
Math
.
random
()*
numberRanges
));
////
test.setX((float)(Math.random()*numberRanges));
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
////
test.setY((float)(Math.random()*numberRanges));
list
.
add
(
test
);
////
list.add(test);
}
////
}
/**---------------------------------查询拥有多人转账关系的点 结束--------------------------------*/
/**---------------------------------查询拥有多人转账关系的点 结束--------------------------------*/
double
centerPointX
=
0
;
double
centerPointX
=
0
;
...
@@ -98,8 +97,10 @@ public class DispersionDiagram {
...
@@ -98,8 +97,10 @@ public class DispersionDiagram {
HashMap
xyMap
=
new
HashMap
();
HashMap
xyMap
=
new
HashMap
();
/** 中心点*/
/** 中心点*/
for
(
int
i
=
0
;
i
<
transferCardVos
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
transferCardVos
.
size
();
i
++){
//存储已经生成的点
hashMap
.
put
(
transferCardVos
.
get
(
i
).
getBankCardNo
(),
"1"
);
//是否重叠
//是否重叠
boolean
overlap
=
false
;
//
boolean overlap=false;
//生成颜色
//生成颜色
Colour
colour
=
new
Colour
();
Colour
colour
=
new
Colour
();
String
code
=
colour
.
getColour
();
String
code
=
colour
.
getColour
();
...
@@ -109,17 +110,60 @@ public class DispersionDiagram {
...
@@ -109,17 +110,60 @@ public class DispersionDiagram {
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setY
((
float
)(
Math
.
random
()*
numberRanges
));
test
.
setName
(
transferCardVos
.
get
(
i
).
getName
());
test
.
setName
(
transferCardVos
.
get
(
i
).
getName
());
test
.
setColor
(
code
);
test
.
setColor
(
code
);
centerPointX
=
test
.
getX
();
//
centerPointX=test.getX();
centerPointY
=
test
.
getY
();
//
centerPointY=test.getY();
/
**查询被转账人全部信息*/
/
/查询被转账人 多人转账关系数据方法
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
transfer
=
transferRelationshipMapper
.
transferRelationship
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
List
<
TransferCardVo
>
transferCardVos1
=
transferRelationshipMapper
.
selectmanyPeoples
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
/** -----------------------------------------------------------------------------------------*/
/** -----------------------------------------------------------------------------------------*/
if
(
transfer
.
size
()==
0
||
transfer
.
size
()<=
100
){
//范围最小值
int
minimum
=
0
;
//范围最大值
int
maximum
=
0
;
if
(
transferCardVos1
.
size
()==
0
||
transferCardVos1
.
size
()<=
50
){
test
.
setSize
(
10
);
test
.
setSize
(
10
);
}
else
if
(
transfer
.
size
()>=
100
){
minimum
=
100
;
test
.
setSize
(
transfer
.
size
()/
100
);
maximum
=
200
;
}
else
if
(
transferCardVos1
.
size
()>
50
&&
transferCardVos1
.
size
()<=
100
){
test
.
setSize
(
15
);
minimum
=
300
;
maximum
=
300
;
}
else
if
(
transferCardVos1
.
size
()>
100
&&
transferCardVos1
.
size
()<=
200
){
test
.
setSize
(
20
);
minimum
=
300
;
maximum
=
450
;
}
else
if
(
transferCardVos1
.
size
()>
200
){
test
.
setSize
(
25
);
minimum
=
300
;
maximum
=
500
;
}
}
list
.
add
(
test
);
list
.
add
(
test
);
/**生成只跟中心点有关系的数据 合并成一个点*/
/**查询被转账人全部信息*/
List
<
com
.
example
.
gajz
.
transferrelationship
.
bean
.
param
.
data
>
transfer
=
transferRelationshipMapper
.
transferRelationship
(
transferCardVos
.
get
(
i
).
getBankCardNo
());
if
(
transfer
.
size
()!=
0
){
Test
testg
=
new
Test
();
testg
.
setSize
(
20
);
testg
.
setX
((
int
)
((
test
.
getX
()-
minimum
)+
Math
.
random
()*((
test
.
getX
()+
maximum
)-(
test
.
getX
()-
minimum
)+
1
)));
testg
.
setY
((
int
)
((
test
.
getY
()-
minimum
)+
Math
.
random
()*((
test
.
getY
()+
maximum
)-(
test
.
getY
()-
minimum
)+
1
)));
testg
.
setColor
(
code
);
testg
.
setId
(
transfer
.
get
(
0
).
getTarget
());
testg
.
setName
(
"单人转账关系总人数:"
+
transfer
.
size
());
list
.
add
(
testg
);
}
for
(
int
n
=
0
;
n
<
transferCardVos1
.
size
();
n
++){
Object
isNot
=
hashMap
.
get
(
transferCardVos1
.
get
(
n
).
getBankCardNo
());
if
(
isNot
==
null
){
Test
tests
=
new
Test
();
tests
.
setId
(
transferCardVos1
.
get
(
n
).
getBankCardNo
());
tests
.
setName
(
transferCardVos1
.
get
(
n
).
getName
());
tests
.
setColor
(
code
);
tests
.
setSize
(
10
);
tests
.
setX
((
int
)
((
test
.
getX
()-
minimum
)+
Math
.
random
()*((
test
.
getX
()+
maximum
)-(
test
.
getX
()-
minimum
)+
1
)));
tests
.
setY
((
int
)
((
test
.
getY
()-
minimum
)+
Math
.
random
()*((
test
.
getY
()+
maximum
)-(
test
.
getY
()-
minimum
)+
1
)));
list
.
add
(
tests
);
hashMap
.
put
(
transferCardVos1
.
get
(
n
).
getBankCardNo
(),
"1"
);
}
}
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
/** -----------------------计算大图四个角的XY轴代码-----------------------*/
// /**算大圈半径专用 总数*/
// /**算大圈半径专用 总数*/
// int bigTotal = transfer.size();
// int bigTotal = transfer.size();
...
...
src/main/java/com/example/gajz/transferrelationship/service/serviceImpl/TransferRelationshipServiceImpl.java
View file @
375cf55a
...
@@ -87,10 +87,10 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
...
@@ -87,10 +87,10 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
*/
*/
@Override
@Override
public
List
diagramSpot
(
DiagramSpotParam
diagramSpotParam
)
{
public
List
diagramSpot
(
DiagramSpotParam
diagramSpotParam
)
{
if
(
diagramSpotParam
.
getDrawingNumber
()==
1
){
/**分散图形算法 */
if
(
diagramSpotParam
.
getDrawingNumber
()==
0
){
/**分散图形算法 */
List
list
=
dispersionDiagram
.
dispersionDiagram
(
diagramSpotParam
.
getNumerical
());
List
list
=
dispersionDiagram
.
dispersionDiagram
(
diagramSpotParam
.
getNumerical
());
return
list
;
return
list
;
}
else
if
(
diagramSpotParam
.
getDrawingNumber
()==
0
){
/**圆形图形算法*/
}
else
if
(
diagramSpotParam
.
getDrawingNumber
()==
1
){
/**圆形图形算法*/
List
list
=
circularAlgorithm
.
circularAlgorithm
(
diagramSpotParam
.
getNumerical
());
List
list
=
circularAlgorithm
.
circularAlgorithm
(
diagramSpotParam
.
getNumerical
());
return
list
;
return
list
;
}
}
...
...
src/main/resources/mapper/TransferRelationshipMapper.xml
View file @
375cf55a
...
@@ -189,4 +189,15 @@
...
@@ -189,4 +189,15 @@
group by a.end_card_no HAVING count(end_card_no)>1
group by a.end_card_no HAVING count(end_card_no)>1
</select>
</select>
<!--查询被转账人 多人转账关系数据方法-->
<select
id=
"selectmanyPeoples"
resultType=
"com.example.gajz.transferrelationship.bean.vo.TransferCardVo"
>
select name,bankCardNo from (
select end_account_name as name,end_card_no as bankCardNo,bank_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}
</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