|
@@ -52,7 +52,7 @@ import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 类注释
|
|
|
|
|
|
+ * {@link StatusException} 状态码范围:008XXX<br>
|
|
*
|
|
*
|
|
* @author WANGWEI
|
|
* @author WANGWEI
|
|
* @date 2018年7月23日
|
|
* @date 2018年7月23日
|
|
@@ -295,7 +295,37 @@ public class UserCloudServiceProvider extends ControllerSupport implements UserC
|
|
@PostMapping("getUserListByIds")
|
|
@PostMapping("getUserListByIds")
|
|
@Override
|
|
@Override
|
|
public GetUserListByIdsResp getUserListByIds(@RequestBody GetUserListByIdsReq req) {
|
|
public GetUserListByIdsResp getUserListByIds(@RequestBody GetUserListByIdsReq req) {
|
|
- return null;
|
|
|
|
|
|
+ Long rootOrgId = req.getRootOrgId();
|
|
|
|
+ List<Long> userIdList = req.getUserIdList();
|
|
|
|
+ if (CollectionUtils.isEmpty(userIdList)) {
|
|
|
|
+ throw new StatusException("008001", "userIdList is empty");
|
|
|
|
+ }
|
|
|
|
+ if (100 < userIdList.size()) {
|
|
|
|
+ throw new StatusException("008002", "size of userIdList is too large");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<UserEntity> userEntityList = userRepo.findByIdIn(userIdList);
|
|
|
|
+
|
|
|
|
+ List<UserBean> list = Lists.newArrayList();
|
|
|
|
+ for (UserEntity userEntity : userEntityList) {
|
|
|
|
+ UserBean userBean = new UserBean();
|
|
|
|
+ userBean.setUserId(userEntity.getId());
|
|
|
|
+ userBean.setName(userEntity.getName());
|
|
|
|
+ userBean.setLoginName(userEntity.getLoginName());
|
|
|
|
+ userBean.setDisplayName(userEntity.getLoginName() + " (" + userEntity.getName() + ")");
|
|
|
|
+ userBean.setOrgId(userEntity.getOrgId());
|
|
|
|
+ userBean.setRootOrgId(userEntity.getRootOrgId());
|
|
|
|
+
|
|
|
|
+ if (!userBean.getRootOrgId().equals(rootOrgId)) {
|
|
|
|
+ throw new StatusException("008003", "params error");
|
|
|
|
+ }
|
|
|
|
+ list.add(userBean);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ GetUserListByIdsResp resp = new GetUserListByIdsResp();
|
|
|
|
+ resp.setUserBeanList(list);
|
|
|
|
+
|
|
|
|
+ return resp;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|