支付成功清空台桌就餐人数等信息
This commit is contained in:
@@ -17,4 +17,10 @@ public interface MpShopTableService extends IService<TbShopTable> {
|
||||
* @param tableId qrcode
|
||||
*/
|
||||
TbShopTable selectByQrcode(String tableId);
|
||||
|
||||
/**
|
||||
* 清除台桌状态
|
||||
* @param tableId 台桌id
|
||||
*/
|
||||
boolean clearTableState(String tableId);
|
||||
}
|
||||
|
||||
@@ -25,4 +25,21 @@ public class MpShopTableServiceImpl extends ServiceImpl<MpShopTableMapper, TbSho
|
||||
return getOne(new LambdaQueryWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, tableId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean clearTableState(String tableId) {
|
||||
TbShopTable shopTable = selectByQrcode(tableId);
|
||||
if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) {
|
||||
return update(new LambdaUpdateWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, tableId)
|
||||
.set(TbShopTable::getUseTime, null)
|
||||
.set(TbShopTable::getProductNum, 0)
|
||||
.set(TbShopTable::getTotalAmount, 0)
|
||||
.set(TbShopTable::getRealAmount, 0)
|
||||
.set(TbShopTable::getUseNum, 0)
|
||||
.set(TbShopTable::getStatus, TableConstant.ShopTable.State.CLEANING.getValue()));
|
||||
}else {
|
||||
return updateStateByQrcode(tableId, TableConstant.ShopTable.State.CLEANING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user