|
@@ -144,10 +144,10 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
//用户协议
|
|
|
List<SysUserContracts> userAllContract = sysUserContractsDao.getUserAllContract(new ArrayList<>(userIds));
|
|
|
Map<Integer, Set<Integer>> userContractVersionMap = new HashMap<>();
|
|
|
- if(!CollectionUtils.isEmpty(userAllContract)){
|
|
|
+ if (!CollectionUtils.isEmpty(userAllContract)) {
|
|
|
userContractVersionMap = userAllContract.stream().collect(Collectors.groupingBy(SysUserContracts::getUserId, Collectors.mapping(SysUserContracts::getVersion, Collectors.toSet())));
|
|
|
}
|
|
|
- Map<Long,String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(userIds,null));
|
|
|
+ Map<Long, String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(userIds, null));
|
|
|
//List<Subject> studentSubject = studentManageDao.getStudentSubject(userIds);
|
|
|
StudentListCourseDto studentListCourseDto = null;
|
|
|
//获取所在乐团
|
|
@@ -196,20 +196,20 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
dto.setHasPracticeCourse(YesOrNoEnum.NO);
|
|
|
}
|
|
|
//如果会员已过期、是否有未生效的会员
|
|
|
- if(dto.getMemberRankSettingId() == null){
|
|
|
+ if (dto.getMemberRankSettingId() == null) {
|
|
|
String s = cloudMap.get(dto.getUserId().longValue());
|
|
|
- if(StringUtils.isNotEmpty(s)){
|
|
|
+ if (StringUtils.isNotEmpty(s)) {
|
|
|
dto.setHasNoStartCloudTeacher(true);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(userContractVersionMap.containsKey(dto.getUserId())){
|
|
|
+ if (userContractVersionMap.containsKey(dto.getUserId())) {
|
|
|
dto.setIsSignedContract(true);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
dto.setIsSignedContract(false);
|
|
|
}
|
|
|
//年级
|
|
|
- dto.setCurrentGrade(studentService.getStudentGrade(dto.getGradeType(),dto.getCurrentGradeNum()));
|
|
|
+ dto.setCurrentGrade(studentService.getStudentGrade(dto.getGradeType(), dto.getCurrentGradeNum()));
|
|
|
}
|
|
|
pageInfo.setRows(dataList);
|
|
|
return pageInfo;
|
|
@@ -253,6 +253,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
pageInfo.setRows(dataList);
|
|
|
return pageInfo;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public PageInfo<SimpleUserDto> queryStudentsWithTeacherByOrganId(StudentManageQueryInfo queryInfo) {
|
|
|
PageInfo<SimpleUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
@@ -300,7 +301,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
dataList = studentPaymentOrderDao.queryDouble11Students(params);
|
|
|
SysConfig vipSpecialActivityConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
|
|
|
Map<Integer, StudentVipDouble11Dto> studentCourseTimeMap = new HashMap<>();
|
|
|
- if(Objects.nonNull(vipSpecialActivityConfig)&&StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())){
|
|
|
+ if (Objects.nonNull(vipSpecialActivityConfig) && StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())) {
|
|
|
Set<Integer> studentIds = dataList.stream().map(StudentVipDouble11Dto::getUserId).collect(Collectors.toSet());
|
|
|
Set<Integer> specialActivityIds = Arrays.stream(vipSpecialActivityConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
|
|
|
List<StudentVipDouble11Dto> studentCourseTimeList = courseScheduleStudentPaymentDao.countStudentDouble11CourseTime(new ArrayList<>(studentIds), new ArrayList<>(specialActivityIds));
|
|
@@ -308,12 +309,12 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
}
|
|
|
for (StudentVipDouble11Dto studentVipDouble11Dto : dataList) {
|
|
|
StudentVipDouble11Dto studentCourseTime = studentCourseTimeMap.get(studentVipDouble11Dto.getUserId());
|
|
|
- studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToOneTime()));
|
|
|
- if(studentVipDouble11Dto.getCourseOneToOneTime()<0){
|
|
|
+ studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime() * 20 - (Objects.isNull(studentCourseTime) ? 0 : studentCourseTime.getCourseOneToOneTime()));
|
|
|
+ if (studentVipDouble11Dto.getCourseOneToOneTime() < 0) {
|
|
|
studentVipDouble11Dto.setCourseOneToOneTime(0);
|
|
|
}
|
|
|
- studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToTwoTime()));
|
|
|
- if(studentVipDouble11Dto.getCourseOneToTwoTime()<0){
|
|
|
+ studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime() * 20 - (Objects.isNull(studentCourseTime) ? 0 : studentCourseTime.getCourseOneToTwoTime()));
|
|
|
+ if (studentVipDouble11Dto.getCourseOneToTwoTime() < 0) {
|
|
|
studentVipDouble11Dto.setCourseOneToTwoTime(0);
|
|
|
}
|
|
|
}
|
|
@@ -328,19 +329,19 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
List<StudentVipDouble11Dto> studentsDouble11Infos = studentPaymentOrderDao.findStudentsDouble11Infos(studentIds);
|
|
|
SysConfig vipSpecialActivityConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
|
|
|
Map<Integer, StudentVipDouble11Dto> studentCourseTimeMap = new HashMap<>();
|
|
|
- if(Objects.nonNull(vipSpecialActivityConfig)&&StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())){
|
|
|
+ if (Objects.nonNull(vipSpecialActivityConfig) && StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())) {
|
|
|
Set<Integer> specialActivityIds = Arrays.stream(vipSpecialActivityConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
|
|
|
List<StudentVipDouble11Dto> studentCourseTimeList = courseScheduleStudentPaymentDao.countStudentDouble11CourseTime(studentIds, new ArrayList<>(specialActivityIds));
|
|
|
studentCourseTimeMap = studentCourseTimeList.stream().collect(Collectors.toMap(StudentVipDouble11Dto::getUserId, s -> s));
|
|
|
}
|
|
|
for (StudentVipDouble11Dto studentVipDouble11Dto : studentsDouble11Infos) {
|
|
|
StudentVipDouble11Dto studentCourseTime = studentCourseTimeMap.get(studentVipDouble11Dto.getUserId());
|
|
|
- studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToOneTime()));
|
|
|
- if(studentVipDouble11Dto.getCourseOneToOneTime()<0){
|
|
|
+ studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime() * 20 - (Objects.isNull(studentCourseTime) ? 0 : studentCourseTime.getCourseOneToOneTime()));
|
|
|
+ if (studentVipDouble11Dto.getCourseOneToOneTime() < 0) {
|
|
|
studentVipDouble11Dto.setCourseOneToOneTime(0);
|
|
|
}
|
|
|
- studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToTwoTime()));
|
|
|
- if(studentVipDouble11Dto.getCourseOneToTwoTime()<0){
|
|
|
+ studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime() * 20 - (Objects.isNull(studentCourseTime) ? 0 : studentCourseTime.getCourseOneToTwoTime()));
|
|
|
+ if (studentVipDouble11Dto.getCourseOneToTwoTime() < 0) {
|
|
|
studentVipDouble11Dto.setCourseOneToTwoTime(0);
|
|
|
}
|
|
|
}
|
|
@@ -486,31 +487,31 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
List<MusicGroupStudentsDto> dataList = new ArrayList<>();
|
|
|
List<StudentRegistration> studentRegistrations = studentRegistrationDao.getMusicGroupStu(queryInfo.getMusicGroupId());
|
|
|
- if(studentRegistrations.size() == 0){
|
|
|
+ if (studentRegistrations.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
List<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
- if(queryInfo.getHasCourse() != null){
|
|
|
+ if (queryInfo.getHasCourse() != null) {
|
|
|
//有剩余课程的学员
|
|
|
- List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP,PRACTICE");
|
|
|
- if(queryInfo.getHasCourse()){
|
|
|
+ List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds, "VIP,PRACTICE");
|
|
|
+ if (queryInfo.getHasCourse()) {
|
|
|
userIds = hasCourseStudent;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
userIds.removeAll(hasCourseStudent);
|
|
|
}
|
|
|
}
|
|
|
- if(userIds.size() > 0 && queryInfo.getOweFlag() != null){
|
|
|
- List<Integer> studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(queryInfo.getMusicGroupId(),userIds,null);
|
|
|
- if(queryInfo.getOweFlag()){
|
|
|
+ if (userIds.size() > 0 && queryInfo.getOweFlag() != null) {
|
|
|
+ List<Integer> studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(queryInfo.getMusicGroupId(), userIds, null);
|
|
|
+ if (queryInfo.getOweFlag()) {
|
|
|
userIds = studentIds;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
userIds.removeAll(studentIds);
|
|
|
}
|
|
|
}
|
|
|
- if(userIds.size() == 0){
|
|
|
+ if (userIds.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
- params.put("userIds",userIds);
|
|
|
+ params.put("userIds", userIds);
|
|
|
int count = studentManageDao.countMusicGroupStudent(params);
|
|
|
if (queryInfo.getIsExport() && count > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
@@ -520,7 +521,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = studentManageDao.queryMusicGroupStudent(params);
|
|
|
//获取乐团学员欠费金额
|
|
|
- Map<Integer,BigDecimal> totalAmountMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentTotalAmount(queryInfo.getMusicGroupId()));
|
|
|
+ Map<Integer, BigDecimal> totalAmountMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentTotalAmount(queryInfo.getMusicGroupId()));
|
|
|
//退团的学生
|
|
|
List<Integer> quitUserIds = dataList.stream().filter(e -> e.getStudentStatus().equals("QUIT")).map(MusicGroupStudentsDto::getUserId).collect(Collectors.toList());
|
|
|
if (quitUserIds.size() > 0) {
|
|
@@ -533,23 +534,23 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
}
|
|
|
}
|
|
|
List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
- List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(collect,"VIP,PRACTICE");
|
|
|
+ List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(collect, "VIP,PRACTICE");
|
|
|
List<SubjectChange> waitPayChange = subjectChangeDao.getMusicGroupWaitPay(queryInfo.getMusicGroupId());
|
|
|
Map<Integer, List<SubjectChange>> studentWaitPayChange = waitPayChange.stream().collect(Collectors.groupingBy(SubjectChange::getStudentId));
|
|
|
//查询是否有有效期内乐保
|
|
|
- List<StudentInstrument> studentsMaintenanceNum = studentInstrumentDao.getStudentsMaintenanceNum(collect,queryInfo.getMusicGroupId());
|
|
|
+ List<StudentInstrument> studentsMaintenanceNum = studentInstrumentDao.getStudentsMaintenanceNum(collect, queryInfo.getMusicGroupId());
|
|
|
Map<Integer, Integer> studentMaintenanceMap = studentsMaintenanceNum.stream().collect(Collectors.toMap(StudentInstrument::getStudentId, StudentInstrument::getGoodsId));
|
|
|
|
|
|
//查询云教练订单
|
|
|
List<CloudTeacherOrder> studentCloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrders(collect, queryInfo.getMusicGroupId());
|
|
|
Map<Integer, List<CloudTeacherOrder>> studentCloudTeacherMap = studentCloudTeacherOrders.stream().collect(Collectors.groupingBy(CloudTeacherOrder::getStudentId));
|
|
|
Date nowDate = new Date();
|
|
|
- Map<Long,String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(new HashSet<>(collect),null));
|
|
|
- dataList.forEach(e->{
|
|
|
+ Map<Long, String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(new HashSet<>(collect), null));
|
|
|
+ dataList.forEach(e -> {
|
|
|
//如果会员已过期、是否有未生效的会员
|
|
|
- if(e.getMemberRankSettingId() == null){
|
|
|
+ if (e.getMemberRankSettingId() == null) {
|
|
|
String s = cloudMap.get(e.getUserId().longValue());
|
|
|
- if(StringUtils.isNotEmpty(s)){
|
|
|
+ if (StringUtils.isNotEmpty(s)) {
|
|
|
e.setHasNoStartCloudTeacher(true);
|
|
|
}
|
|
|
}
|
|
@@ -558,16 +559,16 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
if (studentWaitPayChange.containsKey(e.getUserId())) {
|
|
|
e.setSubjectChange(studentWaitPayChange.get(e.getUserId()).get(0));
|
|
|
}
|
|
|
- if(studentMaintenanceMap.containsKey(e.getUserId())){
|
|
|
+ if (studentMaintenanceMap.containsKey(e.getUserId())) {
|
|
|
e.setHasMaintenance(true);
|
|
|
}
|
|
|
if (studentCloudTeacherMap.containsKey(e.getUserId())) {
|
|
|
List<CloudTeacherOrder> cloudTeacherOrders = studentCloudTeacherMap.get(e.getUserId());
|
|
|
- if(cloudTeacherOrders != null && cloudTeacherOrders.size() > 0){
|
|
|
+ if (cloudTeacherOrders != null && cloudTeacherOrders.size() > 0) {
|
|
|
BigDecimal cloudAmount = BigDecimal.ZERO;
|
|
|
for (CloudTeacherOrder cloudTeacherOrder : cloudTeacherOrders) {
|
|
|
- if (cloudTeacherOrder.getEndTime() == null || DateUtil.stringToDate(DateUtil.format(cloudTeacherOrder.getEndTime(),DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT).compareTo(
|
|
|
- DateUtil.stringToDate(DateUtil.format(nowDate,DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT)) >= 0) {
|
|
|
+ if (cloudTeacherOrder.getEndTime() == null || DateUtil.stringToDate(DateUtil.format(cloudTeacherOrder.getEndTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT), DateUtil.ISO_EXPANDED_DATE_FORMAT).compareTo(
|
|
|
+ DateUtil.stringToDate(DateUtil.format(nowDate, DateUtil.ISO_EXPANDED_DATE_FORMAT), DateUtil.ISO_EXPANDED_DATE_FORMAT)) >= 0) {
|
|
|
cloudAmount = cloudAmount.add(cloudTeacherOrder.getAmount());
|
|
|
}
|
|
|
}
|
|
@@ -592,17 +593,17 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
//未完成vip、网管课学员数量/该乐团在读学员人数*100%
|
|
|
List<StudentRegistration> studentRegistrations = studentRegistrationDao.getMusicGroupStu(musicGroupId);
|
|
|
List<Integer> userIds = studentRegistrations.stream().filter(e -> e.getMusicGroupStatus() == StudentMusicGroupStatusEnum.NORMAL).map(StudentRegistration::getUserId).collect(Collectors.toList());
|
|
|
- if(userIds.size() == 0){
|
|
|
- resultMap.put("courseRate","0.00%");
|
|
|
+ if (userIds.size() == 0) {
|
|
|
+ resultMap.put("courseRate", "0.00%");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP,PRACTICE");
|
|
|
+ List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds, "VIP,PRACTICE");
|
|
|
double size = userIds.size() + 0d;
|
|
|
- if(hasCourseStudent.size() == 0){
|
|
|
- resultMap.put("courseRate","0.00%");
|
|
|
- }else {
|
|
|
+ if (hasCourseStudent.size() == 0) {
|
|
|
+ resultMap.put("courseRate", "0.00%");
|
|
|
+ } else {
|
|
|
double d = (hasCourseStudent.size() / size) * 100;
|
|
|
- resultMap.put("courseRate",String.format("%.2f", d) + "%");
|
|
|
+ resultMap.put("courseRate", String.format("%.2f", d) + "%");
|
|
|
}
|
|
|
return resultMap;
|
|
|
}
|
|
@@ -637,7 +638,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
public void updateUser(SysUser sysUser) {
|
|
|
studentManageDao.updateUser(sysUser);
|
|
|
Student student = studentDao.get(sysUser.getId());
|
|
|
- if(student != null) {
|
|
|
+ if (student != null) {
|
|
|
student.setCurrentGradeNum(sysUser.getCurrentGradeNum());
|
|
|
student.setCurrentClass(sysUser.getCurrentClass());
|
|
|
Optional.ofNullable(sysUser.getSubjectId()).ifPresent(student::setSubjectIdList);
|
|
@@ -682,7 +683,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
Date date = new Date();
|
|
|
SysUser sysUser = teacherDao.getUserWithPhone(student.getPhone());
|
|
|
if (sysUser != null) {
|
|
|
- EmployeeServiceImpl.checkTenantId(student.getTenantId(),sysUser.getTenantId());
|
|
|
+ EmployeeServiceImpl.checkTenantId(student.getTenantId(), sysUser.getTenantId());
|
|
|
if (sysUser.getUserType().contains("STUDENT")) {
|
|
|
throw new BizException("手机号已被占用");
|
|
|
} else {
|
|
@@ -734,13 +735,13 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
// 同步更新机构手机号 如果它存在
|
|
|
SysUser user = teacherDao.getUser(student.getId());
|
|
|
tenantInfoService.updatePhone(student.getPhone(), user.getPhone());
|
|
|
- activityUserMapperDao.updateTeacherId(student.getUserId(),student.getTeacherId());
|
|
|
- if(Objects.nonNull(student.getCarePackage())||Objects.nonNull(student.getComeOnPackage())){
|
|
|
+ activityUserMapperDao.updateTeacherId(student.getUserId(), student.getTeacherId());
|
|
|
+ if (Objects.nonNull(student.getCarePackage()) || Objects.nonNull(student.getComeOnPackage())) {
|
|
|
Student oldStudent = studentDao.get(userId);
|
|
|
- if(Objects.nonNull(oldStudent.getCarePackage())&&oldStudent.getCarePackage().equals(2)){
|
|
|
+ if (Objects.nonNull(oldStudent.getCarePackage()) && oldStudent.getCarePackage().equals(2)) {
|
|
|
student.setCarePackage(oldStudent.getCarePackage());
|
|
|
}
|
|
|
- if(Objects.nonNull(oldStudent.getComeOnPackage())&&oldStudent.getComeOnPackage().equals(2)){
|
|
|
+ if (Objects.nonNull(oldStudent.getComeOnPackage()) && oldStudent.getComeOnPackage().equals(2)) {
|
|
|
student.setComeOnPackage(oldStudent.getComeOnPackage());
|
|
|
}
|
|
|
}
|
|
@@ -750,8 +751,8 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
|
|
|
studentExtracurricularExercisesSituationService.deleteByStudent(student.getId(), monDayDate.toString());
|
|
|
}
|
|
|
- webFeignService.updateNickName(userId,student.getUsername());
|
|
|
- imFeignService.update(new ImUserModel(userId.toString(),student.getUsername(),sysUser1 == null ? null:sysUser1.getAvatar()));
|
|
|
+ webFeignService.updateNickName(userId, student.getUsername());
|
|
|
+ imFeignService.update(new ImUserModel(userId.toString(), student.getUsername(), sysUser1 == null ? null : sysUser1.getAvatar()));
|
|
|
return userId;
|
|
|
}
|
|
|
|
|
@@ -782,9 +783,9 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
studentNum = studentNum == null ? 0 : studentNum;
|
|
|
signInNum = signInNum == null ? 0 : signInNum;
|
|
|
leaveNum = leaveNum == null ? 0 : leaveNum;
|
|
|
- if(Objects.nonNull(courseSchedule)&& !CourseStatusEnum.NOT_START.equals(courseSchedule.getStatus())){
|
|
|
+ if (Objects.nonNull(courseSchedule) && !CourseStatusEnum.NOT_START.equals(courseSchedule.getStatus())) {
|
|
|
sum.put("truantNum", studentNum - signInNum - leaveNum);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
sum.put("truantNum", 0);
|
|
|
}
|
|
|
sum.put("homeworkNum", studentManageDao.countHomeworkNum(courseScheduleId));
|
|
@@ -811,14 +812,14 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
|
|
|
List<UserGroupDto> allUserGroups = studentRegistrationDao.getUserGroups(new ArrayList<>(studentIds));
|
|
|
Map<Integer, List<UserGroupDto>> userGroupsMap = new HashMap<>();
|
|
|
- if(!CollectionUtils.isEmpty(allUserGroups)){
|
|
|
+ if (!CollectionUtils.isEmpty(allUserGroups)) {
|
|
|
userGroupsMap = allUserGroups.stream().collect(Collectors.groupingBy(UserGroupDto::getUserId));
|
|
|
}
|
|
|
|
|
|
for (Student4operating student4operating : dataList) {
|
|
|
List<UserGroupDto> userGroupDtos = userGroupsMap.get(student4operating.getStudentId());
|
|
|
- if(!CollectionUtils.isEmpty(userGroupDtos)){
|
|
|
- student4operating.setGroupNames(userGroupDtos.stream().filter(ug->StringUtils.isNotBlank(ug.getGroupName())).map(UserGroupDto::getGroupName).sorted().collect(Collectors.joining(",")));
|
|
|
+ if (!CollectionUtils.isEmpty(userGroupDtos)) {
|
|
|
+ student4operating.setGroupNames(userGroupDtos.stream().filter(ug -> StringUtils.isNotBlank(ug.getGroupName())).map(UserGroupDto::getGroupName).sorted().collect(Collectors.joining(",")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -827,14 +828,14 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BasicUserDto> queryCanAddStudent(String musicGroupId, String batchNo,String search,Integer subjectId) {
|
|
|
- return studentManageDao.queryCanAddStudent(musicGroupId, batchNo,search,subjectId);
|
|
|
+ public List<BasicUserDto> queryCanAddStudent(String musicGroupId, String batchNo, String search, Integer subjectId) {
|
|
|
+ return studentManageDao.queryCanAddStudent(musicGroupId, batchNo, search, subjectId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public PageInfo<BasicUserDto> queryGroupStudents(StudentQueryInfo queryInfo) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null || sysUser.getId() == null){
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
PageInfo<BasicUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
@@ -843,17 +844,17 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
Integer count = 0;
|
|
|
- if("VIP".equals(queryInfo.getGroupType())){
|
|
|
+ if ("VIP".equals(queryInfo.getGroupType())) {
|
|
|
count = studentManageDao.countVipGroupStudents(params);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
count = studentManageDao.countPracticeGroupStudents(params);
|
|
|
}
|
|
|
List<BasicUserDto> dataList = new ArrayList<>();
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
- if("VIP".equals(queryInfo.getGroupType())){
|
|
|
+ if ("VIP".equals(queryInfo.getGroupType())) {
|
|
|
dataList = studentManageDao.queryVipGroupStudents(params);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
dataList = studentManageDao.queryPracticeGroupStudents(params);
|
|
|
}
|
|
|
}
|
|
@@ -864,7 +865,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
@Override
|
|
|
public PageInfo<StudentNoStartCoursesDto> queryStudentNoStartCourse(StudentQueryInfo queryInfo) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null || sysUser.getId() == null){
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
PageInfo<StudentNoStartCoursesDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
@@ -901,8 +902,11 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
dataList = musicGroupPaymentStudentCourseDetailDao.pageStudentSubTotalCourseTimes(params);
|
|
|
+ //内部分页
|
|
|
+ int endIdx = pageInfo.getPageNo() * pageInfo.getLimit();
|
|
|
+ dataList = dataList.subList(pageInfo.getOffset(), dataList.size() > endIdx ? endIdx : dataList.size());
|
|
|
|
|
|
- Map<Integer,String> classMap = MapUtil.convertMybatisMap(classGroupDao.queryStudentClassGroupMap(queryInfo.getMusicGroupId()));
|
|
|
+ Map<Integer, String> classMap = MapUtil.convertMybatisMap(classGroupDao.queryStudentClassGroupMap(queryInfo.getMusicGroupId()));
|
|
|
for (StudentSubTotalCourseTimesDto timesDto : dataList) {
|
|
|
timesDto.setClassGroupId(classMap.get(timesDto.getUserId()));
|
|
|
}
|
|
@@ -919,7 +923,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
|
|
|
Integer tenantId = TenantContextHolder.getTenantId();
|
|
|
String studentErrorLeaveNum = sysTenantConfigService.getTenantConfigValue(SysConfigService.STUDENT_ERROR_LEAVE_NUM, tenantId);
|
|
|
- if(StringUtils.isEmpty(studentErrorLeaveNum)){
|
|
|
+ if (StringUtils.isEmpty(studentErrorLeaveNum)) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -931,21 +935,21 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
params.put("currentMonth", currentMonth);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
//当前用户是否是分部经理
|
|
|
- Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION,sysUser.getId(),sysUser.getIsSuperAdmin());
|
|
|
+ Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
|
|
|
if (onlyForRole) {
|
|
|
//获取教务老师关联的班级列表
|
|
|
List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
|
|
|
- if(classGroupIds == null || classGroupIds.size() == 0){
|
|
|
+ if (classGroupIds == null || classGroupIds.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
params.put("classGroupIds", classGroupIds);
|
|
|
}
|
|
|
- params.put("studentErrorLeaveNum",studentErrorLeaveNum);
|
|
|
+ params.put("studentErrorLeaveNum", studentErrorLeaveNum);
|
|
|
int count = indexBaseMonthDataDao.countStudentErrorLeave1(params);
|
|
|
List<StudentErrorLeaveDto> dataList = new ArrayList<>();
|
|
|
if (count > 0) {
|
|
|
//获取近两个月异常请假次数
|
|
|
- Map<Integer,BigDecimal> leaveNumMap = MapUtil.convertIntegerMap(indexBaseMonthDataDao.getStudentErrorLeaveNumMap(params));
|
|
|
+ Map<Integer, BigDecimal> leaveNumMap = MapUtil.convertIntegerMap(indexBaseMonthDataDao.getStudentErrorLeaveNumMap(params));
|
|
|
pageInfo.setTotal(count);
|
|
|
dataList = indexBaseMonthDataDao.queryStudentErrorLeave(params);
|
|
|
for (StudentErrorLeaveDto studentErrorLeaveDto : dataList) {
|
|
@@ -977,47 +981,47 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateChildrenDayStudent(ActivityCourseDetailDto activityCourseDetailDto) {
|
|
|
Student student = studentDao.getLocked(activityCourseDetailDto.getUserId());
|
|
|
- if(student == null){
|
|
|
+ if (student == null) {
|
|
|
throw new BizException("学员信息不存在");
|
|
|
}
|
|
|
- if(!activityCourseDetailDto.getVip1().equals(0) && !activityCourseDetailDto.getVip1().equals(1)){
|
|
|
+ if (!activityCourseDetailDto.getVip1().equals(0) && !activityCourseDetailDto.getVip1().equals(1)) {
|
|
|
throw new BizException("修改失败:排课次数异常");
|
|
|
}
|
|
|
- if(!activityCourseDetailDto.getVip2().equals(0) && !activityCourseDetailDto.getVip2().equals(1)){
|
|
|
+ if (!activityCourseDetailDto.getVip2().equals(0) && !activityCourseDetailDto.getVip2().equals(1)) {
|
|
|
throw new BizException("修改失败:排课次数异常");
|
|
|
}
|
|
|
- if(!activityCourseDetailDto.getFree_vip().equals(0) && !activityCourseDetailDto.getFree_vip().equals(1)){
|
|
|
+ if (!activityCourseDetailDto.getFree_vip().equals(0) && !activityCourseDetailDto.getFree_vip().equals(1)) {
|
|
|
throw new BizException("修改失败:排课次数异常");
|
|
|
}
|
|
|
- if(!activityCourseDetailDto.getMusic_theory().equals(0) && !activityCourseDetailDto.getMusic_theory().equals(1)){
|
|
|
+ if (!activityCourseDetailDto.getMusic_theory().equals(0) && !activityCourseDetailDto.getMusic_theory().equals(1)) {
|
|
|
throw new BizException("修改失败:排课次数异常");
|
|
|
}
|
|
|
- if(activityCourseDetailDto.getMusic_theory().equals(1)){
|
|
|
+ if (activityCourseDetailDto.getMusic_theory().equals(1)) {
|
|
|
String activityCourseDetail = student.getActivityCourseDetail();
|
|
|
- if(StringUtils.isNotEmpty(activityCourseDetail)){
|
|
|
+ if (StringUtils.isNotEmpty(activityCourseDetail)) {
|
|
|
ActivityCourseDetailDto detailDto = JSON.parseObject(activityCourseDetail, ActivityCourseDetailDto.class);
|
|
|
- if(detailDto.getMusic_theory() == null || detailDto.getMusic_theory().equals(0)){
|
|
|
+ if (detailDto.getMusic_theory() == null || detailDto.getMusic_theory().equals(0)) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserById(student.getUserId());
|
|
|
- if(sysUser == null){
|
|
|
+ if (sysUser == null) {
|
|
|
throw new BizException("请登录");
|
|
|
}
|
|
|
OrganizationDegreeCourseFee degreeCourseFee = organizationDegreeCourseFeeDao.getByOrganId(sysUser.getOrganId());
|
|
|
- if(degreeCourseFee == null){
|
|
|
+ if (degreeCourseFee == null) {
|
|
|
throw new BizException("学员所在分部未配置考级价格");
|
|
|
}
|
|
|
activityCourseDetailDto.setMusic_theory_price(degreeCourseFee.getTheory());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
activityCourseDetailDto.setMusic_theory_price(detailDto.getMusic_theory_price());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
SysUser sysUser = teacherDao.getUser(student.getUserId());
|
|
|
OrganizationDegreeCourseFee degreeCourseFee = organizationDegreeCourseFeeDao.getByOrganId(sysUser.getOrganId());
|
|
|
- if(degreeCourseFee == null){
|
|
|
+ if (degreeCourseFee == null) {
|
|
|
throw new BizException("学员所在分部未配置考级价格");
|
|
|
}
|
|
|
activityCourseDetailDto.setMusic_theory_price(degreeCourseFee.getTheory());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
activityCourseDetailDto.setMusic_theory_price(BigDecimal.ZERO);
|
|
|
}
|
|
|
activityCourseDetailDto.setUserId(null);
|
|
@@ -1030,35 +1034,35 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
List<Integer> studentIds = new ArrayList<>();
|
|
|
- params.put("studentIds",studentIds);
|
|
|
+ params.put("studentIds", studentIds);
|
|
|
PageInfo<Student> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
- if(queryInfo.getHasMusicCourse() != null){
|
|
|
- params.put("groupType","MUSIC");
|
|
|
- params.put("hasCourse",queryInfo.getHasMusicCourse());
|
|
|
+ if (queryInfo.getHasMusicCourse() != null) {
|
|
|
+ params.put("groupType", "MUSIC");
|
|
|
+ params.put("hasCourse", queryInfo.getHasMusicCourse());
|
|
|
studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
|
|
|
- if(studentIds == null || studentIds.size() == 0){
|
|
|
+ if (studentIds == null || studentIds.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
}
|
|
|
- if(queryInfo.getHasPracticeCourse() != null){
|
|
|
- params.put("groupType","PRACTICE");
|
|
|
- params.put("hasCourse",queryInfo.getHasPracticeCourse());
|
|
|
- params.put("studentIds",studentIds);
|
|
|
+ if (queryInfo.getHasPracticeCourse() != null) {
|
|
|
+ params.put("groupType", "PRACTICE");
|
|
|
+ params.put("hasCourse", queryInfo.getHasPracticeCourse());
|
|
|
+ params.put("studentIds", studentIds);
|
|
|
studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
|
|
|
- if(studentIds == null || studentIds.size() == 0){
|
|
|
+ if (studentIds == null || studentIds.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
}
|
|
|
- if(queryInfo.getHasVipCourse() != null){
|
|
|
- params.put("groupType","VIP");
|
|
|
- params.put("hasCourse",queryInfo.getHasVipCourse());
|
|
|
- params.put("studentIds",studentIds);
|
|
|
+ if (queryInfo.getHasVipCourse() != null) {
|
|
|
+ params.put("groupType", "VIP");
|
|
|
+ params.put("hasCourse", queryInfo.getHasVipCourse());
|
|
|
+ params.put("studentIds", studentIds);
|
|
|
studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
|
|
|
- if(studentIds == null || studentIds.size() == 0){
|
|
|
+ if (studentIds == null || studentIds.size() == 0) {
|
|
|
return pageInfo;
|
|
|
}
|
|
|
}
|
|
|
- params.put("studentIds",studentIds);
|
|
|
+ params.put("studentIds", studentIds);
|
|
|
List<Student> dataList = null;
|
|
|
int count = studentDao.countStudent(params);
|
|
|
if (count > 0) {
|