|
@@ -118,12 +118,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ClassGroup addClassGroup(ClassGroup classGroup) throws Exception {
|
|
|
+ String userIds = classGroup.getUserIds();
|
|
|
+ if(userIds == null || userIds.isEmpty()) throw new Exception("班级学生不能为空");
|
|
|
+
|
|
|
+ HashSet<String> userIdStrSet = new HashSet<>(Arrays.asList(userIds.split(",")));
|
|
|
+
|
|
|
Date date = new Date();
|
|
|
classGroup.setCreateTime(date);
|
|
|
classGroup.setUpdateTime(date);
|
|
|
classGroup.setType(ClassGroupTypeEnum.NORMAL);
|
|
|
- String userIds = classGroup.getUserIds();
|
|
|
- HashSet<String> userIdStrSet = new HashSet<>(Arrays.asList(userIds.split(",")));
|
|
|
|
|
|
classGroup.setExpectStudentNum(userIdStrSet.size());
|
|
|
classGroup.setStudentNum(userIdStrSet.size());
|
|
@@ -139,6 +142,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
classGroupStudentMapper.setCreateTime(date);
|
|
|
classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
classGroupStudentList.add(classGroupStudentMapper);
|
|
|
+
|
|
|
StudentRegistration studentRegistration = new StudentRegistration();
|
|
|
studentRegistration.setClassGroupId(classGroup.getId());
|
|
|
studentRegistration.setUserId(Integer.getInteger(userId));
|