Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -250,7 +250,7 @@ public class TbPointsExchangeRecordServiceImpl extends ServiceImpl<TbPointsExcha
|
|||||||
.set(TbPointsExchangeRecord::getCancelOrRefundTime, new Date())
|
.set(TbPointsExchangeRecord::getCancelOrRefundTime, new Date())
|
||||||
.set(TbPointsExchangeRecord::getCancelOrRefundReason, "超时未支付,系统自动取消订单")
|
.set(TbPointsExchangeRecord::getCancelOrRefundReason, "超时未支付,系统自动取消订单")
|
||||||
.eq(TbPointsExchangeRecord::getStatus, "unpaid")
|
.eq(TbPointsExchangeRecord::getStatus, "unpaid")
|
||||||
.last("and TIMESTAMPDIFF(MINUTE, NOW(), create_time) >= 5"));
|
.last("and TIMESTAMPDIFF(MINUTE, create_time, NOW()) >= 5"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -286,7 +286,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
|
|||||||
.set(TbShopTableBooking::getStatus, 999)
|
.set(TbShopTableBooking::getStatus, 999)
|
||||||
.set(TbShopTableBooking::getUpdateTime, new Date())
|
.set(TbShopTableBooking::getUpdateTime, new Date())
|
||||||
.eq(TbShopTableBooking::getStatus, 20)
|
.eq(TbShopTableBooking::getStatus, 20)
|
||||||
.last("and TIMESTAMPDIFF(MINUTE, NOW(), booking_time) >= timeout_minute"));
|
.last("and TIMESTAMPDIFF(MINUTE, booking_time, NOW()) >= timeout_minute"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -296,7 +296,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
|
|||||||
.set(TbShopTableBooking::getStatus, -1)
|
.set(TbShopTableBooking::getStatus, -1)
|
||||||
.set(TbShopTableBooking::getUpdateTime, new Date())
|
.set(TbShopTableBooking::getUpdateTime, new Date())
|
||||||
.eq(TbShopTableBooking::getStatus, 999)
|
.eq(TbShopTableBooking::getStatus, 999)
|
||||||
.last("and TIMESTAMPDIFF(MINUTE, NOW(), booking_time) >= timeout_minute+15"));
|
.last("and TIMESTAMPDIFF(MINUTE, booking_time, NOW()) >= timeout_minute+15"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ import cn.ysk.cashier.exception.BadRequestException;
|
|||||||
import cn.ysk.cashier.mapper.shop.TbShopTableMapper;
|
import cn.ysk.cashier.mapper.shop.TbShopTableMapper;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbActivateOutRecord;
|
import cn.ysk.cashier.mybatis.entity.TbActivateOutRecord;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||||
|
import cn.ysk.cashier.mybatis.entity.TbShopTableBooking;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbThirdPartyCouponRecord;
|
import cn.ysk.cashier.mybatis.entity.TbThirdPartyCouponRecord;
|
||||||
import cn.ysk.cashier.mybatis.mapper.*;
|
import cn.ysk.cashier.mybatis.mapper.*;
|
||||||
import cn.ysk.cashier.mybatis.service.*;
|
import cn.ysk.cashier.mybatis.service.*;
|
||||||
@@ -55,6 +56,7 @@ import cn.ysk.cashier.vo.*;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.dianguang.cloud.ossservice.model.DateUtils;
|
import com.dianguang.cloud.ossservice.model.DateUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -111,6 +113,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
private final MpProductStockDetailMapper mpProductStockDetailMapper;
|
private final MpProductStockDetailMapper mpProductStockDetailMapper;
|
||||||
private final TbMemberPointsService memberPointsService;
|
private final TbMemberPointsService memberPointsService;
|
||||||
private final TbShopCouponService shopCouponService;
|
private final TbShopCouponService shopCouponService;
|
||||||
|
private final TbShopTableBookingService tbShopTableBookingService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -296,30 +299,30 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
.orderByDesc(TbOrderInfo::getId)).getRecords();
|
.orderByDesc(TbOrderInfo::getId)).getRecords();
|
||||||
orderInfoList.forEach(item -> currentOrderInfoMap.computeIfAbsent(item.getTableId(), k -> item));
|
orderInfoList.forEach(item -> currentOrderInfoMap.computeIfAbsent(item.getTableId(), k -> item));
|
||||||
|
|
||||||
for (TbShopTable date : tbShopTableList) {
|
for (TbShopTable data : tbShopTableList) {
|
||||||
if (StrUtil.isBlank(date.getQrcode())) {
|
if (StrUtil.isBlank(data.getQrcode())) {
|
||||||
date.setStatus("unbind");
|
data.setStatus("unbind");
|
||||||
} else if ((countMap.get(date.getQrcode()) == null || countMap.get(date.getQrcode()) < 1) && !TableStateEnum.CLEANING.getState().equals(date.getStatus())) {
|
} else if ((countMap.get(data.getQrcode()) == null || countMap.get(data.getQrcode()) < 1) && !TableStateEnum.CLEANING.getState().equals(data.getStatus())) {
|
||||||
date.setStatus("idle");
|
data.setStatus("idle");
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
.eq(TbShopTable::getQrcode, date.getQrcode())
|
.eq(TbShopTable::getQrcode, data.getQrcode())
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
}
|
}
|
||||||
Map<String, Object> itemMap = BeanUtil.beanToMap(date, false, false);
|
Map<String, Object> itemMap = BeanUtil.beanToMap(data, false, false);
|
||||||
if ((date.getStatus().equals("using") || date.getStatus().equals("cleaning")) && date.getUseTime() != null) {
|
if ((data.getStatus().equals("using") || data.getStatus().equals("cleaning")) && data.getUseTime() != null) {
|
||||||
itemMap.put("durationTime", DateUtil.current() - date.getUseTime().getTime());
|
itemMap.put("durationTime", DateUtil.current() - data.getUseTime().getTime());
|
||||||
} else {
|
} else {
|
||||||
itemMap.put("durationTime", 0);
|
itemMap.put("durationTime", 0);
|
||||||
}
|
}
|
||||||
if (!"".equals(date.getQrcode())) {
|
if (!"".equals(data.getQrcode())) {
|
||||||
itemMap.put("qrcode", QRCODE + date.getQrcode().trim());
|
itemMap.put("qrcode", QRCODE + data.getQrcode().trim());
|
||||||
itemMap.put("tableId", date.getQrcode());
|
itemMap.put("tableId", data.getQrcode());
|
||||||
}
|
}
|
||||||
|
|
||||||
TbOrderInfo orderInfo = null;
|
TbOrderInfo orderInfo = null;
|
||||||
if (StrUtil.isNotBlank(date.getQrcode())) {
|
if (StrUtil.isNotBlank(data.getQrcode())) {
|
||||||
try {
|
try {
|
||||||
orderInfo = currentOrderInfoMap.get(date.getQrcode());
|
orderInfo = currentOrderInfoMap.get(data.getQrcode());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info(e.getMessage());
|
log.info(e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -328,6 +331,17 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
itemMap.put("orderId", orderInfo == null ? null : orderInfo.getId());
|
itemMap.put("orderId", orderInfo == null ? null : orderInfo.getId());
|
||||||
itemMap.put("useType", orderInfo == null ? null : orderInfo.getUseType());
|
itemMap.put("useType", orderInfo == null ? null : orderInfo.getUseType());
|
||||||
itemMap.put("masterId", orderInfo == null ? null : orderInfo.getMasterId());
|
itemMap.put("masterId", orderInfo == null ? null : orderInfo.getMasterId());
|
||||||
|
Date bookingDate = DateUtil.date().toJdkDate();
|
||||||
|
LambdaQueryWrapper<TbShopTableBooking> wrapper = Wrappers.lambdaQuery();
|
||||||
|
wrapper.eq(TbShopTableBooking::getBookingDate, bookingDate);
|
||||||
|
wrapper.eq(TbShopTableBooking::getShopTableId, data.getId());
|
||||||
|
wrapper.ne(TbShopTableBooking::getStatus, -1);
|
||||||
|
wrapper.eq(TbShopTableBooking::getDelFlag, 0);
|
||||||
|
List<TbShopTableBooking> list = tbShopTableBookingService.list(wrapper);
|
||||||
|
if (list == null) {
|
||||||
|
list = new ArrayList<>();
|
||||||
|
}
|
||||||
|
itemMap.put("bookingList", list);
|
||||||
infoList.add(itemMap);
|
infoList.add(itemMap);
|
||||||
}
|
}
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user