完成挂账管理相关需求

This commit is contained in:
谭凯凯 2024-11-28 09:37:57 +08:00 committed by Tankaikai
parent ed4c1fb034
commit 78a9e5b8ad
2 changed files with 12 additions and 6 deletions

View File

@ -250,7 +250,7 @@ public class TbPointsExchangeRecordServiceImpl extends ServiceImpl<TbPointsExcha
.set(TbPointsExchangeRecord::getCancelOrRefundTime, new Date())
.set(TbPointsExchangeRecord::getCancelOrRefundReason, "超时未支付,系统自动取消订单")
.eq(TbPointsExchangeRecord::getStatus, "unpaid")
.last("and TIMESTAMPDIFF(MINUTE, create_time, NOW()) >= 5"));
.last("and TIMESTAMPDIFF(MINUTE, NOW(), create_time) >= 5"));
}
}

View File

@ -261,10 +261,16 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
@Override
public Map<String, Object> summary(Integer shopId, String[] phoneNos) {
List<Map<String, Object>> list = baseMapper.summaryByPhoneNos(shopId, Arrays.asList(phoneNos));
Map<String, Object> result = new HashMap<>(phoneNos.length);
List<String> phoneNoList = Arrays.asList(phoneNos).stream().distinct().collect(Collectors.toList());
List<List<String>> splits = CollUtil.split(phoneNoList, 10);
List<Map<String, Object>> list = new ArrayList<>();
for (List<String> split : splits) {
List<Map<String, Object>> subList = baseMapper.summaryByPhoneNos(shopId, split);
list.addAll(subList);
}
Map<String, Object> result = new HashMap<>(phoneNoList.size());
for (String phoneNo : phoneNos) {
Map<String, Object> fillData = new HashMap<>(2);
Map<String, Object> fillData = new HashMap<>(3);
fillData.put("consumeOrders", 0);
fillData.put("cancelOrders", 0);
fillData.put("phoneNumber", phoneNo);
@ -279,7 +285,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
baseMapper.update(Wrappers.<TbShopTableBooking>lambdaUpdate()
.set(TbShopTableBooking::getStatus, 999)
.eq(TbShopTableBooking::getStatus, 20)
.last("and TIMESTAMPDIFF(MINUTE, booking_time, NOW()) >= timeout_minute"));
.last("and TIMESTAMPDIFF(MINUTE, NOW(), booking_time) >= timeout_minute"));
}
@Override
@ -288,7 +294,7 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
baseMapper.update(Wrappers.<TbShopTableBooking>lambdaUpdate()
.set(TbShopTableBooking::getStatus, -1)
.eq(TbShopTableBooking::getStatus, 999)
.last("and TIMESTAMPDIFF(MINUTE, booking_time, NOW()) >= timeout_minute+15"));
.last("and TIMESTAMPDIFF(MINUTE, NOW(), booking_time) >= timeout_minute+15"));
}
}