测试环境订票修改为同程测试环境
This commit is contained in:
parent
bf21d7bb37
commit
a862d4cde3
|
@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.relational.core.mapping.Column;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
import java.io.Serial;
|
||||
|
@ -23,4 +22,10 @@ public class OrderTravel implements Serializable {
|
|||
private String orderNo;
|
||||
private String travelNo;
|
||||
|
||||
public static OrderTravel of(String orderNo, String travelNo) {
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setTravelNo(travelNo);
|
||||
orderTravel.setOrderNo(orderNo);
|
||||
return orderTravel;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
|
||||
public interface OrderTravelRepository {
|
||||
OrderTravel save(OrderTravel orderTravel);
|
||||
|
||||
OrderTravel findByOrderNo(String orderNo);
|
||||
}
|
|
@ -216,10 +216,10 @@ public class LYOrderSyncAdapter implements SupplierOrderSync {
|
|||
}
|
||||
|
||||
|
||||
private Location getCityLocation(Location location) {
|
||||
public Location getCityLocation(Location location) {
|
||||
if (location.getLocationType().equals(LOCATION_TYPE_CITY)) {
|
||||
return location;
|
||||
} else if (location.getLocationType().equals(LOCATION_LEVEL_COUNTY) || location.getLocationType().equals(LOCATION_TYPE_DISTRICT)) {
|
||||
} else if (location.getLocationType().equals(LOCATION_TYPE_COUNTY) || location.getLocationType().equals(LOCATION_TYPE_DISTRICT)) {
|
||||
return locationRepository.findById(location.getParentLocationId());
|
||||
} else if (location.getLocationType().equals(LOCATION_TYPE_AIRPORT)) {
|
||||
//如果是机场的话,要查询出对应的地级市
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.chint.infrastructure.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
import com.chint.domain.repository.OrderTravelRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class OrderTravelRepositoryImpl implements OrderTravelRepository {
|
||||
|
||||
@Autowired
|
||||
private JdbcOrderTravelRepository jdbcOrderTravelRepository;
|
||||
|
||||
@Override
|
||||
public OrderTravel save(OrderTravel orderTravel) {
|
||||
List<OrderTravel> byOrderNo = jdbcOrderTravelRepository.findByOrderNo(orderTravel.getOrderNo());
|
||||
if (byOrderNo != null && byOrderNo.isEmpty()) {
|
||||
jdbcOrderTravelRepository.save(orderTravel);
|
||||
}
|
||||
return orderTravel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderTravel findByOrderNo(String orderNo) {
|
||||
List<OrderTravel> byOrderNo = jdbcOrderTravelRepository.findByOrderNo(orderNo);
|
||||
if (byOrderNo != null && !byOrderNo.isEmpty()) {
|
||||
return byOrderNo.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,9 @@ package com.chint.interfaces.rest.ly.in;
|
|||
|
||||
import com.chint.application.commands.OrderStatusChangeCommand;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.OrderTravelRepository;
|
||||
import com.chint.domain.service.SystemDomainService;
|
||||
import com.chint.domain.service.supplier.SupplierService;
|
||||
import com.chint.domain.value_object.SupplierCallbackData;
|
||||
|
@ -49,6 +51,9 @@ public class LYETAController {
|
|||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Autowired
|
||||
private OrderTravelRepository orderTravelRepository;
|
||||
|
||||
@PostMapping("/eta")
|
||||
public LYNoteResponse noteByETA(@RequestBody LyETAPush lyETAPush) {
|
||||
if (lyETAPush.getNotifyType() != 51) {
|
||||
|
@ -56,6 +61,7 @@ public class LYETAController {
|
|||
}
|
||||
|
||||
LyETAPush.NotifyData notifyData = lyETAPush.getNotifyData();
|
||||
String approvalOrderId = notifyData.getApprovalOrderId();
|
||||
String travelApplyNo = notifyData.getTravelApplyNo();
|
||||
String[] split = travelApplyNo.split("-");
|
||||
if (split.length == 0) {
|
||||
|
@ -67,7 +73,7 @@ public class LYETAController {
|
|||
if (systemDomainService.ifImmediateResponse(sysCode)) {
|
||||
//如果是可以立刻返回结果的,直接返回审批通过信息
|
||||
CompletableFuture.runAsync(() -> DelayDispatch.attemptToSend(
|
||||
() -> lyApprovalRequest.pushApprovalSuccess(notifyData.getApprovalOrderId()).isSuccess(), 0
|
||||
() -> lyApprovalRequest.pushApprovalSuccess(approvalOrderId).isSuccess(), 0
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -75,6 +81,8 @@ public class LYETAController {
|
|||
SupplierCallbackData supplierCallbackData = handlerETACallBackData(lyETAPush);
|
||||
OrderDetail orderDetail = supplierService.handleSupplierCallback(supplierCallbackData);
|
||||
|
||||
orderTravelRepository.save(OrderTravel.of(orderDetail.getOrderNo(), approvalOrderId));
|
||||
|
||||
//发送超标事件
|
||||
Command.of(OrderStatusChangeCommand.class)
|
||||
.orderDetail(orderDetail)
|
||||
|
@ -85,7 +93,7 @@ public class LYETAController {
|
|||
.sendToQueue();
|
||||
|
||||
int subNotifyType = lyETAPush.getSubNotifyType();
|
||||
if(subNotifyType == 2 || subNotifyType == 4 || subNotifyType == 6 ){
|
||||
if (subNotifyType == 2 || subNotifyType == 4 || subNotifyType == 6) {
|
||||
//如果推送类是2,4,6还要触发改签事件
|
||||
Command.of(OrderStatusChangeCommand.class)
|
||||
.orderDetail(orderDetail)
|
||||
|
|
|
@ -38,10 +38,10 @@ logging:
|
|||
#正式
|
||||
ly:
|
||||
appId: zhengtai
|
||||
account: ab9fe0c19dd64a99b936fded72c3bb94
|
||||
password: glHRJJ9JMUwNfQ8OwAQi
|
||||
secret: MnghmYJpM1U2RaLx
|
||||
baseUrl: https://api.dttrip.cn/openapi
|
||||
account: 4f9cb1080b564dd0a94aa95f7a19c8b5
|
||||
password: 1fD3SutgzfS48qznYQiq
|
||||
secret: WOHzCMvHd823iHgH
|
||||
baseUrl: https://api.qa.dttrip.cn/openapi
|
||||
ifForwardRequest: false
|
||||
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ chint:
|
|||
# host: gf-jump.chint.com
|
||||
# port: 30108
|
||||
# database: itinerary_booking
|
||||
# username: e2b8171f-9920-4972-8f84-383ff27eee44
|
||||
# password: zbPYf9CUI1ef1nhW
|
||||
# username: 5d34865d-187b-45a1-937b-13687ba4d4a4
|
||||
# password: XqU0PhUa8LQla6Gl
|
||||
|
||||
url: https://trip.chint.com/
|
||||
redis:
|
||||
|
|
|
@ -48,10 +48,10 @@ logging:
|
|||
#正式
|
||||
ly:
|
||||
appId: zhengtai
|
||||
account: ab9fe0c19dd64a99b936fded72c3bb94
|
||||
password: glHRJJ9JMUwNfQ8OwAQi
|
||||
secret: MnghmYJpM1U2RaLx
|
||||
baseUrl: https://api.dttrip.cn/openapi
|
||||
account: 4f9cb1080b564dd0a94aa95f7a19c8b5
|
||||
password: 1fD3SutgzfS48qznYQiq
|
||||
secret: WOHzCMvHd823iHgH
|
||||
baseUrl: https://api.qa.dttrip.cn/openapi
|
||||
ifForwardRequest: false
|
||||
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.chint.domain.aggregates.order.RouteOrder;
|
|||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.*;
|
||||
import com.chint.domain.service.JTCompanyDomainService;
|
||||
import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
|
||||
import com.chint.domain.value_object.RanksData;
|
||||
import com.chint.infrastructure.util.Digest;
|
||||
import com.chint.infrastructure.util.PinyinUtil;
|
||||
|
@ -116,6 +117,8 @@ class RouteApplicationTests {
|
|||
@Autowired
|
||||
private UserHttpRequestImpl userHttpRequestImpl;
|
||||
|
||||
@Autowired
|
||||
private LYOrderSyncAdapter lyOrderSyncAdapter;
|
||||
|
||||
@Autowired
|
||||
private UserSFRequest userSFRequest;
|
||||
|
@ -264,9 +267,9 @@ class RouteApplicationTests {
|
|||
// log.trace("trace");
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void loginSignProd() {
|
||||
String sfno = "081001001";
|
||||
String sfno = "230601010";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240315000308";
|
||||
String companycode = "浙江正泰电器股份有限公司";
|
||||
|
@ -1206,4 +1209,10 @@ class RouteApplicationTests {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
void testQueryCity() {
|
||||
Location location = locationRepository.findById(373L);
|
||||
Location cityLocation = lyOrderSyncAdapter.getCityLocation(location);
|
||||
System.out.println(cityLocation);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue