|
@@ -15,16 +15,14 @@ import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -74,9 +72,15 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
|
|
}
|
|
}
|
|
if (count != 0) {
|
|
if (count != 0) {
|
|
Map<String, List<TeacherHomeworkListDto>> collect = dataList.stream().collect(Collectors.groupingBy(TeacherHomeworkListDto::getDay));
|
|
Map<String, List<TeacherHomeworkListDto>> collect = dataList.stream().collect(Collectors.groupingBy(TeacherHomeworkListDto::getDay));
|
|
- for (String key : collect.keySet()) {
|
|
|
|
|
|
+ List<Date> dates=new ArrayList<>();
|
|
|
|
+ collect.keySet().forEach(ds-> dates.add(DateUtil.stringToDate(ds,"yyyy-MM-dd")));
|
|
|
|
+ dates.sort(Comparator.comparing(Date::getTime));
|
|
|
|
+ dates.sort(Comparator.reverseOrder());
|
|
|
|
+ for (Date date : dates) {
|
|
|
|
+ String key=DateUtil.dateToString(date, "yyyy-MM-dd");
|
|
Map<String, Object> r = new HashMap<>();
|
|
Map<String, Object> r = new HashMap<>();
|
|
r.put("day", key);
|
|
r.put("day", key);
|
|
|
|
+ collect.get(key).sort(Comparator.comparing(TeacherHomeworkListDto::getStartClassTime).reversed());
|
|
r.put("list", collect.get(key));
|
|
r.put("list", collect.get(key));
|
|
result.add(r);
|
|
result.add(r);
|
|
}
|
|
}
|