台桌修改状态清除用餐人数
This commit is contained in:
@@ -233,6 +233,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
TbShopTable tbShopTable = tbShopTableRepository.findById(resources.getId()).orElseGet(TbShopTable::new);
|
TbShopTable tbShopTable = tbShopTableRepository.findById(resources.getId()).orElseGet(TbShopTable::new);
|
||||||
ValidationUtil.isNull(tbShopTable.getId(), "TbShopTable", "id", resources.getId());
|
ValidationUtil.isNull(tbShopTable.getId(), "TbShopTable", "id", resources.getId());
|
||||||
tbShopTable.copy(resources);
|
tbShopTable.copy(resources);
|
||||||
|
if ("idle".equals(resources.getStatus())) {
|
||||||
|
tbShopTable.setUseNum(0);
|
||||||
|
}
|
||||||
tbShopTableRepository.save(tbShopTable);
|
tbShopTableRepository.save(tbShopTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1461,6 +1464,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
.set(TbShopTable::getEndTime, DateUtil.date())
|
.set(TbShopTable::getEndTime, DateUtil.date())
|
||||||
|
.set(TbShopTable::getUseNum, 0)
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
} else {
|
} else {
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
|||||||
Reference in New Issue
Block a user