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
fbf5742e
Commit
fbf5742e
authored
Aug 01, 2025
by
wujipeng
Browse files
Merge remote-tracking branch 'origin/dev' into dev
parents
8a9e85c7
9c02f656
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/GroupController.java
0 → 100644
View file @
fbf5742e
package
com.platform.controller
;
import
com.platform.model.dto.GroupDetailDTO
;
import
com.platform.model.resp.Result
;
import
com.platform.page.TableDataInfo
;
import
com.platform.service.GroupDetailService
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
"/group"
)
public
class
GroupController
extends
BaseController
{
@Resource
private
GroupDetailService
groupDetailService
;
@PostMapping
(
"/person"
)
public
TableDataInfo
person
(
@RequestBody
GroupDetailDTO
groupDetailDTO
)
{
startPage
(
groupDetailDTO
.
getPageNum
(),
groupDetailDTO
.
getPageSize
());
return
getDataTable
(
groupDetailService
.
queryList
(
groupDetailDTO
));
}
@PostMapping
(
"/ip"
)
public
TableDataInfo
ip
(
@RequestBody
GroupDetailDTO
groupDetailDTO
)
{
startPage
(
groupDetailDTO
.
getPageNum
(),
groupDetailDTO
.
getPageSize
());
return
getDataTable
(
groupDetailService
.
queryIp
(
groupDetailDTO
));
}
@GetMapping
(
"/ipDetail"
)
public
Result
getDetail
(
@RequestParam
String
ip
)
{
return
Result
.
data
(
groupDetailService
.
queryIpDetail
(
ip
));
}
@PostMapping
(
"/mac"
)
public
TableDataInfo
mac
(
@RequestBody
GroupDetailDTO
groupDetailDTO
)
{
startPage
(
groupDetailDTO
.
getPageNum
(),
groupDetailDTO
.
getPageSize
());
return
getDataTable
(
groupDetailService
.
queryMac
(
groupDetailDTO
));
}
@GetMapping
(
"/macDetail"
)
public
Result
macDetail
(
@RequestParam
String
mac
)
{
return
Result
.
data
(
groupDetailService
.
queryMacDetail
(
mac
));
}
}
src/main/java/com/platform/mapper/GroupDetailMapper.java
View file @
fbf5742e
package
com.platform.mapper
;
package
com.platform.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.dto.GroupDetailDTO
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.vo.GroupDetailVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
@Mapper
public
interface
GroupDetailMapper
extends
BaseMapper
<
GroupDetailEntity
>
{
public
interface
GroupDetailMapper
extends
BaseMapper
<
GroupDetailEntity
>
{
List
<
GroupDetailVO
>
queryIp
(
GroupDetailDTO
groupDetailDTO
);
List
<
GroupDetailVO
>
queryMac
(
GroupDetailDTO
groupDetailDTO
);
}
}
src/main/java/com/platform/model/dto/GroupDetailDTO.java
0 → 100644
View file @
fbf5742e
package
com.platform.model.dto
;
import
lombok.Data
;
@Data
public
class
GroupDetailDTO
{
private
int
pageNum
;
private
int
pageSize
;
private
int
groupId
;
}
src/main/java/com/platform/model/entity/GroupDetailEntity.java
View file @
fbf5742e
...
@@ -15,12 +15,19 @@ public class GroupDetailEntity {
...
@@ -15,12 +15,19 @@ public class GroupDetailEntity {
@TableField
(
"case_id"
)
@TableField
(
"case_id"
)
private
int
caseId
;
private
int
caseId
;
@TableField
(
"group_id"
)
private
int
groupId
;
private
String
userName
;
private
String
userName
;
private
int
transactionCount
;
// 总交易次数
private
int
transactionCount
;
// 总交易次数
private
double
totalAmount
;
// 总交易金额(转出+转入)
private
double
totalAmount
;
// 总交易金额(转出+转入)
private
double
outgoingAmount
;
// 转出金额
private
double
outgoingAmount
;
// 转出金额
private
double
incomingAmount
;
// 转入金额
private
double
incomingAmount
;
// 转入金额
private
String
ip
;
private
String
mac
;
private
String
account
;
public
GroupDetailEntity
(
String
userName
)
{
public
GroupDetailEntity
(
String
userName
)
{
this
.
userName
=
userName
;
this
.
userName
=
userName
;
}
}
...
...
src/main/java/com/platform/model/vo/EdgeVO.java
View file @
fbf5742e
...
@@ -20,15 +20,23 @@ public class EdgeVO {
...
@@ -20,15 +20,23 @@ public class EdgeVO {
private
String
groupId
;
private
String
groupId
;
private
String
ip
;
private
String
mac
;
private
String
account
;
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
id
,
String
source
,
String
target
,
int
totalTransactions
,
double
totalAmount
,
String
groupId
,
String
ip
,
String
mac
,
String
account
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
source
=
source
;
this
.
source
=
source
;
this
.
target
=
target
;
this
.
target
=
target
;
this
.
totalTransactions
=
totalTransactions
;
this
.
totalTransactions
=
totalTransactions
;
this
.
totalAmount
=
totalAmount
;
this
.
totalAmount
=
totalAmount
;
this
.
groupId
=
groupId
;
this
.
groupId
=
groupId
;
this
.
ip
=
ip
;
this
.
mac
=
mac
;
this
.
account
=
account
;
}
}
}
}
src/main/java/com/platform/model/vo/GroupDetailVO.java
0 → 100644
View file @
fbf5742e
package
com.platform.model.vo
;
import
lombok.Data
;
@Data
public
class
GroupDetailVO
{
private
String
ip
;
private
int
frequency
;
private
String
associatedUsers
;
private
String
associatedAccounts
;
}
src/main/java/com/platform/service/GroupDetailService.java
View file @
fbf5742e
package
com.platform.service
;
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.dto.GroupDetailDTO
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.vo.GroupDetailVO
;
import
java.util.List
;
public
interface
GroupDetailService
extends
IService
<
GroupDetailEntity
>
{
public
interface
GroupDetailService
extends
IService
<
GroupDetailEntity
>
{
List
<
GroupDetailEntity
>
queryList
(
GroupDetailDTO
groupDTO
);
List
<
GroupDetailVO
>
queryIp
(
GroupDetailDTO
groupDetailDTO
);
List
<
GroupDetailEntity
>
queryIpDetail
(
String
ip
);
List
<
GroupDetailVO
>
queryMac
(
GroupDetailDTO
groupDetailDTO
);
List
<
GroupDetailEntity
>
queryMacDetail
(
String
mac
);
}
}
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
fbf5742e
...
@@ -121,6 +121,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -121,6 +121,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
String
payer
=
excelDataEntity
.
getPayUserName
();
String
payer
=
excelDataEntity
.
getPayUserName
();
String
payee
=
excelDataEntity
.
getPayeeName
();
String
payee
=
excelDataEntity
.
getPayeeName
();
double
amount
=
excelDataEntity
.
getAmount
();
double
amount
=
excelDataEntity
.
getAmount
();
String
ip
=
excelDataEntity
.
getIp
();
String
mac
=
excelDataEntity
.
getMac
();
String
account
=
excelDataEntity
.
getPaymentBankName
();
// 添加到并查集
// 添加到并查集
uf
.
makeSet
(
payer
);
uf
.
makeSet
(
payer
);
...
@@ -138,7 +141,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -138,7 +141,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
}
else
{
}
else
{
// 创建新边
// 创建新边
String
edgeId
=
"line-"
+
payer
+
"-"
+
payee
;
String
edgeId
=
"line-"
+
payer
+
"-"
+
payee
;
EdgeVO
newEdge
=
new
EdgeVO
(
edgeId
,
payer
,
payee
,
1
,
amount
,
uf
.
find
(
payer
));
EdgeVO
newEdge
=
new
EdgeVO
(
edgeId
,
payer
,
payee
,
1
,
amount
,
uf
.
find
(
payer
)
,
ip
,
mac
,
account
);
edgeMap
.
put
(
edgeKey
,
newEdge
);
edgeMap
.
put
(
edgeKey
,
newEdge
);
}
}
}
}
...
@@ -222,10 +225,16 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -222,10 +225,16 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
String
payer
=
edge
.
getSource
();
String
payer
=
edge
.
getSource
();
String
payee
=
edge
.
getTarget
();
String
payee
=
edge
.
getTarget
();
double
amount
=
edge
.
getTotalAmount
();
double
amount
=
edge
.
getTotalAmount
();
String
ip
=
edge
.
getIp
();
String
mac
=
edge
.
getMac
();
String
account
=
edge
.
getAccount
();
// 更新付款人(转出)
// 更新付款人(转出)
GroupDetailEntity
payerDetail
=
memberDetailMap
.
get
(
payer
);
GroupDetailEntity
payerDetail
=
memberDetailMap
.
get
(
payer
);
if
(
payerDetail
!=
null
)
{
if
(
payerDetail
!=
null
)
{
payerDetail
.
setIp
(
ip
);
payerDetail
.
setMac
(
mac
);
payerDetail
.
setAccount
(
account
);
payerDetail
.
addOutgoingTransaction
(
amount
);
payerDetail
.
addOutgoingTransaction
(
amount
);
payerDetail
.
incrementTransactionCount
(
edge
.
getTotalTransactions
());
payerDetail
.
incrementTransactionCount
(
edge
.
getTotalTransactions
());
}
}
...
@@ -233,6 +242,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
...
@@ -233,6 +242,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
// 更新收款人(转入)
// 更新收款人(转入)
GroupDetailEntity
payeeDetail
=
memberDetailMap
.
get
(
payee
);
GroupDetailEntity
payeeDetail
=
memberDetailMap
.
get
(
payee
);
if
(
payeeDetail
!=
null
)
{
if
(
payeeDetail
!=
null
)
{
payeeDetail
.
setIp
(
ip
);
payeeDetail
.
setMac
(
mac
);
payeeDetail
.
setAccount
(
account
);
payeeDetail
.
addIncomingTransaction
(
amount
);
payeeDetail
.
addIncomingTransaction
(
amount
);
payeeDetail
.
incrementTransactionCount
(
edge
.
getTotalTransactions
());
payeeDetail
.
incrementTransactionCount
(
edge
.
getTotalTransactions
());
}
}
...
...
src/main/java/com/platform/service/impl/GroupDetailServiceImpl.java
View file @
fbf5742e
package
com.platform.service.impl
;
package
com.platform.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.platform.mapper.GroupDetailMapper
;
import
com.platform.mapper.GroupDetailMapper
;
import
com.platform.model.dto.GroupDetailDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.entity.GroupDetailEntity
;
import
com.platform.model.vo.GroupDetailVO
;
import
com.platform.service.GroupDetailService
;
import
com.platform.service.GroupDetailService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Service
public
class
GroupDetailServiceImpl
extends
ServiceImpl
<
GroupDetailMapper
,
GroupDetailEntity
>
implements
GroupDetailService
{
public
class
GroupDetailServiceImpl
extends
ServiceImpl
<
GroupDetailMapper
,
GroupDetailEntity
>
implements
GroupDetailService
{
@Override
public
List
<
GroupDetailEntity
>
queryList
(
GroupDetailDTO
groupDetailDTO
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
GroupDetailEntity
>()
.
eq
(
GroupDetailEntity:
:
getGroupId
,
groupDetailDTO
.
getGroupId
()));
}
@Override
public
List
<
GroupDetailVO
>
queryIp
(
GroupDetailDTO
groupDetailDTO
)
{
return
baseMapper
.
queryIp
(
groupDetailDTO
);
}
@Override
public
List
<
GroupDetailEntity
>
queryIpDetail
(
String
ip
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
GroupDetailEntity
>()
.
eq
(
GroupDetailEntity:
:
getIp
,
ip
));
}
@Override
public
List
<
GroupDetailVO
>
queryMac
(
GroupDetailDTO
groupDetailDTO
)
{
return
baseMapper
.
queryMac
(
groupDetailDTO
);
}
@Override
public
List
<
GroupDetailEntity
>
queryMacDetail
(
String
mac
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
GroupDetailEntity
>()
.
eq
(
GroupDetailEntity:
:
getMac
,
mac
));
}
}
}
src/main/java/com/platform/service/impl/GroupServiceImpl.java
View file @
fbf5742e
...
@@ -38,14 +38,15 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, GroupEntity> impl
...
@@ -38,14 +38,15 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, GroupEntity> impl
groupEntity
.
setTotalTransactions
(
groupVO
.
getTotalTransactions
());
groupEntity
.
setTotalTransactions
(
groupVO
.
getTotalTransactions
());
//入库
//入库
save
(
groupEntity
);
save
(
groupEntity
);
System
.
out
.
println
(
groupEntity
.
getId
());
groupVO
.
setId
(
groupEntity
.
getId
());
groupVO
.
setId
(
groupEntity
.
getId
());
List
<
GroupDetailEntity
>
groupDetailList
=
groupVO
.
getGroupDetailList
();
List
<
GroupDetailEntity
>
groupDetailList
=
groupVO
.
getGroupDetailList
();
if
(
CollUtil
.
isNotEmpty
(
groupDetailList
))
{
if
(
CollUtil
.
isNotEmpty
(
groupDetailList
))
{
groupDetailList
.
forEach
(
groupDetailEntity
->
groupDetailEntity
.
setCaseId
(
id
));
groupDetailList
.
forEach
(
groupDetailEntity
->
{
groupDetailEntity
.
setCaseId
(
id
);
groupDetailEntity
.
setGroupId
(
groupEntity
.
getId
());
});
groupDetailService
.
saveBatch
(
groupDetailList
);
groupDetailService
.
saveBatch
(
groupDetailList
);
}
}
groupVO
.
setGroupDetailList
(
null
);
groupVO
.
setGroupDetailList
(
null
);
});
});
}
}
...
...
src/main/resources/com/platform/mapper/ExcelDataMapper.xml
View file @
fbf5742e
...
@@ -24,7 +24,10 @@
...
@@ -24,7 +24,10 @@
select
select
pay_user_name payUserName,
pay_user_name payUserName,
payee_name payeeName,
payee_name payeeName,
amount amount
amount amount,
ip ip,
mac mac,
payment_bank_name
from
from
excel_data
excel_data
where
where
...
...
src/main/resources/com/platform/mapper/GroupDetailMapper.xml
0 → 100644
View file @
fbf5742e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.platform.mapper.GroupDetailMapper"
>
<select
id=
"queryIp"
resultType=
"com.platform.model.vo.GroupDetailVO"
>
SELECT
ip,
COUNT(*) AS frequency,
GROUP_CONCAT(DISTINCT user_name ORDER BY user_name SEPARATOR ', ') AS associatedUsers,
GROUP_CONCAT(DISTINCT account ORDER BY account SEPARATOR ', ') AS associatedAccounts
FROM
group_detail
where
group_id = #{groupId}
GROUP BY
ip
</select>
<select
id=
"queryMac"
resultType=
"com.platform.model.vo.GroupDetailVO"
>
SELECT
mac,
COUNT(*) AS frequency,
GROUP_CONCAT(DISTINCT user_name ORDER BY user_name SEPARATOR ', ') AS associatedUsers,
GROUP_CONCAT(DISTINCT account ORDER BY account SEPARATOR ', ') AS associatedAccounts
FROM
group_detail
where
group_id = #{groupId}
GROUP BY
mac
</select>
</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