|
|
@@ -17,6 +17,7 @@ import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.enums.HotelRoomStatusEnum;
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
+import org.dromara.common.core.utils.SpringUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
@@ -346,6 +347,25 @@ public class KfOrderServiceImpl implements IKfOrderService {
|
|
|
return baseMapper.selectByBo(bo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public boolean checkInTeamFromRoomStatus(KfOrderBo bo) {
|
|
|
+ // 查询 客人信息 是否有存在的订单
|
|
|
+ LambdaQueryWrapper<KfOrder> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ List<String> orderStatusYd = List.of(HotelBusinessConstants.ORDER_STATUS_YD, HotelBusinessConstants.ORDER_STATUS_RZ);
|
|
|
+ queryWrapper.in(KfOrder::getOrderStatus, orderStatusYd);
|
|
|
+ queryWrapper.and(e -> e.eq(KfOrder::getRoomCode, bo.getRoomCode()).or().eq(KfOrder::getGuestId, bo.getGuestId()));
|
|
|
+ // 已入住、已预定 不能再入住
|
|
|
+ // 房间状态是否为ok房 其他房不能入住
|
|
|
+ if(baseMapper.selectCount(queryWrapper) > 0){
|
|
|
+ throw new ServiceException("不能办理入住,原因:1.已入住或已预定,2.房间不是OK房");
|
|
|
+ }
|
|
|
+ //办理入住
|
|
|
+ RemoteOrderVo remoteOrderVo = checkInTeamByBoPrivate(bo);
|
|
|
+
|
|
|
+ return remoteOrderVo != null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 办理团客入住
|
|
|
*
|
|
|
@@ -353,9 +373,14 @@ public class KfOrderServiceImpl implements IKfOrderService {
|
|
|
* @return 入住信息
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public RemoteOrderVo checkInTeamByBo(RemoteOrderBo remoteBo) {
|
|
|
- List<String> orderStatusList = Arrays.asList("1", "2");
|
|
|
KfOrderBo bo = MapstructUtils.convert(remoteBo, KfOrderBo.class);
|
|
|
+ return checkInTeamByBoPrivate(bo);
|
|
|
+ }
|
|
|
+
|
|
|
+ private RemoteOrderVo checkInTeamByBoPrivate(KfOrderBo bo) {
|
|
|
+ List<String> orderStatusList = Arrays.asList("1", "2");
|
|
|
if (bo != null) {
|
|
|
KfOrderVo vo = baseMapper.selectVoOne(
|
|
|
new LambdaQueryWrapper<KfOrder>()
|