|
@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
|
|
|
import com.ym.mec.education.base.BaseResponse;
|
|
|
import com.ym.mec.education.base.PageResponse;
|
|
|
import com.ym.mec.education.entity.*;
|
|
|
+import com.ym.mec.education.enums.ClassGroupStudentStatusEnum;
|
|
|
import com.ym.mec.education.enums.ClassGroupTypeEnum;
|
|
|
import com.ym.mec.education.enums.ReturnCodeEnum;
|
|
|
import com.ym.mec.education.enums.TeachTypeEnum;
|
|
@@ -25,6 +26,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -52,6 +54,11 @@ public class MusicGroupServiceImpl extends ServiceImpl<MusicGroupMapper, MusicGr
|
|
|
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IClassGroupStudentMapperService classGroupStudentMapperService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public PageResponse groupList(MusicGroupReq req) {
|
|
|
PageResponse response = new PageResponse();
|
|
@@ -132,7 +139,28 @@ public class MusicGroupServiceImpl extends ServiceImpl<MusicGroupMapper, MusicGr
|
|
|
int studNum = classGroups.stream().mapToInt(ClassGroup::getStudentNum).sum();
|
|
|
musicGroupResp.setStudentNum(studNum);
|
|
|
|
|
|
- int mergeNum = classGroups.stream().filter(e -> ClassGroupTypeEnum.MIX.getCode().equalsIgnoreCase(e.getType()).count();
|
|
|
+ Long mergeNum = classGroups.stream().filter(e -> ClassGroupTypeEnum.MIX.getCode().equalsIgnoreCase(e.getType())).count();
|
|
|
+
|
|
|
+ Long unitClassNum = classGroups.stream().filter(e -> ClassGroupTypeEnum.NORMAL.getCode().equalsIgnoreCase(e.getType())).count();
|
|
|
+ musicGroupResp.setMergeClassNum(Optional.ofNullable(mergeNum).orElse(0L).intValue());
|
|
|
+ musicGroupResp.setUnitClassNum(Optional.ofNullable(unitClassNum).orElse(0L).intValue());
|
|
|
+
|
|
|
+
|
|
|
+ List<Integer> classId = classGroups.stream().map(e ->e.getId()).collect(Collectors.toList());
|
|
|
+ QueryWrapper<ClassGroupStudentMapper> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.in("class_group_id_", classId);
|
|
|
+
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperService.list(queryWrapper2);
|
|
|
+
|
|
|
+ if(!CollectionUtils.isEmpty(classGroupStudentMappers)){
|
|
|
+
|
|
|
+ Long liveNum = classGroups.stream().filter(e -> ClassGroupStudentStatusEnum.NORMAL.getCode().equalsIgnoreCase(e.getType())).count();
|
|
|
+
|
|
|
+ Long delNum = classGroups.stream().filter(e -> ClassGroupStudentStatusEnum.QUIT.getCode().equalsIgnoreCase(e.getType())).count();
|
|
|
+ musicGroupResp.setLiveStudNum(Optional.ofNullable(liveNum).orElse(0L).intValue());
|
|
|
+ musicGroupResp.setDelStudNum(Optional.ofNullable(delNum).orElse(0L).intValue());
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
//老师
|
|
|
SysUser sysUser1 = sysUserService.getById(musicGroup.getTeamTeacherId());
|