修复订单回推的生成退款订单的id出现重复的问题

This commit is contained in:
lulz1 2024-04-17 16:19:10 +08:00
parent cf3239e6bb
commit c261f3b776
9 changed files with 55 additions and 20 deletions

View File

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

View File

@ -68,7 +68,6 @@ public class JwtTokenAdminInterceptor implements HandlerInterceptor {
return true;
} else {
throw new AuthException(JWT_INVALID);
// return true;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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