Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class QOfferEmployment extends EntityPathBase<OfferEmployment> {

public final DateTimePath<java.time.LocalDateTime> suggestEndTime = createDateTime("suggestEndTime", java.time.LocalDateTime.class);

public final BooleanPath suggestFinished = createBoolean("suggestFinished");

public final NumberPath<Integer> suggestHourlyPay = createNumber("suggestHourlyPay", Integer.class);

public final NumberPath<Long> suggestId = createNumber("suggestId", Long.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public interface AccountRepository extends JpaRepository<Account, Long> {

@Modifying
@Query("update Account a " +
"set a.starPoint = ((a.starPoint * a.workCount) + :newStarPoint) / (a.workCount+1), " +
"set a.starPoint = ((a.starPoint * a.workCount) + :starPoint) / (a.workCount+1), " +
"a.workCount = a.workCount + 1 " +
"where a.accountId in " +
"(select oe.employee.accountId From OfferEmployment oe where oe.suggestId = :suggestId)")
void updateWorkCountBySuggestId(@Param("suggestId") Long suggestId, @Param("starPoint") Integer newStarPoint);
void updateWorkCountAndStarPointBySuggestId(@Param("suggestId") Long suggestId, @Param("starPoint") Integer newStarPoint);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public void completeOfferEmployment(OfferEmploymentCompleteRequest completeReque
// 알바생 평점 조정
Integer reviewScore = reviewRepository.findReviewStarPointBySuggestId(completeRequest.suggestId());
// 알바 횟수 count + 1
accountRepository.updateWorkCountBySuggestId(completeRequest.suggestId(), reviewScore);
accountRepository.updateWorkCountAndStarPointBySuggestId(completeRequest.suggestId(), reviewScore);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ResponseEntity<OfferEmploymentResponse> sendOfferEmployment(
return ResponseEntity.ok(offerEmploymentResponse);
}

@PostMapping
@PostMapping("/complete")
public ResponseEntity<String> completeOfferEmployment(
@RequestBody final OfferEmploymentCompleteRequest completeRequest
) {
Expand Down
Loading