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hIiwiY29tcGFueUlkIjozNjYsIm5pY2tuYW1lIjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.3VNOCzT9Pu_RGsCICXEsMuM_mFRETunNtoSB_TPDshE
\ No newline at end of file
... ...
vix0qbuznyj
\ No newline at end of file
zbsys7ypbqn
\ No newline at end of file
... ...
5ed9dcf3d3d3dd8712866e81ddeaa03db27321bc0aa1d1345e07fe6cc60850447889694b
\ No newline at end of file
dd1ea685842935996b653a7535369e29b68d929fa63dad46d1c0bee989c568eba721eb29
\ No newline at end of file
... ...
oLomjQURsdLc5GLZ65cY3GzBiKpPaDPBzc9cXQrhF/NWjMEP+t5AwqFuQMh7MopRpV7dL88+eLH9pO4UkgsDiUBbk4rIRXkZOHXelDUj0NqfHBcvB9tQDjwJHTsca90JXg7owrE69AlJzmNHpOQiBC4llbqqfj3c9S0Q4LulyxE=
\ No newline at end of file
x6Dq0DW/MXUUcihqmq0aws07k9KB5ya4TQaB3ccMhurfS1fJP56j5gBYPIWHE13mH6E4yENiCgSVGMpRVdwRtqAdlV9zoCqRG+KnpcRXw9aV9NRojZw/Jj6rOOyvy65C0uDvvUwzAudZrGiFZsbvVk7W4QNx8SiETuJU5H4bnFs=
\ No newline at end of file
... ...
3048401168629236736
\ No newline at end of file
3049855903982945280
\ No newline at end of file
... ...
мֵ26
\ No newline at end of file
мֵ34
\ No newline at end of file
... ...
3276055687934208
\ No newline at end of file
3276233267976448
\ No newline at end of file
... ...
мֵ26
\ No newline at end of file
мֵ34
\ No newline at end of file
... ...
11118
\ No newline at end of file
11122
\ No newline at end of file
... ...
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5NjM2NTY4LCJleHAiOjE1OTk2NDczNjgsIm5iZiI6MTU5OTYzNjU2OCwianRpIjoiMVVrWnJLeXlmdmV1Y0twRyIsInN1YiI6MzI0ODgxNzYxMzg2MzkzNiwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1Njc2OFx1NWZkNzE0IiwicGhvbmUiOiIxOTk5MDAwMDAxNCIsInVpZCI6MzI0ODgxNzYxMzg2MzkzNiwiYWRtaW5UeXBlIjoyfQ.uFsD_IpmZkYZ7g-t5A18l4SgR-M7YnP81toDMqdbemM
\ No newline at end of file
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5NzIzMjc3LCJleHAiOjE1OTk3MzQwNzcsIm5iZiI6MTU5OTcyMzI3NywianRpIjoiUUx4dlFBWWlJUzFUNDEyUiIsInN1YiI6MzI0ODgxNzYxMzY4MTY2NCwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1OGM3OVx1NWI1MFx1NTkzNCIsInBob25lIjoiMTk5OTAwMDAwMDgiLCJ1aWQiOjMyNDg4MTc2MTM2ODE2NjQsImFkbWluVHlwZSI6Mn0.C6WiMH4f3HTpNMd90OIPwH0Xj0IO9KQTw_8fFQArMkA
\ No newline at end of file
... ...
t2YH6FmzZPZQQnCniiSFndfRQxA77Fic
\ No newline at end of file
AdPr5t7P7iGyWEkawhEHjE676QGXHFD2
\ No newline at end of file
... ...
7dugs1atnus
\ No newline at end of file
v7dgpn5mvm
\ No newline at end of file
... ...
import json
import time
# from helpfunc.db_func import *
from helpfunc.db_func import *
from helpfunc.header_func import *
from helpfunc.login_func import *
from helpfunc.m_func import *
... ...
... ... @@ -15,7 +15,7 @@ def GetConnect():
print("连接数据库失败,%s" % err)
return conn
def setup_hook_clean_db():
def setup_hook_clean_db(company_id):
"""
初始化时清理数据库中的历史数据
:return:
... ... @@ -23,33 +23,38 @@ def setup_hook_clean_db():
db = GetConnect()
cursor = db.cursor()
try:
#删除评论
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")
'''
--任务列表
DELETE from tasks t where t.company_id =366;
-- 获得素币
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 }');
--发送推送
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 }' );
--任务接收者
DELETE FROM rob_infos ri WHERE ri.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
--驳回任务
DELETE FROM reject_task_records rtr WHERE rtr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
-- --关闭任务
DELETE FROM off_task_records otr WHERE otr.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
--通知
DELETE FROM notifications n WHERE n.external_resource IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
--参与竞标
DELETE FROM bid_infos bi WHERE bi.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
--中标
DELETE FROM bidder_infos bin WHERE bin.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = 366 );
'''
db.commit()
print("delete OK")
#获得素币
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 }')''')
db.commit()
#发送推送
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 }' )''')
db.commit()
#任务接收者
cursor.execute('''DELETE FROM rob_infos ri WHERE ri.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id ={} )'''.format(company_id))
db.commit()
#驳回任务
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))
db.commit()
#关闭任务
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))
db.commit()
#通知
cursor.execute('''DELETE FROM notifications n WHERE n.external_resource IN ( SELECT ID FROM tasks T WHERE T.company_id ={} )'''.format(company_id))
db.commit()
#参与竞标
cursor.execute('''DELETE FROM bid_infos bi WHERE bi.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
db.commit()
#中标
cursor.execute('''DELETE FROM bidder_infos bin WHERE bin.task_id IN ( SELECT ID FROM tasks T WHERE T.company_id = {} )'''.format(company_id))
db.commit()
#任务列表
db.commit()
cursor.execute('''DELETE from tasks t where t.company_id ={};'''.format(company_id))
print(cursor.rowcount)
db.commit()
print("delete 成功")
except:
# 发生错误时回滚
db.rollback()
print('回滚操作')
db.close()
\ No newline at end of file
... ...
... ... @@ -7,8 +7,8 @@ teststeps:
testcase: testcases/permission/ques_pf_permission/QX001_pf_permission.yml
- name: 登录系统
# variables:
# username: ${ENV(wpftwphone)}
variables:
username: ${ENV(wpftwphone)}
testcase: testcases/common/COM002_m_login_testcases.yml
- name: 引用资源
... ...
config:
name: start_testcases
#清理数据
setup_hooks:
- ${setup_hook_clean_db(214)}
teardown_hooks:
- ${sleep(2)}
- ${setup_hook_clean_db(366)}
\ No newline at end of file
... ...
... ... @@ -6,12 +6,12 @@ testcases:
- name: start....初始化数据库
testcase: testcases/start_testcases.yml
#
#- name: member_list 成员管理搜索
# testcase: testcases/task/member/member_list_testcases.yml
#
#- name: member_set_permission 成员管理设置权限
# testcase: testcases/task/member/member_set_permission_testcases.yml
- name: member_list 成员管理搜索
testcase: testcases/task/member/member_list_testcases.yml
- name: member_set_permission 成员管理设置权限
testcase: testcases/task/member/member_set_permission_testcases.yml
- name: 测试流程
testcase: testcases/firstpage/FS008.yml
\ No newline at end of file
#- name: 测试流程
# testcase: testcases/common/COM012_loot_open_status_5_testcase.yml
\ No newline at end of file
... ...
不能预览此文件类型