1.7桌台账单同步

优质
小牛编辑
132浏览
2023-12-01

下行接口收到do-sync后(下行接口详见0.5),从业务系统中读取生成账单信息,同步到服务端。

请求参数说明

参数描述必填示例值类型最大长度
action接口参数组object
└action需要调用的接口名称do_sync_tabelbillstring
postPOST参数组object
└bill_infoobject
└└biz_id线下账单id 唯一(必须保证本门店不重复)2018101810180001number
└└state状态0:空台 1:有账单 2:封账(无法加菜) 3:J结账完成1number
└└table桌台A01string
└└opentime开台时间20190802131452number
└└pscount就餐人数5number
└└info账单描述账单描述,有结账错误时,返回错误信息string
└└viewmode是否可以清算 (设置为1则表示账单还不能结算)0number
└└bill账单明细列表list
└└└gdsid菜品编码2018101800001number
└└└name菜品名称农夫山泉string
└└└unit菜品单位string
└└└price菜品数量5.2number
└└└qty菜品单价2number
└└└amt金额10.4number
└└└value原价10.01number
└└└time加菜时间20190813094910number
└└└state菜品状态 -1:已退菜 1:已下单 2:已下厨-1number
└└viewadddish空台是否可以加菜(设置为1则表示空台不允许用户加菜)0number
└└paytime结账完成时间(结账完成时必传)20190802131452number

请求示例

{
    "action": {
        "action": "do_sync_tabelbill"
    },
    "post": {
        "bill_info": {
            "biz_id": "2018101810180001",
            "state": "1",
            "table": "A01",
            "opentime": "20190802131452",
            "paytime": "20190802131452",
            "pscount": "5",
            "info": "账单描述,有结账错误时,返回错误信息",
            "viewmode": "0",
            "viewadddish": "0",
            "bill": [
                {
                    "gdsid": "2018101800001",
                    "name": "农夫山泉",
                    "unit": "瓶",
                    "price": "5.2",
                    "qty": "2",
                    "amt": "10.4",
                    "value": "10.01",
                    "time": "20190813094910",
                    "state": "-1"
                },
                {
                    "gdsid": "2018101800002",
                    "name": "口水鸡",
                    "unit": "份",
                    "price": "100",
                    "qty": "1",
                    "amt": "100",
                    "value": "108",
                    "time": "20190813094910",
                    "state": "2"
                }
            ]
        }
    }
}

响应参数说明

参数描述必填示例值类型最大长度
status返回状态。接口成功时为1,出错为01number
info错误时会返回相应的错误信息同步成功!string
msid6786number

响应示例

{
    "status":"1",
    "info":"同步成功!",
    "server_timestamp":1531209285,
    "server_time":"2018-07-10 15:54:45",
    "server_name":"wx-task2.hz",
    "msid":"6786"
}