|
|
@@ -24,6 +24,7 @@ import org.jeecg.common.util.TokenUtils;
|
|
|
import org.jeecg.config.ApiVersion;
|
|
|
import org.jeecg.config.ApiVersionConstant;
|
|
|
import org.jeecg.modules.business.entity.BusHotel;
|
|
|
+import org.jeecg.modules.business.entity.BusMarketCouponsCashUsed;
|
|
|
import org.jeecg.modules.business.service.IBusHotelService;
|
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
|
import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
|
@@ -81,39 +82,40 @@ public class HotelController extends WebConfig {
|
|
|
return Result.OK(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 可入住酒店列表
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param sort 0推荐排序 1 距离优先 2低价优先 3评分优先 4评论数优先
|
|
|
+ * @param keyWord 搜索关键字
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value="可入住酒店列表", notes="可入住酒店列表")
|
|
|
@GetMapping(value = "/can-use-hotel-list")
|
|
|
@ApiLogin
|
|
|
@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
- public Result<List<BusHotel>> getCanUseHotelList(BusHotel busHotel, HttpServletRequest req) {
|
|
|
- LambdaQueryWrapper<BusHotel> queryWrapper = QueryGenerator.initQueryWrapper(busHotel, req.getParameterMap()).lambda();
|
|
|
- if (StringUtils.isNotBlank(busHotel.getKeyWord())) {
|
|
|
- queryWrapper.and(t -> {
|
|
|
- t.like(BusHotel::getAddress, busHotel.getKeyWord());
|
|
|
- t.or().like(BusHotel::getName, busHotel.getKeyWord());
|
|
|
- t.or().like(BusHotel::getIntroduction, busHotel.getKeyWord());
|
|
|
- });
|
|
|
- }
|
|
|
+ public Result<IPage<BusHotel>> getCanUseHotelList( @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ @RequestParam(name = "sort", defaultValue = "0") Integer sort,
|
|
|
+ @RequestParam(name = "keyWord", defaultValue = "") String keyWord,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Page<BusHotel> page = new Page<BusHotel>(pageNo, pageSize);
|
|
|
String tenantId = TenantContextHolder.getTenantId();
|
|
|
- if (StringUtils.isNotBlank(tenantId)) {
|
|
|
- queryWrapper.eq(BusHotel::getTenantId, tenantId);
|
|
|
- }
|
|
|
- queryWrapper.eq(BusHotel::getStatus, 1);
|
|
|
- queryWrapper.eq(BusHotel::getCheckStatus, 1);
|
|
|
- queryWrapper.eq(BusHotel::getDelFlag, 0);
|
|
|
- List<BusHotel> list = busHotelService.list(queryWrapper);
|
|
|
- list.forEach(t -> {
|
|
|
- LambdaQueryWrapper<CesRoomLayout> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(CesRoomLayout::getHotelId, t.getId());
|
|
|
- lambdaQueryWrapper.orderByAsc(CesRoomLayout::getMarketPrice).last("limit 1");
|
|
|
- CesRoomLayout cesRoomLayout = cesRoomLayoutService.getOne(lambdaQueryWrapper);
|
|
|
- if (cesRoomLayout != null) {
|
|
|
- t.setMinPrice(cesRoomLayout.getMarketPrice());
|
|
|
- }
|
|
|
- if (ObjectUtils.isNotEmpty(busHotel.getLat()) && ObjectUtils.isNotEmpty(busHotel.getLng())) {
|
|
|
+ IPage<BusHotel> pageList = busHotelService.pageList(page, tenantId, keyWord, sort);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
- return Result.OK(list);
|
|
|
+ /**
|
|
|
+ * 通过id查询酒店详情
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value="通过id查询酒店详情", notes="通过id查询酒店详情")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<BusHotel> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
+ BusHotel busHotel = busHotelService.getById(id);
|
|
|
+ return Result.OK(busHotel);
|
|
|
}
|
|
|
}
|