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
294ee286
Commit
294ee286
authored
Jul 15, 2024
by
xiao-hesheng
Browse files
数据库验证流程十脚本编写
parent
3b1a5c7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b3流程十请领业务流_二级库向边仓_数据库验证.air/a_b3流程十请领业务流_二级库向边仓_数据库验证.py
View file @
294ee286
...
@@ -507,8 +507,8 @@ try:
...
@@ -507,8 +507,8 @@ try:
check_mcms_dept_buy_approval_after
(
int
(
i
))
check_mcms_dept_buy_approval_after
(
int
(
i
))
mcms_dept_buy_detail_approval_after
(
int
(
i
))
mcms_dept_buy_detail_approval_after
(
int
(
i
))
#
check_buyWayText()#验证出库渠道是否为边仓
check_buyWayText
()
#验证出库渠道是否为边仓
#
commonFuc().check_text_exist_result_text('succees', 'succees')
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
Exception
as
e
:
except
Exception
as
e
:
# 打印错误信息
# 打印错误信息
print
(
f
"发生错误:
{
e
}
"
)
print
(
f
"发生错误:
{
e
}
"
)
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
294ee286
...
@@ -5,6 +5,7 @@ import traceback
...
@@ -5,6 +5,7 @@ import traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public1.public1.public1
import
*
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_tools
import
get_create_time
,
check_mcms_dept_buy_car_sql
from
common.fileUtls
import
FileUtils
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.run_cmd_script
import
execute_command
...
@@ -20,792 +21,83 @@ python runner_test.py tag id2303-14 debug mdm3
...
@@ -20,792 +21,83 @@ python runner_test.py tag id2303-14 debug mdm3
"""
"""
def
SERACH_goods_id
(
GoodsId
):
def
check_mcms_dept_buy_car
(
type
=
1
):
# 在请领出库渠道边仓中搜索产品
hos_goods_id
=
'hos_goods_id'
module
=
'b5_spd3_core_business_flow'
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束\
# 获取请求头信息
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
,
"herpService_mcmsBranchGoodsInfo_page_url"
)
dept1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
# GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload53_2"
,
GoodsId
,
get_hosid
(),
get_branch_id
(),
dept1
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
branchGoodsId
=
commonFuc
().
analysis_json
(
'id'
,
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
)))
return
branchGoodsId
def
goods_move2
():
# 设置请领出库渠道为直送
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
module
=
"b2_herp3_bs"
# 设置请领出库渠道为直送
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"updateSettleType_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"
))
for
i
in
range
(
1
,
4
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
GoodsId
=
hosGoodsId
.
replace
(
get_hosid
(),
''
)
branchGoodsId
=
SERACH_goods_id
(
GoodsId
)
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload47_2"
,
branchGoodsId
,
hosGoodsId
,
get_branch_id
())
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'goods_move,result'
,
result
)
def
second_dept_Request
(
hosGoodsId
,
type
):
module
=
"b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询===========================
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
,
"herpService_buy_queryGoodsInfoPage_url"
)
print
(
'我要请领_手工请领_列表查询================='
,
url
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
# 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId
=
hosGoodsId
.
replace
(
get_hosid
(),
''
)
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload39"
,
GoodsId
,
get_hosid
(),
deptid2
,
areaCode
)
print
(
'我要请领_手工请领_列表查询'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'我要请领_手工请领_列表查询,result'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
goodsName
=
commonFuc
().
analysis_json
(
'goodsName'
,
data1
)
goodsSpec
=
commonFuc
().
analysis_json
(
'goodsSpec'
,
data1
)
mdmGoodsCode
=
commonFuc
().
analysis_json
(
'mdmGoodsCode'
,
data1
)
goodsCode
=
commonFuc
().
analysis_json
(
'goodsCode'
,
data1
)
unit
=
commonFuc
().
analysis_json
(
'unit'
,
data1
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
data1
)
goodsMfrsName
=
commonFuc
().
analysis_json
(
'goodsMfrsName'
,
data1
)
unitName
=
commonFuc
().
analysis_json
(
'unitName'
,
data1
)
price
=
commonFuc
().
analysis_json
(
'price'
,
data1
)
deptId
=
commonFuc
().
analysis_json
(
'deptId'
,
data1
)
# areaCode=commonFuc().analysis_json('areaCode',data1)
areaName
=
'默认库区'
targetDeptId
=
commonFuc
().
analysis_json
(
'targetDeptId'
,
data1
)
targetDeptName
=
commonFuc
().
analysis_json
(
'targetDeptName'
,
data1
)
targetStockId
=
commonFuc
().
analysis_json
(
'targetStockId'
,
data1
)
targetStockName
=
commonFuc
().
analysis_json
(
'targetStockName'
,
data1
)
purModeText
=
commonFuc
().
analysis_json
(
'purModeText'
,
data1
)
goodsGeneralName
=
commonFuc
().
analysis_json
(
'goodsGeneralName'
,
data1
)
provName
=
commonFuc
().
analysis_json
(
'provName'
,
data1
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
data1
)
# 信息写入文件
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
)
list_b
.
append
(
data1
)
list_c
.
append
(
data1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
FileUtils
().
w_info8
(
info
,
module
,
'二级库请领产品信息'
,
titlename
,
'message21'
)
# 我要请领_手工请领_列表查询===========================
# 添加到请领车=============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_buy_createBuyCar_url"
)
print
(
'添加到请领车================='
,
url
)
if
type
==
1
:
if
type
==
1
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload40"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
2
:
elif
type
==
2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload41"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
3
:
elif
type
==
3
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload42"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
mdmGoodsCode
,
branch_id
=
get_branch_id
()
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
# 获取每次都会变化的字段create_time的值
deptId
,
create_time
=
get_create_time
(
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s'order by create_time desc LIMIT 1;"
%
(
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
branch_id
,
hos_goods_id
))
request_body
=
get_process_list
(
request_body
)
print
(
'create_time'
,
create_time
)
print
(
'添加到请领车'
,
'request_body'
,
request_body
)
id
=
get_id
(
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
hos_goods_id
))
print
(
'添加到请领车,result'
,
result
)
print
(
'id'
,
id
)
# 添加到请领车=============================================
create_user
=
get_id
(
"select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;;"
%
(
branch_id
,
hos_goods_id
))
def
BuyCarSubmit
():
print
(
'create_time'
,
create_time
,
'id'
,
id
)
module
=
"b5_spd3_core_business_flow"
sql
=
"""select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' order by create_time desc LIMIT 1;
# # 登录获取用户id等信息,使用创建的用户登录===========开始
"""
%
(
branch_id
,
hos_goods_id
)
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
actual_value1
=
check_mcms_dept_buy_car_sql
(
sql
)
username
=
info
[
'username1'
]
print
(
actual_value1
)
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询===========================
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
,
"herpService_buy_queryBuyCarPage_url"
)
print
(
'请领车查询================='
,
url
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload43"
,
areaCode
,
get_hosid
(),
deptid2
)
areaName
=
'默认库区'
# 读取文件中的信息
print
(
'请领车查询'
,
'request_body'
,
request_body
)
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"二级库请领产品信息"
,
'message21'
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'请领车查询,result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
list_id
=
[]
for
i
in
data
:
id
=
commonFuc
().
analysis_json
(
'id'
,
i
)
list_id
.
append
(
id
)
# 请领车查询===============================================
# 请领车提交===============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_buy_validBuyCarSubmit_url"
)
print
(
'请领车提交================='
,
url
)
billExpdtDate
=
timeUtils
().
get_time_add
(
30
,
2
)
print
(
'billExpdtDate'
,
billExpdtDate
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload44"
,
billExpdtDate
,
get_branch_id
(),
list_id
[
0
],
list_id
[
1
],
list_id
[
2
])
print
(
'请领车提交'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'请领车提交,result'
,
result
)
# 请领车提交===============================================
# 创建领车交易=================================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_buy_createBuyBill_url"
)
print
(
'创建领车交易================='
,
url
)
billExpdtDate
=
timeUtils
().
get_time_add
(
30
,
2
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload44"
,
billExpdtDate
,
get_branch_id
(),
list_id
[
0
],
list_id
[
1
],
list_id
[
2
])
print
(
'创建领车交易'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'创建领车交易,result'
,
result
)
currentTaskList
=
commonFuc
().
analysis_json
(
'currentTaskList'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
def
add_dept2
():
module
=
'b2_herp3_bs'
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# 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
()
# print( token,projectCode,uxid,corpId,info)
# c3_新增科室_特殊科室_二级库房
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"dept_insert_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
,
"payload15_2"
,
get_branch_id
(),
get_hosid
())
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
def
add_new_deptinfo
():
module
=
"b2_herp3_bs"
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# 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
()
# print( token,projectCode,uxid,corpId,info)
# b9_科室管理_科室登记_科室查询
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"deptPage_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
,
"payload13"
,
branch_id
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
if
total
==
5
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 将deptid写入文件
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
print
(
'data1'
,
data1
)
info
=
[]
for
i
in
data1
:
deptid
=
commonFuc
().
analysis_json
(
'id'
,
i
)
info
.
append
(
deptid
)
titlename
=
[
'deptid1'
,
'deptid2'
,
'deptid3'
,
'deptid4'
,
'deptid5'
]
FileUtils
().
w_info8
(
info
,
module
,
'所有科室id'
,
titlename
,
'message6'
)
info1
=
[]
for
i
in
data1
:
ename
=
commonFuc
().
analysis_json
(
'ename'
,
i
)
info1
.
append
(
ename
)
FileUtils
().
w_info8
(
info1
,
module
,
'所有科室name'
,
titlename
,
'message6'
)
def
purchase_module_process
():
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是一级库
module
=
"b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
print
(
'username,password'
,
username
,
password
)
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 采购计划列表查询暂存数据列表查询
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVoPage_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"
))
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload56"
,
get_hosid
())
print
(
'采购计划列表查询暂存数据'
,
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'采购计划列表查询暂存数据,result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
for
i
in
data
:
pid
=
commonFuc
().
analysis_json
(
'id'
,
i
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVo_url"
)
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload57"
,
pid
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'herpService_purPlan_listVo_url_result'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
result
)
id1
=
commonFuc
().
analysis_json
(
'pid'
,
data1
)
closeStatus
=
commonFuc
().
analysis_json
(
'closeStatus'
,
data1
)
id2
=
commonFuc
().
analysis_json
(
'id'
,
data1
)
inSettlement
=
1
planPkgQty
=
commonFuc
().
analysis_json
(
'planPkgQty'
,
data1
)
planPkgQty
=
int
(
float
(
planPkgQty
))
pkgDefQty
=
commonFuc
().
analysis_json
(
'pkgDefQty'
,
data1
)
pkgDefQty
=
int
(
float
(
pkgDefQty
))
provId
=
commonFuc
().
analysis_json
(
'provId'
,
data1
)
provName
=
commonFuc
().
analysis_json
(
'provName'
,
data1
)
subProvId
=
commonFuc
().
analysis_json
(
'subProvId'
,
data1
)
subProvName
=
commonFuc
().
analysis_json
(
'subProvName'
,
data1
)
hosGoodsId
=
commonFuc
().
analysis_json
(
'hosGoodsId'
,
data1
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
data1
)
version
=
commonFuc
().
analysis_json
(
'version'
,
data1
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
data1
)
purTaskId
=
commonFuc
().
analysis_json
(
'purTaskId'
,
data1
)
sourceId
=
commonFuc
().
analysis_json
(
'sourceId'
,
data1
)
codingType
=
commonFuc
().
analysis_json
(
'codingType'
,
data1
)
tempFlag
=
commonFuc
().
analysis_json
(
'tempFlag'
,
data1
)
orderNo
=
commonFuc
().
analysis_json
(
'orderNo'
,
data1
)
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"
))
# # 请求体
if
purMode
==
60
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58"
,
id1
,
closeStatus
,
id2
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
,
purMode
,
pkgDefId
,
sourceId
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号试剂'
,
titlename
,
'message12'
)
# =====================
elif
purMode
==
10
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58"
,
id1
,
closeStatus
,
id2
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
,
purMode
,
pkgDefId
,
sourceId
)
print
(
'orderNo'
,
orderNo
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号'
,
titlename
,
'message7'
)
else
:
# purMode=20
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_1"
,
id1
,
id2
,
provId
,
provName
,
subProvId
,
subProvName
,
hosGoodsId
,
sourceId
)
titlename
=
(
'orderNo1'
,
'orderNo2'
)
info
=
(
orderNo
,
orderNo
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'采购计划单号高值'
,
titlename
,
'message11'
)
print
(
'采购计划提交request_body'
,
request_body
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'采购计划提交'
,
result
)
def
order_dp
(
type
=
1
):
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"供货关系申请2"
,
'message'
)
# print(info)
username
=
info
[
'e_username'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password1"
)
# username = '001f90380'
# password='1qaz!QAZ'
print
(
'username,password'
,
username
,
password
)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
1
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# =========================查询待确认订单======================
module
=
"a6_mdm3_dp"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"purchase_page_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hos_id
=
branch_id
[
0
:
5
]
exeProvId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
if
type
==
1
:
orderNo1
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号'
,
'message7'
)[
"orderNo1"
]
print
(
orderNo1
)
elif
type
==
2
:
orderNo1
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号高值'
,
'message11'
)[
"orderNo1"
]
print
(
orderNo1
)
elif
type
==
3
:
orderNo1
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'采购计划单号试剂'
,
'message12'
)[
"orderNo1"
]
print
(
orderNo1
)
else
:
orderNo1
=
'orderNo1'
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1_1_1"
,
orderNo1
,
hos_id
,
exeProvId
)
# print('request_body',request_body)
# 发送请求
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
if
total
==
1
:
break
else
:
time
.
sleep
(
6
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data1
[
0
])
print
(
'id1'
,
id1
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
)
list_b
.
append
(
data1
)
list_c
.
append
(
data1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将配送订单信息息写入到文件中
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'配送订单信息'
,
titlename
,
'message8'
)
# 从message8文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"配送订单信息"
,
'message8'
)
# print('info', info)
list_a
=
info
[
'list_a'
]
list_a
=
','
.
join
(
map
(
str
,
list_a
))
import
json
new_request_body
=
list_a
.
replace
(
"'"
,
'"'
)
new_request_body1
=
new_request_body
.
replace
(
"None"
,
'null'
)
print
(
new_request_body1
)
list_a2
=
json
.
loads
(
new_request_body1
)
# print('list_a', list_a)
billMode
=
"billMode"
createUser
=
'createUser'
hosId
=
'hosId'
provId
=
'provId'
for
i
in
list_a2
:
billMode
=
i
[
"billMode"
]
createUser
=
i
[
"createUser"
]
hosId
=
i
[
'hosId'
]
provId
=
i
[
'provId'
]
break
# =========================查询待确认订单======================
# ==============================确认订单==================
module
=
"a6_mdm3_dp"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"ensure_url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
id1
,
uxid
)
# print('request_body',request_body)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
code
==
0
:
commonFuc
().
check_text_exist
(
code
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# ==============================确认订单==================
# ==============================配送==================
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"detail_id_url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload4"
,
id1
)
# print('request_body',request_body)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resulta3获取订单详细信息中的子表id_3_0医院'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
commonFuc
().
check_text_exist
(
code
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
id2
=
commonFuc
().
analysis_json
(
'id'
,
data1
[
0
])
print
(
id1
,
id2
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
)
list_b
.
append
(
data1
)
list_c
.
append
(
data1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将配送订单信息息写入到文件中
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'配送订单详细信息'
,
titlename
,
'message9'
)
# ==================a3获取订单详细信息中的子表id_3_0医院
# ==================订单配送========================
module
=
"a6_mdm3_dp"
# a1订单配送列表数据查询_全部
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"submit_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
# 从message9文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"配送订单详细信息"
,
'message9'
)
print
(
'info从message9文件中获取信息'
,
info
)
list_a
=
info
[
'list_a'
]
list_a
=
info
[
'list_a'
]
hosGoodsId
=
'hosGoodsId'
mdm_goods_code
=
commonFuc
().
analysis_json
(
'mdmGoodsCode'
,
list_a
)
mdmGoodsCode
=
'mdmGoodsCode'
pur_mode
=
commonFuc
().
analysis_json
(
'purMode'
,
list_a
)
goodsCode
=
'goodsCode'
goodsCode
=
commonFuc
().
analysis_json
(
'goodsCode'
,
list_a
)
pkgDefId
=
'pkgDefId'
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
list_a
)
erpCode
=
'erpCode'
pkgDefName
=
commonFuc
().
analysis_json
(
'pkgDefName'
,
list_a
)
for
i
in
list_a
:
last_modified_user
=
create_user
print
(
'aaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
i
)
last_modified
=
create_time
for
j
in
i
:
# print('actual_value1',actual_value1)
print
(
'bbbbbbbbbbbbbbbbbbb'
,
j
)
actual_value2
=
get_process_list2
(
actual_value1
)
hosGoodsId
=
j
[
'hosGoodsId'
]
# print('actual_value2')
mdmGoodsCode
=
j
[
'mdmGoodsCode'
]
# print( actual_value2)
goodsCode
=
j
[
'goodsCode'
]
# prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
pkgDefId
=
j
[
'pkgDefId'
]
expected_value2
=
'expected_value2'
erpCode
=
j
[
'erpCode'
]
if
type
==
1
or
type
==
3
:
break
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
# # #获取日期
'check_mcms_dept_buy_car_low_value'
,
id
,
get_hosid
(),
branch_id
,
productDate
=
timeUtils
().
get_time_hms
(
5
)
deptid2
,
expdtDate
=
timeUtils
().
get_time_add
(
190
,
2
)
deptname2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
if
type
==
1
:
goodsCode
,
pur_mode
,
pkgDefId
,
pkgDefName
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload9_2_1_1_1"
,
id1
,
id1
,
hosId
,
provId
,
billMode
,
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
createUser
,
username
,
createUser
,
id2
,
hosGoodsId
,
mdmGoodsCode
,
goodsCode
,
pkgDefId
,
productDate
,
expdtDate
,
erpCode
,
id2
)
elif
type
==
2
:
elif
type
==
2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload9_2_1_2_1"
,
id1
,
id1
,
hosId
,
provId
,
billMode
,
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
createUser
,
username
,
createUser
,
id2
,
hosGoodsId
,
mdmGoodsCode
,
'check_mcms_dept_buy_car_high_value'
,
id
,
get_hosid
(),
goodsCode
,
productDate
,
expdtDate
,
erpCode
,
id2
)
branch_id
,
elif
type
==
3
:
deptid2
,
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload9_2_1_3_1"
,
id1
,
id1
,
hosId
,
provId
,
billMode
,
deptname2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
createUser
,
username
,
createUser
,
id2
,
hosGoodsId
,
mdmGoodsCode
,
goodsCode
,
pur_mode
,
goodsCode
,
pkgDefId
,
productDate
,
expdtDate
,
erpCode
,
id2
)
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# print('expected_value2', expected_value2)
print
(
'request_body'
,
request_body
)
# expected_value2=get_process_list2(expected_value2)
# 发送请求
actual_value2
=
actual_value2
.
replace
(
" "
,
""
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
expected_value2
=
expected_value2
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
print
(
'result'
,
result
)
# 断言
if
actual_value2
==
expected_value2
:
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
print
(
'ok'
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data
)
info
=
(
id1
,
id1
)
titlename
=
(
'distrBillId1'
,
'distrBillId2'
)
# 将配送订单信息息写入到文件中
if
type
==
1
:
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'低值配送单号'
,
titlename
,
'message10'
)
elif
type
==
2
:
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'高值配送单号'
,
titlename
,
'message10'
)
elif
type
==
3
:
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'试剂配送单号'
,
titlename
,
'message10'
)
if
code
==
0
:
commonFuc
().
check_text_exist
(
code
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
check_accept_order
(
type
=
1
):
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
# print(info)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
# username = '001f90380'
# password='1qaz!QAZ'
print
(
'username,password'
,
username
,
password
)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# =========================查询待验收订单======================
module
=
"b5_spd3_core_business_flow"
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_wait_page_url"
)
print
(
'url'
,
url
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hos_id
=
branch_id
[
0
:
5
]
if
type
==
1
:
sourceOrderNo
=
FileUtils
().
r_info8
(
module
,
'低值配送单号'
,
'message10'
)[
"distrBillId1"
]
elif
type
==
2
:
sourceOrderNo
=
FileUtils
().
r_info8
(
module
,
'高值配送单号'
,
'message10'
)[
"distrBillId1"
]
elif
type
==
3
:
sourceOrderNo
=
FileUtils
().
r_info8
(
module
,
'试剂配送单号'
,
'message10'
)[
"distrBillId1"
]
else
:
else
:
sourceOrderNo
=
FileUtils
().
r_info8
(
module
,
'低值配送单号'
,
'message10'
)[
"distrBillId1"
]
print
(
'error'
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload"
,
hos_id
,
branch_id
,
sourceOrderNo
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
print
(
'request_body'
,
request_body
)
# 发送请求
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
if
total
==
1
:
break
else
:
time
.
sleep
(
6
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
)
list_b
.
append
(
data1
)
list_c
.
append
(
data1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将验收单信息写入到文件中
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单信息'
,
titlename
,
'message13'
)
# 从message13文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"验收单信息"
,
'message13'
)
# print('info', info)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
sourceType
=
"sourceType"
billMode
=
'billMode'
recOrgId
=
'recOrgId'
recOrgName
=
'recOrgName'
sourceOrgId
=
'sourceOrgId'
sourceOrgName
=
'sourceOrgName'
sourceVersion
=
'sourceVersion'
tbStatus
=
'tbStatus'
for
i
in
list_a
:
print
(
'i'
,
i
)
for
j
in
i
:
sourceType
=
j
[
"sourceType"
]
billMode
=
j
[
"billMode"
]
recOrgId
=
j
[
'recOrgId'
]
recOrgName
=
j
[
'recOrgName'
]
sourceOrgId
=
j
[
'sourceOrgId'
]
sourceOrgName
=
j
[
'sourceOrgName'
]
sourceVersion
=
j
[
'sourceVersion'
]
tbStatus
=
j
[
'tbStatus'
]
break
# =========================查询待验收订单======================
# ==============================查看订单详情==================
sourceId
=
sourceOrderNo
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_wait_detail_url"
)
print
(
'url'
,
url
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1"
,
sourceId
,
sourceType
,
billMode
,
branch_id
)
# print('request_body',request_body)
# 发送请求
while
True
:
time
.
sleep
(
6
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
0
:
break
else
:
print
(
'验收单数据未同步完成,等待6秒'
)
print
(
'result'
,
result
)
# 断言
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data
)
list_b
.
append
(
data
)
list_c
.
append
(
data
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将验收单详细信息写入到文件中
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单详情信息'
,
titlename
,
'message14'
)
# 读取viewId
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"验收单详情信息"
,
'message14'
)
# print('info', info)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
viewId
=
"viewId"
settlement
=
'settlement'
recTemperature
=
'recTemperature'
recHumidity
=
'recHumidity'
hosGoodsId
=
'hosGoodsId'
distrQty
=
'distrQty'
distrPkgQty
=
'distrPkgQty'
for
i
in
list_a
:
for
j
in
i
:
viewId
=
j
[
"viewId"
]
settlement
=
j
[
"settlement"
]
recTemperature
=
j
[
'recTemperature'
]
recHumidity
=
j
[
'recHumidity'
]
hosGoodsId
=
j
[
'hosGoodsId'
]
distrQty
=
j
[
'distrQty'
]
distrPkgQty
=
j
[
'distrPkgQty'
]
break
# ==============================查看订单详情==================
# ========设置验收全部合格
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
print
(
'check_barcode_save_url'
,
url
)
sourceBillId
=
sourceId
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
sourceBillId
,
viewId
)
print
(
'设置验收全部合格request_body'
,
request_body
)
# 发送请求
time
.
sleep
(
6
)
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
print
(
code
)
if
code
==
0
and
data
==
1
:
break
else
:
print
(
'设置产品合格出现问题'
)
time
.
sleep
(
6
)
continue
# ========设置验收全部合格
# =============提交验收单========================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_submit_url"
)
deptId
=
recOrgId
deptName
=
recOrgName
provId
=
sourceOrgId
provName
=
sourceOrgName
createUser
=
uxid
sourceNo
=
sourceId
checkQty
=
distrQty
checkPkgQty
=
distrPkgQty
time
.
sleep
(
6
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
billMode
,
branch_id
,
deptId
,
deptName
,
hos_id
,
provId
,
provName
,
recOrgId
,
recOrgName
,
sourceId
,
sourceVersion
,
sourceType
,
tbStatus
,
createUser
,
sourceNo
,
viewId
,
hosGoodsId
,
viewId
,
settlement
,
checkQty
,
distrPkgQty
,
checkPkgQty
,
recTemperature
,
recHumidity
)
print
(
'request_body'
,
'提交验收单'
,
request_body
)
# 发送请求
while
True
:
time
.
sleep
(
3
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
CHECK_NO
=
commonFuc
().
analysis_json
(
'data'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
0
:
break
info
=
(
CHECK_NO
,
CHECK_NO
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单号'
,
titlename
,
'message15'
)
try
:
try
:
...
@@ -817,9 +109,20 @@ try:
...
@@ -817,9 +109,20 @@ try:
# 设置部门负责人
# 设置部门负责人
# set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid5"]) # 设置二级科室负责人
# set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid5"]) # 设置二级科室负责人
# 从下面开始,上面的暂时注释
# 从下面开始,上面的暂时注释
goods_move2
()
# 设置产品出库渠道为直送
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
for
i
in
range
(
6
):
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air'
)
from
a_b4流程十一请领业务流_二级库向直送
import
goods_move2
goods_move2
()
# 设置产品出库渠道为直送
from
a_b4流程十一请领业务流_二级库向直送
import
second_dept_Request
from
a_b4流程十一请领业务流_二级库向直送
import
BuyCarSubmit
from
a_b4流程十一请领业务流_二级库向直送
import
purchase_module_process
from
a_b4流程十一请领业务流_二级库向直送
import
order_dp
from
a_b4流程十一请领业务流_二级库向直送
import
check_accept_order
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air'
)
for
i
in
range
(
1
):
# # 低值
# # 低值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
# # 高值
# # 高值
...
...
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