def test_multi_split_with_warehouse():
    vip_name = "会员" + base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"{vip_name}")
    product_code = base.get_now_string()
    product_interface.new_product(product_code)
    main_sku_code = product_interface.get_sku_code(product_code)[0]
    product_interface.modify_sku_price(main_sku_code, "100")
    sku_id_list = product_interface.get_sku_id("", product_code)
    modify_info_dict = {"优先出库仓": "主仓库"}
    product_interface.multi_modify_sku_info(sku_id_list, modify_info_dict)
    sku_info = [{'商家编码': main_sku_code, '数量': '2'}]
    product_code = base.get_now_string()
    product_interface.new_product(product_code)
    test_sku_code = product_interface.get_sku_code(product_code)[0]
    product_interface.modify_sku_price(test_sku_code, "100")
    sku_id_list = product_interface.get_sku_id("", product_code)
    modify_info_dict = {"优先出库仓": "测试仓"}
    product_interface.multi_modify_sku_info(sku_id_list, modify_info_dict)
    sku_info.append({'商家编码': test_sku_code, '数量': '2'})
    print(f"商品信息是:{sku_info}")
    order_code = order_interface.new_order(vip_name, sku_info)["Code"]
    base.fuzzy_search("订单编码", order_code)
    base.wait_element_click(base.get_cell_xpath(1, "订单编码"))
    base.click_space()
    element = base.wait_element(base.get_cell_xpath(1, "订单状态"))
    text = element.text
    base.wait_element_click(base.find_xpath("拆单"))
    base.wait_element(base.find_xpath("拆单", "按仓库拆包"))
    time.sleep(1)
    base.wait_element_click(base.find_xpath("拆单", "按仓库拆包"))
    time.sleep(1)
    with base.operate_page("订单", "打印发货", "打印发货框架"):
        start = datetime.datetime.now()
        while (datetime.datetime.now() - start).seconds < 30:
            base.fuzzy_search("发货单号", order_code)
            base.scroll_to(2)
            warehouse_list = base.get_column_text("仓库")
            if len(warehouse_list) == 2:
                assert "主仓库" in warehouse_list
                assert "测试仓" in warehouse_list
                break
        base.scroll_to(0)
        base.wait_element_click(base.get_cell_xpath("主仓库", "商品信息"))
        sku_code_list = delivery_order.get_all_float_sku_info("商家编码")
        for i in sku_code_list:
            assert i == main_sku_code
        base.wait_element_click(base.get_cell_xpath("测试仓", "商品信息"))
        sku_code_list = delivery_order.get_all_float_sku_info("商家编码")
        for i in sku_code_list:
            assert i == test_sku_code
def test_multi_split_with_weight():
    vip_name = "会员" + base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"{vip_name}")
    product_code = base.get_now_string()
    product_interface.new_product(product_code)
    sku_code = product_interface.get_sku_code(product_code)[0]
    product_interface.modify_sku_price(sku_code, "100")
    sku_id_list = product_interface.get_sku_id("", product_code)
    modify_info_dict = {"重量": "1.0"}
    product_interface.multi_modify_sku_info(sku_id_list, modify_info_dict)
    sku_info = [{'商家编码': sku_code, '数量': '10'}]
    print(f"商品信息是:{sku_info}")
    order_code = order_interface.new_order(vip_name, sku_info)["Code"]
    base.fuzzy_search("订单编码", order_code)
    base.wait_element_click(base.get_cell_xpath(1, "订单编码"))
    base.click_space()
    element = base.wait_element(base.get_cell_xpath(1, "订单状态"))
    text = element.text
    base.wait_element_click(base.find_xpath("拆单"))
    base.wait_element(base.find_xpath("拆单", "按重量拆包"))
    time.sleep(1)
    base.wait_element_click(base.find_xpath("拆单", "按重量拆包"))
    time.sleep(1)
    with base.operate_page("订单", "打印发货", "打印发货框架"):
        start = datetime.datetime.now()
        while (datetime.datetime.now() - start).seconds < 30:
            base.fuzzy_search("发货单号", order_code)
            product_num_list = base.get_column_text("商品数")
            if len(product_num_list) == 4:
                assert ['1', '3', '3', '3'] == product_num_list
                break
