|
@@ -141,11 +141,13 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
// 判断用户是否存在
|
|
|
SysUser user = teacherDao.getUserWithPhone(studentPreRegistration.getPhone());
|
|
|
Integer userId = null;
|
|
|
-
|
|
|
+
|
|
|
if(user != null && user.getId() != null){
|
|
|
- if(user.getUserType().contains("STUDENT")){
|
|
|
+ if (user.getUserType().contains("STUDENT")) {
|
|
|
throw new BizException("您已注册,请直接下载APP!");
|
|
|
- }
|
|
|
+ } else { // 当前用户是 SYSTEM, TEACHER 添加学生
|
|
|
+ user.setUserType(user.getUserType() + ",STUDENT");
|
|
|
+ }
|
|
|
userId = user.getId();
|
|
|
if (studentPreRegistration.getOrganId() != null) {
|
|
|
user.setOrganId(studentPreRegistration.getOrganId());
|
|
@@ -156,11 +158,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
if (studentPreRegistration.getUserName() != null) {
|
|
|
user.setUsername(studentPreRegistration.getUserName());
|
|
|
}
|
|
|
- if (user.getUserType() == null) {
|
|
|
- user.setUserType("STUDENT");
|
|
|
- } else if (!user.getUserType().contains("STUDENT")) {
|
|
|
- user.setUserType(user.getUserType() + ",STUDENT");
|
|
|
- }
|
|
|
+
|
|
|
user.setUpdateTime(date);
|
|
|
teacherDao.updateUser(user);
|
|
|
}else{
|
|
@@ -177,7 +175,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
userId = user.getId();
|
|
|
sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//添加student
|
|
|
Student student = new Student();
|
|
|
student.setUserId(userId);
|
|
@@ -451,9 +449,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
if (student == null) {
|
|
|
throw new BizException("学员信息不存在");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Date nowDate = new Date();
|
|
|
-
|
|
|
+
|
|
|
if(student.getMembershipStartTime() == null){
|
|
|
student.setMembershipStartTime(nowDate);
|
|
|
}
|