|
@@ -1,4 +1,5 @@
|
|
|
package org.jeecg.modules.bus.controller;
|
|
package org.jeecg.modules.bus.controller;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.jeecg.annotation.ApiLogin;
|
|
import org.jeecg.annotation.ApiLogin;
|
|
|
|
|
+import org.jeecg.com.util.ThirdSessionHolder;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
@@ -22,10 +24,16 @@ import org.jeecg.common.util.TokenUtils;
|
|
|
import org.jeecg.config.ApiVersion;
|
|
import org.jeecg.config.ApiVersion;
|
|
|
import org.jeecg.config.ApiVersionConstant;
|
|
import org.jeecg.config.ApiVersionConstant;
|
|
|
import org.jeecg.config.WebConfig;
|
|
import org.jeecg.config.WebConfig;
|
|
|
|
|
+import org.jeecg.modules.business.dto.BookingOrderSaveDto;
|
|
|
import org.jeecg.modules.business.entity.BusHotel;
|
|
import org.jeecg.modules.business.entity.BusHotel;
|
|
|
import org.jeecg.modules.business.entity.BusMarketCouponsCashUsed;
|
|
import org.jeecg.modules.business.entity.BusMarketCouponsCashUsed;
|
|
|
|
|
+import org.jeecg.modules.business.entity.BusMemberCard;
|
|
|
import org.jeecg.modules.business.service.IBusHotelService;
|
|
import org.jeecg.modules.business.service.IBusHotelService;
|
|
|
|
|
+import org.jeecg.modules.business.service.IBusMemberCardService;
|
|
|
|
|
+import org.jeecg.modules.business.service.IBusRoomBookingOrdersService;
|
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
|
|
|
+import org.jeecg.modules.order.entity.CesOrderComment;
|
|
|
|
|
+import org.jeecg.modules.order.service.impl.CesOrderCommentServiceImpl;
|
|
|
import org.jeecg.modules.rooms.DTO.CanUseRequestParamDto;
|
|
import org.jeecg.modules.rooms.DTO.CanUseRequestParamDto;
|
|
|
import org.jeecg.modules.rooms.Vo.CanUseResultVo;
|
|
import org.jeecg.modules.rooms.Vo.CanUseResultVo;
|
|
|
import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
@@ -61,6 +69,12 @@ public class HotelController extends WebConfig {
|
|
|
private CesRoomLayoutServiceImpl cesRoomLayoutService;
|
|
private CesRoomLayoutServiceImpl cesRoomLayoutService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private CesRoomsServiceImpl cesRoomsService;
|
|
private CesRoomsServiceImpl cesRoomsService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private CesOrderCommentServiceImpl cesOrderCommentService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IBusRoomBookingOrdersService busRoomBookingOrdersService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IBusMemberCardService busMemberCardService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 酒店列表查询
|
|
* 酒店列表查询
|
|
@@ -119,6 +133,7 @@ public class HotelController extends WebConfig {
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "通过id查询酒店详情", notes = "通过id查询酒店详情")
|
|
@ApiOperation(value = "通过id查询酒店详情", notes = "通过id查询酒店详情")
|
|
|
@GetMapping(value = "/queryById")
|
|
@GetMapping(value = "/queryById")
|
|
|
|
|
+ @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
public Result<BusHotel> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
public Result<BusHotel> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
BusHotel busHotel = busHotelService.getById(id);
|
|
BusHotel busHotel = busHotelService.getById(id);
|
|
|
return Result.OK(busHotel);
|
|
return Result.OK(busHotel);
|
|
@@ -132,6 +147,7 @@ public class HotelController extends WebConfig {
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "根据酒店查询房型对应可用房间", notes = "根据酒店查询房型对应可用房间")
|
|
@ApiOperation(value = "根据酒店查询房型对应可用房间", notes = "根据酒店查询房型对应可用房间")
|
|
|
@GetMapping(value = "/can-user-rooms")
|
|
@GetMapping(value = "/can-user-rooms")
|
|
|
|
|
+ @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
public Result<List<CanUseResultVo>> getCanUseRooms(CanUseRequestParamDto param) {
|
|
public Result<List<CanUseResultVo>> getCanUseRooms(CanUseRequestParamDto param) {
|
|
|
if (param.getHotelId() == null || param.getHotelId().isEmpty())
|
|
if (param.getHotelId() == null || param.getHotelId().isEmpty())
|
|
|
throw new JeecgBootException("参数错误");
|
|
throw new JeecgBootException("参数错误");
|
|
@@ -139,4 +155,54 @@ public class HotelController extends WebConfig {
|
|
|
throw new JeecgBootException("请传入时间范围");
|
|
throw new JeecgBootException("请传入时间范围");
|
|
|
return Result.ok(cesRoomsService.getCanUseRooms(param));
|
|
return Result.ok(cesRoomsService.getCanUseRooms(param));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据酒店查询评价列表
|
|
|
|
|
+ * @param cesOrderComment
|
|
|
|
|
+ * @param pageNo
|
|
|
|
|
+ * @param pageSize
|
|
|
|
|
+ * @param req
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value="根据酒店查询评价列表", notes="根据酒店查询评价列表")
|
|
|
|
|
+ @GetMapping(value = "/comment-list")
|
|
|
|
|
+ @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
|
|
+ public Result<IPage<CesOrderComment>> getCommentPageList(CesOrderComment cesOrderComment,
|
|
|
|
|
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
|
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
+ LambdaQueryWrapper<CesOrderComment> queryWrapper = QueryGenerator.initQueryWrapper(cesOrderComment, req.getParameterMap()).lambda();
|
|
|
|
|
+ Page<CesOrderComment> page = new Page<CesOrderComment>(pageNo, pageSize);
|
|
|
|
|
+ IPage<CesOrderComment> pageList = cesOrderCommentService.page(page, queryWrapper);
|
|
|
|
|
+ return Result.OK(pageList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 酒店预定订单添加
|
|
|
|
|
+ * @param busRoomBookingOrders
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @AutoLog(value = "酒店预定订单-添加")
|
|
|
|
|
+ @ApiOperation(value="酒店预定订单-添加", notes="酒店预定订单-添加")
|
|
|
|
|
+ @PostMapping(value = "/hotel-room-booking")
|
|
|
|
|
+ @ApiLogin
|
|
|
|
|
+ @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
|
|
+ public Result<String> hotelRoomBookingAdd(@RequestBody BookingOrderSaveDto busRoomBookingOrders) {
|
|
|
|
|
+ Boolean isTeam = busRoomBookingOrders.getOrderInfo().getBookingOrdersType().equals(2);
|
|
|
|
|
+ busRoomBookingOrders.getOrderInfo().setBookingOrdersType(1);
|
|
|
|
|
+ String tenantId = TenantContextHolder.getTenantId();
|
|
|
|
|
+ String userId = ThirdSessionHolder.getUserId();
|
|
|
|
|
+ LambdaQueryWrapper<BusMemberCard> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(BusMemberCard::getUserId, userId);
|
|
|
|
|
+ lambdaQueryWrapper.eq(BusMemberCard::getHotelId, busRoomBookingOrders.getHotelId());
|
|
|
|
|
+ Long count = busMemberCardService.count(lambdaQueryWrapper);
|
|
|
|
|
+ if (count > 0) {
|
|
|
|
|
+ busRoomBookingOrders.getOrderInfo().setCustomerType(2);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ busRoomBookingOrders.getOrderInfo().setCustomerType(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Result.OK("预定成功", busRoomBookingOrdersService.bookingOrderSave(busRoomBookingOrders, isTeam));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|