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
e6d9c144
Commit
e6d9c144
authored
Aug 01, 2025
by
wujipeng
Browse files
人与人关系弹框分页
parent
28ab0abf
Changes
13
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/UserController.java
View file @
e6d9c144
...
...
@@ -43,4 +43,10 @@ public class UserController extends BaseController {
startPage
(
userDTO
.
getPageNum
(),
userDTO
.
getPageSize
());
return
getDataTable
((
userService
.
cashFlow
(
userDTO
)));
}
@ApiModelProperty
(
value
=
"人与人关系弹框分页"
)
@PostMapping
(
"/relation/page"
)
public
Result
relationPage
(
@RequestBody
UserDTO
userDTO
)
{
return
Result
.
data
(
userService
.
relationPage
(
userDTO
));
}
}
src/main/java/com/platform/mapper/ExcelDataMapper.java
View file @
e6d9c144
...
...
@@ -30,4 +30,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
);
List
<
ExcelDataEntity
>
relationPage
(
@Param
(
"oneselfAccountList"
)
List
<
String
>
oneselfAccountList
,
@Param
(
"otherAccountList"
)
List
<
String
>
otherAccountList
);
}
src/main/java/com/platform/mapper/UserAccountMapper.java
View file @
e6d9c144
...
...
@@ -11,4 +11,6 @@ import java.util.List;
public
interface
UserAccountMapper
extends
BaseMapper
<
UserAccountEntity
>
{
void
saveUserBatch
(
@Param
(
"userAccountList"
)
List
<
UserAccountEntity
>
userAccountList
);
List
<
String
>
queryUserAccountList
(
@Param
(
"userName"
)
String
userName
);
}
src/main/java/com/platform/model/dto/UserDTO.java
View file @
e6d9c144
...
...
@@ -23,4 +23,10 @@ public class UserDTO extends UserEntity {
@ApiModelProperty
(
value
=
"每页显示的数量"
,
example
=
"10"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"对方id"
)
private
String
otherId
;
}
src/main/java/com/platform/model/vo/EveryoneVO.java
0 → 100644
View file @
e6d9c144
package
com.platform.model.vo
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : wujipeng
* @date : 2025/8/1 17:51
* @Version: 1.0
* @Desc : 描述信息
*/
@Data
public
class
EveryoneVO
{
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"指认关系"
)
private
List
<
UserRelationEntity
>
relation
;
@ApiModelProperty
(
value
=
"交易次数"
)
private
Integer
tradeCount
;
@ApiModelProperty
(
value
=
"交易总额"
)
private
String
tradeTotal
;
@ApiModelProperty
(
value
=
"明细"
)
private
List
<
ExcelDataEntity
>
details
;
}
src/main/java/com/platform/service/ExcelDataService.java
View file @
e6d9c144
...
...
@@ -54,4 +54,6 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List
<
AssociationVO
>
selectFinancialTransactions
(
String
userName
,
String
caseId
);
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
);
List
<
ExcelDataEntity
>
relationPage
(
List
<
String
>
oneselfAccountList
,
List
<
String
>
otherAccountList
);
}
src/main/java/com/platform/service/UserAccountService.java
View file @
e6d9c144
...
...
@@ -11,4 +11,6 @@ public interface UserAccountService extends IService<UserAccountEntity> {
void
deleteByUserName
(
String
userName
);
void
saveUserBatch
(
List
<
UserAccountEntity
>
userAccountList
);
List
<
String
>
queryUserAccountList
(
String
userName
);
}
src/main/java/com/platform/service/UserService.java
View file @
e6d9c144
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.UserVO
;
import
java.util.List
;
...
...
@@ -25,4 +26,6 @@ public interface UserService extends IService<UserEntity> {
* @return List<ExcelDataEntity>
*/
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
);
EveryoneVO
relationPage
(
UserDTO
userDTO
);
}
src/main/java/com/platform/service/impl/ExcelDataServiceImpl.java
View file @
e6d9c144
...
...
@@ -76,4 +76,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
public
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
)
{
return
baseMapper
.
cashFlow
(
userDTO
);
}
@Override
public
List
<
ExcelDataEntity
>
relationPage
(
List
<
String
>
oneselfAccountList
,
List
<
String
>
otherAccountList
)
{
return
baseMapper
.
relationPage
(
oneselfAccountList
,
otherAccountList
);
}
}
src/main/java/com/platform/service/impl/UserAccountServiceImpl.java
View file @
e6d9c144
...
...
@@ -27,4 +27,9 @@ public class UserAccountServiceImpl extends ServiceImpl<UserAccountMapper, UserA
public
void
saveUserBatch
(
List
<
UserAccountEntity
>
userAccountList
)
{
baseMapper
.
saveUserBatch
(
userAccountList
);
}
@Override
public
List
<
String
>
queryUserAccountList
(
String
userName
)
{
return
baseMapper
.
queryUserAccountList
(
userName
);
}
}
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
e6d9c144
...
...
@@ -4,8 +4,10 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.map.MapUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.platform.exception.BusinessException
;
import
com.platform.mapper.UserMapper
;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
...
...
@@ -13,6 +15,7 @@ import com.platform.model.entity.UserAccountEntity;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
com.platform.model.vo.AssociationVO
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.UserVO
;
import
com.platform.service.ExcelDataService
;
import
com.platform.service.UserAccountService
;
...
...
@@ -164,4 +167,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
}
return
excelDataList
;
}
@Override
public
EveryoneVO
relationPage
(
UserDTO
userDTO
)
{
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
UserEntity
oneself
=
getById
(
userDTO
.
getUserId
());
UserEntity
other
=
getById
(
userDTO
.
getOtherId
());
if
(
ObjectUtils
.
isEmpty
(
oneself
)
||
ObjectUtils
.
isEmpty
(
other
)){
throw
new
BusinessException
(
"用户不存在"
);
}
//标题
everyoneVO
.
setTitle
(
oneself
.
getUserName
()
+
","
+
other
.
getUserName
());
//查询关系
List
<
UserRelationEntity
>
userRelation
=
userRelationService
.
list
(
new
LambdaQueryWrapper
<
UserRelationEntity
>()
.
eq
(
UserRelationEntity:
:
getUserId
,
userDTO
.
getUserId
())
.
eq
(
UserRelationEntity:
:
getOtherId
,
userDTO
.
getOtherId
()));
//指认关系
if
(
ObjectUtils
.
isEmpty
(
userRelation
)){
everyoneVO
.
setRelation
(
userRelation
);
}
//查询账户
List
<
String
>
oneselfAccountList
=
userAccountService
.
queryUserAccountList
(
oneself
.
getUserName
());
List
<
String
>
otherAccountList
=
userAccountService
.
queryUserAccountList
(
oneself
.
getUserName
());
PageHelper
.
startPage
(
userDTO
.
getPageNum
(),
userDTO
.
getPageSize
());
List
<
ExcelDataEntity
>
details
=
excelDataService
.
relationPage
(
oneselfAccountList
,
otherAccountList
);
everyoneVO
.
setDetails
(
details
);
PageHelper
.
clearPage
();
return
everyoneVO
;
}
}
src/main/resources/com/platform/mapper/ExcelDataMapper.xml
View file @
e6d9c144
...
...
@@ -106,4 +106,9 @@
payment_account = #{otherUserName}
)
</select>
<select
id=
"relationPage"
resultType=
"com.platform.model.entity.ExcelDataEntity"
>
select amount,time,payee_account,payment_account
from excel_data
where (payment_account in (#{oneselfAccountList}) and payment_account in (#{otherAccountList})) or (payment_account in (#{otherAccountList}) and payment_account in (#{oneselfAccountList}))
</select>
</mapper>
src/main/resources/com/platform/mapper/UserAccountMapper.xml
View file @
e6d9c144
...
...
@@ -9,4 +9,15 @@
(#{item.userName}, #{item.account}, #{item.caseId})
</foreach>
</insert>
<select
id=
"queryUserAccountList"
resultType=
"java.lang.String"
>
SELECT DISTINCT
CASE
WHEN direction = '出账' THEN payment_account
WHEN direction = '入账' THEN payee_account
ELSE NULL
END AS account
FROM excel_data
WHERE direction IN ('出账', '入账')
and pay_user_name = #{userName}
</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