|
|
@@ -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) {
|
|
|
//冻结旗下所有民宿、账号
|