开发数据回推接口
This commit is contained in:
parent
79b25da344
commit
4c2d64ca0a
|
@ -32,7 +32,6 @@ public class RouteOrderPageRes {
|
|||
private List<LocationRes> locationResList;
|
||||
|
||||
private String amount;
|
||||
private String instructions;
|
||||
private String estimateAmount;
|
||||
private Integer orderStatus;
|
||||
private String approvalStatus;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<RouteOrderRes> queryOrder(@RequestBody OrderQueryData queryData) {
|
||||
User currentUser = BaseContext.getCurrentUser();
|
||||
RouteOrder routeOrder = orderQuery.queryById(queryData.getRouteId()).reloadStatus();
|
||||
RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder);
|
||||
List<LegRes> 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);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,6 @@ public class OrderQuery {
|
|||
.toList();
|
||||
res.setLocationResList(locationRes);
|
||||
res.setUserName(currentUser.getName());
|
||||
res.setInstructions(routeOrder.getApproveOrderNo().getInstructions());
|
||||
return res;
|
||||
})
|
||||
.toList();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue