1.排队取号 增加叫号状态接口

This commit is contained in:
2024-09-14 17:01:05 +08:00
parent 21d35b3f22
commit 75a07add94
4 changed files with 32 additions and 1 deletions

View File

@@ -55,4 +55,12 @@ public class TbCallTableController {
return Result.successWithData(tbCallService.cancel(cancelCallQueueDTO));
}
@GetMapping("state")
public Result getState(
@RequestParam String openId,
@RequestParam Integer shopId
) {
return Result.successWithData(tbCallService.getState(openId, shopId));
}
}

View File

@@ -106,6 +106,11 @@ public class TbCallQueue implements Serializable {
*/
private String callNum;
/**
* 创建年月日
*/
private String createDay;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@@ -138,7 +143,8 @@ public class TbCallQueue implements Serializable {
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
&& (this.getSubState() == null ? other.getSubState() == null : this.getSubState().equals(other.getSubState()))
&& (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))
&& (this.getCallNum() == null ? other.getCallNum() == null : this.getCallNum().equals(other.getCallNum()));
&& (this.getCallNum() == null ? other.getCallNum() == null : this.getCallNum().equals(other.getCallNum()))
&& (this.getCreateDay() == null ? other.getCreateDay() == null : this.getCreateDay().equals(other.getCreateDay()));
}
@Override
@@ -163,6 +169,7 @@ public class TbCallQueue implements Serializable {
result = prime * result + ((getSubState() == null) ? 0 : getSubState().hashCode());
result = prime * result + ((getConfirmTime() == null) ? 0 : getConfirmTime().hashCode());
result = prime * result + ((getCallNum() == null) ? 0 : getCallNum().hashCode());
result = prime * result + ((getCreateDay() == null) ? 0 : getCreateDay().hashCode());
return result;
}
@@ -190,6 +197,7 @@ public class TbCallQueue implements Serializable {
sb.append(", subState=").append(subState);
sb.append(", confirmTime=").append(confirmTime);
sb.append(", callNum=").append(callNum);
sb.append(", createDay=").append(createDay);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

View File

@@ -11,4 +11,6 @@ public interface TbCallService {
Object getAllInfo(Integer shopId);
Object cancel(CancelCallQueueDTO cancelCallQueueDTO);
Object getState(String openId, Integer shopId);
}

View File

@@ -77,7 +77,9 @@ public class TbCallServiceImpl implements TbCallService {
TbCallQueue callQueue = callQueueService.lambdaQuery()
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
.eq(TbCallQueue::getOpenId, takeNumberDTO.getOpenId())
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
.eq(TbCallQueue::getCreateDay, DateUtil.today())
.in(TbCallQueue::getState, 0, 1)
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
if (callQueue != null) {
@@ -90,6 +92,7 @@ public class TbCallServiceImpl implements TbCallService {
callQueue.setShopId(shopInfo.getId());
callQueue.setShopName(shopInfo.getShopName());
callQueue.setCallNum(getCallNumber(takeNumberDTO.getShopId(), callTable));
callQueue.setCreateDay(DateUtil.today());
return callQueueService.save(callQueue);
}
@@ -111,4 +114,14 @@ public class TbCallServiceImpl implements TbCallService {
.set(TbCallQueue::getCallTime, DateUtil.date())
.set(TbCallQueue::getState, -1).update();
}
@Override
public Object getState(String openId, Integer shopId) {
return callQueueService.lambdaQuery()
.eq(TbCallQueue::getOpenId, openId)
.eq(TbCallQueue::getCreateDay, DateUtil.today())
.eq(TbCallQueue::getShopId, shopId)
.one();
}
}