|
|
@@ -1,61 +1,77 @@
|
|
|
package com.xjrsoft.module.student.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import cn.dev33.satoken.secure.BCrypt;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
|
-import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
+import com.xjrsoft.common.enums.EnrollTypeEnum;
|
|
|
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
+import com.xjrsoft.common.enums.RoleCodeEnum;
|
|
|
+import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
-import com.xjrsoft.common.utils.RedisUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
-import com.xjrsoft.config.CommonPropertiesConfig;
|
|
|
-import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
-import com.xjrsoft.module.base.entity.BaseUserStudent;
|
|
|
-import com.xjrsoft.module.base.entity.WhitelistManagement;
|
|
|
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTask;
|
|
|
+import com.xjrsoft.module.banding.service.IBandingTaskClassService;
|
|
|
+import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
|
|
|
+import com.xjrsoft.module.banding.service.IBandingTaskService;
|
|
|
+import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
|
|
|
+import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
|
|
|
+import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
+import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.base.service.IBaseSemesterService;
|
|
|
-import com.xjrsoft.module.base.service.IBaseUserStudentService;
|
|
|
-import com.xjrsoft.module.base.service.IWhitelistManagementService;
|
|
|
-import com.xjrsoft.module.organization.entity.User;
|
|
|
-import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
-import com.xjrsoft.module.organization.service.IUserRoleRelationService;
|
|
|
+import com.xjrsoft.module.databoard.vo.ItemCountVo;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
-import com.xjrsoft.module.student.dto.*;
|
|
|
-import com.xjrsoft.module.student.entity.BaseNewStudent;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
|
|
|
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
|
|
|
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
|
|
|
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
|
|
|
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
|
|
|
+import com.xjrsoft.module.student.entity.StudentReportPlan;
|
|
|
import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
|
-import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
|
|
|
-import com.xjrsoft.module.student.vo.*;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
+import com.xjrsoft.module.student.service.IEnrollmentPlanService;
|
|
|
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
|
|
|
+import com.xjrsoft.module.student.service.IStudentReportRecordService;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordItemVo;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
+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.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
-import java.io.IOException;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.*;
|
|
|
-import java.util.concurrent.CompletableFuture;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
- * @title: 新生维护信息
|
|
|
+ * @title: 新生报到信息
|
|
|
* @Author dzx
|
|
|
- * @Date: 2024-06-27
|
|
|
+ * @Date: 2025年3月19日
|
|
|
* @Version 1.0
|
|
|
*/
|
|
|
@RestController
|
|
|
@@ -64,359 +80,325 @@ import java.util.concurrent.CompletableFuture;
|
|
|
@AllArgsConstructor
|
|
|
public class BaseNewStudentReportController {
|
|
|
|
|
|
- private final IUserService userService;
|
|
|
- private final IBaseNewStudentService baseNewStudentService;
|
|
|
- private final IBaseStudentFamilyMemberService familyMemberService;
|
|
|
- private final IWhitelistManagementService whitelistManagementService;
|
|
|
- private final IUserRoleRelationService userRoleRelationService;
|
|
|
- private final RedisUtil redisUtil;
|
|
|
- private final IBaseUserStudentService userStudentService;
|
|
|
- private final CommonPropertiesConfig propertiesConfig;
|
|
|
+ private final IStudentReportRecordService recordService;
|
|
|
+ private final IStudentReportPlanService reportPlanService;
|
|
|
+ private final IBandingTaskClassService bandingTaskClassService;
|
|
|
private final IBaseSemesterService semesterService;
|
|
|
+ private final IBaseGradeService gradeService;
|
|
|
+ private final IEnrollmentPlanService enrollmentPlanService;
|
|
|
+ private final IBandingTaskService bandingTaskService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value = "新生维护信息列表(分页)")
|
|
|
@SaCheckPermission("basenewstudent:detail")
|
|
|
@XjrLog(value = "新生维护信息列表(分页)")
|
|
|
- public RT<PageOutput<BaseNewStudentPageVo>> page(@Valid BaseNewStudentPageDto dto) {
|
|
|
-
|
|
|
- Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
- PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
|
|
|
- return RT.ok(pageOutput);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/report-page")
|
|
|
- @ApiOperation(value = "新生报到(分页)")
|
|
|
- @SaCheckPermission("basenewstudent:detail")
|
|
|
- @XjrLog(value = "新生报到(分页)")
|
|
|
- public RT<PageOutput<BaseNewStudentPageVo>> reportPage(@Valid BaseNewStudentPageDto dto) {
|
|
|
+ public RT<PageOutput<StudentReportRecordPlanPageVo>> page(@Valid StudentTryReadingReportPageDto dto){
|
|
|
+ dto.setReportCategory(3);
|
|
|
List<String> roleList = StpUtil.getRoleList();
|
|
|
- if (roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getTeacherId() == null) {
|
|
|
+ if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
|
|
|
dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
}
|
|
|
- if (dto.getBaseSemesterId() == null) {
|
|
|
- LambdaQueryWrapper<BaseSemester> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .orderByDesc(BaseSemester::getStartDate)
|
|
|
- .select(BaseSemester.class, x -> VoToColumnUtil.fieldsToColumns(BaseSemester.class).contains(x.getProperty()));
|
|
|
- List<BaseSemester> semesterList = semesterService.list(queryWrapper);
|
|
|
- if (!semesterList.isEmpty()) {
|
|
|
- dto.setBaseSemesterId(semesterList.get(0).getId());
|
|
|
+ if(dto.getIsMoible() != null && dto.getIsMoible() == 1){
|
|
|
+ StudentReportPlan plan = reportPlanService.getLastNewStudentReportPlan();
|
|
|
+ dto.setStudentReportPlanId(plan.getId());
|
|
|
+ BandingTask bandingTask = bandingTaskService.getById(plan.getBandingTaskId());
|
|
|
+ List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
|
|
|
+ new QueryWrapper<EnrollmentPlan>().lambda()
|
|
|
+ .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
+ .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
|
|
|
+ .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
|
|
|
+ .eq(EnrollmentPlan::getGradeId, bandingTask.getGradeId())
|
|
|
+ .orderByDesc(EnrollmentPlan::getId)
|
|
|
+ );
|
|
|
+ if(!enrollmentPlans.isEmpty()){
|
|
|
+ dto.setEnrollmentPlanId(enrollmentPlans.get(0).getId());
|
|
|
}
|
|
|
}
|
|
|
- Page<BaseNewStudentPageVo> page = baseNewStudentService.getReportPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
- PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
|
|
|
+ Page<StudentReportRecordPlanPageVo> page = recordService.getTryReadingPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPlanPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = "/tree")
|
|
|
- @ApiOperation(value = "新生维护信息树")
|
|
|
- @SaCheckPermission("basenewstudent:detail")
|
|
|
- @XjrLog(value = "新生维护信息树")
|
|
|
- public RT<List<BaseNewStudentTreeVo>> tree() {
|
|
|
|
|
|
- List<EnrollmentPlanGradeVo> gradeList = baseNewStudentService.getGradeList();
|
|
|
- List<EnrollmentPlanTreeVo> list = baseNewStudentService.getEnrollmentPlanList();
|
|
|
+ @GetMapping(value = "/class-statistics")
|
|
|
+ @ApiOperation(value="班级数据统计")
|
|
|
+ @SaCheckPermission("studentreportrecord:detail")
|
|
|
+ @XjrLog(value = "班级数据统计")
|
|
|
+ public RT<BandingTaskClassReportStatisticsVo> classStatistics(@RequestParam Long classId){
|
|
|
+ return RT.ok(bandingTaskClassService.getTryReadingReportClassStatistics(new StudentTryReadingReportPageDto(){{
|
|
|
+ setClassId(classId);
|
|
|
+ setReportCategory(3);
|
|
|
+ }}));
|
|
|
+ }
|
|
|
|
|
|
- List<BaseNewStudentTreeVo> result = new ArrayList<>();
|
|
|
- for (EnrollmentPlanGradeVo gradeVo : gradeList) {
|
|
|
- BaseNewStudentTreeVo treeVo = new BaseNewStudentTreeVo() {{
|
|
|
- setId(gradeVo.getId());
|
|
|
- setName(gradeVo.getName());
|
|
|
- setTreeType(1);
|
|
|
- }};
|
|
|
- List<BaseNewStudentTreeVo> children = new ArrayList<>();
|
|
|
- for (EnrollmentPlanTreeVo planTreeVo : list) {
|
|
|
- if (planTreeVo.getGradeId().equals(gradeVo.getId())) {
|
|
|
- children.add(new BaseNewStudentTreeVo() {{
|
|
|
- setId(planTreeVo.getId());
|
|
|
- setName(planTreeVo.getEnrollTypeCn());
|
|
|
- setTreeType(2);
|
|
|
- }});
|
|
|
- }
|
|
|
+ @GetMapping(value = "/statistics")
|
|
|
+ @ApiOperation(value="领导统计")
|
|
|
+ @SaCheckPermission("studentreportrecord:detail")
|
|
|
+ @XjrLog(value = "领导统计")
|
|
|
+ public RT<StudentReportRecordStatisticsVo> statistics(@Valid StudentReportRecordStatisticsDto dto){
|
|
|
+ if(dto.getGradeId() == null && (dto.getCategory() == null || dto.getCategory() == 1)){
|
|
|
+ LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .orderByDesc(BaseGrade::getTitle)
|
|
|
+ .select(BaseGrade.class,x -> VoToColumnUtil.fieldsToColumns(BaseGrade.class).contains(x.getProperty()));
|
|
|
+ List<BaseGrade> gradeList = gradeService.list(queryWrapper);
|
|
|
+ if(!gradeList.isEmpty()){
|
|
|
+ dto.setGradeId(gradeList.get(0).getId());
|
|
|
}
|
|
|
-
|
|
|
- treeVo.setChildren(children);
|
|
|
- result.add(treeVo);
|
|
|
}
|
|
|
-
|
|
|
- return RT.ok(result);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/info")
|
|
|
- @ApiOperation(value = "根据id查询新生维护信息信息")
|
|
|
- @SaCheckPermission("basenewstudent:detail")
|
|
|
- @XjrLog(value = "根据id查询新生维护信息信息", saveResponseData = true)
|
|
|
- public RT<BaseNewStudentVo> info(@RequestParam Long id) {
|
|
|
- BaseNewStudent baseNewStudent = baseNewStudentService.getById(id);
|
|
|
- if (baseNewStudent == null) {
|
|
|
- return RT.error("找不到此数据!");
|
|
|
+ if(dto.getEnrollType() == null || dto.getEnrollType().isEmpty()){
|
|
|
+ dto.setEnrollType(EnrollTypeEnum.AUTUMN_ENROLLMENT.getCode());
|
|
|
}
|
|
|
- return RT.ok(BeanUtil.toBean(baseNewStudent, BaseNewStudentVo.class));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping
|
|
|
- @ApiOperation(value = "新增新生维护信息")
|
|
|
- @SaCheckPermission("basenewstudent:add")
|
|
|
- @XjrLog(value = "新增新生维护信息", saveResponseData = true)
|
|
|
- public RT<Boolean> add(@Valid @RequestBody AddBaseNewStudentDto dto) {
|
|
|
- BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
|
|
|
- baseNewStudent.setFirstAmbitionId(Long.parseLong(dto.getFirstAmbition()));
|
|
|
- baseNewStudent.setSecondAmbitionId(Long.parseLong(dto.getSecondAmbition()));
|
|
|
- baseNewStudent.setCreateDate(new Date());
|
|
|
- boolean isSuccess = baseNewStudentService.save(baseNewStudent);
|
|
|
- return RT.ok(isSuccess);
|
|
|
- }
|
|
|
-
|
|
|
- @PutMapping
|
|
|
- @ApiOperation(value = "修改新生维护信息")
|
|
|
- @SaCheckPermission("basenewstudent:edit")
|
|
|
- @XjrLog(value = "修改新生维护信息", saveResponseData = true)
|
|
|
- public RT<Boolean> update(@Valid @RequestBody UpdateBaseNewStudentDto dto) {
|
|
|
-
|
|
|
- BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
|
|
|
- return RT.ok(baseNewStudentService.updateById(baseNewStudent));
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @DeleteMapping
|
|
|
- @ApiOperation(value = "删除新生维护信息")
|
|
|
- @SaCheckPermission("basenewstudent:delete")
|
|
|
- @XjrLog(value = "删除新生维护信息", saveResponseData = true)
|
|
|
- public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
|
|
|
- return RT.ok(baseNewStudentService.removeBatchByIds(ids));
|
|
|
- }
|
|
|
-
|
|
|
- @DeleteMapping("deleteByUserIds")
|
|
|
- @ApiOperation(value = "删除新生(保留新生信息,删除基础信息)")
|
|
|
- @SaCheckPermission("basenewstudent:delete")
|
|
|
- @XjrLog(value = "删除新生(保留新生信息,删除基础信息)", saveResponseData = true)
|
|
|
- public RT<Boolean> deleteByUserIds(@Valid @RequestBody DeleteNewStudentDto dto) {
|
|
|
- return RT.ok(baseNewStudentService.deleteByUserIds(dto));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping("/import")
|
|
|
- @ApiOperation(value = "导入")
|
|
|
- @XjrLog(value = "导入", saveRequestData = false, saveResponseData = true)
|
|
|
- public RT<List<Map<String, String>>> importData(@RequestParam Long treeId, @RequestParam MultipartFile file) throws IOException {
|
|
|
- List<Map<Integer, Object>> errorList = baseNewStudentService.importData(treeId, file);
|
|
|
- List<Map<String, String>> result = new ArrayList<>();
|
|
|
-
|
|
|
- for (Map<Integer, Object> objectMap : errorList) {
|
|
|
- Map<String, String> object = new LinkedHashMap<>();
|
|
|
- object.put("毕业学校", objectMap.get(0) == null ? "" : objectMap.get(0).toString());
|
|
|
- object.put("学生姓名", objectMap.get(1) == null ? "" : objectMap.get(1).toString());
|
|
|
- object.put("性别", objectMap.get(2) == null ? "" : objectMap.get(2).toString());
|
|
|
- object.put("身份证号", objectMap.get(3) == null ? "" : objectMap.get(3).toString());
|
|
|
- object.put("身高(cm)", objectMap.get(4) == null ? "" : objectMap.get(4).toString());
|
|
|
- object.put("体重(kg)", objectMap.get(5) == null ? "" : objectMap.get(5).toString());
|
|
|
- object.put("毕业班级", objectMap.get(6) == null ? "" : objectMap.get(6).toString());
|
|
|
- object.put("学生来源", objectMap.get(7) == null ? "" : objectMap.get(7).toString());
|
|
|
- object.put("住宿类型", objectMap.get(8) == null ? "" : objectMap.get(8).toString());
|
|
|
- object.put("手机号", objectMap.get(9) == null ? "" : objectMap.get(9).toString());
|
|
|
- object.put("第一志愿", objectMap.get(10) == null ? "" : objectMap.get(10).toString());
|
|
|
- object.put("第二志愿", objectMap.get(11) == null ? "" : objectMap.get(11).toString());
|
|
|
- object.put("是否可调配", objectMap.get(12) == null ? "" : objectMap.get(12).toString());
|
|
|
- object.put("家庭电话", objectMap.get(13) == null ? "" : objectMap.get(13).toString());
|
|
|
- object.put("家庭地址", objectMap.get(14) == null ? "" : objectMap.get(14).toString());
|
|
|
- object.put("错误信息", objectMap.get(15) == null ? "" : objectMap.get(15).toString());
|
|
|
- result.add(object);
|
|
|
+ if(dto.getCategory() != null && dto.getCategory() == 2 && dto.getBaseSemesterId() == null){
|
|
|
+ dto.setBaseSemesterId(semesterService.getLastSemester());
|
|
|
}
|
|
|
- return RT.ok(result);
|
|
|
- }
|
|
|
|
|
|
- @PostMapping("/score-import")
|
|
|
- @ApiOperation(value = "成绩导入")
|
|
|
- @XjrLog(value = "成绩导入", saveRequestData = false, saveResponseData = true)
|
|
|
- public RT<List<Map<String, String>>> scoreImport(@RequestParam MultipartFile file) throws IOException {
|
|
|
- List<BaseNewStudentScoreExcelVo> errorList = baseNewStudentService.scoreImport(file);
|
|
|
- List<Map<String, String>> result = new ArrayList<>();
|
|
|
+ List<EnrollmentPlan> enrollmentPlanList = enrollmentPlanService.list(
|
|
|
+ new QueryWrapper<EnrollmentPlan>().lambda()
|
|
|
+ .eq(EnrollmentPlan::getEnrollType, dto.getEnrollType())
|
|
|
+ .eq(EnrollmentPlan::getGradeId, dto.getGradeId())
|
|
|
+ .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
+ .orderByDesc(EnrollmentPlan::getId)
|
|
|
+ );
|
|
|
+ if(enrollmentPlanList.isEmpty()){
|
|
|
+ return RT.ok(new StudentReportRecordStatisticsVo());
|
|
|
+ }
|
|
|
|
|
|
- for (BaseNewStudentScoreExcelVo objectMap : errorList) {
|
|
|
- Map<String, String> object = new LinkedHashMap<>();
|
|
|
- object.put("毕业学校", objectMap.getGraduateSchool());
|
|
|
- object.put("姓名", objectMap.getName());
|
|
|
- object.put("性别", objectMap.getGender());
|
|
|
- object.put("班级", objectMap.getGraduateClass());
|
|
|
- object.put("总成绩", objectMap.getScore().intValue() + "");
|
|
|
- object.put("错误信息", "未能查询到该学生或该学生存在多个");
|
|
|
- result.add(object);
|
|
|
+ StudentTryReadingReportPageDto recordPageDto = new StudentTryReadingReportPageDto();
|
|
|
+ recordPageDto.setEnrollmentPlanId(enrollmentPlanList.get(0).getId());
|
|
|
+ recordPageDto.setReportCategory(3);
|
|
|
+ List<StudentReportRecordPlanPageVo> dataList = recordService.getTryReadingList(recordPageDto);
|
|
|
+ StudentReportRecordStatisticsVo statisticsVo = new StudentReportRecordStatisticsVo();
|
|
|
+ statisticsVo.setAllCount(dataList.stream().count());
|
|
|
+
|
|
|
+ statisticsVo.setArrivedCount(dataList.stream().filter(x -> x.getReportTime() != null).count());
|
|
|
+ statisticsVo.setNotArrivedCount(dataList.stream().filter(x -> x.getReportTime() == null).count());
|
|
|
+ statisticsVo.setArrivedMaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender())).count());
|
|
|
+ statisticsVo.setArrivedFemaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())).count());
|
|
|
+
|
|
|
+ statisticsVo.setStayMaleCount(dataList.stream().filter(
|
|
|
+ x -> GenderDictionaryEnum.MALE.getValue().equals(x.getGender())
|
|
|
+ && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
|
|
|
+ && x.getReportTime() != null
|
|
|
+ ).count());
|
|
|
+ statisticsVo.setStayFemaleCount(dataList.stream().filter(
|
|
|
+ x -> GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())
|
|
|
+ && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
|
|
|
+ && x.getReportTime() != null
|
|
|
+ ).count());
|
|
|
+ statisticsVo.setNotStayMaleCount(dataList.stream().filter(
|
|
|
+ x -> GenderDictionaryEnum.MALE.getValue().equals(x.getGender())
|
|
|
+ && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
|
|
|
+ && x.getReportTime() != null
|
|
|
+ ).count());
|
|
|
+ statisticsVo.setNotStayFemaleCount(dataList.stream().filter(
|
|
|
+ x -> GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())
|
|
|
+ && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
|
|
|
+ && x.getReportTime() != null
|
|
|
+ ).count());
|
|
|
+
|
|
|
+ if(dto.getCategory() != null && dto.getCategory() == 3){
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getGraduateSchool() != null)
|
|
|
+ .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getGraduateSchool));
|
|
|
+ List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
|
|
|
+ for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
|
|
|
+ graduatedUniversityList.add(
|
|
|
+ new ItemCountVo(){{
|
|
|
+ setItem(graduatedUniversity);
|
|
|
+ setCount(graduatedUniversityMap.get(graduatedUniversity).size());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
|
|
|
}
|
|
|
- return RT.ok(result);
|
|
|
- }
|
|
|
|
|
|
- @PostMapping("/active-account")
|
|
|
- @ApiOperation(value = "激活账号")
|
|
|
- @XjrLog(value = "激活账号", saveResponseData = true)
|
|
|
- public RT<Boolean> activeAccount(@Valid @RequestBody ActiveAccountDto dto) {
|
|
|
- User user = userService.getById(dto.getId());
|
|
|
- user.setMobile(dto.getMobile());
|
|
|
- user.setEnabledMark(EnabledMark.ENABLED.getCode());
|
|
|
- user.setModifyDate(LocalDateTime.now());
|
|
|
- userService.updateById(user);
|
|
|
- // 新增家庭成员信息
|
|
|
- if (StrUtil.isNotEmpty(dto.getParentName()) && StrUtil.isNotEmpty(dto.getParentMobile())) {
|
|
|
- List<BaseStudentFamilyMember> list = familyMemberService.list(
|
|
|
- new QueryWrapper<BaseStudentFamilyMember>().lambda()
|
|
|
- .eq(BaseStudentFamilyMember::getName, dto.getParentName())
|
|
|
- .eq(BaseStudentFamilyMember::getUserId, dto.getId())
|
|
|
- .eq(BaseStudentFamilyMember::getMobile, dto.getParentMobile())
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassName() != null)
|
|
|
+ .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> classNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassName() != null)
|
|
|
+ .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
|
|
|
+ List<StudentReportRecordItemVo> classList = new ArrayList<>();
|
|
|
+ for (String className : classMap.keySet()) {
|
|
|
+ classList.add(
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
+ setItem(className);
|
|
|
+ setCount(classMap.get(className).size());
|
|
|
+ if(classNotMap.get(className) != null && !(classNotMap.get(className).isEmpty())){
|
|
|
+ setCount2(classNotMap.get(className).size());
|
|
|
+ }
|
|
|
+ }}
|
|
|
);
|
|
|
- BaseStudentFamilyMember member;
|
|
|
- if (list.isEmpty()) {
|
|
|
- member = new BaseStudentFamilyMember();
|
|
|
- member.setUserId(user.getId());
|
|
|
- member.setName(dto.getParentName());
|
|
|
- member.setMobile(dto.getParentMobile());
|
|
|
- member.setCreateDate(LocalDateTime.now());
|
|
|
- member.setCreateUserId(StpUtil.getLoginIdAsLong());
|
|
|
- familyMemberService.save(member);
|
|
|
- } else {
|
|
|
- member = list.get(0);
|
|
|
- }
|
|
|
- List<User> parents = userService.list(
|
|
|
- new QueryWrapper<User>().lambda()
|
|
|
- .eq(User::getUserName, dto.getParentMobile())
|
|
|
- .or()
|
|
|
- .eq(User::getMobile, dto.getParentMobile())
|
|
|
+ }
|
|
|
+ statisticsVo.setClassList(classList);
|
|
|
+
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassType() != null)
|
|
|
+ .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> classTypeNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassType() != null)
|
|
|
+ .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
|
|
|
+ List<StudentReportRecordItemVo> classTypeList = new ArrayList<>();
|
|
|
+ for (String classType : classTypeMap.keySet()) {
|
|
|
+ classTypeList.add(
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
+ setItem(classType);
|
|
|
+ setCount(classTypeMap.get(classType).size());
|
|
|
+ if(classTypeNotMap.get(classType) != null && !(classTypeNotMap.get(classType).isEmpty())){
|
|
|
+ setCount2(classTypeNotMap.get(classType).size());
|
|
|
+ }
|
|
|
+ }}
|
|
|
);
|
|
|
- if (parents.isEmpty()) {
|
|
|
- User parentUser = new User() {{
|
|
|
- setUserName(dto.getParentMobile());
|
|
|
- setName(dto.getParentName());
|
|
|
- setIsChangePassword(1);
|
|
|
- setDeleteMark(0);
|
|
|
- setEnabledMark(1);
|
|
|
- setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
- setMobile(dto.getParentMobile());
|
|
|
- }};
|
|
|
- userService.save(parentUser);
|
|
|
-
|
|
|
- userRoleRelationService.save(new UserRoleRelation() {{
|
|
|
- setUserId(parentUser.getId());
|
|
|
- setRoleId(4L);
|
|
|
- }});
|
|
|
-
|
|
|
- BaseUserStudent userStudent = new BaseUserStudent();
|
|
|
- userStudent.setStudentId(user.getId());
|
|
|
- userStudent.setStudentNane(user.getName());
|
|
|
- userStudent.setStudentIdentity(user.getCredentialNumber());
|
|
|
- userStudent.setCreateDate(new Date());
|
|
|
- userStudent.setUserId(parentUser.getId());
|
|
|
- userStudent.setStatus(1);
|
|
|
- userStudentService.save(userStudent);
|
|
|
- } else {
|
|
|
- User parentUser = parents.get(0);
|
|
|
- BaseUserStudent userStudent = new BaseUserStudent();
|
|
|
- userStudent.setStudentId(user.getId());
|
|
|
- userStudent.setStudentNane(user.getName());
|
|
|
- userStudent.setStudentIdentity(user.getCredentialNumber());
|
|
|
- userStudent.setCreateDate(new Date());
|
|
|
- userStudent.setUserId(parentUser.getId());
|
|
|
- userStudent.setStatus(1);
|
|
|
- userStudentService.save(userStudent);
|
|
|
- }
|
|
|
}
|
|
|
+ statisticsVo.setClassTypeList(classTypeList);
|
|
|
+
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> majorMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> majorNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
|
|
|
+ List<StudentReportRecordItemVo> majorList = new ArrayList<>();
|
|
|
+ for (String majorName : majorMap.keySet()) {
|
|
|
+ majorList.add(
|
|
|
+ new StudentReportRecordItemVo(){{
|
|
|
+ setItem(majorName);
|
|
|
+ setCount(majorMap.get(majorName).size());
|
|
|
+ if(majorNotMap.get(majorName) != null && !(majorNotMap.get(majorName).isEmpty())){
|
|
|
+ setCount2(majorNotMap.get(majorName).size());
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ statisticsVo.setMajorList(majorList);
|
|
|
+
|
|
|
+ Map<String, List<StudentReportRecordPlanPageVo>> deptMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getDeptName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getDeptName));
|
|
|
+ List<ItemCountVo> deptList = new ArrayList<>();
|
|
|
+ for (String deptName : deptMap.keySet()) {
|
|
|
+ deptList.add(
|
|
|
+ new ItemCountVo(){{
|
|
|
+ setItem(deptName);
|
|
|
+ setCount(deptMap.get(deptName).size());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ statisticsVo.setDeptList(deptList);
|
|
|
|
|
|
-
|
|
|
- //新增白名单信息
|
|
|
- List<WhitelistManagement> managementList = whitelistManagementService.list(
|
|
|
- new QueryWrapper<WhitelistManagement>().lambda()
|
|
|
- .eq(WhitelistManagement::getUserId, dto.getId())
|
|
|
+ BigDecimal divide = BigDecimal.ZERO;
|
|
|
+ if( statisticsVo.getAllCount() != 0){
|
|
|
+ divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ statisticsVo.setReportRate(divide.doubleValue());
|
|
|
+
|
|
|
+ //查询年级趋势
|
|
|
+ List<BaseGrade> gradeList = gradeService.list(
|
|
|
+ new QueryWrapper<BaseGrade>().lambda()
|
|
|
+ .eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(BaseGrade::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
+ .eq(BaseGrade::getStatus, 1)
|
|
|
+ .orderByDesc(BaseGrade::getTitle)
|
|
|
);
|
|
|
- if (managementList.isEmpty()) {
|
|
|
- WhitelistManagement whitelistManagement = new WhitelistManagement() {{
|
|
|
- setName(user.getName());
|
|
|
- setUserId(user.getId());
|
|
|
- setCreateDate(new Date());
|
|
|
- setCredentialNumber(user.getCredentialNumber());
|
|
|
- setPhone(user.getMobile());
|
|
|
- }};
|
|
|
- whitelistManagementService.save(whitelistManagement);
|
|
|
- } else {
|
|
|
- WhitelistManagement whitelistManagement = managementList.get(0);
|
|
|
- whitelistManagement.setName(user.getName());
|
|
|
- whitelistManagement.setUserId(user.getId());
|
|
|
- whitelistManagement.setModifyDate(new Date());
|
|
|
- whitelistManagement.setCredentialNumber(user.getCredentialNumber());
|
|
|
- whitelistManagement.setPhone(user.getMobile());
|
|
|
- whitelistManagementService.updateById(whitelistManagement);
|
|
|
+ List<ItemCountVo> gradeDataList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 3; i ++){
|
|
|
+ BaseGrade baseGrade = gradeList.get(i);
|
|
|
+
|
|
|
+ List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
|
|
|
+ new QueryWrapper<EnrollmentPlan>().lambda()
|
|
|
+ .eq(EnrollmentPlan::getGradeId, baseGrade.getId())
|
|
|
+ .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
+ .orderByDesc(EnrollmentPlan::getId)
|
|
|
+ );
|
|
|
+ int gradeCount = 0;
|
|
|
+ for (EnrollmentPlan enrollmentPlan : enrollmentPlans) {
|
|
|
+ StudentTryReadingReportPageDto gradeRecordPageDto = new StudentTryReadingReportPageDto();
|
|
|
+ gradeRecordPageDto.setEnrollmentPlanId(enrollmentPlan.getId());
|
|
|
+ gradeRecordPageDto.setIsReport(1);
|
|
|
+ gradeRecordPageDto.setReportCategory(3);
|
|
|
+ gradeCount += recordService.getTryReadingList(gradeRecordPageDto).size();
|
|
|
+ }
|
|
|
+ ItemCountVo itemCountVo = new ItemCountVo();
|
|
|
+ itemCountVo.setItem(baseGrade.getName());
|
|
|
+ itemCountVo.setCount(gradeCount);
|
|
|
+ gradeDataList.add(itemCountVo);
|
|
|
}
|
|
|
+ Collections.sort(gradeDataList, Comparator.comparing(ItemCountVo::getItem));
|
|
|
+ statisticsVo.setGradeList(gradeDataList);
|
|
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
- List<User> userList = userService.list();
|
|
|
- redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);
|
|
|
-
|
|
|
- List<UserRoleRelation> userRoleRelationList = userRoleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
|
|
|
- redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
|
|
|
-
|
|
|
- whitelistManagementService.loadCaches();
|
|
|
- });
|
|
|
-
|
|
|
- return RT.ok(true);
|
|
|
+ return RT.ok(statisticsVo);
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/report-export-query")
|
|
|
- @ApiOperation(value = "导出")
|
|
|
+ @PostMapping(value = "/export-query")
|
|
|
+ @ApiOperation(value="导出")
|
|
|
+ @SaCheckPermission("studentreportrecord:detail")
|
|
|
@XjrLog(value = "导出")
|
|
|
- public ResponseEntity<byte[]> exportData(@Valid @RequestBody BaseNewStudentPageDto dto) {
|
|
|
- if (dto.getBaseSemesterId() == null) {
|
|
|
- LambdaQueryWrapper<BaseSemester> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .orderByDesc(BaseSemester::getStartDate)
|
|
|
- .select(BaseSemester.class, x -> VoToColumnUtil.fieldsToColumns(BaseSemester.class).contains(x.getProperty()));
|
|
|
- List<BaseSemester> semesterList = semesterService.list(queryWrapper);
|
|
|
- if (!semesterList.isEmpty()) {
|
|
|
- dto.setBaseSemesterId(semesterList.get(0).getId());
|
|
|
- }
|
|
|
- }
|
|
|
+ public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody StudentTryReadingReportPageDto dto){
|
|
|
+ List<StudentReportRecordExcelVo> dataList = new ArrayList<>();
|
|
|
+
|
|
|
List<String> roleList = StpUtil.getRoleList();
|
|
|
- if (roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getTeacherId() == null) {
|
|
|
- dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ if(roleList.contains(RoleCodeEnum.TEACHER.getCode()) && roleList.contains(RoleCodeEnum.CLASSTE.getCode())){
|
|
|
+ if(dto.getClassId() == null){
|
|
|
+ dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ }
|
|
|
}
|
|
|
- List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);
|
|
|
- List<BaseNewStudentExportVo> exportVos = new ArrayList<>();
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
|
|
|
- for (BaseNewStudentPageVo el : reportList) {
|
|
|
- BaseNewStudentExportVo vo = BeanUtil.toBean(el, BaseNewStudentExportVo.class);
|
|
|
- if (el.getIsReport() == 1) {
|
|
|
- vo.setReportStatus("是");
|
|
|
- } else if (el.getIsReport() == 0) {
|
|
|
- vo.setReportStatus("否");
|
|
|
+ dto.setReportCategory(3);
|
|
|
+ List<StudentReportRecordPlanPageVo> planPageList = recordService.getTryReadingList(dto);
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ for (StudentReportRecordPlanPageVo pageVo : planPageList) {
|
|
|
+ StudentReportRecordExcelVo excelVo = BeanUtil.toBean(pageVo, StudentReportRecordExcelVo.class);
|
|
|
+ if(pageVo.getReportTime() != null){
|
|
|
+ excelVo.setReportTime(sdf.format(pageVo.getReportTime()));
|
|
|
}
|
|
|
- if (el.getReportTime() != null) {
|
|
|
- vo.setReportTime(el.getReportTime().format(formatter));
|
|
|
+ excelVo.setIsReport("否");
|
|
|
+ if(pageVo.getIsReport() != null && pageVo.getIsReport() == 1){
|
|
|
+ excelVo.setIsReport("是");
|
|
|
}
|
|
|
- exportVos.add(vo);
|
|
|
+
|
|
|
+ dataList.add(excelVo);
|
|
|
}
|
|
|
ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
- EasyExcel.write(bot, BaseNewStudentExportVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(exportVos);
|
|
|
-
|
|
|
- return RT.fileStream(bot.toByteArray(), "RoomBed" + ExcelTypeEnum.XLSX.getValue());
|
|
|
+ EasyExcel.write(bot, StudentReportRecordExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
|
|
|
+ String fileName = "exportQuerty" + ExcelTypeEnum.XLSX.getValue();
|
|
|
+ return RT.fileStream(bot.toByteArray(), fileName);
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/change-banding-status")
|
|
|
- @ApiOperation(value = "修改分班状态")
|
|
|
- @SaCheckPermission("basenewstudent:add")
|
|
|
- @XjrLog(value = "修改分班状态", saveResponseData = true)
|
|
|
- public RT<Boolean> changeBandingStatus(@Valid @RequestBody List<ChangeBandingStatusDto> dto) {
|
|
|
- for (ChangeBandingStatusDto el : dto) {
|
|
|
- BaseNewStudent newStudent = baseNewStudentService.getById(el.getId());
|
|
|
-
|
|
|
- UpdateWrapper<BaseNewStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("id", newStudent.getId());
|
|
|
- updateWrapper.setSql("is_can_banding = " + el.getIsCanBanding());
|
|
|
- if (StrUtil.isNotEmpty(el.getRemarks())) {
|
|
|
- updateWrapper.setSql("remarks = '" + el.getRemarks() + "'");
|
|
|
- } else {
|
|
|
- updateWrapper.setSql("remarks = null");
|
|
|
+ @GetMapping(value = "/class-list")
|
|
|
+ @ApiOperation(value="查询班级信息")
|
|
|
+ @SaCheckPermission("studentreportrecord:detail")
|
|
|
+ @XjrLog(value = "查询班级信息")
|
|
|
+ public RT<List<BandingTaskClassPageVo>> classList(@Valid StudentReportRecordPageDto dto){
|
|
|
+ BandingTaskClassPageDto classDto = new BandingTaskClassPageDto();
|
|
|
+ if(dto.getEnrollmentPlanId() == null){
|
|
|
+ if(dto.getTeacherId() != null){
|
|
|
+ classDto.setTeacherId(dto.getTeacherId());
|
|
|
+ }else{
|
|
|
+ classDto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ }
|
|
|
+ StudentReportPlan plan = reportPlanService.getLastNewStudentReportPlan();
|
|
|
+ if(plan == null){
|
|
|
+ return RT.ok(new ArrayList<>());
|
|
|
+ }
|
|
|
+ classDto.setBandingTaskId(plan.getBandingTaskId());
|
|
|
+ }else{
|
|
|
+ EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(dto.getEnrollmentPlanId());
|
|
|
+ if(enrollmentPlan != null){
|
|
|
+ List<BandingTask> list = bandingTaskService.list(
|
|
|
+ new QueryWrapper<BandingTask>().lambda()
|
|
|
+ .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
|
|
|
+ .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
|
|
|
+ .eq(BandingTask::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(BandingTask::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
+ .orderByDesc(BandingTask::getId)
|
|
|
+ );
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ classDto.setBandingTaskId(list.get(0).getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
+ if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
|
|
|
+ classDto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
}
|
|
|
- baseNewStudentService.update(newStudent, updateWrapper);
|
|
|
}
|
|
|
|
|
|
- return RT.ok(true);
|
|
|
+ List<BandingTaskClassPageVo> list = bandingTaskClassService.getList(classDto);
|
|
|
+ return RT.ok(list);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|