|
@@ -54,12 +54,14 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
|
|
|
if(StringUtils.isBlank(exercises.getContent())){
|
|
|
throw new BizException("请填写内容");
|
|
|
}
|
|
|
- if(Objects.isNull(exercises.getExpireDate())){
|
|
|
- throw new BizException("请指定截至日期");
|
|
|
- }
|
|
|
if(StringUtils.isBlank(exercises.getStudentIdList())){
|
|
|
throw new BizException("请指定学生");
|
|
|
}
|
|
|
+ if(Objects.isNull(exercises.getExpireDate())){
|
|
|
+ LocalDateTime localDateTime=LocalDateTime.now();
|
|
|
+ localDateTime=localDateTime.plusDays(2).withHour(21).withMinute(0).withSecond(0);
|
|
|
+ exercises.setExpireDate(Date.from(localDateTime.atZone(DateUtil.zoneId).toInstant()));
|
|
|
+ }
|
|
|
List<Integer> studentIds = Arrays.asList(exercises.getStudentIdList().split(",")).stream().mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
|
exercises.setBatchNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
|
|
exercises.setExpectNum(studentIds.size());
|