登录返回的数据,添加登录参数
This commit is contained in:
parent
756b1baa63
commit
8df5cd172b
|
@ -3,6 +3,7 @@ package com.chint.application.out;
|
|||
|
||||
import com.chint.application.commands.OrderCreateCommand;
|
||||
import com.chint.application.commands.UserLoginCommand;
|
||||
import com.chint.application.commands.UserSFCommand;
|
||||
import com.chint.application.services.login.strategy.ANFeiShuLoginStrategy;
|
||||
import com.chint.application.services.login.strategy.FeishuLoginStrategy;
|
||||
import com.chint.application.services.login.strategy.PailaLoginStrategy;
|
||||
|
@ -162,6 +163,7 @@ public class LoginController {
|
|||
|
||||
|
||||
private void loginEventBoarder(User user) {
|
||||
Command.of(UserSFCommand.class).user(user).sendToQueue();
|
||||
Command.of(UserLoginCommand.class).user(user).sendToQueue();
|
||||
user.setSyncTime(LocalDateTime.now());
|
||||
userRepository.save(user);
|
||||
|
|
|
@ -372,7 +372,7 @@ public class User implements Serializable {
|
|||
userData.getGender(),
|
||||
userData.getStatus());
|
||||
UserDepartmentInfo userDepartmentInfo = builder.finish();
|
||||
if (userData.getPersonIdExternal().equals(userData.getLoginUsername())) {
|
||||
if (userData.getPersonIdExternal().equals(userData.getUserId())) {
|
||||
userDepartmentInfo.setIfPrimary(1);
|
||||
} else {
|
||||
userDepartmentInfo.setIfPrimary(0);
|
||||
|
@ -380,9 +380,7 @@ public class User implements Serializable {
|
|||
List<UserDepartmentInfo> userDepartmentInfoList = this.getUserDepartmentInfoList();
|
||||
List<UserDepartmentInfo> result = new ArrayList<>();
|
||||
if (userDepartmentInfoList != null && !userDepartmentInfoList.isEmpty()) {
|
||||
if (userDepartmentInfoList.contains(userDepartmentInfo)) {
|
||||
return this;
|
||||
}
|
||||
userDepartmentInfoList.removeIf(departmentInfo -> departmentInfo.equals(userDepartmentInfo));
|
||||
List<UserDepartmentInfo> list = userDepartmentInfoList.stream().distinct().toList();
|
||||
if (userDepartmentInfo.ifPrimary()) {
|
||||
list.forEach(it -> it.setIfPrimary(0));
|
||||
|
|
|
@ -82,13 +82,12 @@ public class UserDepartmentInfo implements Serializable {
|
|||
&& Objects.equals(departmentCodeSix, that.departmentCodeSix)
|
||||
&& Objects.equals(departmentNameSix, that.departmentNameSix)
|
||||
&& Objects.equals(departmentCodeSeven, that.departmentCodeSeven)
|
||||
&& Objects.equals(departmentNameSeven, that.departmentNameSeven)
|
||||
&& Objects.equals(ifPrimary, that.ifPrimary);
|
||||
&& Objects.equals(departmentNameSeven, that.departmentNameSeven);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(companyCode, companyName, departmentCodeOne, departmentNameOne, departmentCodeTwo, departmentNameTwo, departmentCodeThree, departmentNameThree, departmentCodeFour, departmentNameFour, departmentCodeFive, departmentNameFive, departmentCodeSix, departmentNameSix, departmentCodeSeven, departmentNameSeven, ifPrimary);
|
||||
return Objects.hash(companyCode, companyName, departmentCodeOne, departmentNameOne, departmentCodeTwo, departmentNameTwo, departmentCodeThree, departmentNameThree, departmentCodeFour, departmentNameFour, departmentCodeFive, departmentNameFive, departmentCodeSix, departmentNameSix, departmentCodeSeven, departmentNameSeven);
|
||||
}
|
||||
|
||||
public Builder start() {
|
||||
|
|
Loading…
Reference in New Issue