Просмотр исходного кода

添加个人评价所需参数

liu 2 лет назад
Родитель
Сommit
f9c1353ef2

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

@@ -556,11 +556,13 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
 
 
         IPage ipage=bookingCommentService.personageComment(status, usersId, page, rows);
+        PersonageCommentCountVo vo=bookingCommentService.personageCommentCount(usersId);
 
         jsonObject.put("code", 200);
         jsonObject.put("message", "成功");
         jsonObject.put("success", true);
         jsonObject.put("page", ipage);
+        jsonObject.put("data", vo);
         ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
 
         return null;

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

@@ -66,4 +66,8 @@ public interface BookingCommentService {
     IPage personageComment(int status, String usersId, int page, int rows);
 
     PersonageDetailsVo personageDetails(String bookingCommentId);
+
+    //待评级数量,已评价数量
+    PersonageCommentCountVo personageCommentCount(String usersId);
+
 }

+ 13 - 0
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -245,6 +245,19 @@ public class BookingCommentImplService implements BookingCommentService {
 
 
     @Override
+    public PersonageCommentCountVo personageCommentCount(String usersId) {
+        PersonageCommentCountVo vo = new PersonageCommentCountVo();
+        //带评价数量
+        Integer waiting = bookingCommentDao.personageNotCommentTotal(usersId);
+        vo.setWaitingCount(waiting);
+//        已评价
+        Integer rated = bookingCommentDao.personageCommentTotal(usersId);
+        vo.setRatedCount(rated);
+        return vo;
+    }
+
+
+    @Override
     public BookCommentDto getById(String bookId) {
         List<BookingComment> list = bookingCommentDao.getByBookId(bookId);
         if (list == null) return null;

+ 12 - 0
mhotel/src/com/happy/vo/PersonageCommentCountVo.java

@@ -0,0 +1,12 @@
+package com.happy.vo;
+
+import lombok.Data;
+
+@Data
+public class PersonageCommentCountVo {
+//    待评价
+    private Integer waitingCount;
+
+//    已评价
+    private Integer ratedCount;
+}