Commit b64c9878 by guojuxing

用户批量转移分组添加全部转移逻辑

parent e8123d70
...@@ -4,7 +4,9 @@ import java.util.Arrays; ...@@ -4,7 +4,9 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.service.*; import com.gic.cloud.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -108,12 +110,24 @@ public class UserController { ...@@ -108,12 +110,24 @@ public class UserController {
} }
@RequestMapping("/bulk-transfer-user-to-new-account-group") @RequestMapping("/bulk-transfer-user-to-new-account-group")
public RestResponse bulkTransferAccountGroup(String userIds, Integer targetAccountGroupId) { public RestResponse bulkTransferAccountGroup(String userIds, Integer targetAccountGroupId, boolean isAll) {
List<Integer> userIdList = Arrays.stream(userIds.split(",")) List<Integer> userIdList = null;
.filter(e -> StringUtils.isNumeric(e)) if (isAll) {
.mapToInt(e -> Integer.parseInt(e)) ServiceResponse<List<UserDTO>> result = userApiService.listUser(new UserQO()
.boxed() .setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId()));
.collect(Collectors.toList()); if (result.isSuccess()) {
List<UserDTO> userList = result.getResult();
if (CollectionUtils.isNotEmpty(userList)) {
userIdList = userList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
}
}
} else {
userIdList = Arrays.stream(userIds.split(","))
.filter(e -> StringUtils.isNumeric(e))
.mapToInt(e -> Integer.parseInt(e))
.boxed()
.collect(Collectors.toList());
}
return ResultControllerUtils.commonResult(userApiService.bulkTransferAccountGroup(userIdList, targetAccountGroupId)); return ResultControllerUtils.commonResult(userApiService.bulkTransferAccountGroup(userIdList, targetAccountGroupId));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment