コード例 #1
0
ファイル: task.py プロジェクト: Xuemeizhong/API
    def task_list(cls, data):
        '''

        :param data: 列表查询接口
        :return:
        '''
        try:
            if 'type' in data['data'].keys() and data['data']['type'] != None:

                type_data = yaml_replace_for_filter('base.yml',
                                                    dir_case='base',
                                                    filter='sys_enum')
                type_response = BaseInterService.sys_enum(type_data[0])

                if type_response.status_code == 200:

                    result_type = type_response.json()

                    for index in range(0, len(result_type['data'])):

                        if data['data']['type'] in result_type['data'][
                                index].values():

                            data['data']['type'] = result_type['data'][
                                index].get('enumValue')
                            break

            response = SendRequest(data)

            return response
        except Exception as error:
            raise
コード例 #2
0
 def get_goods_info(cls, data):
     '''新品测量-获取货品信息'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #3
0
 def get_unit_name(cls, data):
     '''新品测量-获取单位名称'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #4
0
 def get_currency(cls, data):
     '''新品测量-获取币种'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #5
0
 def get_logistics_type(cls, data):
     '''新品测量-获取物流类型'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #6
0
 def measure_new_item(cls, data):
     '''新品测量-提交'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #7
0
 def get_storage_type(cls, data):
     '''新品测量-获取存储分类'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #8
0
 def save_package_unit(cls, data):
     '''新品测量-保存包装单位'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #9
0
 def get_lot_tracking(cls, data):
     '''新品测量-获取批次跟踪属性'''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #10
0
 def arn_search_list(cls, data):
     '''
     获取ARN单中可收获登记列表
     :return:
     '''
     try:
         return SendRequest(data)
     except Exception as error:
         raise
コード例 #11
0
ファイル: arn_manager.py プロジェクト: Xuemeizhong/API
 def arn_query(cls, data):
     '''
     据ARN单号查询ARN信息
     :return:
     '''
     try:
         return SendRequest(data)
     except Exception as error:
         raise
コード例 #12
0
 def current_pro(cls,data):
     '''
     获取项目
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #13
0
ファイル: arn_manager.py プロジェクト: Xuemeizhong/API
 def arn_sattus(cls, data):
     '''
     根据ARN单号查询,ARN单可做哪些操作
     :return:
     '''
     try:
         return SendRequest(data)
     except expression as identifier:
         raise
コード例 #14
0
 def data_dict(cls,data):
     '''
     获取数据字典
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #15
0
 def home_warehouse(cls,data):
     '''
     获取仓库信息
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #16
0
 def home_site(cls,data):
     '''
     获取站点信息
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #17
0
 def sys_enum(cls,data):
     '''
     获取系统枚举
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #18
0
 def item_type(cls,data):
     '''
     获取货品类型
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #19
0
 def currency_list(cls,data):
     '''
     获取货币类型
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #20
0
 def home_menu(data):
     '''
     获取主页菜单
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #21
0
 def current_org(cls,data):
     '''
     获取委托方
     :return:
     '''
     try:
         return  SendRequest(data)
     except Exception as error:
         raise
コード例 #22
0
 def get_five_items(self, data):
     '''
     :param data:
     :return:
     获取料五项
     '''
     try:
         request = SendRequest(data=data)
         logger.info(f"接口响应返回结果:{request.json()}")
         return request
     except Exception as e:
         raise
コード例 #23
0
ファイル: task.py プロジェクト: Xuemeizhong/API
    def task_list_of_type(cls, type, list):
        '''

        :param type: 任务类型
        :param list: 列表查询接口
        :return:
        '''
        try:

            type_response = BaseInterService.sys_enum(type)
            print(type_response)
            type = type_response.json()['data']
            for index in range(0, len(type)):
                if list['data']['type'] in type[index].values():
                    list['data']['type'] = type[index].get('enumValue')

            response = SendRequest(list)

            return response
        except Exception as error:
            raise
コード例 #24
0
ファイル: login.py プロジェクト: Xuemeizhong/API
 def login_func(data):
     try:
         return SendRequest(data)
     except Exception as error:
         raise
コード例 #25
0
ファイル: arn_manager.py プロジェクト: Xuemeizhong/API
    def arn_list(cls, data):
        '''
        查询该仓库所有的ARN单
        :return:
        '''

        enum_data = yaml_replace_for_filter(test_filename='base.yml',
                                            dir_case='base')

        try:
            # 状态
            if 'status' in data['data'].keys(
            ) and data['data']['status'] != None:
                #状态接口测试返回
                result_sta = BaseInterService.sys_enum(
                    enum_data['sys_enum'][1])
                if result_sta.status_code == 200:
                    result_status = result_sta.json()
                    for index in range(0, len(result_status['data'])):
                        if str(data['data']['status']
                               ) in result_status['data'][index].values():
                            data['data']['status'] = result_status['data'][
                                index]['enumValue']
                            break

            if 'putawayStatus' in data['data'].keys(
            ) and data['data']['putawayStatus'] != None:
                #商家状态列表
                result_putaway = BaseInterService.sys_enum(
                    enum_data['sys_enum'][2])
                print(f"上架状态:{result_putaway.json()}")
                if result_putaway.status_code == 200:
                    result_putawayStatus = result_putaway.json()
                    for index in range(0, len(result_putawayStatus['data'])):
                        if data['data'][
                                'putawayStatus'] in result_putawayStatus[
                                    'data'][index].values():
                            data['data'][
                                'putawayStatus'] = result_putawayStatus[
                                    'data'][index]['enumValue']
                            break

            if 'businessOrgid' in data['data'].keys(
            ) and data['data']['businessOrgid'] != None:
                #委托方

                result_current_org = BaseInterService.current_org(
                    enum_data['current_org'][0])

                if result_current_org.status_code == 200:
                    result_org = result_current_org.json()
                    for index in range(0, len(result_org['data'])):
                        if data['data']['businessOrgid'] in result_org['data'][
                                index].values():
                            data['data']['businessOrgid'] = result_org['data'][
                                index]['id']
                            break

            if 'projectId' in data['data'].keys(
            ) and data['data']['projectId'] != None:
                #项目

                result_current_pro = BaseInterService.current_pro(
                    enum_data['current_pro'][0])

                if result_current_pro.status_code == 200:
                    result_pro = result_current_pro.json()

                    for index in range(0, len(result_pro['data'])):
                        if data['data']['projectId'] in result_pro['data'][
                                index].values():
                            data['data']['projectId'] = result_pro['data'][
                                index]['id']
                            break

            return SendRequest(data)

        except Exception as error:
            raise
コード例 #26
0
ファイル: conftest.py プロジェクト: Xuemeizhong/API
def login(request):
    return SendRequest(request.param)