|
@@ -1,5 +1,7 @@
|
|
|
package com.ym.mec.web.controller.education;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dto.EduOrganStudentDataDto;
|
|
|
import com.ym.mec.biz.dal.dto.StatDto;
|
|
|
import com.ym.mec.biz.dal.entity.Organization;
|
|
@@ -8,8 +10,11 @@ import com.ym.mec.biz.service.OrganizationService;
|
|
|
import com.ym.mec.biz.service.StudentService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
+
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -33,6 +38,8 @@ public class EduStudentController extends BaseController {
|
|
|
private StudentService studentService;
|
|
|
@Autowired
|
|
|
private OrganizationService organizationService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation(value = "云教练学员数据")
|
|
|
@GetMapping("/organStudentData")
|
|
@@ -43,7 +50,12 @@ public class EduStudentController extends BaseController {
|
|
|
@ApiOperation(value = "分部云教练学员数据预览")
|
|
|
@GetMapping("/organStudentOverView")
|
|
|
public HttpResponseResult<List<EduOrganStudentDataDto>> organStudentOverView() throws Exception {
|
|
|
- List<Organization> organizations = organizationService.queryEmployeeOrgan();
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ throw new BizException("获取用户信息失败");
|
|
|
+ }
|
|
|
+ Integer userId = sysUser.getId();
|
|
|
+ List<Organization> organizations = organizationService.queryEmployeeOrgan(userId);
|
|
|
if(CollectionUtils.isEmpty(organizations)){
|
|
|
return succeed(Collections.emptyList());
|
|
|
}
|