Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
1d60b6b1
Commit
1d60b6b1
authored
Jul 15, 2024
by
xiao-hesheng
Browse files
数据库验证流程十脚本编写
parent
4dc7e707
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air/a_b5流程十二请领业务流_二级库向二级库.py
View file @
1d60b6b1
...
...
@@ -419,11 +419,12 @@ def pick_execute():
# 复核===================================
def
main
():
try
:
add_dept2
()
# 新增一个二级科室
add_new_deptinfo
()
# 写入科室信息到文件中
grants_user_new
()
# 新增授权
# 同步库房信息
execute_command
(
"python runner_test.py tag id2263-221 debug sit"
)
# ================暂时注释======================
# add_dept2() # 新增一个二级科室
# add_new_deptinfo() # 写入科室信息到文件中
# grants_user_new() # 新增授权
# # 同步库房信息
# execute_command("python runner_test.py tag id2263-221 debug sit")
# 设置部门用户
set_dept_user
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
...
...
@@ -438,7 +439,7 @@ def main():
currentDeptId
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
targetDeptId
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
edit_goods_target
(
currentDeptId
,
targetDeptId
)
#================暂时注释=========================
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
5
))
# 设置登录账号默认权限是新二级库
# # # 低值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
...
...
air_case/public1/public1/public1.py
View file @
1d60b6b1
...
...
@@ -5,6 +5,7 @@ from airtest.core.helper import using
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
common.common_func
import
commonFuc
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_tools
import
get_id
,
process_tuple
from
common.fileUtls
import
FileUtils
import
json
import
time
...
...
@@ -461,7 +462,8 @@ def set_dept_user(dept_id, deptName, type=1):
# ====获取库区id===== 开始==========
stockAreaId
=
get_stockAreaId
(
dept_id
,
stockId
)
# stockAreaId = get_stockAreaId(dept_id, stockId)
stockAreaId
=
process_tuple
(
get_id
(
"select id from mcms_stock_shelf where stock_id='%s'and address='%s';"
%
(
stockId
,
deptName
)))
print
(
stockAreaId
)
# ====获取库区id===== 结束==========
# dept_query_all()
...
...
@@ -491,13 +493,14 @@ def set_dept_user(dept_id, deptName, type=1):
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"basic_stockUser_page_url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload65_3"
,
dept_id
,
stockAreaId
,
get_hosid
())
print
(
'查询库区是否已经存在人员'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'查询库区是否已经存在人员'
,
result
)
userCode
=
commonFuc
().
analysis_json
(
'userCode'
,
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
)))
# url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "basic_stockUser_page_url")
# request_body = commonFuc().get_business_data(module, "payload65_3", dept_id, stockAreaId, get_hosid())
# print('查询库区是否已经存在人员', request_body)
# result = commonFuc().http_post(url, request_body, headers)
# print('查询库区是否已经存在人员', result)
# userCode = commonFuc().analysis_json('userCode',
# commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)))
userCode
=
process_tuple
(
get_id
(
"select user_code from mcms_stock_user where user_code='%s' and dept_id='%s' and del_flag=0;"
%
(
username1
,
dept_id
)))
# print('userCode',userCode)
if
userCode
!=
username1
:
# 查询库区是否已经存在人员,不需要重复添加===============
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment