|
|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
|
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
@@ -27,25 +28,40 @@ import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.concat.service.IXjrUserService;
|
|
|
-import com.xjrsoft.module.feedback.entity.FeedbackItem;
|
|
|
import com.xjrsoft.module.hikvision.util.DataUtil;
|
|
|
import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
import com.xjrsoft.module.organization.service.IUserDeptRelationService;
|
|
|
import com.xjrsoft.module.room.service.IRoomBedService;
|
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
|
import com.xjrsoft.module.student.dto.MajorGradeClassDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
-import com.xjrsoft.module.student.vo.*;
|
|
|
+import com.xjrsoft.module.student.vo.BaseDepMajorGradeClassStudenTreeVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentSchoolRollVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentTreeVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentUserVo;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+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 org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
@@ -53,7 +69,16 @@ import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.text.ParseException;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Base64;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.Enumeration;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipFile;
|
|
|
@@ -65,6 +90,7 @@ import java.util.zip.ZipFile;
|
|
|
public class StudentManagerController {
|
|
|
|
|
|
private final IStudentManagerService studentManagerService;
|
|
|
+ private final IBaseStudentSchoolRollService schoolRollService;
|
|
|
private final IBaseGradeService baseGradeService;
|
|
|
private final IBaseClassService baseClassService;
|
|
|
private final IXjrUserService xjrUserService;
|
|
|
@@ -213,6 +239,19 @@ public class StudentManagerController {
|
|
|
return R.ok(studentManagerService.add(dto));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/find-student-exist")
|
|
|
+ @ApiOperation(value = "新增前判断学生是否存在")
|
|
|
+ @SaCheckPermission("studentmanager:detail")
|
|
|
+ @XjrLog(value = "新增前判断学生是否存在")
|
|
|
+ public RT<BaseStudentSompleInfoVo> info(@Valid BaseStudentSimpleInfoDto dto) {
|
|
|
+ List<BaseStudentSompleInfoVo> infos = schoolRollService.getInfosByParam(dto);
|
|
|
+ if(infos.isEmpty()){
|
|
|
+ return RT.ok();
|
|
|
+ }
|
|
|
+ return RT.ok(infos.get(0));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@PostMapping("upload-image")
|
|
|
@ApiOperation(value = "上传学生学籍照片")
|
|
|
@SaCheckPermission("studentmanager:add")
|
|
|
@@ -252,10 +291,13 @@ public class StudentManagerController {
|
|
|
@PostMapping("/import")
|
|
|
@ApiOperation(value = "导入学生信息")
|
|
|
@XjrLog(value = "导入学生信息", saveRequestData = false, saveResponseData = true)
|
|
|
- public RT<Boolean> importData(@RequestParam("file") MultipartFile file) throws IOException, ParseException {
|
|
|
+ public RT<List<BaseStudentSompleInfoVo>> importData(@RequestParam("file") MultipartFile file) throws IOException, ParseException {
|
|
|
List<Map<Integer, Object>> excelDataList = EasyExcel.read(file.getInputStream()).sheet().headRowNumber(3).doReadSync();
|
|
|
-
|
|
|
- return RT.ok(studentManagerService.importStudentData(excelDataList));
|
|
|
+ List<BaseStudentSompleInfoVo> result = studentManagerService.importStudentData(excelDataList);
|
|
|
+ if(!result.isEmpty()){
|
|
|
+ return RT.ok(result);
|
|
|
+ }
|
|
|
+ return RT.ok(null);
|
|
|
}
|
|
|
|
|
|
|