|
|
@@ -81,11 +81,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 实体类转化成视图对象
|
|
|
- *
|
|
|
- * @param collection 实体类集合
|
|
|
- * @return
|
|
|
- */
|
|
|
+ * 实体类转化成视图对象
|
|
|
+ *
|
|
|
+ * @param collection 实体类集合
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private List<UserPlanVo> entity2Vo(Collection<UserPlan> collection) {
|
|
|
List<UserPlanVo> voList = collection.stream()
|
|
|
.map(any -> BeanUtil.toBean(any, UserPlanVo.class))
|
|
|
@@ -372,7 +372,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
|
|
|
userPlanVo.setCoursePlanVo(coursePlanVo);
|
|
|
- userPlanVos.add(userPlanVo);
|
|
|
+ userPlanVos.add(userPlanVo);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -571,11 +571,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
|
|
|
calendarStudyVos.stream().filter(c -> c.getMonth() == (cal.get(Calendar.MONTH)+1))
|
|
|
- .forEach(c -> {
|
|
|
- finalDayStudyVos.addAll(c.getDayStudyList().stream()
|
|
|
- .filter(v -> v.getDate() < 7 + cal.get(Calendar.DAY_OF_MONTH) && v.getDate() > cal.get(Calendar.DAY_OF_MONTH) - 7)
|
|
|
- .collect(Collectors.toList()));
|
|
|
- });
|
|
|
+ .forEach(c -> {
|
|
|
+ finalDayStudyVos.addAll(c.getDayStudyList().stream()
|
|
|
+ .filter(v -> v.getDate() < 7 + cal.get(Calendar.DAY_OF_MONTH) && v.getDate() > cal.get(Calendar.DAY_OF_MONTH) - 7)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+ });
|
|
|
switch (cal.get(Calendar.DAY_OF_WEEK)- 1){
|
|
|
case 0:
|
|
|
dayStudyVos=finalDayStudyVos.stream()
|
|
|
@@ -669,7 +669,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
userPlanVos.setCalendarStudyVo(calendarStudyVos);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
return userPlanVos;
|
|
|
}
|
|
|
|
|
|
@@ -711,7 +711,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
|
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
|
- Date date1 = new Date(bo.getExamDate()*1000L);
|
|
|
+ Date date1 = new Date(userPlan.getExamDate()*1000L);
|
|
|
//获得相隔天数
|
|
|
//得到学习的周
|
|
|
List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
|
|
|
@@ -721,6 +721,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
int dutyDays = getDutyDays(new Date(), date1,longs,7L);
|
|
|
|
|
|
//计算每天需要学习多少节课
|
|
|
+ int size = listMap.size();
|
|
|
|
|
|
int Sec = (int)Math.ceil((double)listMap.size()/dutyDays);
|
|
|
|
|
|
@@ -731,6 +732,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
|
|
|
|
//key和value都循环
|
|
|
+ listId = new ArrayList<>();
|
|
|
for(Map.Entry<Long,Long> entry : listMap.entrySet()) {
|
|
|
listId.add(entry.getKey());
|
|
|
}
|
|
|
@@ -739,6 +741,24 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
Integer month = 0;
|
|
|
+
|
|
|
+ for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
|
|
|
+ if (month < calendarStudyVo.getMonth()){
|
|
|
+ month = Convert.toInt(calendarStudyVo.getMonth());
|
|
|
+ }
|
|
|
+ for (DayStudyVo dayStudyVo : calendarStudyVo.getDayStudyList()) {
|
|
|
+ if (dayStudyVo.getDate() > Calendar.getInstance().get(Calendar.DAY_OF_MONTH) && calendarStudyVo.getMonth() == (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)) {
|
|
|
+ dayStudyVo.setStudyCourseKnob(0L);
|
|
|
+ dayStudyVo.setCourseDayMap(new HashMap<>());
|
|
|
+ dayStudyVo.setSectionIdMap(new HashMap<>());
|
|
|
+ }else if(calendarStudyVo.getMonth() > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
|
|
|
+ dayStudyVo.setStudyCourseKnob(0L);
|
|
|
+ dayStudyVo.setCourseDayMap(new HashMap<>());
|
|
|
+ dayStudyVo.setSectionIdMap(new HashMap<>());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//将原有的月份添加课程的节数
|
|
|
for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
|
|
|
if (month < calendarStudyVo.getMonth()){
|
|
|
@@ -779,7 +799,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
dayStudyVo.setSectionIdMap(sectionIdMap);
|
|
|
dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
}
|
|
|
- }else if(calendarStudyVo.getMonth() != (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
|
|
|
+ }else if(calendarStudyVo.getMonth() > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
|
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
|
|
|
|
|
|
@@ -879,7 +899,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
sectionNum = 0;
|
|
|
dayStudyVo.setPerform(0);
|
|
|
}
|
|
|
- }else if(month != (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
|
|
|
+ }else if(month > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
|
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
sectionNum = sectionNum-Sec;
|
|
|
@@ -1373,9 +1393,9 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
//获得当月
|
|
|
if (!CollectionUtils.isEmpty(calendarStudyVos) && calendarStudyVos.size() > 0){
|
|
|
for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
|
|
|
- if (month < calendarStudyVo.getMonth()){
|
|
|
- month = Convert.toInt(calendarStudyVo.getMonth()+1);
|
|
|
- }
|
|
|
+ if (month < calendarStudyVo.getMonth()){
|
|
|
+ month = Convert.toInt(calendarStudyVo.getMonth()+1);
|
|
|
+ }
|
|
|
}
|
|
|
}else {
|
|
|
month = cal.get(Calendar.MONTH) + 1;
|