diff --git a/src/main/java/com/chint/application/out/OrderDetailController.java b/src/main/java/com/chint/application/out/OrderDetailController.java index cc44763e..27fef52f 100644 --- a/src/main/java/com/chint/application/out/OrderDetailController.java +++ b/src/main/java/com/chint/application/out/OrderDetailController.java @@ -258,6 +258,7 @@ public class OrderDetailController { if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y)) { trainOrderDetail = orderExtensionCreator.of(SUPPLIER_L_Y).updateTrainOrderDetailData(trainOrderDetail, command.getOrderInfo()); } + trainOrderDetail.setDetailId(newOrderNo); orderDetail.setTrainOrderDetail(trainOrderDetail); } @@ -274,6 +275,7 @@ public class OrderDetailController { } else { flightOrderDetail = orderExtensionCreator.of(SUPPLIER_L_Y).updateFlightOrderDetailData(flightOrderDetail, command.getOrderInfo()); } + flightOrderDetail.setDetailId(newOrderNo); orderDetail.setFlightOrderDetail(flightOrderDetail); } @@ -294,8 +296,9 @@ public class OrderDetailController { hotelOrderDetail.setCustomers(newCustomers); if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y)) { hotelOrderDetail = orderExtensionCreator.of(SUPPLIER_L_Y).updateHotelOrderDetailData(hotelOrderDetail, command.getOrderInfo()); - orderDetail.setHotelOrderDetail(hotelOrderDetail); } + hotelOrderDetail.setDetailId(newOrderNo); + orderDetail.setHotelOrderDetail(hotelOrderDetail); } private void updateCarOrderDetail(OrderDetail orderDetail, RefundOrderGenerateCommand command, String newOrderNo) { @@ -306,6 +309,7 @@ public class OrderDetailController { carOrderDetail.setDetailId(newOrderNo); carOrderDetail.setCreateTime(command.getCreateTime()); carOrderDetail.setId(null); + carOrderDetail.setDetailId(newOrderNo); orderDetail.setCarOrderDetail(carOrderDetail); } } \ No newline at end of file diff --git a/src/main/java/com/chint/infrastructure/config/webconfig/JwtTokenAdminInterceptor.java b/src/main/java/com/chint/infrastructure/config/webconfig/JwtTokenAdminInterceptor.java index bdb15c69..64674078 100644 --- a/src/main/java/com/chint/infrastructure/config/webconfig/JwtTokenAdminInterceptor.java +++ b/src/main/java/com/chint/infrastructure/config/webconfig/JwtTokenAdminInterceptor.java @@ -68,7 +68,6 @@ public class JwtTokenAdminInterceptor implements HandlerInterceptor { return true; } else { throw new AuthException(JWT_INVALID); -// return true; } } } \ No newline at end of file diff --git a/src/main/java/com/chint/infrastructure/constant/AmapConstant.java b/src/main/java/com/chint/infrastructure/constant/AmapConstant.java index 3c65c9e7..185e2d00 100644 --- a/src/main/java/com/chint/infrastructure/constant/AmapConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/AmapConstant.java @@ -14,4 +14,6 @@ public class AmapConstant { public static final String FINISHED_ORDER_URL = "/ws/car/open/enterprise/bill/detail/list";//企业完单数据分页查询 public static final String CANCEL_AN_ORDER_URL = "/ws/car/open/enterprise/cancelOrder";//取消订单 + //登录路径 + public static final String AMAP_LOGIN_PATH = "/ws/car/open/enterprise/order/detail"; } diff --git a/src/main/java/com/chint/interfaces/rest/amap/AmapLoginRequest.java b/src/main/java/com/chint/interfaces/rest/amap/AmapLoginRequest.java index 60e5bcf5..7cd53963 100644 --- a/src/main/java/com/chint/interfaces/rest/amap/AmapLoginRequest.java +++ b/src/main/java/com/chint/interfaces/rest/amap/AmapLoginRequest.java @@ -1,12 +1,29 @@ package com.chint.interfaces.rest.amap; +import com.chint.domain.aggregates.user.User; +import com.chint.interfaces.rest.amap.dto.token.TokenResponse; +import com.chint.interfaces.rest.amap.request.AmapRequest; import com.chint.interfaces.rest.amap.request.TokenRequest; +import com.chint.interfaces.rest.base.dto.H5LoginResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class AmapLoginRequest { + @Autowired private TokenRequest tokenRequest; + @Autowired + private AmapRequest amapRequest; + @Value("${amap.baseLoginUrl}") + private String baseLoginUrl; + + + private H5LoginResponse h5Login(User user) { + TokenResponse token = tokenRequest.getToken(user); + return null; + } } diff --git a/src/main/java/com/chint/interfaces/rest/amap/request/TokenRequest.java b/src/main/java/com/chint/interfaces/rest/amap/request/TokenRequest.java index 5110d8c3..574578f1 100644 --- a/src/main/java/com/chint/interfaces/rest/amap/request/TokenRequest.java +++ b/src/main/java/com/chint/interfaces/rest/amap/request/TokenRequest.java @@ -1,6 +1,7 @@ package com.chint.interfaces.rest.amap.request; +import com.chint.domain.aggregates.user.User; import com.chint.interfaces.rest.amap.dto.token.TokenDto; import com.chint.interfaces.rest.amap.dto.token.TokenResponse; import com.google.gson.Gson; @@ -21,11 +22,21 @@ public class TokenRequest { @Autowired private AmapRequest amapRequest; - public TokenResponse getToken(TokenDto.UserInfo userInfo) { - TokenDto tokenDto = new TokenDto(); - Gson gson = new Gson(); - String json = gson.toJson(userInfo); - tokenDto.setUserInfo(json); + private Gson gson = new Gson(); + + public TokenResponse getToken(User user) { + TokenDto tokenDto = getTokenDto(user); return amapRequest.post(baseUrl + TOKEN_URL, tokenDto, TokenResponse.class); } + + public TokenDto getTokenDto(User user) { + TokenDto tokenDto = new TokenDto(); + TokenDto.UserInfo userInfo = new TokenDto.UserInfo(); + userInfo.setMobile(user.getPhoneNumber()); + userInfo.setUserId(user.getEmployeeNo()); + String json = gson.toJson(userInfo); + tokenDto.setUserInfo(json); + return tokenDto; + } + } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 2dad0311..413b0aa5 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -54,6 +54,7 @@ amap: signKey: ngwdzlembqju9lairthw264bzkhw2vto aesKey: 7eEdUzuVflM8n9Wo baseUrl: https://sns.testing.amap.com + baseLoginUrl: https://pre-hailing.amap.com sf: openApiBaseUrl: https://openapi.chintcloud.net diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 60f5b070..77242ab6 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -51,7 +51,7 @@ amap: signKey: ngwdzlembqju9lairthw264bzkhw2vto aesKey: 7eEdUzuVflM8n9Wo baseUrl: https://sns.testing.amap.com - + baseLoginUrl: https://pre-hailing.amap.com sf: openApiBaseUrl: https://openapi.chint.com akBaseUrl: https://transitbridge.chint.com diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index ac208af0..6202becb 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -64,7 +64,7 @@ amap: signKey: ngwdzlembqju9lairthw264bzkhw2vto aesKey: 7eEdUzuVflM8n9Wo baseUrl: https://sns.testing.amap.com - + baseLoginUrl: https://pre-hailing.amap.com sf: openApiBaseUrl: https://openapi.chintcloud.net akBaseUrl: https://transitbridge.chint.com diff --git a/src/test/java/com/chint/AmapTest.java b/src/test/java/com/chint/AmapTest.java index e054a5f4..d2dc82a5 100644 --- a/src/test/java/com/chint/AmapTest.java +++ b/src/test/java/com/chint/AmapTest.java @@ -25,20 +25,21 @@ public class AmapTest { private Gson gson = new Gson(); private User user = new User(1L, "230615020", 1, "卢麟哲", "lulz1@chint.com", "15857193365", "A30000001"); + private User user2 = new User(null, "240102021", 1, "袁文领", "yuanwl@chint.com", "13849105130 ", "A30000001"); - // @Test + @Test public void createUser() { - BaseResponse baseResponse = amapUserRequest.createUser(user); + BaseResponse baseResponse = amapUserRequest.createUser(user2); System.out.println(gson.toJson(baseResponse)); } -// @Test + @Test public void queryUser(){ - UserQueryResponse userQueryResponse = amapUserRequest.queryUser(user); + UserQueryResponse userQueryResponse = amapUserRequest.queryUser(user2); System.out.println(gson.toJson(userQueryResponse)); } -// @Test + @Test public void updateUser(){ BaseResponse baseResponse = amapUserRequest.updateUser(user); System.out.println(gson.toJson(baseResponse)); @@ -51,13 +52,13 @@ public class AmapTest { @Autowired private OrderDetailRequest orderDetailRequest; - // @Test + @Test public void gaoDe() { - TokenDto.UserInfo userInfo = new TokenDto.UserInfo(); - userInfo.setUserId("230615020"); - userInfo.setMobile("15857193365"); - userInfo.setRideTypes(new int[]{1, 2}); - TokenResponse response = tokenRequest.getToken(userInfo); +// TokenDto.UserInfo userInfo = new TokenDto.UserInfo(); +// userInfo.setUserId("230615020"); +// userInfo.setMobile("15857193365"); +// userInfo.setRideTypes(new int[]{1, 2}); + TokenResponse response = tokenRequest.getToken(user); String token = response.getData().getToken(); System.out.println("token = " + token); }