Browse Source

修改bug

raojiaolong@163.com 2 years ago
parent
commit
affde055ed

+ 7 - 5
mhotel/src/com/happy/action/adminAction.java

@@ -186,11 +186,13 @@ public class adminAction extends ActionSupport implements ServletRequestAware {
 //                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
 //                return null;
 //            }
-            if (admin.getPassword()!=null && !"".equals(admin.getPassword()) && !PwdDefind.vertify(admin.getPassword())){
-                resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
-                resultJson.put("code", 500);
-                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
-                return null;
+            if(admin.getPassword()!=null && !"".equals(admin.getPassword())){
+                if (!PwdDefind.vertify(admin.getPassword())){
+                    resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
+                    resultJson.put("code", 500);
+                    ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                    return null;
+                }
             }
             StringBuilder getOneSqlx = new StringBuilder("");
             getOneSqlx.append(" and admin_name = '").append(admin.getAdminName()).append("'")

+ 7 - 5
mhotel/src/com/happy/action/adminManagerAction.java

@@ -239,11 +239,13 @@ public class adminManagerAction extends ActionSupport implements ServletRequestA
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 return null;
             }
-            if (!PwdDefind.vertify(admin.getPassword())){
-                resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
-                resultJson.put("code", 500);
-                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
-                return null;
+            if(admin.getPassword()!=null && !"".equals(admin.getPassword())){
+                if (!PwdDefind.vertify(admin.getPassword())){
+                    resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
+                    resultJson.put("code", 500);
+                    ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                    return null;
+                }
             }
             StringBuilder getOneSqlx = new StringBuilder("");
             getOneSqlx.append(" and admin_name = '").append(admin.getAdminName()).append("'");

+ 4 - 0
mhotel/src/com/happy/action/hotelAction.java

@@ -37,6 +37,9 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
     public HotelDictService hotelDictService;
 
     @Resource
+    public HouseService houseService;
+
+    @Resource
     public FileService fileService;
 
     public Integer id;
@@ -176,6 +179,7 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
             if(hotel.getHconfig() != null && !"".equals(hotel.getHconfig())){
                 hotel.setHconfig(hotelDictService.setConfig(hotel.getHconfig()));
             }
+            hotel.setRoomNumber(houseService.getHouseSum(managerId));
             hotel.sethTypeName(hotelDictService.getDictNameById(Integer.parseInt(hotel.getHtype())));
             BeanUtils.copyProperties(hotel,hotelEto);
             hotelEto.setHotelTownshipName(adminManager.getHotelTownshipName());

+ 4 - 3
mhotel/src/com/happy/action/houseAction.java

@@ -321,16 +321,17 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
     public String queryPageHouseSum(){
         JSONObject resultJson = new JSONObject();
         StringBuilder s1 = new StringBuilder("");
+        StringBuilder s2 = new StringBuilder("");
         if (orderTime!=null){
             s1.append("  and DATE_FORMAT(order_start_time,'%Y-%m-%d') = '").append(orderTime).append("'");
         }
         if (hName!=null){
-            s1.append("  and house_name like '%").append(hName).append("%'");
+            s2.append("  and a.h_name like '%").append(hName).append("%'");
         }
         if (managerId!=null){
-            s1.append("  and hotel_manager_id = '").append(managerId).append("'");
+            s2.append("  and a.manager_id = '").append(managerId).append("'");
         }
-        IPage<HouseSumEto> houseIPage = houseService.queryPageHouseSum(s1.toString(),page,rows);
+        IPage<HouseSumEto> houseIPage = houseService.queryPageHouseSum(s1.toString(),s2.toString(),page,rows);
         if(houseIPage!=null && !"".equals(houseIPage)){
             resultJson.put("message", "查询分页成功");
             resultJson.put("code", 200);

+ 13 - 4
mhotel/src/com/happy/dao/HouseDao.java

@@ -62,18 +62,27 @@ public interface HouseDao {
 
     /**
      * 描述:分页查询房源
-     * @param sqlx
+     * @param sqlx1
+     * @param sqlx2
      * @param page
      * @param rows
      * @return
      */
-    List<HouseSumEto> queryPageHouseSum(String sqlx, int page, int rows);
+    List<HouseSumEto> queryPageHouseSum(String sqlx1,String sqlx2, int page, int rows);
 
     /**
      * 描述:获取房源总数
-     * @param sqlx
+     * @param sqlx1
+     * @param sqlx2
+     * @return
+     */
+    int queryPageHouseSumTotal(String sqlx1,String sqlx2);
+
+    /**
+     * 描述:获取房型数量
+     * @param managerId
      * @return
      */
-    int queryPageHouseSumTotal(String sqlx);
+    int getHouseSum(int managerId);
 
 }

File diff suppressed because it is too large
+ 14 - 5
mhotel/src/com/happy/dao/impl/HouseImplDao.java


+ 10 - 2
mhotel/src/com/happy/service/HouseService.java

@@ -62,10 +62,18 @@ public interface HouseService {
 
     /**
      * 描述:分页查询房源
-     * @param sqlx
+     * @param sqlx1
+     * @param sqlx2
      * @param page
      * @param rows
      * @return
      */
-    IPage<HouseSumEto> queryPageHouseSum(String sqlx, int page, int rows);
+    IPage<HouseSumEto> queryPageHouseSum(String sqlx1,String sqlx2, int page, int rows);
+
+    /**
+     * 描述:获取房型数量
+     * @param managerId
+     * @return
+     */
+    int getHouseSum(int managerId);
 }

+ 8 - 3
mhotel/src/com/happy/service/impl/HouseImplService.java

@@ -65,10 +65,10 @@ public class HouseImplService implements HouseService {
     }
 
     @Override
-    public IPage<HouseSumEto> queryPageHouseSum(String sqlx, int page, int rows){
+    public IPage<HouseSumEto> queryPageHouseSum(String sqlx1,String sqlx2, int page, int rows){
         IPage<HouseSumEto> iPage = new IPage();
-        List<HouseSumEto> houseList = houseDao.queryPageHouseSum(sqlx,page,rows);
-        int total = houseDao.queryPageHouseSumTotal(sqlx);
+        List<HouseSumEto> houseList = houseDao.queryPageHouseSum(sqlx1,sqlx2,page,rows);
+        int total = houseDao.queryPageHouseSumTotal(sqlx1,sqlx2);
         iPage.setPageList(houseList);
         iPage.setPage(page);
         iPage.setTotalPage( (int)Math.ceil((double)total/rows));
@@ -76,4 +76,9 @@ public class HouseImplService implements HouseService {
         iPage.setTotal(total);
         return iPage;
     }
+
+    @Override
+    public int getHouseSum(int managerId) {
+        return houseDao.getHouseSum(managerId);
+    }
 }