Browse Source

bug修改

夏文涛 2 years ago
parent
commit
722734e244

+ 7 - 0
mhotel/src/com/happy/action/HouseNumberStatusAction.java

@@ -156,6 +156,13 @@ public class HouseNumberStatusAction extends BaseController implements ModelDriv
      */
      */
     @SneakyThrows
     @SneakyThrows
     public void modifyStatus() {
     public void modifyStatus() {
+        if(houseNumberStatusDto.getCloseType() == null){
+            ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
+                put("message", "关房类型不能为空");
+                put("code", 500);
+            }}.toString());
+        }
+
         houseNumberStatusService.modifyStatus(houseNumberStatusDto);
         houseNumberStatusService.modifyStatus(houseNumberStatusDto);
         ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
         ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
             put("message", "请求成功");
             put("message", "请求成功");

+ 1 - 1
mhotel/src/com/happy/dao/impl/HouseNumberImplDao.java

@@ -104,7 +104,7 @@ public class HouseNumberImplDao implements HouseNumberDao {
         String sql = "select `id`,`house_id`,`number_name`,`create_id`,`create_date`,`modify_date`from\n" +
         String sql = "select `id`,`house_id`,`number_name`,`create_id`,`create_date`,`modify_date`from\n" +
                      "(select * from house_number where house_id = :house_id and status != 0) a\n" +
                      "(select * from house_number where house_id = :house_id and status != 0) a\n" +
                      "where not exists\n" +
                      "where not exists\n" +
-                     "(select number_id from house_number_status where DATE_FORMAT(set_date,'%Y-%m-%d') >= :order_start_time and DATE_FORMAT(set_date,'%Y-%m-%d') <= :order_end_time and booking_id != :booking_id and `status` >1 and number_id = a.id group by number_id)" +
+                     "(select number_id from house_number_status where DATE_FORMAT(set_date,'%Y-%m-%d') >= :order_start_time and DATE_FORMAT(set_date,'%Y-%m-%d') <= :order_end_time and (booking_id != :booking_id or booking_id is null) and close_type >= 1 and status != 0 and number_id = a.id group by number_id)" +
                      "order by number_name asc";
                      "order by number_name asc";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("house_id", book.getHouseId());
         sps.addValue("house_id", book.getHouseId());