修改编译版本
This commit is contained in:
parent
85cfbd5ec6
commit
32ba08c300
|
@ -0,0 +1,11 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallback {
|
||||||
|
private String method; // Method of the callback, e.g., "trip.callback"
|
||||||
|
private TripCallbackData data; // Main data containing trip details
|
||||||
|
|
||||||
|
// Getters and setters...
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallbackCity {
|
||||||
|
private String geoId; // Geographical ID of the city
|
||||||
|
private String cityEnName; // English name of the city
|
||||||
|
private String cityName; // Local name of the city
|
||||||
|
|
||||||
|
// Getters and setters...
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallbackData {
|
||||||
|
private String changeCar; // Indicates if a car change is requested
|
||||||
|
private String startDate; // Start date of the trip
|
||||||
|
private String endDate; // End date of the trip
|
||||||
|
private String receiptsNum; // Receipts number
|
||||||
|
private String businessTripReason; // Reason for the business trip
|
||||||
|
private String receiptsStatus; // Status of the receipts
|
||||||
|
private String createUserId; // User ID of the creator
|
||||||
|
private String createUserName; // Name of the creator
|
||||||
|
private String createUserMobile; // Mobile number of the creator
|
||||||
|
private String compName; // Company name
|
||||||
|
private String compId; // Company ID
|
||||||
|
private String createTime; // Creation time of the trip
|
||||||
|
private String type; // Type of document, e.g., "0" for application
|
||||||
|
// Additional fields...
|
||||||
|
private List<TripCallbackCity> cityList; // List of cities involved in the trip
|
||||||
|
private List<TripCallbackUserInfo> userInfoList; // List of user information
|
||||||
|
private List<TripCallbackScheduleDetail> scheduleDetailList; // List of schedule details
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallbackDocument {
|
||||||
|
private String docType; // Type of the document, e.g., visa, ticket
|
||||||
|
private String docId; // Unique identifier for the document
|
||||||
|
private String docName; // Name of the document
|
||||||
|
private String issueDate; // Issue date of the document
|
||||||
|
private String expiryDate; // Expiry date of the document
|
||||||
|
private String issuingAuthority; // Authority that issued the document
|
||||||
|
|
||||||
|
// Getters and setters...
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallbackScheduleDetail {
|
||||||
|
private String scheduleType; // Type of schedule, e.g., flight, hotel
|
||||||
|
private String scheduleStartDate; // Start date of the schedule
|
||||||
|
private String scheduleEndDate; // End date of the schedule
|
||||||
|
private String city; // City associated with this schedule
|
||||||
|
private String country; // Country associated with this schedule
|
||||||
|
private String detail; // Detailed information about the schedule
|
||||||
|
private TripCallbackDocument document; // Document associated with the schedule
|
||||||
|
|
||||||
|
// Getters and setters...
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.chint.application.dtos.trip;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TripCallbackUserInfo {
|
||||||
|
private String userId; // Unique identifier for the user
|
||||||
|
private String userName; // Name of the user
|
||||||
|
private String userMobile; // Mobile number of the user
|
||||||
|
private List<TripCallbackDocument> documents; // List of documents associated with the user
|
||||||
|
|
||||||
|
// Getters and setters...
|
||||||
|
}
|
|
@ -9,9 +9,10 @@ public class SupplierCallbackData {
|
||||||
private Integer productType; //用于区分同程搜索数据
|
private Integer productType; //用于区分同程搜索数据
|
||||||
private Object data;
|
private Object data;
|
||||||
|
|
||||||
public static SupplierCallbackData of(String supplierName) {
|
public static SupplierCallbackData of(String supplierName, String employeeNo) {
|
||||||
SupplierCallbackData supplierCallbackData = new SupplierCallbackData();
|
SupplierCallbackData supplierCallbackData = new SupplierCallbackData();
|
||||||
supplierCallbackData.setSupplierName(supplierName);
|
supplierCallbackData.setSupplierName(supplierName);
|
||||||
|
supplierCallbackData.setEmployeeNo(employeeNo);
|
||||||
return supplierCallbackData;
|
return supplierCallbackData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class CTripOrderSearchRequest {
|
||||||
return postRequest.post(searchUrl, request, SearchOrderResponse.class);
|
return postRequest.post(searchUrl, request, SearchOrderResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SearchOrderResponse SearchOrderResponseByOrderId(String orderId){
|
public SearchOrderResponse searchOrderResponseByOrderId(String orderId){
|
||||||
String ticket = ticketRequest.loadTicket();
|
String ticket = ticketRequest.loadTicket();
|
||||||
SearchOrderRequest request = SearchOrderRequest
|
SearchOrderRequest request = SearchOrderRequest
|
||||||
.builder()
|
.builder()
|
||||||
|
|
|
@ -1,27 +1,40 @@
|
||||||
package com.chint.interfaces.rest.ctrip.in;
|
package com.chint.interfaces.rest.ctrip.in;
|
||||||
|
|
||||||
|
import com.chint.domain.service.supplier.SupplierService;
|
||||||
|
import com.chint.domain.value_object.SupplierCallbackData;
|
||||||
|
import com.chint.interfaces.rest.ctrip.CTripOrderSearchRequest;
|
||||||
import com.chint.interfaces.rest.ctrip.dto.put.CTripNoteResponse;
|
import com.chint.interfaces.rest.ctrip.dto.put.CTripNoteResponse;
|
||||||
import com.chint.interfaces.rest.ctrip.dto.put.CTripNotification;
|
import com.chint.interfaces.rest.ctrip.dto.put.CTripNotification;
|
||||||
|
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import static com.chint.infrastructure.constant.Constant.SUPPLIER_C_TRIP;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/public/CTrip")
|
@RequestMapping("/public/CTrip")
|
||||||
public class CTripNoteController {
|
public class CTripNoteController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SupplierService supplierService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CTripOrderSearchRequest cTripOrderSearchRequest;
|
||||||
|
|
||||||
@PostMapping("/event")
|
@PostMapping("/event")
|
||||||
public CTripNoteResponse noteEvent(@RequestBody CTripNotification cTripNotification) {
|
public CTripNoteResponse noteEvent(@RequestBody CTripNotification cTripNotification) {
|
||||||
if (cTripNotification.getContent() != null) {
|
if (cTripNotification.getContent() != null && cTripNotification.getPreEmployeeID() != null) {
|
||||||
//成功触发消息,需要查询对于的订单信息,
|
//成功触发消息,需要查询对于的订单信息,調用订单查询的服务来查询该订单详情
|
||||||
|
SupplierCallbackData supplierCallbackData =
|
||||||
//如果订单不存在需要保存到数据库以及对应的行程规划单下
|
SupplierCallbackData.of(SUPPLIER_C_TRIP, cTripNotification.getPreEmployeeID());
|
||||||
|
SearchOrderResponse response = cTripOrderSearchRequest
|
||||||
//如果订单以及存在,那么只需要给对应的订单加入对应的事件
|
.searchOrderResponseByOrderId(cTripNotification.getBusinessId());
|
||||||
|
supplierCallbackData.data(response);
|
||||||
|
supplierService.handleSupplierCallback(supplierCallbackData);
|
||||||
return new CTripNoteResponse("0", "成功收到消息");
|
return new CTripNoteResponse("0", "成功收到消息");
|
||||||
}
|
}
|
||||||
return new CTripNoteResponse("1", "未收到消息");
|
return new CTripNoteResponse("1", "未收到消息");
|
||||||
|
|
|
@ -4,12 +4,12 @@ server:
|
||||||
chint:
|
chint:
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
host: rm-cn-jeo3lfy9q0006gso.rwlb.rds.aliyuncs.com
|
host: 10.10.24.44
|
||||||
# host: 10.9.56.48
|
# host: 10.9.56.48
|
||||||
port: 3306
|
port: 6603
|
||||||
database: itinerary_booking
|
database: itinerary_booking
|
||||||
username: echo
|
username: tripbook
|
||||||
password: R3nd0mP@ssw0rd!
|
password: W@Xgf25d&lRk*L0X#
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
org.springframework.jdbc.core.JdbcTemplate: DEBUG
|
org.springframework.jdbc.core.JdbcTemplate: DEBUG
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
server:
|
||||||
|
port: 8081
|
||||||
|
|
||||||
|
chint:
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
host: rm-cn-jeo3lfy9q0006gso.rwlb.rds.aliyuncs.com
|
||||||
|
# host: 10.9.56.48
|
||||||
|
port: 3306
|
||||||
|
database: itinerary_booking
|
||||||
|
username: echo
|
||||||
|
password: R3nd0mP@ssw0rd!
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.springframework.jdbc.core.JdbcTemplate: DEBUG
|
||||||
|
org.springframework.jdbc.core.StatementCreatorUtils: TRACE
|
|
@ -1,6 +1,6 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: test
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: ${chint.datasource.driver-class-name}
|
driver-class-name: ${chint.datasource.driver-class-name}
|
||||||
url: jdbc:mysql://${chint.datasource.host}:${chint.datasource.port}/${chint.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://${chint.datasource.host}:${chint.datasource.port}/${chint.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||||
|
|
Loading…
Reference in New Issue