登录返回的数据,添加登录参数

This commit is contained in:
lulz1 2024-04-29 10:50:24 +08:00
parent 756b1baa63
commit 8df5cd172b
3 changed files with 6 additions and 7 deletions

View File

@ -3,6 +3,7 @@ package com.chint.application.out;
import com.chint.application.commands.OrderCreateCommand; import com.chint.application.commands.OrderCreateCommand;
import com.chint.application.commands.UserLoginCommand; 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.ANFeiShuLoginStrategy;
import com.chint.application.services.login.strategy.FeishuLoginStrategy; import com.chint.application.services.login.strategy.FeishuLoginStrategy;
import com.chint.application.services.login.strategy.PailaLoginStrategy; import com.chint.application.services.login.strategy.PailaLoginStrategy;
@ -162,6 +163,7 @@ public class LoginController {
private void loginEventBoarder(User user) { private void loginEventBoarder(User user) {
Command.of(UserSFCommand.class).user(user).sendToQueue();
Command.of(UserLoginCommand.class).user(user).sendToQueue(); Command.of(UserLoginCommand.class).user(user).sendToQueue();
user.setSyncTime(LocalDateTime.now()); user.setSyncTime(LocalDateTime.now());
userRepository.save(user); userRepository.save(user);

View File

@ -372,7 +372,7 @@ public class User implements Serializable {
userData.getGender(), userData.getGender(),
userData.getStatus()); userData.getStatus());
UserDepartmentInfo userDepartmentInfo = builder.finish(); UserDepartmentInfo userDepartmentInfo = builder.finish();
if (userData.getPersonIdExternal().equals(userData.getLoginUsername())) { if (userData.getPersonIdExternal().equals(userData.getUserId())) {
userDepartmentInfo.setIfPrimary(1); userDepartmentInfo.setIfPrimary(1);
} else { } else {
userDepartmentInfo.setIfPrimary(0); userDepartmentInfo.setIfPrimary(0);
@ -380,9 +380,7 @@ public class User implements Serializable {
List<UserDepartmentInfo> userDepartmentInfoList = this.getUserDepartmentInfoList(); List<UserDepartmentInfo> userDepartmentInfoList = this.getUserDepartmentInfoList();
List<UserDepartmentInfo> result = new ArrayList<>(); List<UserDepartmentInfo> result = new ArrayList<>();
if (userDepartmentInfoList != null && !userDepartmentInfoList.isEmpty()) { if (userDepartmentInfoList != null && !userDepartmentInfoList.isEmpty()) {
if (userDepartmentInfoList.contains(userDepartmentInfo)) { userDepartmentInfoList.removeIf(departmentInfo -> departmentInfo.equals(userDepartmentInfo));
return this;
}
List<UserDepartmentInfo> list = userDepartmentInfoList.stream().distinct().toList(); List<UserDepartmentInfo> list = userDepartmentInfoList.stream().distinct().toList();
if (userDepartmentInfo.ifPrimary()) { if (userDepartmentInfo.ifPrimary()) {
list.forEach(it -> it.setIfPrimary(0)); list.forEach(it -> it.setIfPrimary(0));

View File

@ -82,13 +82,12 @@ public class UserDepartmentInfo implements Serializable {
&& Objects.equals(departmentCodeSix, that.departmentCodeSix) && Objects.equals(departmentCodeSix, that.departmentCodeSix)
&& Objects.equals(departmentNameSix, that.departmentNameSix) && Objects.equals(departmentNameSix, that.departmentNameSix)
&& Objects.equals(departmentCodeSeven, that.departmentCodeSeven) && Objects.equals(departmentCodeSeven, that.departmentCodeSeven)
&& Objects.equals(departmentNameSeven, that.departmentNameSeven) && Objects.equals(departmentNameSeven, that.departmentNameSeven);
&& Objects.equals(ifPrimary, that.ifPrimary);
} }
@Override @Override
public int hashCode() { 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() { public Builder start() {