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IjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.3VNOCzT9Pu_RGsCICXEsMuM_mFRETunNtoSB_TPDshE
1 -vix0qbuznyj  
  1 +zbsys7ypbqn
1 -5ed9dcf3d3d3dd8712866e81ddeaa03db27321bc0aa1d1345e07fe6cc60850447889694b  
  1 +dd1ea685842935996b653a7535369e29b68d929fa63dad46d1c0bee989c568eba721eb29
1 -oLomjQURsdLc5GLZ65cY3GzBiKpPaDPBzc9cXQrhF/NWjMEP+t5AwqFuQMh7MopRpV7dL88+eLH9pO4UkgsDiUBbk4rIRXkZOHXelDUj0NqfHBcvB9tQDjwJHTsca90JXg7owrE69AlJzmNHpOQiBC4llbqqfj3c9S0Q4LulyxE=  
  1 +x6Dq0DW/MXUUcihqmq0aws07k9KB5ya4TQaB3ccMhurfS1fJP56j5gBYPIWHE13mH6E4yENiCgSVGMpRVdwRtqAdlV9zoCqRG+KnpcRXw9aV9NRojZw/Jj6rOOyvy65C0uDvvUwzAudZrGiFZsbvVk7W4QNx8SiETuJU5H4bnFs=
1 -3048401168629236736  
  1 +3049855903982945280
1 -3276055687934208  
  1 +3276233267976448
1 -eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5NjM2NTY4LCJleHAiOjE1OTk2NDczNjgsIm5iZiI6MTU5OTYzNjU2OCwianRpIjoiMVVrWnJLeXlmdmV1Y0twRyIsInN1YiI6MzI0ODgxNzYxMzg2MzkzNiwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1Njc2OFx1NWZkNzE0IiwicGhvbmUiOiIxOTk5MDAwMDAxNCIsInVpZCI6MzI0ODgxNzYxMzg2MzkzNiwiYWRtaW5UeXBlIjoyfQ.uFsD_IpmZkYZ7g-t5A18l4SgR-M7YnP81toDMqdbemM  
  1 +eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5NzIzMjc3LCJleHAiOjE1OTk3MzQwNzcsIm5iZiI6MTU5OTcyMzI3NywianRpIjoiUUx4dlFBWWlJUzFUNDEyUiIsInN1YiI6MzI0ODgxNzYxMzY4MTY2NCwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1OGM3OVx1NWI1MFx1NTkzNCIsInBob25lIjoiMTk5OTAwMDAwMDgiLCJ1aWQiOjMyNDg4MTc2MTM2ODE2NjQsImFkbWluVHlwZSI6Mn0.C6WiMH4f3HTpNMd90OIPwH0Xj0IO9KQTw_8fFQArMkA
1 -t2YH6FmzZPZQQnCniiSFndfRQxA77Fic  
  1 +AdPr5t7P7iGyWEkawhEHjE676QGXHFD2
