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
cd9aba24
Commit
cd9aba24
authored
Aug 05, 2025
by
wujipeng
Browse files
新增编辑用户关系
parent
3e90096d
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/UserController.java
View file @
cd9aba24
...
@@ -2,6 +2,8 @@ package com.platform.controller;
...
@@ -2,6 +2,8 @@ package com.platform.controller;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.UserAccountEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
import
com.platform.page.TableDataInfo
;
import
com.platform.page.TableDataInfo
;
import
com.platform.service.UserService
;
import
com.platform.service.UserService
;
...
@@ -31,12 +33,18 @@ public class UserController extends BaseController {
...
@@ -31,12 +33,18 @@ public class UserController extends BaseController {
return
toAjax
(
userService
.
updateUser
(
userDTO
));
return
toAjax
(
userService
.
updateUser
(
userDTO
));
}
}
@ApiModelProperty
(
value
=
"新增"
)
@ApiModelProperty
(
value
=
"新增
用户信息
"
)
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
public
Result
<
Boolean
>
add
(
@RequestBody
UserDTO
userDTO
)
{
public
Result
<
Boolean
>
add
(
@RequestBody
UserDTO
userDTO
)
{
return
Result
.
data
(
userService
.
add
(
userDTO
));
return
Result
.
data
(
userService
.
add
(
userDTO
));
}
}
@ApiModelProperty
(
value
=
"新增编辑用户关系"
)
@PostMapping
(
"/relation/save/update"
)
public
Result
<
Boolean
>
relationSaveOrUpdate
(
@RequestParam
(
name
=
"userRelationList"
)
List
<
UserRelationEntity
>
userRelationList
)
{
return
Result
.
data
(
userService
.
relationSaveOrUpdate
(
userRelationList
));
}
@ApiModelProperty
(
value
=
"资金流水"
)
@ApiModelProperty
(
value
=
"资金流水"
)
@PostMapping
(
"/cash/flow/page"
)
@PostMapping
(
"/cash/flow/page"
)
public
TableDataInfo
cashFlow
(
@RequestBody
UserDTO
userDTO
)
{
public
TableDataInfo
cashFlow
(
@RequestBody
UserDTO
userDTO
)
{
...
...
src/main/java/com/platform/service/UserService.java
View file @
cd9aba24
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
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.vo.EveryoneVO
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.UserVO
;
import
com.platform.model.vo.UserVO
;
...
@@ -34,4 +35,6 @@ public interface UserService extends IService<UserEntity> {
...
@@ -34,4 +35,6 @@ public interface UserService extends IService<UserEntity> {
UserEntity
getByUserName
(
String
newName
);
UserEntity
getByUserName
(
String
newName
);
List
<
String
>
queryListByCaseId
(
Integer
id
);
List
<
String
>
queryListByCaseId
(
Integer
id
);
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
);
}
}
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
cd9aba24
...
@@ -134,22 +134,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -134,22 +134,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userDTO
.
setSex
(
idCardInfo
.
get
(
"sex"
));
userDTO
.
setSex
(
idCardInfo
.
get
(
"sex"
));
userDTO
.
setIdType
(
"身份证"
);
userDTO
.
setIdType
(
"身份证"
);
}
}
save
(
userDTO
);
return
save
(
userDTO
);
List
<
UserRelationEntity
>
relationShipList
=
userDTO
.
getRelationShipList
();
for
(
UserRelationEntity
userRelationEntity
:
relationShipList
)
{
userRelationEntity
.
setOtherName
(
userDTO
.
getUserName
());
userRelationEntity
.
setCaseId
(
userDTO
.
getCaseId
());
}
userRelationService
.
saveBatch
(
relationShipList
);
for
(
UserRelationEntity
userRelationEntity
:
relationShipList
)
{
userRelationEntity
.
setOtherName
(
userRelationEntity
.
getUserName
());
userRelationEntity
.
setUserName
(
userDTO
.
getUserName
());
userRelationEntity
.
setCaseId
(
userDTO
.
getCaseId
());
userRelationEntity
.
setId
(
null
);
}
userRelationService
.
saveBatch
(
relationShipList
);
return
Boolean
.
TRUE
;
}
}
@Override
@Override
...
@@ -225,4 +210,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -225,4 +210,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userEntityList
.
forEach
(
userEntity
->
userNameList
.
add
(
userEntity
.
getUserName
()));
userEntityList
.
forEach
(
userEntity
->
userNameList
.
add
(
userEntity
.
getUserName
()));
return
new
ArrayList
<>(
userNameList
);
return
new
ArrayList
<>(
userNameList
);
}
}
@Override
public
Boolean
relationSaveOrUpdate
(
List
<
UserRelationEntity
>
userRelationList
)
{
return
userRelationService
.
saveOrUpdateBatch
(
userRelationList
);
}
}
}
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