瀏覽代碼

更新个人评论接口

liu 2 年之前
父節點
當前提交
a17abf16f5

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

@@ -16,6 +16,7 @@ import com.opensymphony.xwork2.ActionSupport;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.interceptor.ServletRequestAware;
+import org.springframework.beans.BeanUtils;
 
 
 import javax.annotation.Resource;
@@ -566,13 +567,27 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
         }
 
 
-        IPage ipage=bookingCommentService.personageComment(status, usersId, page, rows);
+        IPage<PersonageCommentVo> ipage=bookingCommentService.personageComment(status, usersId, page, rows);
+
+        IPage<CommentDetailsVo> voIPage = new IPage<>();
+        BeanUtils.copyProperties(ipage,voIPage);
+
+        List<PersonageCommentVo> pageList = ipage.getPageList();
+        ArrayList<CommentDetailsVo> commentDetailsVos = new ArrayList<>();
+        for (PersonageCommentVo personageCommentVo : pageList) {
+            String bookingCommentId1 = personageCommentVo.getBookingCommentId();
+            CommentDetailsVo commentDetailsVo =bookingCommentService.commentDetails(bookingCommentId1);
+            commentDetailsVos.add(commentDetailsVo);
+        }
+
+        voIPage.setPageList(commentDetailsVos);
+
         PersonageCommentCountVo vo=bookingCommentService.personageCommentCount(usersId);
 
         jsonObject.put("code", 200);
         jsonObject.put("message", "成功");
         jsonObject.put("success", true);
-        jsonObject.put("page", ipage);
+        jsonObject.put("page", voIPage);
         jsonObject.put("data", vo);
         ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
 

+ 1 - 0
mhotel/src/com/happy/action/AppHotelCouponAction.java

@@ -222,6 +222,7 @@ public class AppHotelCouponAction extends ActionSupport implements ServletReques
 
     }
 
+
     /**
      * 指定名宿
      *

+ 1 - 1
mhotel/src/com/happy/service/BookingCommentService.java

@@ -60,7 +60,7 @@ public interface BookingCommentService {
 
     CommentDetailsVo commentDetails(String bookingId);
 
-    IPage personageComment(int status, String usersId, int page, int rows);
+    IPage<PersonageCommentVo> personageComment(int status, String usersId, int page, int rows);
 
     PersonageDetailsVo personageDetails(String bookingCommentId);
 

+ 10 - 4
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -73,11 +73,11 @@ public class BookingCommentImplService implements BookingCommentService {
         workflow.setType(2);
         workflow.setRemark(bookingComment.getContent());
         workflow.setStatus(1);
-        workflow.setCreateId(bookingComment.getCreateId()+"");
+        workflow.setCreateId(bookingComment.getCreateId() + "");
         workflow.setCreateDate(bookingComment.getCreateDate());
-        workflowImplService.insert(workflow);
+        int insert = workflowImplService.insert(workflow);
 
-        if (Long.valueOf(id) > 0 && i > 0) {
+        if (Long.valueOf(id) > 0 && i > 0 && insert > 0) {
             return i;
         } else {
             return 0;
@@ -224,7 +224,7 @@ public class BookingCommentImplService implements BookingCommentService {
     }
 
     @Override
-    public IPage personageComment(int status, String usersId, int page, int rows) {
+    public IPage<PersonageCommentVo> personageComment(int status, String usersId, int page, int rows) {
         IPage<PersonageCommentVo> iPage = new IPage();
         List<PersonageCommentVo> vos = null;
         int total = 0;
@@ -293,6 +293,12 @@ public class BookingCommentImplService implements BookingCommentService {
 //        已评价
         Integer rated = bookingCommentDao.personageCommentTotal(usersId);
         vo.setRatedCount(rated);
+//      待审核
+       Integer audit = bookingCommentDao.auditTotalComment(usersId);
+        vo.setAuditCount(audit);
+//            审批拒绝
+        Integer refuseAudit = bookingCommentDao.refuseAuditTotalComment(usersId);
+        vo.setRefuseAuditCount(refuseAudit);
         return vo;
     }
 

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

@@ -9,4 +9,10 @@ public class PersonageCommentCountVo {
 
 //    已评价
     private Integer ratedCount;
+
+//    待审核
+    private Integer auditCount;
+
+//    审核拒绝
+    private Integer refuseAuditCount;
 }