|
@@ -3,9 +3,9 @@ package com.ym.mec.web.controller;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
-import com.ym.mec.biz.dal.dto.ActivityCourseDetailDto;
|
|
|
|
-import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.entity.Employee;
|
|
import com.ym.mec.biz.dal.entity.Employee;
|
|
|
|
+import com.ym.mec.biz.dal.entity.Organization;
|
|
import com.ym.mec.biz.dal.entity.Student;
|
|
import com.ym.mec.biz.dal.entity.Student;
|
|
import com.ym.mec.biz.dal.page.*;
|
|
import com.ym.mec.biz.dal.page.*;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
@@ -19,15 +19,14 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
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.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Api(tags = "学生管理")
|
|
@Api(tags = "学生管理")
|
|
@RestController
|
|
@RestController
|
|
@@ -48,6 +47,8 @@ public class StudentManageController extends BaseController {
|
|
private EmployeeDao employeeDao;
|
|
private EmployeeDao employeeDao;
|
|
@Autowired
|
|
@Autowired
|
|
private StudentService studentService;
|
|
private StudentService studentService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private OrganizationService organizationService;
|
|
|
|
|
|
private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
|
|
private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
@@ -414,4 +415,40 @@ public class StudentManageController extends BaseController {
|
|
}
|
|
}
|
|
return succeed(false);
|
|
return succeed(false);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "云教练学员数据预览")
|
|
|
|
+ @GetMapping("/getCloudStudyStudentOverView")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('studentManage/getCloudStudyStudentOverView')")
|
|
|
|
+ public HttpResponseResult<CloudStudyStudentDataDto> getCloudStudyStudentOverView(String organIds) throws Exception {
|
|
|
|
+ List<Integer> organIdsList = new ArrayList<>();
|
|
|
|
+ if(StringUtils.isNotBlank(organIds)){
|
|
|
|
+ organIdsList = Arrays.stream(organIds.split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
|
+ }else{
|
|
|
|
+ List<Organization> organizations = organizationService.queryEmployeeOrgan();
|
|
|
|
+ if(CollectionUtils.isEmpty(organizations)){
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+ organIdsList = organizations.stream().map(Organization::getId).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return succeed(studentService.getCloudStudyStudentOverView(organIdsList));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "分部云教练学员数据预览")
|
|
|
|
+ @GetMapping("/organStudentOverView")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('studentManage/organStudentOverView')")
|
|
|
|
+ public HttpResponseResult<List<EduOrganStudentDataDto>> organStudentOverView() throws Exception {
|
|
|
|
+ List<Organization> organizations = organizationService.queryEmployeeOrgan();
|
|
|
|
+ if(CollectionUtils.isEmpty(organizations)){
|
|
|
|
+ return succeed(Collections.emptyList());
|
|
|
|
+ }
|
|
|
|
+ List<Integer> organIds = organizations.stream().map(Organization::getId).collect(Collectors.toList());
|
|
|
|
+ return succeed(studentService.organStudentOverView(organIds));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "云教练学员数据")
|
|
|
|
+ @GetMapping("/organStudentData")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('studentManage/organStudentData')")
|
|
|
|
+ public HttpResponseResult<StatDto> organStudentData(StudentQueryInfo queryInfo){
|
|
|
|
+ return succeed(studentService.organStudentData(queryInfo));
|
|
|
|
+ }
|
|
}
|
|
}
|