台桌预订改造

This commit is contained in:
谭凯凯 2024-12-18 10:34:13 +08:00 committed by Tankaikai
parent 099f5f58a5
commit 41faaf4808
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
@ -172,6 +173,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
}
@Override
@Transactional(rollbackFor = Exception.class)
public void markStatus(Long id, Integer status) {
if (id == null) {
throw new BadRequestException("id不能为空");
@ -191,6 +193,10 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
entity.setArrivedTime(null);
}
super.updateById(entity);
mpShopTableMapper.update(Wrappers.<TbShopTable>lambdaUpdate()
.set(TbShopTable::getStatus, "idle")
.eq(TbShopTable::getStatus, "subscribe")
.eq(TbShopTable::getId, entity.getShopTableId()));
}
@Override