Browse Source

投诉列表/投诉详细/评价列表/评价详细/评价回复

lijie 2 years ago
parent
commit
f936596150

+ 21 - 137
mhotel/src/com/happy/Model/BookingComment.java

@@ -1,16 +1,30 @@
 package com.happy.Model;
 package com.happy.Model;
 
 
 
 
+import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 
+import java.util.List;
+
+@Data
 @Builder
 @Builder
+@NoArgsConstructor
+@AllArgsConstructor
 public class BookingComment {
 public class BookingComment {
     //    主键
     //    主键
-    private Integer id;
+    private String id;
 
 
     //    回复评论id
     //    回复评论id
     private String commentId;
     private String commentId;
 
 
+    //    回复主评论id
+    private String commentParentId;
+
+    //    回复主评论人姓名
+    private String commentName;
+
     //    评论订单id
     //    评论订单id
     private String bookingId;
     private String bookingId;
 
 
@@ -42,7 +56,10 @@ public class BookingComment {
     private Double scoreWz;
     private Double scoreWz;
 
 
     //    创建人
     //    创建人
-    private Integer createId;
+    private String createId;
+
+    //    评价人
+    private String createName;
 
 
     private String createUsername;
     private String createUsername;
 
 
@@ -55,140 +72,7 @@ public class BookingComment {
     //    状态(0删除 1正常)
     //    状态(0删除 1正常)
     private String status;
     private String status;
 
 
+    //    下级评论回复
+    private List<BookingComment> lowCommentList;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getCommentId() {
-        return commentId;
-    }
-
-    public void setCommentId(String commentId) {
-        this.commentId = commentId;
-    }
-
-    public String getBookingId() {
-        return bookingId;
-    }
-
-    public void setBookingId(String bookingId) {
-        this.bookingId = bookingId;
-    }
-
-    public String getHotelId() {
-        return hotelId;
-    }
-
-    public void setHotelId(String hotelId) {
-        this.hotelId = hotelId;
-    }
-
-    public String getHouseId() {
-        return houseId;
-    }
-
-    public void setHouseId(String houseId) {
-        this.houseId = houseId;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public String getCommentStatus() {
-        return commentStatus;
-    }
-
-    public void setCommentStatus(String commentStatus) {
-        this.commentStatus = commentStatus;
-    }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-    }
-
-    public Double getScoreWs() {
-        return scoreWs;
-    }
-
-    public void setScoreWs(Double scoreWs) {
-        this.scoreWs = scoreWs;
-    }
-
-    public Double getScoreFw() {
-        return scoreFw;
-    }
-
-    public void setScoreFw(Double scoreFw) {
-        this.scoreFw = scoreFw;
-    }
-
-    public Double getScoreSs() {
-        return scoreSs;
-    }
-
-    public void setScoreSs(Double scoreSs) {
-        this.scoreSs = scoreSs;
-    }
-
-    public Double getScoreWz() {
-        return scoreWz;
-    }
-
-    public void setScoreWz(Double scoreWz) {
-        this.scoreWz = scoreWz;
-    }
-
-    public Integer getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(Integer createId) {
-        this.createId = createId;
-    }
-
-    public String getCreateUsername() {
-        return createUsername;
-    }
-
-    public void setCreateUsername(String createUsername) {
-        this.createUsername = createUsername;
-    }
-
-    public String getCreateDate() {
-        return createDate;
-    }
-
-    public void setCreateDate(String createDate) {
-        this.createDate = createDate;
-    }
-
-    public String getModifyDate() {
-        return modifyDate;
-    }
-
-    public void setModifyDate(String modifyDate) {
-        this.modifyDate = modifyDate;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
 }
 }

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

@@ -2,6 +2,8 @@ package com.happy.Model;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
+import java.util.List;
+
 @Data
 @Data
 public class BookingComplaint {
 public class BookingComplaint {
 
 
@@ -24,4 +26,10 @@ public class BookingComplaint {
     private String modifyDate;//修改时间
     private String modifyDate;//修改时间
 
 
     private String status;//状态(0删除 1.处理中 2.已处理)
     private String status;//状态(0删除 1.处理中 2.已处理)
+
+    private String houseName; //房型名称
+
+    private String hotelName; //酒店名称名称
+
+    List<FileInfo> fileInfos;// 附件
 }
 }

+ 1 - 2
mhotel/src/com/happy/action/AppBookingCommentAction.java

@@ -221,14 +221,13 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
         BookingComment bookingComment = BookingComment.builder().bookingId(bookingId)
         BookingComment bookingComment = BookingComment.builder().bookingId(bookingId)
                 .hotelId(hotelId).houseId(houseId).content(content)
                 .hotelId(hotelId).houseId(houseId).content(content)
                 .score(score).scoreWs(scoreWs).scoreFw(scoreFw)
                 .score(score).scoreWs(scoreWs).scoreFw(scoreFw)
-                .scoreSs(scoreSs).scoreWz(scoreWz).createId(createId)
+                .scoreSs(scoreSs).scoreWz(scoreWz).createId(String.valueOf(createId))
                 .createUsername(createUsername).createDate(createDate)
                 .createUsername(createUsername).createDate(createDate)
                 .modifyDate(modifyDate).build();
                 .modifyDate(modifyDate).build();
 
 
 
 
         int a = bookingCommentService.orderRate(bookingComment,pictureList);
         int a = bookingCommentService.orderRate(bookingComment,pictureList);
 
 
-
         if (a>0) {
         if (a>0) {
             jsonObject.put("code", 200);
             jsonObject.put("code", 200);
             jsonObject.put("message", "添加成功");
             jsonObject.put("message", "添加成功");

+ 170 - 0
mhotel/src/com/happy/action/bookCommentAction.java

@@ -0,0 +1,170 @@
+package com.happy.action;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.happy.Model.BookingComment;
+import com.happy.Model.House;
+import com.happy.Until.GetHttpParam;
+import com.happy.Until.ResUtil;
+import com.happy.common.controller.BaseController;
+import com.happy.dto.BookCommentDto;
+import com.happy.dto.IPage;
+import com.happy.service.BookingCommentService;
+import com.happy.service.BookingComplaintService;
+import net.sf.json.JSONObject;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.interceptor.ServletRequestAware;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+public class bookCommentAction extends BaseController implements ServletRequestAware {
+    public String keywords;//关键字搜索
+
+    public String score; //评分
+
+    public Integer bookId; //关联订单id
+
+    public String commentStartTime;//起始时间
+
+    public String commentEndTime;//结束时间
+
+    public String checkoutStartTime;//退房起始时间
+    public String checkoutEndTime;//退房起始时间
+
+    @Resource(name = "BookingCommentService")
+    private BookingCommentService bookingCommentService;
+
+    public String queryPage(){
+        JSONObject resultJson = new JSONObject();
+        StringBuilder s1 = new StringBuilder("");
+        StringBuilder s2 = new StringBuilder("");
+        if (keywords != null){
+            s1.append(" and (a.id like '%").append(keywords).append("%'");
+//            s1.append(" or a.comment_name like '%").append(keywords).append("%'");
+            s1.append(" or c.user_name like '%").append(keywords).append("%')");
+            s2.append(" and (a.id like '%").append(keywords).append("%'");
+            s2.append(" or a.createName like '%").append(keywords).append("%')");
+        }
+        if (score != null){
+            s1.append(" and a.score >= ").append(score).append(" ");
+            s2.append(" and a.score >= ").append(score).append(" ");
+        }
+        if (commentStartTime != null){
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') >= '").append(commentStartTime).append("' ");
+            s2.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') >= '").append(commentStartTime).append("' ");
+        }
+        if (commentEndTime != null){
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') <= '").append(commentEndTime).append("' ");
+            s2.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') <= '").append(commentEndTime).append("' ");
+        }
+        if (checkoutStartTime != null){
+            s1.append(" and DATE_FORMAT(b.check_out_time, '%Y-%m-%d') >= '").append(checkoutStartTime).append("' ");
+            s2.append(" and DATE_FORMAT(a.check_out_time, '%Y-%m-%d') >= '").append(checkoutStartTime).append("' ");
+        }
+        if (checkoutEndTime != null){
+            s1.append(" and DATE_FORMAT(b.check_out_time, '%Y-%m-%d') <= '").append(checkoutEndTime).append("' ");
+            s2.append(" and DATE_FORMAT(a.check_out_time, '%Y-%m-%d') <= '").append(checkoutEndTime).append("' ");
+        }
+        if (status != null){
+            s1.append(" and a.comment_status = ").append(status).append(" ");
+            s2.append(" and a.comment_status = ").append(status).append(" ");
+        }
+        IPage<BookingComment> list = bookingCommentService.queryPage(s1.toString(),s2.toString(), page, rows);
+        if(list != null && !"".equals(list)){
+            resultJson.put("message", "查询分页成功");
+            resultJson.put("code", 200);
+            resultJson.put("data", list);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        }else{
+            resultJson.put("message", "查询分页失败");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        }
+        return null;
+    }
+
+    public String getByBookId(){
+        JSONObject resultJson = new JSONObject();
+        if (bookId == null) {
+            resultJson.put("message", "请传入订单id");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+        BookCommentDto book = bookingCommentService.getByBookingId(bookId);
+        if (book != null) {
+            resultJson.put("message", "查询成功");
+            resultJson.put("code", 200);
+            resultJson.put("data", book);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }else{
+            resultJson.put("message", "未查到评价信息");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+    }
+
+    public String getById(){
+        JSONObject resultJson = new JSONObject();
+        if (id == null) {
+            resultJson.put("message", "请传入订单id");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+        BookCommentDto list = bookingCommentService.getById(id);
+        if (list != null) {
+            resultJson.put("message", "查询成功");
+            resultJson.put("code", 200);
+            resultJson.put("data", list);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }else{
+            resultJson.put("message", "未查到评价信息");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+    }
+
+    public String insterCommpent(){
+        JSONObject resultJson = new JSONObject();
+        Gson gson = new Gson();
+        com.alibaba.fastjson.JSONObject json = GetHttpParam.getRequestParameters(request);
+        if (json == null) {
+            resultJson.put("message", "请传入参数");
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+        BookingComment bookingComment = null;
+        try{
+            bookingComment = gson.fromJson(json.toString(), new TypeToken<BookingComment>() {}.getType());
+            if (bookingComment.getCommentId()==null || bookingComment.getContent()==null || bookingComment.getCommentParentId()==null || bookingComment.getCommentName()==null){
+                resultJson.put("message", "各参数不能为空");
+                resultJson.put("code", 500);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                return null;
+            }
+            int m = bookingCommentService.insterCommpent(bookingComment);
+            if (m > 0){
+                resultJson.put("message", "回复成功");
+                resultJson.put("code", 200);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            }else {
+                resultJson.put("message", "回复失败");
+                resultJson.put("code", 500);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                return null;
+            }
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+        resultJson.put("message", "未知异常");
+        resultJson.put("code", 205);
+        ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        return null;
+    }
+}

+ 110 - 18
mhotel/src/com/happy/action/bookComplainAction.java

@@ -1,9 +1,13 @@
 package com.happy.action;
 package com.happy.action;
 
 
+import com.happy.Model.Booking;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.Hotel;
 import com.happy.Model.Hotel;
 import com.happy.Model.House;
 import com.happy.Model.House;
+import com.happy.Until.Excel.toExcel;
 import com.happy.Until.ResUtil;
 import com.happy.Until.ResUtil;
+import com.happy.Until.ResponseUtil;
+import com.happy.Until.UUIDUtil;
 import com.happy.common.controller.BaseController;
 import com.happy.common.controller.BaseController;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.service.BookingComplaintService;
 import com.happy.service.BookingComplaintService;
@@ -17,6 +21,7 @@ import org.apache.struts2.interceptor.ServletRequestAware;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Vector;
 
 
 public class bookComplainAction extends BaseController implements ServletRequestAware {
 public class bookComplainAction extends BaseController implements ServletRequestAware {
 
 
@@ -28,9 +33,6 @@ public class bookComplainAction extends BaseController implements ServletRequest
 
 
     @Resource(name = "BookingComplaintService")
     @Resource(name = "BookingComplaintService")
     private BookingComplaintService bookingComplaintService;
     private BookingComplaintService bookingComplaintService;
-    @Resource(name = "HotelService")
-    private HotelService hotelService;
-
     /**
     /**
      * 列表查询
      * 列表查询
      * @return
      * @return
@@ -38,32 +40,32 @@ public class bookComplainAction extends BaseController implements ServletRequest
     public String queryPage(){
     public String queryPage(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
         StringBuilder s1 = new StringBuilder("");
         StringBuilder s1 = new StringBuilder("");
+        StringBuilder s2 = new StringBuilder("");
         if (keywords != null){
         if (keywords != null){
-            s1.append(" and id like '%").append(keywords).append("%'");
+            s1.append(" and (a.id like '%").append(keywords).append("%'");
+            s2.append(" and (a.id like '%").append(keywords).append("%'");
             s1.append(" or title like '%").append(keywords).append("%'");
             s1.append(" or title like '%").append(keywords).append("%'");
+            s2.append(" or a.title like '%").append(keywords).append("%'");
             s1.append(" or content like '%").append(keywords).append("%'");
             s1.append(" or content like '%").append(keywords).append("%'");
+            s2.append(" or a.content like '%").append(keywords).append("%'");
             s1.append(" or booking_id = '").append(keywords).append("' ");
             s1.append(" or booking_id = '").append(keywords).append("' ");
-            String sqlx = " and hname like '%" + keywords + "%' ";
-            List<Hotel> hotelList = hotelService.queryList(sqlx);
-            if (hotelList!=null){
-                StringBuilder ids = new StringBuilder();
-                hotelList.forEach(str->{
-                    ids.append("'").append(str.getId()).append("',");
-                });
-                ids.deleteCharAt(ids.length()-1);
-                s1.append(" or hotel_id in (").append(ids).append(") ");
-            }
+            s2.append(" or a.booking_id = '").append(keywords).append("' ");
+            s1.append(" or h2.hname like '%").append(keywords).append("%')");
+            s2.append(" or a.hotel_name like '%").append(keywords).append("%')");
         }
         }
         if (status != null){
         if (status != null){
-            s1.append(" and status = ").append(status).append(" ");
+            s1.append(" and a.status = ").append(status).append(" ");
+            s2.append(" and a.status = ").append(status).append(" ");
         }
         }
         if (complainStartTime != null){
         if (complainStartTime != null){
-            s1.append(" and DATE_FORMAT(create_date, '%Y-%m-%d') >= ").append(complainStartTime).append(" ");
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') >= '").append(complainStartTime).append("' ");
+            s2.append(" and DATE_FORMAT(create_date, '%Y-%m-%d') >= '").append(complainStartTime).append("' ");
         }
         }
         if (complainStartTime != null){
         if (complainStartTime != null){
-            s1.append(" and DATE_FORMAT(create_date, '%Y-%m-%d') <= ").append(complainEndTime).append(" ");
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') <= '").append(complainEndTime).append("' ");
+            s2.append(" and DATE_FORMAT(create_date, '%Y-%m-%d') <= '").append(complainEndTime).append("' ");
         }
         }
-        IPage<BookingComplaint> bookingComplaintIPage = bookingComplaintService.queryPage(s1.toString(), page, rows);
+        IPage<BookingComplaint> bookingComplaintIPage = bookingComplaintService.queryPage(s1.toString(),s2.toString(), page, rows);
         if(bookingComplaintIPage!=null && !"".equals(bookingComplaintIPage)){
         if(bookingComplaintIPage!=null && !"".equals(bookingComplaintIPage)){
             resultJson.put("message", "查询分页成功");
             resultJson.put("message", "查询分页成功");
             resultJson.put("code", 200);
             resultJson.put("code", 200);
@@ -75,5 +77,95 @@ public class bookComplainAction extends BaseController implements ServletRequest
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
         }
         }
         return null;
         return null;
+
+    }
+
+    /**
+     * 投诉详情
+     */
+    public String getById(){
+        JSONObject resultJson = new JSONObject();
+        BookingComplaint bookingComplaint = bookingComplaintService.getById(id);
+        if (bookingComplaint != null) {
+            resultJson.put("message", "查询成功");
+            resultJson.put("code", 200);
+            resultJson.put("data", bookingComplaint);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }else{
+            resultJson.put("message", "未查询到投诉订单信息");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+    }
+
+    public String toComplainExcel(){
+        JSONObject resultJson = new JSONObject();
+        StringBuilder s1 = new StringBuilder("");
+        if (keywords != null){
+            s1.append(" and a.id like '%").append(keywords).append("%'");
+            s1.append(" or title like '%").append(keywords).append("%'");
+            s1.append(" or content like '%").append(keywords).append("%'");
+            s1.append(" or booking_id = '").append(keywords).append("' ");
+            s1.append(" or h2.hname like '%").append(keywords).append("%'");
+        }
+        if (status != null){
+            s1.append(" and a.status = ").append(status).append(" ");
+        }
+        if (complainStartTime != null) {
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') >= '").append(complainStartTime).append("' ");
+        }
+        if (complainStartTime != null){
+            s1.append(" and DATE_FORMAT(a.create_date, '%Y-%m-%d') <= '").append(complainEndTime).append("' ");
+        }
+        List<BookingComplaint> list = bookingComplaintService.toComplainExcel(s1.toString());
+        if(list==null){
+            resultJson.put("code", 500);
+            resultJson.put("message", "无数据无法导出");
+            ResponseUtil.writeJson(ServletActionContext.getResponse(),
+                    resultJson.toString());
+        }
+        List<Vector> vectorsList = new ArrayList<>();
+        for(BookingComplaint bookingComplaint : list){
+            Vector columnValue = new Vector();
+            columnValue.add(bookingComplaint.getId());
+            columnValue.add(bookingComplaint.getTitle());
+            columnValue.add(bookingComplaint.getContent());
+            columnValue.add(bookingComplaint.getBookingId());
+            columnValue.add(bookingComplaint.getHotelName());
+            columnValue.add(bookingComplaint.getHouseName());
+            columnValue.add(bookingComplaint.getCreateDate());
+            vectorsList.add(columnValue);
+        }
+        // 项目路径地址
+        String path = request.getSession().getServletContext()
+                .getRealPath("/download/");;// File.separator
+
+        try{
+            Vector columnName = new Vector();
+            columnName.add("投诉id");
+            columnName.add("投诉标题");
+            columnName.add("投诉内容");
+            columnName.add("订单号");
+            columnName.add("酒店名称");
+            columnName.add("房型");
+            columnName.add("投诉时间");
+
+            String filePathName ="投诉信息" + UUIDUtil.generateID() +".xls";
+            // 导出文件
+            new toExcel().book(vectorsList, path + filePathName,
+                    "sheet1", columnName);
+            String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+            resultJson.put("downurl", url + "/download/" + filePathName);
+            resultJson.put("code", 200);
+            resultJson.put("message", "导出成功");
+            ResponseUtil.writeJson(ServletActionContext.getResponse(),
+                    resultJson.toString());
+        } catch (Exception e){
+            e.printStackTrace();
+        }
+        return null;
     }
     }
+
 }
 }

+ 15 - 0
mhotel/src/com/happy/dao/BookingCommentDao.java

@@ -2,7 +2,22 @@ package com.happy.dao;
 
 
 import com.happy.Model.BookingComment;
 import com.happy.Model.BookingComment;
 
 
+import java.util.List;
+
 public interface BookingCommentDao {
 public interface BookingCommentDao {
     String insertBookingComment(BookingComment bookingComment);
     String insertBookingComment(BookingComment bookingComment);
 
 
+    List<BookingComment> queryPage(String sqlx, int page, int rows);
+
+    int queryTotal(String sqlx);
+
+    List<BookingComment> getByBookId(String bookId);
+
+    List<BookingComment> getByParentId(String parentId);
+
+    List<BookingComment> getByCommentId(String commentId);
+
+    int insterCommpent(BookingComment bookingComment);
+
+    int updateCommpentStatus(BookingComment bookingComment);
 }
 }

+ 2 - 0
mhotel/src/com/happy/dao/BookingComplainDao.java

@@ -9,7 +9,9 @@ import java.util.List;
 public interface BookingComplainDao {
 public interface BookingComplainDao {
 
 
     List<BookingComplaint> queryPage(String sqlx, int page, int rows);
     List<BookingComplaint> queryPage(String sqlx, int page, int rows);
+    List<BookingComplaint> toComplainExcel(String sqlx);
 
 
     int queryTotal(String sqlx);
     int queryTotal(String sqlx);
 
 
+    BookingComplaint getById(String id);
 }
 }

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

@@ -1,13 +1,22 @@
 package com.happy.dao.impl;
 package com.happy.dao.impl;
 
 
 import com.happy.Model.BookingComment;
 import com.happy.Model.BookingComment;
+import com.happy.Model.HotelCoupon;
+import com.happy.Model.HouseNumber;
+import com.happy.Until.Func;
+import com.happy.Until.SqlUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.dao.BookingCommentDao;
 import com.happy.dao.BookingCommentDao;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
 import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
 @Repository("BookingCommentDao")
 @Repository("BookingCommentDao")
 public class BookingCommentDaoImpl implements BookingCommentDao {
 public class BookingCommentDaoImpl implements BookingCommentDao {
     @Autowired
     @Autowired
@@ -22,8 +31,15 @@ public class BookingCommentDaoImpl implements BookingCommentDao {
         this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
         this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
     }
     }
 
 
+    private String selectSql = "select " +
+            "a.id,a.comment_id,a.comment_parent_id,a.comment_name,a.booking_id,a.hotel_id,a.house_id,a.content,a.comment_status,a.score,a.score_ws," +
+            "a.score_fw,a.score_ss,a.score_wz,a.create_id,a.create_username,a.create_date,a.modify_date,a.status,b.check_out_time,c.user_name as createName"+
+            " from booking_comment a" +
+            " left join booking b on b.id = a.booking_id"+
+            " left join users c on c.id = a.create_id" +
+            " where 1=1 ";
     /**
     /**
-     * Ìí¼ÓÆÀ¼Û£¬²¢·µ»ØÖ÷¼ü
+     * ������ۣ�����������
      * @param bookingComment
      * @param bookingComment
      * @return
      * @return
      */
      */
@@ -71,6 +87,122 @@ public class BookingCommentDaoImpl implements BookingCommentDao {
         return id;
         return id;
     }
     }
 
 
+    @Override
+    public List<BookingComment> queryPage(String sqlx, int page, int rows) {
+        SqlUtil.filterKeyword(sqlx);
+        int start = (page - 1) * rows;// �页的起始下标
+        String sql = selectSql + sqlx + " and a.comment_id is null " + " ORDER BY create_date DESC limit :start,:rows ";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("start", start);
+        sps.addValue("rows", rows);
+        List<BookingComment> list = namedParameterJdbcTemplate.query(sql, sps,
+                new BeanPropertyRowMapper<>(BookingComment.class));
+        if (list != null && list.size() > 0) return list;
+        return null;
+    }
+
+    @Override
+    public int queryTotal(String sqlx) {
+        SqlUtil.filterKeyword(sqlx);
+        String sql = "SELECT count(*) FROM ("+ selectSql + " and a.comment_id is null " +") a where status != 0 "+sqlx;
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        return namedParameterJdbcTemplate.queryForInt(sql, sps);
+    }
+
+    @Override
+    public List<BookingComment> getByBookId(String bookId) {
+        String sql = selectSql + " and a.booking_id = :id and a.comment_id is null and status != 0";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("id",bookId);
+        List<BookingComment> list = new ArrayList<>();
+        try{
+            list = namedParameterJdbcTemplate.query(sql,sps, new BeanPropertyRowMapper<>(BookingComment.class));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(list != null && list.size()>0) return list;
+        return null;
+    }
+
+    @Override
+    public List<BookingComment> getByParentId(String parentId) {
+        String sql = selectSql + " and a.comment_parent_id = :id and status != 0";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("id",parentId);
+        List<BookingComment> list = new ArrayList<>();
+        try{
+            list = namedParameterJdbcTemplate.query(sql,sps, new BeanPropertyRowMapper<>(BookingComment.class));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(list != null && list.size()>0) return list;
+        return null;
+    }
+
+    @Override
+    public List<BookingComment> getByCommentId(String commentId) {
+        String sql = selectSql + " and a.comment_id = :id and status != 0";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("id",commentId);
+        List<BookingComment> list = new ArrayList<>();
+        try{
+            list = namedParameterJdbcTemplate.query(sql,sps, new BeanPropertyRowMapper<>(BookingComment.class));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(list != null && list.size()>0) return list;
+        return null;
+    }
+
+    @Override
+    public int insterCommpent(BookingComment bookingComment) {
+        String sql = "INSERT INTO booking_comment (id, comment_id, comment_parent_id, comment_name, content,create_date,modify_date, status,comment_status) VALUES (:id, :comment_id, :comment_parent_id, :comment_name, :content, :create_date, :modify_date, :status,:comment_status)";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("comment_id",bookingComment.getCommentId());
+        sps.addValue("comment_parent_id",bookingComment.getCommentParentId());
+        sps.addValue("comment_name",bookingComment.getCommentName());
+        sps.addValue("content",bookingComment.getContent());
+        sps.addValue("create_date",UUIDUtil.getNewDate());
+        sps.addValue("modify_date",UUIDUtil.getNewDate());
+        sps.addValue("status",1);
+        sps.addValue("comment_status",1);
+        if(bookingComment.getId()==null){
+            sps.addValue("id", String.valueOf(UUID.randomUUID()));
+        }else{
+            sps.addValue("id", bookingComment.getId());
 
 
+        }
+        int num = 0;
+        try{
+            num = namedParameterJdbcTemplate.update(sql, sps);
+        }
+        catch(Exception e){
+            e.printStackTrace();
+        }
+        return num;
+    }
+
+    @Override
+    public int updateCommpentStatus(BookingComment bookingComment) {
+        StringBuffer stringBuffer =  new StringBuffer(" update `booking_comment` set  ");
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        if (!Func.checkNull(String.valueOf(bookingComment.getCommentStatus()))){
+            stringBuffer.append(" comment_status=:comment_status,");
+            stringBuffer.append(" modify_date=:modify_date");
+            sps.addValue("comment_status", bookingComment.getCommentStatus());
+            sps.addValue("modify_date",UUIDUtil.getNewDate());
+        }
+        // 将�修改的数�填充到查询语�中
+        stringBuffer.append("  where id=:id  ");
+        sps.addValue("id", bookingComment.getId());
+        int num = 0;
+        try{
+            num = namedParameterJdbcTemplate.update(stringBuffer.toString(), sps);
+        }
+        catch(Exception e){
+            e.printStackTrace();
+        }
+        return num;
+    }
 
 
 }
 }

+ 33 - 4
mhotel/src/com/happy/dao/impl/BookingComplainImplDao.java

@@ -1,5 +1,6 @@
 package com.happy.dao.impl;
 package com.happy.dao.impl;
 
 
+import com.happy.Model.Booking;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.House;
 import com.happy.Model.House;
@@ -29,14 +30,17 @@ public class BookingComplainImplDao implements BookingComplainDao {
     }
     }
 
 
     private String selectSql = "select " +
     private String selectSql = "select " +
-            "id,booking_id,hotel_id,house_id,title,content,create_id,create_date,modify_date,status" +
-            " from booking_complaint where 1=1 ";
+            "a.id,a.booking_id,a.hotel_id,a.house_id,a.title,a.content,a.create_id,a.create_date,a.modify_date,a.status,h.h_name as house_name,h2.hname as hotel_name" +
+            " from booking_complaint a " +
+            " left join house h on a.house_id = h.id " +
+            " left join hotel h2 on a.hotel_id = h2.id "+
+            " where a.status != 0 ";
 
 
     @Override
     @Override
     public List<BookingComplaint> queryPage(String sqlx, int page, int rows) {
     public List<BookingComplaint> queryPage(String sqlx, int page, int rows) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
         int start = (page - 1) * rows;// 每页的起始下标
         int start = (page - 1) * rows;// 每页的起始下标
-        String sql = selectSql + sqlx + "and status != 0"  +" ORDER BY id DESC limit :start,:rows ";
+        String sql = selectSql + sqlx + "and a.status != 0"  +" ORDER BY id DESC limit :start,:rows ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("start", start);
         sps.addValue("start", start);
         sps.addValue("rows", rows);
         sps.addValue("rows", rows);
@@ -47,11 +51,36 @@ public class BookingComplainImplDao implements BookingComplainDao {
     }
     }
 
 
     @Override
     @Override
+    public List<BookingComplaint> toComplainExcel(String sqlx) {
+        SqlUtil.filterKeyword(sqlx);
+        String sql = selectSql + sqlx + " and a.status != 0"  +" ORDER BY id DESC ";
+        List<BookingComplaint> list = namedParameterJdbcTemplate.query(sql,
+                new BeanPropertyRowMapper<>(BookingComplaint.class));
+        if (list != null && list.size() > 0) return list;
+        return null;
+    }
+
+    @Override
     public int queryTotal(String sqlx) {
     public int queryTotal(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = "SELECT count(*) FROM `booking_complaint` where status != 0 "+sqlx;
+        String sql = "SELECT count(*) FROM ("+ selectSql +") a where status != 0 "+sqlx;
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
     }
     }
 
 
+    @Override
+    public BookingComplaint getById(String id) {
+        String sql = selectSql + " and a.id = :id";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("id", id);
+        List<BookingComplaint> list = null;
+        try{
+            list = namedParameterJdbcTemplate.query(sql, sps,
+                    new BeanPropertyRowMapper<>(BookingComplaint.class));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(list != null && list.size()>0) return list.get(0);
+        return null;
+    }
 }
 }

+ 25 - 0
mhotel/src/com/happy/dto/BookCommentDto.java

@@ -0,0 +1,25 @@
+package com.happy.dto;
+
+import com.happy.Model.Booking;
+import com.happy.Model.BookingComment;
+import com.happy.Model.FileInfo;
+import com.happy.Model.House;
+import lombok.Data;
+
+import java.awt.print.Book;
+import java.util.List;
+@Data
+public class BookCommentDto {
+
+    //订单
+    public Booking book;
+
+    //房型
+    public House house;
+
+    List<FileInfo> fileInfos;// 附件
+
+    //主评论
+    List<BookingComment> bookingCommentList;
+
+}

+ 30 - 0
mhotel/src/com/happy/service/BookingCommentService.java

@@ -2,6 +2,9 @@ package com.happy.service;
 
 
 import com.happy.Model.BookingComment;
 import com.happy.Model.BookingComment;
 import com.happy.Model.FileInfo;
 import com.happy.Model.FileInfo;
+import com.happy.Model.HotelCoupon;
+import com.happy.dto.BookCommentDto;
+import com.happy.dto.IPage;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -9,4 +12,31 @@ public interface BookingCommentService {
 
 
 
 
     int orderRate( BookingComment bookingComment,List<String> pictureList);
     int orderRate( BookingComment bookingComment,List<String> pictureList);
+
+    /**
+     * 描述:查询订单下的所有评论 根据订单id与comment_parent_id为空查询
+     * @param bookId 订单Id
+     * @return 返回订单下所有最大级的评价
+     */
+    BookCommentDto getById(String bookId);
+
+    /**
+     * 分页查询
+     * @return 返回所有
+     */
+    IPage<BookingComment> queryPage(String sqlx,String sql, int page, int rows);
+
+    /**
+     * 评价列表详情
+     * @param id 订单id
+     * @return 订单和房型
+     */
+    BookCommentDto getByBookingId(Integer id);
+
+    /**
+     * 回复弹窗 保存同时并修改当前回复信息状态为已回复
+     * @param bookingComment 回复内容
+     * @return 影响数量
+     */
+    int insterCommpent(BookingComment bookingComment);
 }
 }

+ 13 - 2
mhotel/src/com/happy/service/BookingComplaintService.java

@@ -4,15 +4,17 @@ import com.happy.Model.BookingComplaint;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.HotelCoupon;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 
 
+import java.util.List;
+
 public interface BookingComplaintService {
 public interface BookingComplaintService {
     /**
     /**
      * 描述:分页查询
      * 描述:分页查询
-     * @param sqlx
+     * @param sqlx 列表查询条件 sql 总数查询条件
      * @param page
      * @param page
      * @param rows
      * @param rows
      * @return
      * @return
      */
      */
-    IPage<BookingComplaint> queryPage(String sqlx, int page, int rows);
+    IPage<BookingComplaint> queryPage(String sqlx,String sql, int page, int rows);
 
 
     /**
     /**
      * 描述:获取总条数
      * 描述:获取总条数
@@ -20,4 +22,13 @@ public interface BookingComplaintService {
      * @return
      * @return
      */
      */
     int queryTotal(String sqlx);
     int queryTotal(String sqlx);
+
+    /**
+     * 描述:根据id查询投诉表
+     * @param id 投诉id
+     * @return
+     */
+    BookingComplaint getById(String id);
+
+    List<BookingComplaint> toComplainExcel(String sqlx);
 }
 }

+ 114 - 5
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -1,10 +1,14 @@
 package com.happy.service.impl;
 package com.happy.service.impl;
 
 
-import com.happy.Model.BookingComment;
-import com.happy.Model.FileInfo;
+import com.happy.Model.*;
 import com.happy.dao.BookingCommentDao;
 import com.happy.dao.BookingCommentDao;
+import com.happy.dao.FileInfoDao;
+import com.happy.dto.BookCommentDto;
+import com.happy.dto.IPage;
+import com.happy.service.BookService;
 import com.happy.service.BookingCommentService;
 import com.happy.service.BookingCommentService;
 import com.happy.service.FileService;
 import com.happy.service.FileService;
+import com.happy.service.HouseService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
@@ -13,19 +17,26 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 @Service("BookingCommentService")
 @Service("BookingCommentService")
-
 public class BookingCommentImplService implements BookingCommentService {
 public class BookingCommentImplService implements BookingCommentService {
 
 
     @Resource
     @Resource
     BookingCommentDao bookingCommentDao;
     BookingCommentDao bookingCommentDao;
 
 
     @Resource
     @Resource
+    BookService bookService;
+
+    @Resource
+    HouseService houseService;
+
+    @Resource
+    public FileInfoDao fileDao;
+    @Resource
     FileService fileService;
     FileService fileService;
 
 
 
 
 
 
     /**
     /**
-     * Ìí¼ÓÆÀÂÛ
+     * �������
      *
      *
      * @param pictureList
      * @param pictureList
      * @param bookingComment
      * @param bookingComment
@@ -35,7 +46,7 @@ public class BookingCommentImplService implements BookingCommentService {
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public int orderRate( BookingComment bookingComment,List<String> pictureList) {
     public int orderRate( BookingComment bookingComment,List<String> pictureList) {
 
 
-//        Ìí¼ÓÆÀÂÛ±í²¢·µ»ØÖ÷¼ü
+//        ������۱���������
 
 
         String id = bookingCommentDao.insertBookingComment(bookingComment);
         String id = bookingCommentDao.insertBookingComment(bookingComment);
         int i = 1;
         int i = 1;
@@ -62,5 +73,103 @@ public class BookingCommentImplService implements BookingCommentService {
 
 
     }
     }
 
 
+    @Override
+    public IPage<BookingComment> queryPage(String sqlx,String sql, int page, int rows) {
+        IPage<BookingComment> iPage = new IPage();
+        List<BookingComment> hotelCouponList = bookingCommentDao.queryPage(sqlx,page,rows);
+        int total = bookingCommentDao.queryTotal(sql);
+        iPage.setPageList(hotelCouponList);
+        iPage.setPage(page);
+        iPage.setTotalPage( (int)Math.ceil((double)total/rows));
+        iPage.setRows(rows);
+        iPage.setTotal(total);
+        return iPage;
+    }
+
+    @Override
+    public BookCommentDto getByBookingId(Integer id) {
+        Booking book = bookService.getById(id);
+        House house = houseService.getById(Integer.parseInt(book.getHouseId()));
+        BookCommentDto bookCommentDto = new BookCommentDto();
+        bookCommentDto.setBook(book);
+        bookCommentDto.setHouse(house);
+        return bookCommentDto;
+    }
+
+    @Override
+    public int insterCommpent(BookingComment bookingComment) {
+        BookingComment comment = new BookingComment();
+        comment.setId(bookingComment.getCommentId());
+        comment.setCommentStatus("2");
+        int m = bookingCommentDao.updateCommpentStatus(comment);
+        int i = bookingCommentDao.insterCommpent(bookingComment);
+        if (i > 0 && m >0){
+            return i;
+        }else {
+            return 0;
+        }
+    }
+
+    @Override
+    public BookCommentDto getById(String bookId) {
+        List<BookingComment> list = bookingCommentDao.getByBookId(bookId);
+        if (list == null) return null;
+        BookCommentDto bookCommentDto = new BookCommentDto();
+        bookCommentDto.setBook(bookService.getById(Integer.parseInt(bookId)));
+        BookingComment comment = list.stream().findFirst().orElse(null);
+        if (comment != null) {
+            List<FileInfo> fileInfos = fileDao.queryList("and link_id ='" + comment.getId() + "'");
+            bookCommentDto.setFileInfos(fileInfos);
+        }
+        for (BookingComment bookingComment : list){
+            List<BookingComment> listByParentId = bookingCommentDao.getByParentId(bookingComment.getId());
+            for (BookingComment parentComment : listByParentId){
+                getComment(parentComment);
+            }
+            bookingComment.setLowCommentList(listByParentId);
+        }
+        bookCommentDto.setBookingCommentList(list);
+        return bookCommentDto;
+    }
+    public BookingComment getComment(BookingComment parentComment){
+      if(parentComment!=null){
+         List<BookingComment> parentCommentList = bookingCommentDao.getByCommentId(parentComment.getId());
+          if(parentComment != null && parentCommentList != null){
+              for(BookingComment low : parentCommentList){//一级评论
+                  getLowcomment(low);
+              }
+          }
+      }
+      return parentComment;
+    };
+
+    private void getLowcomment(BookingComment comment){
+        List<BookingComment> list = new ArrayList<>();
+        if (comment.getLowCommentList()!=null) {
+            list = comment.getLowCommentList();
+        }
+        List<BookingComment> low = bookingCommentDao.getByCommentId(comment.getId());
+        if(low != null){
+            list.addAll(low);
+            comment.setLowCommentList(list);
+            for(BookingComment low1 : list){
+                getLowcomment(low1,comment);
+            }
+        }
+    }
 
 
+    private void getLowcomment(BookingComment comment,BookingComment parentCommentList){
+        List<BookingComment> list = new ArrayList<>();
+        if (parentCommentList.getLowCommentList()!=null) {
+            list = parentCommentList.getLowCommentList();
+        }
+        List<BookingComment> low = bookingCommentDao.getByCommentId(comment.getId());
+        if(low!=null){
+            list.addAll(low);
+            comment.setLowCommentList(low);
+            for(BookingComment low1 : list){
+                getLowcomment(low1,comment);
+            }
+        }
+    }
 }
 }

+ 19 - 3
mhotel/src/com/happy/service/impl/BookingComplaintImplService.java

@@ -1,10 +1,12 @@
 package com.happy.service.impl;
 package com.happy.service.impl;
 
 
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.BookingComplaint;
+import com.happy.Model.FileInfo;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.House;
 import com.happy.Model.House;
 import com.happy.dao.BookingComplainDao;
 import com.happy.dao.BookingComplainDao;
 import com.happy.dao.BookingLogDao;
 import com.happy.dao.BookingLogDao;
+import com.happy.dao.FileInfoDao;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.service.BookingComplaintService;
 import com.happy.service.BookingComplaintService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -17,13 +19,14 @@ public class BookingComplaintImplService implements BookingComplaintService {
 
 
     @Resource
     @Resource
     public BookingComplainDao bookingComplainDao;
     public BookingComplainDao bookingComplainDao;
-
+    @Resource
+    public FileInfoDao fileDao;
 
 
     @Override
     @Override
-    public IPage<BookingComplaint> queryPage(String sqlx, int page, int rows) {
+    public IPage<BookingComplaint> queryPage(String sqlx,String sql, int page, int rows) {
         IPage<BookingComplaint> iPage = new IPage();
         IPage<BookingComplaint> iPage = new IPage();
         List<BookingComplaint> houseList =  bookingComplainDao.queryPage(sqlx,page,rows);
         List<BookingComplaint> houseList =  bookingComplainDao.queryPage(sqlx,page,rows);
-        int total = bookingComplainDao.queryTotal(sqlx);
+        int total = bookingComplainDao.queryTotal(sql);
         iPage.setPageList(houseList);
         iPage.setPageList(houseList);
         iPage.setPage(page);
         iPage.setPage(page);
         iPage.setTotalPage( (int)Math.ceil((double)total/rows));
         iPage.setTotalPage( (int)Math.ceil((double)total/rows));
@@ -36,4 +39,17 @@ public class BookingComplaintImplService implements BookingComplaintService {
     public int queryTotal(String sqlx) {
     public int queryTotal(String sqlx) {
         return bookingComplainDao.queryTotal(sqlx);
         return bookingComplainDao.queryTotal(sqlx);
     }
     }
+
+    @Override
+    public BookingComplaint getById(String id) {
+        BookingComplaint bookingComplaint = bookingComplainDao.getById(id);
+        List<FileInfo> fileInfos = fileDao.queryList("and link_id ='" + id + "'");
+        bookingComplaint.setFileInfos(fileInfos);
+        return bookingComplaint;
+    }
+
+    @Override
+    public List<BookingComplaint> toComplainExcel(String sqlx) {
+        return bookingComplainDao.toComplainExcel(sqlx);
+    }
 }
 }

+ 2 - 0
mhotel/src/struts.xml

@@ -35,6 +35,8 @@
 		</action>
 		</action>
 		<action name="Complain*" method = "{1}" class="com.happy.action.bookComplainAction">
 		<action name="Complain*" method = "{1}" class="com.happy.action.bookComplainAction">
 		</action>
 		</action>
+		<action name="Comment*" method = "{1}" class="com.happy.action.bookCommentAction">
+		</action>
 		<action name="house*" method = "{1}" class="com.happy.action.houseAction">
 		<action name="house*" method = "{1}" class="com.happy.action.houseAction">
 		</action>
 		</action>
 		<action name="house/price/*" method = "{1}" class="com.happy.action.HousePriceAction">
 		<action name="house/price/*" method = "{1}" class="com.happy.action.HousePriceAction">