def new_stock_in_order(warehouse_name, supplier_name, sku_info_list, memo=''):
    """
            warehouse_name:仓库名称
            supplier_name:供应商名称
            memo:备注
            sku_info_list :
            [
            {"商家编码":"测试商品1-红色 S","数量":"10"},
            {},
            ]
            return:{'ID': '7495081608949531534', 'Code': 'PUO2009010003'}
    """
    """
    sku_info_list : [
    {"SkuId":"7494440356323262567","CostPrice":811.63,"Qty":1},
    {"SkuId":"7494440356323262568","CostPrice":133.99,"Qty":1}
    ]
    返回数据:
    {"data":
        {
            "Id":"7495082491766636848",
            "Code":"SIO2009020002",
            "SourceOrderCode":null,
            "StockInType":0,
            "StockInSearchType":2,
            "StockInSearchTypeName":"无采购入库",
            "StockInTypeName":"手动新增",
            "SupplierId":"7494441869460375525",
            "SupplierName":"供应商1",
            "WarehouseId":"162573418911628622",
            "WarehouseName":"主仓库",
            "Qty":2,
            "Amount":945.62,
            "StockInUserName":null,
            "IsStockIn":false,
            "Memo":"",
            "RecordDate":"2020-09-02 13:39:24",
            "RecordUserName":"******",
            "StockInDate":null
        },
    "code":1,
    "message":null
    }
    """
    params = {
        "WarehouseId":
        get_inventory_id(warehouse_name),
        "SupplierId":
        supplier_interface.get_supplier_info(supplier_name,
                                             ["供应商ID"])["供应商ID"],
        "Memo":
        memo,
    }
    lines = []
    for i in sku_info_list:
        query_info_list = {"仓库": "主仓库", "商家编码": i["商家编码"]}
        return_info_list = ["成本单价"]
        cost_price = finance_interface.get_warehouse_cost_price_info(
            query_info_list, return_info_list)[0]["成本单价"]
        line = {
            "SkuId": product_interface.get_sku_id(i["商家编码"])[0],
            "ActualPrice": cost_price,
            "Qty": i["数量"]
        }
        lines.append(line)
    # print(lines)
    url = "http://gw.erp12345.com/api/Stocks/StockInOrder/AddStockInOrder?stock={"
    for k, v in params.items():
        url += f"'{k}':'{v}',"
    url += "'Lines':["
    for i in lines:
        url += "{"
        for k, v in i.items():
            url += f"'{k}':{v},"
        url += "},"
    url += "]}"
    headers = {'Cookie': base.cookies}
    response = requests.get(url, headers=headers)
    result = dict(response.json())
    purchase_order_info_list = {
        "ID": result["data"]["Id"],
        "Code": result["data"]["Code"],
    }
    return purchase_order_info_list
