Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mhotel/src/com/happy/dao/impl/BookImplDao.java
Administrator 2 years ago
parent
commit
5eb106f09a

BIN
mhotel/WebRoot/download/订单信息Report.xls


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

@@ -23,6 +23,7 @@ public class Booking {
   private String hotelPhone; // 民宿联系电话
   private String hotelPerson; // 民宿联系人
   private String hotelTownship; // 民宿所属乡镇
+  private String hotelTownshipName; // 民宿所属乡镇
   private String hotelConfig; // 民宿配置
   private List hotelConfigList; // 民宿配置列表
   private String hotelType; // 民宿类型
@@ -178,6 +179,13 @@ public class Booking {
     this.hotelTownship = hotelTownship;
   }
 
+  public String getHotelTownshipName() {
+    return hotelTownshipName;
+  }
+
+  public void setHotelTownshipName(String hotelTownshipName) {
+    this.hotelTownshipName = hotelTownshipName;
+  }
 
   public String getHotelConfig() {
     return hotelConfig;

+ 6 - 3
mhotel/src/com/happy/action/bookAction.java

@@ -156,7 +156,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
                 //推送信息
                 if(!"".equals(sendMsg)){
                     String errmsg = Message.wxErrorMsg(Message.send(user.getOpenid(),book.getOrderNum(),book.getUserName(),sendMsg,book.getCreateTime().substring(0,10)));
-                    if("请求成功 ".equals(errmsg)){
+                    if("请求成功".equals(errmsg)){
                         resultJson.put("message", msg+"成功");
                         resultJson.put("code", 200);
                         ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
@@ -167,7 +167,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
                     ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                     return null;
                 }
-
+                resultJson.put("message", msg+"成功");
+                resultJson.put("code", 500);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                return null;
             } else {
                 resultJson.put("message", msg+"失败");
                 resultJson.put("code", 502);
@@ -315,7 +318,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
                     .append(" and pay_time <= '").append(payEndTime).append("'");
         }
         if(hotelTownship!=null){
-            s1.append(" and hotel_township = '").append(payStartTime).append("'");
+            s1.append(" and hotel_township = '").append(hotelTownship).append("'");
         }
         if(minTotalPrice!=null){
             s1.append(" and house_total_price >= '").append(minTotalPrice).append("'");

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

@@ -101,7 +101,8 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
 //                return null;
 //            }
             StringBuilder getOneSqlx = new StringBuilder("");
-            getOneSqlx.append(" and h_name = '").append(house.gethName()).append("'");
+            getOneSqlx.append(" and h_name = '").append(house.gethName()).append("'")
+                    .append(" and manager_id = '").append(house.getManagerId()).append("'");
             House listc = houseService.getOen(getOneSqlx.toString());
             if (listc != null) {
                 resultJson.put("message", "房型已存在");
@@ -182,6 +183,7 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
 //            }
             StringBuilder getOneSqlx = new StringBuilder("");
             getOneSqlx.append(" and h_name = '").append(house.gethName()).append("'");
+            getOneSqlx.append(" and manager_id = '").append(house.getManagerId()).append("'");
             getOneSqlx.append(" and id != '").append(house.getId()).append("'");
             House listc = houseService.getOen(getOneSqlx.toString());
             if (listc != null) {
@@ -294,7 +296,7 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
         if (hName!=null){
             s1.append(" and h_name like '%").append(hName).append("%'");
         }
-        if (hName!=null){
+        if (managerId!=null){
             s1.append(" and manager_id = '").append(managerId).append("'");
         }
         IPage<House> houseIPage = houseService.queryPage(s1.toString(),page,rows);

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

@@ -182,7 +182,7 @@ public class BookImplDao implements BookDao {
     @Override
     public List<Booking> queryPage(String sqlx, int page, int rows) {
         int start = (page - 1) * rows;// 每页的起始下标
-        String sql = "SELECT * FROM `booking` WHERE is_delete=1 "+sqlx+" ORDER BY create_time DESC limit :start,:rows ";
+        String sql = "SELECT a.*,b.name hotel_township_name FROM booking a left join hotel_dict b on a.hotel_township = b.id WHERE is_delete=1 "+sqlx+" ORDER BY create_time DESC limit :start,:rows ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("start", start);
         sps.addValue("rows", rows);

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

@@ -43,7 +43,7 @@ public class IDCImplDao implements IDCDao {
 
     @Override
     public List<IDCHotelEto> getHotelData() {
-        String sql = "select hposition,count(1) hotelNum from hotel group by hposition order by count(1) DESC";
+        String sql = "select c.name hposition,count(1) hotelNum from hotel a left join admin_manager b on a.manager_id=b.id left join hotel_dict c on c.id = b.hotel_township  group by c.id order by count(1) DESC";
         List<IDCHotelEto> list = null;
         try{
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCHotelEto.class));