|  | @@ -1,5 +1,6 @@
 | 
	
		
			
				|  |  |  package com.ym.mec.web.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.exception.BizException;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
	
		
			
				|  | @@ -164,6 +165,7 @@ public class EmployeeController extends BaseController {
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |              List<SysEmployeePositionDto> sysEmployeePositionDtoList = sysEmployeePositionService.queryByUserId(sysUser.getId());
 | 
	
		
			
				|  |  |              if(sysEmployeePositionDtoList != null && sysEmployeePositionDtoList.size() > 0){
 | 
	
		
			
				|  |  | +                sysUser.setPositions(StringUtils.join(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getRoleId).collect(Collectors.toSet()),","));
 | 
	
		
			
				|  |  |              	sysUser.setPositionName(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getPositionName).collect(Collectors.joining(",")));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return succeed(sysUser);
 | 
	
	
		
			
				|  | @@ -171,138 +173,6 @@ public class EmployeeController extends BaseController {
 | 
	
		
			
				|  |  |          return failed("获取用户信息失败");
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    /*@ApiOperation(value = "获取教务人员")
 | 
	
		
			
				|  |  | -    @GetMapping("/findEducationUsers")
 | 
	
		
			
				|  |  | -    public HttpResponseResult findEducationUsers(Integer userId, Integer organId){
 | 
	
		
			
				|  |  | -        SysUser sysUser;
 | 
	
		
			
				|  |  | -        if(userId == null){
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -            if (sysUser == null) {
 | 
	
		
			
				|  |  | -                return failed("用户信息获取失败");
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserById(userId);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        String organIds = new String();
 | 
	
		
			
				|  |  | -        if(Objects.isNull(organId)){
 | 
	
		
			
				|  |  | -            Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -            if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -                organIds = employee.getOrganIdList();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | -            organIds = organId.toString();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(employeeService.findByRole("4,5",organIds));
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "获取对应角色的员工")
 | 
	
		
			
				|  |  | -    @GetMapping("/findUserByRole")
 | 
	
		
			
				|  |  | -    public HttpResponseResult findEducationUsers(Integer userId, Integer organId, EmployeeRoleEnum employeeRole){
 | 
	
		
			
				|  |  | -        SysUser sysUser;
 | 
	
		
			
				|  |  | -        if(userId == null){
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -            if (sysUser == null) {
 | 
	
		
			
				|  |  | -                return failed("用户信息获取失败");
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserById(userId);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        String organIds = new String();
 | 
	
		
			
				|  |  | -        if(Objects.isNull(organId)){
 | 
	
		
			
				|  |  | -            Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -            if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -                organIds = employee.getOrganIdList();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | -            organIds = organId.toString();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        HashMap<String, Object> map = new HashMap<>();
 | 
	
		
			
				|  |  | -        if(employeeRole == null){
 | 
	
		
			
				|  |  | -            map.put("TEAM_TEACHER",employeeService.findByRole("5",organIds));
 | 
	
		
			
				|  |  | -            map.put("TRANSACTION",employeeService.findByRole("58",organIds));
 | 
	
		
			
				|  |  | -            map.put("EDUCATION",employeeService.findByRole("4",organIds));
 | 
	
		
			
				|  |  | -        }else if(employeeRole == EmployeeRoleEnum.TEAM_TEACHER){
 | 
	
		
			
				|  |  | -            map.put("TEAM_TEACHER",employeeService.findByRole("5",organIds));
 | 
	
		
			
				|  |  | -        }else if(employeeRole == EmployeeRoleEnum.TRANSACTION){
 | 
	
		
			
				|  |  | -            map.put("TRANSACTION",employeeService.findByRole("58",organIds));
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            map.put("EDUCATION",employeeService.findByRole("4",organIds));
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(map);
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "获取对应角色的员工")
 | 
	
		
			
				|  |  | -    @GetMapping("/queryEmployeeByRole")
 | 
	
		
			
				|  |  | -    public HttpResponseResult queryEmployeeByRole(Integer organId, String roleId){
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        if (sysUser == null) {
 | 
	
		
			
				|  |  | -            return failed(HttpStatus.FORBIDDEN,"请登录");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        String organIds = new String();
 | 
	
		
			
				|  |  | -        if(Objects.isNull(organId)){
 | 
	
		
			
				|  |  | -            Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -            if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -                organIds = employee.getOrganIdList();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | -            organIds = organId.toString();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(employeeService.findByRole(roleId, organIds));
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "获取教务老师")
 | 
	
		
			
				|  |  | -    @GetMapping("/findEducationTeacher")
 | 
	
		
			
				|  |  | -    public HttpResponseResult findEducationTeacher(Integer userId){
 | 
	
		
			
				|  |  | -        SysUser sysUser;
 | 
	
		
			
				|  |  | -        if(userId == null){
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -            if (sysUser == null) {
 | 
	
		
			
				|  |  | -                return failed("用户信息获取失败");
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            sysUser = sysUserFeignService.queryUserById(userId);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        String organIds = new String();
 | 
	
		
			
				|  |  | -        Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -        if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -            organIds = employee.getOrganIdList();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(employeeService.findByRole("4",organIds));
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "获取维修技师")
 | 
	
		
			
				|  |  | -    @GetMapping("/findTechnician")
 | 
	
		
			
				|  |  | -    @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
 | 
	
		
			
				|  |  | -    public HttpResponseResult findTechnician(String organIds){
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        if (sysUser == null) {
 | 
	
		
			
				|  |  | -            return failed("用户信息获取失败");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(StringUtils.isEmpty(organIds)){
 | 
	
		
			
				|  |  | -            Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -            if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -                organIds=employee.getOrganIdList();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(employeeService.findByRole("37",organIds));
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "获取所有维修技师(包含离职和冻结的)")
 | 
	
		
			
				|  |  | -    @GetMapping("/findAllTechnician")
 | 
	
		
			
				|  |  | -    @PreAuthorize("@pcs.hasPermissions('employee/findAllTechnician')")
 | 
	
		
			
				|  |  | -    public HttpResponseResult<List<SimpleUserDto>> findAllTechnician(){
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        String organIds = new String();
 | 
	
		
			
				|  |  | -        if (sysUser == null) {
 | 
	
		
			
				|  |  | -            return failed("用户信息获取失败");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        Employee employee = employeeService.get(sysUser.getId());
 | 
	
		
			
				|  |  | -        if (StringUtils.isEmpty(organIds)) {
 | 
	
		
			
				|  |  | -            organIds=employee.getOrganIdList();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return succeed(employeeService.findAllByRole("37",organIds));
 | 
	
		
			
				|  |  | -    }*/
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取所选用户离职所需交接信息")
 | 
	
		
			
				|  |  |      @GetMapping("/levelDetail")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('employee/levelDetail')")
 |