1.创建订单普通下单不沿用上笔

This commit is contained in:
SongZhang 2024-09-06 10:38:10 +08:00
parent e086c4df95
commit eb1603a4ee
1 changed files with 5 additions and 5 deletions

View File

@ -635,14 +635,14 @@ public class OrderService {
}
@Transactional(rollbackFor = Exception.class)
public Result createOrder(OrderVo orderVo, String clientType, String token, Integer oldOrderId, boolean isPrint) {
public Result createOrder(OrderVo orderVo, String clientType, String token, Integer oldOrderId, boolean isPost) {
String day = DateUtils.getDay();
TbShopTable shopTable = null;
String currentOrderKey = RedisCst.getCurrentOrderKey(orderVo.getTableId(),
orderVo.getShopId().toString());
String orderIdValue = redisUtil.getMessage(currentOrderKey);
Integer orderId = orderIdValue == null ? 0 : Integer.parseInt(orderIdValue);
Integer orderId = isPost ? orderIdValue == null ? 0 : Integer.parseInt(orderIdValue) : 0;
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
.eq(TbCashierCart::getShopId, orderVo.getShopId())
@ -755,7 +755,7 @@ public class OrderService {
if (orderInfo == null || !"unpaid".equals(orderInfo.getStatus())) {
redisUtil.deleteByKey(currentOrderKey);
}
if (orderId > 0 && orderInfo != null) {
if (orderInfo != null && orderId > 0) {
// if (!orderInfo.getStatus().equals("unpaid")){
// return Result.fail(CodeEnum.ORDERCREATE);
// }
@ -819,7 +819,7 @@ public class OrderService {
redisUtil.saveMessage(RedisCst.OUT_NUMBER.concat(orderInfo.getShopId()),object.toString());
orderId = orderInfo.getId();
if (isPrint) {
if (isPost) {
redisUtil.saveMessage(currentOrderKey, orderInfo.getId().toString());
}
@ -874,7 +874,7 @@ public class OrderService {
}
if (!StrUtil.isBlank(orderVo.getTableId())) {
if (isPrint) {
if (isPost) {
producer.printMechine(String.valueOf(orderId));
}
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()