fix: complete single-order acceptance and add Lingxing WMS integration

This commit is contained in:
2026-10-12 16:09:21 +08:00
parent 6c4ee2bfde
commit c06e788b0f
27 changed files with 2305 additions and 46 deletions
@@ -0,0 +1,68 @@
# Select explicitly with --spring.config.location=classpath:/application-lingxing-local.yml.
# No remote imports, database, registry or scheduled jobs are used by this local instance.
server:
address: 127.0.0.1
port: ${INTEGRATION_LOCAL_PORT:19210}
spring:
application:
name: integration-service
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
cloud:
bootstrap:
enabled: false
discovery:
enabled: false
service-registry:
auto-registration:
enabled: false
nacos:
config:
enabled: false
import-check:
enabled: false
discovery:
enabled: false
register-enabled: false
baiyue:
runtime:
scheduling-enabled: false
security:
internal-service-token: ${INTERNAL_SERVICE_TOKEN:}
integration:
lingxing-wms:
enabled: ${LINGXING_WMS_ENABLED:false}
base-uri: https://api.xlwms.com
app-key: ${LINGXING_WMS_APP_KEY:}
app-secret: ${LINGXING_WMS_APP_SECRET:}
connect-timeout: 5s
request-timeout: 15s
min-request-interval: 1s
baidu-ocr:
enabled: false
amazon-sp-api:
enabled: false
carrier-schedule:
matson:
enabled: false
hede:
enabled: false
sml:
enabled: false
zim:
enabled: false
evergreen:
enabled: false
management:
endpoints:
web:
exposure:
include: health
endpoint:
health:
show-details: never
@@ -35,6 +35,14 @@ baiyue:
security:
internal-service-token: ${INTERNAL_SERVICE_TOKEN:}
integration:
lingxing-wms:
enabled: ${LINGXING_WMS_ENABLED:false}
base-uri: https://api.xlwms.com
app-key: ${LINGXING_WMS_APP_KEY:}
app-secret: ${LINGXING_WMS_APP_SECRET:}
connect-timeout: 5s
request-timeout: 15s
min-request-interval: 1s
baidu-ocr:
enabled: ${BAIDU_OCR_ENABLED:false}
api-key: ${BAIDU_OCR_API_KEY:}
@@ -0,0 +1,81 @@
openapi: 3.0.3
info:
title: Lingxing WMS Internal Read API
version: 1.0.0
description: Read-only provider adapter. No business scheduling, persistence, inventory mutation or public Gateway route.
security:
- InternalServiceToken: []
paths:
/internal/integrations/lingxing/wms/outbound-orders/query:
post:
summary: Query one page of completed WMS outbound summaries by outbound time
description: Calls OMP /openapi/v2/order/delivery/page with timeType=outboundTime and status=100. Source time strings are preserved. This is a single page, not a complete sales report. It uses the self-developed-system API authorization in the WMS management console.
requestBody:
required: true
content:
application/json:
schema: {$ref: '#/components/schemas/QueryRequest'}
responses:
'200':
description: Standard envelope; code 200 for success, A0401 for rejected internal identity, A0422 for bean validation, B0001 or S0503 for provider/configuration failures. Failures never return a successful empty page.
content:
application/json:
schema: {$ref: '#/components/schemas/Response'}
components:
securitySchemes:
InternalServiceToken:
type: apiKey
in: header
name: X-Internal-Service-Token
schemas:
QueryRequest:
type: object
required: [startTime, endTime, current, size]
properties:
startTime: {type: string, example: '2026-09-12T08:00:00', description: Source local datetime; must precede endTime and must not be earlier than endTime minus one calendar month. This is a local guard.}
endTime: {type: string, example: '2026-10-12T08:00:00', description: Source local datetime.}
current: {type: integer, minimum: 1}
size: {type: integer, minimum: 1, maximum: 100, description: Local request cap; not a claim about the provider quota. Use 1 for connectivity verification.}
OrderSummary:
type: object
required: [deliveryNo]
properties:
deliveryNo: {type: string}
sourceNo: {type: string, nullable: true}
customerCode: {type: string, nullable: true}
whCode: {type: string, nullable: true}
status: {type: integer, nullable: true}
createTime: {type: string, nullable: true}
outboundTime: {type: string, nullable: true}
PageResult:
type: object
required: [records, current, size, sourceCode, observedAt]
properties:
records: {type: array, items: {$ref: '#/components/schemas/OrderSummary'}}
total: {type: string, pattern: '^[0-9]+$', nullable: true, description: Provider total only when supplied. Java Long follows the platform JSON string convention.}
current: {type: integer}
size: {type: integer}
sourceCode: {type: integer}
observedAt: {type: string, format: date-time}
ProviderFailure:
type: object
required: [errorCode, retryable]
properties:
errorCode: {type: string}
retryable: {type: boolean}
upstreamStatus: {type: integer, nullable: true}
sourceCode: {type: integer, nullable: true}
Response:
type: object
required: [code, message, data, timestamp]
properties:
code: {type: string}
message: {type: string, description: Sanitized local message; never the raw provider response.}
data:
nullable: true
oneOf:
- {$ref: '#/components/schemas/PageResult'}
- {$ref: '#/components/schemas/ProviderFailure'}
requestId: {type: string, nullable: true}
traceId: {type: string, nullable: true}
timestamp: {type: string, format: date-time}