|
@@ -150,6 +150,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
userPlan.setStudyNum(0L);
|
|
userPlan.setStudyNum(0L);
|
|
|
userPlan.setCreateTime(DateUtils.getNowTime());
|
|
userPlan.setCreateTime(DateUtils.getNowTime());
|
|
|
userPlan.setUpdateTime(DateUtils.getNowTime());
|
|
userPlan.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ userPlan.setExamDate(userPlanVo.getExamDate());
|
|
|
if (bo.getStatus() != null){
|
|
if (bo.getStatus() != null){
|
|
|
userPlan.setStatus(bo.getStatus());
|
|
userPlan.setStatus(bo.getStatus());
|
|
|
}
|
|
}
|
|
@@ -229,7 +230,9 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
userPlanVo.setStudyNum(userPlan.getStudyNum());
|
|
|
userPlanVo.setPlanId(userPlan.getPlanId());
|
|
userPlanVo.setPlanId(userPlan.getPlanId());
|
|
|
|
|
|
|
|
|
|
+ //得到日历日期
|
|
|
List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
|
|
List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
|
|
|
|
|
+ //得到
|
|
|
List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
|
|
List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
|
|
|
Long[] strings = new Long[cont.size()];
|
|
Long[] strings = new Long[cont.size()];
|
|
|
cont.toArray(strings);
|
|
cont.toArray(strings);
|
|
@@ -291,6 +294,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
if (bo.getStatus() == 2) {
|
|
if (bo.getStatus() == 2) {
|
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
|
|
|
+ userPlan.setStatus(1);
|
|
|
boolean save = this.updateById(userPlan);
|
|
boolean save = this.updateById(userPlan);
|
|
|
LambdaQueryWrapper<UserPlanCource> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<UserPlanCource> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(bo.getPlanId() != null,UserPlanCource::getPlanId,bo.getPlanId());
|
|
lqw.eq(bo.getPlanId() != null,UserPlanCource::getPlanId,bo.getPlanId());
|
|
@@ -333,6 +337,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
if (bo.getStatus() == 2) {
|
|
if (bo.getStatus() == 2) {
|
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
userPlan.setPlanId(bo.getPlanId());
|
|
|
|
|
+ userPlan.setStatus(1);
|
|
|
boolean save = this.updateById(userPlan);
|
|
boolean save = this.updateById(userPlan);
|
|
|
LambdaQueryWrapper<UserPlanCource> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<UserPlanCource> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(bo.getPlanId() != null,UserPlanCource::getPlanId,bo.getPlanId());
|
|
lqw.eq(bo.getPlanId() != null,UserPlanCource::getPlanId,bo.getPlanId());
|
|
@@ -397,21 +402,37 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
if (Sec < sectionNum) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum)+dayStudyVo.getStudyCourseKnob());
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum)+dayStudyVo.getStudyCourseKnob());
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ 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) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
|
|
|
- sectionNum = sectionNum-Sec;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
|
|
+
|
|
|
|
|
+ sectionNum = sectionNum-Sec;
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum)+dayStudyVo.getStudyCourseKnob());
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum)+dayStudyVo.getStudyCourseKnob());
|
|
|
- sectionNum = 0;
|
|
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
|
|
+
|
|
|
|
|
+ sectionNum = 0;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -437,9 +458,21 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
if (Sec < sectionNum) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ if (courseDayMap == null) {
|
|
|
|
|
+ courseDayMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ if (courseDayMap == null) {
|
|
|
|
|
+ courseDayMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}
|
|
}
|
|
@@ -447,9 +480,21 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
if (Sec < sectionNum) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ if (courseDayMap == null) {
|
|
|
|
|
+ courseDayMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
|
|
+ Map<Long, Long> courseDayMap = dayStudyVo.getCourseDayMap();
|
|
|
|
|
+ if (courseDayMap == null) {
|
|
|
|
|
+ courseDayMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ courseDayMap.put(planVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(courseDayMap);
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}
|
|
}
|
|
@@ -524,20 +569,32 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
if (Sec < sectionNum) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
dayStudyVo.setPerform(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) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -569,7 +626,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
//获得当前课程最近一个考试计划 考生考生计划或者最近考试计划
|
|
//获得当前课程最近一个考试计划 考生考生计划或者最近考试计划
|
|
|
CoursePlanVo coursePlanVo = baseMapper.selectByCourse(bo);
|
|
CoursePlanVo coursePlanVo = baseMapper.selectByCourse(bo);
|
|
|
ExamArrangementTimeVo examArrangementTimeVo = baseMapper.selectByExam(coursePlanVo.getCategoryId());
|
|
ExamArrangementTimeVo examArrangementTimeVo = baseMapper.selectByExam(coursePlanVo.getCategoryId());
|
|
|
-
|
|
|
|
|
|
|
+ userPlanVo.setExamDate(examArrangementTimeVo.getStartTime());
|
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
|
Date date1 = new Date(examArrangementTimeVo.getStartTime()*1000L);
|
|
Date date1 = new Date(examArrangementTimeVo.getStartTime()*1000L);
|
|
|
//获得相隔天数
|
|
//获得相隔天数
|
|
@@ -612,17 +669,33 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
if (Sec < sectionNum) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setPerform(0);
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
|
|
+ dayStudyVo.setPerform(0);
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
sectionNum = 0;
|
|
sectionNum = 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) {
|
|
if (Sec < sectionNum) {
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setPerform(0);
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
sectionNum = sectionNum-Sec;
|
|
sectionNum = sectionNum-Sec;
|
|
|
}else if (Sec >= sectionNum){
|
|
}else if (Sec >= sectionNum){
|
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
|
|
|
|
|
+ dayStudyVo.setPerform(0);
|
|
|
|
|
+ Map<Long,Long> studyDstudyVo = new HashMap<Long, Long>();
|
|
|
|
|
+ studyDstudyVo.put(coursePlanVo.getCourseId(),Convert.toLong(Sec));
|
|
|
|
|
+ dayStudyVo.setCourseDayMap(studyDstudyVo);
|
|
|
sectionNum = 0;
|
|
sectionNum = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|