Пример #1
0
def get_data(times=None):
    if times == '1':
        start = TimeFormat.get_month_ago(1)
        end = TimeFormat.get_day_end_time(-7)
    elif times == '3':
        start = TimeFormat.get_month_ago(3)
        end = TimeFormat.get_month_ago(2)
    elif times == '6':
        start = TimeFormat.get_month_ago(6)
        end = TimeFormat.get_month_ago(5)
    elif times == '7':
        start, end = TimeFormat.get_day_start_time(-6), TimeFormat.getnow()
    else:
        start, end = TimeFormat.get_day_start_time(-6), TimeFormat.getnow()
    return start, end
Пример #2
0
 def test_028_api_78dk_platform_om_trans_findTransLogList_now(self):
     """
     交易流水列表  今天
     :return:
     """
     res = json.loads(WebAction.test_api_78dk_platform_om_trans_findTransLogList(
         pagesize=10, pagecurrent=1, enddate=TimeFormat.get_now_time_13(), transstate='',
         begindate=TimeFormat.string_toTimestamp_13(TimeFormat.get_day_start_time(0)), searchwhere='', transtype=''))
     Assertion.verity(res['code'], '10000')
     Assertion.verity(res['msg'], '成功')
Пример #3
0
 def test_005_api_78dk_platform_sys_user_saveSystemUser_now_days(self):
     """
     合同列表查询(申请列表) 最近30天
     :return:
     """
     res = json.loads(
         WebAction.test_api_78dk_platform_om_contract_viewContracts(
             pagecurrent=1, orderstate='', enddate=TimeFormat.get_now_time_13(),
             begindate=TimeFormat.string_toTimestamp_13(TimeFormat.get_day_start_time(0)), pagesize=10, name=''))
     Assertion.verity(res['code'], '10000')
     Assertion.verity(res['msg'], '成功')
Пример #4
0
def special(key, value):
    """
    处理特殊规则
    :param key: 规则key值
    :param value: 修改规则值
    :return:
    """
    if key in [
            'V04_1010', 'V04_1011', 'V04_1012', 'V05_1015', 'V05_1016',
            'V05_1017'
    ]:
        # value 传入数据格式 int 如5,-7
        result = TimeFormat.get_day_start_time(FileUtils.str_to_num(value))
    elif key in ['V01_3001', 'V01_3002', 'V01_1001']:
        # value 传入数据格式 int 如5,-7 , 0.0, 0.1
        result = FileUtils.str_to_num(value)
    elif key == 'V03_1045':
        V03_1045 = [{
            "call_cnt_6m": 304,
            "peer_num": "15775800488",
            "call_cnt_1m": 6,
            "call_cnt_3m": 140,
            "call_cnt_1w": 9
        }]
        #  value 传入数据格式 phone;num
        v = re.split('[;;]', value)
        num = FileUtils.str_to_num(str(v[1]))
        tmp = {
            "call_cnt_6m": 304,
            "peer_num": v[0],
            "call_cnt_1m": num,
            "call_cnt_3m": 140,
            "call_cnt_1w": 9
        }
        V03_1045.append(tmp)
        result = V03_1045
    elif key == 'V03_1046':
        # value传入格式phone1;phone2;phone3
        v = re.split('[;;]', value)
        result = [{
            "top_item": [{
                "peer_number": v[0]
            }, {
                "peer_number": v[1]
            }, {
                "peer_number": v[2]
            }],
            "key":
            "peer_num_top3_3m"
        }, {
            "top_item": [{
                "peer_number": v[3]
            }, {
                "peer_number": v[4]
            }, {
                "peer_number": v[5]
            }],
            "key":
            "peer_num_top3_6m"
        }]
    elif key == 'V01_1010':
        # value传入格式 intV05_1015
        result = str([{
            "name": "{}".format(fake.name()),
            "phones": ["{}".format(fake.phone_number())]
        } for _ in range(int(FileUtils.str_to_num(value)))
                      ]).replace('\'', '\"')
    elif key == 'V03_1002':
        result = str(int(FileUtils.str_to_num(value)))
    else:
        result = value
    return result