fix:修复可能导出部分临时行程规划单遗漏的问题

This commit is contained in:
lulz1 2024-06-28 20:10:06 +08:00
parent 7a8d98cd40
commit 3c3739f56c
3 changed files with 12 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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());