排队取号顺延之后支持重复取号
This commit is contained in:
@@ -59,7 +59,7 @@ public class TbCallQueue {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@Column(name = "cancel_time")
|
@Column(name = "cancel_time")
|
||||||
private Date cancelTime;
|
private Date cancelTime;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@Column(name = "confirm_time")
|
@Column(name = "confirm_time")
|
||||||
private Date confirmTime;
|
private Date confirmTime;
|
||||||
@@ -84,4 +84,7 @@ public class TbCallQueue {
|
|||||||
@Column(name = "create_day")
|
@Column(name = "create_day")
|
||||||
private String createDay;
|
private String createDay;
|
||||||
|
|
||||||
|
@Column(name = "is_postpone")
|
||||||
|
private Integer isPostpone;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||||
.in(TbCallQueue::getState, 0, 1)
|
.in(TbCallQueue::getState, 0, 1)
|
||||||
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
|
.eq(TbCallQueue::getIsPostpone, 0)
|
||||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||||
if (callQueue != null) {
|
if (callQueue != null) {
|
||||||
throw new BadRequestException("当前用户已取号");
|
throw new BadRequestException("当前用户已取号");
|
||||||
@@ -182,6 +183,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
||||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||||
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
|
.eq(TbCallQueue::getIsPostpone, 0)
|
||||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||||
if (callQueue != null) {
|
if (callQueue != null) {
|
||||||
throw new BadRequestException("当前用户已取号");
|
throw new BadRequestException("当前用户已取号");
|
||||||
@@ -323,6 +325,8 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
callQueue.setPassTime(DateUtil.date());
|
callQueue.setPassTime(DateUtil.date());
|
||||||
|
// 已经顺延
|
||||||
|
callQueue.setIsPostpone(1);
|
||||||
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
|
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
|
||||||
if (shopInfo == null) {
|
if (shopInfo == null) {
|
||||||
throw new BadRequestException("店铺信息不存在");
|
throw new BadRequestException("店铺信息不存在");
|
||||||
@@ -337,7 +341,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
Integer postponeNum = callTable.getPostponeNum();
|
Integer postponeNum = callTable.getPostponeNum();
|
||||||
|
|
||||||
// 判断是否需要顺延
|
// 判断是否需要顺延
|
||||||
if (isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
|
if (callQueue.getIsPostpone() == 0 && isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
|
||||||
// 查询当前桌以及顺延桌数
|
// 查询当前桌以及顺延桌数
|
||||||
List<TbCallQueue> current = callQueueService.lambdaQuery()
|
List<TbCallQueue> current = callQueueService.lambdaQuery()
|
||||||
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())
|
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())
|
||||||
|
|||||||
Reference in New Issue
Block a user