def order_list(token_b): timeStamp = time.time() timeArray = time.localtime(timeStamp) queryDate = time.strftime("%Y-%m-%d", timeArray) url = MERCHANT_URL + '/order/list' data = { "listType": "EAT", "orderStoreId": "", "page": "1", "queryDate": queryDate, "rows": "40", "token": token_b, "userId": "729", "isTestUser": "******", "shopId": "10041", "storeId": "104" } data_eval = my_request(url, data) my_log.debug('B端堂食待出餐订单' + str(data_eval)) res = { "orderItemIdList": data_eval['_data']['orderDTOList'][0]['id'], "shippingType": data_eval['_data']['orderDTOList'][0]['shippingType'], "orderStoreId": data_eval['_data']['orderDTOList'][0]['orderItemDTOList'][0]['id'] } return res
def login_b(): url = MERCHANT_URL + '/user/login' data = { "deviceCode": "", "deviceType": "1", "pwd": "p6C/0G6SroCAB7GRqBG+e5f0ULmN6d+YiLVs8s6WL+QUryTEPK1kLGpyjDvsEs0Tx6eNysxtwmboYW5ValmLMeKfcmnhkwKlWbPPKiuhpIbGiU+bmWPCTFXgvO9ryuzRsVJR293k3VcB1r3uZxkgQmGk/br4vmGID9l4wuzscIs=", "ua": "", "userName": "******" } data_eval = my_request(url, data) res = data_eval['_data']['token'] return res
def login_ps(): url = AFTERSALE_URL + '/user/login' data = { "token": "", "memberId": "335", "empNo": "335", "password": "******", "shopId": "0", "warehouseId": "10056", "type": "2" } data_eval = my_request(url, data) res = data_eval['_data']['token'] return res
def get_member_code(token_c): url = EARTHAPI_URL + '/member/createexclusivecode' data = { "token": token_c, "memberId": "1145", "channel": 218, "shopId": "10041", "warehouseId": "10056", "centerShopId": "10000", "centerWarehouseId": "10034", "v": 2, "exclusiveCodeType": "797" } data_eval = my_request(url, data) res = data_eval['_data']['exclusiveCode'] return res
def quickpayinfo(token_b, memberCode): url = MERCHANT_URL + '/verification/quickpayinfo' data = { "memberCode": memberCode, "autoPass": False, "checkDeviceNo": "729", "maxInterval": 60, "token": token_b, "userId": "729", "isTestUser": "******", "shopId": "10041", "storeId": "104" } data_eval = my_request(url, data) my_log.debug('闪电付待核销订单查询' + str(data_eval)) return data_eval
def confirmMeal(token_b, res_data): url = MERCHANT_URL + '/order/confirmMeal' data = { "orderItemIdList": [res_data["orderStoreId"]], "orderStoreId": res_data["orderItemIdList"], "shippingType": res_data["shippingType"], "userName": "******", "token": token_b, "userId": "729", "isTestUser": "******", "shopId": "10041", "storeId": "104" } data_eval = my_request(url, data) my_log.debug('B端确认出餐' + str(data_eval)) return data_eval
def quickpaycheck(token_b, orderId): url = MERCHANT_URL + '/verification/quickpaycheck' data = { "checkDeviceNo": "729", "orderId": orderId, "orderStoreId": "", "memberId": "1145", "token": token_b, "userId": "729", "isTestUser": "******", "shopId": "10041", "storeId": "104" } data_eval = my_request(url, data) my_log.debug('闪电付订单核销' + str(data_eval)) return data_eval['_data']['checkResult']
def confirm(token_b, res_data): url = MERCHANT_URL + '/verification/confirm' data = { "listType": "EAT", "storeOrderIdList": [res_data["orderItemIdList"]], "orderItemIdList": [res_data["orderStoreId"]], "shippingType": res_data["shippingType"], "token": token_b, "userId": "729", "isTestUser": "******", "shopId": "10041", "storeId": "104" } data_eval = my_request(url, data) my_log.debug('B端仅供堂食核销' + str(data_eval)) res = data_eval["_data"]["orderDTOList"][0]["shipmentStatus"] return res
def login_c(): url = EARTHAPI_URL + '/member/login' data = { "token": "", "memberId": "", "channel": "218", "shopId": "10041", "warehouseId": "10056", "centerShopId": "10000", "centerWarehouseId": "10034", "v": 2, "mobile": "16966662500", "pwd": "pxxJtko/3vbooB4HLCVUnBY8UWpsAJlPEaUYGLL0sgGIytOknP63D8/JvRCvMSU7iCQQSudt46yC6WDjBg7LiHFoutczfDC0HaMjNzRAflFX5nEBCyoFfX9gJP7CM5yNarEgDhfQYL+/BmvVgKWekF4h7jwRNVVoUPwCfQlKnsw=", "deviceCode": "AlZIy7Qw-3Nq9UFWN1XZTlwaROLeiOkl1dYB9imET4Gp", "deviceType": "1" } data_eval = my_request(url, data) res = data_eval['_data']['token'] return res