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
1559472e
Commit
1559472e
authored
Jul 16, 2024
by
xiao-hesheng
Browse files
数据库验证流程十一脚本编写
parent
bd07645d
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air/a_b5流程十二请领业务流_二级库向二级库.py
View file @
1559472e
...
...
@@ -420,19 +420,21 @@ 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
)
#
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5'],
#
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5'], 2)
# 设置部门负责人
set_dept_lead_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
])
# 设置二级科室负责人
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
set_stockShelf_Linkman
()
#设置库区联系人
deptName5
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
set_stockShelf_Linkman
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
],
get_stockAreaId2_new_fromDb
(
deptName5
,
2
))
#设置库区联系人
#新建科室产品分配
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
])
#编辑产品请领目标为二级检验科002
...
...
air_case/public1/public1/public1.py
View file @
1559472e
...
...
@@ -342,10 +342,10 @@ def get_stockId(name, type=1): # 获取仓库id参数是库房名称
id3
=
i
[
'id'
]
print
(
id3
)
return
id3
def
get_stockId_fromdb
(
name
,
type
=
1
):
# 获取仓库id参数是库房名称
def
get_stockId_fromdb
(
name
):
# 获取仓库id参数是库房名称
stockId
=
process_tuple
(
get_id
(
"select id from mcms_stock_info where stock_name='%s'and branch_id='
h0347-3754
';"
%
name
))
get_id
(
"select id from mcms_stock_info where stock_name='%s'and branch_id='
%s
';"
%
(
name
,
get_branch_id
())
))
return
stockId
...
...
@@ -454,13 +454,13 @@ def set_dept_user(dept_id, deptName, type=1):
if
type
==
1
:
# 中心库房名称
branch_name
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_name"
]
stockId
=
get_stockId
(
branch_name
+
'中心库房'
)
stockId
=
get_stockId
_fromdb
(
branch_name
+
'中心库房'
)
# 二级库房名称
elif
type
==
2
:
stockId
=
get_stockId
(
deptName
+
'库房'
,
2
)
stockId
=
get_stockId
_fromdb
(
deptName
+
'库房'
)
print
(
'stockId'
,
stockId
)
elif
type
==
3
:
stockId
=
get_stockId
(
deptName
+
'库房'
,
3
)
stockId
=
get_stockId
_fromdb
(
deptName
+
'库房'
)
print
(
stockId
)
# 获取库房id==========结束============
...
...
@@ -1821,7 +1821,7 @@ def get_stockAreaId_new(dept_id, deptName, type=1):
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'库区信息'
,
titlename
,
'message22'
)
return
shelfCode
def
get_stockAreaId_new_fromDb
(
dept_id
,
deptName
,
type
=
1
):
def
get_stockAreaId_new_fromDb
(
deptName
,
type
=
1
):
module
=
"b2_herp3_bs"
stockId
=
'stockId'
# 获取库房id========= 开始====
...
...
@@ -1831,10 +1831,10 @@ def get_stockAreaId_new_fromDb(dept_id, deptName, type=1):
stockId
=
get_stockId_fromdb
(
branch_name
+
'中心库房'
)
# 二级库房名称
elif
type
==
2
:
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
,
2
)
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
)
print
(
stockId
)
elif
type
==
3
:
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
,
3
)
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
)
print
(
stockId
)
# 获取库房id==========结束============
...
...
@@ -1845,6 +1845,29 @@ def get_stockAreaId_new_fromDb(dept_id, deptName, type=1):
shelfCode
=
get_id
(
sql
)
return
shelfCode
def
get_stockAreaId2_new_fromDb
(
deptName
,
type
=
1
):
module
=
"b2_herp3_bs"
stockId
=
'stockId'
# 获取库房id========= 开始====
if
type
==
1
:
# 中心库房名称
branch_name
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_name"
]
stockId
=
get_stockId_fromdb
(
branch_name
+
'中心库房'
)
# 二级库房名称
elif
type
==
2
:
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
)
print
(
stockId
)
elif
type
==
3
:
stockId
=
get_stockId_fromdb
(
deptName
+
'库房'
)
print
(
stockId
)
# 获取库房id==========结束============
# ====获取库区id===== 开始==========
sql
=
"select stock_Id from mcms_stock_shelf where stock_Id='%s'and address='%s' order by create_time desc LIMIT 1;"
%
(
stockId
,
deptName
)
print
(
sql
)
shelfCode
=
get_id
(
sql
)
return
shelfCode
def
herpService_mcmsDeptGoodsInfo_getByProvIdPage
():
# 高值跟台获取产品信息
module
=
"b5_spd3_core_business_flow"
...
...
@@ -2401,7 +2424,7 @@ def reGetString(String, leftBinary="^", rightBinary="$"):
return
"没有匹配到内容,请检查左右边界"
def
set_stockShelf_Linkman
():
def
set_stockShelf_Linkman
(
deptId
,
stockAreaId
):
print
(
'设置库区联系人'
)
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
...
...
@@ -2413,9 +2436,22 @@ def set_stockShelf_Linkman():
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 从message22文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"库区信息"
,
'message22'
)
list_a
=
info
[
'list_a'
]
module
=
'b2_herp3_bs'
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"basic_stockShelf_page_url"
)
# # 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload62_4"
,
deptId
,
stockAreaId
)
print
(
'request_body查询库区id'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
# 断言
# info = FileUtils().r_info8('b5_spd3_core_business_flow', "库区信息", 'message22')
list_a
=
result
print
(
'list_a'
,
list_a
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
list_a
)
shelfCode
=
commonFuc
().
analysis_json
(
'shelfCode'
,
list_a
)
...
...
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