> For the complete documentation index, see [llms.txt](https://yeasy.gitbook.io/blockchain_guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeasy.gitbook.io/blockchain_guide/11_app_dev/chaincode_example06.md).

# 物流供应链简单案例

[chaincode\_example06.go](https://github.com/yeasy/blockchain_guide/blob/master/11_app_dev/chaincode_example06.go) 演示物流公司、快递点、寄件人、收件人和寄货单的基本流程。

## 数据结构

* `User`：用户姓名、位置、地址、联系方式、余额和模拟密钥；
* `Express`：物流公司名称、地址、联系方式、余额和快递点列表；
* `ExpressPoint`：快递点名称、地址、联系方式和所属物流公司；
* `ExpressOrder`：寄货单、寄收双方、物流费用、途经快递点和签收状态。

## 主要交易函数

* `CreateUser`：创建寄件人或收件人；
* `CreateExpress`：创建物流公司；
* `CreateExpressPoint`：创建快递点；
* `AddExpressPoint`：将快递点加入物流公司；
* `CreateExpressOrder`：创建寄货单；
* `UpdateExpressOrder`：追加订单途经快递点；
* `FinishExpressOrder`：收件人签收并完成付款；
* `GetExpressOrderByID`、`GetExpress`、`GetUserByAddress`、`GetExpressPointByAddress`：读取状态。

示例保留两种付款方式：寄件人预付和收件人到付。真实系统中，签收验签与资金结算应接入正式身份、支付和风控流程。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://yeasy.gitbook.io/blockchain_guide/11_app_dev/chaincode_example06.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
