### 出貨,需製作約 3~4 頁,部分頁面可以使用彈窗類顯示資訊 1. 司機登入後先使用 /api/OutboundDespatch/LoadForDriver 取得該日的出貨託運單。 - 需帶 token 、 預約日期。 - 該頁面是多筆資料,列表顯示,顯示指定預約日期該司機有幾筆託運單。 - 此資料先以 `array1` 表示,(開發者自訂,此名稱方便下面說明) - 需顯示: | key | 對應 key 的中文名稱 | | --- | --- | | despatchNo | 託運單編號 | | carNo | 車輛 | | driverName | 司機名稱 | | storeHouseName | 倉庫 | | router | 運送受贈單位 | | distance | 運送距離(公里 | ```jsx { "columnFields": [], "code": 200, "msg": "載入成功", "count": 2, "data": [ { "despatchNo": "OD404164785111110", "carId": "333095815151686", "carNo": "BND-3795(高雄大寮)", "driverId": "324224866684997", "driverName": "郭建琳", "reserveDate": "2023-04-07 00:00:00", "storeHouseId": "356403446739014", "storeHouseName": "北基倉庫測試", "status": 0, "route": "測試單位", "distance": 1.23, "id": "404164785111109" }, { "despatchNo": "OD404167349788742", "carId": "333095499735110", "carNo": "BQC-3172(高雄大寮)", "driverId": "324224866684997", "driverName": "郭建琳", "reserveDate": "2023-04-07 00:00:00", "storeHouseId": "324246985531462", "storeHouseName": "板橋倉庫", "status": 0, "route": "測試單位>測試單位小驢X>測試教會", "distance": 473.46, "id": "404167349788741" } ] } ``` 1. 若要獲得該託運單中的詳細資訊,需使用 /api/OutboundDespatch/GetInfo 取得託運詳情。 - 需帶 token 、 `array1` 中個別物件的 `id`。 - 該頁面是單一資料,但是 `outboundDespatchRoute` (託運路線) 是陣列,`outboundDespatchRoute` 部分須以多筆顯示。 - 此資料先以 `obj1` 表示,(開發者自訂,此名稱方便下面說明) - 需顯示: | key | 對應 key 的中文名稱 | 說明 | | --- | --- | --- | | despatchNo | 託運單編號 | | | carNo | 車輛 | | | driverName | 司機名稱 | | | storeHouseName | 倉庫 | | | router | 運送受贈單位 | | | distance | 運送距離(公里 | | | | | outboundDespatchRoute 底下的資料 | | reserveDate | 預約時段 | | | recipientName | 單位名稱 | | ```jsx { "result": { "id": "404167349788741", "despatchNo": "OD404167349788742", "reserveDate": "2023-04-07 00:00:00", "driverId": "324224866684997", "driverName": "郭建琳", "carId": "333095499735110", "carNo": "BQC-3172(高雄大寮)", "storeHouseId": "324246985531462", "storeHouseName": "板橋倉庫", "status": 0, "route": "測試單位>測試單位小驢X>測試教會", "distance": 473.46, "outboundDespatchRoute": [ { "outboundDespatchId": "404167349788741", "outboundOrderId": "404167025414213", "outboundOrderNo": "404167025385541", "reserveDate": "2023-04-07 11:39:00", "sign": "", "status": 1, "recipientName": "測試單位" }, { "outboundDespatchId": "404167349788741", "outboundOrderId": "404167055609925", "outboundOrderNo": "404167055585349", "reserveDate": "2023-04-07 12:38:00", "sign": "", "status": 1, "recipientName": "測試單位小驢X" }, { "outboundDespatchId": "404167349788741", "outboundOrderId": "404167084630085", "outboundOrderNo": "404167084605509", "reserveDate": "2023-04-07 14:33:00", "sign": "", "status": 1, "recipientName": "測試教會" } ] }, "message": "操作成功", "code": 200 } ``` 1. 若要獲得訂單託運詳情中的商品資訊,需使用 /api/OutboundOrder/Get 取得 id ,可以打執行下一步。 - 需帶 token 、 `obj1.outboundDespatchRoute` 中的個別 `outboundOrderId` - 此資料頁面可以不顯示,但接下來流程會需要 `/api/OutboundOrder/Get` 的 id 觸發。 - 此資料先以 `obj2` 表示,(開發者自訂,此名稱方便下面說明) ```jsx { "result": { "orgId": "279344066834501", "outboundAllocationId": "403903722537031", "orderNo": "403903966187589", "reserveDate": "2023-04-06 17:00:00", "sign": "", "status": 5, "createDate": "2023-04-06 17:49:28", "id": "403903966220357" }, "message": "操作成功", "code": 200 } ``` 1. 託運送時、送達後,託運單若要更改託運狀態,需使用 /api/OutboundOrder/ChangeOutboundOrderStatus 變更訂單狀態。 - 需帶 token 、query (qeury 如下 Body ),以訂單抵完成,訂單狀態變 5 為例。 ```jsx var query = { id: obj2.id, status: 5, } ``` - 訂單狀態整理: | 狀態碼 | 狀態說明 | | --- | --- | | 1 | 新訂單 | | 2 | 帶執行 | | 3 | 執行中 | | 4 | 抵達 | | 5 | 成功 | | 9 | 取消 | 1. 獲得託運單中的詳細商品資訊,需使用 /api/Outbound/GetOutboundAllocationInfo 獲得託運商品詳細資訊。 - 需帶 token 、 `obj2.outboundAllocationId` - 該頁面是單一資料,但是 `outboundBos` (這一箱的運送商品) 是陣列,`outboundBos` 部分須以多筆顯示。 - `outboundBos` 底下有 `outboundProduct` (一般體系商品) 也是陣列,寫需以多筆顯示。 - 版型接近: ![](https://i.imgur.com/Awx0J0m.png) - 需顯示: | key | 對應 key 的中文名稱 | | | --- | --- | --- | | recipientName | 受贈單位 | | | | | outboundBos 底下的資料。 | | boxWeight | 運送總重 | | | costcoWeight | 好多體系重量 | | | method | 本箱出貨方式 | | | | | outboundProduct 底下的資料。 | | name | 商品名稱 | | | weight | 商品重量 | | ```jsx { "result": { "id": "404181380247623", "outboundId": "404166501101638", "recipientId": "375953659199558", "recipientName": "測試單位 T", "outboundBos": [ { "id": "404181380255814", "outboundId": "404166501101638", "outboundAllocationId": "404181380247623", "method": "冷凍", "boxWeight": 25, "costcoWeight": 12, "outboundProduct": [ { "name": "測試牛肉", "weight": 4 }, { "name": "測試豬肉", "weight": 2 }, { "name": "測試雞肉", "weight": 3 }, { "name": "測試羊肉", "weight": 4 } ] }, { "id": "404181380292678", "outboundId": "404166501101638", "outboundAllocationId": "404181380247623", "method": "常溫", "boxWeight": 9, "costcoWeight": 6, "outboundProduct": [ { "name": "測試麵包", "weight": 3 } ] }, { "id": "404181380309062", "outboundId": "404166501101638", "outboundAllocationId": "404181380247623", "method": "冷藏", "boxWeight": 8, "costcoWeight": 2, "outboundProduct": [ { "name": "測試蔬菜", "weight": 6 } ] } ], "outboundOrder": [ { "orgId": "279344066834501", "outboundAllocationId": "404181380247623", "orderNo": "404182851256389", "reserveDate": "2023-04-07 12:44:00", "sign": "", "status": 1, "createDate": "2023-04-07 12:44:15", "id": "404182851280965" } ] }, "message": "操作成功", "code": 200 } ``` ---- # 2023/04/12 補充 >這邊的教會資訊是哪邊來的 教會資訊是上面,步驟 2 ,outboundDespatchRoute (陣列) 底下的資料 recipientName 就是受贈單位,reserveDate 就是送貨時間,status 對應訂單狀態。 >訂單內頁是這樣對應嗎? - 好事多的重量是 `costcoWeight`,下圖紅圈中的 100 公斤也是 `costcoWeight` ,下圖紅圈可以不顯示避免畫面混亂。 - 好事多名稱固定是好事多,一般體系則是看商品名稱 ![](https://i.imgur.com/qUPCMXO.png) - 一般體系,指的就是 `outboundProduct` 底下的 array 資料,`name` 對應名稱, `weight` 對應重量。 - 其餘重量對應的 key 可參考下圖 ![](https://i.imgur.com/6t7Dmvn.png) - 若 outboundBos 多筆時就以多筆顯示,如下圖: ![](https://i.imgur.com/3qbqE9W.png) ### 訂單狀態 label: "新訂單", value: 0 label: "待執行", value: 1 label: "執行中", value: 2 label: "抵達", value: 3 label: "完成", value: 5 label: "取消", value: 9