Browse Source

更新文件 AppHomePageAction.java

陈士柏 2 years ago
parent
commit
6dd25aecf3
1 changed files with 8 additions and 3 deletions
  1. 8 3
      mhotel/src/com/happy/action/AppHomePageAction.java

+ 8 - 3
mhotel/src/com/happy/action/AppHomePageAction.java

@@ -373,9 +373,14 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
                             hotel.setRoom_number_calc(mhd.get().getTotalHouseNum().toString());
                         }
                     }
-
-                    Optional<HotelPriceOneDataVo> one = newOneDatas.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
-                    Optional<PriceHotelDataVo> min = mins.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
+                    Optional<HotelPriceOneDataVo> one = null;
+                    if (!newOneDatas.isEmpty()){
+                        one = newOneDatas.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
+                    }
+                    Optional<PriceHotelDataVo> min = null;
+                    if (mins!=null){
+                        min = mins.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
+                    }
                     if (one != null && one.isPresent() && min != null && min.isPresent()) {
                         if(one.get().getPrice() > min.get().getPrice()){
                             hotel.setMin_price(decimalFormat.format(min.get().getPrice()));