|
@@ -166,34 +166,79 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
public Boolean insertByAddBo(UserPlanAddBo bo) throws ParseException {
|
|
public Boolean insertByAddBo(UserPlanAddBo bo) throws ParseException {
|
|
|
validEntityPlanBeforeSave(bo);
|
|
validEntityPlanBeforeSave(bo);
|
|
|
UserPlan userPlan = new UserPlan();
|
|
UserPlan userPlan = new UserPlan();
|
|
|
- List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
|
|
|
|
|
- Long sumUp=0L;
|
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
+
|
|
|
|
|
+ //设置为1号,当前日期既为本月第一天
|
|
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ //将小时至0
|
|
|
|
|
+ c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ //将分钟至0
|
|
|
|
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
|
|
+ //将秒至0
|
|
|
|
|
+ c.set(Calendar.SECOND,0);
|
|
|
|
|
+ //将毫秒至0
|
|
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+
|
|
|
|
|
+ Calendar c1 = Calendar.getInstance();
|
|
|
|
|
+ c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
+ //设置为当月最后一天
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ //将小时至23
|
|
|
|
|
+ c1.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
|
|
+ //将分钟至59
|
|
|
|
|
+ c1.set(Calendar.MINUTE, 59);
|
|
|
|
|
+ //将秒至59
|
|
|
|
|
+ c1.set(Calendar.SECOND,59);
|
|
|
|
|
+ //将毫秒至999
|
|
|
|
|
+ c1.set(Calendar.MILLISECOND, 999);
|
|
|
|
|
+
|
|
|
|
|
+ List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
|
|
+ Long secAll = 0L;
|
|
|
|
|
+ Long sumUp = 0L;
|
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
|
Date date1 = new Date(bo.getEndTime() * 1000L);
|
|
Date date1 = new Date(bo.getEndTime() * 1000L);
|
|
|
//获得相隔天数
|
|
//获得相隔天数
|
|
|
int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
|
|
int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
|
|
|
-
|
|
|
|
|
|
|
+ if (dutyDays < 1){
|
|
|
|
|
+ throw new IllegalArgumentException("没有学习天数,请认真填写开始结束时间");
|
|
|
|
|
+ }
|
|
|
List<Long> seLongs = baseMapper.selectGoods(aLong);
|
|
List<Long> seLongs = baseMapper.selectGoods(aLong);
|
|
|
Long allNum = 0L;
|
|
Long allNum = 0L;
|
|
|
for (Long seLong : seLongs) {
|
|
for (Long seLong : seLongs) {
|
|
|
allNum += seLong;
|
|
allNum += seLong;
|
|
|
}
|
|
}
|
|
|
- sumUp += allNum;
|
|
|
|
|
|
|
+ sumUp = allNum;
|
|
|
//计算每天需要学习多少节课
|
|
//计算每天需要学习多少节课
|
|
|
int Sec = (int) Math.ceil((double) allNum / dutyDays);
|
|
int Sec = (int) Math.ceil((double) allNum / dutyDays);
|
|
|
|
|
+ secAll+=Sec;
|
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
|
- if (allNum.equals(0)){
|
|
|
|
|
|
|
+ if (allNum < 0){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- allNum -= Sec;
|
|
|
|
|
|
|
+ Calendar c5 = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()));
|
|
|
|
|
+ if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
|
- dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
|
|
|
|
|
+ } else{
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
+ }
|
|
|
}else {
|
|
}else {
|
|
|
- dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(allNum);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
@@ -201,10 +246,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
|
daySectionVo.setGoodsId(aLong);
|
|
daySectionVo.setGoodsId(aLong);
|
|
|
- daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
|
|
|
|
|
+ } else{
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
daySectionVo.setGoodsPerform(0);
|
|
daySectionVo.setGoodsPerform(0);
|
|
|
daySectionList.add(daySectionVo);
|
|
daySectionList.add(daySectionVo);
|
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
|
|
|
+ allNum -= Sec;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -248,34 +299,79 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
this.updateById(userPlan);
|
|
this.updateById(userPlan);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
- List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
|
|
|
|
|
- Long sumUp=0L;
|
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
+
|
|
|
|
|
+ //设置为1号,当前日期既为本月第一天
|
|
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ //将小时至0
|
|
|
|
|
+ c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ //将分钟至0
|
|
|
|
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
|
|
+ //将秒至0
|
|
|
|
|
+ c.set(Calendar.SECOND,0);
|
|
|
|
|
+ //将毫秒至0
|
|
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+
|
|
|
|
|
+ Calendar c1 = Calendar.getInstance();
|
|
|
|
|
+ c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
+ //设置为当月最后一天
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ //将小时至23
|
|
|
|
|
+ c1.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
|
|
+ //将分钟至59
|
|
|
|
|
+ c1.set(Calendar.MINUTE, 59);
|
|
|
|
|
+ //将秒至59
|
|
|
|
|
+ c1.set(Calendar.SECOND,59);
|
|
|
|
|
+ //将毫秒至999
|
|
|
|
|
+ c1.set(Calendar.MILLISECOND, 999);
|
|
|
|
|
+
|
|
|
|
|
+ List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
|
|
+ Long secAll = 0L;
|
|
|
|
|
+ Long sumUp = 0L;
|
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
|
Date date1 = new Date(bo.getEndTime() * 1000L);
|
|
Date date1 = new Date(bo.getEndTime() * 1000L);
|
|
|
//获得相隔天数
|
|
//获得相隔天数
|
|
|
int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
|
|
int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
|
|
|
-
|
|
|
|
|
|
|
+ if (dutyDays < 1){
|
|
|
|
|
+ throw new IllegalArgumentException("没有学习天数,请认真填写开始结束时间");
|
|
|
|
|
+ }
|
|
|
List<Long> seLongs = baseMapper.selectGoods(aLong);
|
|
List<Long> seLongs = baseMapper.selectGoods(aLong);
|
|
|
Long allNum = 0L;
|
|
Long allNum = 0L;
|
|
|
for (Long seLong : seLongs) {
|
|
for (Long seLong : seLongs) {
|
|
|
allNum += seLong;
|
|
allNum += seLong;
|
|
|
}
|
|
}
|
|
|
- sumUp += allNum;
|
|
|
|
|
|
|
+ sumUp = allNum;
|
|
|
//计算每天需要学习多少节课
|
|
//计算每天需要学习多少节课
|
|
|
int Sec = (int) Math.ceil((double) allNum / dutyDays);
|
|
int Sec = (int) Math.ceil((double) allNum / dutyDays);
|
|
|
|
|
+ secAll+=Sec;
|
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
|
- if (allNum.equals(0)){
|
|
|
|
|
|
|
+ if (allNum < 0){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- allNum -= Sec;
|
|
|
|
|
|
|
+ Calendar c5 = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()));
|
|
|
|
|
+ if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
|
- dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
|
|
|
|
|
+ } else{
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
+ }
|
|
|
}else {
|
|
}else {
|
|
|
- dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(allNum);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
@@ -283,10 +379,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
|
daySectionVo.setGoodsId(aLong);
|
|
daySectionVo.setGoodsId(aLong);
|
|
|
- daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
|
|
|
|
|
+ } else{
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
daySectionVo.setGoodsPerform(0);
|
|
daySectionVo.setGoodsPerform(0);
|
|
|
daySectionList.add(daySectionVo);
|
|
daySectionList.add(daySectionVo);
|
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
|
|
|
+ allNum -= Sec;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -344,7 +446,34 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
@Override
|
|
@Override
|
|
|
public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
|
|
public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
|
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
|
- List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
|
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
+
|
|
|
|
|
+ //设置为1号,当前日期既为本月第一天
|
|
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ //将小时至0
|
|
|
|
|
+ c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ //将分钟至0
|
|
|
|
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
|
|
+ //将秒至0
|
|
|
|
|
+ c.set(Calendar.SECOND,0);
|
|
|
|
|
+ //将毫秒至0
|
|
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
+
|
|
|
|
|
+ Calendar c1 = Calendar.getInstance();
|
|
|
|
|
+ c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
+ //设置为当月最后一天
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ //将小时至23
|
|
|
|
|
+ c1.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
|
|
+ //将分钟至59
|
|
|
|
|
+ c1.set(Calendar.MINUTE, 59);
|
|
|
|
|
+ //将秒至59
|
|
|
|
|
+ c1.set(Calendar.SECOND,59);
|
|
|
|
|
+ //将毫秒至999
|
|
|
|
|
+ c1.set(Calendar.MILLISECOND, 999);
|
|
|
|
|
+
|
|
|
|
|
+ List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
Long secAll = 0L;
|
|
Long secAll = 0L;
|
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
for (Long aLong : bo.getGoodsId()) {
|
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
//最近考试时间七天前到现在的天数,学习视频时长
|
|
@@ -365,15 +494,29 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
|
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
|
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
|
|
|
- if (allNum.equals(0)){
|
|
|
|
|
|
|
+ if (allNum < 0){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- allNum -= Sec;
|
|
|
|
|
|
|
+ Calendar c5 = Calendar.getInstance();
|
|
|
|
|
+ c.setTime(new Date(bo.getStartTime()));
|
|
|
|
|
+ if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
if (dayStudyVo.getStudyCourseKnob() != null) {
|
|
|
- dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
|
|
|
|
|
+ } else{
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
|
|
|
|
|
+ }
|
|
|
}else {
|
|
}else {
|
|
|
- dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(allNum);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
dayStudyVo.setPerform(0);
|
|
dayStudyVo.setPerform(0);
|
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
List<DaySectionVo> daySectionList = new ArrayList<>();
|
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
|
|
@@ -381,10 +524,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
}
|
|
}
|
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
DaySectionVo daySectionVo = new DaySectionVo();
|
|
|
daySectionVo.setGoodsId(aLong);
|
|
daySectionVo.setGoodsId(aLong);
|
|
|
- daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
|
|
+ if (allNum < Sec) {
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
|
|
|
|
|
+ } else{
|
|
|
|
|
+ daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
daySectionVo.setGoodsPerform(0);
|
|
daySectionVo.setGoodsPerform(0);
|
|
|
daySectionList.add(daySectionVo);
|
|
daySectionList.add(daySectionVo);
|
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
dayStudyVo.setDaySectionList(daySectionList);
|
|
|
|
|
+ allNum -= Sec;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -420,8 +569,6 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
List<DayStudyVo> dayStudyList = new ArrayList<>();
|
|
List<DayStudyVo> dayStudyList = new ArrayList<>();
|
|
|
// 每次循环给calBegin日期加一天,直到calBegin.getTime()时间等于dEnd
|
|
// 每次循环给calBegin日期加一天,直到calBegin.getTime()时间等于dEnd
|
|
|
while (format.parse(dEndS).after(calBegin.getTime())) {
|
|
while (format.parse(dEndS).after(calBegin.getTime())) {
|
|
|
- // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
|
|
|
|
|
- calBegin.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
if (calendarStudyVo.getMonth() == null){
|
|
if (calendarStudyVo.getMonth() == null){
|
|
|
calendarStudyVo.setMonth(Convert.toLong(calBegin.get(java.util.Calendar.MONTH)+1));
|
|
calendarStudyVo.setMonth(Convert.toLong(calBegin.get(java.util.Calendar.MONTH)+1));
|
|
|
calendarStudyVo.setYear(Convert.toLong(calBegin.get(java.util.Calendar.YEAR)));
|
|
calendarStudyVo.setYear(Convert.toLong(calBegin.get(java.util.Calendar.YEAR)));
|
|
@@ -438,10 +585,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
dayStudyVo.setDate(Convert.toLong(calBegin.get(Calendar.DATE)));
|
|
dayStudyVo.setDate(Convert.toLong(calBegin.get(Calendar.DATE)));
|
|
|
dayStudyVo.setStudyDay(Convert.toLong(calBegin.get(Calendar.DAY_OF_WEEK)-1));
|
|
dayStudyVo.setStudyDay(Convert.toLong(calBegin.get(Calendar.DAY_OF_WEEK)-1));
|
|
|
dayStudyList.add(dayStudyVo);
|
|
dayStudyList.add(dayStudyVo);
|
|
|
|
|
+ // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
|
|
|
|
|
+ calBegin.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
}
|
|
}
|
|
|
calendarStudyVo.setDayStudyList(dayStudyList);
|
|
calendarStudyVo.setDayStudyList(dayStudyList);
|
|
|
Datelist.add(calendarStudyVo);
|
|
Datelist.add(calendarStudyVo);
|
|
|
- System.out.println(Datelist);
|
|
|
|
|
return Datelist;
|
|
return Datelist;
|
|
|
}
|
|
}
|
|
|
|
|
|