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
05bcfa64
Commit
05bcfa64
authored
Aug 09, 2025
by
zhuxiang
Browse files
画布接口优化
parent
2819ef80
Changes
5
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/CaseRuleConfigController.java
View file @
05bcfa64
...
...
@@ -20,7 +20,7 @@ public class CaseRuleConfigController extends BaseController {
}
@GetMapping
(
"/data/{caseId}"
)
public
Result
data
(
@PathVariable
Str
in
g
caseId
)
{
public
Result
data
(
@PathVariable
in
t
caseId
)
{
return
Result
.
data
(
caseRuleConfigService
.
getByCaseId
(
caseId
));
}
}
src/main/java/com/platform/model/entity/CaseRuleConfigEntity.java
View file @
05bcfa64
...
...
@@ -30,7 +30,7 @@ public class CaseRuleConfigEntity {
private
Date
endTime
;
private
Str
in
g
principal
;
private
in
t
principal
;
private
boolean
whiteFlag
;
}
src/main/java/com/platform/service/CaseRuleConfigService.java
View file @
05bcfa64
...
...
@@ -4,5 +4,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.platform.model.entity.CaseRuleConfigEntity
;
public
interface
CaseRuleConfigService
extends
IService
<
CaseRuleConfigEntity
>
{
CaseRuleConfigEntity
getByCaseId
(
Str
in
g
caseId
);
CaseRuleConfigEntity
getByCaseId
(
in
t
caseId
);
}
src/main/java/com/platform/service/impl/CaseRuleServiceImpl.java
View file @
05bcfa64
...
...
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
@Service
public
class
CaseRuleServiceImpl
extends
ServiceImpl
<
CaseRuleConfigMapper
,
CaseRuleConfigEntity
>
implements
CaseRuleConfigService
{
@Override
public
CaseRuleConfigEntity
getByCaseId
(
Str
in
g
caseId
)
{
public
CaseRuleConfigEntity
getByCaseId
(
in
t
caseId
)
{
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CaseRuleConfigEntity
>()
.
eq
(
CaseRuleConfigEntity:
:
getCaseId
,
caseId
));
}
...
...
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
05bcfa64
...
...
@@ -33,6 +33,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
@Resource
private
GroupService
groupService
;
@Resource
private
CaseRuleConfigService
caseRuleConfigService
;
@Resource
private
UserRelationService
userRelationService
;
@Override
...
...
@@ -138,8 +140,37 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
// 存储边信息,键为payer-payee组合
Map
<
String
,
EdgeVO
>
edgeMap
=
new
HashMap
<>();
//查看案件是否有配置的规则
CaseRuleConfigEntity
caseRuleConfigEntity
=
caseRuleConfigService
.
getByCaseId
(
caseDTO
.
getId
());
if
(
caseRuleConfigEntity
!=
null
)
{
caseDTO
.
setMinTransaction
(
caseRuleConfigEntity
.
getMinTransaction
());
caseDTO
.
setMaxTransaction
(
caseRuleConfigEntity
.
getMaxTransaction
());
caseDTO
.
setMinAmount
(
caseRuleConfigEntity
.
getMinAmount
());
caseDTO
.
setMaxAmount
(
caseRuleConfigEntity
.
getMaxAmount
());
caseDTO
.
setStartTime
(
caseRuleConfigEntity
.
getStartTime
());
caseDTO
.
setEndTime
(
caseRuleConfigEntity
.
getEndTime
());
caseDTO
.
setPrincipal
(
caseRuleConfigEntity
.
getPrincipal
());
caseDTO
.
setWhiteFlag
(
caseRuleConfigEntity
.
isWhiteFlag
());
}
// 查询案件数据
List
<
ExcelDataEntity
>
excelDataEntityList
=
excelDataService
.
queryList
(
caseDTO
);
Iterator
<
ExcelDataEntity
>
iterator
=
excelDataEntityList
.
iterator
();
while
(
iterator
.
hasNext
())
{
ExcelDataEntity
excelDataEntity
=
iterator
.
next
();
if
(
caseDTO
.
getPrincipal
()
!=
null
)
{
if
(
caseDTO
.
getPrincipal
()
==
1
&&
excelDataEntity
.
getPayeeName
().
contains
(
"公司"
))
{
//移除被付款人是公司
iterator
.
remove
();
// 安全移除元素
}
if
(
caseDTO
.
getPrincipal
()
==
2
&&
!
excelDataEntity
.
getPayeeName
().
contains
(
"公司"
))
{
//移除被付款人是公司
iterator
.
remove
();
// 安全移除元素
}
}
}
if
(
caseDTO
.
getWhiteFlag
()
!=
null
&&
caseDTO
.
getWhiteFlag
())
{
//过滤白名单
filterWhite
(
excelDataEntityList
);
...
...
@@ -194,11 +225,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
Set
<
String
>
validNodes
=
new
HashSet
<>();
for
(
String
node
:
uf
.
getParent
().
keySet
())
{
if
(
shouldIncludeNode
(
node
,
caseDTO
))
{
validNodes
.
add
(
node
);
String
label
=
userAndLabel
.
get
(
node
);
graph
.
addNode
(
new
NodeVO
(
node
,
label
));
}
graph
.
addNode
(
new
NodeVO
(
node
,
label
));
}
// 第三步:过滤边
...
...
@@ -516,21 +545,6 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
return
result
;
}
// 节点过滤逻辑
private
boolean
shouldIncludeNode
(
String
node
,
CaseDTO
caseDTO
)
{
if
(
caseDTO
.
getPrincipal
()
==
null
)
{
return
true
;
// 无过滤条件时包含所有节点
}
if
(
caseDTO
.
getPrincipal
()
==
1
)
{
// 过滤掉收款人名称中带有公司的数据
return
!(
node
.
contains
(
"公司"
));
}
else
{
// 过滤掉收款人名称中不含公司的数据
return
node
.
contains
(
"公司"
);
}
}
// 检查团体是否有实际连接(非孤立节点)
private
boolean
hasConnections
(
Set
<
String
>
members
,
GraphVO
graph
)
{
return
graph
.
getEdges
().
stream
()
...
...
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