修复日程美甲师筛选消失与日视图泳道末端裁切
自动发布开发环境 Nacos 配置 / publish (push) Successful in 24s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 11s

This commit is contained in:
2026-11-09 15:59:22 +08:00
parent 69ea01eaa4
commit 583bace2e1
6 changed files with 72 additions and 10 deletions
@@ -133,7 +133,9 @@ public class PlanningServiceImpl implements PlanningService {
}
}
boolean artistFiltered = artistId != null && artistId > 0;
List<PlanningArtistVO> artists = listArtists(shopId, artistId);
List<PlanningArtistVO> artistOptions = artistFiltered ? listArtists(shopId, null) : artists;
List<ArtistScheduleDO> schedules = listSchedules(shopId, start, end, artistId);
Map<Long, String> artistNames = artists.stream()
.collect(Collectors.toMap(PlanningArtistVO::getId, PlanningArtistVO::getName, (a, b) -> a));
@@ -151,6 +153,14 @@ public class PlanningServiceImpl implements PlanningService {
.filter(appointment -> appointment.getArtistId() != null)
.collect(Collectors.groupingBy(PlanningAppointmentVO::getArtistId, Collectors.counting()));
artists.forEach(artist -> artist.setRangeCount(countByArtist.getOrDefault(artist.getId(), 0L).intValue()));
if (artistFiltered) {
List<PlanningAppointmentVO> rangeAppointments = listAppointments(shopId, rangeStart, rangeEnd, null, artistOptions);
Map<Long, Long> optionCountByArtist = rangeAppointments.stream()
.filter(appointment -> appointment.getArtistId() != null)
.collect(Collectors.groupingBy(PlanningAppointmentVO::getArtistId, Collectors.counting()));
artistOptions.forEach(artist -> artist.setRangeCount(
optionCountByArtist.getOrDefault(artist.getId(), 0L).intValue()));
}
PlanningCalendarVO vo = new PlanningCalendarVO();
vo.setBusinessStartTime(businessHours == null ? null : businessHours.start().toString());
@@ -159,6 +169,7 @@ public class PlanningServiceImpl implements PlanningService {
|| shop.getDefaultAppointmentDurationMinutes() <= 0 ? DEFAULT_DURATION_MINUTES : shop.getDefaultAppointmentDurationMinutes());
vo.setSlotMinutes(DEFAULT_SLOT_MINUTES);
vo.setArtists(artists);
vo.setArtistOptions(artistOptions);
vo.setSchedules(scheduleVos);
vo.setAppointments(appointments);
vo.setDaySummaries(buildDaySummaries(start, end, artists, schedules, appointments, weeklyHours));
@@ -11,6 +11,8 @@ public class PlanningCalendarVO {
private Integer defaultAppointmentDurationMinutes;
private Integer slotMinutes;
private List<PlanningArtistVO> artists;
/** 全部美甲师选项(不受 artistId 筛选影响),供端侧筛选栏始终展示完整 chip 列表 */
private List<PlanningArtistVO> artistOptions;
private List<PlanningScheduleVO> schedules;
private List<PlanningAppointmentVO> appointments;
private List<PlanningDaySummaryVO> daySummaries;