|
@@ -28,21 +28,15 @@ public class ZfbController {
|
|
|
@Autowired
|
|
|
private ZhiHouseService zhiHouseService;
|
|
|
|
|
|
- @PostMapping("/preDeleteStaff")
|
|
|
- public Result preDeleteStaff(@RequestBody HashMap<String,Long> param) {
|
|
|
- Long userId = param.get("userId");
|
|
|
- Long deptId = param.get("companyId");
|
|
|
+ @PostMapping("/deleteStaff")
|
|
|
+ public Result deleteStaff(@RequestBody JSONObject param) {
|
|
|
+ Long userId = param.getLong("userId");
|
|
|
+ Long toUserId = param.getLong("toUserId");
|
|
|
+ String toUserPone = param.getString("toUserPone");
|
|
|
// 获取直播间绑定信息
|
|
|
List<Long> bindUsers = mySysUserBrandService.queryBrandIdList(userId);
|
|
|
if (!ObjectUtils.isEmpty(bindUsers)) {
|
|
|
- // 获取该公司下管理员手机号
|
|
|
- List<TbUser> userEntities = zhiHouseService.getSysUserListByDeptIds(deptId);
|
|
|
- List<String> phones = userEntities.stream().filter(user -> !user.getId().equals(userId))
|
|
|
- .map(TbUser::getPhone).collect(Collectors.toList());
|
|
|
- if(ObjectUtils.isEmpty(phones)){
|
|
|
- return Result.failure("删除失败,公司仅剩一名员工,不可进行删除!");
|
|
|
- }
|
|
|
- return Result.success(phones);
|
|
|
+ mySysUserBrandService.reBindUser(userId,toUserId,toUserPone);
|
|
|
}
|
|
|
return Result.success();
|
|
|
}
|