|
|
@@ -339,7 +339,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
@Override
|
|
|
public List<CourseListVo> getAdjustList1(String classId,String teacherId, String adjustDate,String timeNumber,String applicantTeacherId, String exchangeDate, String adjustType) {
|
|
|
CourseTableAdjustDto1 dto = new CourseTableAdjustDto1();
|
|
|
- if (exchangeDate != null && !"".equals(exchangeDate)) {
|
|
|
+ if (exchangeDate != null && !exchangeDate.isEmpty()) {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
LocalDate localDateTime = LocalDate.parse(exchangeDate, formatter);
|
|
|
DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
|
|
|
@@ -347,7 +347,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
dto.setWeek(dayOfWeek.getValue());
|
|
|
}
|
|
|
|
|
|
- if (adjustDate != null && !"".equals(adjustDate)) {
|
|
|
+ if (adjustDate != null && !adjustDate.isEmpty()) {
|
|
|
dto.setAdjustDate(adjustDate);
|
|
|
}
|
|
|
|
|
|
@@ -356,12 +356,12 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
List<String> timeNumbers = timeNumber == null ? Collections.emptyList() : Arrays.asList(timeNumber.split(","));
|
|
|
dto.setTimeNumbers(timeNumbers);
|
|
|
|
|
|
- if (applicantTeacherId != null && !"".equals(applicantTeacherId)) {
|
|
|
+ if (applicantTeacherId != null && !applicantTeacherId.isEmpty()) {
|
|
|
dto.setApplicantTeacherId(Long.parseLong(applicantTeacherId));
|
|
|
}
|
|
|
|
|
|
dto.setClassId(classId);
|
|
|
- if (teacherId != null && !"".equals(teacherId)) {
|
|
|
+ if (teacherId != null && !teacherId.isEmpty()) {
|
|
|
dto.setTeacherId(Long.parseLong(teacherId));
|
|
|
}
|
|
|
dto.setAdjustType(adjustType);
|
|
|
@@ -369,6 +369,21 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
List<Long> courseIds = courseTableMapper.getExceptCourseIds(dto.getApplicantTeacherId());
|
|
|
dto.setExceptCourseList(courseIds);
|
|
|
List<CourseListVo> list = courseTableMapper.getAdjustList1(dto);
|
|
|
+
|
|
|
+ if(!list.isEmpty()) {
|
|
|
+ List<String> idList = list.stream()
|
|
|
+ .map(CourseListVo::getTimeNumber)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ dto.setTimeNumbers(idList);
|
|
|
+ List<CourseListVo> excludeList = courseTableMapper.getAdjustList2(dto);
|
|
|
+
|
|
|
+ list = list.stream()
|
|
|
+ .filter(vo -> excludeList.stream()
|
|
|
+ .noneMatch(ex -> ex.getTimeNumber().equals(vo.getTimeNumber()))
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
for (CourseListVo courseListVo : list) {
|
|
|
if (courseListVo.getTimePeriod() == 1) {
|
|
|
courseListVo.setTimePeriodCn("上午");
|