1 import json 1 import json
2 import time 2 import time
3 -# from helpfunc.db_func import * 3 +from helpfunc.db_func import *
4 from helpfunc.header_func import * 4 from helpfunc.header_func import *
5 from helpfunc.login_func import * 5 from helpfunc.login_func import *
6 from helpfunc.m_func import * 6 from helpfunc.m_func import *
@@ -15,7 +15,7 @@ def GetConnect(): @@ -15,7 +15,7 @@ def GetConnect():
15 print("连接数据库失败,%s" % err) 15 print("连接数据库失败,%s" % err)
16 return conn 16 return conn
17 17
18 -def setup_hook_clean_db(): 18 +def setup_hook_clean_db(company_id):
19 """ 19 """
20 初始化时清理数据库中的历史数据 20 初始化时清理数据库中的历史数据
21 :return: 21 :return:
@@ -23,33 +23,38 @@ def setup_hook_clean_db(): @@ -23,33 +23,38 @@ def setup_hook_clean_db():
23 db = GetConnect() 23 db = GetConnect()
24 cursor = db.cursor() 24 cursor = db.cursor()
25 try: 25 try:
26 - #删除评论  
27 - cursor.execute("delete d from comment d LEFT JOIN comment a on d.id=a.cid LEFT JOIN question b on a.id = b.id LEFT JOIN departments c on b.relevantDepartmentId =c.id where c.company_id =42 and c.enabled = 1")  
28 - '''  
29 - --任务列表  
30 - DELETE from tasks t where t.company_id =366;  
31 --- 获得素币  
32 -DELETE FROM su_money_transaction_records smrt  
33 -WHERE ( smrt.employee @> '{"uid":3248817613863936 }' or smrt.employee @> '{"uid":3247366011913216 }' or smrt.employee @> '{"uid":3248817613835264 }'or smrt.employee @> '{"uid":3248817613892608 }');  
34 ---发送推送  
35 -DELETE FROM sent_notifications sn  
36 -WHERE ( sn.receiver @> '{"uid":3248817613863936 }' OR sn.receiver @> '{"uid":3247366011913216 }' OR sn.receiver @> '{"uid":3248817613835264 }' OR sn.receiver @> '{"uid":3248817613892608 }' );  
37 ---任务接收者  
38 -DELETE FROM rob_infos ri WHERE ri.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
39 ---驳回任务  
40 -DELETE FROM reject_task_records rtr WHERE rtr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
41 --- --关闭任务  
42 -DELETE FROM off_task_records otr WHERE otr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
43 ---通知  
44 -DELETE FROM notifications n WHERE n.external_resource IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
45 ---参与竞标  
46 -DELETE FROM bid_infos bi WHERE bi.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
47 ---中标  
48 -DELETE FROM bidder_infos bin WHERE bin.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );  
49 - '''  
50 - db.commit()  
51 - print("delete OK") 26 + #获得素币
  27 + cursor.execute('''DELETE FROM su_money_transaction_records smrt WHERE ( smrt.employee @> '{"uid":3248817613863936 }' or smrt.employee @> '{"uid":3247366011913216 }' or smrt.employee @> '{"uid":3248817613835264 }'or smrt.employee @> '{"uid":3248817613892608 }')''')
  28 + db.commit()
  29 + #发送推送
  30 + cursor.execute('''DELETE FROM sent_notifications sn WHERE ( sn.receiver @> '{"uid":3248817613863936 }' OR sn.receiver @> '{"uid":3247366011913216 }' OR sn.receiver @> '{"uid":3248817613835264 }' OR sn.receiver @> '{"uid":3248817613892608 }' )''')
  31 + db.commit()
  32 + #任务接收者
  33 + cursor.execute('''DELETE FROM rob_infos ri WHERE ri.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id ={} )'''.format(company_id))
  34 + db.commit()
  35 + #驳回任务
  36 + cursor.execute('''DELETE FROM reject_task_records rtr WHERE rtr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
  37 + db.commit()
  38 + #关闭任务
  39 + cursor.execute('''DELETE FROM off_task_records otr WHERE otr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
  40 + db.commit()
  41 + #通知
  42 + cursor.execute('''DELETE FROM notifications n WHERE n.external_resource IN ( SELECT ID FROM tasks T WHERE T.company_id ={} )'''.format(company_id))
  43 + db.commit()
  44 + #参与竞标
  45 + cursor.execute('''DELETE FROM bid_infos bi WHERE bi.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
  46 + db.commit()
  47 + #中标
  48 + cursor.execute('''DELETE FROM bidder_infos bin WHERE bin.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
  49 + db.commit()
  50 + #任务列表
  51 + db.commit()
  52 + cursor.execute('''DELETE from tasks t where t.company_id ={};'''.format(company_id))
  53 + print(cursor.rowcount)
  54 + db.commit()
  55 + print("delete 成功")
52 except: 56 except:
53 # 发生错误时回滚 57 # 发生错误时回滚
54 db.rollback() 58 db.rollback()
  59 + print('回滚操作')
55 db.close() 60 db.close()
@@ -7,8 +7,8 @@ teststeps: @@ -7,8 +7,8 @@ teststeps:
7 testcase: testcases/permission/ques_pf_permission/QX001_pf_permission.yml 7 testcase: testcases/permission/ques_pf_permission/QX001_pf_permission.yml
8 8
9 - name: 登录系统 9 - name: 登录系统
10 -# variables:  
11 -# username: ${ENV(wpftwphone)} 10 + variables:
  11 + username: ${ENV(wpftwphone)}
12 testcase: testcases/common/COM002_m_login_testcases.yml 12 testcase: testcases/common/COM002_m_login_testcases.yml
13 13
14 - name: 引用资源 14 - name: 引用资源
1 config: 1 config:
2 name: start_testcases 2 name: start_testcases
3 #清理数据 3 #清理数据
4 - setup_hooks:  
5 - - ${setup_hook_clean_db(214)}  
6 teardown_hooks: 4 teardown_hooks:
7 - - ${sleep(2)} 5 + - ${setup_hook_clean_db(366)}
@@ -6,12 +6,12 @@ testcases: @@ -6,12 +6,12 @@ testcases:
6 6
7 - name: start....初始化数据库 7 - name: start....初始化数据库
8 testcase: testcases/start_testcases.yml 8 testcase: testcases/start_testcases.yml
  9 +#
  10 +#- name: member_list 成员管理搜索
  11 +# testcase: testcases/task/member/member_list_testcases.yml
  12 +#
  13 +#- name: member_set_permission 成员管理设置权限
  14 +# testcase: testcases/task/member/member_set_permission_testcases.yml
9 15
10 -- name: member_list 成员管理搜索  
11 - testcase: testcases/task/member/member_list_testcases.yml  
12 -  
13 -- name: member_set_permission 成员管理设置权限  
14 - testcase: testcases/task/member/member_set_permission_testcases.yml  
15 -  
16 -- name: 测试流程  
17 - testcase: testcases/firstpage/FS008.yml  
  16 +#- name: 测试流程
  17 +# testcase: testcases/common/COM012_loot_open_status_5_testcase.yml
不能预览此文件类型