|
|
@@ -2105,11 +2105,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
@Override
|
|
|
public List<ExamSessionVo> getExamSession(Integer month) {
|
|
|
//根据月份筛选
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- public static void main(String[] args) {
|
|
|
- String dateStr = "202306"; // 指定年月
|
|
|
+ String dateStr = String.format("20230%s",month); // 指定年月
|
|
|
LocalDate date = LocalDate.parse(dateStr + "01", DateTimeFormatter.BASIC_ISO_DATE);
|
|
|
LocalDate dateFirst = date.with(TemporalAdjusters.firstDayOfMonth()); // 指定年月的第一天
|
|
|
LocalDate dateEnd = date.with(TemporalAdjusters.lastDayOfMonth()); // 指定年月的最后一天
|
|
|
@@ -2117,10 +2113,34 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
Date date1 = Date.from(zonedDateTime1.toInstant());
|
|
|
ZonedDateTime zonedDateTime = dateEnd.atStartOfDay(ZoneId.systemDefault());
|
|
|
Date date2 = Date.from(zonedDateTime.toInstant());
|
|
|
- System.out.println("dateFirst = " + date1.getTime());
|
|
|
- System.out.println("dateEnd = " + date2.getTime());
|
|
|
+ Long startTime = date1.getTime()/1000;
|
|
|
+ Long endTime = (date2.getTime()/1000) + 86400;
|
|
|
+
|
|
|
+ List<ExamApplySiteTime> siteTimes = iExamApplySiteTimeService
|
|
|
+ .list(new LambdaQueryWrapper<ExamApplySiteTime>()
|
|
|
+ .ge(ExamApplySiteTime::getExamTime, startTime)
|
|
|
+ .le(ExamApplySiteTime::getExamTime, endTime));
|
|
|
+ if (CollectionUtils.isEmpty(siteTimes)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ return siteTimes.stream().map(item -> {
|
|
|
+ ExamSessionVo vo = new ExamSessionVo();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("MM月dd号");
|
|
|
+ String format = sdf.format(new Date(item.getExamTime() * 1000));
|
|
|
+ List<ExamApplySiteTimeTwoAddBo> siteTimeTwoAddBos = JSONArray.parseArray(item.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
|
|
|
+ ExamApplySiteTimeTwoAddBo twoAddBo = siteTimeTwoAddBos.get(0);
|
|
|
+ vo.setExamSession(String.format("%s(%s-%s)",format,twoAddBo.getStartTime(),twoAddBo.getEndTime()));
|
|
|
+ vo.setExamTime(item.getExamTime());
|
|
|
+ vo.setExamStartTime(twoAddBo.getStartTime());
|
|
|
+ vo.setExamEndTime(twoAddBo.getEndTime());
|
|
|
+
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private Integer getSeatNumber(UserSubscribeAddBo bo,Long userNum) {
|
|
|
List<UserSubscribe> list = list(new LambdaQueryWrapper<UserSubscribe>().eq(UserSubscribe::getApplyId, bo.getApplyId())
|
|
|
.eq(UserSubscribe::getApplySiteStartTime, bo.getApplySiteStartTime())
|