台桌修改状态清除用餐人数

This commit is contained in:
2024-09-13 15:45:14 +08:00
parent 67af4f1463
commit 78ed984ef8

View File

@@ -233,6 +233,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
TbShopTable tbShopTable = tbShopTableRepository.findById(resources.getId()).orElseGet(TbShopTable::new);
ValidationUtil.isNull(tbShopTable.getId(), "TbShopTable", "id", resources.getId());
tbShopTable.copy(resources);
if ("idle".equals(resources.getStatus())) {
tbShopTable.setUseNum(0);
}
tbShopTableRepository.save(tbShopTable);
}
@@ -1461,6 +1464,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
.set(TbShopTable::getEndTime, DateUtil.date())
.set(TbShopTable::getUseNum, 0)
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
} else {
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()