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
35344c1e
Commit
35344c1e
authored
Aug 06, 2025
by
wujipeng
Browse files
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # src/main/java/com/platform/service/impl/UserServiceImpl.java
parents
7bfe80fd
f2662ffb
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/mapper/UserMapper.java
View file @
35344c1e
...
@@ -2,8 +2,14 @@ package com.platform.mapper;
...
@@ -2,8 +2,14 @@ package com.platform.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.vo.ExcelDataVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
@Mapper
public
interface
UserMapper
extends
BaseMapper
<
UserEntity
>
{
public
interface
UserMapper
extends
BaseMapper
<
UserEntity
>
{
List
<
ExcelDataVO
>
queryUserLabel
(
@Param
(
"userNameList"
)
List
<
String
>
userNameList
,
@Param
(
"caseId"
)
Integer
id
);
}
}
src/main/java/com/platform/service/UserService.java
View file @
35344c1e
...
@@ -6,6 +6,7 @@ import com.platform.model.entity.ExcelDataEntity;
...
@@ -6,6 +6,7 @@ import com.platform.model.entity.ExcelDataEntity;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.ExcelDataVO
;
import
com.platform.model.vo.UserVO
;
import
com.platform.model.vo.UserVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -37,4 +38,6 @@ public interface UserService extends IService<UserEntity> {
...
@@ -37,4 +38,6 @@ public interface UserService extends IService<UserEntity> {
List
<
String
>
queryListByCaseId
(
Integer
id
);
List
<
String
>
queryListByCaseId
(
Integer
id
);
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
);
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
);
List
<
ExcelDataVO
>
queryUserLabel
(
List
<
String
>
userNameList
,
Integer
id
);
}
}
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
35344c1e
...
@@ -16,7 +16,6 @@ import org.springframework.util.ObjectUtils;
...
@@ -16,7 +16,6 @@ import org.springframework.util.ObjectUtils;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
CaseServiceImpl
extends
ServiceImpl
<
CaseMapper
,
CasesEntity
>
implements
CasesService
{
public
class
CaseServiceImpl
extends
ServiceImpl
<
CaseMapper
,
CasesEntity
>
implements
CasesService
{
...
@@ -437,25 +436,25 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
...
@@ -437,25 +436,25 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
}
}
//查看每个人的账号类型
//查看每个人的账号类型
List
<
String
>
userNameList
=
new
ArrayList
<>(
uniqueNodes
);
List
<
String
>
userNameList
=
new
ArrayList
<>(
uniqueNodes
);
List
<
ExcelDataVO
>
excelDataEntityListNew
=
excelDataService
.
queryListByPayUserList
(
userNameList
,
caseDTO
.
getId
());
//查看每个人的账号标签
//根据用户名分组
List
<
ExcelDataVO
>
excelDataEntityListNew
=
userService
.
queryUserLabel
(
userNameList
,
caseDTO
.
getId
());
List
<
ExcelDataVO
>
groupedObjects
=
excelDataEntityListNew
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
ExcelDataVO:
:
getPayUserName
))
for
(
ExcelDataVO
dataVO
:
excelDataEntityListNew
)
{
.
values
().
stream
()
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
nodeDegreeMap
.
entrySet
())
{
.
map
(
list
->
list
.
get
(
0
))
// 保留每组的第一个对象
String
key
=
entry
.
getKey
();
.
collect
(
Collectors
.
toList
());
Integer
value
=
entry
.
getValue
();
if
(
dataVO
.
getPayUserName
().
equals
(
key
))
{
groupedObjects
.
forEach
(
excelDataVO
->
{
if
(
key
.
contains
(
"公司"
))
{
//获取节点数量
dataVO
.
setAccountType
(
"银联"
);
int
nodeNum
=
nodeDegreeMap
.
get
(
excelDataVO
.
getPayUserName
());
}
else
{
excelDataVO
.
setNodeNum
(
nodeNum
);
dataVO
.
setAccountType
(
"个人"
);
if
(
excelDataVO
.
getPayeeName
().
contains
(
"公司"
))
{
}
excelDataVO
.
setAccountType
(
"银联"
);
dataVO
.
setNodeNum
(
value
);
}
else
{
}
excelDataVO
.
setAccountType
(
"个人"
);
}
}
});
}
Iterator
<
ExcelDataVO
>
iterator
=
groupedObjects
.
iterator
();
Iterator
<
ExcelDataVO
>
iterator
=
excelDataEntityListNew
.
iterator
();
while
(
iterator
.
hasNext
())
{
while
(
iterator
.
hasNext
())
{
ExcelDataVO
excelDataVO
=
iterator
.
next
();
ExcelDataVO
excelDataVO
=
iterator
.
next
();
if
(
caseDTO
.
getMinTransaction
()
!=
null
&&
caseDTO
.
getMaxTransaction
()
!=
null
)
{
if
(
caseDTO
.
getMinTransaction
()
!=
null
&&
caseDTO
.
getMaxTransaction
()
!=
null
)
{
...
@@ -469,22 +468,24 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
...
@@ -469,22 +468,24 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
}
}
}
}
}
}
List
<
NodeVO
>
result
=
Lists
.
newArrayList
();
List
<
NodeVO
>
result
=
Lists
.
newArrayList
();
groupedObjects
.
forEach
(
excelDataVO
->
{
excelDataEntityListNew
.
forEach
(
excelDataVO
->
{
NodeVO
person
=
new
NodeVO
();
person
.
setNode
(
excelDataVO
.
getPayUserName
());
person
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
person
.
setLabel
(
excelDataVO
.
getLabel
());
person
.
setNodeType
(
"个人"
);
result
.
add
(
person
);
NodeVO
org
=
new
NodeVO
();
NodeVO
org
=
new
NodeVO
();
if
(
excelDataVO
.
get
PayeeName
().
contain
s
(
"
公司
"
))
{
if
(
excelDataVO
.
get
AccountType
().
equal
s
(
"
银联
"
))
{
org
.
setNode
(
excelDataVO
.
getPay
ee
Name
());
org
.
setNode
(
excelDataVO
.
getPay
User
Name
());
org
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
org
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
org
.
setBankCode
(
excelDataVO
.
getPayeeBankCard
());
org
.
setBankCode
(
excelDataVO
.
getPayeeBankCard
());
org
.
setNodeType
(
"银联"
);
org
.
setNodeType
(
"银联"
);
result
.
add
(
org
);
result
.
add
(
org
);
}
else
{
NodeVO
person
=
new
NodeVO
();
person
.
setNode
(
excelDataVO
.
getPayUserName
());
person
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
person
.
setLabel
(
excelDataVO
.
getLabel
());
person
.
setNodeType
(
"个人"
);
result
.
add
(
person
);
}
}
});
});
return
result
;
return
result
;
...
...
src/main/java/com/platform/service/impl/GroupDetailServiceImpl.java
View file @
35344c1e
...
@@ -27,8 +27,12 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
...
@@ -27,8 +27,12 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
@Override
@Override
public
List
<
GroupDetailEntity
>
queryList
(
GroupDetailDTO
groupDetailDTO
)
{
public
List
<
GroupDetailEntity
>
queryList
(
GroupDetailDTO
groupDetailDTO
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
GroupDetailEntity
>()
List
<
GroupDetailEntity
>
groupDetailEntityList
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
GroupDetailEntity
>()
.
eq
(
GroupDetailEntity:
:
getGroupId
,
groupDetailDTO
.
getGroupId
()));
.
eq
(
GroupDetailEntity:
:
getGroupId
,
groupDetailDTO
.
getGroupId
()));
// 安全移除元素
groupDetailEntityList
.
removeIf
(
groupDetailEntity
->
groupDetailEntity
.
getUserName
().
contains
(
"商户"
));
return
groupDetailEntityList
;
}
}
@Override
@Override
...
...
src/main/java/com/platform/service/impl/GroupServiceImpl.java
View file @
35344c1e
...
@@ -33,9 +33,11 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, GroupEntity> impl
...
@@ -33,9 +33,11 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, GroupEntity> impl
GroupVO
groupVO
=
groups
.
get
(
i
);
GroupVO
groupVO
=
groups
.
get
(
i
);
GroupEntity
groupEntity
=
new
GroupEntity
();
GroupEntity
groupEntity
=
new
GroupEntity
();
groupEntity
.
setGroupSize
(
groupVO
.
getGroupSize
());
groupEntity
.
setGroupSize
(
groupVO
.
getGroupSize
());
groupEntity
.
setGroupName
(
"团体"
+
1
);
groupEntity
.
setGroupName
(
"团体"
+
i
);
groupEntity
.
setCaseId
(
id
);
groupEntity
.
setCaseId
(
id
);
groupEntity
.
setTotalAmount
(
groupVO
.
getTotalAmount
());
double
totalAmount
=
groupVO
.
getTotalAmount
();
double
formattedAmount
=
Math
.
round
(
totalAmount
*
100.0
)
/
100.0
;
groupEntity
.
setTotalAmount
(
formattedAmount
);
groupEntity
.
setTotalTransactions
(
groupVO
.
getTotalTransactions
());
groupEntity
.
setTotalTransactions
(
groupVO
.
getTotalTransactions
());
//入库
//入库
save
(
groupEntity
);
save
(
groupEntity
);
...
...
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
35344c1e
...
@@ -278,4 +278,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -278,4 +278,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
public
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
)
{
public
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
)
{
return
userRelationService
.
saveOrUpdateBatch
(
userRelationList
);
return
userRelationService
.
saveOrUpdateBatch
(
userRelationList
);
}
}
@Override
public
List
<
ExcelDataVO
>
queryUserLabel
(
List
<
String
>
userNameList
,
Integer
id
)
{
return
baseMapper
.
queryUserLabel
(
userNameList
,
id
);
}
}
}
src/main/resources/application.yml
View file @
35344c1e
...
@@ -4,9 +4,9 @@ server:
...
@@ -4,9 +4,9 @@ server:
spring
:
spring
:
datasource
:
datasource
:
username
:
root
username
:
root
password
:
xukang123
password
:
RZKJ_0415$
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://
101.126.87.27
:3306/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
url
:
jdbc:mysql://
47.110.71.183
:3306/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
servlet
:
servlet
:
multipart
:
multipart
:
...
...
src/main/resources/com/platform/mapper/UserMapper.xml
View file @
35344c1e
...
@@ -3,4 +3,17 @@
...
@@ -3,4 +3,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.platform.mapper.UserMapper"
>
<mapper
namespace=
"com.platform.mapper.UserMapper"
>
<select
id=
"queryUserLabel"
resultType=
"com.platform.model.vo.ExcelDataVO"
>
SELECT
v.userName AS payUserName,
u.label
FROM
(
<foreach
collection=
"userNameList"
item=
"userName"
separator=
"UNION ALL"
>
SELECT #{userName} AS userName
</foreach>
) AS v
LEFT JOIN
user u ON u.user_name = v.userName AND u.case_id = #{caseId}
</select>
</mapper>
</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