From 54b992a7f3478dac497231aa46afa843acf885d9 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 25 Apr 2020 22:46:35 +0400 Subject: [PATCH] try to fix grants kias --- src/main/java/ru/ulstu/grant/service/GrantService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/ru/ulstu/grant/service/GrantService.java b/src/main/java/ru/ulstu/grant/service/GrantService.java index 4b2c9d5..87de64e 100644 --- a/src/main/java/ru/ulstu/grant/service/GrantService.java +++ b/src/main/java/ru/ulstu/grant/service/GrantService.java @@ -197,6 +197,7 @@ 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())) { //если дедайны тоже совпадают @@ -225,7 +226,9 @@ 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; }