def new_purchase_order(warehouse_name,
                       supplier_name,
                       sku_info_list,
                       memo="",
                       is_cash_pay="false"):
    """
        warehouse_name:仓库名称
        supplier_name:供应商名称
        memo:备注
        is_cash_pay: 现金支付
        sku_info_list :
        [
        {"商家编码":"测试商品1-红色 S","单价":"20","数量":"10"},
        {},
        ]
        return:{'ID': '7495081608949531534', 'Code': 'PUO2009010003'}
        """
    """
    sku_info_list : [
    {"SkuId":"7495079369275081918","ActualPrice":"20","Qty":"10"},
    {"SkuId":"7495079369275081919","ActualPrice":"21","Qty":"11"},
    {"SkuId":"7495079369275081920","ActualPrice":"22","Qty":"12"},
    {"SkuId":"7495079369275081921","ActualPrice":"23","Qty":"13"},
    {"SkuId":"7495079369275081922","ActualPrice":"24","Qty":"14"},
    {"SkuId":"7495079369275081923","ActualPrice":"25","Qty":"15"},
    {"SkuId":"7495079369275081924","ActualPrice":"26","Qty":"16"}
    ]
    返回数据:
    {"data":
        {
            "Id":"7495081583011954992",
            "Code":"PUO2009010001",
            "OutCode":null,
            "SupplierId":"7494441869460375525",
            "SupplierName":"供应商1",
            "WarehouseId":"162573418911628622",
            "WarehouseName":"主仓库",
            "Qty":91,
            "Amount":2121.0,
            "PayAmount":0.0,
            "IsCashPay":false,
            "Memo":"",
            "Status":"未审核",
            "StatusType":1,
            "IsSettlement":false,
            "SettlementAmount":0.0,
            "UnSettlementAmount":0.0,
            "RecordDate":"2020-09-01 22:36:38",
            "RecordUserName":"******",
            "PushStatus":"",
            "WmsStatus":"",
            "WmsMessage":null,
            "StockInQty":0,
            "ProcurementType":null
        },
    "code":1,
    "message":null
    }
    """
    params = {
        "WarehouseId":
        inventory_interface.get_inventory_id(warehouse_name),
        "SupplierId":
        supplier_interface.get_supplier_info(supplier_name,
                                             ["供应商ID"])["供应商ID"],
        "Memo":
        memo,
        "IsCashPay":
        is_cash_pay,
    }
    lines = []
    for i in sku_info_list:
        line = {
            "SkuId": product_interface.get_sku_id(i["商家编码"])[0],
            "ActualPrice": i["单价"],
            "Qty": i["数量"]
        }
        lines.append(line)
    # print(lines)
    url = "http://gw.erp12345.com/api/Purchase/Purchase/AddPurchase?purchase={"
    for k, v in params.items():
        url += f"'{k}':'{v}',"
    url += "'Lines':["
    for i in lines:
        url += "{"
        for k, v in i.items():
            url += f"'{k}':{v},"
        url += "},"
    url += "]}"
    headers = {'Cookie': base.cookies}
    response = requests.get(url, headers=headers)
    result = dict(response.json())
    purchase_order_info_list = {
        "ID": result["data"]["Id"],
        "Code": result["data"]["Code"],
    }
    return purchase_order_info_list
Пример #5
0
def test_multi_modify_sku_info():
    sku_id_list = product_interface.get_sku_id("", "20200831095731")
    print(sku_id_list)
    modify_info_dict = {"优先出库仓": "主仓库"}
    product_interface.multi_modify_sku_info(sku_id_list, modify_info_dict)
