|
@@ -171,8 +171,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
validEntityPlanBeforeSave(bo);
|
|
validEntityPlanBeforeSave(bo);
|
|
|
UserPlan userPlan = new UserPlan();
|
|
UserPlan userPlan = new UserPlan();
|
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
|
- c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long time=new Long((bo.getStartTime()*1000L));
|
|
|
|
|
+ String d = format.format(time);
|
|
|
|
|
+ Date date=format.parse(d);
|
|
|
|
|
+ c.setTime(date);
|
|
|
//设置为1号,当前日期既为本月第一天
|
|
//设置为1号,当前日期既为本月第一天
|
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
//将小时至0
|
|
//将小时至0
|
|
@@ -183,19 +186,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
c.set(Calendar.SECOND,0);
|
|
c.set(Calendar.SECOND,0);
|
|
|
//将毫秒至0
|
|
//将毫秒至0
|
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
|
-
|
|
|
|
|
Calendar c1 = Calendar.getInstance();
|
|
Calendar c1 = Calendar.getInstance();
|
|
|
- c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
|
|
+ SimpleDateFormat formatTwo = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long timeTwo=new Long(bo.getEndTime()*1000L);
|
|
|
|
|
+ String dTwo = format.format(timeTwo);
|
|
|
|
|
+ Date dateTwo=format.parse(dTwo);
|
|
|
|
|
+ c1.setTime(dateTwo);
|
|
|
//设置为当月最后一天
|
|
//设置为当月最后一天
|
|
|
- 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);
|
|
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c1.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ System.out.println(c.getTimeInMillis());
|
|
|
|
|
+ System.out.println(c1.getTimeInMillis());
|
|
|
|
|
|
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
Long secAll = 0L;
|
|
Long secAll = 0L;
|
|
@@ -304,8 +304,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
|
- c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long time=new Long((bo.getStartTime()*1000L));
|
|
|
|
|
+ String d = format.format(time);
|
|
|
|
|
+ Date date=format.parse(d);
|
|
|
|
|
+ c.setTime(date);
|
|
|
//设置为1号,当前日期既为本月第一天
|
|
//设置为1号,当前日期既为本月第一天
|
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
//将小时至0
|
|
//将小时至0
|
|
@@ -316,19 +319,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
c.set(Calendar.SECOND,0);
|
|
c.set(Calendar.SECOND,0);
|
|
|
//将毫秒至0
|
|
//将毫秒至0
|
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
|
-
|
|
|
|
|
Calendar c1 = Calendar.getInstance();
|
|
Calendar c1 = Calendar.getInstance();
|
|
|
- c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
|
|
+ SimpleDateFormat formatTwo = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long timeTwo=new Long(bo.getEndTime()*1000L);
|
|
|
|
|
+ String dTwo = format.format(timeTwo);
|
|
|
|
|
+ Date dateTwo=format.parse(dTwo);
|
|
|
|
|
+ c1.setTime(dateTwo);
|
|
|
//设置为当月最后一天
|
|
//设置为当月最后一天
|
|
|
- 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);
|
|
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c1.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ System.out.println(c.getTimeInMillis());
|
|
|
|
|
+ System.out.println(c1.getTimeInMillis());
|
|
|
|
|
|
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
Long secAll = 0L;
|
|
Long secAll = 0L;
|
|
@@ -451,8 +451,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
|
|
public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
|
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
UserPlanVo userPlanVo = new UserPlanVo();
|
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
|
- c.setTime(new Date(bo.getStartTime()*1000));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long time=new Long((bo.getStartTime()*1000L));
|
|
|
|
|
+ String d = format.format(time);
|
|
|
|
|
+ Date date=format.parse(d);
|
|
|
|
|
+ c.setTime(date);
|
|
|
//设置为1号,当前日期既为本月第一天
|
|
//设置为1号,当前日期既为本月第一天
|
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
//将小时至0
|
|
//将小时至0
|
|
@@ -463,19 +466,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
c.set(Calendar.SECOND,0);
|
|
c.set(Calendar.SECOND,0);
|
|
|
//将毫秒至0
|
|
//将毫秒至0
|
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
|
-
|
|
|
|
|
Calendar c1 = Calendar.getInstance();
|
|
Calendar c1 = Calendar.getInstance();
|
|
|
- c1.setTime(new Date(bo.getEndTime()*1000));
|
|
|
|
|
|
|
+ SimpleDateFormat formatTwo = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ Long timeTwo=new Long(bo.getEndTime()*1000L);
|
|
|
|
|
+ String dTwo = format.format(timeTwo);
|
|
|
|
|
+ Date dateTwo=format.parse(dTwo);
|
|
|
|
|
+ c1.setTime(dateTwo);
|
|
|
//设置为当月最后一天
|
|
//设置为当月最后一天
|
|
|
- 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);
|
|
|
|
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c1.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
|
+ System.out.println(c.getTimeInMillis());
|
|
|
|
|
+ System.out.println(c1.getTimeInMillis());
|
|
|
|
|
|
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
Long secAll = 0L;
|
|
Long secAll = 0L;
|
|
@@ -547,37 +547,6 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
return userPlanVo;
|
|
return userPlanVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void main(String[] args) throws ParseException {
|
|
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
|
|
- c.setTime(new Date(1641225600*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(1643817600*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);
|
|
|
|
|
- System.out.println(clCalendarStudyVos);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
//获得日历
|
|
//获得日历
|
|
|
public static List<CalendarStudyVo> findDates(Long dBegin, Long dEnd) throws ParseException, java.text.ParseException {
|
|
public static List<CalendarStudyVo> findDates(Long dBegin, Long dEnd) throws ParseException, java.text.ParseException {
|