|
|
@@ -3,20 +3,20 @@ package org.dromara.hotel.service.impl;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.dromara.common.core.constant.CacheNames;
|
|
|
+import org.dromara.common.core.constant.*;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.backstage.api.RemotePtRoomService;
|
|
|
-import org.dromara.common.core.constant.DefaultConstants;
|
|
|
-import org.dromara.common.core.constant.HotelBusinessConstants;
|
|
|
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.SmsUtils;
|
|
|
import org.dromara.common.core.utils.SpringUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
@@ -36,6 +36,7 @@ import org.dromara.hotel.service.IKfTeamService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.Duration;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
|
|
|
@@ -53,7 +54,6 @@ public class KfOrderServiceImpl implements IKfOrderService {
|
|
|
|
|
|
private final KfOrderMapper baseMapper;
|
|
|
private final IKfTeamService teamService;
|
|
|
- private final KfGuestMapper guestMapper;
|
|
|
private final IKfGuestTeamRService guestTeamService;
|
|
|
|
|
|
/**
|
|
|
@@ -272,6 +272,29 @@ public class KfOrderServiceImpl implements IKfOrderService {
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R<Void> phoneCheckIn(String phone, String phoneCode) {
|
|
|
+ //1.校验验证码
|
|
|
+ if(RedisUtils.isExistsObject(SmsUtils.PHONE_CODE_PREFIX + phone)){
|
|
|
+ if(RedisUtils.getCacheObject(SmsUtils.PHONE_CODE_PREFIX + phone).equals(phoneCode)){
|
|
|
+ //2.根据手机号查询团客信息
|
|
|
+ KfGuestBo guestBo = new KfGuestBo();
|
|
|
+ guestBo.setPhone(phone);
|
|
|
+ R<KfTeamGuestVo> teamGuestVoR = getTeamGuestCheckInfo(guestBo);
|
|
|
+ //3.报到
|
|
|
+ if(teamGuestCheckIn(teamGuestVoR.getData())){
|
|
|
+ return R.ok();
|
|
|
+ }else {
|
|
|
+ return R.fail("报到失败");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return R.fail("验证码错误");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return R.fail("验证码错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean updateOrderAndRoomStatus(KfOrderBo bo) {
|
|
|
if(ObjectUtil.isNotEmpty(bo)){
|