1.代客下单 创建订单删除小程序购物车缓存
This commit is contained in:
@@ -333,7 +333,7 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
private final TbShopUserFlowMapper shopUserFlowMapper;
|
private final TbShopUserFlowMapper shopUserFlowMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId) {
|
public TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId, Double discount, Integer vipUserId) {
|
||||||
|
|
||||||
TbOrderInfo orderInfo = orderInfoMapper.selectById(orderId);
|
TbOrderInfo orderInfo = orderInfoMapper.selectById(orderId);
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
userFlow.setBalance(shopUser.getAmount());
|
userFlow.setBalance(shopUser.getAmount());
|
||||||
userFlow.setShopUserId(shopUser.getId());
|
userFlow.setShopUserId(shopUser.getId());
|
||||||
userFlow.setBizCode("vipCardCash");
|
userFlow.setBizCode("vipCardCash");
|
||||||
userFlow.setBizName("代客下单会员余额支付");
|
userFlow.setBizName("余额支付");
|
||||||
userFlow.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
userFlow.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
userFlow.setType("-");
|
userFlow.setType("-");
|
||||||
shopUserFlowMapper.insert(userFlow);
|
shopUserFlowMapper.insert(userFlow);
|
||||||
|
|||||||
@@ -368,10 +368,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
// 增加redis购物车数据
|
// 增加redis购物车数据
|
||||||
String tableCartKey = RedisConstant.getTableCartKey(addCartDTO.getTableId(), addCartDTO.getShopId().toString());
|
String tableCartKey = RedisConstant.getTableCartKey(addCartDTO.getTableId(), addCartDTO.getShopId().toString());
|
||||||
String tableCart = redisTemplate.opsForValue().get(tableCartKey);
|
String tableCart = redisTemplate.opsForValue().get(tableCartKey);
|
||||||
List<TbCashierCart> cartArrayList = new ArrayList<>();
|
|
||||||
if (tableCart != null) {
|
|
||||||
cartArrayList = JSONObject.parseArray(tableCart, TbCashierCart.class);
|
|
||||||
}
|
|
||||||
// 首次加入
|
// 首次加入
|
||||||
if (tbCashierCart == null) {
|
if (tbCashierCart == null) {
|
||||||
tbCashierCart = new TbCashierCart();
|
tbCashierCart = new TbCashierCart();
|
||||||
@@ -895,7 +891,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
})
|
})
|
||||||
.or((query4 -> {
|
.or((query4 -> {
|
||||||
query4.isNull(TbCashierCart::getTradeDay)
|
query4.isNull(TbCashierCart::getTradeDay)
|
||||||
.eq(TbCashierCart::getMasterId, "");
|
.isNull(TbCashierCart::getMasterId);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
// if (createOrderDTO.getVipUserId() != null) {
|
// if (createOrderDTO.getVipUserId() != null) {
|
||||||
@@ -1063,10 +1059,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
// 推送耗材信息
|
// 推送耗材信息
|
||||||
pushConsMsg(orderInfo, cashierCarts);
|
pushConsMsg(orderInfo, cashierCarts);
|
||||||
|
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
|
||||||
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
|
|
||||||
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
|
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()));
|
|
||||||
|
|
||||||
if (createOrderDTO.isPostPay() && isPrint) {
|
if (createOrderDTO.isPostPay() && isPrint) {
|
||||||
Long count = orderInfoMapper.selectCount(new LambdaQueryWrapper<TbOrderInfo>()
|
Long count = orderInfoMapper.selectCount(new LambdaQueryWrapper<TbOrderInfo>()
|
||||||
@@ -1077,7 +1070,13 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
|
||||||
|
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()));
|
||||||
|
|
||||||
|
String tableCartKey = RedisConstant.getTableCartKey(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString());
|
||||||
|
redisTemplate.delete(tableCartKey);
|
||||||
return orderInfo;
|
return orderInfo;
|
||||||
}, stringRedisTemplate, RedisConstant.getLockKey(RedisConstant.CREATE_ORDER,createOrderDTO.getShopId(),
|
}, stringRedisTemplate, RedisConstant.getLockKey(RedisConstant.CREATE_ORDER,createOrderDTO.getShopId(),
|
||||||
createOrderDTO.getTableId(), createOrderDTO.getMasterId(), createOrderDTO.isPostPay()));
|
createOrderDTO.getTableId(), createOrderDTO.getMasterId(), createOrderDTO.isPostPay()));
|
||||||
|
|||||||
Reference in New Issue
Block a user