|
@@ -82,6 +82,11 @@ public class SysUserController extends AbstractController {
|
|
|
if (null == resultPage) {
|
|
|
return R.error("获取用户列表失败");
|
|
|
}
|
|
|
+ resultPage.getRecords().parallelStream().forEach(user->{
|
|
|
+ if (!ObjectUtils.isEmpty(user.getIsPlatformStreamer()) && user.getIsPlatformStreamer()) {
|
|
|
+ user.setRoleName("平台主持人");
|
|
|
+ }
|
|
|
+ });
|
|
|
return R.ok(CommonDataUtils.assembleResult(resultPage.getTotal(), resultPage.getPages()
|
|
|
, resultPage.getCurrent(), resultPage.getRecords()));
|
|
|
}
|
|
@@ -350,29 +355,24 @@ public class SysUserController extends AbstractController {
|
|
|
}
|
|
|
|
|
|
Long deptId = sysUserEntity.getDeptId();
|
|
|
-
|
|
|
- // 更新企业员工信息
|
|
|
- long num = sysUserService.getUserNumOfDept(deptId);
|
|
|
-
|
|
|
- if (ObjectUtils.isEmpty(deptId)) {
|
|
|
- return R.error("删除员工失败:员工企业信息设置有误!");
|
|
|
- }
|
|
|
-
|
|
|
- if(num <= 1){
|
|
|
- return R.error("删除失败,公司仅剩一个账号");
|
|
|
- }
|
|
|
- // 获取直播间绑定信息
|
|
|
- List<Long> bindUsers = mySysUserBrandService.queryBrandIdList(userId);
|
|
|
- if (!ObjectUtils.isEmpty(bindUsers)) {
|
|
|
- // 获取该公司下管理员手机号
|
|
|
- List<SysUserEntity> userEntities = sysUserService.getSysUserListByDeptIds(Arrays.asList(deptId));
|
|
|
- List<String> phones = userEntities.stream().filter(user -> !user.getUserId().equals(userId))
|
|
|
- .map(SysUserEntity::getMobile).collect(Collectors.toList());
|
|
|
-
|
|
|
- if(ObjectUtils.isEmpty(phones)){
|
|
|
- return R.error("删除失败,公司仅剩一名员工,不可进行删除!");
|
|
|
+ if(!ObjectUtils.isEmpty(deptId)){
|
|
|
+ // 更新企业员工信息
|
|
|
+ long num = sysUserService.getUserNumOfDept(deptId);
|
|
|
+ if(num <= 1){
|
|
|
+ return R.error("删除失败,公司仅剩一个账号");
|
|
|
+ }
|
|
|
+ // 获取直播间绑定信息
|
|
|
+ List<Long> bindUsers = mySysUserBrandService.queryBrandIdList(userId);
|
|
|
+ if (!ObjectUtils.isEmpty(bindUsers)) {
|
|
|
+ // 获取该公司下管理员手机号
|
|
|
+ List<SysUserEntity> userEntities = sysUserService.getSysUserListByDeptIds(Arrays.asList(deptId));
|
|
|
+ List<String> phones = userEntities.stream().filter(user -> !user.getUserId().equals(userId))
|
|
|
+ .map(SysUserEntity::getMobile).collect(Collectors.toList());
|
|
|
+ if(ObjectUtils.isEmpty(phones)){
|
|
|
+ return R.error("删除失败,公司仅剩一名员工,不可进行删除!");
|
|
|
+ }
|
|
|
+ return R.ok().put("list", phones);
|
|
|
}
|
|
|
- return R.ok().put("list", phones);
|
|
|
}
|
|
|
return R.ok();
|
|
|
}
|