Browse Source

。。。

wangwei 6 years ago
parent
commit
9430392367

+ 324 - 126
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/OrgController.java

@@ -4,7 +4,9 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -21,6 +23,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -35,14 +38,17 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnum;
 import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnumManager;
 import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
 import cn.com.qmth.examcloud.commons.base.util.excel.ExcelError;
+import cn.com.qmth.examcloud.commons.web.helpers.page.PageInfo;
 import cn.com.qmth.examcloud.commons.web.security.bean.User;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.OrgDomain;
 import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
 import cn.com.qmth.examcloud.core.basic.dao.OrgPropertyRepo;
 import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
@@ -50,8 +56,9 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
 import cn.com.qmth.examcloud.core.basic.dao.entity.OrgPropertyEntity;
 import cn.com.qmth.examcloud.core.basic.dao.enums.OrgProperty;
 import cn.com.qmth.examcloud.core.basic.service.bean.OrgDto;
+import cn.com.qmth.examcloud.core.basic.service.bean.OrgInfo;
 import cn.com.qmth.examcloud.core.basic.service.impl.ExportService;
-import cn.com.qmth.examcloud.core.basic.service.impl.OrgService;
+import cn.com.qmth.examcloud.core.basic.service.impl.OrgServiceImpl;
 import io.swagger.annotations.ApiOperation;
 
 /**
@@ -66,7 +73,7 @@ public class OrgController extends ControllerSupport {
 	OrgRepo orgRepo;
 
 	@Autowired
-	OrgService orgService;
+	OrgServiceImpl orgService;
 
 	@Autowired
 	OrgPropertyRepo orgPropertyRepo;
@@ -75,92 +82,173 @@ public class OrgController extends ControllerSupport {
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param id
+	 * @param curPage
+	 * @param pageSize
+	 * @param code
+	 * @param name
+	 * @return
+	 */
+	@ApiOperation(value = "分页查询顶级机构")
+	@GetMapping("/rootOrgPage/{curPage}/{pageSize}")
+	public PageInfo<OrgDomain> getRootOrgPage(@PathVariable Integer curPage,
+			@PathVariable Integer pageSize, @RequestParam(required = false) String code,
+			@RequestParam(required = false) String name) {
+
+		Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
+
+		Specification<OrgEntity> specification = (root, query, cb) -> {
+			List<Predicate> predicates = new ArrayList<>();
+			predicates.add(cb.isNull(root.get("parentId")));
+			if (StringUtils.isNotEmpty(name)) {
+				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
+			}
+			if (StringUtils.isNotEmpty(code)) {
+				predicates.add(cb.like(root.get("code"), toSqlSearchPattern(code)));
+			}
+			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+		};
+
+		Page<OrgEntity> page = orgRepo.findAll(specification, pageable);
+		List<OrgDomain> list = Lists.newArrayList();
+		Iterator<OrgEntity> iterator = page.iterator();
+
+		while (iterator.hasNext()) {
+			OrgEntity next = iterator.next();
+			OrgDomain d = new OrgDomain();
+			list.add(d);
+
+			d.setCode(next.getCode());
+			d.setContacts(next.getContacts());
+			d.setEnable(next.getEnable());
+			d.setId(next.getId());
+			d.setName(next.getName());
+			d.setParentId(next.getParentId());
+			d.setRemark(next.getRemark());
+			d.setRootId(next.getRootId());
+			d.setTelephone(next.getTelephone());
+		}
+
+		PageInfo<OrgDomain> ret = new PageInfo<OrgDomain>();
+		ret.setList(list);
+		ret.setTotal(page.getTotalElements());
+		return ret;
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param orgId
 	 * @return
 	 */
 	@ApiOperation(value = "按ID查询机构", notes = "ID查询")
-	@GetMapping("/{id}")
-	public OrgEntity getOrg(@PathVariable Long id) {
-		OrgEntity org = orgService.findOne(id);
-		return org;
+	@GetMapping("{orgId}")
+	public OrgEntity getOrg(@PathVariable Long orgId) {
+		OrgEntity orgEntity = orgRepo.findOne(orgId);
+		if (null == orgEntity) {
+			throw new StatusException("B-001250", "orgId is wrong");
+		}
+		validateRootOrgIsolation(orgEntity.getRootId());
+
+		return orgEntity;
 	}
 
 	/**
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param parentId
+	 * @param code
 	 * @return
 	 */
-	@ApiOperation(value = "查询下属机构不带分页", notes = "不分页")
-	@GetMapping("/sub/{parentId}")
-	public List<OrgEntity> getSubOrgList(@PathVariable Long parentId) {
-		List<OrgEntity> orgList = orgRepo.findByParentIdAndEnable(parentId, true);
-		return orgList;
+	@ApiOperation(value = "查询顶级机构")
+	@GetMapping("getRootOrgByCode")
+	public OrgEntity getRootOrgByCode(@RequestParam("code") String code) {
+		OrgEntity org = orgRepo.findByParentIdIsNullAndCode(code);
+		return org;
 	}
 
 	/**
-	 * 修改请通知作者
+	 * 方法注释
 	 *
 	 * @author WANGWEI
 	 * @param curPage
 	 * @param pageSize
-	 * @param rootOrgId
+	 * @param parentId
 	 * @param code
 	 * @param name
 	 * @return
 	 */
-	@ApiOperation(value = "模糊查询顶级机构的子机构")
-	@GetMapping("/getSubOrgList/{curPage}/{pageSize}")
-	public Page<OrgEntity> getSubOrgListOfRootOrg(@PathVariable Integer curPage,
-			@PathVariable Integer pageSize, @RequestParam Long rootOrgId, @RequestParam String code,
-			@RequestParam String name) {
-
-		User accessUser = getAccessUser();
-		if (!isSuperAdmin()) {
-			if (!accessUser.getRootOrgId().equals(rootOrgId)) {
-				throw new StatusException("B-140001", "非法访问");
-			}
+	@ApiOperation(value = "分页查询子机构")
+	@GetMapping("subOrgPage/{curPage}/{pageSize}")
+	public PageInfo<OrgDomain> getSubOrgPage(@PathVariable Integer curPage,
+			@PathVariable Integer pageSize, @RequestParam(required = true) Long parentId,
+			@RequestParam(required = false) String code,
+			@RequestParam(required = false) String name) {
+
+		OrgEntity parentOrg = orgRepo.findOne(parentId);
+		if (null == parentOrg) {
+			throw new StatusException("B-001250", "parentId is wrong");
 		}
+		validateRootOrgIsolation(parentOrg.getRootId());
 
-		Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
-				"updateTime");
-
-		OrgEntity criteria = new OrgEntity();
-		criteria.setParentId(rootOrgId);
-		criteria.setCode(code);
-		criteria.setName(name);
+		Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
 
 		Specification<OrgEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
-			if (StringUtils.isNotEmpty(criteria.getName())) {
-				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(criteria.getName())));
+			predicates.add(cb.equal(root.get("parentId"), parentId));
+
+			if (StringUtils.isNotEmpty(name)) {
+				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
 			}
-			if (StringUtils.isNotEmpty(criteria.getCode())) {
-				predicates.add(cb.like(root.get("code"), toSqlSearchPattern(criteria.getCode())));
+			if (StringUtils.isNotEmpty(code)) {
+				predicates.add(cb.like(root.get("code"), toSqlSearchPattern(code)));
 			}
-			predicates.add(cb.equal(root.get("parentId"), criteria.getParentId()));
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 		};
 
-		Page<OrgEntity> ret = orgRepo.findAll(specification, pageable);
+		Page<OrgEntity> page = orgRepo.findAll(specification, pageable);
+		List<OrgDomain> list = Lists.newArrayList();
+		Iterator<OrgEntity> iterator = page.iterator();
+
+		while (iterator.hasNext()) {
+			OrgEntity next = iterator.next();
+			OrgDomain d = new OrgDomain();
+			list.add(d);
+
+			d.setCode(next.getCode());
+			d.setContacts(next.getContacts());
+			d.setEnable(next.getEnable());
+			d.setId(next.getId());
+			d.setName(next.getName());
+			d.setParentId(next.getParentId());
+			d.setRemark(next.getRemark());
+			d.setRootId(next.getRootId());
+			d.setTelephone(next.getTelephone());
+		}
+
+		PageInfo<OrgDomain> ret = new PageInfo<OrgDomain>();
+		ret.setList(list);
+		ret.setTotal(page.getTotalElements());
 		return ret;
 	}
 
 	/**
-	 * 修改请通知作者
+	 * 方法注释
 	 *
 	 * @author WANGWEI
+	 * @param enable
 	 * @return
 	 */
-	@ApiOperation(value = "查询所有顶级机构")
-	@GetMapping("/getAllRootOrgList")
-	public List<OrgEntity> getAllRootOrgList() {
+	@ApiOperation(value = "查询顶级机构")
+	@GetMapping("getRootOrgList")
+	public List<OrgEntity> getRootOrgList(@RequestParam(required = false) Boolean enable) {
 
 		Specification<OrgEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
 			predicates.add(cb.isNull(root.get("parentId")));
-			predicates.add(cb.equal(root.get("enable"), true));
+			if (null != enable) {
+				predicates.add(cb.equal(root.get("enable"), enable));
+			}
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 		};
 
@@ -169,62 +257,136 @@ public class OrgController extends ControllerSupport {
 	}
 
 	/**
-	 * 修改请通知作者
+	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param curPage
-	 * @param pageSize
-	 * @param rootOrgId
-	 * @param code
-	 * @param name
+	 * @param parentId
+	 * @param orgName
 	 * @return
 	 */
-	@ApiOperation(value = "模糊查询顶级机构")
-	@GetMapping("/getRootOrgList/{curPage}/{pageSize}")
-	public Page<OrgEntity> getRootOrgList(@PathVariable Integer curPage,
-			@PathVariable Integer pageSize, @RequestParam String code, @RequestParam String name) {
+	@ApiOperation(value = "查询子机构列表")
+	@GetMapping("subOrgListByNameLike")
+	public List<OrgEntity> getSubOrgListByNameLike(@RequestParam(required = true) String name,
+			@RequestParam(required = false) Boolean enable) {
 
-		Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
-				"updateTime");
+		if (StringUtils.isBlank(name)) {
+			List<OrgEntity> list = Lists.newArrayList();
+			return list;
+		}
 
-		OrgEntity criteria = new OrgEntity();
-		criteria.setCode(code);
-		criteria.setName(name);
+		// 过载保护
+		int total = orgRepo.countByNameLike(name);
+		if (total > 1000) {
+			List<OrgEntity> list = Lists.newArrayList();
+			return list;
+		}
 
 		Specification<OrgEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
-			if (StringUtils.isNotEmpty(criteria.getName())) {
-				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(criteria.getName())));
+			predicates.add(cb.equal(root.get("rootId"), getRootOrgId()));
+			if (StringUtils.isNotBlank(name)) {
+				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
 			}
-			if (StringUtils.isNotEmpty(criteria.getCode())) {
-				predicates.add(cb.like(root.get("code"), toSqlSearchPattern(criteria.getCode())));
+			if (null != enable) {
+				predicates.add(cb.equal(root.get("enable"), enable));
 			}
-			predicates.add(cb.isNull(root.get("parentId")));
+
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 		};
+		Sort sort = new Sort(Direction.DESC, "updateTime");
+		List<OrgEntity> list = orgRepo.findAll(specification, sort);
 
-		Page<OrgEntity> ret = orgRepo.findAll(specification, pageable);
-		return ret;
+		return list;
 	}
 
 	/**
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param org
-	 * @param request
+	 * @param orgId
+	 * @return
+	 */
+	@ApiOperation(value = "查询机构所有属性")
+	@GetMapping("allProperties/{orgId}")
+	public Map<String, String> getAllOrgProperties(@PathVariable Long orgId) {
+
+		OrgEntity orgEntity = orgRepo.findOne(orgId);
+		if (null == orgEntity) {
+			throw new StatusException("B-001250", "orgId is wrong");
+		}
+		validateRootOrgIsolation(orgEntity.getRootId());
+
+		Map<String, String> map = Maps.newHashMap();
+		List<OrgPropertyEntity> list = orgPropertyRepo.findByOrgId(orgId);
+		DynamicEnumManager manager = OrgProperty.getDynamicEnumManager();
+		for (OrgPropertyEntity cur : list) {
+			DynamicEnum de = manager.getById(cur.getKeyId());
+			map.put(de.getName(), cur.getValue());
+		}
+
+		return map;
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param orgId
+	 * @param key
+	 * @return
+	 */
+	@ApiOperation(value = "查询机构单个属性")
+	@GetMapping("property/{orgId}/{key}")
+	public String getOrgProperty(@PathVariable Long orgId, @PathVariable String key) {
+		OrgEntity orgEntity = orgRepo.findOne(orgId);
+		if (null == orgEntity) {
+			throw new StatusException("B-001250", "orgId is wrong");
+		}
+		validateRootOrgIsolation(orgEntity.getRootId());
+
+		DynamicEnumManager manager = OrgProperty.getDynamicEnumManager();
+		DynamicEnum de = manager.getByName(key);
+		OrgPropertyEntity one = orgPropertyRepo.findByOrgIdAndKeyId(orgId, de.getId());
+		if (null == one) {
+			return null;
+		}
+		return one.getValue();
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param domain
 	 * @return
 	 */
 	@ApiOperation(value = "新增顶级机构", notes = "新增")
 	@PostMapping("addRootOrg")
-	public OrgEntity addRootOrg(@RequestBody OrgEntity org) {
+	public OrgEntity addRootOrg(@RequestBody OrgDomain domain) {
+		trim(domain);
 
 		if (!isSuperAdmin()) {
 			throw new StatusException("B-140001", "非法访问");
 		}
 
-		org.setParentId(null);
-		OrgEntity saved = orgService.save(org);
+		if (StringUtils.isBlank(domain.getCode())) {
+			throw new StatusException("B-150001", "code is null");
+		}
+
+		OrgEntity orgEntity = orgRepo.findByParentIdIsNullAndCode(domain.getCode());
+		if (null == orgEntity) {
+			throw new StatusException("B-150001", "机构代码已存在");
+		}
+
+		OrgInfo info = new OrgInfo();
+		info.setCode(domain.getCode());
+		info.setName(domain.getName());
+		info.setContacts(domain.getContacts());
+		info.setTelephone(domain.getTelephone());
+		info.setDomainName(domain.getDomainName());
+		info.setRemark(domain.getRemark());
+
+		OrgEntity saved = orgService.saveRootOrg(info);
 		return saved;
 	}
 
@@ -232,20 +394,27 @@ public class OrgController extends ControllerSupport {
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param org
+	 * @param domain
 	 * @return
 	 */
 	@ApiOperation(value = "更新顶级机构", notes = "更新")
 	@PutMapping("updateRootOrg")
-	public OrgEntity updateRootOrg(@RequestBody OrgEntity org) {
-		trim(org);
+	public OrgEntity updateRootOrg(@RequestBody OrgDomain domain) {
+		trim(domain);
+
 		if (!isSuperAdmin()) {
 			throw new StatusException("B-140001", "非法访问");
 		}
 
-		org.setParentId(null);
-		org.setRootId(org.getId());
-		OrgEntity saved = orgService.save(org);
+		OrgInfo info = new OrgInfo();
+		info.setCode(domain.getCode());
+		info.setName(domain.getName());
+		info.setContacts(domain.getContacts());
+		info.setTelephone(domain.getTelephone());
+		info.setDomainName(domain.getDomainName());
+		info.setRemark(domain.getRemark());
+
+		OrgEntity saved = orgService.saveRootOrg(info);
 		return saved;
 	}
 
@@ -253,24 +422,31 @@ public class OrgController extends ControllerSupport {
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param org
+	 * @param domain
 	 * @return
 	 */
 	@ApiOperation(value = "新增子机构", notes = "新增")
 	@PostMapping("addSubOrg")
-	public OrgEntity addSubOrg(@RequestBody OrgEntity org) {
-		trim(org);
+	public OrgEntity addSubOrg(@RequestBody OrgDomain domain) {
+		trim(domain);
+
 		User accessUser = getAccessUser();
 
-		OrgEntity subOrg = orgRepo.findByRootIdAndCode(accessUser.getRootOrgId(), org.getCode());
+		OrgEntity subOrg = orgRepo.findByRootIdAndCode(accessUser.getRootOrgId(), domain.getCode());
 		if (null != subOrg) {
 			throw new StatusException("B-140001", "机构代码已存在");
 		}
-		org.setParentId(accessUser.getRootOrgId());
-		org.setRootId(accessUser.getRootOrgId());
-		OrgEntity saved = orgService.save(org);
 
-		// orgService.createLearnerCenterUser(saved);
+		OrgInfo info = new OrgInfo();
+		info.setCode(domain.getCode());
+		info.setName(domain.getName());
+		info.setContacts(domain.getContacts());
+		info.setTelephone(domain.getTelephone());
+		info.setParentId(accessUser.getRootOrgId());
+		info.setRootId(accessUser.getRootOrgId());
+		info.setRemark(domain.getRemark());
+
+		OrgEntity saved = orgService.saveSubOrg(info);
 		return saved;
 	}
 
@@ -278,18 +454,31 @@ public class OrgController extends ControllerSupport {
 	 * 方法注释
 	 *
 	 * @author WANGWEI
-	 * @param org
-	 * @param request
+	 * @param domain
 	 * @return
 	 */
 	@ApiOperation(value = "更新子机构", notes = "更新")
 	@PutMapping("updateSubOrg")
-	public OrgEntity updateSubOrg(@RequestBody OrgEntity org) {
-		cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
+	public OrgEntity updateSubOrg(@RequestBody OrgDomain domain) {
+		trim(domain);
+
+		User accessUser = getAccessUser();
+
+		OrgEntity subOrg = orgRepo.findByRootIdAndCode(accessUser.getRootOrgId(), domain.getCode());
+		if (null != subOrg) {
+			throw new StatusException("B-140001", "机构代码已存在");
+		}
+
+		OrgInfo info = new OrgInfo();
+		info.setCode(domain.getCode());
+		info.setName(domain.getName());
+		info.setContacts(domain.getContacts());
+		info.setTelephone(domain.getTelephone());
+		info.setParentId(accessUser.getRootOrgId());
+		info.setRootId(accessUser.getRootOrgId());
+		info.setRemark(domain.getRemark());
 
-		org.setParentId(accessUser.getRootOrgId());
-		org.setRootId(accessUser.getRootOrgId());
-		OrgEntity saved = orgService.save(org);
+		OrgEntity saved = orgService.saveSubOrg(info);
 		return saved;
 	}
 
@@ -299,6 +488,15 @@ public class OrgController extends ControllerSupport {
 		orgRepo.delete(id);
 	}
 
+	/**
+	 * 待重构
+	 *
+	 * @author WANGWEI
+	 * @param request
+	 * @param file
+	 * @return
+	 * @throws Exception
+	 */
 	@ApiOperation(value = "按父ID导入子机构", notes = "导入子机构")
 	@PostMapping("/import")
 	public List<ExcelError> importLearnCenter(HttpServletRequest request,
@@ -310,6 +508,12 @@ public class OrgController extends ControllerSupport {
 		return excelErrors;
 	}
 
+	/**
+	 * 待重构
+	 *
+	 * @author WANGWEI
+	 * @param response
+	 */
 	@ApiOperation(value = "下载导入模板", notes = "下载导入模板")
 	@GetMapping("/download")
 	public void importFileTemplate(HttpServletResponse response) {
@@ -317,31 +521,54 @@ public class OrgController extends ControllerSupport {
 		ExportService.exportEXCEL("学习中心导入模板", OrgDto.class, list, response);
 	}
 
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param ids
+	 */
 	@ApiOperation(value = "启用机构", notes = "启用")
 	@PutMapping("/enable/{ids}")
-	public void enableSchool(@PathVariable String ids) {
+	public void enableOrgs(@PathVariable String ids) {
 		List<Long> orgIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
 				.collect(Collectors.toList());
 		for (Long orgId : orgIds) {
-			orgService.enableSchool(orgId, true);
+			OrgEntity org = orgRepo.findOne(orgId);
+			org.setEnable(true);
+			orgRepo.save(org);
 		}
 	}
 
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param ids
+	 */
 	@ApiOperation(value = "禁用机构", notes = "禁用")
 	@PutMapping("/disable/{ids}")
-	public void disableSchool(@PathVariable String ids) {
+	public void disableOrgs(@PathVariable String ids) {
 		List<Long> orgIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
 				.collect(Collectors.toList());
 		for (Long orgId : orgIds) {
-			orgService.enableSchool(orgId, false);
+			OrgEntity org = orgRepo.findOne(orgId);
+			org.setEnable(false);
+			orgRepo.save(org);
 		}
 	}
 
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param domain
+	 * @throws IOException
+	 */
 	@ApiOperation(value = "获取logo")
 	@GetMapping("/logo")
 	public void getLogo(@RequestParam("domain") String domain, HttpServletResponse response)
 			throws IOException {
-		OrgEntity org = orgRepo.findRootOrgByCode(domain);
+		OrgEntity org = orgRepo.findByParentIdIsNullAndDomainName(domain);
 		DynamicEnumManager manager = OrgProperty.getDynamicEnumManager();
 		DynamicEnum de = manager.getByName("LOGO_PATH");
 
@@ -352,13 +579,6 @@ public class OrgController extends ControllerSupport {
 		}
 	}
 
-	@ApiOperation(value = "查询顶级机构")
-	@GetMapping("/getRootOrgByCode")
-	public OrgEntity getRootOrgByCode(@RequestParam("code") String code) throws IOException {
-		OrgEntity org = orgRepo.findRootOrgByCode(code);
-		return org;
-	}
-
 	/**
 	 * 方法注释
 	 *
@@ -404,26 +624,4 @@ public class OrgController extends ControllerSupport {
 		orgPropertyRepo.save(entity);
 	}
 
-	/**
-	 * 修改请通知作者
-	 *
-	 * @author WANGWEI
-	 * @param parentId
-	 * @param orgName
-	 * @return
-	 */
-	@ApiOperation(value = "按机构名称模糊查询子机构列表")
-	@PostMapping("getSubOrgListByNameLike/{parentId}")
-	public List<OrgEntity> getSubOrgListByNameLike(@PathVariable Long parentId,
-			@RequestParam String orgName) {
-		List<OrgEntity> list = null;
-		if (StringUtils.isBlank(orgName)) {
-			list = Lists.newArrayList();
-			return list;
-		}
-		orgName = "%" + orgName + "%";
-		list = orgRepo.findByParentIdAndNameLikeAndEnable(parentId, orgName, true);
-		return list;
-	}
-
 }

+ 128 - 0
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/OrgDomain.java

@@ -0,0 +1,128 @@
+package cn.com.qmth.examcloud.core.basic.api.controller.bean;
+
+import java.util.Map;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年8月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OrgDomain implements JsonSerializable {
+
+	private static final long serialVersionUID = -3035023820638726879L;
+
+	private Long id;
+
+	private Long rootId;
+
+	private Long parentId;
+
+	private String name;
+
+	private String code;
+
+	private Boolean enable;
+
+	private String telephone;
+
+	private String contacts;
+
+	private String remark;
+
+	private String domainName;
+
+	private Map<String, String> properties;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getRootId() {
+		return rootId;
+	}
+
+	public void setRootId(Long rootId) {
+		this.rootId = rootId;
+	}
+
+	public Long getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(Long parentId) {
+		this.parentId = parentId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Boolean getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+	public String getTelephone() {
+		return telephone;
+	}
+
+	public void setTelephone(String telephone) {
+		this.telephone = telephone;
+	}
+
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getDomainName() {
+		return domainName;
+	}
+
+	public void setDomainName(String domainName) {
+		this.domainName = domainName;
+	}
+
+	public Map<String, String> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Map<String, String> properties) {
+		this.properties = properties;
+	}
+
+}

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

@@ -1,8 +1,5 @@
 package cn.com.qmth.examcloud.core.basic.api.provider;
 
-import java.util.List;
-
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -11,23 +8,27 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.google.common.collect.Lists;
-
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
-import cn.com.qmth.examcloud.core.basic.api.request.GetOrgListByNameLikeReq;
 import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
 import cn.com.qmth.examcloud.core.basic.api.request.SaveOrgReq;
-import cn.com.qmth.examcloud.core.basic.api.response.GetOrgListByNameLikeResp;
 import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
 import cn.com.qmth.examcloud.core.basic.api.response.SaveOrgResp;
 import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
 import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
-import cn.com.qmth.examcloud.core.basic.service.impl.OrgService;
+import cn.com.qmth.examcloud.core.basic.service.bean.OrgInfo;
+import cn.com.qmth.examcloud.core.basic.service.impl.OrgServiceImpl;
 import io.swagger.annotations.ApiOperation;
 
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年8月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
 @Transactional
 @RestController
 @RequestMapping("${$rmp.cloud.basic}" + "org")
@@ -36,7 +37,7 @@ public class OrgCloudServiceProvider extends ControllerSupport implements OrgClo
 	private static final long serialVersionUID = -7858439296389761341L;
 
 	@Autowired
-	private OrgService orgService;
+	private OrgServiceImpl orgService;
 
 	@Autowired
 	private OrgRepo orgRepo;
@@ -44,55 +45,23 @@ public class OrgCloudServiceProvider extends ControllerSupport implements OrgClo
 	@ApiOperation(value = "保存机构")
 	@PostMapping("saveOrg")
 	@Override
-	public SaveOrgResp saveOrg(@RequestBody SaveOrgReq orgReq) {
-		OrgEntity org = orgRepo.findByRootIdAndCode(orgReq.getRootOrgId(), orgReq.getOrgCode());
-		if (org == null) {
-			org = new OrgEntity();
-		}
-		org = new OrgEntity();
-		org.setName(orgReq.getOrgName());
-		org.setCode(orgReq.getOrgCode());
-		org.setParentId(orgReq.getRootOrgId());
-		org.setRootId(orgReq.getRootOrgId());
-		org.setEnable(true);
-		org = orgService.save(org);
+	public SaveOrgResp saveOrg(@RequestBody SaveOrgReq req) {
+		OrgInfo info = new OrgInfo();
+		info.setCode(req.getCode());
+		info.setName(req.getName());
+		info.setContacts(req.getContacts());
+		info.setTelephone(req.getTelephone());
+		info.setDomainName(req.getDomainName());
+		info.setRemark(req.getRemark());
+
+		OrgEntity saved = orgService.saveRootOrg(info);
 
 		SaveOrgResp orgResp = new SaveOrgResp();
-		orgResp.setId(org.getId());
-		orgResp.setName(org.getName());
+		orgResp.setId(saved.getId());
+		orgResp.setName(saved.getName());
 		return orgResp;
 	}
 
-	@ApiOperation(value = "按机构名称模糊查询机构列表")
-	@PostMapping("getOrgListByNameLike")
-	@Override
-	public GetOrgListByNameLikeResp getOrgListByNameLike(@RequestBody GetOrgListByNameLikeReq req) {
-		String orgName = req.getOrgName();
-		String rootOrgId = req.getRootOrgId();
-
-		List<OrgEntity> list = Lists.newArrayList();
-		if (StringUtils.isNotBlank(orgName)) {
-			list = orgRepo.findByRootIdAndNameLike(Long.parseLong(rootOrgId), orgName);
-		}
-
-		GetOrgListByNameLikeResp resp = new GetOrgListByNameLikeResp();
-		List<OrgBean> orgList = Lists.newArrayList();
-		resp.setOrgList(orgList);
-
-		if (CollectionUtils.isNotEmpty(list)) {
-			for (OrgEntity curOrg : list) {
-				OrgBean orgBean = new OrgBean();
-				orgBean.setId(curOrg.getId());
-				orgBean.setName(curOrg.getName());
-				orgBean.setParentId(curOrg.getParentId());
-				orgBean.setRootId(curOrg.getRootId());
-				orgList.add(orgBean);
-			}
-		}
-
-		return resp;
-	}
-
 	@ApiOperation(value = "按机构名称模糊查询机构列表")
 	@PostMapping("getOrg")
 	@Override

+ 6 - 5
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/OrgRepo.java

@@ -4,7 +4,6 @@ import java.util.List;
 
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
 
 import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
@@ -24,16 +23,18 @@ public interface OrgRepo
 
 	OrgEntity findByParentIdAndCode(Long parentId, String code);
 
+	OrgEntity findByParentIdIsNullAndDomainName(String domainName);
+
 	OrgEntity findByRootIdAndCode(Long rootId, String code);
 
 	List<OrgEntity> findByRootIdAndNameLike(Long rootId, String name);
 
 	List<OrgEntity> findByParentIdAndEnable(Long parentId, Boolean enable);
 
-	@Query(value = "select t from OrgEntity t where t.parentId is null and t.code=?1")
-	OrgEntity findRootOrgByCode(String code);
+	OrgEntity findByParentIdIsNullAndCode(String code);
+
+	OrgEntity findByParentIdIsNullAndId(Long id);
 
-	@Query(value = "select t from OrgEntity t where t.parentId is null and t.id =?1")
-	OrgEntity findRootOrgById(Long rootOrgId);
+	int countByNameLike(String name);
 
 }

+ 18 - 3
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/OrgEntity.java

@@ -10,7 +10,11 @@ import javax.persistence.Table;
 import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 
 /**
- * Created by songyue on 17/1/13.
+ * 顶级机构:parentId is null; id=rootId<br>
+ *
+ * @author WANGWEI
+ * @date 2018年8月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
 @Entity
 @Table(name = "EC_B_ORG", indexes = {
@@ -30,10 +34,10 @@ public class OrgEntity extends JpaEntity {
 	private Long parentId;
 
 	@Column(nullable = false)
-	private String name;
+	private String code;
 
 	@Column(nullable = false)
-	private String code;
+	private String name;
 
 	@Column(nullable = false)
 	private Boolean enable;
@@ -47,6 +51,9 @@ public class OrgEntity extends JpaEntity {
 	@Column(nullable = true)
 	private String remark;
 
+	@Column(nullable = true)
+	private String domainName;
+
 	public Long getId() {
 		return id;
 	}
@@ -119,4 +126,12 @@ public class OrgEntity extends JpaEntity {
 		this.remark = remark;
 	}
 
+	public String getDomainName() {
+		return domainName;
+	}
+
+	public void setDomainName(String domainName) {
+		this.domainName = domainName;
+	}
+
 }

+ 33 - 0
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/OrgService.java

@@ -0,0 +1,33 @@
+package cn.com.qmth.examcloud.core.basic.service;
+
+import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
+import cn.com.qmth.examcloud.core.basic.service.bean.OrgInfo;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年8月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface OrgService {
+
+	/**
+	 * 保存顶级机构
+	 *
+	 * @author WANGWEI
+	 * @param orgInfo
+	 * @return
+	 */
+	OrgEntity saveRootOrg(OrgInfo orgInfo);
+
+	/**
+	 * 保存子机构
+	 *
+	 * @author WANGWEI
+	 * @param orgInfo
+	 * @return
+	 */
+	OrgEntity saveSubOrg(OrgInfo orgInfo);
+
+}

+ 128 - 0
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/bean/OrgInfo.java

@@ -0,0 +1,128 @@
+package cn.com.qmth.examcloud.core.basic.service.bean;
+
+import java.util.Map;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年8月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OrgInfo implements JsonSerializable {
+
+	private static final long serialVersionUID = -3035023820638726879L;
+
+	private Long id;
+
+	private Long rootId;
+
+	private Long parentId;
+
+	private String name;
+
+	private String code;
+
+	private Boolean enable;
+
+	private String telephone;
+
+	private String contacts;
+
+	private String remark;
+
+	private String domainName;
+
+	private Map<String, String> properties;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getRootId() {
+		return rootId;
+	}
+
+	public void setRootId(Long rootId) {
+		this.rootId = rootId;
+	}
+
+	public Long getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(Long parentId) {
+		this.parentId = parentId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Boolean getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+	public String getTelephone() {
+		return telephone;
+	}
+
+	public void setTelephone(String telephone) {
+		this.telephone = telephone;
+	}
+
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getDomainName() {
+		return domainName;
+	}
+
+	public void setDomainName(String domainName) {
+		this.domainName = domainName;
+	}
+
+	public Map<String, String> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Map<String, String> properties) {
+		this.properties = properties;
+	}
+
+}

+ 1 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

@@ -103,7 +103,7 @@ public class AuthServiceImpl implements AuthService {
 			}
 
 			try {
-				rootOrg = orgRepo.findRootOrgByCode(loginInfo.getDomain());
+				rootOrg = orgRepo.findByParentIdIsNullAndDomainName(loginInfo.getDomain());
 				rootOrgId = rootOrg.getId();
 			} catch (Exception e) {
 				throw new StatusException("B-001002", "机构不存在", e);

+ 115 - 50
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgService.java → examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgServiceImpl.java

@@ -30,10 +30,12 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
 import cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity;
 import cn.com.qmth.examcloud.core.basic.dao.entity.UserEntity;
 import cn.com.qmth.examcloud.core.basic.dao.entity.UserRoleRelationEntity;
+import cn.com.qmth.examcloud.core.basic.service.OrgService;
 import cn.com.qmth.examcloud.core.basic.service.bean.OrgDto;
+import cn.com.qmth.examcloud.core.basic.service.bean.OrgInfo;
 
 @Service
-public class OrgService {
+public class OrgServiceImpl implements OrgService {
 
 	@Autowired
 	RoleRepo roleRepo;
@@ -192,72 +194,135 @@ public class OrgService {
 		return orgRepo.findAll(examExample);
 	}
 
-	/**
-	 * 强校验
+	/*
+	 * 保存顶级机构
 	 *
 	 * @author WANGWEI
-	 * @param org
-	 * @return
+	 * 
+	 * @see
+	 * cn.com.qmth.examcloud.core.basic.service.OrgService#saveRootOrg(cn.com.
+	 * qmth.examcloud.core.basic.service.bean.OrgInfo)
 	 */
-	public OrgEntity save(OrgEntity org) {
+	@Override
+	public OrgEntity saveRootOrg(OrgInfo orgInfo) {
+
+		String code = orgInfo.getCode();
+		String name = orgInfo.getName();
+		Boolean enable = orgInfo.getEnable();
+		String contacts = orgInfo.getContacts();
+		String telephone = orgInfo.getTelephone();
+		String domainName = orgInfo.getDomainName();
+		String remark = orgInfo.getRemark();
 
-		String code = org.getCode();
 		if (StringUtils.isBlank(code)) {
-			throw new StatusException("B-150000", "code is blank");
+			throw new StatusException("B-150001", "code is null");
+		}
+		if (StringUtils.isBlank(name)) {
+			throw new StatusException("B-150002", "name is null");
 		}
 
-		// 顶级机构
-		if (null == org.getParentId()) {
+		if (null == enable) {
+			enable = true;
+		}
 
-			// 校验顶级机构编码已存在
-			OrgEntity rootOrg = orgRepo.findRootOrgByCode(code);
-			if (null != rootOrg) {
-				if (!(null != org.getId() && org.getId().equals(rootOrg.getId()))) {
-					throw new StatusException("B-150001", "顶级机构编码已存在");
-				}
+		OrgEntity orgEntity = orgRepo.findByParentIdIsNullAndCode(code);
+		if (null == orgEntity) {
+			OrgEntity tmp = new OrgEntity();
+			tmp.setRootId(-1L);
+			tmp.setCode(code);
+			tmp.setEnable(enable);
+			tmp.setName(name);
+			orgEntity = orgRepo.save(tmp);
+		} else {
+			if (!orgEntity.getId().equals(orgEntity.getRootId())) {
+				throw new StatusException("B-150003", "数据错误");
 			}
+		}
 
-			// 新增
-			if (null == org.getId()) {
-				org.setRootId(-1L);
-				OrgEntity saved = orgRepo.save(org);
-				org.setId(saved.getId());
-				org.setRootId(saved.getId());
-			}
+		orgEntity.setRootId(orgEntity.getId());
+		orgEntity.setName(name);
+		orgEntity.setEnable(enable);
+		orgEntity.setContacts(contacts);
+		orgEntity.setTelephone(telephone);
+		orgEntity.setDomainName(domainName);
+		orgEntity.setRemark(remark);
+
+		OrgEntity saved = orgRepo.save(orgEntity);
+
+		return saved;
+	}
+
+	/*
+	 * 保存子机构
+	 *
+	 * @author WANGWEI
+	 * 
+	 * @see
+	 * cn.com.qmth.examcloud.core.basic.service.OrgService#saveSubOrg(cn.com.
+	 * qmth.examcloud.core.basic.service.bean.OrgInfo)
+	 */
+	@Override
+	public OrgEntity saveSubOrg(OrgInfo orgInfo) {
+
+		String code = orgInfo.getCode();
+		String name = orgInfo.getName();
+		Boolean enable = orgInfo.getEnable();
+		String contacts = orgInfo.getContacts();
+		String telephone = orgInfo.getTelephone();
+		Long rootId = orgInfo.getRootId();
+		Long parentId = orgInfo.getParentId();
+		String remark = orgInfo.getRemark();
+
+		if (null == enable) {
+			enable = true;
 		}
-		// 子机构
-		else {
-			Long rootId = org.getRootId();
-			if (null == rootId) {
-				throw new StatusException("B-150002", "rootId is null");
-			}
-			OrgEntity rootOrg = orgRepo.findOne(rootId);
-			if (null == rootOrg || null != rootOrg.getParentId()) {
-				throw new StatusException("B-150003", "rootId is wrong");
-			}
-			Long parentId = org.getParentId();
 
-			OrgEntity parentOrg = orgRepo.findOne(parentId);
-			if (!parentOrg.getRootId().equals(rootId)) {
-				throw new StatusException("B-150004", "parentId is wrong");
-			}
+		if (null == rootId) {
+			throw new StatusException("B-150000", "rootId is null");
+		}
+		if (StringUtils.isBlank(code)) {
+			throw new StatusException("B-150001", "code is null");
+		}
+		if (StringUtils.isBlank(name)) {
+			throw new StatusException("B-150002", "name is null");
+		}
+		if (null == parentId) {
+			throw new StatusException("B-150003", "parentId is null");
+		}
 
-			OrgEntity subOrg = orgRepo.findByRootIdAndCode(rootId, code);
-			if (null != subOrg) {
-				if (!(null != org.getId() && org.getId().equals(subOrg.getId()))) {
-					throw new StatusException("B-150005", "机构编码已存在");
-				}
-			}
+		OrgEntity rootOrgEntity = orgRepo.findOne(rootId);
+		if (null == rootOrgEntity) {
+			throw new StatusException("B-150004", "rootId is wrong");
+		}
+		if (null != rootOrgEntity.getParentId()) {
+			throw new StatusException("B-150005", "rootId is wrong");
+		}
 
+		OrgEntity parentOrgEntity = orgRepo.findOne(parentId);
+		if (null == parentOrgEntity) {
+			throw new StatusException("B-150006", "parentId is wrong");
 		}
 
-		OrgEntity saved = orgRepo.save(org);
-		return saved;
-	}
+		if (!rootOrgEntity.getRootId().equals(parentOrgEntity.getRootId())) {
+			throw new StatusException("B-150007", "parentId, rootId is wrong");
+		}
 
-	public OrgEntity findOne(Long id) {
-		OrgEntity org = orgRepo.findOne(id);
-		return org;
+		OrgEntity orgEntity = orgRepo.findByRootIdAndCode(rootId, code);
+		if (null == orgEntity) {
+			orgEntity = new OrgEntity();
+			orgEntity.setRootId(rootId);
+			orgEntity.setParentId(parentId);
+		}
+
+		orgEntity.setName(name);
+		orgEntity.setEnable(enable);
+		orgEntity.setContacts(contacts);
+		orgEntity.setTelephone(telephone);
+		orgEntity.setRemark(remark);
+
+		OrgEntity saved = orgRepo.save(orgEntity);
+
+		return saved;
 	}
 
 }

+ 1 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/StudentServiceImpl.java

@@ -45,7 +45,7 @@ public class StudentServiceImpl implements StudentService {
 	OrgRepo orgRepo;
 
 	@Autowired
-	OrgService orgService;
+	OrgServiceImpl orgService;
 
 	/**
 	 * 获取所有学生(分页)