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
def get_goods_info(cls, data): '''新品测量-获取货品信息''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def get_unit_name(cls, data): '''新品测量-获取单位名称''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def get_currency(cls, data): '''新品测量-获取币种''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def get_logistics_type(cls, data): '''新品测量-获取物流类型''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def measure_new_item(cls, data): '''新品测量-提交''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def get_storage_type(cls, data): '''新品测量-获取存储分类''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def save_package_unit(cls, data): '''新品测量-保存包装单位''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def get_lot_tracking(cls, data): '''新品测量-获取批次跟踪属性''' try: request = SendRequest(data=data) logger.info(f"接口响应返回结果:{request.json()}") return request except Exception as e: raise
def arn_search_list(cls, data): ''' 获取ARN单中可收获登记列表 :return: ''' try: return SendRequest(data) except Exception as error: raise
def arn_query(cls, data): ''' 据ARN单号查询ARN信息 :return: ''' try: return SendRequest(data) except Exception as error: raise
def current_pro(cls,data): ''' 获取项目 :return: ''' try: return SendRequest(data) except Exception as error: raise
def arn_sattus(cls, data): ''' 根据ARN单号查询,ARN单可做哪些操作 :return: ''' try: return SendRequest(data) except expression as identifier: raise
def data_dict(cls,data): ''' 获取数据字典 :return: ''' try: return SendRequest(data) except Exception as error: raise
def home_warehouse(cls,data): ''' 获取仓库信息 :return: ''' try: return SendRequest(data) except Exception as error: raise
def home_site(cls,data): ''' 获取站点信息 :return: ''' try: return SendRequest(data) except Exception as error: raise
def sys_enum(cls,data): ''' 获取系统枚举 :return: ''' try: return SendRequest(data) except Exception as error: raise
def item_type(cls,data): ''' 获取货品类型 :return: ''' try: return SendRequest(data) except Exception as error: raise
def currency_list(cls,data): ''' 获取货币类型 :return: ''' try: return SendRequest(data) except Exception as error: raise
def home_menu(data): ''' 获取主页菜单 :return: ''' try: return SendRequest(data) except Exception as error: raise
def current_org(cls,data): ''' 获取委托方 :return: ''' try: return SendRequest(data) except Exception as error: raise
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
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
def login_func(data): try: return SendRequest(data) except Exception as error: raise
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
def login(request): return SendRequest(request.param)