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
cac5d06f
Commit
cac5d06f
authored
May 23, 2024
by
xiao-hesheng
Browse files
流程十脚本编写
parent
29fb30a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air/a_b3流程十请领业务流_二级库向边仓.py
View file @
cac5d06f
...
...
@@ -68,16 +68,195 @@ def goods_move():
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
:
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_logic_stock
():
module
=
"b5_spd3_core_business_flow"
#登录集中管控平台
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_platform
()
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
)
try
:
#科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
# token, projectCode, uxid, corpId, info=login_platform()
# print(token, projectCode, uxid, corpId, info
)
add_logic_stock
(
)
# token, projectCode, uxid, corpId, info =login_logic_stock()
# print(token, projectCode, uxid, corpId, info)
#设置产品出库渠道为边仓
goods_move
()
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
# # 低值
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()
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'1'
)
data/b5_spd3_core_business_flow/message21
View file @
cac5d06f
...
...
@@ -2,11 +2,11 @@
list_a
:
-
&id001
-
id
:
hosGoodsId
:
h034700003
682
goodsName
:
新型冠状病毒检测试剂
CKWiZ
hosGoodsId
:
h034700003
748
goodsName
:
新型冠状病毒检测试剂
pKIh2
goodsSpec
:
G-31891
mdmGoodsCode
:
'11660
574
'
goodsCode
:
'00003
682
'
mdmGoodsCode
:
'11660
640
'
goodsCode
:
'00003
748
'
unit
:
支
purMode
:
60
goodsMfrsName
:
德国歌德公司 Geuder AG
...
...
@@ -17,28 +17,28 @@
pkgQty
:
qty
:
0
goodsImg
:
[]
pkgDefId
:
ec15e428923b46bc8c51c833bde60359
pkgDefId
:
16b05f527c984671a679c6448275aa4a
buyPkgQty
:
unitName
:
100支/100
price
:
99.9999
hosId
:
branchId
:
deptId
:
7aa9a7c18aa1440ba5c88f459c2d17c8
deptId
:
ae5633c54a4741c08e1b76d10025ebf5
deptName
:
areaCode
:
areaName
:
targetDeptId
:
9b15c86f70a64f2ab83e207bde34541
9
targetDeptId
:
550f4768e0f74ccbb706d3afa3d63a5
9
targetDeptName
:
设备科001
targetStockId
:
76ac42c9f9724988a36eaacfdff45ef6
targetStockName
:
东土城路院区
3pvuL
中心库房
targetStockId
:
e0dc175070b640229a9d913d5161aac0
targetStockName
:
东土城路院区
CU2K!
中心库房
purchaseFlag
:
1
tempFlag
:
0
grantWay
:
1
grantWay
:
2
deptGoodsStatus
:
codingType
:
purModeText
:
检验试剂
goodsGeneralName
:
检测试剂
provName
:
国药集团公司
f$F5C
provName
:
国药集团公司
p0t4h
noRecPkgQty
:
0
noRecQty
:
0
list_b
:
...
...
data/b5_spd3_core_business_flow/message22
View file @
cac5d06f
...
...
@@ -2,8 +2,8 @@
list_a
:
-
&id001
-
id
:
2920c945491743478cac349bb5c9124c
lastModified
:
'2024-05-23 14:5
6:09
'
version
:
1
lastModified
:
'2024-05-23 14:5
7:15
'
version
:
2
createTime
:
'2024-05-23 14:45:15'
createUser
:
h0347_UID-051284
lastModifiedUser
:
h0347_UID-051284
...
...
report/summary.html
View file @
cac5d06f
...
...
@@ -56,7 +56,7 @@
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分
1
3秒
</td>
<td
class=
'details-col-elapsed'
>
0分3
0
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</table>
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
a4_流程四_基础模块设置
/log.html'
target=
'_blank'
>
a_
a4_流程四_基础模块设置
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
b3流程十请领业务流_二级库向边仓
/log.html'
target=
'_blank'
>
a_
b3流程十请领业务流_二级库向边仓
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
13.183
</td>
<td
class=
"details-col-elapsed"
>
30.031
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
runner.py
View file @
cac5d06f
...
...
@@ -13,6 +13,8 @@ sys.path.append(rootPath)
if
__name__
==
'__main__'
:
delData
().
Del_supply_relation
()
delData
().
Delete_business_Data
()
# 第一个参数 case 执行类型,'all', 'sc', 'tag'
caseType
=
sys
.
argv
[
1
]
# 第2个参数要执行
...
...
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