Files
LabelChange-server/到货及出库模块接口对接文档.html
2026-06-01 16:30:29 +08:00

1766 lines
63 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>到货及出库模块接口对接文档</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
header {
background-color: #4CAF50;
color: white;
padding: 30px 0;
text-align: center;
margin-bottom: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
font-size: 2.5em;
margin-bottom: 10px;
}
h2 {
font-size: 2em;
margin: 40px 0 20px;
color: #4CAF50;
border-bottom: 2px solid #4CAF50;
padding-bottom: 10px;
}
h3 {
font-size: 1.5em;
margin: 30px 0 15px;
color: #333;
}
h4 {
font-size: 1.2em;
margin: 20px 0 10px;
color: #555;
}
p {
margin-bottom: 15px;
text-align: justify;
}
.section {
background-color: white;
padding: 30px;
margin-bottom: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.table-container {
overflow-x: auto;
margin: 20px 0;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:hover {
background-color: #f5f5f5;
}
.code-block {
background-color: #f8f8f8;
border: 1px solid #ddd;
border-radius: 4px;
padding: 15px;
margin: 15px 0;
font-family: 'Courier New', Courier, monospace;
white-space: pre-wrap;
overflow-x: auto;
}
.api-endpoint {
background-color: #e8f5e8;
border-left: 4px solid #4CAF50;
padding: 15px;
margin: 20px 0;
border-radius: 0 4px 4px 0;
}
.endpoint-path {
font-family: 'Courier New', Courier, monospace;
font-weight: bold;
color: #4CAF50;
margin-bottom: 10px;
}
.endpoint-method {
display: inline-block;
background-color: #4CAF50;
color: white;
padding: 4px 10px;
border-radius: 4px;
font-size: 0.9em;
margin-right: 10px;
}
.example {
background-color: #f0f8ff;
border: 1px solid #add8e6;
border-radius: 4px;
padding: 15px;
margin: 15px 0;
}
.example-title {
font-weight: bold;
margin-bottom: 10px;
color: #1e90ff;
}
.note {
background-color: #fff3cd;
border: 1px solid #ffeeba;
border-radius: 4px;
padding: 15px;
margin: 15px 0;
color: #856404;
}
.warning {
background-color: #f8d7da;
border: 1px solid #f5c6cb;
border-radius: 4px;
padding: 15px;
margin: 15px 0;
color: #721c24;
}
ul, ol {
margin: 15px 0;
padding-left: 30px;
}
li {
margin-bottom: 8px;
}
.success {
color: #28a745;
}
.error {
color: #dc3545;
}
.info {
color: #17a2b8;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>到货及出库模块接口对接文档</h1>
<p>详细的到货及出库模块API接口使用说明</p>
</header>
<div class="section">
<h2>1. 接口概述</h2>
<p>到货及出库模块提供了一系列RESTful API接口用于到货交接单和出库交接单的创建、查询、更新以及与袋牌的关联操作。本文档详细描述了这些接口的使用方法、请求参数和响应格式。</p>
<h3>1.1 接口基础信息</h3>
<ul>
<li><strong>基础URL</strong><code>http://{服务器地址}:{端口}/api/shipping-handover</code></li>
<li><strong>测试环境请求地址</strong><code>http://172.232.21.79:5002</code></li>
<li><strong>正式环境请求地址</strong><code>https://lr.tooexp.com</code></li>
<li><strong>请求方式</strong>POST/GET</li>
<li><strong>数据格式</strong>JSON</li>
<li><strong>响应格式</strong>JSON</li>
</ul>
<h3>1.2 状态码说明</h3>
<div class="table-container">
<table>
<thead>
<tr>
<th>状态码</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>操作成功</td>
</tr>
<tr>
<td>400</td>
<td>请求参数错误或操作失败</td>
</tr>
<tr>
<td>404</td>
<td>资源不存在</td>
</tr>
<tr>
<td>500</td>
<td>服务器内部错误</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<h2>2. 接口详细说明</h2>
<h3>2.1 到货交接单模块</h3>
<div class="api-endpoint">
<h4>2.1.1 查询到货交接单信息</h4>
<div class="endpoint-path">
<span class="endpoint-method">POST</span>
<span>/receipt-query</span>
</div>
<p>根据到货编号查询到货交接单详细信息,包括包裹数、已有标签率、到货时间等</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrivalNumber</td>
<td>string</td>
<td></td>
<td>到货编号(提单号或大箱号)</td>
<td>"TEST1ZX30Y730494260906"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求体示例</h5>
<div class="code-block">
{
"arrivalNumber": "TEST1ZX30Y730494260906",
"callback": null
}
</div>
<h5>Mock数据</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>到货编号</th>
<th>包裹数</th>
<th>已有标签率</th>
<th>到货时间</th>
<th>提单号</th>
<th>大箱号</th>
</tr>
</thead>
<tbody>
<tr>
<td>TEST1ZX30Y730494260906</td>
<td>1200</td>
<td>0.8</td>
<td>1744032000000</td>
<td>TEST1ZX30Y730494260906</td>
<td>testS169-3-20-2-1</td>
</tr>
<tr>
<td>TEST1ZX30Y730494260907</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>TEST1ZX30Y730494260907</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
POST /api/arrival-handover/receipt-query
Content-Type: application/json
{
"arrivalNumber": "TEST1ZX30Y730494260906"
}
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": {
"packageCount": 1200,
"labelRate": 0.8,
"arrivalTime": 1744032000000,
"billOfLadingNumber": "TEST1ZX30Y730494260906",
"masterPackageNumber": "testS169-3-20-2-1"
}
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>packageCount</td>
<td>int</td>
<td>包裹总数</td>
</tr>
<tr>
<td>labelRate</td>
<td>double</td>
<td>已有标签率</td>
</tr>
<tr>
<td>arrivalTime</td>
<td>long?</td>
<td>到货时间戳毫秒UTC</td>
</tr>
<tr>
<td>billOfLadingNumber</td>
<td>string</td>
<td>提单号</td>
</tr>
<tr>
<td>masterPackageNumber</td>
<td>string</td>
<td>大箱号</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "无预报数据",
"data": {
"billOfLadingNumber": "TEST1ZX30Y730494260907",
"masterPackageNumber": ""
}
}
</div>
</div>
<h3>2.2 出库交接单模块</h3>
<div class="api-endpoint">
<h4>2.2.1 查询出库交接单详细信息</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/details/{handoverNumber}</span>
</div>
<p>根据出库交接单号查询详细信息包括BOL单号、渠道商、袋牌数量、总包裹数和交接单状态</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>handoverNumber</td>
<td>string</td>
<td></td>
<td>出库交接单号(路径参数)</td>
<td>"TESTBOL001"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>Mock数据</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>出库交接单号</th>
<th>渠道商</th>
<th>袋牌数量</th>
<th>总包裹数</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr>
<td>TESTBOL001</td>
<td>GOFO</td>
<td>3</td>
<td>150</td>
<td>Draft</td>
</tr>
<tr>
<td>TESTBOL002</td>
<td>USPS</td>
<td>5</td>
<td>250</td>
<td>Draft</td>
</tr>
<tr>
<td>TESTBOL003</td>
<td>UPS</td>
<td>0</td>
<td>0</td>
<td>Draft</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/details/TESTBOL001
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": {
"handoverNumber": "TESTBOL001",
"channel": "GOFO",
"bagTagCount": 3,
"totalPackageCount": 150,
"status": "Draft"
}
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>handoverNumber</td>
<td>string</td>
<td>交接单号</td>
</tr>
<tr>
<td>channel</td>
<td>string</td>
<td>渠道商</td>
</tr>
<tr>
<td>bagTagCount</td>
<td>int</td>
<td>袋牌数量</td>
</tr>
<tr>
<td>totalPackageCount</td>
<td>int</td>
<td>总包裹数</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>状态</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "Shipping handover form not found"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.2.2 确认出库交接单</h4>
<div class="endpoint-path">
<span class="endpoint-method">POST</span>
<span>/confirm</span>
</div>
<p>确认出库交接单,将状态从草稿修改为已出库</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>handoverNumber</td>
<td>string</td>
<td></td>
<td>出库交接单号</td>
<td>"TESTBOL001"</td>
</tr>
<tr>
<td>deliveryTime</td>
<td>long?</td>
<td></td>
<td>出货时间戳毫秒UTC</td>
<td>1744032000000</td>
</tr>
<tr>
<td>pod</td>
<td>string</td>
<td></td>
<td>POD图片链接至少包含两张图片用逗号分隔</td>
<td>"https://example.com/pod1.jpg,https://example.com/pod2.jpg"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求体示例</h5>
<div class="code-block">
{
"handoverNumber": "TESTBOL001",
"deliveryTime": 1744032000000,
"pod": "https://example.com/pod1.jpg,https://example.com/pod2.jpg",
"callback": null
}
</div>
<h5>Mock数据</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>出库交接单号</th>
<th>操作结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>TESTBOL001</td>
<td>成功</td>
</tr>
<tr>
<td>TESTBOL002</td>
<td>成功</td>
</tr>
<tr>
<td>TESTBOL003</td>
<td>成功</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
POST /api/shipping-handover/confirm
Content-Type: application/json
{
"handoverNumber": "TESTBOL001",
"deliveryTime": 1744032000000,
"pod": "https://example.com/pod1.jpg,https://example.com/pod2.jpg"
}
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>bool</td>
<td>操作结果</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
<h5>业务规则</h5>
<ol>
<li>一旦执行确认出库操作后,系统不允许对同一交接单再次执行出库操作</li>
<li>每次出库操作至少关联一个袋牌信息</li>
<li>POD字段必须至少包含两张图片的S3链接</li>
</ol>
</div>
<div class="api-endpoint">
<h4>2.2.3 创建出库交接单</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/create</span>
</div>
<p>创建出库交接单</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>HandoverNumber</td>
<td>string</td>
<td></td>
<td>交接单号,为空时自动生成</td>
<td>"BOL-ORD-GOFO-20260325-001"</td>
</tr>
<tr>
<td>Channel</td>
<td>string</td>
<td></td>
<td>渠道</td>
<td>"GOFO"</td>
</tr>
<tr>
<td>DeliveryTime</td>
<td>DateTime?</td>
<td></td>
<td>交货时间</td>
<td>"2026-05-08T10:00:00Z"</td>
</tr>
<tr>
<td>POD</td>
<td>string</td>
<td></td>
<td>POD图片链接</td>
<td>"https://example.com/pod1.jpg,https://example.com/pod2.jpg"</td>
</tr>
<tr>
<td>Remarks</td>
<td>string</td>
<td></td>
<td>备注</td>
<td>"测试备注"</td>
</tr>
<tr>
<td>Creator</td>
<td>string</td>
<td></td>
<td>创建人</td>
<td>"test_user"</td>
</tr>
<tr>
<td>TimeZone</td>
<td>string</td>
<td></td>
<td>时区</td>
<td>"America/New_York"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/create?Channel=GOFO&Creator=test_user&TimeZone=America/New_York
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": 1
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>int</td>
<td>新增记录ID</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.2.4 获取出库交接单列表</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/list</span>
</div>
<p>获取出库交接单列表,支持分页和筛选</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td>int</td>
<td></td>
<td>页码默认1</td>
<td>1</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td></td>
<td>每页数量默认10</td>
<td>10</td>
</tr>
<tr>
<td>sortBy</td>
<td>string</td>
<td></td>
<td>排序字段默认CreatedAt</td>
<td>"CreatedAt"</td>
</tr>
<tr>
<td>sortOrder</td>
<td>string</td>
<td></td>
<td>排序方向默认desc</td>
<td>"desc"</td>
</tr>
<tr>
<td>handoverNumber</td>
<td>string</td>
<td></td>
<td>交接单号</td>
<td>"BOL-ORD-GOFO-20260325-001"</td>
</tr>
<tr>
<td>channel</td>
<td>string</td>
<td></td>
<td>渠道</td>
<td>"GOFO"</td>
</tr>
<tr>
<td>creator</td>
<td>string</td>
<td></td>
<td>创建人</td>
<td>"test_user"</td>
</tr>
<tr>
<td>startDeliveryTime</td>
<td>DateTime?</td>
<td></td>
<td>开始交货时间</td>
<td>"2026-05-08T10:00:00Z"</td>
</tr>
<tr>
<td>endDeliveryTime</td>
<td>DateTime?</td>
<td></td>
<td>结束交货时间</td>
<td>"2026-05-09T10:00:00Z"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/list?page=1&pageSize=10&channel=GOFO
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": {
"forms": [
{
"Id": 1,
"HandoverNumber": "BOL-ORD-GOFO-20260325-001",
"BigBagCount": 3,
"SmallBagCount": 150,
"Channel": "GOFO",
"DeliveryTime": 1744032000000,
"POD": "https://example.com/pod1.jpg",
"Remarks": "测试备注",
"Creator": "test_user",
"CreatedAt": 1744032000000,
"UpdatedAt": 1744032000000,
"TimeZone": "America/New_York",
"Status": 0
}
],
"totalCount": 1
}
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>forms</td>
<td>array</td>
<td>交接单列表</td>
</tr>
<tr>
<td>totalCount</td>
<td>int</td>
<td>总记录数</td>
</tr>
</tbody>
</table>
</div>
<h5>ShippingHandoverFormEntity 字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>Id</td>
<td>int</td>
<td>主键ID</td>
</tr>
<tr>
<td>HandoverNumber</td>
<td>string</td>
<td>交接单号</td>
</tr>
<tr>
<td>BigBagCount</td>
<td>int</td>
<td>袋牌数量</td>
</tr>
<tr>
<td>SmallBagCount</td>
<td>int</td>
<td>包裹数量</td>
</tr>
<tr>
<td>Channel</td>
<td>string</td>
<td>渠道</td>
</tr>
<tr>
<td>DeliveryTime</td>
<td>long?</td>
<td>交货时间戳毫秒UTC</td>
</tr>
<tr>
<td>POD</td>
<td>string</td>
<td>POD图片链接</td>
</tr>
<tr>
<td>Remarks</td>
<td>string</td>
<td>备注</td>
</tr>
<tr>
<td>Creator</td>
<td>string</td>
<td>创建人</td>
</tr>
<tr>
<td>CreatedAt</td>
<td>long</td>
<td>创建时间戳毫秒UTC</td>
</tr>
<tr>
<td>UpdatedAt</td>
<td>long</td>
<td>更新时间戳毫秒UTC</td>
</tr>
<tr>
<td>TimeZone</td>
<td>string</td>
<td>时区</td>
</tr>
<tr>
<td>Status</td>
<td>int</td>
<td>状态0=草稿1=已出库)</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<h3>2.3 出库交接单与袋牌关联模块</h3>
<div class="api-endpoint">
<h4>2.3.1 关联袋牌到出货交接单</h4>
<div class="endpoint-path">
<span class="endpoint-method">POST</span>
<span>/bag-tag/associate/{shippingHandoverFormId}</span>
</div>
<p>关联袋牌到出货交接单</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>shippingHandoverFormId</td>
<td>int</td>
<td></td>
<td>出货交接单ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>bagTagIds</td>
<td>List&lt;int&gt;</td>
<td></td>
<td>袋牌ID列表请求体</td>
<td>[1, 2, 3]</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
POST /api/shipping-handover/bag-tag/associate/1
Content-Type: application/json
[1, 2, 3]
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.2 获取出货交接单关联的袋牌列表</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/list/{shippingHandoverFormId}</span>
</div>
<p>获取出货交接单关联的袋牌列表</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>shippingHandoverFormId</td>
<td>int</td>
<td></td>
<td>出货交接单ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/list/1
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": [
{
"Id": 1,
"TagNumber": "USPS202601271200000001",
"ChannelName": "USPS",
"Status": "Closed",
"Creator": "system",
"CreatedAt": 1706361600000,
"OpenedAt": 1706361900000,
"ClosedAt": 1706363400000
}
]
}
</div>
<h5>BagTagEntity 字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>Id</td>
<td>int</td>
<td>主键ID</td>
</tr>
<tr>
<td>TagNumber</td>
<td>string</td>
<td>袋牌号</td>
</tr>
<tr>
<td>ChannelName</td>
<td>string</td>
<td>渠道名</td>
</tr>
<tr>
<td>Status</td>
<td>string</td>
<td>状态</td>
</tr>
<tr>
<td>Creator</td>
<td>string</td>
<td>创建人</td>
</tr>
<tr>
<td>CreatedAt</td>
<td>long</td>
<td>创建时间戳毫秒UTC</td>
</tr>
<tr>
<td>OpenedAt</td>
<td>long?</td>
<td>开袋时间戳毫秒UTC</td>
</tr>
<tr>
<td>ClosedAt</td>
<td>long?</td>
<td>封袋时间戳毫秒UTC</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.3 从出货交接单中移除袋牌</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/remove/{relationId}</span>
</div>
<p>从出货交接单中移除袋牌</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>relationId</td>
<td>int</td>
<td></td>
<td>关联ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/remove/1
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.4 清空出货交接单的所有袋牌关联</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/clear/{shippingHandoverFormId}</span>
</div>
<p>清空出货交接单的所有袋牌关联</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>shippingHandoverFormId</td>
<td>int</td>
<td></td>
<td>出货交接单ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/clear/1
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.5 统计出货交接单的袋牌数量和包裹数量</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/count/{shippingHandoverFormId}</span>
</div>
<p>统计出货交接单的袋牌数量和包裹数量</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>shippingHandoverFormId</td>
<td>int</td>
<td></td>
<td>出货交接单ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/count/1
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": {
"bagTagCount": 3,
"packageCount": 150
}
}
</div>
<h5>响应字段说明</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>字段名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>bagTagCount</td>
<td>int</td>
<td>袋牌数量</td>
</tr>
<tr>
<td>packageCount</td>
<td>int</td>
<td>包裹数量</td>
</tr>
</tbody>
</table>
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.6 检查袋牌是否已关联到出货交接单</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/check/{bagTagId}</span>
</div>
<p>检查袋牌是否已关联到出货交接单</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>bagTagId</td>
<td>int</td>
<td></td>
<td>袋牌ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/check/1
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
<div class="api-endpoint">
<h4>2.3.7 通过袋牌号关联袋牌到出货交接单</h4>
<div class="endpoint-path">
<span class="endpoint-method">GET</span>
<span>/bag-tag/associate-by-number/{shippingHandoverFormId}</span>
</div>
<p>通过袋牌号关联袋牌到出货交接单</p>
<h5>请求参数</h5>
<div class="table-container">
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>shippingHandoverFormId</td>
<td>int</td>
<td></td>
<td>出货交接单ID路径参数</td>
<td>1</td>
</tr>
<tr>
<td>bagTagNumbers</td>
<td>string</td>
<td></td>
<td>袋牌号列表(逗号分隔)</td>
<td>"USPS202601271200000001,USPS202601271200000002"</td>
</tr>
<tr>
<td>callback</td>
<td>string</td>
<td></td>
<td>JSONP回调函数</td>
<td>"callback"</td>
</tr>
</tbody>
</table>
</div>
<h5>请求示例</h5>
<div class="code-block">
GET /api/shipping-handover/bag-tag/associate-by-number/1?bagTagNumbers=USPS202601271200000001,USPS202601271200000002
</div>
<h5>响应格式</h5>
<p><strong>成功响应</strong></p>
<div class="code-block">
{
"code": 0,
"message": "success",
"data": true
}
</div>
<p><strong>失败响应</strong></p>
<div class="code-block">
{
"code": 9999,
"message": "错误信息"
}
</div>
</div>
</div>
<div class="section">
<h2>3. 接口调用示例</h2>
<h3>3.1 使用cURL调用</h3>
<h4>查询出库交接单详细信息</h4>
<div class="code-block">
curl -X GET "http://localhost:5002/api/shipping-handover/details/TESTBOL001"
</div>
<h4>创建出库交接单</h4>
<div class="code-block">
curl -X GET "http://localhost:5002/api/shipping-handover/create?Channel=GOFO&Creator=test_user&TimeZone=America/New_York"
</div>
<h4>查询到货交接单信息POST请求</h4>
<div class="code-block">
curl -X POST "http://localhost:5002/api/arrival-handover/receipt-query" \
-H "Content-Type: application/json" \
-d '{"arrivalNumber": "TEST1ZX30Y730494260906"}'
</div>
<h3>3.2 使用PowerShell调用</h3>
<h4>查询出库交接单详细信息</h4>
<div class="code-block">
Invoke-RestMethod -Uri "http://localhost:5002/api/shipping-handover/details/TESTBOL001" `
-Method GET
</div>
<h4>创建出库交接单</h4>
<div class="code-block">
Invoke-RestMethod -Uri "http://localhost:5002/api/shipping-handover/create?Channel=GOFO&Creator=test_user&TimeZone=America/New_York" `
-Method GET
</div>
<h4>查询到货交接单信息POST请求</h4>
<div class="code-block">
$body = @{
arrivalNumber = "TEST1ZX30Y730494260906"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:5002/api/arrival-handover/receipt-query" `
-Method POST `
-Body $body `
-ContentType "application/json"
</div>
</div>
<div class="section">
<h2>4. 注意事项</h2>
<h3>4.1 数据验证</h3>
<ul>
<li>渠道不能为空</li>
<li>创建人不能为空</li>
<li>时区不能为空</li>
<li>时间戳均使用UTC时间毫秒</li>
</ul>
<h3>4.2 性能考虑</h3>
<ul>
<li>批量操作时,建议合理控制数据量</li>
<li>频繁的接口调用可能会影响系统性能,建议合理控制调用频率</li>
</ul>
</div>
<div class="section">
<h2>5. 常见问题</h2>
<h3>5.1 创建出库交接单失败</h3>
<p><strong>可能原因</strong></p>
<ul>
<li>渠道为空</li>
<li>创建人为空</li>
<li>时区为空</li>
</ul>
<p><strong>解决方案</strong></p>
<ul>
<li>确保必填参数不为空</li>
</ul>
<h3>5.2 查询出库交接单失败</h3>
<p><strong>可能原因</strong></p>
<ul>
<li>出库交接单号不存在</li>
</ul>
<p><strong>解决方案</strong></p>
<ul>
<li>检查出库交接单号是否正确</li>
</ul>
</div>
<div class="section">
<h2>6. 接口版本管理</h2>
<div class="table-container">
<table>
<thead>
<tr>
<th>版本</th>
<th>变更内容</th>
<th>发布日期</th>
</tr>
</thead>
<tbody>
<tr>
<td>v1.5</td>
<td>修改确认出库交接单接口的deliveryTime入参为long类型时间戳</td>
<td>2026-05-09</td>
</tr>
<tr>
<td>v1.4</td>
<td>恢复接口入参时间参数类型为DateTime/string返回值保持为long类型时间戳</td>
<td>2026-05-08</td>
</tr>
<tr>
<td>v1.3</td>
<td>修改确认出库交接单接口为POST方法</td>
<td>2026-05-08</td>
</tr>
<tr>
<td>v1.2</td>
<td>修改receipt-query接口为POST方法时间字段改为long类型时间戳增加响应字段类型说明</td>
<td>2026-05-08</td>
</tr>
<tr>
<td>v1.1</td>
<td>新增查询到货交接单信息接口</td>
<td>2026-03-25</td>
</tr>
<tr>
<td>v1.0</td>
<td>初始版本,包含所有基础接口</td>
<td>2026-03-25</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<h2>7. 联系信息</h2>
<p>如有接口使用问题,请联系系统管理员或开发团队。</p>
</div>
</div>
</body>
</html>