|
|
@ -109,6 +109,7 @@ public class GrantService {
|
|
|
|
if (grantDto.getApplicationFileName() != null && grant.getApplication() != null) {
|
|
|
|
if (grantDto.getApplicationFileName() != null && grant.getApplication() != null) {
|
|
|
|
fileService.deleteFile(grant.getApplication());
|
|
|
|
fileService.deleteFile(grant.getApplication());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
grantDto.getRemovedDeadlineIds().forEach(deadlineService::remove);
|
|
|
|
grantRepository.save(copyFromDto(grant, grantDto));
|
|
|
|
grantRepository.save(copyFromDto(grant, grantDto));
|
|
|
|
return grant.getId();
|
|
|
|
return grant.getId();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -184,4 +185,12 @@ public class GrantService {
|
|
|
|
grantDto.getPapers().clear();
|
|
|
|
grantDto.getPapers().clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void removeDeadline(GrantDto grantDto, Integer deadlineId) {
|
|
|
|
|
|
|
|
if (grantDto.getDeadlines().get(deadlineId).getId() != null) {
|
|
|
|
|
|
|
|
grantDto.getRemovedDeadlineIds().add(grantDto.getDeadlines().get(deadlineId).getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
grantDto.getDeadlines().remove((int) deadlineId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|