shenzhongzheng 2 년 전
부모
커밋
27237c00b2

+ 4 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/controller/CesRoomLayoutMemberPriceController.java

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -42,15 +43,13 @@ public class CesRoomLayoutMemberPriceController extends JeecgController<CesRoomL
         @AutoLog(value = "获取会员等级价格")
         @AutoLog(value = "获取会员等级价格")
         @ApiOperation(value="获取会员等级价格", notes="获取会员等级价格")
         @ApiOperation(value="获取会员等级价格", notes="获取会员等级价格")
         @GetMapping(value = "/getListByParentId")
         @GetMapping(value = "/getListByParentId")
-        public Result getListByParentId(String parentId,String hotelId){
+        public Result getListByParentId(String parentId){
             if(StringUtils.isBlank(parentId)){
             if(StringUtils.isBlank(parentId)){
                 return Result.error(ResultCode.PARAM_MISS);
                 return Result.error(ResultCode.PARAM_MISS);
             }
             }
-            if(StringUtils.isBlank(hotelId)){
-                return Result.error(ResultCode.PARAM_MISS);
-            }
             try{
             try{
-               return   memberPriceService.getListByHotelIdAndParentId(parentId,hotelId);
+                List<CesRoomLayoutMemberPrice>  memberPriceList = memberPriceService.getListByParentId(parentId);
+                return  Result.ok(memberPriceList);
             }catch (Exception e){
             }catch (Exception e){
                 return Result.error(e.getMessage());
                 return Result.error(e.getMessage());
             }
             }

+ 4 - 26
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/service/CesRoomLayoutMemberPriceServiceImpl.java

@@ -37,39 +37,17 @@ public class CesRoomLayoutMemberPriceServiceImpl extends ServiceImpl<CesRoomLayo
     private BusMarketMemberServiceImpl marketMemberService;
     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 parentId
-     * @param hotelId
      * @return
      * @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()
         List<CesRoomLayoutMemberPrice> list = cesRoomLayoutMemberPriceMapper.selectList(Wrappers.<CesRoomLayoutMemberPrice>lambdaQuery()
                 .eq(CesRoomLayoutMemberPrice::getParentId,parentId)
                 .eq(CesRoomLayoutMemberPrice::getParentId,parentId)
-                .eq(CesRoomLayoutMemberPrice::getHotelId,hotelId)
                 .eq(CesRoomLayoutMemberPrice::getInvalid,false));
                 .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;
+    }
 }
 }