测试环境订票修改为同程测试环境

This commit is contained in:
lulz1 2024-03-25 12:46:10 +08:00
parent bf21d7bb37
commit a862d4cde3
9 changed files with 82 additions and 17 deletions

View File

@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
@ -23,4 +22,10 @@ public class OrderTravel implements Serializable {
private String orderNo; private String orderNo;
private String travelNo; private String travelNo;
public static OrderTravel of(String orderNo, String travelNo) {
OrderTravel orderTravel = new OrderTravel();
orderTravel.setTravelNo(travelNo);
orderTravel.setOrderNo(orderNo);
return orderTravel;
}
} }

View File

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

View File

@ -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)) { if (location.getLocationType().equals(LOCATION_TYPE_CITY)) {
return location; 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()); return locationRepository.findById(location.getParentLocationId());
} else if (location.getLocationType().equals(LOCATION_TYPE_AIRPORT)) { } else if (location.getLocationType().equals(LOCATION_TYPE_AIRPORT)) {
//如果是机场的话要查询出对应的地级市 //如果是机场的话要查询出对应的地级市

View File

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

View File

@ -2,7 +2,9 @@ package com.chint.interfaces.rest.ly.in;
import com.chint.application.commands.OrderStatusChangeCommand; import com.chint.application.commands.OrderStatusChangeCommand;
import com.chint.domain.aggregates.order.OrderDetail; import com.chint.domain.aggregates.order.OrderDetail;
import com.chint.domain.aggregates.order.OrderTravel;
import com.chint.domain.exceptions.NotFoundException; import com.chint.domain.exceptions.NotFoundException;
import com.chint.domain.repository.OrderTravelRepository;
import com.chint.domain.service.SystemDomainService; import com.chint.domain.service.SystemDomainService;
import com.chint.domain.service.supplier.SupplierService; import com.chint.domain.service.supplier.SupplierService;
import com.chint.domain.value_object.SupplierCallbackData; import com.chint.domain.value_object.SupplierCallbackData;
@ -49,6 +51,9 @@ public class LYETAController {
@Autowired @Autowired
private SupplierService supplierService; private SupplierService supplierService;
@Autowired
private OrderTravelRepository orderTravelRepository;
@PostMapping("/eta") @PostMapping("/eta")
public LYNoteResponse noteByETA(@RequestBody LyETAPush lyETAPush) { public LYNoteResponse noteByETA(@RequestBody LyETAPush lyETAPush) {
if (lyETAPush.getNotifyType() != 51) { if (lyETAPush.getNotifyType() != 51) {
@ -56,6 +61,7 @@ public class LYETAController {
} }
LyETAPush.NotifyData notifyData = lyETAPush.getNotifyData(); LyETAPush.NotifyData notifyData = lyETAPush.getNotifyData();
String approvalOrderId = notifyData.getApprovalOrderId();
String travelApplyNo = notifyData.getTravelApplyNo(); String travelApplyNo = notifyData.getTravelApplyNo();
String[] split = travelApplyNo.split("-"); String[] split = travelApplyNo.split("-");
if (split.length == 0) { if (split.length == 0) {
@ -67,7 +73,7 @@ public class LYETAController {
if (systemDomainService.ifImmediateResponse(sysCode)) { if (systemDomainService.ifImmediateResponse(sysCode)) {
//如果是可以立刻返回结果的直接返回审批通过信息 //如果是可以立刻返回结果的直接返回审批通过信息
CompletableFuture.runAsync(() -> DelayDispatch.attemptToSend( 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); SupplierCallbackData supplierCallbackData = handlerETACallBackData(lyETAPush);
OrderDetail orderDetail = supplierService.handleSupplierCallback(supplierCallbackData); OrderDetail orderDetail = supplierService.handleSupplierCallback(supplierCallbackData);
orderTravelRepository.save(OrderTravel.of(orderDetail.getOrderNo(), approvalOrderId));
//发送超标事件 //发送超标事件
Command.of(OrderStatusChangeCommand.class) Command.of(OrderStatusChangeCommand.class)
.orderDetail(orderDetail) .orderDetail(orderDetail)
@ -85,7 +93,7 @@ public class LYETAController {
.sendToQueue(); .sendToQueue();
int subNotifyType = lyETAPush.getSubNotifyType(); int subNotifyType = lyETAPush.getSubNotifyType();
if(subNotifyType == 2 || subNotifyType == 4 || subNotifyType == 6 ){ if (subNotifyType == 2 || subNotifyType == 4 || subNotifyType == 6) {
//如果推送类是2,4,6还要触发改签事件 //如果推送类是2,4,6还要触发改签事件
Command.of(OrderStatusChangeCommand.class) Command.of(OrderStatusChangeCommand.class)
.orderDetail(orderDetail) .orderDetail(orderDetail)

View File

@ -38,10 +38,10 @@ logging:
#正式 #正式
ly: ly:
appId: zhengtai appId: zhengtai
account: ab9fe0c19dd64a99b936fded72c3bb94 account: 4f9cb1080b564dd0a94aa95f7a19c8b5
password: glHRJJ9JMUwNfQ8OwAQi password: 1fD3SutgzfS48qznYQiq
secret: MnghmYJpM1U2RaLx secret: WOHzCMvHd823iHgH
baseUrl: https://api.dttrip.cn/openapi baseUrl: https://api.qa.dttrip.cn/openapi
ifForwardRequest: false ifForwardRequest: false
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz

View File

@ -14,8 +14,8 @@ chint:
# host: gf-jump.chint.com # host: gf-jump.chint.com
# port: 30108 # port: 30108
# database: itinerary_booking # database: itinerary_booking
# username: e2b8171f-9920-4972-8f84-383ff27eee44 # username: 5d34865d-187b-45a1-937b-13687ba4d4a4
# password: zbPYf9CUI1ef1nhW # password: XqU0PhUa8LQla6Gl
url: https://trip.chint.com/ url: https://trip.chint.com/
redis: redis:

View File

@ -48,10 +48,10 @@ logging:
#正式 #正式
ly: ly:
appId: zhengtai appId: zhengtai
account: ab9fe0c19dd64a99b936fded72c3bb94 account: 4f9cb1080b564dd0a94aa95f7a19c8b5
password: glHRJJ9JMUwNfQ8OwAQi password: 1fD3SutgzfS48qznYQiq
secret: MnghmYJpM1U2RaLx secret: WOHzCMvHd823iHgH
baseUrl: https://api.dttrip.cn/openapi baseUrl: https://api.qa.dttrip.cn/openapi
ifForwardRequest: false ifForwardRequest: false
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz

View File

@ -14,6 +14,7 @@ import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.user.User; import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.*; import com.chint.domain.repository.*;
import com.chint.domain.service.JTCompanyDomainService; import com.chint.domain.service.JTCompanyDomainService;
import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
import com.chint.domain.value_object.RanksData; import com.chint.domain.value_object.RanksData;
import com.chint.infrastructure.util.Digest; import com.chint.infrastructure.util.Digest;
import com.chint.infrastructure.util.PinyinUtil; import com.chint.infrastructure.util.PinyinUtil;
@ -116,6 +117,8 @@ class RouteApplicationTests {
@Autowired @Autowired
private UserHttpRequestImpl userHttpRequestImpl; private UserHttpRequestImpl userHttpRequestImpl;
@Autowired
private LYOrderSyncAdapter lyOrderSyncAdapter;
@Autowired @Autowired
private UserSFRequest userSFRequest; private UserSFRequest userSFRequest;
@ -264,9 +267,9 @@ class RouteApplicationTests {
// log.trace("trace"); // log.trace("trace");
} }
// @Test @Test
void loginSignProd() { void loginSignProd() {
String sfno = "081001001"; String sfno = "230601010";
String syscode = "FSSC"; String syscode = "FSSC";
String billcode = "CLSQ240315000308"; String billcode = "CLSQ240315000308";
String companycode = "浙江正泰电器股份有限公司"; 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);
}
} }