完成离职人员关卡

This commit is contained in:
lulz1 2024-05-06 17:36:08 +08:00
parent 8d83e92a85
commit bb44893339
4 changed files with 9 additions and 12 deletions

View File

@ -83,13 +83,12 @@ public class AmapUserRequest implements UserSync {
@ListenTo(command = "UserDisabledCommand", order = 0)
@Override
public Boolean disableUserToSupplier(UserDisabledCommand command) {
public void disableUserToSupplier(UserDisabledCommand command) {
User user = command.getUser();
String updateUserUrl = BaseUrl + USER_UPDATE_PATH;
UserParam userParamByUser = createUserParamByUser(user);
userParamByUser.setStatus(0);
BaseResponse post = amapRequest.post(updateUserUrl, userParamByUser, BaseResponse.class);
return post.getCode().equals(1);
CompletableFuture.runAsync(() -> amapRequest.post(updateUserUrl, userParamByUser, BaseResponse.class));
}
@Data

View File

@ -131,7 +131,7 @@ public class CTripUserSaveRequest implements UserSync {
@ListenTo(command = "UserDisabledCommand", order = 1)
@Override
public Boolean disableUserToSupplier(UserDisabledCommand command) {
public void disableUserToSupplier(UserDisabledCommand command) {
User user = command.getUser();
AuthenticationListRequest authenticationListRequest = buildUserParam(user);
List<AuthenticationInfo> authenticationInfoList = authenticationListRequest.getAuthenticationInfoList();
@ -139,7 +139,6 @@ public class CTripUserSaveRequest implements UserSync {
AuthenticationInfo authenticationInfo = authenticationInfoList.get(0);
authenticationInfo.getAuthentication().setValid('I');
}
AuthenticationResponseList response = postRequest.post(userUrl, authenticationListRequest, AuthenticationResponseList.class);
return response.getResult().equals("Success");
CompletableFuture.runAsync(() -> postRequest.post(userUrl, authenticationListRequest, AuthenticationResponseList.class));
}
}

View File

@ -117,13 +117,12 @@ public class LYUserRequest implements UserSync {
@ListenTo(command = "UserDisabledCommand",order = 3)
@Override
public Boolean disableUserToSupplier(UserDisabledCommand command) {
public void disableUserToSupplier(UserDisabledCommand command) {
User user = command.getUser();
EmployeeEntity employeeEntity = user2LYEmployee(user);
employeeEntity.setWorkingState(0);
EmployeeRequest employeeData = new EmployeeRequest();
employeeData.setParam(employeeEntity);
UserResponse post = postRequest.post(userUrl, employeeData, UserResponse.class);
return post.isSuccess();
CompletableFuture.runAsync(() -> postRequest.post(userUrl, employeeData, UserResponse.class));
}
}

View File

@ -7,5 +7,5 @@ import com.chint.domain.aggregates.user.User;
public interface UserSync {
User syncUserInfoToSupplier(UserLoginCommand command);
Boolean disableUserToSupplier(UserDisabledCommand command);
void disableUserToSupplier(UserDisabledCommand command);
}