Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
63693302
Commit
63693302
authored
Aug 10, 2025
by
zhuxiang
Browse files
画布优化
parent
a89b4c4e
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/model/entity/ExcelDataEntity.java
View file @
63693302
...
...
@@ -113,4 +113,7 @@ public class ExcelDataEntity {
@ApiModelProperty
(
"关联账户"
)
@TableField
(
exist
=
false
)
private
String
associationAccount
;
@TableField
(
exist
=
false
)
private
int
transactionCount
;
}
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
63693302
...
...
@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
@Service
...
...
@@ -163,10 +165,29 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
if
(
caseDTO
.
getPrincipal
()
==
1
&&
excelDataEntity
.
getPayeeName
().
contains
(
"公司"
))
{
//移除被付款人是公司
iterator
.
remove
();
// 安全移除元素
continue
;
}
if
(
caseDTO
.
getPrincipal
()
==
2
&&
!
excelDataEntity
.
getPayeeName
().
contains
(
"公司"
))
{
//移除被付款人是公司
iterator
.
remove
();
// 安全移除元素
continue
;
}
}
// 检查金额过滤条件
if
(
caseDTO
.
getMinAmount
()
!=
null
&&
caseDTO
.
getMaxAmount
()
!=
null
)
{
if
(
excelDataEntity
.
getAmount
()
<
caseDTO
.
getMinAmount
()
||
excelDataEntity
.
getAmount
()
>
caseDTO
.
getMaxAmount
())
{
iterator
.
remove
();
continue
;
}
}
// 检查交易次数过滤条件
if
(
caseDTO
.
getMinTransaction
()
!=
null
&&
caseDTO
.
getMaxTransaction
()
!=
null
)
{
if
(
excelDataEntity
.
getTransactionCount
()
<
caseDTO
.
getMinTransaction
()
||
excelDataEntity
.
getTransactionCount
()
>
caseDTO
.
getMaxTransaction
())
{
iterator
.
remove
();
}
}
}
...
...
@@ -190,6 +211,11 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
String
payer
=
excelDataEntity
.
getPayUserName
();
String
payee
=
excelDataEntity
.
getPayeeName
();
double
amount
=
excelDataEntity
.
getAmount
();
BigDecimal
bd
=
new
BigDecimal
(
amount
);
bd
=
bd
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
// 保留两位小数,四舍五入
double
formattedAmount
=
bd
.
doubleValue
();
String
ip
=
excelDataEntity
.
getIp
();
String
mac
=
excelDataEntity
.
getMac
();
String
account
=
excelDataEntity
.
getPaymentBankName
();
...
...
@@ -208,10 +234,10 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
if
(
existingEdge
!=
null
)
{
// 更新现有边
existingEdge
.
setTotalTransactions
(
existingEdge
.
getTotalTransactions
()
+
1
);
existingEdge
.
setTotalAmount
(
existingEdge
.
getTotalAmount
()
+
a
mount
);
existingEdge
.
setTotalAmount
(
existingEdge
.
getTotalAmount
()
+
formattedA
mount
);
}
else
{
// 创建新边
EdgeVO
newEdge
=
new
EdgeVO
(
payer
,
payee
,
1
,
a
mount
,
uf
.
find
(
payer
),
ip
,
mac
,
account
);
EdgeVO
newEdge
=
new
EdgeVO
(
payer
,
payee
,
1
,
formattedA
mount
,
uf
.
find
(
payer
),
ip
,
mac
,
account
);
edgeMap
.
put
(
edgeKey
,
newEdge
);
}
}
...
...
@@ -238,23 +264,6 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
!
validNodes
.
contains
(
edge
.
getTarget
()))
{
continue
;
}
// 检查金额过滤条件
if
(
caseDTO
.
getMinAmount
()
!=
null
&&
caseDTO
.
getMaxAmount
()
!=
null
)
{
if
(
edge
.
getTotalAmount
()
<
caseDTO
.
getMinAmount
()
||
edge
.
getTotalAmount
()
>
caseDTO
.
getMaxAmount
())
{
continue
;
}
}
// 检查交易次数过滤条件
if
(
caseDTO
.
getMinTransaction
()
!=
null
&&
caseDTO
.
getMaxTransaction
()
!=
null
)
{
if
(
edge
.
getTotalTransactions
()
<
caseDTO
.
getMinTransaction
()
||
edge
.
getTotalTransactions
()
>
caseDTO
.
getMaxTransaction
())
{
continue
;
}
}
// 添加到有效边集合
validEdges
.
add
(
edge
);
graph
.
addEdge
(
edge
);
...
...
@@ -447,7 +456,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
userEntity
.
setCaseId
(
userDTO
.
getCaseId
());
userEntity
.
setType
(
"1"
);
userService
.
save
(
userEntity
);
}
else
{
}
else
{
userEntity
.
setType
(
"1"
);
userEntity
.
setUserName
(
userDTO
.
getNewName
());
userEntity
.
setSex
(
userDTO
.
getSex
());
...
...
src/main/resources/com/platform/mapper/ExcelDataMapper.xml
View file @
63693302
...
...
@@ -34,7 +34,8 @@
select
pay_user_name payUserName,
payee_name payeeName,
amount amount,
SUM(amount) amount,
COUNT(*) AS transactionCount,
ip ip,
mac mac,
payment_bank_name
...
...
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