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
6aa65f69
Commit
6aa65f69
authored
Aug 02, 2025
by
wujipeng
Browse files
用户关系修改
parent
26c2bacf
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/model/dto/UserDTO.java
View file @
6aa65f69
...
...
@@ -24,9 +24,9 @@ public class UserDTO extends UserEntity {
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
user
Id
;
private
String
user
Name
;
@ApiModelProperty
(
value
=
"对方id"
)
private
String
other
Id
;
private
String
other
Name
;
}
src/main/java/com/platform/model/entity/UserRelationEntity.java
View file @
6aa65f69
...
...
@@ -20,18 +20,19 @@ public class UserRelationEntity {
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"用户id"
)
@TableField
(
"user_id"
)
private
Integer
userId
;
@ApiModelProperty
(
value
=
"对方id"
)
@TableField
(
"other_id"
)
private
Integer
otherId
;
@ApiModelProperty
(
value
=
"用户名"
)
@TableField
(
"user_name"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"对方名"
)
@TableField
(
"other_name"
)
private
String
otherName
;
@ApiModelProperty
(
value
=
"案件id"
)
@TableField
(
"case_id"
)
private
String
caseId
;
@ApiModelProperty
(
value
=
"关系"
)
@TableField
(
"relation_ship"
)
private
String
relationShip
;
...
...
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
6aa65f69
...
...
@@ -54,7 +54,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List
<
UserAccountEntity
>
userAccountEntityList
=
userAccountService
.
queryListByUserName
(
userName
);
userVO
.
setUserAccountList
(
userAccountEntityList
);
}
List
<
UserRelationEntity
>
relationShipList
=
userRelationService
.
list
(
new
LambdaQueryWrapper
<
UserRelationEntity
>().
eq
(
UserRelationEntity:
:
getUserId
,
userEntity
.
getId
()));
List
<
UserRelationEntity
>
relationShipList
=
userRelationService
.
list
(
new
LambdaQueryWrapper
<
UserRelationEntity
>()
.
eq
(
UserRelationEntity:
:
getUserName
,
userEntity
.
getUserName
()).
eq
(
UserRelationEntity:
:
getCaseId
,
caseId
));
if
(!
ObjectUtils
.
isEmpty
(
relationShipList
)){
userVO
.
setRelationShipList
(
relationShipList
);
}
...
...
@@ -141,12 +142,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List
<
UserRelationEntity
>
relationShipList
=
userDTO
.
getRelationShipList
();
for
(
UserRelationEntity
userRelationEntity
:
relationShipList
)
{
userRelationEntity
.
setOtherId
(
userDTO
.
getId
());
userRelationEntity
.
setOtherName
(
userDTO
.
getUserName
());
userRelationEntity
.
setCaseId
(
userDTO
.
getCaseId
());
}
userRelationService
.
saveBatch
(
relationShipList
);
for
(
UserRelationEntity
userRelationEntity
:
relationShipList
)
{
userRelationEntity
.
setOtherId
(
userRelationEntity
.
getUserId
());
userRelationEntity
.
setUserId
(
userDTO
.
getId
());
userRelationEntity
.
setOtherName
(
userRelationEntity
.
getUserName
());
userRelationEntity
.
setUserName
(
userDTO
.
getUserName
());
userRelationEntity
.
setCaseId
(
userDTO
.
getCaseId
());
userRelationEntity
.
setId
(
null
);
}
userRelationService
.
saveBatch
(
relationShipList
);
...
...
@@ -171,8 +174,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
public
EveryoneVO
relationPage
(
UserDTO
userDTO
)
{
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
UserEntity
oneself
=
getById
(
userDTO
.
getUserId
());
UserEntity
other
=
getById
(
userDTO
.
getOtherId
());
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
(
"用户不存在"
);
}
...
...
@@ -180,8 +185,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
everyoneVO
.
setTitle
(
oneself
.
getUserName
()
+
","
+
other
.
getUserName
());
//查询关系
List
<
UserRelationEntity
>
userRelation
=
userRelationService
.
list
(
new
LambdaQueryWrapper
<
UserRelationEntity
>()
.
eq
(
UserRelationEntity:
:
getUser
Id
,
userDTO
.
getUser
Id
())
.
eq
(
UserRelationEntity:
:
getOther
Id
,
userDTO
.
getOther
Id
()));
.
eq
(
UserRelationEntity:
:
getUser
Name
,
userDTO
.
getUser
Name
())
.
eq
(
UserRelationEntity:
:
getOther
Name
,
userDTO
.
getOther
Name
()));
//指认关系
if
(
ObjectUtils
.
isEmpty
(
userRelation
)){
everyoneVO
.
setRelation
(
userRelation
);
...
...
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