Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/saas' into saas

zouxuan 3 gadi atpakaļ
vecāks
revīzija
b6ac703be5

+ 21 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -2168,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())) {

+ 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){//如果本周没课