业务逻辑

具体实现

代码逻辑

# 获取参数
def get_data(host, file_name):
    tru_file(file_name)
    data = {}
    factoryTypes = get_factoryType()
    cutType = get_cutType()
    data["cutType"] = cutType
    for factotyType in factoryTypes:
        data["factoryType"] = factotyType
        ProductGroups = get_ProductGroup(host, factotyType)
        stepGroups = get_StepGroup(host, factotyType)
        for ProductGroup in ProductGroups:
            data["productGroup"] = ProductGroup
            productIDS = get_ProductID(host, factotyType, ProductGroup)
            for productID in productIDS:
                data["productId"] = productID
                for stepGroup in stepGroups:
                    data["stepGroup"] = stepGroup

                    stepIds = get_StepId(host, factotyType, productID, stepGroup)
                    for stepID in stepIds:
                        data["stepId"] = stepID

                        ItemTypes = get_ItemType(host, factotyType, stepID)
                        for ItemType in ItemTypes:
                            data["itemType"] = ItemType
                            items = get_Item(host, factotyType, stepID, ItemType)
                            for item in items:
                                data["item"] = item["key"]

                                param = get_param(data)
                                with open(file_name, "a", encoding="utf-8") as f:
                                    f.write(str(param) + "\n")

问题


↙↙↙阅读原文可查看相关链接,并与作者交流