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
6a758e9e
Commit
6a758e9e
authored
Nov 16, 2021
by
wuqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2021/11/16 吴卿华 增加echarts双人转账关系图接口 修改双人转账关系图显示位置
parent
4cb08521
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
227 additions
and
52 deletions
+227
-52
lineStyle.java
...ple/gajz/transferrelationship/bean/echarts/lineStyle.java
+16
-0
EchartsTrBetweenTwoPersonsVo.java
...ferrelationship/bean/vo/EchartsTrBetweenTwoPersonsVo.java
+28
-0
TransferLocation.java
...ferrelationship/relationalalgorithm/TransferLocation.java
+85
-49
TransferRelationshipService.java
...sferrelationship/service/TransferRelationshipService.java
+14
-0
TransferRelationshipServiceImpl.java
.../service/serviceImpl/TransferRelationshipServiceImpl.java
+78
-0
TransferRelationshipMapper.xml
src/main/resources/mapper/TransferRelationshipMapper.xml
+6
-3
No files found.
src/main/java/com/example/gajz/transferrelationship/bean/echarts/lineStyle.java
0 → 100644
View file @
6a758e9e
package
com
.
example
.
gajz
.
transferrelationship
.
bean
.
echarts
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* echarts 关系图
*/
@Data
@ToString
public
class
lineStyle
{
/**
* 关系线曲度
*/
private
double
curveness
;
}
src/main/java/com/example/gajz/transferrelationship/bean/vo/EchartsTrBetweenTwoPersonsVo.java
0 → 100644
View file @
6a758e9e
package
com
.
example
.
gajz
.
transferrelationship
.
bean
.
vo
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* echarts 双人转账关系图 关系 生成接口 返回值封装类
*/
@Data
@ToString
public
class
EchartsTrBetweenTwoPersonsVo
{
/**
* 转账人
*/
private
String
source
;
/**
* 收款人
*/
private
String
target
;
/**
* 关系线曲度
*/
private
com
.
example
.
gajz
.
transferrelationship
.
bean
.
echarts
.
lineStyle
lineStyle
;
}
src/main/java/com/example/gajz/transferrelationship/relationalalgorithm/TransferLocation.java
View file @
6a758e9e
This diff is collapsed.
Click to expand it.
src/main/java/com/example/gajz/transferrelationship/service/TransferRelationshipService.java
View file @
6a758e9e
...
...
@@ -78,4 +78,18 @@ public interface TransferRelationshipService {
* @return
*/
Result
trBetweenTwoPersons
(
List
<
SearchRelationshipVo
>
transferAssociationParam
);
/**
* echarts 双人转账关系图 点 生成接口
* @param transferAssociationParam
* @return
*/
Result
echartsTransferAssociation
(
TransferAssociationParam
transferAssociationParam
);
/**
* echarts 双人转账关系图 关系 生成接口
* @param transferAssociationParam
* @return
*/
Result
echartsTrBetweenTwoPersons
(
List
<
SearchRelationshipVo
>
transferAssociationParam
);
}
src/main/java/com/example/gajz/transferrelationship/service/serviceImpl/TransferRelationshipServiceImpl.java
View file @
6a758e9e
...
...
@@ -3,6 +3,7 @@ import com.example.gajz.redis.ConFigRedis;
import
com.example.gajz.result.Result
;
import
com.example.gajz.result.ResultCode
;
import
com.example.gajz.transferrelationship.bean.dto.*
;
import
com.example.gajz.transferrelationship.bean.echarts.lineStyle
;
import
com.example.gajz.transferrelationship.bean.excel.abcExcie
;
import
com.example.gajz.transferrelationship.bean.param.TransferAssociationParam
;
import
com.example.gajz.transferrelationship.bean.vo.*
;
...
...
@@ -870,4 +871,81 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
}
return
new
Result
(
ResultCode
.
SUCCESS
,
list
);
}
/**
* echarts 双人转账关系图 点 生成接口
* @param transferAssociationParam
* @return
*/
@Override
public
Result
echartsTransferAssociation
(
TransferAssociationParam
transferAssociationParam
)
{
Result
result
=
this
.
transferAssociation
(
transferAssociationParam
);
Object
obj
=
result
.
getData
();
/**将有关系的数据放入这个list中 */
List
<
SearchRelationshipVo
>
transferAssociationList
=
new
ArrayList
<>();
if
(
obj
instanceof
ArrayList
<?>)
{
for
(
Object
o
:
(
List
<?>)
obj
)
{
transferAssociationList
.
add
(
SearchRelationshipVo
.
class
.
cast
(
o
));
}
}
List
<
EchartsUserVo
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
transferAssociationList
.
size
();
i
++){
EchartsUserVo
echartsUserVo
=
new
EchartsUserVo
();
echartsUserVo
.
setY
(
transferAssociationList
.
get
(
i
).
getY
());
echartsUserVo
.
setX
(
transferAssociationList
.
get
(
i
).
getX
());
echartsUserVo
.
setName
(
transferAssociationList
.
get
(
i
).
getCardNumber
());
list
.
add
(
echartsUserVo
);
}
return
new
Result
(
ResultCode
.
SUCCESS
,
list
);
}
/**
* echarts 双人转账关系图 关系 生成接口
* @param transferAssociationParam
* @return
*/
@Override
public
Result
echartsTrBetweenTwoPersons
(
List
<
SearchRelationshipVo
>
transferAssociationParam
)
{
Result
result
=
this
.
trBetweenTwoPersons
(
transferAssociationParam
);
Object
obj
=
result
.
getData
();
/**将有关系的数据放入这个list中 */
List
<
TransferRelationship
>
transferAssociationList
=
new
ArrayList
<>();
if
(
obj
instanceof
ArrayList
<?>)
{
for
(
Object
o
:
(
List
<?>)
obj
)
{
transferAssociationList
.
add
(
TransferRelationship
.
class
.
cast
(
o
));
}
}
/**将已经获取到的关系数据放入新list当中返回*/
List
<
EchartsTrBetweenTwoPersonsVo
>
echartsTrBetweenTwoPersonsVosList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
transferAssociationList
.
size
();
i
++){
EchartsTrBetweenTwoPersonsVo
echartsTrBetweenTwoPersonsVo
=
new
EchartsTrBetweenTwoPersonsVo
();
echartsTrBetweenTwoPersonsVo
.
setSource
(
transferAssociationList
.
get
(
i
).
getSource
().
getId
());
echartsTrBetweenTwoPersonsVo
.
setTarget
(
transferAssociationList
.
get
(
i
).
getTarget
().
getId
());
echartsTrBetweenTwoPersonsVosList
.
add
(
echartsTrBetweenTwoPersonsVo
);
}
/**计算转账关系曲线*/
for
(
int
p
=
0
;
p
<
echartsTrBetweenTwoPersonsVosList
.
size
();
p
++){
//转账共有几人
int
frequency
=
0
;
//曲线值
double
curveValue
=
0.01
;
for
(
int
k
=
0
;
k
<
echartsTrBetweenTwoPersonsVosList
.
size
();
k
++){
if
(
echartsTrBetweenTwoPersonsVosList
.
get
(
p
).
getSource
().
equals
(
echartsTrBetweenTwoPersonsVosList
.
get
(
k
).
getSource
())){
frequency
++;
if
(
frequency
>
2
){
lineStyle
line
=
new
lineStyle
();
line
.
setCurveness
(
curveValue
);
echartsTrBetweenTwoPersonsVosList
.
get
(
p
).
setLineStyle
(
line
);
curveValue
=
curveValue
+
0.01
;
}
else
{
lineStyle
line
=
new
lineStyle
();
line
.
setCurveness
(
curveValue
);
echartsTrBetweenTwoPersonsVosList
.
get
(
p
).
setLineStyle
(
line
);
}
}
}
}
return
new
Result
(
ResultCode
.
SUCCESS
,
echartsTrBetweenTwoPersonsVosList
);
}
}
src/main/resources/mapper/TransferRelationshipMapper.xml
View file @
6a758e9e
...
...
@@ -96,8 +96,10 @@
<!--查询搜索人关联下一级数据-->
<select
id=
"querySubordinate"
resultType=
"com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo"
>
select end_account_name as name,end_card_no as cardNumber,count(end_card_no) as transferTimes
from abc_statement where end_account_name is not null and end_card_no is not null and
bank_card_no=#{cardNumber} group by end_card_no
from abc_statement
where end_account_name is not null
and end_card_no is not null
and bank_card_no=#{cardNumber} group by end_card_no
</select>
<!--查询转账人-->
...
...
@@ -138,7 +140,8 @@
<!--查询上级转账人方法-->
<select
id=
"querySuperior"
resultType=
"com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo"
>
select bank_account_name as name ,bank_card_no as cardNumber from abc_statement where end_card_no=#{cardNumbe} and bank_card_no is not null
select bank_account_name as name ,bank_card_no as cardNumber from abc_statement where end_card_no=#{cardNumbe}
and bank_card_no is not null
group by bank_card_no
</select>
...
...
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