فهرست منبع

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 سال پیش
والد
کامیت
fb92308625
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -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());