diff --git a/src/main/java/com/chint/application/commands/OrderCreateCommand.java b/src/main/java/com/chint/application/commands/OrderCreateCommand.java index 160b244f..e5c796d4 100644 --- a/src/main/java/com/chint/application/commands/OrderCreateCommand.java +++ b/src/main/java/com/chint/application/commands/OrderCreateCommand.java @@ -10,9 +10,16 @@ import lombok.EqualsAndHashCode; @Data public class OrderCreateCommand extends Command { private User user; + private UserLoginParam userLoginParam; public OrderCreateCommand of(User user) { this.user = user; return this; } + + + public OrderCreateCommand loginParam(UserLoginParam userLoginParam) { + this.userLoginParam = userLoginParam; + return this; + } } diff --git a/src/main/java/com/chint/application/out/LoginController.java b/src/main/java/com/chint/application/out/LoginController.java index c74b4052..c42e7832 100644 --- a/src/main/java/com/chint/application/out/LoginController.java +++ b/src/main/java/com/chint/application/out/LoginController.java @@ -97,12 +97,14 @@ public class LoginController { //异步执行更新用户信息到同程 User currentUser = BaseContext.getCurrentUser(); - if (billcode != null) { + if (billcode != null && !billcode.isEmpty()) { if (companycode == null) { throw new OrderException("companycode 不能为空"); } //发送创建行程订单命令 - Command.of(OrderCreateCommand.class).of(currentUser).sendToQueue(); + Command.of(OrderCreateCommand.class).of(currentUser) + .loginParam(userLoginParam) + .sendToQueue(); } loginEventBoarder(currentUser); return Result.Success(CommonMessageConstant.SUCCESS, userLoginResult); diff --git a/src/main/java/com/chint/domain/service/OrderDomainService.java b/src/main/java/com/chint/domain/service/OrderDomainService.java index de6c496a..a1f3a4d1 100644 --- a/src/main/java/com/chint/domain/service/OrderDomainService.java +++ b/src/main/java/com/chint/domain/service/OrderDomainService.java @@ -114,7 +114,7 @@ public class OrderDomainService { @ListenTo(command = "OrderCreateCommand", order = 0) public RouteOrder createOrder(OrderCreateCommand command) { User user = command.getUser(); - UserLoginParam loginParam = user.getUserLoginParam(); + UserLoginParam loginParam = command.getUserLoginParam(); // 从 Redis 查找 RouteOrder tempOrder = routeRepository .findTempRouteOrderBySysCodeAndBillCode(loginParam.getSyscode(), loginParam.getBillcode());