WANG 6 年 前
コミット
07e76436f4

+ 23 - 2
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/provider/OrgCloudServiceProvider.java

@@ -52,7 +52,7 @@ import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 类注释
+ * {@link StatusException} 状态码范围:010XXX<br>
  *
  * @author WANGWEI
  * @date 2018年8月23日
@@ -135,7 +135,28 @@ public class OrgCloudServiceProvider extends ControllerSupport implements OrgClo
 	@PostMapping("getOrgsByIdList")
 	@Override
 	public GetOrgsByIdListResp getOrgsByIdList(@RequestBody GetOrgsByIdListReq req) {
-		return null;
+
+		List<Long> orgIdList = req.getOrgIdList();
+
+		final List<OrgBean> orgList = Lists.newArrayList();
+		for (Long cur : orgIdList) {
+			OrgEntity org = GlobalHelper.getEntity(orgRepo, cur, OrgEntity.class);
+			if (null == org) {
+				throw new StatusException("010001", "no org. [id=" + cur + "]");
+			}
+			OrgBean orgBean = new OrgBean();
+			orgBean.setId(org.getId());
+			orgBean.setName(org.getName());
+			orgBean.setCode(org.getCode());
+			orgBean.setParentId(org.getParentId());
+			orgBean.setRootId(org.getRootId());
+			orgBean.setEnable(org.getEnable());
+
+			orgList.add(orgBean);
+		}
+		GetOrgsByIdListResp resp = new GetOrgsByIdListResp();
+		resp.setOrgList(orgList);
+		return resp;
 	}
 
 	@ApiOperation(value = "查询所有机构")