1.增加mybatisplus依赖

This commit is contained in:
2024-08-20 17:03:51 +08:00
parent 796f43299f
commit d8027c92b2
3 changed files with 78 additions and 38 deletions

View File

@@ -141,10 +141,10 @@ public class OrderService {
if ((StrUtil.isNotBlank(tableId))) {
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getQrcode, tableId)
.eq(TbShopTable::getStatus, "opening"));
.in(TbShopTable::getStatus, "idle", "opening"));
if (shopTable == null) {
return Result.fail("台桌不存在或未开台");
return Result.fail("台桌不处于开台或空闲状态");
}
}
@@ -389,14 +389,19 @@ public class OrderService {
}
int orderId = 0;
String uuid = "";
ArrayList<Integer> ids = new ArrayList<>();
for (TbCashierCart cashierCart : list) {
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
orderId = Integer.parseInt(cashierCart.getOrderId());
}
cashierCart.setStatus("create");
ids.add(cashierCart.getId());
}
mpCashierCartMapper.insertOrUpdate(list);
// mpCashierCartMapper.insertOrUpdate(list);
// cashierCartMapper.updateStatusByMaster(Integer.valueOf(shopId), masterId, "create", day, uuid);
mpCashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
.set(TbCashierCart::getStatus, "create")
.in(TbCashierCart::getId, ids));
if (orderId > 0) {
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
orderDetailMapper.updateStatusByOrderId(orderId, "cancelled");
@@ -908,13 +913,19 @@ public class OrderService {
return Result.fail(CodeEnum.CARTJH);
}
int orderId = 0;
ArrayList<Integer> ids = new ArrayList<>();
for (TbCashierCart cashierCart : list) {
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
orderId = Integer.parseInt(cashierCart.getOrderId());
}
cashierCart.setStatus("create");
ids.add(cashierCart.getId());
// cashierCart.setStatus("create");
// }
}
mpCashierCartMapper.insertOrUpdate(list);
mpCashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
.set(TbCashierCart::getStatus, "create")
.in(TbCashierCart::getId, ids));
// cashierCartMapper.updateStatusByMaster(shopId, masterId, "create", day, uuid);
if (orderId > 0) {
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");