|
@@ -1,5 +1,9 @@
|
|
package org.dromara.system.service.impl;
|
|
package org.dromara.system.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import org.dromara.common.core.domain.R;
|
|
import org.dromara.common.core.domain.R;
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
@@ -7,30 +11,30 @@ import org.dromara.common.core.utils.ClassUtils;
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
-import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
|
-import org.dromara.system.domain.RegisterParentsStudent;
|
|
|
|
-import org.dromara.system.domain.RegisterSchoolFile;
|
|
|
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
+import org.dromara.system.domain.RegisterSchool;
|
|
|
|
+import org.dromara.system.domain.SysUser;
|
|
import org.dromara.system.domain.bo.RegisterParentsStudentBo;
|
|
import org.dromara.system.domain.bo.RegisterParentsStudentBo;
|
|
|
|
+import org.dromara.system.domain.bo.RegisterSchoolBo;
|
|
import org.dromara.system.domain.bo.RegisterSchoolFileBo;
|
|
import org.dromara.system.domain.bo.RegisterSchoolFileBo;
|
|
import org.dromara.system.domain.bo.RegisterTeacherClassBo;
|
|
import org.dromara.system.domain.bo.RegisterTeacherClassBo;
|
|
import org.dromara.system.domain.vo.*;
|
|
import org.dromara.system.domain.vo.*;
|
|
import org.dromara.system.mapper.*;
|
|
import org.dromara.system.mapper.*;
|
|
import org.dromara.system.service.IRegisterParentsStudentService;
|
|
import org.dromara.system.service.IRegisterParentsStudentService;
|
|
import org.dromara.system.service.IRegisterSchoolFileService;
|
|
import org.dromara.system.service.IRegisterSchoolFileService;
|
|
|
|
+import org.dromara.system.service.IRegisterSchoolService;
|
|
import org.dromara.system.service.IRegisterTeacherClassService;
|
|
import org.dromara.system.service.IRegisterTeacherClassService;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.dromara.system.domain.bo.RegisterSchoolBo;
|
|
|
|
-import org.dromara.system.domain.RegisterSchool;
|
|
|
|
-import org.dromara.system.service.IRegisterSchoolService;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+import static org.dromara.system.constent.Constants.ONE;
|
|
|
|
+import static org.dromara.system.constent.Constants.TWO;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 注册-学校Service业务层处理
|
|
* 注册-学校Service业务层处理
|
|
@@ -52,10 +56,11 @@ public class RegisterSchoolServiceImpl implements IRegisterSchoolService {
|
|
private final RegisterParentsMapper registerParentsMapper;
|
|
private final RegisterParentsMapper registerParentsMapper;
|
|
|
|
|
|
private final IRegisterTeacherClassService registerTeacherClassService;
|
|
private final IRegisterTeacherClassService registerTeacherClassService;
|
|
- private final RegisterTeacherClassMapper registerTeacherClassMapper;
|
|
|
|
|
|
+
|
|
|
|
|
|
private final IRegisterParentsStudentService registerParentsStudentService;
|
|
private final IRegisterParentsStudentService registerParentsStudentService;
|
|
- private final RegisterParentsStudentMapper registerParentsStudentMapper;
|
|
|
|
|
|
+ private final SysUserMapper sysUserMapper;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询注册-学校
|
|
* 查询注册-学校
|
|
@@ -125,9 +130,9 @@ public class RegisterSchoolServiceImpl implements IRegisterSchoolService {
|
|
//查询是否已经注册过
|
|
//查询是否已经注册过
|
|
RegisterSchoolVo registerSchoolOld = baseMapper.selectRegisterSchooByPhonenumber(bo.getUserPhone());
|
|
RegisterSchoolVo registerSchoolOld = baseMapper.selectRegisterSchooByPhonenumber(bo.getUserPhone());
|
|
if(registerSchoolOld!=null){
|
|
if(registerSchoolOld!=null){
|
|
- if(registerSchoolOld.getIsPass().equals("1")){
|
|
|
|
|
|
+ if(registerSchoolOld.getIsPass().equals(ONE)){
|
|
return R.fail("该手机号已注册当前身份,信息正在审核中。",registerSchoolOld);
|
|
return R.fail("该手机号已注册当前身份,信息正在审核中。",registerSchoolOld);
|
|
- }else if(registerSchoolOld.getIsPass().equals("2")){
|
|
|
|
|
|
+ }else if(registerSchoolOld.getIsPass().equals(TWO)){
|
|
return R.fail("该手机号已注册当前身份,审核已通过,请登录。",registerSchoolOld);
|
|
return R.fail("该手机号已注册当前身份,审核已通过,请登录。",registerSchoolOld);
|
|
}else{
|
|
}else{
|
|
return R.fail("该手机号已注册当前身份,审核未通过。",registerSchoolOld);
|
|
return R.fail("该手机号已注册当前身份,审核未通过。",registerSchoolOld);
|
|
@@ -136,7 +141,7 @@ public class RegisterSchoolServiceImpl implements IRegisterSchoolService {
|
|
|
|
|
|
bo.setCreateTime(DateUtils.getNowDate());
|
|
bo.setCreateTime(DateUtils.getNowDate());
|
|
bo.setUpdateTime(DateUtils.getNowDate());
|
|
bo.setUpdateTime(DateUtils.getNowDate());
|
|
- bo.setIsPass("1");
|
|
|
|
|
|
+ bo.setIsPass(ONE);
|
|
RegisterSchool add = MapstructUtils.convert(bo, RegisterSchool.class);
|
|
RegisterSchool add = MapstructUtils.convert(bo, RegisterSchool.class);
|
|
validEntityBeforeSave(add);
|
|
validEntityBeforeSave(add);
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
@@ -155,6 +160,11 @@ public class RegisterSchoolServiceImpl implements IRegisterSchoolService {
|
|
|
|
|
|
if (flag) {
|
|
if (flag) {
|
|
bo.setId(add.getId());
|
|
bo.setId(add.getId());
|
|
|
|
+ //更新用户为apply申请用户
|
|
|
|
+ SysUser sysUser = new SysUser();
|
|
|
|
+ sysUser.setUserName(bo.getUserPhone());
|
|
|
|
+ sysUser.setUserType("apply");
|
|
|
|
+ sysUserMapper.updateByUserName(sysUser);
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
return R.fail();
|
|
return R.fail();
|