|  | @@ -1,18 +1,23 @@
 | 
											
												
													
														|  |  package com.ym.mec.web.controller.education;
 |  |  package com.ym.mec.web.controller.education;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -import com.ym.mec.biz.dal.entity.CooperationOrgan;
 |  | 
 | 
											
												
													
														|  | -import com.ym.mec.biz.service.CooperationOrganService;
 |  | 
 | 
											
												
													
														|  | -import com.ym.mec.biz.service.OrganizationService;
 |  | 
 | 
											
												
													
														|  | -import com.ym.mec.common.controller.BaseController;
 |  | 
 | 
											
												
													
														|  | -import com.ym.mec.common.entity.HttpResponseResult;
 |  | 
 | 
											
												
													
														|  |  import io.swagger.annotations.Api;
 |  |  import io.swagger.annotations.Api;
 | 
											
												
													
														|  |  import io.swagger.annotations.ApiOperation;
 |  |  import io.swagger.annotations.ApiOperation;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +import java.util.List;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.GetMapping;
 |  |  import org.springframework.web.bind.annotation.GetMapping;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.RequestMapping;
 |  |  import org.springframework.web.bind.annotation.RequestMapping;
 | 
											
												
													
														|  |  import org.springframework.web.bind.annotation.RestController;
 |  |  import org.springframework.web.bind.annotation.RestController;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -import java.util.List;
 |  | 
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.auth.api.entity.SysUser;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.dal.entity.CooperationOrgan;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.dal.entity.Organization;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.service.CooperationOrganService;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.biz.service.OrganizationService;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.common.controller.BaseController;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.common.entity.HttpResponseResult;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @RequestMapping("eduOrganization")
 |  |  @RequestMapping("eduOrganization")
 | 
											
												
													
														|  |  @Api(tags = "分部服务")
 |  |  @Api(tags = "分部服务")
 | 
											
										
											
												
													
														|  | @@ -23,16 +28,28 @@ public class EduOrganizationController extends BaseController {
 | 
											
												
													
														|  |      private OrganizationService organizationService;
 |  |      private OrganizationService organizationService;
 | 
											
												
													
														|  |      @Autowired
 |  |      @Autowired
 | 
											
												
													
														|  |      private CooperationOrganService cooperationOrganService;
 |  |      private CooperationOrganService cooperationOrganService;
 | 
											
												
													
														|  | 
 |  | +    
 | 
											
												
													
														|  | 
 |  | +	@Autowired
 | 
											
												
													
														|  | 
 |  | +	private SysUserFeignService sysUserFeignService;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "获取员工所在分部列表")
 |  |      @ApiOperation(value = "获取员工所在分部列表")
 | 
											
												
													
														|  |      @GetMapping("/queryAllOrgan")
 |  |      @GetMapping("/queryAllOrgan")
 | 
											
												
													
														|  | -    public Object queryAllOrgan(Integer tenantId) throws Exception {
 |  | 
 | 
											
												
													
														|  | -        return succeed(organizationService.queryAllOrganWithNoAuth(tenantId));
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public HttpResponseResult<List<Organization>> queryAllOrgan() throws Exception {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +		SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
											
												
													
														|  | 
 |  | +		if(sysUser == null || sysUser.getId() == null){
 | 
											
												
													
														|  | 
 |  | +	    	Integer tenantId = 1;
 | 
											
												
													
														|  | 
 |  | +	        return succeed(organizationService.queryAllOrganWithNoAuth(tenantId));
 | 
											
												
													
														|  | 
 |  | +		}else{
 | 
											
												
													
														|  | 
 |  | +			String organIds = organizationService.getEmployeeOrgan(sysUser.getId(), "", sysUser.getIsSuperAdmin());
 | 
											
												
													
														|  | 
 |  | +	        return succeed(organizationService.queryEmployeeOrgan(organIds));
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  | 
 |  | +    	
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @ApiOperation(value = "获取员工所在分部列表")
 |  |      @ApiOperation(value = "获取员工所在分部列表")
 | 
											
												
													
														|  |      @GetMapping("/queryEmployeeOrgan")
 |  |      @GetMapping("/queryEmployeeOrgan")
 | 
											
												
													
														|  | -    public Object queryEmployeeOrgan() throws Exception {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public HttpResponseResult<List<Organization>> queryEmployeeOrgan() throws Exception {
 | 
											
												
													
														|  |          return succeed(organizationService.queryEmployeeOrgan());
 |  |          return succeed(organizationService.queryEmployeeOrgan());
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 |