|
|
@@ -845,16 +845,29 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
|
public void setBookStatus(){
|
|
|
|
|
|
+ System.out.println("自动接单定时程序");
|
|
|
+
|
|
|
HotelDict respTime = hotelDictService.getById(1000011001);//响应时间
|
|
|
+
|
|
|
+ System.out.println("自动接单定时程序1");
|
|
|
+
|
|
|
HotelDict operate = hotelDictService.getById(1000011002);//响应时间 1自动接单 2自动拒单
|
|
|
+
|
|
|
+ System.out.println("自动接单定时程序2");
|
|
|
+
|
|
|
String sqlx = " and create_time <= DATE_SUB(NOW(), INTERVAL " + respTime.getName() + " MINUTE) and order_status = 2 and hotel_is_order = 1";
|
|
|
List<Booking> bookings = bookService.queryList(sqlx);
|
|
|
|
|
|
- System.out.println("自动接单,订单编号"+bookings.stream().map(Booking::getOrderNum)+";拼接条件:"+sqlx);
|
|
|
+ System.out.println("自动接单定时程序3:"+sqlx);
|
|
|
+
|
|
|
+ String result =bookings == null ? "" : bookings.stream().map(Booking::getOrderNum).collect(Collectors.joining());
|
|
|
+
|
|
|
+ System.out.println("自动接单,订单编号:"+result+";拼接条件:"+sqlx);
|
|
|
|
|
|
AtomicInteger n = new AtomicInteger();
|
|
|
if ("1".equals(operate.getName())){
|
|
|
- bookings.forEach(booking -> {
|
|
|
+
|
|
|
+ for (Booking booking:bookings) {
|
|
|
List<HouseNumberStatus> list = new ArrayList<>();
|
|
|
//不可入住的房间
|
|
|
List<HouseNumber> houseNumbers = houseNumberService.queryHouseStatus(booking);
|
|
|
@@ -916,7 +929,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
booking.setUpdateTime(UUIDUtil.getNewDate());
|
|
|
bookService.updateBooking(booking);
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}else {
|
|
|
HotelDict dict = hotelDictService.getById(1000011999);
|
|
|
bookings.forEach(booking -> {
|