feat:江体小程序定时任务优化

This commit is contained in:
Xiang
2026-05-09 14:58:07 +08:00
parent 268b63e607
commit cb21b38287
3 changed files with 19 additions and 12 deletions

View File

@@ -92,6 +92,7 @@ public class JntyzxUserInfoConfigTask extends BaseScheduleTaskTemplate {
return taskResult;
}
venueInfoDOS = venueInfoDOS.stream()
.filter(item -> !item.getPlaceName().contains("小馆"))
.sorted(Comparator.comparing(item -> VenueInfoUtils.sortVenueInfo(item.getPlaceName())))
.toList();
@@ -103,6 +104,7 @@ public class JntyzxUserInfoConfigTask extends BaseScheduleTaskTemplate {
List<UserInfoDO> list = Lists.newArrayList();
int i = 0;
userInfoService.delAll();
for (UserTokenInfoDO user : users) {
VenueInfoDO venueInfoDO = venueInfoDOS.get(i);
UserInfoDO userInfoDO = new UserInfoDO();

View File

@@ -121,18 +121,23 @@ public class JtVenuePullTask extends BaseScheduleTaskTemplate {
}
venueService.saveOrUpdateTodayVenueInfo(sitePositionLists);
List<SitePositionList> sitePositionLists6_8 = handleMsgSendList(sitePositionLists, 1);
StringBuffer msg = new StringBuffer(
"查询到18:00-20:00空闲场地信息=====>\n时间:" + DateUtils.getDateFromDate(LocalDate.now()) + "\n");
sitePositionLists6_8.forEach(item -> {
msg.append(item.getPlaceName()).append("\n");
});
List<SitePositionList> sitePositionLists8_10 = handleMsgSendList(sitePositionLists, 2);
msg.append("查询到18:00-20:00空闲场地信息=====>\n时间:").append(DateUtils.getDateFromDate(LocalDate.now())).append("\n");
sitePositionLists8_10.forEach(item -> msg.append(item.getPlaceName()).append("\n"));
StringBuffer msg = new StringBuffer();
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
msgSendUtils.sendMsgRestrict1Hours(key, msg.toString());
List<SitePositionList> sitePositionLists6_8 = handleMsgSendList(sitePositionLists, 1);
if (CollectionUtils.isNotEmpty(sitePositionLists6_8)) {
msg.append("查询到18:00-20:00空闲场地信息=====>\n时间:").append(DateUtils.getDateFromDate(LocalDate.now())).append("\n");
sitePositionLists6_8.forEach(item -> msg.append(item.getPlaceName()).append("\n"));
}
List<SitePositionList> sitePositionLists8_10 = handleMsgSendList(sitePositionLists, 2);
if (CollectionUtils.isNotEmpty(sitePositionLists8_10)) {
msg.append("查询到20:00-22:00空闲场地信息=====>\n时间:").append(DateUtils.getDateFromDate(LocalDate.now())).append("\n");
sitePositionLists8_10.forEach(item -> msg.append(item.getPlaceName()).append("\n"));
}
if (StringUtils.isNotBlank(msg)) {
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
msgSendUtils.sendMsgRestrict1Hours(key, msg.toString());
}
taskResult.setSuccess(true);
taskResult.setSummary("查询场地信息成功!时间:" + now);
return taskResult;

View File

@@ -125,7 +125,7 @@ public class JtVenueTomorrowPullTask extends BaseScheduleTaskTemplate {
}
map.put(sitePositionList.getPlaceName(), sitePositionList);
}
StringBuffer msg = new StringBuffer("查询江体场地信息=====>\n时间:" + DateUtils.getDateFromDate(LocalDate.now().plusDays(1)) + time + "\n");
StringBuffer msg = new StringBuffer("查询江体场地信息=====>\n时间:" + DateUtils.getDateFromDate(LocalDate.now().plusDays(1)) + " " + time + "\n");
map.forEach((placeName, sitePositionList) -> {
msg.append(placeName).append("订购人:").append(sitePositionList.getContacts()).append("\n");
});