diff --git a/src/main/java/ru/ulstu/activity/common/service/ActivityService.java b/src/main/java/ru/ulstu/activity/common/service/ActivityService.java index eb3e3f8..bca8c96 100644 --- a/src/main/java/ru/ulstu/activity/common/service/ActivityService.java +++ b/src/main/java/ru/ulstu/activity/common/service/ActivityService.java @@ -64,7 +64,7 @@ public abstract class ActivityService files = new ArrayList<>(); private List projectIds; - private Set authorIds; private Set members; private Integer leaderId; private List paperIds = new ArrayList<>(); @@ -37,22 +34,15 @@ public class GrantDto extends ActivityDto { @JsonProperty("deadlines") List deadlines, @JsonProperty("comment") String comment, @JsonProperty("files") List files, - @JsonProperty("project") ProjectDto project, - @JsonProperty("authorIds") Set authorIds, @JsonProperty("members") Set members, @JsonProperty("leaderId") Integer leaderId, - @JsonProperty("wasLeader") boolean wasLeader, - @JsonProperty("hasAge") boolean hasAge, - @JsonProperty("hasDegree") boolean hasDegree, - @JsonProperty("paperIds") List paperIds, - @JsonProperty("papers") List papers) { + @JsonProperty("paperIds") List paperIds) { super(id); this.title = title; this.status = status; this.deadlines = deadlines; this.comment = comment; this.files = files; - this.authorIds = authorIds; this.members = members; this.leaderId = leaderId; this.paperIds = paperIds; @@ -69,7 +59,6 @@ public class GrantDto extends ActivityDto { this.deadlines = convert(grant.getDeadlines(), DeadlineDto::new); this.comment = grant.getComment(); this.files = convert(grant.getFiles(), FileDataDto::new); - this.authorIds = convert(grant.getAuthors(), user -> user.getId()); this.members = convert(grant.getAuthors(), ScienceGroupMemberDto::new); this.leaderId = grant.getLeader().getId(); this.paperIds = convert(grant.getPapers(), paper -> paper.getId()); @@ -126,14 +115,6 @@ public class GrantDto extends ActivityDto { this.files = files; } - public Set getAuthorIds() { - return authorIds; - } - - public void setAuthorIds(Set authorIds) { - this.authorIds = authorIds; - } - public Set getMembers() { return members; } diff --git a/src/main/java/ru/ulstu/activity/grant/service/GrantService.java b/src/main/java/ru/ulstu/activity/grant/service/GrantService.java index 84f9fcf..599fdab 100644 --- a/src/main/java/ru/ulstu/activity/grant/service/GrantService.java +++ b/src/main/java/ru/ulstu/activity/grant/service/GrantService.java @@ -116,8 +116,8 @@ public class GrantService extends ActivityService .collect(toList()))); } grant.getAuthors().clear(); - if (grantDto.getAuthorIds() != null && !grantDto.getAuthorIds().isEmpty()) { - grantDto.getAuthorIds().forEach(authorIds -> grant.getAuthors().add(userService.findById(authorIds))); + if (grantDto.getMembers() != null && !grantDto.getMembers().isEmpty()) { + grantDto.getMembers().forEach(memberDto -> grant.getAuthors().add(userService.findById(memberDto.getId()))); } if (grantDto.getLeaderId() != null) { grant.setLeader(userService.findById(grantDto.getLeaderId()));