|
|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.enums.EnrollTypeEnum;
|
|
|
@@ -20,11 +21,13 @@ import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.base.service.IBaseSemesterService;
|
|
|
+import com.xjrsoft.module.base.vo.BaseClassPageVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ItemCountVo;
|
|
|
import com.xjrsoft.module.student.dto.AddStudentReportRecordDto;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
|
|
|
@@ -32,10 +35,12 @@ import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportSignDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateStudentReportRecordDto;
|
|
|
import com.xjrsoft.module.student.entity.StudentReportPlan;
|
|
|
+import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
|
|
|
import com.xjrsoft.module.student.entity.StudentReportRecord;
|
|
|
import com.xjrsoft.module.student.service.IStudentReportPlanService;
|
|
|
import com.xjrsoft.module.student.service.IStudentReportRecordService;
|
|
|
import com.xjrsoft.module.student.vo.BaseMajorCategorPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordItemVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
|
|
|
@@ -198,7 +203,7 @@ public class StudentReportRecordController {
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
public RT<StudentReportRecordStatisticsVo> classStatistics(@Valid StudentReportRecordStatisticsDto dto){
|
|
|
|
|
|
- if(dto.getTeacherId() == null && dto.getClassId() == null){
|
|
|
+ if(dto.getTeacherId() == null && dto.getClassId() == null){
|
|
|
dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
}
|
|
|
if(dto.getBaseSemesterId() == null){
|
|
|
@@ -244,7 +249,7 @@ public class StudentReportRecordController {
|
|
|
@ApiOperation(value="领导统计")
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
public RT<StudentReportRecordStatisticsVo> statistics(@Valid StudentReportRecordStatisticsDto dto){
|
|
|
- if(dto.getGradeId() == null){
|
|
|
+ if(dto.getGradeId() == null && (dto.getCategory() == null || dto.getCategory() == 1)){
|
|
|
LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper
|
|
|
.orderByDesc(BaseGrade::getTitle)
|
|
|
@@ -257,6 +262,9 @@ public class StudentReportRecordController {
|
|
|
if(dto.getEnrollType() == null || dto.getEnrollType().isEmpty()){
|
|
|
dto.setEnrollType(EnrollTypeEnum.AUTUMN_ENROLLMENT.getCode());
|
|
|
}
|
|
|
+ if(dto.getCategory() != null && dto.getCategory() == 2){
|
|
|
+ dto.setBaseSemesterId(semesterService.getLastSemester());
|
|
|
+ }
|
|
|
List<StudentReportRecordStatisticsListVo> dataList = studentReportRecordService.getStatisticsDataList(dto);
|
|
|
StudentReportRecordStatisticsVo statisticsVo = new StudentReportRecordStatisticsVo();
|
|
|
statisticsVo.setAllCount(dataList.stream().count());
|
|
|
@@ -286,49 +294,58 @@ public class StudentReportRecordController {
|
|
|
&& StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())
|
|
|
&& x.getReportTime() != null
|
|
|
).count());
|
|
|
- Map<String, List<StudentReportRecordStatisticsListVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getGraduatedUniversity));
|
|
|
- List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
|
|
|
- for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
|
|
|
- graduatedUniversityList.add(
|
|
|
- new ItemCountVo(){{
|
|
|
- setItem(graduatedUniversity);
|
|
|
- setCount(graduatedUniversityMap.get(graduatedUniversity).size());
|
|
|
- }}
|
|
|
- );
|
|
|
+
|
|
|
+ if(dto.getCategory() != null && dto.getCategory() == 1){
|
|
|
+ Map<String, List<StudentReportRecordStatisticsListVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getGraduatedUniversity));
|
|
|
+ List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
|
|
|
+ for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
|
|
|
+ graduatedUniversityList.add(
|
|
|
+ new ItemCountVo(){{
|
|
|
+ setItem(graduatedUniversity);
|
|
|
+ setCount(graduatedUniversityMap.get(graduatedUniversity).size());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
|
|
|
}
|
|
|
- statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
|
|
|
|
|
|
Map<String, List<StudentReportRecordStatisticsListVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassName));
|
|
|
- List<ItemCountVo> classList = new ArrayList<>();
|
|
|
+ Map<String, List<StudentReportRecordStatisticsListVo>> classNotMap = dataList.stream().filter(x -> x.getReportTime() == null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassName));
|
|
|
+ List<StudentReportRecordItemVo> classList = new ArrayList<>();
|
|
|
for (String className : classMap.keySet()) {
|
|
|
classList.add(
|
|
|
- new ItemCountVo(){{
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
setItem(className);
|
|
|
setCount(classMap.get(className).size());
|
|
|
+ setCount2(classNotMap.get(className).size());
|
|
|
}}
|
|
|
);
|
|
|
}
|
|
|
statisticsVo.setClassList(classList);
|
|
|
|
|
|
Map<String, List<StudentReportRecordStatisticsListVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassType));
|
|
|
- List<ItemCountVo> classTypeList = new ArrayList<>();
|
|
|
+ Map<String, List<StudentReportRecordStatisticsListVo>> classTypeNotMap = dataList.stream().filter(x -> x.getReportTime() == null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassType));
|
|
|
+ List<StudentReportRecordItemVo> classTypeList = new ArrayList<>();
|
|
|
for (String classType : classTypeMap.keySet()) {
|
|
|
classTypeList.add(
|
|
|
- new ItemCountVo(){{
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
setItem(classType);
|
|
|
setCount(classTypeMap.get(classType).size());
|
|
|
+ setCount2(classTypeNotMap.get(classType).size());
|
|
|
}}
|
|
|
);
|
|
|
}
|
|
|
statisticsVo.setClassTypeList(classTypeList);
|
|
|
|
|
|
Map<String, List<StudentReportRecordStatisticsListVo>> majorMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getMajorName));
|
|
|
- List<ItemCountVo> majorList = new ArrayList<>();
|
|
|
+ Map<String, List<StudentReportRecordStatisticsListVo>> majorNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getMajorName));
|
|
|
+ List<StudentReportRecordItemVo> majorList = new ArrayList<>();
|
|
|
for (String majorName : majorMap.keySet()) {
|
|
|
majorList.add(
|
|
|
- new ItemCountVo(){{
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
setItem(majorName);
|
|
|
setCount(majorMap.get(majorName).size());
|
|
|
+ setCount2(majorNotMap.get(majorName).size());
|
|
|
}}
|
|
|
);
|
|
|
}
|
|
|
@@ -368,14 +385,33 @@ public class StudentReportRecordController {
|
|
|
if(dto.getClassId() == null){
|
|
|
dto.setClassId(classId);
|
|
|
}
|
|
|
- Long planId = planService.getEffectivePlanId(dto.getTeacherId(), dto.getClassId());
|
|
|
- dto.setStudentReportPlanId(planId);
|
|
|
+// Long planId = planService.getEffectivePlanId(dto.getTeacherId(), dto.getClassId());
|
|
|
+// dto.setStudentReportPlanId(planId);
|
|
|
}
|
|
|
Page<StudentReportRecordPlanPageVo> planPage = studentReportRecordService.getPlanPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(planPage, StudentReportRecordPlanPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/class-list")
|
|
|
+ @ApiOperation(value="班主任负责班级")
|
|
|
+ @SaCheckPermission("studentreportrecord:detail")
|
|
|
+ public RT<List<BaseClassPageVo>> classList(@Valid StudentReportRecordPageDto dto){
|
|
|
+
|
|
|
+ long teacherId = StpUtil.getLoginIdAsLong();
|
|
|
+ Long planId = planService.getEffectivePlanId(teacherId, null);
|
|
|
+ List<BaseClassPageVo> list = classService.selectJoinList(BaseClassPageVo.class,
|
|
|
+ new MPJLambdaWrapper<BaseClass>()
|
|
|
+ .select(BaseClass::getId)
|
|
|
+ .selectAs(BaseClass::getName, BaseClassPageVo::getName)
|
|
|
+ .innerJoin(StudentReportPlanClassRelation.class, StudentReportPlanClassRelation::getClassId, BaseClass::getId)
|
|
|
+ .innerJoin(StudentReportPlan.class, StudentReportPlan::getId, StudentReportPlanClassRelation::getStudentReportPlanId)
|
|
|
+ .eq(StudentReportPlan::getId, planId)
|
|
|
+ .eq(BaseClass::getTeacherId, teacherId)
|
|
|
+ );
|
|
|
+ return RT.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping(value = "/sign")
|
|
|
@ApiOperation(value="学生报到")
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
@@ -389,6 +425,8 @@ public class StudentReportRecordController {
|
|
|
return RT.ok(studentReportRecordService.sgin(dto));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@PostMapping(value = "/all-sign")
|
|
|
@ApiOperation(value="变更已报到")
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|