拷贝课程日志优化
This commit is contained in:
@@ -42,7 +42,6 @@ public class CopyLessonTask {
|
|||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 */1 * * * ?")
|
@Scheduled(cron = "0 */1 * * * ?")
|
||||||
public void execute(){
|
public void execute(){
|
||||||
logger.info("开始执行拷贝课程批处理");
|
|
||||||
LocalTime time = LocalTime.now();
|
LocalTime time = LocalTime.now();
|
||||||
LocalDate date = LocalDate.now();
|
LocalDate date = LocalDate.now();
|
||||||
logger.info(time.toString());
|
logger.info(time.toString());
|
||||||
@@ -55,13 +54,15 @@ public class CopyLessonTask {
|
|||||||
// 非篮球馆有课程
|
// 非篮球馆有课程
|
||||||
LocalTime copyTime = venue.getCopyTime();
|
LocalTime copyTime = venue.getCopyTime();
|
||||||
if (checkTime(time,copyTime)){
|
if (checkTime(time,copyTime)){
|
||||||
|
Integer id = venue.getId();
|
||||||
|
logger.info("开始执行拷贝课程" + id);
|
||||||
LocalDate startDate = date.plusDays(-7);
|
LocalDate startDate = date.plusDays(-7);
|
||||||
LocalDate endDate = date.plusDays(-1);
|
LocalDate endDate = date.plusDays(-1);
|
||||||
String startTime = dtf.format(startDate);
|
String startTime = dtf.format(startDate);
|
||||||
String endTime = dtf.format(endDate);
|
String endTime = dtf.format(endDate);
|
||||||
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime,venue.getId());
|
List<VenueLesson> allForCopy = venueLessonService.findAllForCopy(startTime, endTime, id);
|
||||||
if (allForCopy!= null && allForCopy.size()>0){
|
if (allForCopy!= null && allForCopy.size()>0){
|
||||||
logger.info("需要操作的课程数为:" + allForCopy.size());
|
logger.info(id + "需要操作的课程数为:" + allForCopy.size());
|
||||||
Integer copyTarget = venue.getCopyTarget();
|
Integer copyTarget = venue.getCopyTarget();
|
||||||
if (copyTarget == null){
|
if (copyTarget == null){
|
||||||
copyTarget = 1;
|
copyTarget = 1;
|
||||||
@@ -72,7 +73,7 @@ public class CopyLessonTask {
|
|||||||
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7 * copyTarget + 7);
|
Date copyDate = DateUtilCard.addDays(venueLesson.getDate(), 7 * copyTarget + 7);
|
||||||
venueLessonService.copyOneLesson(venueLesson.getId(),copyDate);
|
venueLessonService.copyOneLesson(venueLesson.getId(),copyDate);
|
||||||
}
|
}
|
||||||
logger.info("拷贝的课程数量为:" + count);
|
logger.info(id + "拷贝的课程数量为:" + count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user