| | |
| | | */ |
| | | @Override |
| | | public List<QuerySiteTimes> querySiteTimes(Integer id, String day,String halfName,String siteName) throws Exception { |
| | | // Site site = this.getById(id); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | // Calendar s = Calendar.getInstance(); |
| | | // s.setTime(sdf.parse(day + " " + site.getAppointmentStartTime())); |
| | | // Calendar e = Calendar.getInstance(); |
| | | // e.setTime(sdf.parse(day + " " + site.getAppointmentEndTime())); |
| | | // |
| | | // int hour = e.get(Calendar.HOUR_OF_DAY); |
| | | // |
| | | // int minute = e.get(Calendar.MINUTE); |
| | | // |
| | | // List<QuerySiteTimes> list = new ArrayList<>(); |
| | | // |
| | | // SimpleDateFormat sdfs = new SimpleDateFormat("HH:mm"); |
| | | // |
| | | // while (true){ |
| | | // |
| | | // String start = sdfs.format(s.getTime()); |
| | | // |
| | | // s.set(Calendar.MINUTE, s.get(Calendar.MINUTE) + 30); |
| | | // |
| | | // int e_hour = s.get(Calendar.HOUR_OF_DAY); |
| | | // |
| | | // int e_minute = s.get(Calendar.MINUTE); |
| | | // |
| | | // String end = sdfs.format(s.getTime()); |
| | | // |
| | | // QuerySiteTimes querySiteTimes = new QuerySiteTimes(); |
| | | // |
| | | // querySiteTimes.setTime(start + "-" + end); |
| | | // |
| | | // querySiteTimes.setSelectable(1); |
| | | // |
| | | // SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>().eq("siteId", id).eq("state", 1) |
| | | // .in("status", Arrays.asList(3, 4, 5)).last(" and DATE_FORMAT(startTime, '%Y-%m-%d %H:%i') <= '" + day + " " + start + "' and DATE_FORMAT(endTime, '%Y-%m-%d %H:%i') >= '" + day + " " + end + "'")); |
| | | // if(null != siteBooking){ |
| | | // querySiteTimes.setSelectable(0); |
| | | // } |
| | | // int count = siteLockService.count(new QueryWrapper<SiteLock>().eq("siteId", id).last(" and DATE_FORMAT(startTime, '%Y-%m-%d %H:%i') <= '" + day + " " + start + "' and DATE_FORMAT(endTime, '%Y-%m-%d %H:%i') >= '" + day + " " + end + "'")); |
| | | // if(count > 0){ |
| | | // querySiteTimes.setSelectable(0); |
| | | // } |
| | | // |
| | | // list.add(querySiteTimes); |
| | | // |
| | | // if(e_hour == hour && minute == e_minute){ |
| | | // break; |
| | | // } |
| | | // } |
| | | // return list; |
| | | |
| | | System.out.println("=======date======"+day); |
| | | |