diff --git a/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java b/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java index 95b11275..8074e19e 100644 --- a/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java +++ b/src/main/java/com/chint/interfaces/rest/amap/AmapUserRequest.java @@ -67,7 +67,7 @@ public class AmapUserRequest implements UserSync { } - @ListenTo(command = "UserLoginCommand",order = 3) + @ListenTo(command = "UserLoginCommand", order = 3) @Override public User syncUserInfoToSupplier(UserLoginCommand command) { User user = command.getUser(); @@ -81,15 +81,14 @@ public class AmapUserRequest implements UserSync { return user; } - @ListenTo(command = "UserDisabledCommand",order = 0) + @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 diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java b/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java index 2f38eb76..4731c704 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/CTripUserSaveRequest.java @@ -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 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)); } } diff --git a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java index b71b8edc..6707eafa 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java @@ -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)); } } diff --git a/src/main/java/com/chint/interfaces/rest/user/UserSync.java b/src/main/java/com/chint/interfaces/rest/user/UserSync.java index 33235351..fa78bd95 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserSync.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserSync.java @@ -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); }