diff --git a/src/main/java/com/chint/application/dtos/response/RouteOrderPageRes.java b/src/main/java/com/chint/application/dtos/response/RouteOrderPageRes.java index 3e187ab3..f2c05870 100644 --- a/src/main/java/com/chint/application/dtos/response/RouteOrderPageRes.java +++ b/src/main/java/com/chint/application/dtos/response/RouteOrderPageRes.java @@ -32,7 +32,6 @@ public class RouteOrderPageRes { private List locationResList; private String amount; - private String instructions; private String estimateAmount; private Integer orderStatus; private String approvalStatus; diff --git a/src/main/java/com/chint/application/dtos/response/RouteOrderRes.java b/src/main/java/com/chint/application/dtos/response/RouteOrderRes.java index 82931b7c..fa76e9a9 100644 --- a/src/main/java/com/chint/application/dtos/response/RouteOrderRes.java +++ b/src/main/java/com/chint/application/dtos/response/RouteOrderRes.java @@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import com.chint.domain.aggregates.order.ApproveOrderNo; import com.chint.domain.aggregates.order.RouteOrder; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.Column; @@ -25,6 +26,8 @@ public class RouteOrderRes { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime bookingTime; private Long userId; + @ApiModelProperty("用户名称") + private String userName; //审批订单号 @Embedded.Nullable private ApproveOrderNo approveOrderNo; diff --git a/src/main/java/com/chint/application/out/LoginController.java b/src/main/java/com/chint/application/out/LoginController.java index 466ef620..88d47cb0 100644 --- a/src/main/java/com/chint/application/out/LoginController.java +++ b/src/main/java/com/chint/application/out/LoginController.java @@ -57,8 +57,10 @@ public class LoginController { UserLoginResult userLoginResult = authenticateService .authenticateEmployeeNo(userLoginParam); - //发送创建行程订单命令 - Command.of(OrderCreateCommand.class).of(userLoginParam).sendToQueue(); + if (billcode != null) { + //发送创建行程订单命令 + Command.of(OrderCreateCommand.class).of(userLoginParam).sendToQueue(); + } //异步执行更新用户信息到同程 User currentUser = userLoginResult.getUser(); diff --git a/src/main/java/com/chint/application/out/OrderOutController.java b/src/main/java/com/chint/application/out/OrderOutController.java index ed0bb92e..169e6946 100644 --- a/src/main/java/com/chint/application/out/OrderOutController.java +++ b/src/main/java/com/chint/application/out/OrderOutController.java @@ -8,10 +8,12 @@ import com.chint.application.dtos.response.RouteOrderRes; import com.chint.application.dtos.trip.TripCallback; import com.chint.application.queryies.OrderQuery; import com.chint.domain.aggregates.order.RouteOrder; +import com.chint.domain.aggregates.user.User; import com.chint.domain.value_object.FlightPriceData; import com.chint.domain.value_object.OrderQueryData; import com.chint.domain.value_object.PriceQueryData; import com.chint.domain.value_object.TrainPriceData; +import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.Result; import com.google.gson.Gson; @@ -46,6 +48,7 @@ public class OrderOutController { @ApiOperation("查询行程规划订单详情") @PostMapping("/query") public Result queryOrder(@RequestBody OrderQueryData queryData) { + User currentUser = BaseContext.getCurrentUser(); RouteOrder routeOrder = orderQuery.queryById(queryData.getRouteId()).reloadStatus(); RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder); List list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList(); @@ -55,6 +58,7 @@ public class OrderOutController { .stream() .map(OrderDetailRes::copyFrom) .toList(); + routeOrderRes.setUserName(currentUser.getName()); routeOrderRes.setOrderDetailRes(orderDetailResList); return Result.Success(SUCCESS, routeOrderRes); } diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 0d73f8d6..2f5d3a8d 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -73,7 +73,6 @@ public class OrderQuery { .toList(); res.setLocationResList(locationRes); res.setUserName(currentUser.getName()); - res.setInstructions(routeOrder.getApproveOrderNo().getInstructions()); return res; }) .toList(); diff --git a/src/main/java/com/chint/domain/aggregates/order/ApproveOrderNo.java b/src/main/java/com/chint/domain/aggregates/order/ApproveOrderNo.java index 8f4ae47e..a9263894 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ApproveOrderNo.java +++ b/src/main/java/com/chint/domain/aggregates/order/ApproveOrderNo.java @@ -1,12 +1,18 @@ package com.chint.domain.aggregates.order; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class ApproveOrderNo { + @ApiModelProperty("billcode") private String fakeOrderNo; + @ApiModelProperty("系统标识") private String sysCode; + @ApiModelProperty("实际单号") private String actualOrderNo; + @ApiModelProperty("入账公司") private String accountCompany; + @ApiModelProperty("申请说明") private String instructions; } diff --git a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java index d207e29c..c7c8c0f7 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java @@ -51,6 +51,9 @@ public class UserHttpRequestImpl implements UserHttpRequest { private User loadRankCode(User user) { String rankName = user.getManaLevel() != null ? user.getManaLevel() : user.getProfLevel(); + if (rankName == null) { + rankName = "PR1"; + } Ranks ranks = rankDomainService.queryRanks(rankName, user.getCompanyCode()); if (ranks != null) { user.setStandardLevel(ranks.getStandardLevel()); diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index f578f0c4..30db0952 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -38,7 +38,7 @@ class RouteApplicationTests { void loginSign() { String sfno = "230615020"; String syscode = "abc"; - String billcode = "KKK12321412323"; + String billcode = ""; String companycode = "A30000001"; String sec = "Superdandan"; String timespan = "12312321412312";