Browse Source

feat:首页

Joburgess 4 years ago
parent
commit
e644425734

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

@@ -1035,7 +1035,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		Map<Long, PracticeGroupType> practiceGroupTypeMap = new HashMap<>();
         if(!CollectionUtils.isEmpty(practiceGroupIds)){
 			List<PracticeCourseDto> practiceGroups = practiceGroupDao.getPracticeGroupByIds(new ArrayList<>(practiceGroupIds));
-//			practiceGroups.stream().collect(Collectors.toM)
+			practiceGroupTypeMap = practiceGroups.stream().collect(Collectors.toMap(PracticeCourseDto::getId, PracticeCourseDto::getType));
 		}
 
         for (CourseScheduleDto courseScheduleDto : studentCourseSchedulesWithDate) {
@@ -1050,6 +1050,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             courseScheduleDto.setSubjectId(subjectIdCourseMap.get(courseScheduleDto.getId().intValue()));
 			courseScheduleDto.setReviewId(reviewIdMap.get(courseScheduleDto.getId().intValue()));
 			courseScheduleDto.setStudentReviewId(StudentReviewIdMap.get(courseScheduleDto.getId()));
+			if(CourseScheduleType.PRACTICE.equals(courseScheduleDto.getType())){
+				courseScheduleDto.setPracticeGroupType(practiceGroupTypeMap.get(Long.valueOf(courseScheduleDto.getMusicGroupId())));
+			}
         }
         result.put("list", studentCourseSchedulesWithDate);
         return result;

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -527,6 +527,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             }else if(student.getCarePackage().equals(2)){
                 return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "该学员已使用关心包排课资格");
             }
+            student.setCarePackage(2);
             courseTimes = 4;
         }else if(PracticeGroupType.COME_ON_PACKAGE.equals(practiceGroupBuyParams.getType())){
             if(Objects.isNull(student.getComeOnPackage())||student.getComeOnPackage().equals(0)){
@@ -534,8 +535,10 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             }else if(student.getComeOnPackage().equals(2)){
                 return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "该学员已使用加油包排课资格");
             }
+            student.setComeOnPackage(2);
             courseTimes = 8;
         }
+        studentDao.update(student);
 
         if(courseTimes<=0){
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "课程信息错误");

+ 8 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDate;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -113,7 +114,13 @@ public class EduPracticeGroupController extends BaseController {
             Map<Integer, List<String>> weekNumApplyTimesMap = (Map<Integer, List<String>>) payPracticeTeacherFreeTimes.get("teacherFreeDays");
             for (Map.Entry<Integer, List<String>> weekNumApplyTimesMapEntry : weekNumApplyTimesMap.entrySet()) {
                 DateTimeFormatter dtf = DateTimeFormatter.ofPattern("HH:mm:ss");
-                for (String timeStr : weekNumApplyTimesMapEntry.getValue()) {
+                Iterator<String> iterator = weekNumApplyTimesMapEntry.getValue().iterator();
+                while (iterator.hasNext()){
+                    String timeStr = iterator.next();
+                    if("23:30:00".equals(timeStr)){
+                        weekNumApplyTimesMapEntry.getValue().remove(timeStr);
+                        continue;
+                    }
                     LocalTime time = LocalTime.parse(timeStr, dtf);
                     LocalTime nextTime = time.plusMinutes(30);
                     if(weekNumApplyTimesMapEntry.getValue().contains(nextTime.format(DateUtil.timeFormatter))){