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
acc846db
Commit
acc846db
authored
Aug 02, 2025
by
zhuxiang
Browse files
案件画布节点数据存入数据库
parent
eb634572
Changes
25
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/CaseController.java
View file @
acc846db
...
@@ -46,9 +46,9 @@ public class CaseController extends BaseController {
...
@@ -46,9 +46,9 @@ public class CaseController extends BaseController {
}
}
@ApiOperation
(
value
=
"案件详情-数据列表"
)
@ApiOperation
(
value
=
"案件详情-数据列表"
)
@
Ge
tMapping
(
"/detail/dataList
/{id}
"
)
@
Pos
tMapping
(
"/detail/dataList"
)
public
Result
dataList
(
@
PathVariable
String
id
)
{
public
Result
dataList
(
@
RequestBody
CaseDTO
caseDTO
)
{
return
Result
.
data
(
caseService
.
queryDataList
(
id
));
return
Result
.
data
(
caseService
.
queryDataList
(
caseDTO
));
}
}
@ApiOperation
(
value
=
"案件详情-数据更新所属人"
)
@ApiOperation
(
value
=
"案件详情-数据更新所属人"
)
...
...
src/main/java/com/platform/mapper/CaseMapper.java
View file @
acc846db
...
@@ -20,4 +20,6 @@ public interface CaseMapper extends BaseMapper<CaseEntity> {
...
@@ -20,4 +20,6 @@ public interface CaseMapper extends BaseMapper<CaseEntity> {
Boolean
saveCase
(
CaseDTO
caseDTO
);
Boolean
saveCase
(
CaseDTO
caseDTO
);
Boolean
removeBatchCase
(
@Param
(
"ids"
)
List
<
String
>
ids
);
Boolean
removeBatchCase
(
@Param
(
"ids"
)
List
<
String
>
ids
);
CaseEntity
getInfoById
(
Integer
id
);
}
}
src/main/java/com/platform/mapper/EdgeMapper.java
0 → 100644
View file @
acc846db
package
com.platform.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.entity.EdgeEntity
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
EdgeMapper
extends
BaseMapper
<
EdgeEntity
>
{
}
src/main/java/com/platform/mapper/ExcelDataMapper.java
View file @
acc846db
...
@@ -19,7 +19,8 @@ import java.util.List;
...
@@ -19,7 +19,8 @@ import java.util.List;
*/
*/
@Mapper
@Mapper
public
interface
ExcelDataMapper
extends
BaseMapper
<
ExcelDataEntity
>
{
public
interface
ExcelDataMapper
extends
BaseMapper
<
ExcelDataEntity
>
{
List
<
ExcelDataVO
>
queryByCaseId
(
String
id
);
List
<
ExcelDataVO
>
queryByCaseId
(
CaseDTO
caseDTO
);
List
<
ExcelDataEntity
>
queryList
(
CaseDTO
caseDTO
);
List
<
ExcelDataEntity
>
queryList
(
CaseDTO
caseDTO
);
...
...
src/main/java/com/platform/mapper/NodeMapper.java
0 → 100644
View file @
acc846db
package
com.platform.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.entity.NodeEntity
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
NodeMapper
extends
BaseMapper
<
NodeEntity
>
{
}
src/main/java/com/platform/model/dto/CaseDTO.java
View file @
acc846db
...
@@ -38,4 +38,8 @@ public class CaseDTO extends CaseEntity {
...
@@ -38,4 +38,8 @@ public class CaseDTO extends CaseEntity {
@ApiModelProperty
(
value
=
"主体类型 1、个人 2、对公"
)
@ApiModelProperty
(
value
=
"主体类型 1、个人 2、对公"
)
private
Integer
principal
;
private
Integer
principal
;
private
String
payUserName
;
private
String
fileName
;
}
}
src/main/java/com/platform/model/entity/CaseEntity.java
View file @
acc846db
...
@@ -40,4 +40,6 @@ public class CaseEntity {
...
@@ -40,4 +40,6 @@ public class CaseEntity {
@TableField
(
"template_id"
)
@TableField
(
"template_id"
)
@ApiModelProperty
(
value
=
"模板id"
)
@ApiModelProperty
(
value
=
"模板id"
)
private
String
templateId
;
private
String
templateId
;
private
Boolean
drawFlag
;
}
}
src/main/java/com/platform/model/entity/EdgeEntity.java
0 → 100644
View file @
acc846db
package
com.platform.model.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
"edge"
)
public
class
EdgeEntity
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
int
id
;
private
int
caseId
;
private
String
target
;
private
String
source
;
private
String
relation
;
private
int
totalTransactions
;
private
double
totalAmount
;
private
String
ip
;
private
String
mac
;
private
String
account
;
}
src/main/java/com/platform/model/entity/NodeEntity.java
0 → 100644
View file @
acc846db
package
com.platform.model.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
"node"
)
public
class
NodeEntity
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
int
id
;
private
int
caseId
;
private
String
node
;
}
src/main/java/com/platform/model/vo/EdgeVO.java
View file @
acc846db
...
@@ -27,9 +27,8 @@ public class EdgeVO {
...
@@ -27,9 +27,8 @@ public class EdgeVO {
private
List
<
String
>
states
;
private
List
<
String
>
states
;
public
EdgeVO
(
String
id
,
String
source
,
String
target
,
int
totalTransactions
,
double
totalAmount
,
String
groupId
,
public
EdgeVO
(
String
source
,
String
target
,
int
totalTransactions
,
double
totalAmount
,
String
groupId
,
String
ip
,
String
mac
,
String
account
)
{
String
ip
,
String
mac
,
String
account
)
{
this
.
id
=
id
;
this
.
source
=
source
;
this
.
source
=
source
;
this
.
target
=
target
;
this
.
target
=
target
;
this
.
totalTransactions
=
totalTransactions
;
this
.
totalTransactions
=
totalTransactions
;
...
@@ -48,4 +47,9 @@ public class EdgeVO {
...
@@ -48,4 +47,9 @@ public class EdgeVO {
this
.
totalAmount
=
totalAmount
;
this
.
totalAmount
=
totalAmount
;
}
}
// 添加无参构造方法
public
EdgeVO
()
{
}
}
}
src/main/java/com/platform/model/vo/GraphVO.java
View file @
acc846db
...
@@ -31,4 +31,5 @@ public class GraphVO {
...
@@ -31,4 +31,5 @@ public class GraphVO {
public
void
addGroup
(
GroupVO
groupVO
)
{
public
void
addGroup
(
GroupVO
groupVO
)
{
groups
.
add
(
groupVO
);
groups
.
add
(
groupVO
);
}
}
}
}
src/main/java/com/platform/model/vo/GroupVO.java
View file @
acc846db
...
@@ -22,4 +22,8 @@ public class GroupVO {
...
@@ -22,4 +22,8 @@ public class GroupVO {
this
.
totalTransactions
=
totalTransactions
;
this
.
totalTransactions
=
totalTransactions
;
this
.
groupDetailList
=
groupDetailList
;
this
.
groupDetailList
=
groupDetailList
;
}
}
public
GroupVO
(){
}
}
}
src/main/java/com/platform/model/vo/NodeVO.java
View file @
acc846db
...
@@ -12,4 +12,8 @@ public class NodeVO {
...
@@ -12,4 +12,8 @@ public class NodeVO {
public
NodeVO
(
String
node
)
{
public
NodeVO
(
String
node
)
{
this
.
node
=
node
;
this
.
node
=
node
;
}
}
// 添加无参构造方法
public
NodeVO
()
{
}
}
}
src/main/java/com/platform/service/CaseService.java
View file @
acc846db
...
@@ -20,7 +20,7 @@ public interface CaseService extends IService<CaseEntity> {
...
@@ -20,7 +20,7 @@ public interface CaseService extends IService<CaseEntity> {
*/
*/
List
<
CaseVO
>
pageCase
(
CaseDTO
caseDTO
);
List
<
CaseVO
>
pageCase
(
CaseDTO
caseDTO
);
List
<
CaseVO
>
queryDataList
(
String
id
);
List
<
CaseVO
>
queryDataList
(
CaseDTO
caseDTO
);
/**
/**
* 数据更新所属人
* 数据更新所属人
...
...
src/main/java/com/platform/service/EdgeService.java
0 → 100644
View file @
acc846db
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.entity.EdgeEntity
;
import
com.platform.model.vo.EdgeVO
;
import
java.util.List
;
public
interface
EdgeService
extends
IService
<
EdgeEntity
>
{
void
saveData
(
Integer
id
,
List
<
EdgeVO
>
edges
);
List
<
EdgeVO
>
queryByCaseId
(
Integer
id
);
}
src/main/java/com/platform/service/ExcelDataService.java
View file @
acc846db
...
@@ -17,7 +17,7 @@ import java.util.List;
...
@@ -17,7 +17,7 @@ import java.util.List;
* @Desc : 描述信息
* @Desc : 描述信息
*/
*/
public
interface
ExcelDataService
extends
IService
<
ExcelDataEntity
>
{
public
interface
ExcelDataService
extends
IService
<
ExcelDataEntity
>
{
List
<
ExcelDataVO
>
queryByCaseId
(
String
id
);
List
<
ExcelDataVO
>
queryByCaseId
(
CaseDTO
caseDTO
);
/**
/**
* @param fileId
* @param fileId
...
...
src/main/java/com/platform/service/GroupService.java
View file @
acc846db
...
@@ -9,4 +9,6 @@ import java.util.List;
...
@@ -9,4 +9,6 @@ import java.util.List;
public
interface
GroupService
extends
IService
<
GroupEntity
>
{
public
interface
GroupService
extends
IService
<
GroupEntity
>
{
void
saveGroup
(
int
id
,
List
<
GroupVO
>
groups
);
void
saveGroup
(
int
id
,
List
<
GroupVO
>
groups
);
List
<
GroupVO
>
queryByCaseId
(
Integer
id
);
}
}
src/main/java/com/platform/service/NodeService.java
0 → 100644
View file @
acc846db
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.entity.NodeEntity
;
import
com.platform.model.vo.NodeVO
;
import
java.util.List
;
public
interface
NodeService
extends
IService
<
NodeEntity
>
{
void
saveData
(
Integer
id
,
List
<
NodeVO
>
nodes
);
List
<
NodeVO
>
queryByCaseId
(
Integer
id
);
}
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
acc846db
...
@@ -23,6 +23,10 @@ import java.util.stream.Collectors;
...
@@ -23,6 +23,10 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
CaseServiceImpl
extends
ServiceImpl
<
CaseMapper
,
CaseEntity
>
implements
CaseService
{
public
class
CaseServiceImpl
extends
ServiceImpl
<
CaseMapper
,
CaseEntity
>
implements
CaseService
{
@Resource
private
NodeService
nodeService
;
@Resource
private
EdgeService
edgeService
;
@Resource
@Resource
private
WhiteService
whiteService
;
private
WhiteService
whiteService
;
@Resource
@Resource
...
@@ -33,9 +37,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -33,9 +37,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
private
UserRelationService
userRelationService
;
private
UserRelationService
userRelationService
;
@Override
@Override
public
List
<
CaseVO
>
queryDataList
(
String
id
)
{
public
List
<
CaseVO
>
queryDataList
(
CaseDTO
caseDTO
)
{
//查看案件所有的excelData
//查看案件所有的excelData
List
<
ExcelDataVO
>
excelDataEntityList
=
excelDataService
.
queryByCaseId
(
id
);
List
<
ExcelDataVO
>
excelDataEntityList
=
excelDataService
.
queryByCaseId
(
caseDTO
);
excelDataEntityList
.
forEach
(
excelDataEntity
->
{
excelDataEntityList
.
forEach
(
excelDataEntity
->
{
if
(
StringUtils
.
isNull
(
excelDataEntity
.
getPayUserName
()))
{
if
(
StringUtils
.
isNull
(
excelDataEntity
.
getPayUserName
()))
{
excelDataEntity
.
setPayUserName
(
"无对应人员的数据"
);
excelDataEntity
.
setPayUserName
(
"无对应人员的数据"
);
...
@@ -100,9 +104,21 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -100,9 +104,21 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
@Override
@Override
public
GraphVO
draw
(
CaseDTO
caseDTO
)
{
public
GraphVO
draw
(
CaseDTO
caseDTO
)
{
// 初始化
返回
对象
// 初始化
画布
对象
GraphVO
graph
=
new
GraphVO
();
GraphVO
graph
=
new
GraphVO
();
CaseEntity
caseEntity
=
baseMapper
.
getInfoById
(
caseDTO
.
getId
());
if
(
caseEntity
==
null
)
{
return
graph
;
}
if
(
caseEntity
.
getDrawFlag
())
{
//查询数据库数据
List
<
NodeVO
>
nodeVOList
=
nodeService
.
queryByCaseId
(
caseDTO
.
getId
());
List
<
EdgeVO
>
edgeVOList
=
edgeService
.
queryByCaseId
(
caseDTO
.
getId
());
List
<
GroupVO
>
groupVOList
=
groupService
.
queryByCaseId
(
caseDTO
.
getId
());
graph
.
setNodes
(
nodeVOList
);
graph
.
setEdges
(
edgeVOList
);
graph
.
setGroups
(
groupVOList
);
}
else
{
// 使用并查集管理团体关系
// 使用并查集管理团体关系
UnionFindVO
uf
=
new
UnionFindVO
();
UnionFindVO
uf
=
new
UnionFindVO
();
...
@@ -149,8 +165,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -149,8 +165,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
existingEdge
.
setTotalAmount
(
existingEdge
.
getTotalAmount
()
+
amount
);
existingEdge
.
setTotalAmount
(
existingEdge
.
getTotalAmount
()
+
amount
);
}
else
{
}
else
{
// 创建新边
// 创建新边
String
edgeId
=
"line-"
+
payer
+
"-"
+
payee
;
EdgeVO
newEdge
=
new
EdgeVO
(
payer
,
payee
,
1
,
amount
,
uf
.
find
(
payer
),
ip
,
mac
,
account
);
EdgeVO
newEdge
=
new
EdgeVO
(
edgeId
,
payer
,
payee
,
1
,
amount
,
uf
.
find
(
payer
),
ip
,
mac
,
account
);
edgeMap
.
put
(
edgeKey
,
newEdge
);
edgeMap
.
put
(
edgeKey
,
newEdge
);
}
}
}
}
...
@@ -317,8 +332,12 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -317,8 +332,12 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
}
}
//处理付款人与收款人的关系
//处理付款人与收款人的关系
disposeUserRelation
(
caseDTO
.
getId
(),
validNodes
,
graph
.
getEdges
());
disposeUserRelation
(
caseDTO
.
getId
(),
validNodes
,
graph
.
getEdges
());
//保存节点、边数据
nodeService
.
saveData
(
caseDTO
.
getId
(),
graph
.
getNodes
());
edgeService
.
saveData
(
caseDTO
.
getId
(),
graph
.
getEdges
());
//保存团体数据
//保存团体数据
groupService
.
saveGroup
(
caseDTO
.
getId
(),
graph
.
getGroups
());
groupService
.
saveGroup
(
caseDTO
.
getId
(),
graph
.
getGroups
());
}
return
graph
;
return
graph
;
}
}
...
...
src/main/java/com/platform/service/impl/EdgeServiceImpl.java
0 → 100644
View file @
acc846db
package
com.platform.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.platform.mapper.EdgeMapper
;
import
com.platform.model.entity.EdgeEntity
;
import
com.platform.model.vo.EdgeVO
;
import
com.platform.service.EdgeService
;
import
com.platform.utils.DozerUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
EdgeServiceImpl
extends
ServiceImpl
<
EdgeMapper
,
EdgeEntity
>
implements
EdgeService
{
@Override
public
void
saveData
(
Integer
id
,
List
<
EdgeVO
>
edges
)
{
List
<
EdgeEntity
>
edgeEntityList
=
DozerUtils
.
convertList
(
edges
,
EdgeEntity
.
class
);
edgeEntityList
.
forEach
(
edgeEntity
->
edgeEntity
.
setCaseId
(
id
));
saveBatch
(
edgeEntityList
);
}
@Override
public
List
<
EdgeVO
>
queryByCaseId
(
Integer
id
)
{
return
DozerUtils
.
convertList
(
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
EdgeEntity
>()
.
eq
(
EdgeEntity:
:
getCaseId
,
id
)),
EdgeVO
.
class
);
}
}
Prev
1
2
Next
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