From f8c9479d2f33515376e5c0d87734edec2e15ad6f Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期三, 15 十一月 2023 09:31:27 +0800 Subject: [PATCH] 后台bug修改 --- cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java b/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java index 7eeb104..b294a0c 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java +++ b/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java @@ -34,6 +34,7 @@ if(System.currentTimeMillis()>l){ siteBooking.setStatus(5); siteBookingMapper.updateById(siteBooking); + } } //定时修改赛事状态 @@ -41,4 +42,27 @@ e.printStackTrace(); } } + + + + //预约场地后,时间超过endTime,状态变为已过期 + @Scheduled(fixedRate = 60000) + public void taskMinute1(){ + try { + List<SiteBooking> siteBookings = siteBookingMapper.selectList(new LambdaQueryWrapper<SiteBooking>().eq(SiteBooking::getStatus, 1)); + for (SiteBooking siteBooking : siteBookings) { + long time = siteBooking.getEndTime().getTime(); + if (System.currentTimeMillis() > time) { + siteBooking.setStatus(4); + siteBookingMapper.updateById(siteBooking); + } + + } + //定时修改赛事状态 + } catch (Exception e) { + e.printStackTrace(); + } + } + + } -- Gitblit v1.7.1