支付成功清空台桌就餐人数等信息
This commit is contained in:
@@ -1110,7 +1110,9 @@ public class CartService {
|
||||
// 去除餐位费信息
|
||||
|
||||
List<TbActivateOutRecord> outRecords = new ArrayList<>();
|
||||
int totalNum = 0;
|
||||
for (TbCashierCart cashierCart : cashierCartList) {
|
||||
totalNum += cashierCart.getNumber();
|
||||
if (!cashierCart.getProductId().equals("-999") && cashierCart.getIsVip().equals((byte) 1)) {
|
||||
List<TbActivateInRecord> actInRecords = activateInRecordService.queryAllByVipIdAndShopIdAndProId(
|
||||
Integer.valueOf(tbShopUser.getId()), Integer.valueOf(orderInfo.getShopId()), Integer.valueOf(cashierCart.getProductId()));
|
||||
@@ -1143,12 +1145,6 @@ public class CartService {
|
||||
|
||||
cashierCartList = cashierCartList.stream().filter(item -> !"-999".equals(item.getProductId())).collect(Collectors.toList());
|
||||
|
||||
|
||||
// 删除旧的餐位费信息
|
||||
// if (shopEatTypeInfoDTO.isTakeout() && seatCartInfo != null) {
|
||||
// cashierCartMapper.deleteByPrimaryKey(seatCartInfo.getId());
|
||||
// }
|
||||
|
||||
if (!CollectionUtils.isEmpty(outRecords)) outRecordMapper.insertBatch(outRecords);
|
||||
|
||||
// 打印票据
|
||||
@@ -1167,8 +1163,13 @@ public class CartService {
|
||||
}
|
||||
|
||||
// 修改台桌状态
|
||||
if (!shopEatTypeInfoDTO.isTakeout() && StrUtil.isNotBlank(tableId)) {
|
||||
mpShopTableService.updateStateByQrcode(tableId, TableConstant.ShopTable.State.USING);
|
||||
if (!shopEatTypeInfoDTO.isTakeout() && StrUtil.isNotBlank(tableId) && shopTable != null) {
|
||||
shopTable.setStatus(TableConstant.ShopTable.State.USING.getValue());
|
||||
shopTable.setProductNum(totalNum);
|
||||
shopTable.setTotalAmount(totalAmount);
|
||||
shopTable.setRealAmount(totalAmount);
|
||||
shopTable.setSeatNum(seatNum);
|
||||
mpShopTableService.updateById(shopTable);
|
||||
}
|
||||
|
||||
// 发送mq消息
|
||||
|
||||
@@ -527,12 +527,7 @@ public class PayService {
|
||||
|
||||
// 重置台桌状态
|
||||
if (StrUtil.isNotBlank(orderInfo.getTableId())) {
|
||||
TbShopTable shopTable = mpShopTableService.selectByQrcode(orderInfo.getTableId());
|
||||
if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) {
|
||||
mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.IDLE);
|
||||
}else {
|
||||
mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.CLEANING);
|
||||
}
|
||||
mpShopTableService.clearTableState(orderInfo.getTableId());
|
||||
}
|
||||
return Result.success(CodeEnum.SUCCESS, "1");
|
||||
}
|
||||
@@ -1154,12 +1149,7 @@ public class PayService {
|
||||
|
||||
// 重置台桌状态
|
||||
if (StrUtil.isNotBlank(orderInfo.getTableId())) {
|
||||
TbShopTable shopTable = mpShopTableService.selectByQrcode(orderInfo.getTableId());
|
||||
if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) {
|
||||
mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.IDLE);
|
||||
}else {
|
||||
mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.CLEANING);
|
||||
}
|
||||
mpShopTableService.clearTableState(orderInfo.getTableId());
|
||||
}
|
||||
return "SUCCESS";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user