From 21ee583563d59d9d04840f65cb0053df9b183554 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期一, 30 十月 2023 10:08:50 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- 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