Commit d47ce16e by guojuxing

超级管理员不能转移

parent f96fbd78
......@@ -6,7 +6,9 @@ import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.gic.auth.dto.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,10 +21,6 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AccountGroupMemberTypeEnum;
import com.gic.auth.constant.SignConstants;
import com.gic.auth.dto.AccountGroupDTO;
import com.gic.auth.dto.AccountGroupMemberDTO;
import com.gic.auth.dto.CollaboratorListDTO;
import com.gic.auth.dto.UserListDTO;
import com.gic.auth.qo.CollaboratorListQO;
import com.gic.auth.qo.UserListQO;
import com.gic.auth.service.AccountGroupApiService;
......@@ -162,8 +160,19 @@ public class AccountGroupController {
for (String str : accountGroupIdArr) {
accountGroupIdList.add(Integer.parseInt(str));
}
ServiceResponse<UserDTO> userResponse = userApiService.getUserByEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
if (!userResponse.isSuccess()) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "超级管理员数据有误");
}
Integer adminUserId = userResponse.getResult().getUserId();
List<Integer> userIdList = new ArrayList<>(userIdArr.length);
for (String str : userIdArr) {
if (StringUtils.isBlank(str)) {
continue;
}
if (str.equals(adminUserId.toString())) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "超级管理员不能转移");
}
userIdList.add(Integer.parseInt(str));
}
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
......
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