Пример #6
0
def test_data_correctness():
    product_code = base.get_now_string()
    product_interface.new_product(product_code)
    print(f"先新建一个商品:{product_code}")
    base.wait_element(base.find_xpath_by_placeholder("货号")).send_keys(product_code)
    time.sleep(1)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "货号")
    print(f"校验货号是不是{product_code}")
    result = base.get_column_text("货号")
    for i in result:
        assert i == product_code
    sku_name_list = [
        "红色 XS",
        "红色 S",
        "红色 M",
        "红色 L",
        "红色 XL",
        "红色 2XL",
        "红色 3XL",
    ]
    print(f"通过规格名称数,和规格名称是不是在规格名称列表中验证规格名称")
    result = base.get_column_text("规格名称")
    assert len(result) == len(sku_name_list)
    for i in result:
        assert i in sku_name_list
    sku_code_list = []
    for i in sku_name_list:
        sku_code_list.append(product_code + "-" + i)
    print(f"通过商家编码数量和商家编码是否在商家编码列表中验证商家编码是否正确")
    product_interface.modify_sku_price(sku_code_list[0], "100", "200", "300", "400")
    print(f"修改标准售价为100,第二价格为200,第三价格为300,第四价格为400")
    result = base.get_column_text("商家编码")
    for i in result:
        assert i in sku_code_list
    sku_id_list = product_interface.get_sku_id("", product_code)
    modify_info_dict = {"商品简称": "简称"}
    product_interface.multi_modify_sku_info(sku_id_list, modify_info_dict)
    print(f"修改商品的简称为简称,再刷新一次简称是否能正常显示")
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "货号")
    result = base.get_column_text("商品简称")
    for i in result:
        assert i == "简称"
    sku_info_list = []
    for i in sku_code_list:
        sku_info_list.append({"商家编码": i, "单价": "20", "数量": "100"})
    purchase_order_id = purchase_interface.new_purchase_order("主仓库", "供应商1", sku_info_list)["ID"]
    purchase_interface.approve_and_stock_in_purchase_order(purchase_order_id)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "货号")
    base.scroll_to(4)
    marketability_inventory = 0
    inventory = 0
    balance = 0
    temporary_inventory = 0
    bin_inventory = 0
    purchase_num = 0
    sales_num = 0
    occupy_num = 0
    marketability_inventory += 100
    print(f"可销售库存是{marketability_inventory}")
    inventory += 100
    print(f"库存是{inventory}")
    balance += 2000
    print(f"余额是{balance}")
    temporary_inventory += 100
    print(f"暂存位库存是{temporary_inventory}")
    purchase_price = 20
    print(f"最新进价是{purchase_price}")
    cost_price = 20
    print(f"成本单价是{cost_price}")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"每个规格采购100个,单价20,验证可销库存数是100,库存数是100,余额是2000.00,暂存位库存是100,最新进价是20.00,成本单价是20.00")
    stock_in_order_id = inventory_interface.new_stock_in_order("主仓库", "供应商1", sku_info_list)["ID"]
    inventory_interface.stock_in_stock_in_order(stock_in_order_id)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory += 100
    print(f"可销售库存是{marketability_inventory}")
    inventory += 100
    print(f"库存是{inventory}")
    balance += 2000
    print(f"余额是{balance}")
    temporary_inventory += 100
    print(f"暂存位库存是{temporary_inventory}")
    purchase_price = 20
    print(f"最新进价是{purchase_price}")
    cost_price = 20
    print(f"成本单价是{cost_price}")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"每个规格入库100个,验证可销售库存是200,库存是200,余额是4000, 暂存位库存是200, 最新进价 20, 成本单价是20")
    stock_out_info = []
    for i in sku_code_list:
        stock_out_info.append({"商家编码": i, "单价": "20", "数量": "50"})
    result = inventory_interface.new_stock_out_order("主仓库", "供应商1", stock_out_info)
    stock_out_order_id = result["ID"]
    inventory_interface.stock_out_stock_out_order(stock_out_order_id)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory -= 50
    print(f"可销售库存是{marketability_inventory}")
    inventory -= 50
    print(f"库存是{inventory}")
    balance -= 1000
    print(f"余额是{balance}")
    temporary_inventory -= 50
    print(f"暂存位库存是{temporary_inventory}")
    purchase_price = 20
    print(f"最新进价是{purchase_price}")
    cost_price = 20
    print(f"成本单价是{cost_price}")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"每个规格出库50个,验证可销售库存150个,库存150个, 余额3000, 暂存位库存15, ")
    result = inventory_interface.new_refund_out_order("主仓库", "供应商1", stock_out_info)
    refund_out_order_id = result["ID"]
    inventory_interface.stock_out_stock_out_order(refund_out_order_id)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory -= 50
    print(f"可销售库存是{marketability_inventory}")
    inventory -= 50
    print(f"库存是{inventory}")
    balance -= 1000
    print(f"余额是{balance}")
    temporary_inventory -= 50
    print(f"暂存位库存是{temporary_inventory}")
    purchase_price = 20
    print(f"最新进价是{purchase_price}")
    cost_price = 20
    print(f"成本单价是{cost_price}")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"每个规格退货出库50个,验证可销售库存100个,库存100个, 余额2000, 暂存位库存100, ")
    purchase_order_id = purchase_interface.new_purchase_order("主仓库", "供应商1", stock_out_info)["ID"]
    purchase_interface.approve_purchase_order(purchase_order_id)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    purchase_num = 0
    purchase_num += 50
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"每个规格采购50个,不入库,验证可销售库存100个,库存100个, 余额2000, 暂存位库存100, 采购在途数是50")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    sku_info = []
    # 还是通过sku_inf_list生成需要的商品信息列表
    for i in sku_code_list:
        sku_info.append({"商家编码": i, "数量": "10"})
    print(f"商品信息是{sku_info}")
    order_info = order_interface.new_order(vip_name, sku_info)
    order_id = order_info["ID"]
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    result = order_interface.approve_order(order_id)
    print(f"审核订单的信息是:{result}")
    delivery_order_id = delivery_interface.get_delivery_order_info({"模糊搜索": order_code}, ["ID"])[0]["ID"]
    print(f"发货单ID是{delivery_order_id}")
    delivery_interface.send_delivery(delivery_order_id)
    print(f"订单发货出库")
    sales_num = 10
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory -= 10
    print(f"可销售库存是{marketability_inventory}")
    inventory -= 10
    print(f"库存是{inventory}")
    balance -= 200
    print(f"余额是{balance}")
    temporary_inventory -= 10
    print(f"暂存位库存是{temporary_inventory}")
    purchase_price = 20
    print(f"最新进价是{purchase_price}")
    cost_price = 20
    print(f"成本单价是{cost_price}")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"新建订单:{order_code},并发货出库,此时每个规格可销售库存减10,库存减10,余额减200,暂存位库存减10,销量加10,")
    print(f"再次新建订单,单不发货只审核,验证占用数增加10,销量增加10,其他不变")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"商品信息是{sku_info}")
    order_info = order_interface.new_order(vip_name, sku_info)
    order_id = order_info["ID"]
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    result = order_interface.approve_order(order_id)
    print(f"审核订单的信息是:{result}")
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory -= 10
    sales_num += 10
    occupy_num = 10
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"再次新建订单,不审核,验证占用数增加10,销量增加10,其他不变")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"商品信息是{sku_info}")
    order_info = order_interface.new_order(vip_name, sku_info)
    order_id = order_info["ID"]
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    marketability_inventory -= 10
    sales_num += 10
    occupy_num += 10
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"通过快速上架功能每个规格上架10个,验证库位库存是否是10,可销售库存加10,库存数加10,库存余额加200")
    print(f"先生成条码")
    sku_id_list = product_interface.get_sku_id(product_code)
    product_interface.new_create_sku_bar_code(sku_id_list)
    bin_sku_mapping = {}
    for i in sku_info:
        bin_name = setting_interface.get_random_bin("主仓库")["库位"]
        print(f"主仓库库位名称是{bin_name}")
        bin_sku_mapping[i["商家编码"]] = bin_name
        barcode = product_interface.get_sku_bar_code(i["商家编码"])[0]
        pda_interface.quick_put_away(bin_name, barcode, i["数量"])
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    bin_inventory = 10
    marketability_inventory += 10
    inventory += 10
    balance += 200
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"通过快速下架,每个规格下架5个,验证库位库存是否减5,可销售库存加减5,库存数加减5,库存余额减100")
    for i in sku_info:
        barcode = product_interface.get_sku_bar_code(i["商家编码"])[0]
        num = int(i["数量"])-5
        pda_interface.quick_sold_out(bin_sku_mapping[i["商家编码"]], barcode, num)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    bin_inventory -= 5
    marketability_inventory -= 5
    inventory -= 5
    balance -= 100
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"换成测试仓再来一次")
    print(f"测试仓每个规格采购入库100")
    purchase_order_id = purchase_interface.new_purchase_order("测试仓", "供应商1", sku_info_list)["ID"]
    purchase_interface.approve_and_stock_in_purchase_order(purchase_order_id)
    print(f"测试仓每个规格入库100")
    stock_in_order_id = inventory_interface.new_stock_in_order("测试仓", "供应商1", sku_info_list)["ID"]
    inventory_interface.stock_in_stock_in_order(stock_in_order_id)
    print(f"测试仓每个规格出库50个")
    result = inventory_interface.new_stock_out_order("测试仓", "供应商1", stock_out_info)
    stock_out_order_id = result["ID"]
    inventory_interface.stock_out_stock_out_order(stock_out_order_id)
    print(f"测试仓每个规格退货出库50个")
    result = inventory_interface.new_refund_out_order("测试仓", "供应商1", stock_out_info)
    refund_out_order_id = result["ID"]
    inventory_interface.stock_out_stock_out_order(refund_out_order_id)
    print(f"测试仓每个规格采购100个,不入库")
    purchase_order_id = purchase_interface.new_purchase_order("测试仓", "供应商1", stock_out_info)["ID"]
    purchase_interface.approve_purchase_order(purchase_order_id)
    print(f"发货出库10个")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    order_info = order_interface.new_order(vip_name, sku_info, "测试仓")
    order_id = order_info["ID"]
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    result = order_interface.approve_order(order_id)
    print(f"审核订单的信息是:{result}")
    delivery_order_id = delivery_interface.get_delivery_order_info({"模糊搜索": order_code}, ["ID"])[0]["ID"]
    print(f"发货单ID是{delivery_order_id}")
    delivery_interface.send_delivery(delivery_order_id)
    print(f"订单发货出库")
    print(f"创建并审核10个")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"商品信息是{sku_info}")
    order_info = order_interface.new_order(vip_name, sku_info, "测试仓")
    order_id = order_info["ID"]
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    result = order_interface.approve_order(order_id)
    print(f"审核订单的信息是:{result}")
    print(f"创建订单不审核")
    vip_name = base.get_now_string()
    vip_interface.new_vip(vip_name)
    print(f"商品信息是{sku_info}")
    order_info = order_interface.new_order(vip_name, sku_info, "测试仓")
    order_code = order_info["Code"]
    print(f"创建订单单号:{order_code}")
    print(f"每个规格上架10个")
    pda_interface.cookies = pda_interface.change_warehouse("测试仓")
    bin_sku_mapping = {}
    for i in sku_info:
        bin_name = setting_interface.get_random_bin("测试仓")["库位"]
        print(f"库位名称是{bin_name}")
        bin_sku_mapping[i["商家编码"]] = bin_name
        barcode = product_interface.get_sku_bar_code(i["商家编码"])[0]
        pda_interface.quick_put_away(bin_name, barcode, i["数量"])
    print(f"每个规格下架5个")
    for i in sku_info:
        barcode = product_interface.get_sku_bar_code(i["商家编码"])[0]
        num = int(i["数量"]) - 5
        pda_interface.quick_sold_out(bin_sku_mapping[i["商家编码"]], barcode, num)
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    bin_inventory *= 2
    marketability_inventory *= 2
    inventory *= 2
    balance *= 2
    temporary_inventory *= 2
    sales_num *= 2
    purchase_num *= 2
    occupy_num *= 2
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    print(f"选择主仓库搜索搜索出具数值减半")
    bin_inventory /= 2
    marketability_inventory /= 2
    inventory /= 2
    balance /= 2
    temporary_inventory /= 2
    sales_num /= 2
    purchase_num /= 2
    occupy_num /= 2
    base.wait_element_click(base.find_xpath_by_placeholder("请选择仓库"))
    base.wait_element_click(base.find_xpath("主仓库"))
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)
    base.wait_element_click(base.find_xpath_by_placeholder("请选择仓库"))
    base.wait_element_click(base.find_xpath("主仓库"))
    base.wait_element_click(base.find_xpath("测试仓"))
    base.wait_table_refresh(base.find_xpath("组合查询"), 1, "可销库存数")
    check_data(bin_inventory, marketability_inventory, inventory, balance, temporary_inventory, purchase_price,
               cost_price, purchase_num, sales_num, occupy_num)