|
|
@@ -203,39 +203,44 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public UserPlanVo userPlan(UserPlanQueryBo bo) {
|
|
|
- UserPlan userPlan = baseMapper.selectByUserPlan(bo);
|
|
|
- UserPlanVo userPlanVo = new UserPlanVo();
|
|
|
- userPlanVo.setUserId(userPlan.getUserId());
|
|
|
- userPlanVo.setExamDate(userPlan.getExamDate());
|
|
|
- userPlanVo.setReminderTime(userPlan.getReminderTime());
|
|
|
- userPlanVo.setStudyDay(userPlan.getStudyDay());
|
|
|
- userPlanVo.setStartTime(userPlan.getStartTime());
|
|
|
- userPlanVo.setEndTime(userPlan.getEndTime());
|
|
|
- userPlanVo.setPitchNum(userPlan.getPitchNum());
|
|
|
- userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
|
- userPlanVo.setPlanId(userPlan.getPlanId());
|
|
|
-
|
|
|
- List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
|
|
|
- List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
|
|
|
- Long[] strings = new Long[cont.size()];
|
|
|
- cont.toArray(strings);
|
|
|
- userPlanVo.setCalendarStudyVo(calendarStudyVos);
|
|
|
- userPlanVo.setStudyCount(strings);
|
|
|
- userPlanVo.setCoursePlanVo(null);
|
|
|
- List<UserPlanCource> userPlanClsList = baseMapper.selectCourse(userPlan.getPlanId());
|
|
|
-
|
|
|
- //初始化需要得到的数组
|
|
|
- Integer[] array = new Integer[userPlanClsList.size()];
|
|
|
-
|
|
|
- //使用for循环得到数组
|
|
|
- for(int i = 0; i < userPlanClsList.size();i++){
|
|
|
- array[i] = Convert.toInt(userPlanClsList.get(i).getSourceId());
|
|
|
+ public List<UserPlanVo> userPlan(UserPlanQueryBo bo) {
|
|
|
+ List<UserPlan> userPlans = baseMapper.selectByUserPlan(bo);
|
|
|
+ List<UserPlanVo> userPlanVos = new ArrayList<>();
|
|
|
+ for (UserPlan userPlan : userPlans) {
|
|
|
+ UserPlanVo userPlanVo = new UserPlanVo();
|
|
|
+ userPlanVo.setUserId(userPlan.getUserId());
|
|
|
+ userPlanVo.setExamDate(userPlan.getExamDate());
|
|
|
+ userPlanVo.setReminderTime(userPlan.getReminderTime());
|
|
|
+ userPlanVo.setStudyDay(userPlan.getStudyDay());
|
|
|
+ userPlanVo.setStartTime(userPlan.getStartTime());
|
|
|
+ userPlanVo.setEndTime(userPlan.getEndTime());
|
|
|
+ userPlanVo.setPitchNum(userPlan.getPitchNum());
|
|
|
+ userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
|
+ userPlanVo.setPlanId(userPlan.getPlanId());
|
|
|
+
|
|
|
+ List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
|
|
|
+ List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
|
|
|
+ Long[] strings = new Long[cont.size()];
|
|
|
+ cont.toArray(strings);
|
|
|
+ userPlanVo.setCalendarStudyVo(calendarStudyVos);
|
|
|
+ userPlanVo.setStudyCount(strings);
|
|
|
+ userPlanVo.setCoursePlanVo(null);
|
|
|
+ List<UserPlanCource> userPlanClsList = baseMapper.selectCourse(userPlan.getPlanId());
|
|
|
+
|
|
|
+ //初始化需要得到的数组
|
|
|
+ Integer[] array = new Integer[userPlanClsList.size()];
|
|
|
+
|
|
|
+ //使用for循环得到数组
|
|
|
+ for(int i = 0; i < userPlanClsList.size();i++){
|
|
|
+ array[i] = Convert.toInt(userPlanClsList.get(i).getSourceId());
|
|
|
+ }
|
|
|
+ bo.setCourseId(array);
|
|
|
+ List<CoursePlanVo> coursePlanVo = baseMapper.selectByListCourse(bo);
|
|
|
+ userPlanVo.setCoursePlanVo(coursePlanVo);
|
|
|
+ userPlanVos.add(userPlanVo);
|
|
|
}
|
|
|
- bo.setCourseId(array);
|
|
|
- List<CoursePlanVo> coursePlanVo = baseMapper.selectByListCourse(bo);
|
|
|
- userPlanVo.setCoursePlanVo(coursePlanVo);
|
|
|
- return userPlanVo;
|
|
|
+
|
|
|
+ return userPlanVos;
|
|
|
}
|
|
|
|
|
|
@Override
|