|
@@ -1,31 +1,34 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.dto.EmployeeLevelDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
+import com.ym.mec.biz.dal.dto.SysEmployeePositionDto;
|
|
|
import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.EmployeeRoleEnum;
|
|
|
import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
|
|
|
import com.ym.mec.biz.service.EmployeeService;
|
|
|
import com.ym.mec.biz.service.OrganizationService;
|
|
|
import com.ym.mec.biz.service.StudentManageService;
|
|
|
+import com.ym.mec.biz.service.SysEmployeePositionService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* @Author Joburgess
|
|
@@ -46,6 +49,8 @@ public class EmployeeController extends BaseController {
|
|
|
private OrganizationService organizationService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private SysEmployeePositionService sysEmployeePositionService;
|
|
|
|
|
|
@ApiOperation(value = "根据部门获取下面的员工")
|
|
|
@GetMapping("/queryEmployByOrganId")
|
|
@@ -145,6 +150,11 @@ public class EmployeeController extends BaseController {
|
|
|
sysUser.setBankCard(employee.getBankCard());
|
|
|
sysUser.setOpenBankAddress(employee.getOpenBankAddress());
|
|
|
sysUser.setPostDeptIds(employee.getPostDeptIds());
|
|
|
+
|
|
|
+ List<SysEmployeePositionDto> sysEmployeePositionDtoList = sysEmployeePositionService.queryByUserId(sysUser.getId());
|
|
|
+ if(sysEmployeePositionDtoList != null && sysEmployeePositionDtoList.size() > 0){
|
|
|
+ sysUser.setPositionName(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getPositionName).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
return succeed(sysUser);
|
|
|
}
|
|
|
return failed("获取用户信息失败");
|