叫号取消接口

This commit is contained in:
张松 2025-04-01 18:04:45 +08:00
parent 32de1b80b7
commit 2ce1d30f06
3 changed files with 22 additions and 0 deletions

View File

@ -77,5 +77,16 @@ public class UCallTableController {
return CzgResult.success(callTableService.subMsg(subMsgDTO));
}
/**
* 取消订阅
* @param queueId 队列id
* @param shopId 店铺id
* @return 是否成功
*/
@DeleteMapping("/cancel")
public CzgResult<Boolean> cancel(@RequestParam Long queueId, @RequestParam Long shopId) {
return CzgResult.success(callTableService.cancel(shopId, queueId));
}
}

View File

@ -40,4 +40,6 @@ public interface CallTableService extends IService<CallTable> {
boolean subMsg(CallSubMsgDTO subMsgDTO);
Object getStatus(Long shopId, String openId, Long queueId);
Boolean cancel(Long shopId, Long queueId);
}

View File

@ -613,4 +613,13 @@ public class CallTableServiceImpl extends ServiceImpl<CallTableMapper, CallTable
data.put("queueInfo", callQueueInfoVOS.isEmpty() ? null : callQueueInfoVOS.getFirst());
return data;
}
@Override
public Boolean cancel(Long shopId, Long queueId) {
return callQueueService.updateChain()
.eq(CallQueue::getShopId, shopId)
.eq(CallQueue::getId, queueId)
.set(CallQueue::getCallTime, DateUtil.date())
.set(CallQueue::getState, -1).update();
}
}