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
6d660d4f
Commit
6d660d4f
authored
May 29, 2024
by
xiao-hesheng
Browse files
流程十一脚本编写
parent
0a3e9f95
Changes
40
Expand all
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air/a_b4流程十一请领业务流_二级库向直送.py
View file @
6d660d4f
This diff is collapsed.
Click to expand it.
air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air/a_b5流程十二请领业务流_二级库向二级库.py
0 → 100644
View file @
6d660d4f
# -*- encoding=utf8 -*-
import
json
import
traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_del_branch_info
import
delData
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.timeUtils
import
timeUtils
from
airtest.core.api
import
using
__author__
=
"xiaohesheng"
"""
case_tag:api,spd_core1,a_b4流程十一请领业务流_二级库向直送,id2302,id2302-15,sit,on
核心业务流:a_b4流程十一请领业务流_二级库向二级库
python runner_test.py tag id2302-15 debug mdm3
"""
def
SERACH_goods_id
(
GoodsId
):
# 在请领出库渠道边仓中搜索产品
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
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
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload40"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload41"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
elif
type
==
3
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload42"
,
hosGoodsId
,
goodsName
,
goodsSpec
,
mdmGoodsCode
,
goodsCode
,
unit
,
purMode
,
goodsMfrsName
,
pkgDefId
,
unitName
,
price
,
deptId
,
areaCode
,
areaName
,
targetDeptId
,
targetDeptName
,
targetStockId
,
targetStockName
,
purModeText
,
goodsGeneralName
,
provName
)
request_body
=
get_process_list
(
request_body
)
print
(
'添加到请领车'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'添加到请领车,result'
,
result
)
# 添加到请领车=============================================
def
BuyCarSubmit
():
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_queryBuyCarPage_url"
)
print
(
'请领车查询================='
,
url
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
areaCode
=
get_stockAreaId_new
(
deptid2
,
deptname2
,
2
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload43"
,
areaCode
,
get_hosid
(),
deptid2
)
print
(
'请领车查询'
,
'request_body'
,
request_body
)
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'
)
try
:
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_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
()
#设置库区联系人
#新建科室产品分配
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
])
#编辑产品请领目标为二级检验科002
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
5
))
# 设置登录账号默认权限是新二级库
# # 低值
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"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
# # 试剂
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message3'
)[
'hosGoodsId'
],
3
)
BuyCarSubmit
()
# 请领车提交
for
i
in
range
(
6
):
# 三个单据共审批6次
approval_center
()
# for i in range(3): # 三个单据共审批3次
# approval_center()
# second_dept_one_key_in()
# second_dept_one_key_in()
# second_dept_one_key_in()
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'1'
)
air_case/public1/public1/public1.py
View file @
6d660d4f
...
...
@@ -1449,7 +1449,80 @@ def get_listUserMgrRangePage(type=1): # 查询权限id
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
3
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
def
get_listUserMgrRangePage1
(
type
=
1
):
# 查询权限id
module
=
'b2_herp3_bs'
username
=
FileUtils
().
r_info8
(
module
,
'用户名信息'
,
'message3'
)[
"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
()
# 获取请求头信息
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
(
'b5_spd3_core_business_flow'
,
"platformService_listUserMgrRangePage_url"
)
request_body
=
commonFuc
().
get_business_data
(
'b5_spd3_core_business_flow'
,
"payload23"
,
uxid
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
print
(
'data1'
,
data1
)
list2
=
[]
mgrRangeName_list
=
[]
for
i
in
data1
:
mgrRangeName
=
i
[
'mgrRangeName'
]
mgrRangeName_list
.
append
(
mgrRangeName
)
print
(
'mgrRangeName_list'
,
mgrRangeName_list
)
for
i
in
mgrRangeName_list
:
print
(
i
)
if
i
==
'设备科001'
:
list2
.
append
(
i
)
for
i
in
mgrRangeName_list
:
if
i
==
'二级检验科002'
:
list2
.
append
(
i
)
else
:
continue
for
i
in
mgrRangeName_list
:
if
i
==
'三级检测组003'
:
list2
.
append
(
i
)
else
:
continue
for
i
in
mgrRangeName_list
:
if
i
==
'科室004'
:
list2
.
append
(
i
)
else
:
continue
for
i
in
mgrRangeName_list
:
if
i
==
'二级科室005'
:
list2
.
append
(
i
)
else
:
continue
print
(
'list2'
,
list2
)
if
type
==
1
:
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
0
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
elif
type
==
2
:
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
1
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
elif
type
==
3
:
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
2
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
elif
type
==
4
:
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
3
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
elif
type
==
5
:
for
i
in
data1
:
if
i
[
'mgrRangeName'
]
==
list2
[
4
]:
return
commonFuc
().
analysis_json
(
'id'
,
i
)
def
get_stockAreaId_new
(
dept_id
,
deptName
,
type
=
1
):
module
=
"b2_herp3_bs"
...
...
@@ -2654,3 +2727,70 @@ def grants_user_new():
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
dept_goods_distribute
(
detpid
):
# 科室添加产品信息(产品是从外网同步过来的)
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
()
#
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"basic_mcmsGoodsInfo_insert"
)
print
(
'basic_mcmsGoodsInfo_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"
))
list2
=
[]
i
=
1
while
True
:
if
i
==
1000
:
print
(
'6000秒过去了,产品还没过来,检查同步是否正常'
)
break
try
:
for
i
in
range
(
1
,
6
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
list2
.
append
(
hosGoodsId
)
except
:
print
(
'产品没有同步过来,等待6秒'
)
time
.
sleep
(
6
)
i
=
i
+
1
continue
else
:
break
dept2_id
=
detpid
j
=
1
for
i
in
list2
:
# 请求体
if
j
==
1
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_6_3"
,
dept2_id
,
i
,
20
)
elif
j
==
2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_6_3"
,
dept2_id
,
i
,
10
)
elif
j
==
3
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_6_3"
,
dept2_id
,
i
,
60
)
else
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload58_6_3"
,
dept2_id
,
i
,
20
)
j
=
j
+
1
request_body
=
'['
+
str
(
request_body
)
+
']'
new_request_body
=
request_body
.
replace
(
"'"
,
'"'
)
print
(
new_request_body
)
import
json
request_body_json
=
json
.
loads
(
new_request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body_json
,
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
)
if
code
==
0
and
data
==
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
data/a2_mdm3_ea/message
View file @
6d660d4f
企业信息:
e_id: CR2024052
8
0038
cname: 国药集团公司
m!4a&
e_id: CR2024052
9
0038
cname: 国药集团公司
0zl25
data/a3_mdm3_hs/message
View file @
6d660d4f
医院信息:
h_id: 湖南省人民医院
gnA7p
h_name: 湖南省人民医院
gnA7p
h_id: 湖南省人民医院
5Lx8I
h_name: 湖南省人民医院
5Lx8I
data/a5_mdm3_pdm/message2
View file @
6d660d4f
产品审核信息
:
MSPid
:
MSP24052
8
0011_1
MSPid
:
MSP24052
9
0011_1
hosId
:
h0347
hosGoodsId
:
h0347000038
2
4
provGoodsid
:
provGood-9922
0957
goodsAuditBillId
:
MSP24052
8
0011
targetId
:
MSP24052
8
0011_1
hosGoodsId
:
h03470000384
2
provGoodsid
:
provGood-9922
1005
goodsAuditBillId
:
MSP24052
9
0011
targetId
:
MSP24052
9
0011_1
data/a6_mdm3_dp/data
View file @
6d660d4f
...
...
@@ -101,6 +101,10 @@ json_headers2: {
"payload9_2_1_2": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"hosId":"%s","provId":"%s","billMode":"%s","hosVersion":3,"createUser":"%s","createUserName":"%s","lastModifiedUser":"%s","detailList":[{"sourceDetailId":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","certificateCode":"","pkgDefId":null,"provGoodsId":null,"replPkgQty":100,"settlement":1,"batchCode":"222","productDate":"%s","expdtDate":"%s","distrPkgQty":100,"disabledFlag":0,"distrQty":100,"ext":{"ygptCode":"","transCond":"","storageCond":"","erpCode":"%s"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_2_1_3": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"hosId":"%s","provId":"%s","billMode":"%s","hosVersion":3,"createUser":"%s","createUserName":"%s","lastModifiedUser":"%s","detailList":[{"sourceDetailId":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","certificateCode":"","pkgDefId":"%s","provGoodsId":null,"replPkgQty":100,"settlement":1,"batchCode":"4444","productDate":"%s","expdtDate":"%s","distrPkgQty":100,"disabledFlag":0,"distrQty":10000,"ext":{"ygptCode":"","transCond":"","storageCond":"","erpCode":"%s"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_2_1_1_1": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"hosId":"%s","provId":"%s","billMode":"%s","hosVersion":3,"createUser":"%s","createUserName":"%s","lastModifiedUser":"%s","detailList":[{"sourceDetailId":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","certificateCode":"","pkgDefId":"%s","provGoodsId":null,"replPkgQty":1,"settlement":1,"batchCode":"333","productDate":"%s","expdtDate":"%s","distrPkgQty":1,"disabledFlag":0,"distrQty":100,"ext":{"ygptCode":"","transCond":"","storageCond":"","erpCode":"%s"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_2_1_2_1": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"hosId":"%s","provId":"%s","billMode":"%s","hosVersion":3,"createUser":"%s","createUserName":"%s","lastModifiedUser":"%s","detailList":[{"sourceDetailId":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","certificateCode":"","pkgDefId":null,"provGoodsId":null,"replPkgQty":1,"settlement":1,"batchCode":"222","productDate":"%s","expdtDate":"%s","distrPkgQty":1,"disabledFlag":0,"distrQty":1,"ext":{"ygptCode":"","transCond":"","storageCond":"","erpCode":"%s"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_2_1_3_1": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"hosId":"%s","provId":"%s","billMode":"%s","hosVersion":3,"createUser":"%s","createUserName":"%s","lastModifiedUser":"%s","detailList":[{"sourceDetailId":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","certificateCode":"","pkgDefId":"%s","provGoodsId":null,"replPkgQty":1,"settlement":1,"batchCode":"4444","productDate":"%s","expdtDate":"%s","distrPkgQty":1,"disabledFlag":0,"distrQty":100,"ext":{"ygptCode":"","transCond":"","storageCond":"","erpCode":"%s"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_3": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":"%s","version":0,"billMode":"66","hosVersion":2,"createUser":"GYQX-SPD:user-19669","createUserName":"浙江高仰医疗","lastModifiedUser":"GYQX-SPD:user-19669","detailList":[{"sourceDetailId":"%s","hosGoodsId":"h0028|hosGood-880444","mdmGoodsCode":null,"goodsCode":"880444","certificateCode":"京械注准203420915218","pkgDefId":"h0028000217","provGoodsId":"provGood-1939432","replPkgQty":6,"settlement":0,"batchCode":"1","productDate":"2023-12-01","expdtDate":"2023-12-31","distrPkgQty":1,"disabledFlag":0,"distrQty":10,"ext":{"ygptCode":"","transCond":"0-15℃","storageCond":"0-30℃","erpCode":"11658060"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
"payload9_4": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"provId":"p10d95","pageType":2,"hosIdList":["h0347","h0028"],"tabIdx":"3","startDate":"","endDate":""}}
"payload9_5": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"dateValue":["",""],"provId":"p10d95","pageType":2,"hosIdList":["h0347","h0028"],"tabIdx":"1","startDate":"","endDate":""}}
...
...
data/a6_mdm3_si/message
View file @
6d660d4f
...
...
@@ -2,10 +2,10 @@
list_a:
- &id001
settleMonth: '202406'
pid: OBh03472024052
8
0004
hosGoodsId: h0347000038
21
goodsCode: '000038
21
'
goodsName: 一次性注射器_低值
$@6MA
pid: OBh03472024052
9
0004
hosGoodsId: h0347000038
39
goodsCode: '000038
39
'
goodsName: 一次性注射器_低值
uXIDv
goodsGg: G-31891
mfrsName: 德国歌德公司 Geuder AG
unit: 支
...
...
@@ -16,17 +16,17 @@
cacheleftAmount: 19999.98
purMode: 10
waitInvoicingNum: 0.0
invoicingPrice:
99.9999
invoicingPrice:
normalContractId:
normalContract: '1'
detailList:
- pid: OBh03472024052
8
0004
- pid: OBh03472024052
9
0004
settleMonth: '202406'
hosGoodsId: h0347000038
21
hosGoodsId: h0347000038
39
batchCode: '333'
distrDetailId: '038377
61
'
distrId: PSh03472024052
8
0005
distrOrderNo: PSh03472024052
8
0005
distrDetailId: '038377
79
'
distrId: PSh03472024052
9
0005
distrOrderNo: PSh03472024052
9
0005
settlePrice: 99.9999
maxSettleQty: -100.0
maxSettleAmount: -9999.99
...
...
@@ -35,11 +35,11 @@
leftSettleQty: -100.0
leftSettleAmount: -9999.99
hosId: h0347
provId: p1e25
0
branchId: h0347-363
7
balanceDetId: OBh03472024052
8
0004-000001
provId: p1e25
4
branchId: h0347-363
9
balanceDetId: OBh03472024052
9
0004-000001
purMode: 10
barCode: 01363
7
0000038
21
0103331124052
8
1724120
4
21UT24052
8
000202
barCode: 01363
9
0000038
39
0103331124052
9
1724120
5
21UT24052
9
000202
batchId:
price:
maxQty:
...
...
@@ -51,14 +51,14 @@
oneFcatName:
volumeFlag:
onlineKind:
viewId: 202406OBh03472024052
8
0004h0347000038
21
- pid: OBh03472024052
8
0004
viewId: 202406OBh03472024052
9
0004h0347000038
39
- pid: OBh03472024052
9
0004
settleMonth: '202406'
hosGoodsId: h0347000038
21
hosGoodsId: h0347000038
39
batchCode: '333'
distrDetailId: '038377
61
'
distrId: PSh03472024052
8
0005
distrOrderNo: PSh03472024052
8
0005
distrDetailId: '038377
79
'
distrId: PSh03472024052
9
0005
distrOrderNo: PSh03472024052
9
0005
settlePrice: 99.9999
maxSettleQty: 100.0
maxSettleAmount: 9999.99
...
...
@@ -67,11 +67,11 @@
leftSettleQty: 100.0
leftSettleAmount: 9999.99
hosId: h0347
provId: p1e25
0
branchId: h0347-363
7
balanceDetId: OBh03472024052
8
0004-000002
provId: p1e25
4
branchId: h0347-363
9
balanceDetId: OBh03472024052
9
0004-000002
purMode: 10
barCode: 01363
7
0000038
21
0103331124052
8
1724120
4
21UT24052
8
0002
05
barCode: 01363
9
0000038
39
0103331124052
9
1724120
5
21UT24052
9
0002
16
batchId:
price:
maxQty:
...
...
@@ -83,10 +83,10 @@
oneFcatName:
volumeFlag:
onlineKind:
viewId: 202406OBh03472024052
8
0004h0347000038
21
unique: 202406OBh03472024052
8
0004h0347000038
21
viewId: 202406OBh03472024052
9
0004h0347000038
39
unique: 202406OBh03472024052
9
0004h0347000038
39
onlineKind: '10'
viewId: 202406OBh03472024052
8
0004h0347000038
21
viewId: 202406OBh03472024052
9
0004h0347000038
39
list_b:
- *id001
list_c:
...
...
data/b2_herp3_bs/data
View file @
6d660d4f
...
...
@@ -211,8 +211,7 @@ json_headers2: {
"payload13": {"pageNum": 1,"pageSize": 50,"orderBy": "code asc","queryObject": {"ename": "","branchId": "院区id", "branchId": "%s", "hosId": "医院id", "hosId": "h0347" }}
"payload14": {"branchId":"%s","cname":"","ename":"设备科001","erpCode":"001","address":"设备科001","contactWay":"13401003250","deptKind":1,"deptCate":1,"deptLevel":"1","flag":"1","hisDeptCodes":"","deptType":"1","packetType":"0","corpId":"h0347","corpKind":1}
"payload15": {"branchId":"%s","cname":"","ename":"二级检验科002","erpCode":"002","address":"二级检验科002","contactWay":"13401003250","deptKind":7,"deptCate":1,"deptLevel":"2","flag":"1","hisDeptCodes":"","deptType":"0","packetType":"0","corpId":"h0347","corpKind":1}
"payload15_2": {"branchId":"%s","cname":"","ename":"二级科室005","erpCode":"005","address":"二级科室005","contactWay":"13401003250","deptKind":7,"deptCate":1,"deptLevel":"2","flag":"1","hisDeptCodes":"","deptType":"0","packetType":"0","corpId":"%s","corpKind":1}
"payload15_2": {"ordinal":1,"branchId":"%s","cname":"","ename":"二级科室005","erpCode":"005","address":"二级科室005","contactWay":"13401003250","deptKind":2,"deptCate":1,"deptLevel":"2","flag":"1","ext1":"","hisDeptCodes":"","deptType":"0","packetType":"0","corpId":"%s","corpKind":1}
"payload16": {"branchId":"%s","pid":"%s","cname":"","ename":"三级检测组003","erpCode":"003","address":"三级检测组003","contactWay":"12401003250","deptKind":7,"deptCate":1,"deptLevel":"3","flag":"1","hisDeptCodes":"","deptType":"0","packetType":"0","corpId":"h0347","corpKind":1}
"payload17": {"branchId":"%s","pid":"%s","cname":"","ename":"科室004","erpCode":"004","address":"三级科室004","contactWay":"三级科室004","deptKind":5,"deptCate":1,"deptLevel":"4","flag":"1","hisDeptCodes":"","deptType":"0","packetType":"0","corpId":"h0347","corpKind":1}
...
...
data/b2_herp3_bs/message
View file @
6d660d4f
院区新增:
branch_id: h0347-363
7
branch_name: 东土城路院区
Sn%cM
branch_id: h0347-363
9
branch_name: 东土城路院区
#c@$a
科室信息:
dept2_id: f
501a45fae784e2c88418821134c4f43
dept2_id: f
c8822ba29a94295a3c3d27a5affbae4
dept2_name: 二级检验科002
data/b2_herp3_bs/message3
View file @
6d660d4f
用户名信息
:
username1
:
自动化测试
a4dQM
username2
:
自动化测试
a4dQM
username1
:
自动化测试
0kQe7
username2
:
自动化测试
0kQe7
data/b2_herp3_bs/message4
View file @
6d660d4f
一级科室信息
:
dept1_id
:
92e5407265e14d48a555d92bb2f455c5
dept1_id
:
437e9b776c4e4d1aabb42b5ab8066224
dept1_name
:
设备科001
data/b2_herp3_bs/message5
View file @
6d660d4f
部门和库区信息
:
dept1_id
:
92e5407265e14d48a555d92bb2f455c5
stockAreaId
:
ed992a93989a430f91632badcce6dfab
dept1_id
:
437e9b776c4e4d1aabb42b5ab8066224
stockAreaId
:
db3baaad8fff4c2ea4194a5dc238943e
data/b2_herp3_bs/message6
View file @
6d660d4f
所有科室id
:
deptid1
:
92e5407265e14d48a555d92bb2f455c5
deptid2
:
f
501a45fae784e2c88418821134c4f43
deptid3
:
614df6f53e8740d1892b6f282a8d3f62
deptid4
:
f639916c6df24c65bdc77b58ae08a2f7
deptid5
:
e
4d8b214250d44e18633f3cea5a72422
deptid1
:
437e9b776c4e4d1aabb42b5ab8066224
deptid2
:
f
c8822ba29a94295a3c3d27a5affbae4
deptid3
:
3d52fc27d77b47dc8bea7b57cbd21bd5
deptid4
:
8ab822e5c93840c0a0549b38639efa9e
deptid5
:
e
510310e705c4a328395ae3ccf8d0cc3
所有科室name
:
deptid1
:
设备科001
deptid2
:
二级检验科002
...
...
data/b2_herp3_bs/message7
View file @
6d660d4f
shelfinfo
:
shelfid
:
ed992a93989a430f91632badcce6dfab
shelfCode
:
areah034721
05
shelfid
:
db3baaad8fff4c2ea4194a5dc238943e
shelfCode
:
areah034721
17
areaName
:
自动化测试
data/b5_spd3_core_business_flow/data
View file @
6d660d4f
...
...
@@ -56,6 +56,10 @@
"herpService_mcmsBranchGoodsInfo_page_url": "/api/herpService/basic/mcmsBranchGoodsInfo/page"
"platformService_basic_logic_save_url": "/api/platformService/basic/logic/save"
"herpService_queryBuyPage_url": "/api/herpService/buy/queryBuyPage"
"herpService_purPlan_listVoPage_url": "/api/herpService/purPlan/listVoPage"
"herpService_purPlan_listVo_url": "/api/herpService/purPlan/listVo"
"herpService_purPlan_submitPurPlan_url": "/api/herpService/purPlan/submitPurPlan"
"username": "xhs1009"
"username2": "test001"
...
...
@@ -137,3 +141,7 @@ json_headers2: {
"payload54": {"logicInfo":{"logicName":"自动化测试12345","simpleName":"自动","stockId":"ST2023122800001","hosId":"%s","mgrMode":"0","purBranchId":"%s","leader":"自动化测试","phone":"自动化测试","tbStatus":1,"delFlag":0,"branchIds":["%s"],"createUser":"%s","lastModifiedUser":"%s"},"mgrRange":{"userId":"%s","corpId":"%s","mgrRangeName":"自动化测试12345","mgrRangeKind":2,"defaultFlag":1,"projectCode":"warehouse","createUser":"%s","lastModifiedUser":"%s","extStr1":"3.0实体仓"}}
"payload55": {"orderBy":"mdb.order_no asc","pageNum":1,"pageSize":50,"queryObject":{"permission":true,"deptId":"","orderNo":"","branchId":"%s","goodsName":"","startDate":"","endDate":"","queryFlag":true}}
"payload56": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","hosId":"%s","status":"0","createUser":"","startTime":null,"endTime":null}}
"payload57": {"pid":"%s","hosGoodsName":"","hosGoodsSpec":"","provName":"","purModes":[],"subProvName":""}
"payload58": {"id":"%s","planDetailList":[{"closeStatus":"%s","id":"%s","inSettlement":1,"planPkgQty":1,"pkgDefQty":100,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":"%s","version":0,"pkgDefId":"%s","purTaskId":null,"sourceId":"%s","codingType":0}],"tempFlag":0,"version":0,"checkLcTaskQty":true}
"payload58_1": {"id":"%s","planDetailList":[{"closeStatus":0,"id":"%s","inSettlement":1,"planPkgQty":1,"pkgDefQty":1,"provId":"%s","provName":"%s","subProvId":"%s","subProvName":"%s","hosGoodsId":"%s","purMode":20,"version":0,"pkgDefId":null,"purTaskId":null,"sourceId":"%s","codingType":0}],"tempFlag":0,"version":0,"checkLcTaskQty":true}
data/b5_spd3_core_business_flow/message
View file @
6d660d4f
供货关系申请2:
e_corpId: p1e25
0
e_corpId: p1e25
4
h_corpId: h0347
e_username: 国药集团公司
m!4a&
e_username: 国药集团公司
0zl25
h_name: test001
data/b5_spd3_core_business_flow/message1
View file @
6d660d4f
产品审核信息
:
MSPid
:
MSP24052
8
0007_1
MSPid
:
MSP24052
9
0007_1
hosId
:
h0347
hosGoodsId
:
h0347000038
20
provGoodsid
:
provGood-9922
0953
goodsAuditBillId
:
MSP24052
8
0007
targetId
:
MSP24052
8
0007_1
hosGoodsId
:
h0347000038
38
provGoodsid
:
provGood-9922
1001
goodsAuditBillId
:
MSP24052
9
0007
targetId
:
MSP24052
9
0007_1
data/b5_spd3_core_business_flow/message10
View file @
6d660d4f
低值配送单号
:
distrBillId1
:
PSh03472024052
8
00
11
distrBillId2
:
PSh03472024052
8
00
11
distrBillId1
:
PSh03472024052
9
00
24
distrBillId2
:
PSh03472024052
9
00
24
高值配送单号
:
distrBillId1
:
PSh03472024052
8
00
1
2
distrBillId2
:
PSh03472024052
8
00
1
2
distrBillId1
:
PSh03472024052
9
002
5
distrBillId2
:
PSh03472024052
9
002
5
试剂配送单号
:
distrBillId1
:
PSh0347202405280013
distrBillId2
:
PSh0347202405280013
高值跟台配送单号
:
distrBillId1
:
PSh0347202405280014
distrBillId2
:
PSh0347202405280014
distrBillId1
:
PSh0347202405290026
distrBillId2
:
PSh0347202405290026
data/b5_spd3_core_business_flow/message11
View file @
6d660d4f
采购计划单号高值
:
orderNo1
:
PLAN2024052
8
24
379
orderNo2
:
PLAN2024052
8
24
379
orderNo1
:
PLAN2024052
9
24
542
orderNo2
:
PLAN2024052
9
24
542
Prev
1
2
Next
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