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
a6575947
Commit
a6575947
authored
Sep 01, 2025
by
wujipeng
Browse files
人与人关系弹框分页-优化
parent
e8a7d940
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/model/vo/EveryoneVO.java
View file @
a6575947
...
...
@@ -30,4 +30,7 @@ public class EveryoneVO {
@ApiModelProperty
(
value
=
"明细"
)
private
List
<
ExcelDataEntity
>
details
;
@ApiModelProperty
(
value
=
"汇总文字"
)
private
List
<
String
>
totalDescription
;
}
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
a6575947
...
...
@@ -2,7 +2,6 @@ package com.platform.service.impl;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -27,7 +26,6 @@ import com.platform.service.UserRelationService;
import
com.platform.service.UserService
;
import
com.platform.utils.DozerUtils
;
import
com.platform.utils.IdCardUtils
;
import
org.checkerframework.checker.nullness.qual.Nullable
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -242,13 +240,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
public
EveryoneVO
relationPage
(
UserDTO
userDTO
)
{
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
UserEntity
oneself
=
getOne
(
new
LambdaQueryWrapper
<
UserEntity
>()
.
eq
(
UserEntity:
:
getUserName
,
userDTO
.
getUserName
()).
eq
(
UserEntity:
:
getCaseId
,
userDTO
.
getCaseId
()),
false
);
// UserEntity other = getOne(new LambdaQueryWrapper<UserEntity>()
// .eq(UserEntity::getUserName, userDTO.getOtherName()).eq(UserEntity::getCaseId, userDTO.getCaseId()), false);
// if (ObjectUtils.isEmpty(oneself) || ObjectUtils.isEmpty(other)) {
// throw new BusinessException("用户不存在");
// }
//标题
everyoneVO
.
setTitle
(
userDTO
.
getUserName
()
+
","
+
userDTO
.
getOtherName
());
//查询关系
...
...
@@ -263,11 +254,39 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
PageHelper
.
startPage
(
userDTO
.
getPageNum
(),
userDTO
.
getPageSize
());
List
<
ExcelDataEntity
>
details
=
Lists
.
newArrayList
();
if
(!
ObjectUtils
.
isEmpty
(
oneselfAccountList
)
&&
!
ObjectUtils
.
isEmpty
(
otherAccountList
))
{
List
<
ExcelDataEntity
>
details
=
excelDataService
.
relationPage
(
oneselfAccountList
,
otherAccountList
);
details
=
excelDataService
.
relationPage
(
oneselfAccountList
,
otherAccountList
);
everyoneVO
.
setDetails
(
details
);
}
PageHelper
.
clearPage
();
//汇总文字
List
<
String
>
totalDescription
=
Lists
.
newArrayList
();
//入账次数
int
inCount
=
0
;
//入账合计
double
inTotal
=
0
;
//出账次数
int
outCount
=
0
;
//出账合计
double
outTotal
=
0
;
if
(!
details
.
isEmpty
())
{
for
(
ExcelDataEntity
detail
:
details
)
{
if
(
"入账"
.
equals
(
detail
.
getDirection
()))
{
inCount
++;
inTotal
+=
detail
.
getAmount
();
}
else
if
(
"出账"
.
equals
(
detail
.
getDirection
()))
{
outCount
++;
outTotal
+=
detail
.
getAmount
();
}
}
totalDescription
.
add
(
userDTO
.
getUserName
()
+
"向"
+
userDTO
.
getOtherName
()
+
"转账"
+
outCount
+
"次,合计"
+
outTotal
+
"元;"
);
totalDescription
.
add
(
userDTO
.
getOtherName
()
+
"向"
+
userDTO
.
getUserName
()
+
"转账"
+
inCount
+
"次,合计"
+
inTotal
+
"元;"
);
}
else
{
totalDescription
.
add
(
userDTO
.
getUserName
()
+
"向"
+
userDTO
.
getOtherName
()
+
"转账0次,合计0元;"
);
totalDescription
.
add
(
userDTO
.
getOtherName
()
+
"向"
+
userDTO
.
getUserName
()
+
"转账0次,合计0元;"
);
}
everyoneVO
.
setTotalDescription
(
totalDescription
);
return
everyoneVO
;
}
...
...
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