|
|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -32,6 +33,7 @@ import org.jeecg.modules.business.dto.BookingOrderSaveDto;
|
|
|
import org.jeecg.modules.business.entity.*;
|
|
|
import org.jeecg.modules.business.enums.CheckInTypeEnum;
|
|
|
import org.jeecg.modules.business.service.*;
|
|
|
+import org.jeecg.modules.business.service.impl.BusRoomPayTypeServiceImpl;
|
|
|
import org.jeecg.modules.business.vo.KeLiItemVo;
|
|
|
import org.jeecg.modules.mall.entity.MallHotelOrder;
|
|
|
import org.jeecg.modules.mall.entity.MallOrderGoods;
|
|
|
@@ -49,6 +51,7 @@ import org.jeecg.modules.mall.entity.MallUserInfo;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
|
import org.jeecg.modules.wxuser.service.IUserInfoService;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -113,6 +116,10 @@ public class HotelController extends WebConfig {
|
|
|
private ISysBaseAPI sysBaseAPI;
|
|
|
@Resource
|
|
|
private ISysUserService sysUserService;
|
|
|
+ @Resource
|
|
|
+ private BusRoomPayTypeServiceImpl busRoomPayTypeService;
|
|
|
+ @Resource
|
|
|
+ private IBusLivingCustomerService busLivingCustomerService;
|
|
|
/**
|
|
|
* 酒店列表查询
|
|
|
*
|
|
|
@@ -490,6 +497,7 @@ public class HotelController extends WebConfig {
|
|
|
String tenantId = TenantContextHolder.getTenantId();
|
|
|
String userId = ThirdSessionHolder.getUserId();
|
|
|
LambdaQueryWrapper<BusRoomsLivingOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(BusRoomsLivingOrder::getSettleType,-1);
|
|
|
lambdaQueryWrapper.eq(BusRoomsLivingOrder::getThirdLoginUserId, userId).orderByDesc(BusRoomsLivingOrder::getCreateTime).last("limit 1");
|
|
|
BusRoomsLivingOrder busRoomsLivingOrder = busRoomsLivingOrderService.getOne(lambdaQueryWrapper);
|
|
|
if (busRoomsLivingOrder != null && StringUtils.isNotBlank(busRoomsLivingOrder.getBookingOrderId())) {
|
|
|
@@ -501,7 +509,15 @@ public class HotelController extends WebConfig {
|
|
|
if (cesRooms != null) {
|
|
|
busHotel = busHotelService.getById(cesRooms.getHotelId());
|
|
|
busHotel.setRoomName(cesRooms.getName());
|
|
|
+ CesRoomLayout cesRoomLayout = cesRoomLayoutService.getById(cesRooms.getLayoutId());
|
|
|
+ busHotel.setCesRoomLayout(cesRoomLayout);
|
|
|
busHotel.setLivingOrder(busRoomsLivingOrder);
|
|
|
+ LambdaQueryWrapper<BusLivingCustomer> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper2.eq(BusLivingCustomer::getLivingOrderId, busRoomsLivingOrder.getId());
|
|
|
+ List<BusLivingCustomer> livingCustomers = busLivingCustomerService.list(lambdaQueryWrapper2);
|
|
|
+ if (livingCustomers != null && livingCustomers.size() > 0) {
|
|
|
+ busHotel.setBusLivingCustomer(livingCustomers.get(0));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -977,8 +993,21 @@ public class HotelController extends WebConfig {
|
|
|
@RequestMapping(value = "/living-settle-checkout",method = RequestMethod.POST)
|
|
|
@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
@ApiLogin
|
|
|
- public Result<Boolean> livingSettleBillCheckOut(@RequestBody List<BusOrderFee> fees, String livingOrderId) {
|
|
|
- Boolean isOk = busRoomBookingOrdersService.livingSettleBillCheckOut(fees,livingOrderId);
|
|
|
+ public Result<Boolean> livingSettleBillCheckOut(@RequestBody List<BusOrderFee> fees,@RequestParam(name = "livingOrderId") String livingOrderId,@RequestParam(name = "hotelId") String hotelId) {
|
|
|
+ if (fees != null && fees.size() > 0) {
|
|
|
+ LambdaQueryWrapper<BusRoomPayType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(BusRoomPayType::getHotelId, hotelId);
|
|
|
+ List<BusRoomPayType> list = busRoomPayTypeService.list(lambdaQueryWrapper);
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ Optional<BusRoomPayType> optional = list.stream().filter(t -> t.getName().contains("现金")).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ fees.get(0).setPayType(optional.get().getId());
|
|
|
+ } else {
|
|
|
+ fees.get(0).setPayType(list.get(0).getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Boolean isOk = busRoomBookingOrdersService.settleBillCheckOut(fees, livingOrderId);
|
|
|
return Result.OK(isOk);
|
|
|
}
|
|
|
|
|
|
@@ -990,8 +1019,20 @@ public class HotelController extends WebConfig {
|
|
|
@RequestMapping(value = "/continue-living",method = RequestMethod.POST)
|
|
|
@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
@ApiLogin
|
|
|
- public Result<Boolean> continueLiving(@RequestBody BusOrderFee fees, Date dueOutTime,String livingOrderId , String hotelId) {
|
|
|
- Boolean isOk = busRoomBookingOrdersService.continueLiving(fees,dueOutTime,livingOrderId,hotelId);
|
|
|
+ public Result<Boolean> continueLiving(@RequestBody BusOrderFee fees,@RequestParam(name = "dueOutTime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm") Date dueOutTime, @RequestParam(name = "livingOrderId") String livingOrderId ,@RequestParam(name = "hotelId") String hotelId) {
|
|
|
+ LambdaQueryWrapper<BusRoomPayType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(BusRoomPayType::getHotelId, hotelId);
|
|
|
+ fees.setPayType("");
|
|
|
+ List<BusRoomPayType> list = busRoomPayTypeService.list(lambdaQueryWrapper);
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ Optional<BusRoomPayType> optional = list.stream().filter(t -> t.getName().contains("微信")).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ fees.setPayType(optional.get().getId());
|
|
|
+ } else {
|
|
|
+ fees.setPayType(list.get(0).getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Boolean isOk = busRoomBookingOrdersService.continueLiving(fees, dueOutTime, livingOrderId, hotelId);
|
|
|
return Result.OK(isOk);
|
|
|
}
|
|
|
}
|