瀏覽代碼

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into saas_2022_05_17_activity

zouxuan 3 年之前
父節點
當前提交
d398cbb880

+ 35 - 28
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1808,11 +1808,13 @@ public class ExportServiceImpl implements ExportService {
             //专业
             if (row.getGroupType().equals(GroupType.VIP)) {
                 row.setVipCourseFee(row.getActualAmount());
-                VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
-                if (vipGroupInfo != null) {
-                    row.setSchoolName(vipGroupInfo.getSchoolName());
-                    row.setSubjectName(vipGroupInfo.getSubjectName());
-                    row.setEduTeacher(vipGroupInfo.getEducationalTeacherName());
+                if(StringUtils.isNotEmpty(row.getMusicGroupId()) && row.getClassGroupId() != null){
+                    VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
+                    if (vipGroupInfo != null) {
+                        row.setSchoolName(vipGroupInfo.getSchoolName());
+                        row.setSubjectName(vipGroupInfo.getSubjectName());
+                        row.setEduTeacher(vipGroupInfo.getEducationalTeacherName());
+                    }
                 }
                 if(row.getTypeDesc() == null){
                     //学员没有历史VIP课程则导出为【VIP课新增】
@@ -2166,25 +2168,28 @@ public class ExportServiceImpl implements ExportService {
             } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
                 //考级报名
                 if (row.getType().equals(OrderTypeEnum.DEGREE_REGISTRATION)) {
-                    String[] feeTypes = row.getMemo().split(";");
-                    List<String> feeTypeList = Arrays.asList(feeTypes);
-                    for (String feeTypeStr : feeTypeList) {
-                        int index = feeTypeStr.lastIndexOf(":");
-                        if (index < 0) {
-                            continue;
-                        }
-                        BigDecimal typeFee = new BigDecimal(feeTypeStr.substring(index + 1));
-                        if (row.getExpectAmount().compareTo(BigDecimal.ZERO) > 0) {
-                            typeFee = typeFee.multiply(row.getActualAmount()).divide(row.getExpectAmount(), 2, BigDecimal.ROUND_DOWN);
-                        }
-                        if (feeTypeStr.contains("VIP")) {
-                            row.setVipCourseFee(typeFee);
-                        } else if (feeTypeStr.contains("网管课")) {
-                            row.setPracticeCourseFee(typeFee);
-                        } else if (feeTypeStr.contains("乐理课")) {
-                            row.setTheoryCourseFee(typeFee);
+                	
+                	if(StringUtils.isNotBlank(row.getMemo())){
+                        String[] feeTypes = row.getMemo().split(";");
+                        List<String> feeTypeList = Arrays.asList(feeTypes);
+                        for (String feeTypeStr : feeTypeList) {
+                            int index = feeTypeStr.lastIndexOf(":");
+                            if (index < 0) {
+                                continue;
+                            }
+                            BigDecimal typeFee = new BigDecimal(feeTypeStr.substring(index + 1));
+                            if (row.getExpectAmount().compareTo(BigDecimal.ZERO) > 0) {
+                                typeFee = typeFee.multiply(row.getActualAmount()).divide(row.getExpectAmount(), 2, BigDecimal.ROUND_DOWN);
+                            }
+                            if (feeTypeStr.contains("VIP")) {
+                                row.setVipCourseFee(typeFee);
+                            } else if (feeTypeStr.contains("网管课")) {
+                                row.setPracticeCourseFee(typeFee);
+                            } else if (feeTypeStr.contains("乐理课")) {
+                                row.setTheoryCourseFee(typeFee);
+                            }
                         }
-                    }
+                	}
                     row.setDegreeFee(row.getActualAmount().subtract(row.getVipCourseFee()).subtract(row.getPracticeCourseFee()).subtract(row.getTheoryCourseFee()));
                 } else {
                     if (row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())) {
@@ -2518,11 +2523,13 @@ public class ExportServiceImpl implements ExportService {
             //专业
             if (row.getGroupType().equals(GroupType.VIP)) {
                 row.setVipCourseFee(row.getActualAmount());
-                VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
-                if (vipGroupInfo != null) {
-                    row.setSchoolName(vipGroupInfo.getSchoolName());
-                    row.setSubjectName(vipGroupInfo.getSubjectName());
-                    row.setEduTeacher(vipGroupInfo.getEducationalTeacherName());
+                if(StringUtils.isNotEmpty(row.getMusicGroupId()) && row.getClassGroupId() != null) {
+                    VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
+                    if (vipGroupInfo != null) {
+                        row.setSchoolName(vipGroupInfo.getSchoolName());
+                        row.setSubjectName(vipGroupInfo.getSubjectName());
+                        row.setEduTeacher(vipGroupInfo.getEducationalTeacherName());
+                    }
                 }
                 if(row.getTypeDesc() == null){
                     //学员没有历史VIP课程则导出为【VIP课新增】

+ 11 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -2,10 +2,8 @@ package com.ym.mec.biz.service.impl;
 
 import java.math.BigDecimal;
 import java.time.DayOfWeek;
-import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -20,7 +18,6 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -59,6 +56,7 @@ import com.ym.mec.biz.dal.enums.IndexDataType;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.TeachTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysTenantConfigService;
@@ -373,6 +371,8 @@ public class StudentServeServiceImpl implements StudentServeService {
         	return;
         }
         
+        Map<String,List<Integer>> musicGroupStudentMap = studentRegistrationList.stream().collect(Collectors.groupingBy(StudentRegistration :: getMusicGroupId, Collectors.mapping(StudentRegistration :: getUserId, Collectors.toList())));
+        
         List<Integer> studentIds = studentRegistrationList.stream().map(t -> t.getUserId()).distinct().collect(Collectors.toList());
 
         Set<String> holidayDays = new HashSet<>();
@@ -456,12 +456,15 @@ public class StudentServeServiceImpl implements StudentServeService {
 		Set<Long> courseIdList = null;
 		ClassGroupTypeEnum teacherType;
 		Map<Integer,Integer> teacherCourseNumMap = null;
+		List<Integer> musicGroupStudentIdList = null;
         
         //理论上一个学生一个乐团只布置一次作业
 		for (Entry<String, List<Integer>> entry : musicGroupStudentIdListMap.entrySet()) {
 			
 			musicGroupId = entry.getKey();
 			
+			musicGroupStudentIdList = musicGroupStudentMap.get(musicGroupId);
+			
 			MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 			if(musicGroup == null || musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS){
 				continue;
@@ -477,6 +480,11 @@ public class StudentServeServiceImpl implements StudentServeService {
 			userCourseMap = musicGroupStudentCurrentWeekCourseMap.get(musicGroupId);
 			
 			for(Integer studentId : entry.getValue()){
+				
+				if(musicGroupStudentIdList == null || musicGroupStudentIdList.contains(studentId) == false){
+					continue;
+				}
+				
 				//在当前乐团,学生本周是否有课
 				if(userCourseMap == null || userCourseMap.get(studentId) == null){//如果本周没课
 					

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -106,7 +106,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	}
 
 	public void sendMessage(List<Integer> studentIds,CourseSchedule.CourseScheduleType type,String courseDate,MessageTypeEnum messageTypeEnum){
-		Map<Integer, String> receivers = studentIds.stream().collect(Collectors.toMap(e -> e, e -> e.toString()));
+		Map<Integer, String> receivers = studentIds.stream().collect(Collectors.toMap(e -> e, e -> e.toString(), (k1, k2) -> k1));
 		sendMessageSource.batchSendMessage(MessageSender.JIGUANG,messageTypeEnum,
 				receivers,null,"STUDENT",courseDate,type.getMsg());
 	}