|
@@ -43,11 +43,28 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
|
|
|
@Override
|
|
|
public UserPlanVo queryById(Long planId){
|
|
|
- UserPlan db = this.baseMapper.selectById(planId);
|
|
|
- UserPlanVo userPlanVo = BeanUtil.toBean(db, UserPlanVo.class);
|
|
|
+ UserPlan userPlan = this.baseMapper.selectById(planId);
|
|
|
//得到日历日期
|
|
|
- List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlanVo.getSchedule(), CalendarStudyVo.class);
|
|
|
+ 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);
|
|
|
return userPlanVo;
|
|
|
}
|
|
|
|
|
@@ -65,11 +82,30 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
lqw.in(bo.getStatus() != null, UserPlan::getStatus, bo.getStatus());
|
|
|
lqw.eq(bo.getPitchNum() != null, UserPlan::getPitchNum, bo.getPitchNum());
|
|
|
lqw.eq(bo.getStudyNum() != null, UserPlan::getStudyNum, bo.getStudyNum());
|
|
|
- List<UserPlanVo> userPlanVos = entity2Vo(this.list(lqw));
|
|
|
- for (UserPlanVo userPlanVo : userPlanVos) {
|
|
|
+ List<UserPlan> userPlans = this.list(lqw);
|
|
|
+ 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(userPlanVo.getSchedule(), CalendarStudyVo.class);
|
|
|
+ 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);
|
|
|
+ userPlanVos.add(userPlanVo);
|
|
|
}
|
|
|
|
|
|
return userPlanVos;
|