|
|
@@ -145,21 +145,26 @@ public class AppHomePageImplService implements AppHomePageService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- houseList.forEach((House house) ->{
|
|
|
+ for (House house:houseList) {
|
|
|
+ if (house == null)
|
|
|
+ continue;
|
|
|
|
|
|
- if (!houseBookingMap.containsKey(Func.parseStr(house.getId()))) {
|
|
|
- house.setRemainRooms(Func.parseStr(house.getNumber()));
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
+ // 将房间图片,写入房型对象中
|
|
|
StringBuilder fileSqlx = new StringBuilder("");
|
|
|
- fileSqlx.append("and link_id = '").append(house.getId()).append("'");
|
|
|
+ fileSqlx.append(" and link_id = '").append(house.getId()).append("'");
|
|
|
List<FileInfo> fileInfoList = fileService.queryList(fileSqlx.toString());
|
|
|
+ house.setFileInfoList(fileInfoList);
|
|
|
|
|
|
+ // 进行累加数据,计算房型还剩余多少房间
|
|
|
+ if (!houseBookingMap.containsKey(Func.parseStr(house.getId()))) {
|
|
|
+ house.setRemainRooms(Func.parseStr(house.getNumber()));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
int i = Func.parseInt(house.getNumber()) - Func.parseInt(houseBookingMap.get(Func.parseStr(house.getId())));
|
|
|
house.setRemainRooms(Func.parseStr(i));
|
|
|
- house.setFileInfoList(fileInfoList);
|
|
|
- });
|
|
|
+
|
|
|
+ };
|
|
|
|
|
|
|
|
|
hotel.setHouseList(houseList);
|