Browse Source

修改住过的酒店名称前面带null导致报错问题,个人评论待审核和审核中查询报错问题

liu 2 years ago
parent
commit
b51c9218de

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

@@ -645,7 +645,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
                 "\t`booking_comment` bc\n" +
                 "\tLEFT JOIN ( SELECT fi.link_id, GROUP_CONCAT( fi.url ) AS url FROM file_info fi GROUP BY fi.link_id ) fi2 ON fi2.link_id = bc.id\n" +
                 "\tLEFT JOIN booking b on b.id=bc.booking_id  LEFT JOIN users u on u.id=bc.create_id LEFT JOIN ( SELECT fi3.link_id, GROUP_CONCAT( fi3.url ) AS url FROM file_info fi3 GROUP BY fi3.link_id ) fi4 ON fi4.link_id = b.house_id \n" +
-                "\tWHERE bc.comment_parent_id is NULL AND bc.`status`=1  and bc.id= :bookingCommentId";
+                "\tWHERE bc.comment_parent_id is NULL and bc.id= :bookingCommentId";
 
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("bookingCommentId", bookingCommentId);

+ 4 - 1
mhotel/src/com/happy/service/impl/AppHomePageImplService.java

@@ -74,8 +74,11 @@ public class AppHomePageImplService implements AppHomePageService {
         StringBuilder strSql = new StringBuilder(" and hstatus=1 "); // 酒店正在营业中才显示" and hstatus=1 "
         strSql.append(" and a.id in( ");
         for (String id: ids) {
-            if (Func.checkNull(id))
+            if (Func.checkNull(id)) {
                 continue;
+            }
+//            去掉前面的null
+            id=id.replaceAll("null","");
             strSql.append(" "+ id + ",");
         }
         strSql.delete(strSql.length() - 1, strSql.length());

+ 19 - 18
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -263,29 +263,30 @@ public class BookingCommentImplService implements BookingCommentService {
     @Override
     public PersonageDetailsVo personageDetails(String bookingCommentId) {
         PersonageDetailsVo vo = bookingCommentDao.personageDetails(bookingCommentId);
-        List<String> url = vo.getUrl();
-        List<String> houseUrl = vo.getHouseUrl();
-        if (url != null && url.size() > 0) {
-            String s = url.get(0);
-            String[] split = s.split(",");
-            ArrayList<String> strings = new ArrayList<>();
-            for (int i = 0; i < split.length; i++) {
-                strings.add(split[i]);
+        if (vo!=null) {
+            List<String> url = vo.getUrl();
+            List<String> houseUrl = vo.getHouseUrl();
+            if (url != null && url.size() > 0) {
+                String s = url.get(0);
+                String[] split = s.split(",");
+                ArrayList<String> strings = new ArrayList<>();
+                for (int i = 0; i < split.length; i++) {
+                    strings.add(split[i]);
+                }
+                vo.setUrl(strings);
             }
-            vo.setUrl(strings);
-        }
 
-        if (url != houseUrl && houseUrl.size() > 0) {
-            String s = houseUrl.get(0);
-            String[] split = s.split(",");
-            ArrayList<String> strings = new ArrayList<>();
-            for (int i = 0; i < split.length; i++) {
-                strings.add(split[i]);
+            if (url != houseUrl && houseUrl.size() > 0) {
+                String s = houseUrl.get(0);
+                String[] split = s.split(",");
+                ArrayList<String> strings = new ArrayList<>();
+                for (int i = 0; i < split.length; i++) {
+                    strings.add(split[i]);
+                }
+                vo.setHouseUrl(strings);
             }
-            vo.setHouseUrl(strings);
         }
 
-
         return vo;
     }