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
5869cb84
Commit
5869cb84
authored
Jun 13, 2024
by
xiao-hesheng
Browse files
流程十二脚本编写
parent
f759dea5
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b9流程十六退库业务_二级库向一级库退库.air/a_b9流程十六退库业务_二级库向一级库退库.py
View file @
5869cb84
...
...
@@ -19,6 +19,142 @@ case_tag:api,spd_core1,a_b9流程十六退库业务_二级库向一级库退库,
python runner_test.py tag id2302-19 debug mdm3
"""
# 入库上架
def
putaway
():
module
=
"b5_spd3_core_business_flow"
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
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_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
# =====================上架入库列表查询==========================
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"stock_in_page_url"
)
print
(
url
)
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload6"
,
branch_id
,
hosId
)
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
>=
1
:
# 将上架入库列表数据写入文件
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
,
'message16'
)
# =====================上架入库列表查询==========================
# =============查看验收单详情========================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"stock_detail_url"
)
print
(
'查看验收单详情'
,
url
)
deptid1
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid1"
]
areaCode
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'shelfinfo'
,
'message7'
)[
"shelfCode"
]
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
# 从message16文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"上架入库列表数据"
,
'message16'
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
sourceId
=
'sourceId'
for
i
in
list_a
:
for
j
in
i
:
sourceId
=
j
[
'sourceId'
]
break
# 从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"
for
i
in
list_a
:
print
(
'i'
,
i
)
for
j
in
i
:
sourceType
=
j
[
"sourceType"
]
break
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload4"
,
deptid1
,
areaCode
,
hosId
,
sourceId
,
sourceType
)
print
(
'request_body'
,
'd'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
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
,
'message17'
)
time
.
sleep
(
6
)
# ============= # =============查看验收单详情================================================
# ================================入库上架===================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"stock_detail_submit_url"
)
print
(
url
)
viewId
=
'viewId'
shelfCode
=
'shelfCode'
sourceId
=
'sourceId'
sourceType
=
'PSD'
sourceVersion
=
'0'
targetDeptId
=
deptid1
targetDeptName
=
'targetDeptName'
targetAreaCode
=
'targetAreaCode'
targetAreaName
=
'targetAreaName'
# 从message17文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"验收单库存详情信息"
,
'message17'
)
# print('info', info)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
for
i
in
list_a
:
print
(
'i'
,
i
)
for
j
in
i
:
viewId
=
j
[
"viewId"
]
shelfCode
=
j
[
'shelfCode'
]
sourceId
=
j
[
'id'
]
break
# 从message16文件中获取信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"上架入库列表数据"
,
'message16'
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
for
i
in
list_a
:
for
j
in
i
:
sourceId
=
j
[
'sourceId'
]
targetAreaName
=
j
[
'areaName'
]
targetAreaCode
=
j
[
'areaCode'
]
break
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload5"
,
viewId
,
shelfCode
,
sourceId
,
sourceType
,
sourceVersion
,
targetDeptId
,
targetDeptName
,
targetAreaCode
,
targetAreaName
)
print
(
'request_body'
,
request_body
)
time
.
sleep
(
3
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# ================================入库上架================================
...
...
@@ -426,9 +562,10 @@ def second_dept_return_Out_Stock(type): # 二级库退库出库
try
:
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
2
))
# 设置登录账号默认权限是三级库
second_dept_return_Out_Stock
(
2
)
#高值耗材退货出库
approval_center
()
# updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
# second_dept_return_Out_Stock(2) #高值耗材退货出库
# approval_center()#审批
putaway
()
#中心库上架
# second_dept_return_Out_Stock(1) #低值耗材退货出库
# second_dept_return_Out_Stock(3) #低值耗材退货出库
# second_dept_one_key_in(2)
...
...
data/b5_spd3_core_business_flow/message16
View file @
5869cb84
...
...
@@ -7,13 +7,13 @@
createTime
:
createUser
:
h0347_UID-051330
lastModifiedUser
:
billMode
:
'
16
'
billMode
:
'
20
'
recType
:
stockKind
:
purMode
:
sourceId
:
CHECK
h034720240613000
02
sourceType
:
PSD
sourceVersion
:
0
sourceId
:
DR
h034720240613000
121
sourceType
:
CK_TK
sourceVersion
:
1
batchList
:
billRelationJson
:
hosId
:
h0347
...
...
@@ -21,18 +21,18 @@
deptName
:
branchId
:
h0347-3669
branchName
:
taskType
:
1
sourceOrgId
:
p1e292
sourceOrgName
:
国药集团公司K19@c
sourceOrderNo
:
YS
24061300
2
taskSourceNo
:
PSh0347
20240613000
5
areaCode
:
areah03472305
areaName
:
自动化测试
taskType
:
2
sourceOrgId
:
7020cc82c12a46e0a8ca998a00bf6760
sourceOrgName
:
二级检验科002
sourceOrderNo
:
DN20
24061300
0121
taskSourceNo
:
DN
20240613000
121
areaCode
:
areaName
:
goodsName
:
goodsGg
:
startDate
:
endDate
:
taskDate
:
'2024-06-13
07:13:00
'
taskDate
:
'2024-06-13
15:16:38
'
pkgTaskId
:
pkgFlag
:
remark
:
''
...
...
data/b5_spd3_core_business_flow/message17
View file @
5869cb84
验收单库存详情信息
:
list_a
:
-
&id001
-
id
:
CHECKh034720240613000020001
lastModified
:
version
:
createTime
:
createUser
:
lastModifiedUser
:
rowIdx
:
purMode
:
10
unitName
:
100支/100
pid
:
CHECKh03472024061300002
hosGoodsId
:
h034700004090
batchCode
:
'333'
expdtDate
:
'2024-12-20'
productDate
:
'2024-06-13'
batchPrice
:
99.9999
settlement
:
1
batchType
:
20
srcBatchId
:
'03838410'
srcBatchPrice
:
99.9999
shelfCode
:
areah03472305-2-01-01
shelfKind
:
barcodeId
:
UT240613000201
subBarcodeId
:
qty
:
10000.0
pkgQty
:
100
distrId
:
PSh0347202406130005
distrDetailId
:
'03838410'
pkgDefQty
:
100.0
pkgDefName
:
'100'
viewId
:
h0347000040903332024-12-20100支/100
codingType
:
batchFlag
:
hasSterilize
:
0
sterilizeQty
:
sterilizePassQty
:
sterilizeRejectQty
:
orderNo
:
sourceDetailId
:
'03838410'
mdmGoodsCode
:
'11661038'
goodsCode
:
'00004090'
tbStatus
:
1
billMode
:
'16'
hosId
:
h0347
branchId
:
h0347-3669
purBillId
:
Ch034720240613000049
provId
:
p1e292
provName
:
国药集团公司K19@c
subSendFlag
:
10
exeProvId
:
p1e292
exeProvName
:
国药集团公司K19@c
purDetailId
:
4c67058b00ee43af8f633f63d438f9de
goodsName
:
一次性注射器_低值6Vcb1
goodsGg
:
G-31891
mfrsId
:
mfrs-11229
mfrsName
:
德国歌德公司 Geuder AG
made
:
德国
unit
:
支
purPrice
:
99.9999
pkgDefId
:
2a07241891d04de2a01a58fee45711d9
supplyId
:
77ab6d5381334a01866ffeab9ad96a82
subProvId
:
p1e292
subProvName
:
国药集团公司K19@c
subPrice
:
99.9999
distrPrice
:
99.9999
distrPkgQty
:
100.0
distrQty
:
10000.0
certificateCode
:
''
productCertCode
:
detailRelationJson
:
extInfo
:
psiPrice
:
99.9999
ext
:
goodsGg
:
G-31891
goodsCode
:
'00004090'
purMode
:
10
goodsName
:
一次性注射器_低值6Vcb1
ygptCode
:
''
transCond
:
''
storageCond
:
''
erpCode
:
'11661038'
ybDefId
:
''
purTaskId
:
multiChargeFlag
:
trustMrfsName
:
-
&id001
[]
list_b
:
-
*id001
list_c
:
...
...
report/summary.html
View file @
5869cb84
...
...
@@ -77,7 +77,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<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分1
5
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</table>
...
...
@@ -95,7 +95,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_b9流程十六退库业务_二级库向一级库退库/log.html'
target=
'_blank'
>
a_b9流程十六退库业务_二级库向一级库退库
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1
3.71
</td>
<td
class=
"details-col-elapsed"
>
1
5.574
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
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