|
@@ -2,7 +2,6 @@ package cn.com.qmth.examcloud.core.basic.api.controller;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
-import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -17,10 +16,7 @@ import org.apache.commons.fileupload.FileItem;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -42,7 +38,6 @@ import cn.com.qmth.examcloud.commons.base.util.ErrorMsg;
|
|
|
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.security.bean.User;
|
|
|
-import cn.com.qmth.examcloud.commons.web.security.entity.AccessUser;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
|
|
@@ -60,8 +55,6 @@ import io.swagger.annotations.ApiOperation;
|
|
|
@RequestMapping("${$rmp.ctr.basic}/org")
|
|
|
public class OrgController extends ControllerSupport{
|
|
|
|
|
|
- private static final Logger LOG = LoggerFactory.getLogger(OrgController.class);
|
|
|
-
|
|
|
@Autowired
|
|
|
OrgRepo orgRepo;
|
|
|
|
|
@@ -110,30 +103,19 @@ public class OrgController extends ControllerSupport{
|
|
|
return new ResponseEntity(orgService.findOne(id), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询下属机构不带分页", notes = "不分页")
|
|
|
- @GetMapping("/sub/{parentId}")
|
|
|
- public ResponseEntity getOrgByParentId(@PathVariable Long parentId,HttpServletRequest request) {
|
|
|
- cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
|
- if(accessUser != null){
|
|
|
- if(accessUser.getRootOrgId().longValue() != accessUser.getOrgId().longValue()){
|
|
|
- return new ResponseEntity(orgRepo.findById(accessUser.getOrgId()), HttpStatus.OK);
|
|
|
- // return new ResponseEntity(orgRepo.findById(parentId), HttpStatus.OK);
|
|
|
- }
|
|
|
- }
|
|
|
- return new ResponseEntity(orgRepo.findByParentId(parentId), HttpStatus.OK);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "查询下属机构不带分页", notes = "不分页")
|
|
|
+ @GetMapping("/sub/{parentId}")
|
|
|
+ public List<Org> getOrgByParentId(@PathVariable Long parentId, HttpServletRequest request) {
|
|
|
+ List<Org> orgList = orgRepo.findByParentId(parentId);
|
|
|
+ return orgList;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "查询下属机构不带分页", notes = "不分页")
|
|
|
- @GetMapping("/sub/both/{parentId}")
|
|
|
- public ResponseEntity getBothOrg(@PathVariable Long parentId,HttpServletRequest request) {
|
|
|
- cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
|
- if(accessUser != null){
|
|
|
- if(accessUser.getRootOrgId().longValue() != accessUser.getOrgId().longValue()){
|
|
|
- return new ResponseEntity(orgRepo.findById(parentId), HttpStatus.OK);
|
|
|
- }
|
|
|
- }
|
|
|
- return new ResponseEntity(orgRepo.findBothByParentId(parentId), HttpStatus.OK);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "查询下属机构不带分页", notes = "不分页")
|
|
|
+ @GetMapping("/sub/both/{parentId}")
|
|
|
+ public List<Org> getBothOrg(@PathVariable Long parentId, HttpServletRequest request) {
|
|
|
+ List<Org> orgList = orgRepo.findBothByParentId(parentId);
|
|
|
+ return orgList;
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "查询下属机构分页带查询", notes = "分页")
|
|
|
@GetMapping("/sub/{parentId}/{curPage}/{pageSize}")
|