perf:江体小程序场地订阅优化

This commit is contained in:
Xiang
2026-03-23 10:25:54 +08:00
parent 7bf6b5d5ed
commit d40a15cbb5
5 changed files with 162 additions and 1 deletions

View File

@@ -16,6 +16,12 @@ public class RedisKeyConstant {
public static final String JNTYZX_VENUE_MSG_SEND_KEY = "jntyzx:order:venue:msg:send";
private static final String JNTYZX_VENUE_SUBSCRIBE_KEY = "jntyzx:venue:subscribe:";
public static String getVenueSubscribeKey(String placeName) {
return JNTYZX_VENUE_SUBSCRIBE_KEY + placeName + ":" + getDate();
}
public static String getDate() {
LocalDate now = LocalDate.now();
return ":" + DateUtils.getDateFromDate(now);

View File

@@ -82,6 +82,10 @@ public class OrderInfoServiceImpl implements IJtOrderService {
log.info("改会员卡被限制,不在请求,用户:{}", userTokenInfoDO.getName());
throw new BusinessException("会员卡被限制,不在请求");
}
if (orderResp.getMessage().contains("已有人预订")) {
log.info("该场地已被人预定,更换场地, 用户:{}", userTokenInfoDO.getName());
redisService.set(RedisKeyConstant.getVenueSubscribeKey(venueInfoDOS.get(0).getPlaceName()), "true");
}
return false;
}
}

View File

@@ -25,4 +25,17 @@ public class VenueInfoUtils {
public static boolean get8210VenueInfo(SitePositionList sitePositionList) {
return StringUtils.equals(sitePositionList.getSjName(), "20:00-21:00") || StringUtils.equals(sitePositionList.getSjName(), "21:00-22:00");
}
public static int sortVenueInfo(String placeName) {
if (placeName.contains("十号")) {
return 0;
}
if (placeName.contains("二号")) {
return 1;
}
if (placeName.contains("九号")) {
return 2;
}
return 3;
}
}