1.排队取号 增加叫号状态接口
This commit is contained in:
@@ -55,4 +55,12 @@ public class TbCallTableController {
|
|||||||
return Result.successWithData(tbCallService.cancel(cancelCallQueueDTO));
|
return Result.successWithData(tbCallService.cancel(cancelCallQueueDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("state")
|
||||||
|
public Result getState(
|
||||||
|
@RequestParam String openId,
|
||||||
|
@RequestParam Integer shopId
|
||||||
|
) {
|
||||||
|
return Result.successWithData(tbCallService.getState(openId, shopId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ public class TbCallQueue implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String callNum;
|
private String callNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建年月日
|
||||||
|
*/
|
||||||
|
private String createDay;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private static final long serialVersionUID = 1L;
|
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.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
|
||||||
&& (this.getSubState() == null ? other.getSubState() == null : this.getSubState().equals(other.getSubState()))
|
&& (this.getSubState() == null ? other.getSubState() == null : this.getSubState().equals(other.getSubState()))
|
||||||
&& (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))
|
&& (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
|
@Override
|
||||||
@@ -163,6 +169,7 @@ public class TbCallQueue implements Serializable {
|
|||||||
result = prime * result + ((getSubState() == null) ? 0 : getSubState().hashCode());
|
result = prime * result + ((getSubState() == null) ? 0 : getSubState().hashCode());
|
||||||
result = prime * result + ((getConfirmTime() == null) ? 0 : getConfirmTime().hashCode());
|
result = prime * result + ((getConfirmTime() == null) ? 0 : getConfirmTime().hashCode());
|
||||||
result = prime * result + ((getCallNum() == null) ? 0 : getCallNum().hashCode());
|
result = prime * result + ((getCallNum() == null) ? 0 : getCallNum().hashCode());
|
||||||
|
result = prime * result + ((getCreateDay() == null) ? 0 : getCreateDay().hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +197,7 @@ public class TbCallQueue implements Serializable {
|
|||||||
sb.append(", subState=").append(subState);
|
sb.append(", subState=").append(subState);
|
||||||
sb.append(", confirmTime=").append(confirmTime);
|
sb.append(", confirmTime=").append(confirmTime);
|
||||||
sb.append(", callNum=").append(callNum);
|
sb.append(", callNum=").append(callNum);
|
||||||
|
sb.append(", createDay=").append(createDay);
|
||||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|||||||
@@ -11,4 +11,6 @@ public interface TbCallService {
|
|||||||
Object getAllInfo(Integer shopId);
|
Object getAllInfo(Integer shopId);
|
||||||
|
|
||||||
Object cancel(CancelCallQueueDTO cancelCallQueueDTO);
|
Object cancel(CancelCallQueueDTO cancelCallQueueDTO);
|
||||||
|
|
||||||
|
Object getState(String openId, Integer shopId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
|
|
||||||
TbCallQueue callQueue = callQueueService.lambdaQuery()
|
TbCallQueue callQueue = callQueueService.lambdaQuery()
|
||||||
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
||||||
|
.eq(TbCallQueue::getOpenId, takeNumberDTO.getOpenId())
|
||||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||||
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
.in(TbCallQueue::getState, 0, 1)
|
.in(TbCallQueue::getState, 0, 1)
|
||||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||||
if (callQueue != null) {
|
if (callQueue != null) {
|
||||||
@@ -90,6 +92,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
callQueue.setShopId(shopInfo.getId());
|
callQueue.setShopId(shopInfo.getId());
|
||||||
callQueue.setShopName(shopInfo.getShopName());
|
callQueue.setShopName(shopInfo.getShopName());
|
||||||
callQueue.setCallNum(getCallNumber(takeNumberDTO.getShopId(), callTable));
|
callQueue.setCallNum(getCallNumber(takeNumberDTO.getShopId(), callTable));
|
||||||
|
callQueue.setCreateDay(DateUtil.today());
|
||||||
return callQueueService.save(callQueue);
|
return callQueueService.save(callQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,4 +114,14 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
.set(TbCallQueue::getCallTime, DateUtil.date())
|
.set(TbCallQueue::getCallTime, DateUtil.date())
|
||||||
.set(TbCallQueue::getState, -1).update();
|
.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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user