소스 검색

家长注册判断手机号是否是学生手机号

大数据与最优化研究所 7 달 전
부모
커밋
2dfc1834e3
1개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 15 0
      src/main/java/com/xjrsoft/module/organization/controller/UserController.java

+ 15 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -41,9 +41,11 @@ import com.xjrsoft.module.organization.service.*;
 import com.xjrsoft.module.organization.utils.OrganizationUtil;
 import com.xjrsoft.module.organization.vo.*;
 import com.xjrsoft.module.oss.factory.OssFactory;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.entity.File;
@@ -116,6 +118,7 @@ public class UserController {
     private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
     private final IWhitelistManagementService whitelistManagementService;
     private final IWorkflowCirculatedService circulatedService;
+    private final IBaseNewStudentService baseNewStudentService;
 
     @GetMapping(value = "/list")
     @ApiOperation(value = "用户列表(不分页)")
@@ -754,6 +757,18 @@ public class UserController {
             throw new MyException("当前手机号已被" + user.getName() + "使用,请更换手机号注册!");
         }
 
+        //验证新生注册家长的手机号是否是学生自己的
+        LambdaQueryWrapper<BaseNewStudent> baseNewStudentLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        baseNewStudentLambdaQueryWrapper
+                .eq(BaseNewStudent::getMobile, dto.getMobile())
+                .eq(BaseNewStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
+                .last("limit 1")
+        ;
+        BaseNewStudent baseNewStudent =  baseNewStudentService.getOne(baseNewStudentLambdaQueryWrapper);
+        if(ObjectUtils.isNotEmpty(baseNewStudent)){
+            throw new MyException("当前手机号为学生" + user.getName() + "填写的学生手机号,请更换手机号注册!");
+        }
+
         // 验证验证码
         if (!smsCtcc.captchaVerify(dto.getMobile(), dto.getSmsCode())) {
             return R.error("验证码不正确!");