|
|
|
@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
|
|
|
|
|
package com.cloud.kicc.system.controller; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.util.ArrayUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
@ -116,25 +117,18 @@ public class UserController {
@@ -116,25 +117,18 @@ public class UserController {
|
|
|
|
|
return R.ok(userService.getUserAuthority(user)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/test") |
|
|
|
|
public R test(String id) { |
|
|
|
|
List<User> userList = userService.list(Wrappers.<User>lambdaQuery() |
|
|
|
|
.ne(User::getId, SecurityUtils.getUser().getId()) |
|
|
|
|
.notIn(User::getUserType, "2", "5")); |
|
|
|
|
remotePushConcernFanService.enterpriseUserFanSave(id, userList); |
|
|
|
|
return R.ok(userList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@SysLog("用户新增") |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('user_add')") |
|
|
|
|
public R save(@RequestBody User user) { |
|
|
|
|
user.setPassword(ENCODER.encode(user.getPassword())); |
|
|
|
|
userService.saveUser(user); |
|
|
|
|
// 企业用户推送类型数据同步
|
|
|
|
|
if (StrUtil.equals(user.getUserType(), "2")) { |
|
|
|
|
//remotePushConcernFanService.pushConcernFanSave(user.getId(), SecurityConstants.FROM_IN);
|
|
|
|
|
// 企业内部用户推送类型数据同步
|
|
|
|
|
if (StrUtil.equals(user.getUserType(), "5")) { |
|
|
|
|
List<User> userList = userService.list(Wrappers.<User>lambdaQuery() |
|
|
|
|
.ne(User::getId, SecurityUtils.getUser().getId()) |
|
|
|
|
.notIn(User::getUserType, "2", "5")); |
|
|
|
|
remotePushConcernFanService.enterpriseUserFanSave(user.getId(), userList); |
|
|
|
|
} |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
@ -192,6 +186,7 @@ public class UserController {
@@ -192,6 +186,7 @@ public class UserController {
|
|
|
|
|
if (ArrayUtil.contains(ids, "1510539584287346688")) { |
|
|
|
|
return R.error("不允许删除超级管理员"); |
|
|
|
|
} |
|
|
|
|
remotePushConcernFanService.removeUserPushData(CollectionUtil.set(false, ids)); |
|
|
|
|
userService.removeByIds(Arrays.asList(ids)); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|