Browse Source

新增民宿商家时添加一条酒店信息

lijie 2 years ago
parent
commit
b3743f53f2
1 changed files with 8 additions and 1 deletions
  1. 8 1
      mhotel/src/com/happy/action/adminManagerAction.java

+ 8 - 1
mhotel/src/com/happy/action/adminManagerAction.java

@@ -187,7 +187,14 @@ public class adminManagerAction extends ActionSupport implements ServletRequestA
                 }
                 }
             }
             }
             int m = adminManagerService.insertAdmin(admin);
             int m = adminManagerService.insertAdmin(admin);
-            if (m > 0) {
+            //region 往hotel表中插入一条数据关联admin_manager
+            Hotel hotel = new Hotel();
+            hotel.setManagerId(admin.getManagerId());
+            hotel.setHotel_name(admin.getHotelName());
+            hotel.setStatus(1);
+            int i = hotelService.insertHotel(hotel);
+            //endregion
+            if (m > 0 && i > 0) {
                 resultJson.put("message", "添加成功");
                 resultJson.put("message", "添加成功");
                 resultJson.put("code", 200);
                 resultJson.put("code", 200);
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());