|
@@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.MessageFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
@@ -246,7 +247,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
studentResp.setSysUser(sysUser);
|
|
|
if (Objects.isNull(studentVo)) {
|
|
|
|
|
|
-
|
|
|
+ long userId = 0;
|
|
|
if (Objects.isNull(sysUser)) {
|
|
|
|
|
|
// 自动注册创建用户
|
|
@@ -259,24 +260,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
user.setUserType(ClientEnum.STUDENT.getCode());
|
|
|
sysUserMapper.insert(user);
|
|
|
|
|
|
- studentResp.setSysUser(user);
|
|
|
- String subjectId = null;
|
|
|
- // 学生声部
|
|
|
- if (!StringUtil.isEmpty(info.getSubjectName())) {
|
|
|
- Subject subject = subjectDao.getSubjectMatchByName(info.getSubjectName());
|
|
|
- if (Objects.nonNull(subject)) {
|
|
|
- subjectId = String.valueOf(subject.getId());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 添加学生帐号
|
|
|
- Student student = new Student();
|
|
|
- student.setUserId(user.getId());
|
|
|
- student.setSubjectId(subjectId);
|
|
|
- student.setUnionId(info.getUnionId());
|
|
|
- student.setLockFlag(UserLockFlag.NORMAL);
|
|
|
- student.setHideFlag(Optional.ofNullable(info.getLockFlag()).orElse(0));
|
|
|
- save(student);
|
|
|
+ studentResp.username(user.getUsername()).userId(user.getId()).setSysUser(user);
|
|
|
|
|
|
// 更新标识
|
|
|
studentResp.setUpdateFlag(true);
|
|
@@ -284,7 +268,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
|
|
|
com.yonge.cooleshow.biz.dal.entity.SysUser updateEntity = new com.yonge.cooleshow.biz.dal.entity.SysUser();
|
|
|
updateEntity.setId(sysUser.getId());
|
|
|
- updateEntity.setDelFlag(Optional.ofNullable(info.getLockFlag()).orElse(0)); // 激活帐号
|
|
|
+ updateEntity.setUpdateTime(LocalDateTime.now());
|
|
|
+ //updateEntity.setDelFlag(Optional.ofNullable(info.getLockFlag()).orElse(0)); // 激活帐号
|
|
|
if (StringUtils.isBlank(sysUser.getUsername())) {
|
|
|
updateEntity.setUsername(info.getUsername());
|
|
|
}
|
|
@@ -295,11 +280,33 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
|
|
|
Student student = lambdaQuery().eq(Student::getUserId, sysUser.getId()).one();
|
|
|
|
|
|
+ if (Objects.nonNull(student)) {
|
|
|
+ // 重置学生隐藏状态
|
|
|
+ info.setLockFlag(0);
|
|
|
+ }
|
|
|
// 更新学生关联帐号
|
|
|
updateStudentUnionStatus(info, studentResp, student);
|
|
|
|
|
|
}
|
|
|
|
|
|
+ String subjectId = null;
|
|
|
+ // 学生声部
|
|
|
+ if (!StringUtil.isEmpty(info.getSubjectName())) {
|
|
|
+ Subject subject = subjectDao.getSubjectMatchByName(info.getSubjectName());
|
|
|
+ if (Objects.nonNull(subject)) {
|
|
|
+ subjectId = String.valueOf(subject.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 添加学生帐号
|
|
|
+ Student student = new Student();
|
|
|
+ student.setUserId(studentResp.getUserId());
|
|
|
+ student.setSubjectId(subjectId);
|
|
|
+ student.setUnionId(info.getUnionId());
|
|
|
+ student.setLockFlag(UserLockFlag.NORMAL);
|
|
|
+ student.setHideFlag(Optional.ofNullable(info.getLockFlag()).orElse(0));
|
|
|
+ save(student);
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
studentResp.username(studentVo.getUsername()).userId(studentVo.getUserId());
|