Skip to content

Commit

Permalink
fix : 리마인드 알림 team.isDeleted.ne(true)
Browse files Browse the repository at this point in the history
  • Loading branch information
seungueonn committed Dec 20, 2023
1 parent 5c5a9e7 commit 6470a02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public Optional<List<Member>> findRepeatMissionPeopleByStatus(MissionStatus miss
.from(teamMember)
.join(mission)
.on(teamMember.team.eq(mission.team),
teamMember.member.isDeleted.ne(true))
teamMember.member.isDeleted.ne(true),
teamMember.team.isDeleted.ne(true))
.where(
mission.status.eq(missionStatus),
mission.type.eq(MissionType.REPEAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,19 +377,12 @@ public Boolean findMyArchivesToday(Long memberId, Long missionId) {
}


// .where(
// // active 한 미션 필터링
// (((mission.status.eq(MissionStatus.ONGOING).or(mission.status.eq(MissionStatus.WAIT))).and(mission.type.eq(MissionType.ONCE)))
// .or((mission.status.eq(MissionStatus.ONGOING)).and(mission.type.eq(MissionType.REPEAT)))),

private BooleanExpression createRepeatTypeConditionByArchive() {
LocalDate now = LocalDate.now();
DayOfWeek firstDayOfWeek = DayOfWeek.MONDAY;
LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek));
LocalDate endOfWeek = startOfWeek.plusDays(6);

// MissionType.REPEAT 인 경우의 추가적인 날짜 범위 조건
// BooleanExpression isRepeatType = missionArchive.mission.type.eq(MissionType.REPEAT);
BooleanExpression dateInRange = missionArchive.createdDate.goe(startOfWeek.atStartOfDay())
.and(missionArchive.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1)));

Expand All @@ -403,11 +396,6 @@ private BooleanExpression createRepeatTypeConditionByState() {
LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek));
LocalDate endOfWeek = startOfWeek.plusDays(6);

// MissionType.REPEAT 인 경우의 추가적인 날짜 범위 조건
// BooleanExpression isRepeatType = missionArchive.mission.type.eq(MissionType.REPEAT);
// BooleanExpression dateInRange = missionState.createdDate.goe(startOfWeek.atStartOfDay())
// .and(missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1)));

BooleanExpression dateInRange = missionState.createdDate.goe(startOfWeek.atStartOfDay())
.and(missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1)));

Expand Down Expand Up @@ -450,7 +438,8 @@ public Optional<List<Member>> findHavingRemainMissionsByQuerydsl() {
)
.groupBy(teamMember.member,mission,mission.number)
.having(missionArchive.count().lt(mission.number),
teamMember.member.isDeleted.ne(true))
teamMember.member.isDeleted.ne(true),
teamMember.team.isDeleted.ne(true))
.fetch());


Expand Down

0 comments on commit 6470a02

Please sign in to comment.