Arthur-Wu committed this file on 2024-11-26
This commit is contained in:
@ -110,7 +110,7 @@ class YMServiceApi(object):
|
||||
logging.info(f"---接口返回状态码为:: {response.status_code}")
|
||||
logging.info(f"---接口返回体为:: {response.json()}\n\n")
|
||||
|
||||
def update_the_store_to_which_the_shopping_cart_belongs(self, CartMac, NewStoreId):
|
||||
def update_the_store_to_which_the_shopping_cart_belongs(self, CartId, CartMac, NewStoreId):
|
||||
'''
|
||||
NewStoreInfo={
|
||||
"CartMac": "b8:2d:28:04:c7:5c",
|
||||
@ -127,18 +127,18 @@ class YMServiceApi(object):
|
||||
'''
|
||||
logging.info("========== [更新购物车 所属门店 信息] ==========")
|
||||
payload = json.dumps({
|
||||
"id": 1213,
|
||||
"id": int(CartId),
|
||||
"mac": CartMac, #
|
||||
"storeId": int(NewStoreId),
|
||||
"cartModelId": 5,
|
||||
"serialNum": "MMAT3FC10100003101023491",
|
||||
"storeCartNo": "QH97",
|
||||
"rfid": "0104e26401440143010000001",
|
||||
"serialNum": "autoTest",
|
||||
"storeCartNo": "ieemooTest_009",
|
||||
"rfid": "autoTest",
|
||||
"status": 1,
|
||||
"motherboardType": "3568",
|
||||
"activationDate": "2024-08-01"
|
||||
})
|
||||
url = self.Domain + "admin/cart/1213"
|
||||
url = self.Domain + f"admin/cart/{int(CartId)}"
|
||||
response = requests.request("PUT", url, headers=self.headerss, data=payload)
|
||||
logging.info(f"-----------接口返回状态码:{response.status_code}")
|
||||
logging.info(f"-----------接口返回数据:{response.json()}\n\n")
|
||||
@ -225,26 +225,27 @@ class YMServiceApi(object):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
'''
|
||||
1、购物车ID
|
||||
1)70:f7:54:07:a6:c0 - 1214
|
||||
1)b8:2d:28:04:c7:5c - 1213
|
||||
{'code': 2007, 'msg': '设备的mac,sn,rfid不允许重复', 'data': None}
|
||||
|
||||
亿猫超市-国秀广场-storeId: 9017,
|
||||
|
||||
武商-梦时代-storeId: 69,
|
||||
家家悦-青岛乐客-storeId: 9022,
|
||||
中百-中百测试店-storeId: 68,
|
||||
|
||||
永辉-龙湖天街-storeId: 9010,
|
||||
家家悦-青岛乐客-storeId: 9022,
|
||||
'''
|
||||
yms = YMServiceApi()
|
||||
GoodsInfo = {"GoodsInputcode": "6924743915848"}
|
||||
MarketAndStoreDetails = {"putMarketId": 50, "putStoreId": ["69"]}
|
||||
|
||||
NewStoreInfo = {
|
||||
"CartMac": "70:f7:54:07:a6:c0",
|
||||
# "CartMac": "b8:2d:28:04:c7:5c",
|
||||
"StoreId": 69,
|
||||
}
|
||||
CartId = 1214
|
||||
CartMac = "70:f7:54:07:a6:c0"
|
||||
NewStoreId = 69
|
||||
yms.update_the_store_to_which_the_shopping_cart_belongs(CartMac, NewStoreId)
|
||||
NewStoreId = 68
|
||||
resp = yms.update_the_store_to_which_the_shopping_cart_belongs(CartId, CartMac, NewStoreId)
|
||||
print(f"-----------更新购物车所属门店信息返回结果为:: \n{resp}\n\n")
|
Reference in New Issue
Block a user