diff --git a/src/main/java/ru/ulstu/user/model/UserDto.java b/src/main/java/ru/ulstu/user/model/UserDto.java index a2f33f6..fd139ad 100644 --- a/src/main/java/ru/ulstu/user/model/UserDto.java +++ b/src/main/java/ru/ulstu/user/model/UserDto.java @@ -14,11 +14,7 @@ import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; -import java.util.Collection; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import static ru.ulstu.odin.model.annotation.OdinString.OdinStringType.PASSWORD; @@ -75,6 +71,12 @@ public class UserDto implements OdinDto { private User.UserDegree degree; + private String orcId; + + private String scopusId; + + private String elibraryId; + public UserDto() { activated = false; roles = new LinkedHashSet<>(); @@ -93,6 +95,9 @@ public class UserDto implements OdinDto { .collect(Collectors.toList())); this.birthDate = user.getBirthDate(); this.degree = user.getDegree(); + this.orcId = user.getOrcId(); + this.scopusId = user.getScopusId(); + this.elibraryId = user.getElibraryId(); } public Integer getId() { @@ -186,6 +191,30 @@ public class UserDto implements OdinDto { this.degree = degree; } + public String getOrcId() { + return orcId; + } + + public void setOrcId(String orcId) { + this.orcId = orcId; + } + + public String getScopusId() { + return scopusId; + } + + public void setScopusId(String scopusId) { + this.scopusId = scopusId; + } + + public String getElibraryId() { + return elibraryId; + } + + public void setElibraryId(String elibraryId) { + this.elibraryId = elibraryId; + } + @JsonIgnore public boolean isPasswordsValid() { if (StringUtils.isEmpty(password) || StringUtils.isEmpty(passwordConfirm)) { diff --git a/src/main/java/ru/ulstu/user/service/UserService.java b/src/main/java/ru/ulstu/user/service/UserService.java index c032332..619f43b 100644 --- a/src/main/java/ru/ulstu/user/service/UserService.java +++ b/src/main/java/ru/ulstu/user/service/UserService.java @@ -24,25 +24,8 @@ import ru.ulstu.core.model.UserActivity; import ru.ulstu.core.model.response.PageableItems; import ru.ulstu.ping.model.Ping; import ru.ulstu.ping.service.PingService; -import ru.ulstu.user.error.UserActivationError; -import ru.ulstu.user.error.UserBlockedException; -import ru.ulstu.user.error.UserEmailExistsException; -import ru.ulstu.user.error.UserIdExistsException; -import ru.ulstu.user.error.UserIsUndeadException; -import ru.ulstu.user.error.UserLoginExistsException; -import ru.ulstu.user.error.UserNotActivatedException; -import ru.ulstu.user.error.UserNotFoundException; -import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException; -import ru.ulstu.user.error.UserResetKeyError; -import ru.ulstu.user.error.UserSendingMailException; -import ru.ulstu.user.model.User; -import ru.ulstu.user.model.UserDto; -import ru.ulstu.user.model.UserInfoNow; -import ru.ulstu.user.model.UserListDto; -import ru.ulstu.user.model.UserResetPasswordDto; -import ru.ulstu.user.model.UserRole; -import ru.ulstu.user.model.UserRoleConstants; -import ru.ulstu.user.model.UserRoleDto; +import ru.ulstu.user.error.*; +import ru.ulstu.user.model.*; import ru.ulstu.user.repository.UserRepository; import ru.ulstu.user.repository.UserRoleRepository; import ru.ulstu.user.util.UserUtils; @@ -52,16 +35,7 @@ import ru.ulstu.utils.timetable.model.Lesson; import javax.mail.MessagingException; import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @Service @@ -207,6 +181,9 @@ public class UserService implements UserDetailsService { user.setLogin(userDto.getLogin()); user.setFirstName(userDto.getFirstName()); user.setLastName(userDto.getLastName()); + user.setOrcId(userDto.getOrcId()); + user.setScopusId(userDto.getScopusId()); + user.setElibraryId(userDto.getElibraryId()); user.setEmail(userDto.getEmail()); if (userDto.isActivated() != user.getActivated()) { if (userDto.isActivated()) { @@ -246,6 +223,9 @@ public class UserService implements UserDetailsService { user.setLastName(updateUser.getLastName()); user.setEmail(updateUser.getEmail()); user.setLogin(updateUser.getLogin()); + user.setOrcId(updateUser.getOrcId()); + user.setScopusId(updateUser.getScopusId()); + user.setElibraryId(updateUser.getElibraryId()); user = updateUserInformation(user); log.debug("Updated Information for User: {}", user.getLogin()); return userMapper.userEntityToUserDto(user); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 830b5ea..8531d06 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -36,7 +36,7 @@ spring.liquibase.enabled=true # Application Settings ng-tracker.base-url=http://127.0.0.1:8080 ng-tracker.undead-user-login=admin -ng-tracker.dev-mode=true +ng-tracker.dev-mode=false ng-tracker.debug_email= ng-tracker.use-https=false ng-tracker.check-run=false diff --git a/src/main/resources/templates/users/profile.html b/src/main/resources/templates/users/profile.html index f59587d..001bd25 100644 --- a/src/main/resources/templates/users/profile.html +++ b/src/main/resources/templates/users/profile.html @@ -58,6 +58,33 @@ class="alert alert-danger">Incorrect email

+
+ + +

Incorrect orc id

+

+
+
+ + +

Incorrect Scopus id

+

+
+
+ + +

Incorrect Elibrary id

+

+