ソースを参照

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mhotel/src/com/happy/dao/impl/BookImplDao.java
Administrator 2 年 前
コミット
43dfac08cf

+ 9 - 0
mhotel/src/com/happy/Model/Booking.java

@@ -57,6 +57,7 @@ public class Booking {
   private String checkOutTime; // 离店时间
   private String remake; // 备注信息
   private int isDelete; // 是否假删除:0删除,1正常
+  private String liveTime;//入住时间
 
   private String lockTime; // 锁定时间
 
@@ -479,4 +480,12 @@ public class Booking {
   public void setHotelIsCheckout(String hotelIsCheckout) {
     this.hotelIsCheckout = hotelIsCheckout;
   }
+
+  public String getLiveTime() {
+    return liveTime;
+  }
+
+  public void setLiveTime(String liveTime) {
+    this.liveTime = liveTime;
+  }
 }

+ 1 - 0
mhotel/src/com/happy/action/AppMePageAction.java

@@ -119,6 +119,7 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
         // 通过用户id查询所有订单列表数据
 
         StringBuilder querySql = new StringBuilder("");
+        querySql.append(" and is_delete = 1");
         if (!Func.checkNull(userId)){
             querySql.append(" and create_userid = '").append(userId).append("' ");
         }

+ 14 - 4
mhotel/src/com/happy/action/adminManagerAction.java

@@ -10,10 +10,7 @@ import com.happy.Until.PwdDefind;
 import com.happy.Until.ResUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.dto.IPage;
-import com.happy.service.AdminManagerService;
-import com.happy.service.AdminService;
-import com.happy.service.FileService;
-import com.happy.service.HotelService;
+import com.happy.service.*;
 import com.opensymphony.xwork2.ActionSupport;
 import net.sf.json.JSONObject;
 import org.apache.struts2.ServletActionContext;
@@ -40,6 +37,9 @@ public class adminManagerAction extends ActionSupport implements ServletRequestA
     public HotelService hotelService;
 
     @Resource
+    public BookService bookService;
+
+    @Resource
     public FileService fileService;
 
     public String adminName;
@@ -443,6 +443,16 @@ public class adminManagerAction extends ActionSupport implements ServletRequestA
             return null;
         }
         AdminManager admin = adminManagerService.getById(id);
+        StringBuilder booksql = new StringBuilder("");
+        booksql.append(" and hotel_manager_id = '").append(admin.getManagerId()).append("'");
+        booksql.append(" and order_status in (1,2,3,4,10) ");
+        List<Booking> bookingList = bookService.queryList(booksql.toString());
+        if(bookingList!=null && bookingList.size()>0){
+            resultJson.put("message", "该民宿存在未完成的订单,禁止删除");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
         int m = adminManagerService.delAdmin(id);
         if (m > 0) {
             //冻结旗下所有民宿、账号

+ 2 - 0
mhotel/src/com/happy/action/bookAction.java

@@ -123,6 +123,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
                         return null;
                     }
                     book.setOrderStatus("4");
+                    book.setLiveTime(UUIDUtil.getNewDate());
                     book.setUpdateTime(UUIDUtil.getNewDate());
                     msg = "入住办理";
                     break;
@@ -193,6 +194,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
     public String quearyBookPage(){
         JSONObject resultJson = new JSONObject();
         StringBuilder s1 = new StringBuilder("");
+        //s1.append(" and is_delete = 1");
         if(managerId!=null){
             s1.append(" and hotel_manager_id = '").append(managerId).append("'");
         }

ファイルの差分が大きいため隠しています
+ 5 - 6
mhotel/src/com/happy/dao/impl/BookImplDao.java