Пример #1
0
def call_server_save_data(router, params):
    url = 'http://{ip}:{port}/{router}'.format(router=router,
                                               ip=utils.ip(),
                                               port=utils.port())
    params = {"params": params}
    try:
        resp = utils.post(url=url, params=params)
    except Exception as e:
        logging.error(repr(e))
        raise RuntimeError('保存数据到服务器未知异常')
Пример #2
0
def get_base_elements(code):
    data = {'code': code}
    url = 'http://{ip}:{port}/base-element/search'.format(ip=utils.ip(),
                                                          port=utils.port())
    params = {"id": None, "params": data}
    try:
        resp = utils.post(url=url, params=params)
        if 'error' in resp:
            raise RuntimeError('获取服务器excel配置未知异常')
        for re in resp:
            if re.get('status'):
                re['status'] = '1'
            else:
                re['status'] = '0'
        df1 = pd.DataFrame(resp)
        for df in df1:
            df1.rename(columns={df: hump2Underline(df)}, inplace=True)
        data = df1.to_dict(orient='records')
        return data
    except Exception as e:
        logging.error(repr(e))
        raise RuntimeError('获取服务器excel配置未知异常')
Пример #3
0
def save_data(data):
    url = 'http://{ip}:{port}/sup-agreement/excel/prepare'.format(ip=utils.ip(), port=utils.port())
    params = {
        "params": data
    }
    resp = utils.post(url=url, params=params)
Пример #4
0
def save_data(data):
    url = 'http://{ip}:{port}/swap-termination/excel/prepare'.format(
        ip=utils.ip(), port=utils.port())
    params = {"params": data}
    resp = utils.post(url=url, params=params)
Пример #5
0
def save_data(data):
    url = 'http://{ip}:{port}/master-product-list/excel/prepare'.format(
        ip=utils.ip(), port=utils.port())
    params = {"params": data}
    resp = utils.post(url=url, params=params)
Пример #6
0
def save_data(data):
    url = 'http://{ip}:{port}/contract-number/excel/prepare'.format(
        ip=utils.ip(), port=utils.port())
    params = {"params": data}
    resp = utils.post(url=url, params=params)
Пример #7
0
def save_data(data):
    url = 'http://{ip}:{port}/performance-guarantee/excel/prepare'.format(
        ip=utils.ip(), port=utils.port())
    params = {"params": data}
    resp = utils.post(url=url, params=params)