This commit is contained in:
Anton Romanov 2020-04-25 23:17:47 +04:00
parent 54b992a7f3
commit e3da8c710f

View File

@ -197,7 +197,6 @@ public class GrantService extends BaseService {
private boolean saveFromKias(GrantDto grantDto) throws IOException {
grantDto.setName(grantDto.getTitle());
String title = checkUniqueName(grantDto, grantDto.getId()); //проверка уникальности имени
System.out.println(title);
if (title != null) {
Grant grantFromDB = grantRepository.findFirstByTitle(title); //грант с таким же названием из бд
if (checkSameDeadline(grantDto, grantFromDB.getId())) { //если дедайны тоже совпадают
@ -226,9 +225,7 @@ public class GrantService extends BaseService {
private boolean checkSameDeadline(GrantDto grantDto, Integer id) {
Date date = DateUtils.clearTime(grantDto.getDeadlines().get(0).getDate()); //дата с сайта киас
System.out.println(date);
Date foundGrantDate = DateUtils.clearTime(deadlineService.findByGrantIdAndDate(id, date));
System.out.println(foundGrantDate);
return foundGrantDate != null && foundGrantDate.compareTo(date) == 0;
}