Commit 4940fe8a authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程五脚本提交

parent c6beb5d4
......@@ -365,12 +365,12 @@ def check_sys_user_mgr_range():
user_id=get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# 要验证的数据sql
for i in range(4):
sql1 = "select * from sys_user_mgr_range where user_id='%s' order by create_time desc LIMIT 1 OFFSET %s;" % (
sql1 = "select * from sys_user_mgr_range where user_id='%s' order by mgr_range_name desc LIMIT 1 OFFSET %s;" % (
(user_id,i))
actual = check_mcms_pur_sql(sql1)
print('actual', actual)
id = get_id(
"select id from sys_user_mgr_range where user_id='%s' order by create_time desc LIMIT 1 OFFSET %s;" % (
"select id from sys_user_mgr_range where user_id='%s' order by mgr_range_name desc LIMIT 1 OFFSET %s;" % (
user_id,i))
corp_id=hos_id
if i==0:
......@@ -438,9 +438,10 @@ def check_dept_leader():
last_modified_user=create_user
user_leader_id = get_login_user_uxid_bydb(
FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
version=get_id("select version from sys_org where id='%s';" % id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_dept_leader', id, pid, code, corp_id, branch_id,
last_update_datetime
last_update_datetime,version
, create_time, create_user, last_modified_user, last_modified,
user_leader_id)
......@@ -471,24 +472,23 @@ def check_StockArea():
actual = check_mcms_pur_sql(sql1)
print('actual', actual)
id = get_id(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;" % (branch_id))
pid = get_id("select pid from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;" % (
branch_id))
code = get_id("select code from sys_org where branch_id='%s' and id='%s';" % (branch_id, id))
corp_id = get_hosid()
last_update_datetime = get_create_time("select last_update_datetime from sys_org where id='%s';" % id)
create_time = get_create_time("select create_time from sys_org where id='%s';" % id)
last_modified = get_create_time("select last_modified from sys_org where id='%s';" % id)
username = commonFuc().get_business_data('b2_herp3_bs', "username")
create_user = get_login_user_uxid_bydb(username)
last_modified_user = create_user
user_leader_id = get_login_user_uxid_bydb(
"select id from mcms_stock_shelf order by shelf_code desc LIMIT 1 OFFSET %s;" % (i))
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
stock_id = get_stockId_fromdb(stock_name)
shelf_code = get_stockAreaId_new_fromDb(dept_name, 1)
shelf_no="自动化测试"
create_time = get_create_time("select create_time from mcms_stock_shelf where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_stock_shelf where id='%s';" % id)
# username = commonFuc().get_business_data('b2_herp3_bs', "username")
create_user = get_login_user_uxid_bydb(
FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
last_modified_user = create_user
parent_id=get_id("select parent_id from mcms_stock_shelf where id='%s';" % id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_dept_leader', id, pid, code, corp_id, branch_id,
last_update_datetime
, create_time, create_user, last_modified_user, last_modified,
user_leader_id)
'check_mcms_stock_shelf'+str(i), id, stock_id, shelf_code, shelf_no, parent_id,
create_user,create_time, last_modified, last_modified_user
)
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
......@@ -515,23 +515,23 @@ from a_a4_流程四_基础模块设置 import test1, test2, grants_user, add_Sto
try:
# # ==============删除业务数据和报表数据
# test1() # 参数2是新增院区后缀为6位数的参数1是老模式
# test2() # 科室添加产品信息(产品是从外网同步过来的)
# dept_query_all() # 科室查询,将科室id写入文件中
# time.sleep(6)
# # 检查院区数据,科室数据,库房,新增用户数据
# check_basics_set_info()
# time.sleep(3)
# # 检查mcms_dept_goods_info表数据,验证科室添加的产品信息
# check_mcms_dept_goods_info()
# grants_user() # 给用户授权
#检查授权数据
# check_sys_user_mgr_range()
# set_dept_lead1() # 设置一级科室负责人
# time.sleep(3)
# check_dept_leader()
# add_StockArea() # 添加库区
# ==============删除业务数据和报表数据
test1() # 参数2是新增院区后缀为6位数的参数1是老模式
test2() # 科室添加产品信息(产品是从外网同步过来的)
dept_query_all() # 科室查询,将科室id写入文件中
time.sleep(6)
# 检查院区数据,科室数据,库房,新增用户数据
check_basics_set_info()
time.sleep(3)
# 检查mcms_dept_goods_info表数据,验证科室添加的产品信息
check_mcms_dept_goods_info()
grants_user() # 给用户授权
# 检查授权数据
check_sys_user_mgr_range()
set_dept_lead1() # 设置一级科室负责人
time.sleep(3)
check_dept_leader()
add_StockArea() # 添加库区
time.sleep(3)
#检查库区数据
check_StockArea()
......
......@@ -507,10 +507,10 @@
"check_sys_user_mgr_range_info3": '{"id": "%s", "user_id": "%s", "corp_id": "%s", "mgr_range_id": "%s", "mgr_range_name": "%s", "default_flag": 0, "project_code": "herp", "mgr_branch_id": "%s", "mgr_branch_name": "%s", "mgr_range_kind": 0, "version": 0, "create_user": "%s", "create_time": %s, "last_modified_user": "%s", "last_modified": %s, "ext_str1": "%s", "ext_str2": None, "ext_str3": None}'
#检查部门负责人数据
"check_dept_leader": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 3, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}'
"check_dept_leader": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": %s, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}'
#检查库区数据
"check_mcms_stock_shelf0": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-02-02", "shelf_no": "%s-2-02-02", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
"check_mcms_stock_shelf1": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-02-02", "shelf_no": "%s-2-02-02", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
"check_mcms_stock_shelf2": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-02-02", "shelf_no": "%s-2-02-02", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
"check_mcms_stock_shelf3": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-02-02", "shelf_no": "%s-2-02-02", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
\ No newline at end of file
"check_mcms_stock_shelf1": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-02-01", "shelf_no": "%s-2-02-01", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
"check_mcms_stock_shelf2": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-01-02", "shelf_no": "%s-2-01-02", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 0, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
"check_mcms_stock_shelf3": '{"id": "%s", "stock_id": "%s", "shelf_code": "%s-2-01-01", "shelf_no": "%s-2-01-01", "shelf_name": None, "shelf_type": None, "stock_type": 1, "default_flag": 1, "special_flag": None, "parent_id": "%s", "linkman": None, "rec_phone": None, "level_code": None, "tb_status": 1, "shelf_kind": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "address": None}'
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment