hotfix: Do not remove lastFileReview / lastApprover when deleting users
This commit is contained in:
parent
c12127a226
commit
723ddc7fa4
@ -126,8 +126,4 @@ public interface StatusResource {
|
||||
@PostMapping(value = STATUS_PATH + "/include-pages" + DOSSIER_ID_PATH_PARAM + FILE_ID_PATH_VARIABLE)
|
||||
void includePages(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set<Integer> pages);
|
||||
|
||||
|
||||
@PostMapping(value = STATUS_PATH + "/remove-not-existing-users", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
void removeNotExistingUsers(@RequestBody Set<String> deletedUsers);
|
||||
|
||||
}
|
||||
|
||||
@ -526,13 +526,4 @@ public class FileStatusPersistenceService {
|
||||
response.isOcrFinished() ? OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS) : null,
|
||||
OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void removeNotExistingUsers(Set<String> users) {
|
||||
|
||||
fileRepository.deleteLastReviewers(users, OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
fileRepository.deleteLastApprovers(users, OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -125,17 +125,7 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
|
||||
@Modifying
|
||||
@Query("update FileEntity f set f.assignee = :assignee, f.lastReviewer = :lastReviewer, f.lastApprover = :lastApprover, " + "f.lastUpdated = :lastUpdated where f.id = :fileId")
|
||||
int setAssignee(String fileId, String assignee, String lastReviewer, String lastApprover, OffsetDateTime lastUpdated);
|
||||
|
||||
|
||||
@Modifying
|
||||
@Query("update FileEntity f set f.lastReviewer = null, f.lastUpdated = :lastUpdated where f.lastReviewer IN :users")
|
||||
int deleteLastReviewers(Set<String> users, OffsetDateTime lastUpdated);
|
||||
|
||||
|
||||
@Modifying
|
||||
@Query("update FileEntity f set f.lastApprover = null, f.lastUpdated = :lastUpdated where f.lastApprover IN :users")
|
||||
int deleteLastApprovers(Set<String> users, OffsetDateTime lastUpdated);
|
||||
|
||||
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update FileEntity f set f.excluded = :excluded, f.lastUpdated = :lastUpdated where f.id = :fileId")
|
||||
|
||||
@ -95,13 +95,6 @@ public class FileStatusController implements StatusResource {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeNotExistingUsers(@RequestBody Set<String> notExistingUsers) {
|
||||
|
||||
fileStatusService.removeNotExistingUsers(notExistingUsers);
|
||||
}
|
||||
|
||||
|
||||
public void setStatusUnderReview(@PathVariable(DOSSIER_ID_PARAM) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = USER_ID_REQUEST_PARAM, required = false) String userId) {
|
||||
|
||||
@ -748,10 +748,4 @@ public class FileStatusService {
|
||||
fileStatusPersistenceService.updateOCRStatus(response);
|
||||
}
|
||||
|
||||
|
||||
public void removeNotExistingUsers(Set<String> notExistingUsers) {
|
||||
|
||||
fileStatusPersistenceService.removeNotExistingUsers(notExistingUsers);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user