Parcourir la source

查询使用卫生间信息

chejianzheng il y a 3 mois
Parent
commit
29b73e732e
1 fichiers modifiés avec 20 ajouts et 2 suppressions
  1. 20 2
      src/main/java/com/wxxcx/index/WxxcxIndexController.java

+ 20 - 2
src/main/java/com/wxxcx/index/WxxcxIndexController.java

@@ -1969,8 +1969,26 @@ public class WxxcxIndexController<AesException extends Throwable> {
         }
         if (Objects.nonNull(stayTimes) && stayTimes.size() > 0) {
 
-            List<StayTime> roomList = stayTimes.stream().filter(stayTime -> 0 == (stayTime.getType())).collect(Collectors.toList());
-            List<StayTime> toiletList = stayTimes.stream().filter(stayTime -> 1 == stayTime.getType()).collect(Collectors.toList());
+            List<StayTime> roomList = stayTimes.stream().filter(stayTime ->
+                    {
+                        if (stayTime != null && stayTime.getType() != null) {
+                            if (0 == (stayTime.getType())) {
+                                return true;
+                            }
+                        }
+                        return false;
+                    }
+            ).collect(Collectors.toList());
+            List<StayTime> toiletList = stayTimes.stream().filter(stayTime ->
+                    {
+                        if (stayTime != null && stayTime.getType() != null) {
+                            if (1 == (stayTime.getType())) {
+                                return true;
+                            }
+                        }
+                        return false;
+                    }
+                    ).collect(Collectors.toList());
 
             if (!CollectionUtils.isEmpty(roomList)) {
                 for (StayTime stayTime : roomList) {