From 3c3739f56cf1589eeeba3bf0f3f96700c0c36a27 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 28 Jun 2024 20:10:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=83=A8=E5=88=86=E4=B8=B4=E6=97=B6=E8=A1=8C?= =?UTF-8?q?=E7=A8=8B=E8=A7=84=E5=88=92=E5=8D=95=E9=81=97=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/application/commands/OrderCreateCommand.java | 7 +++++++ .../java/com/chint/application/out/LoginController.java | 6 ++++-- .../java/com/chint/domain/service/OrderDomainService.java | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) 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());