Browse Source

定时任务自动拒单

lijie 2 years ago
parent
commit
bad5104e45
1 changed files with 7 additions and 5 deletions
  1. 7 5
      mhotel/src/com/happy/service/impl/BookImplService.java

+ 7 - 5
mhotel/src/com/happy/service/impl/BookImplService.java

@@ -10,6 +10,7 @@ import com.happy.Until.Func;
 import com.happy.Until.HttpUtils;
 import com.happy.Until.HttpUtils;
 import com.happy.Until.UUIDUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.dao.BookDao;
 import com.happy.dao.BookDao;
+import com.happy.dao.HotelDictDao;
 import com.happy.dto.BookTypeEto;
 import com.happy.dto.BookTypeEto;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.service.*;
 import com.happy.service.*;
@@ -32,6 +33,9 @@ public class BookImplService implements BookService {
 
 
     @Resource
     @Resource
     public BookDao bookDao;
     public BookDao bookDao;
+
+    @Resource
+    public HotelDictDao hotelDictDao;
     @Resource
     @Resource
     public BookinglogService bookinglogService;
     public BookinglogService bookinglogService;
 
 
@@ -180,7 +184,7 @@ public class BookImplService implements BookService {
 
 
     @Override
     @Override
     public int updateBookStatus() {
     public int updateBookStatus() {
-        HotelDict respTime = hotelDictService.getById(1000011001);//响应时间 状态1为10分、2为20分、3为30分
+        HotelDict respTime = hotelDictService.getById(1000011001);//响应时间
         HotelDict operate = hotelDictService.getById(1000011002);//响应时间 1自动接单 2自动拒单
         HotelDict operate = hotelDictService.getById(1000011002);//响应时间 1自动接单 2自动拒单
         String sqlx = " and create_time <= DATE_SUB(NOW(), INTERVAL " + respTime.getName() + " MINUTE) and order_status = 2 ";
         String sqlx = " and create_time <= DATE_SUB(NOW(), INTERVAL " + respTime.getName() + " MINUTE) and order_status = 2 ";
         List<Booking> bookings = bookDao.queryList(sqlx);
         List<Booking> bookings = bookDao.queryList(sqlx);
@@ -251,14 +255,12 @@ public class BookImplService implements BookService {
             });
             });
             return n.get();
             return n.get();
         }else {
         }else {
-            String ip = request.getServerName();
-            ip += "/mhotel/abkchargeback.action";
-            String finalIp = ip;
+            HotelDict dict = hotelDictDao.getById(1000011999);
             bookings.forEach(booking -> {
             bookings.forEach(booking -> {
                 Map<String, String> params = new HashMap<>();
                 Map<String, String> params = new HashMap<>();
                 params.put("bookingId", String.valueOf(booking.getId()));
                 params.put("bookingId", String.valueOf(booking.getId()));
                 try {
                 try {
-                    String msg = HttpUtils.post(finalIp, params);
+                    String msg = HttpUtils.post(dict.getFileUrl(), params);
                 } catch (IOException e) {
                 } catch (IOException e) {
                     throw new RuntimeException(e);
                     throw new RuntimeException(e);
                 }
                 }