| | |
| | | */ |
| | | //预约场地后,待支付的订单 时间超过30分钟,不保留 |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute(){ |
| | | public void taskMinute() { |
| | | try { |
| | | List<SiteBooking> siteBookings = siteBookingMapper. |
| | | selectList(new LambdaQueryWrapper<SiteBooking>().eq(SiteBooking::getStatus, 0)); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | long time = siteBooking.getInsertTime().getTime(); |
| | | long l = time + 1800 * 1000; |
| | | if(System.currentTimeMillis()>l){ |
| | | if (System.currentTimeMillis() > l) { |
| | | siteBooking.setStatus(5); |
| | | siteBookingMapper.deleteById(siteBooking.getId()); |
| | | } |
| | |
| | | |
| | | //预约场地后,时间超过endTime,状态变为已过期 |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute1(){ |
| | | 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); |
| | | } |
| | | long time = siteBooking.getEndTime().getTime(); |
| | | if (System.currentTimeMillis() > time) { |
| | | siteBooking.setStatus(4); |
| | | siteBookingMapper.updateById(siteBooking); |
| | | } |
| | | } |
| | | //定时修改赛事状态 |
| | | } catch (Exception e) { |
| | |
| | | |
| | | // 预约场地后,待支付的订单 时间超过30分钟,不保留 |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute3(){ |
| | | public void taskMinute3() { |
| | | try { |
| | | // 获取待核销状态的记录 |
| | | List<SiteBooking> siteBookings = siteBookingMapper.selectList(new LambdaQueryWrapper<SiteBooking>() |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |