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
29de8abd
Commit
29de8abd
authored
Sep 13, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
24dccb45
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_a5流程五_中心库入库结算_正结算1_提交采购计划_数据库验证.air/a_a5流程五_中心库入库结算_正结算1_提交采购计划_数据库验证.py
View file @
29de8abd
# -*- encoding=utf8 -*-
import
traceback
from
air_case.public1.public1.public1
import
updateUserLoginDefaultRange
,
get_listUserMgrRangePage
,
call_login
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
...
...
@@ -21,478 +22,55 @@ import time
module
=
"b6_spd3_core_business_flow_database_check"
def
login
():
module
=
"b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air'
)
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air'
)
from
a_a5流程五_中心库入库结算_正结算1_提交采购计划
import
goods_move3
,
get_GoodsPkgDef
,
low_vaule_purchase_plan
,
approval_center
,
hight_vaule_purchase_plan
,
reagent_purchase_plan
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
return
token
,
projectCode
,
uxid
,
corpId
,
info
# 登录获取用户id等信息,使用创建的用户登录============结束
# 采购计划_低值
def
low_vaule_purchase_plan
():
module
=
"b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_insert_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
pkgDefId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品包装信息'
,
'message6'
)[
"unitPackageid1"
]
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
deptid1
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid1"
]
hospital_name
=
commonFuc
().
get_business_data
(
module
,
'hospital_name'
)
areaCode
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"shelfCode"
]
areaName
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"areaName"
]
recUser
=
uxid
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1_1_1"
,
hosGoodsId
,
pkgDefId
,
hosId
,
branch_id
,
hospital_name
,
deptid1
,
deptid1
,
areaCode
,
areaName
,
recUser
)
print
(
'request_body'
,
request_body
)
# new_request_body = request_body.replace("'", '"')
# new_request_body = new_request_body.replace("None", 'null')
# # print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# print('request_body_json', request_body_json)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
pid
=
commonFuc
().
analysis_json
(
'data'
,
result
)
# 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVo_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload11"
,
pid
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data
[
0
])
orderNo
=
commonFuc
().
analysis_json
(
'orderNo'
,
data
[
0
])
print
(
'orderNo'
,
orderNo
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号'
,
titlename
,
'message7'
)
# =====================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_submitPurPlan_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
provId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
provName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
subProvId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
subProvName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload12_1_1"
,
pid
,
id1
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
,
pkgDefId
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultbbbbbbbbbbbbbbbbbbbb'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
approval_center
():
module
=
"b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"apprCenter_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
,
"payload50_6"
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
commonFuc
().
check_text_exist
(
0
,
result
)
taskId
=
commonFuc
().
analysis_json
(
'taskId'
,
data1
[
0
])
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"approvalBatch_url"
)
# 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload50_7"
,
taskId
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
>=
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
get_GoodsPkgDef
(
hosGoodsId
):
# 获取院区产品id==================开始
module
=
"b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录===========结束
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"mcmsBranchGoodsInfo_url"
)
print
(
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"
))
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
hos_id
=
branch_id
[
0
:
5
]
print
(
hos_id
)
# hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
GoodsId
=
hosGoodsId
.
replace
(
hos_id
,
''
)
print
(
GoodsId
)
deptid1
=
FileUtils
().
r_info8
(
module
,
'所有科室id'
,
'message6'
)[
"deptid1"
]
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload39_1_1"
,
branch_id
,
hos_id
,
GoodsId
,
deptid1
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
data
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
branchGoodsId
=
commonFuc
().
analysis_json
(
'branchGoodsId'
,
data
)
hosGoodsId
=
commonFuc
().
analysis_json
(
'hosGoodsId'
,
data
)
# 获取院区产品id ===========结束
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"branchGoodsPkgDef_url"
)
print
(
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"
))
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload42_2"
,
hos_id
,
branch_id
,
branchGoodsId
)
print
(
'request_body'
,
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
unitPackageid
=
commonFuc
().
analysis_json
(
'id'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
print
(
'unitPackageid'
,
unitPackageid
)
info
=
(
unitPackageid
,
unitPackageid
)
titlename
=
(
'unitPackageid1'
,
'unitPackageid2'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'产品包装信息'
,
titlename
,
'message6'
)
#高值采购计划
def
hight_vaule_purchase_plan
():
module
=
"b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_insert_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
pkgDefId
=
None
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
deptid1
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid1"
]
hospital_name
=
commonFuc
().
get_business_data
(
module
,
'hospital_name'
)
areaCode
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"shelfCode"
]
areaName
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"areaName"
]
recUser
=
uxid
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1_1_2"
,
hosGoodsId
,
hosId
,
branch_id
,
hospital_name
,
deptid1
,
deptid1
,
areaCode
,
areaName
,
recUser
)
print
(
'request_body'
,
request_body
)
# new_request_body = request_body.replace("'", '"')
# new_request_body = new_request_body.replace("None", 'null')
# # print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# print('request_body_json', request_body_json)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
pid
=
commonFuc
().
analysis_json
(
'data'
,
result
)
# 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVo_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload11"
,
pid
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data
[
0
])
orderNo
=
commonFuc
().
analysis_json
(
'orderNo'
,
data
[
0
])
print
(
'orderNo'
,
orderNo
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号高值'
,
titlename
,
'message11'
)
# =====================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_submitPurPlan_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
provId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
provName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
subProvId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
subProvName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload12_1_2"
,
pid
,
id1
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultbbbbbbbbbbbbbbbbbbbb'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
#试剂采购计划
def
reagent_purchase_plan
():
module
=
"b3_herp3_purchase"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取暂存的单号=======================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_insert_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
pkgDefId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品包装信息'
,
'message6'
)[
"unitPackageid1"
]
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
deptid1
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid1"
]
hospital_name
=
commonFuc
().
get_business_data
(
module
,
'hospital_name'
)
areaCode
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"shelfCode"
]
areaName
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"areaName"
]
recUser
=
uxid
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1_1_3"
,
hosGoodsId
,
pkgDefId
,
hosId
,
branch_id
,
hospital_name
,
deptid1
,
deptid1
,
areaCode
,
areaName
,
recUser
)
print
(
'request_body'
,
request_body
)
# new_request_body = request_body.replace("'", '"')
# new_request_body = new_request_body.replace("None", 'null')
# # print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# print('request_body_json', request_body_json)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
pid
=
commonFuc
().
analysis_json
(
'data'
,
result
)
# 采购计划号
# 获取暂存的单号==========================================================
# 获取采购计划详情中的id
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVo_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload11"
,
pid
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data
[
0
])
orderNo
=
commonFuc
().
analysis_json
(
'orderNo'
,
data
[
0
])
print
(
'orderNo'
,
orderNo
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号试剂'
,
titlename
,
'message12'
)
# =====================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_submitPurPlan_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
provId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
provName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
subProvId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
subProvName
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload12_1_3"
,
pid
,
id1
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
,
pkgDefId
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultbbbbbbbbbbbbbbbbbbbb'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
main
():
token
,
projectCode1
,
uxid1
,
corpId1
,
info1
=
call_login
(
2
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是1级库
try
:
goods_move3
(
token
)
# 获取低值的hosGoodsId
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
get_GoodsPkgDef
(
hosGoodsId
,
token
)
# 获取单元包id
except
:
print
(
'流程五获取hosGoodsId出现错误,请检查脚本或者数据'
)
try
:
low_vaule_purchase_plan
()
low_vaule_purchase_plan
(
token
,
uxid1
)
except
Exception
as
e
:
print
(
'低值采购计划提交出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
traceback
.
print_exc
()
#审批
try
:
approval_center
()
approval_center
(
token
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
hight_vaule_purchase_plan
()
hight_vaule_purchase_plan
(
token
,
uxid1
)
except
Exception
as
e
:
print
(
'高值采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
approval_center
(
token
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
reagent_purchase_plan
()
reagent_purchase_plan
(
token
,
uxid1
)
except
Exception
as
e
:
print
(
'试剂采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
approval_center
(
token
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
main
()
\ No newline at end of file
air_case/b6_spd3_core_business_flow_database_check/a_b1流程八_高值跟台业务流程_数据库验证.air/a_b1流程八_高值跟台业务流程_数据库验证.py
View file @
29de8abd
...
...
@@ -616,8 +616,8 @@ def check_hdi_distr_detail(distr_main_key, type):
operationNoticeBillId
=
source_id
operationNoticeBillDetailId
=
source_detail_id
operationApplyBillDetailId
=
get_id
(
"select id from spd3_herp_test2.mcms_operation_apply where
branch
_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
branch
_id
)
operationApplyBillDetailId
=
operationApplyBillDetailId
.
replace
(
"O"
,
""
)
"select id from spd3_herp_test2.mcms_operation_apply
_list
where
hos_goods
_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
hos_goods
_id
)
#
operationApplyBillDetailId = operationApplyBillDetailId.replace("O", "")
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'hdi_distr_detail_0911'
,
distr_detail_main_key
,
distr_main_key
,
source_id
,
source_detail_id
,
pur_detail_id
...
...
@@ -2244,49 +2244,49 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟
from
a_b1流程八_高值跟台业务流程
import
dept2_set
,
operationApply
,
second_dept_in_warehouse
,
out_return_gt
try
:
#
dept2_set()
# # # #
#
设置默认科室,切换到二级科室,使用科室管理功能
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
#
herpService_mcmsDeptGoodsInfo_getByProvIdPage()
#
time.sleep(6)
#
operationApply() # 手术跟台申请单提交
#
time.sleep(6)
#
check_mcms_operation_apply()# 手术跟台申请单数据库检查
#
approval_center() # 二级科室审批审批手术跟台申请单
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
#
approval_center1() # 中心库再次审批手术跟台申请单
#
time.sleep(6)
#
check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查
#
#
#内网查询手术通知单号
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
#
time.sleep(6)
#
check_mcms_operation_notice()# 手术通知单数据库检查
#
time.sleep(6)
#
orderno = Search_OrderNO() # 手术通知单接口查询单号
#
height_value_order_dp(orderno) # 高值跟台外网配送
#
time.sleep(6)
#
check_hdi_distr() # 外网配送单数据库检查
#
time.sleep(6)
#
check_accept_order() # 内网验收
#
time.sleep(6)
#
check_mcms_check(2)#高值跟台验收检查验收表数据
#
#这里验收后会自动生成出入库单,批次信息,需要同步验证入库单和批次信息
#
check_mcms_psi(2) # 调用函数检查中心库入库单和出库单数据库写值
#
#
检查批次信息
#
check_mcms_hos_batch(2)
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
#
second_dept_in_warehouse() # 二级科室入库
#
time.sleep(6)
#
check_mcms_psi_dept_in() # 检查二级库入库单数据库表数据
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
#
out_return_gt() # 跟台退货出库_中心库处理
#
time.sleep(6)
#
#这里的业务会产生二级库消耗出库和消耗退货入库单据,和二级库出库数据
#
check_mcms_psi_dept_XH_CK()
#
time.sleep(6)
#
check_mcms_psi_dept_out()# 检查二级库退库出库单数据库表数据
#
#
检查中心库出库单
#
time.sleep(2)
dept2_set
()
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
time
.
sleep
(
6
)
operationApply
()
# 手术跟台申请单提交
time
.
sleep
(
6
)
check_mcms_operation_apply
()
# 手术跟台申请单数据库检查
approval_center
()
# 二级科室审批审批手术跟台申请单
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
approval_center1
()
# 中心库再次审批手术跟台申请单
time
.
sleep
(
6
)
check_mcms_operation_apply_approval_after
()
# 手术跟台申请单审批后的数据库检查
# #内网查询手术通知单号
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
time
.
sleep
(
6
)
check_mcms_operation_notice
()
# 手术通知单数据库检查
time
.
sleep
(
6
)
orderno
=
Search_OrderNO
()
# 手术通知单接口查询单号
height_value_order_dp
(
orderno
)
# 高值跟台外网配送
time
.
sleep
(
6
)
check_hdi_distr
()
# 外网配送单数据库检查
time
.
sleep
(
6
)
check_accept_order
()
# 内网验收
time
.
sleep
(
6
)
check_mcms_check
(
2
)
#高值跟台验收检查验收表数据
#这里验收后会自动生成出入库单,批次信息,需要同步验证入库单和批次信息
check_mcms_psi
(
2
)
# 调用函数检查中心库入库单和出库单数据库写值
# 检查批次信息
check_mcms_hos_batch
(
2
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
second_dept_in_warehouse
()
# 二级科室入库
time
.
sleep
(
6
)
check_mcms_psi_dept_in
()
# 检查二级库入库单数据库表数据
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
out_return_gt
()
# 跟台退货出库_中心库处理
time
.
sleep
(
6
)
#这里的业务会产生二级库消耗出库和消耗退货入库单据,和二级库出库数据
check_mcms_psi_dept_XH_CK
()
time
.
sleep
(
6
)
check_mcms_psi_dept_out
()
# 检查二级库退库出库单数据库表数据
# 检查中心库出库单
time
.
sleep
(
2
)
check_mcms_psi_out
()
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
Exception
as
e
:
...
...
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