|
|
@@ -37,39 +37,17 @@ public class CesRoomLayoutMemberPriceServiceImpl extends ServiceImpl<CesRoomLayo
|
|
|
private BusMarketMemberServiceImpl marketMemberService;
|
|
|
|
|
|
|
|
|
- public List<CesRoomLayoutMemberPrice> getListByParentId(String parentId){
|
|
|
- if(StringUtils.isBlank(parentId)) return new ArrayList<>();
|
|
|
- List<CesRoomLayoutMemberPrice> list = cesRoomLayoutMemberPriceMapper.selectList(Wrappers.<CesRoomLayoutMemberPrice>lambdaQuery()
|
|
|
- .eq(CesRoomLayoutMemberPrice::getParentId,parentId)
|
|
|
- .eq(CesRoomLayoutMemberPrice::getInvalid,false));
|
|
|
-
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 获取会员等级数据
|
|
|
* @param parentId
|
|
|
- * @param hotelId
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result getListByHotelIdAndParentId(String parentId,String hotelId){
|
|
|
+ public List<CesRoomLayoutMemberPrice> getListByParentId(String parentId){
|
|
|
+ if(StringUtils.isBlank(parentId)) return new ArrayList<>();
|
|
|
List<CesRoomLayoutMemberPrice> list = cesRoomLayoutMemberPriceMapper.selectList(Wrappers.<CesRoomLayoutMemberPrice>lambdaQuery()
|
|
|
.eq(CesRoomLayoutMemberPrice::getParentId,parentId)
|
|
|
- .eq(CesRoomLayoutMemberPrice::getHotelId,hotelId)
|
|
|
.eq(CesRoomLayoutMemberPrice::getInvalid,false));
|
|
|
- List<String> memberIds = list.stream().map(v -> v.getId()).collect(Collectors.toList());
|
|
|
- List<BusMarketMember> marketMembers = marketMemberService.getByIds(memberIds,hotelId);
|
|
|
- List<LayoutMemberPriceVo> vos = new ArrayList<>();
|
|
|
- list.forEach(v -> {
|
|
|
- LayoutMemberPriceVo vo = new LayoutMemberPriceVo();
|
|
|
- BeanUtil.copyProperties(v,vo);
|
|
|
- Optional<BusMarketMember> marketMemberOptional = marketMembers.stream().filter(c -> c.getId().equals(v.getLevelId())).findFirst();
|
|
|
- if(marketMemberOptional.isPresent()) vo.setMemberName(marketMemberOptional.get().getName());
|
|
|
- vos.add(vo);
|
|
|
- });
|
|
|
- return Result.OK(vos);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|