浏览代码

学生数据添加增加唯一性验证

dzx 7 月之前
父节点
当前提交
483a3f6f9f

+ 1 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -237,6 +237,7 @@ public class StudentManagerController {
     public R add(@Valid @RequestBody AddBaseStudentUserDto dto) {
         List<BaseStudentSompleInfoVo> infos = schoolRollService.getInfosByParam(new BaseStudentSimpleInfoDto() {{
             setIdNumber(dto.getCredentialNumber());
+            setFindNewStudent(0);
         }});
         if(!infos.isEmpty()){
             return R.ok(infos.get(0));

+ 4 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentSimpleInfoDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.dto;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -27,4 +28,7 @@ public class BaseStudentSimpleInfoDto {
     private String archivesStatus;
 
     private List<String> idNumberList;
+
+    @JsonIgnore
+    private Integer findNewStudent = 1;
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -275,7 +275,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     @Override
     public List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto) {
         List<BaseStudentSompleInfoVo> userList = userMapper.getInfosByParam(dto);
-        if(userList.isEmpty()){
+        if(userList.isEmpty() && dto.getFindNewStudent() == 1){
             userList = newStudentMapper.getInfosByParam(dto);
         }
         return userList;