Browse Source

修改bug

liu 2 years ago
parent
commit
60d0212c72

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

@@ -573,6 +573,17 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
         BeanUtils.copyProperties(ipage,voIPage);
         BeanUtils.copyProperties(ipage,voIPage);
 
 
         List<PersonageCommentVo> pageList = ipage.getPageList();
         List<PersonageCommentVo> pageList = ipage.getPageList();
+
+        PersonageCommentCountVo vo = bookingCommentService.personageCommentCount(usersId);
+        if (pageList == null || pageList.size() <= 0 ||status==0) {
+            jsonObject.put("code", 200);
+            jsonObject.put("message", "成功");
+            jsonObject.put("success", true);
+            jsonObject.put("page", voIPage);
+            jsonObject.put("data", vo);
+            ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
+            return null;
+        }
         ArrayList<CommentDetailsVo> commentDetailsVos = new ArrayList<>();
         ArrayList<CommentDetailsVo> commentDetailsVos = new ArrayList<>();
         for (PersonageCommentVo personageCommentVo : pageList) {
         for (PersonageCommentVo personageCommentVo : pageList) {
             String bookingCommentId1 = personageCommentVo.getBookingCommentId();
             String bookingCommentId1 = personageCommentVo.getBookingCommentId();
@@ -582,8 +593,6 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
 
 
         voIPage.setPageList(commentDetailsVos);
         voIPage.setPageList(commentDetailsVos);
 
 
-        PersonageCommentCountVo vo=bookingCommentService.personageCommentCount(usersId);
-
         jsonObject.put("code", 200);
         jsonObject.put("code", 200);
         jsonObject.put("message", "成功");
         jsonObject.put("message", "成功");
         jsonObject.put("success", true);
         jsonObject.put("success", true);

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

@@ -148,7 +148,16 @@ public class BookingCommentImplService implements BookingCommentService {
 //
 //
         String id = bookingCommentDao.insertBookingComment(bookingComment);
         String id = bookingCommentDao.insertBookingComment(bookingComment);
 
 
-        if (Long.valueOf(id) > 0) {
+        Workflow workflow = new Workflow();
+        workflow.setLinkId(id);
+        workflow.setType(2);
+        workflow.setRemark(bookingComment.getContent());
+        workflow.setStatus(1);
+        workflow.setCreateId(bookingComment.getCreateId() + "");
+        workflow.setCreateDate(bookingComment.getCreateDate());
+        int insert = workflowImplService.insert(workflow);
+
+        if (Long.valueOf(id) > 0 && insert > 0) {
             return 1;
             return 1;
         } else {
         } else {
             return 0;
             return 0;