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
62294e7b
Commit
62294e7b
authored
Aug 01, 2024
by
xiao-hesheng
Browse files
优化调整脚本
parent
37904ae4
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air/a_a4_流程四_基础模块设置.py
View file @
62294e7b
...
@@ -329,6 +329,7 @@ def add_StockArea():#添加货位
...
@@ -329,6 +329,7 @@ def add_StockArea():#添加货位
def
recover_dataFile
():
def
recover_dataFile
():
delData
().
Delete_branch_by_id
(
2
)
delData
().
Delete_branch_by_id
(
2
)
delData
().
Delete_probeInfo_other
(
2
)
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
src
=
pro_path
+
r
'/data'
src
=
pro_path
+
r
'/data'
dst
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'备份路径'
,
'message29'
)[
'备份目录'
]
dst
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'备份路径'
,
'message29'
)[
'备份目录'
]
...
@@ -338,7 +339,7 @@ def recover_dataFile():
...
@@ -338,7 +339,7 @@ def recover_dataFile():
if
os
.
path
.
exists
(
src
):
if
os
.
path
.
exists
(
src
):
shutil
.
rmtree
(
src
)
shutil
.
rmtree
(
src
)
FileUtils
().
copy_folder_backup
(
dst
,
src
)
FileUtils
().
copy_folder_backup
(
dst
,
src
)
def
branch_add
(
token
):
def
branch_add
():
module
=
'b2_herp3_bs'
module
=
'b2_herp3_bs'
# 内网登录
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
...
@@ -369,7 +370,7 @@ def branch_add(token):
...
@@ -369,7 +370,7 @@ def branch_add(token):
#备份当前data目录
#备份当前data目录
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
src
=
pro_path
+
r
'/data'
src
=
pro_path
+
r
'/data'
dst
=
pro_path
+
r
'/data'
+
timeUtils
()
.
get_
time_hms
(
5
)
dst
=
pro_path
+
r
'/data'
+
get_branch_name
()
+
get_
branch_id
(
)
#将备份的目录路径写入到文件中
#将备份的目录路径写入到文件中
info
=
(
src
,
dst
)
info
=
(
src
,
dst
)
titlename
=
(
'源目录'
,
'备份目录'
)
titlename
=
(
'源目录'
,
'备份目录'
)
...
...
air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air/a_a5流程五_中心库入库结算_正结算1_提交采购计划.py
View file @
62294e7b
# -*- encoding=utf8 -*-
# -*- encoding=utf8 -*-
import
traceback
import
traceback
from
air_case.public1.public1.public1
import
get_hosid
,
get_branch_id
from
air_case.public1.public1.public1
import
get_hosid
,
get_branch_id
,
login
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
...
@@ -22,21 +22,21 @@ import time
...
@@ -22,21 +22,21 @@ import time
module
=
"b5_spd3_core_business_flow"
module
=
"b5_spd3_core_business_flow"
def
login
():
#
def login():
module
=
"b2_herp3_bs"
#
module = "b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
#
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
#
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print
(
info
)
#
print(info)
username1
=
info
[
'username1'
]
#
username1 = info['username1']
#
username
=
username1
#
username = username1
## print('医院名称',username)
#
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
#
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
#
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
#
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
#
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
return
token
,
projectCode
,
uxid
,
corpId
,
info
#
return token, projectCode, uxid, corpId, info
# 登录获取用户id等信息,使用创建的用户登录============结束
#
# 登录获取用户id等信息,使用创建的用户登录============结束
# 采购计划_低值
# 采购计划_低值
...
@@ -455,9 +455,62 @@ def reagent_purchase_plan():
...
@@ -455,9 +455,62 @@ def reagent_purchase_plan():
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
goods_move3
():
# 设置请领出库渠道为中心库
# # 登录获取用户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_3"
,
branchGoodsId
,
hosGoodsId
,
get_branch_id
())
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'goods_move,result'
,
result
)
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_3"
,
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
main
():
def
main
():
try
:
try
:
goods_move3
()
# 获取低值的hosGoodsId
# 获取低值的hosGoodsId
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
...
...
air_case/b5_spd3_core_business_flow/a_a9流程六_中心库入库结算_负结算.air/a_a9流程六_中心库入库结算_负结算.py
View file @
62294e7b
...
@@ -40,7 +40,7 @@ def center_warehouse_return():
...
@@ -40,7 +40,7 @@ def center_warehouse_return():
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
token
,
projectCode
,
uxid
,
corpId
,
info
=
login
(
username
,
password
,
2
)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 登录获取用户id等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
# 到库房明细查询,查询产品的udi码
get_udi
(
1
)
get_udi
_bydb
(
1
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_pick_submit_url"
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_pick_submit_url"
)
print
(
'url'
,
url
)
print
(
'url'
,
url
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
...
...
air_case/demo/产品检查.air/产品检查.py
View file @
62294e7b
...
@@ -61,7 +61,7 @@ import sys
...
@@ -61,7 +61,7 @@ import sys
# 备份当前data目录
# 备份当前data目录
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
src
=
pro_path
+
r
'/data'
src
=
pro_path
+
r
'/data'
dst
=
pro_path
+
r
'/data'
+
timeUtils
()
.
get_
time_hms
(
5
)
dst
=
pro_path
+
r
'/data'
+
get_branch_name
()
+
get_
branch_id
(
)
#将备份的目录路径写入到文件中
#将备份的目录路径写入到文件中
info
=
(
src
,
dst
)
info
=
(
src
,
dst
)
titlename
=
(
'源目录'
,
'备份目录'
)
titlename
=
(
'源目录'
,
'备份目录'
)
...
...
air_case/public1/public1/public1.py
View file @
62294e7b
This diff is collapsed.
Click to expand it.
common/db/sql/sql_del_branch_info.py
View file @
62294e7b
...
@@ -142,12 +142,15 @@ class delData(object):
...
@@ -142,12 +142,15 @@ class delData(object):
# print('多余库房信息删除成功 ')
# print('多余库房信息删除成功 ')
cursor
.
close
()
cursor
.
close
()
def
Delete_probeInfo_other
(
self
):
def
Delete_probeInfo_other
(
self
,
type
=
1
):
connection
=
pymysql
.
connect
(
host
=
"10.17.65.108"
,
user
=
"root"
,
password
=
"Cmic.2023"
,
database
=
"spd3_herp_test2"
,
connection
=
pymysql
.
connect
(
host
=
"10.17.65.108"
,
user
=
"root"
,
password
=
"Cmic.2023"
,
database
=
"spd3_herp_test2"
,
charset
=
"utf8"
)
charset
=
"utf8"
)
cursor
=
connection
.
cursor
()
cursor
=
connection
.
cursor
()
# 删除多余库房信息
# 删除多余库房信息
sql
=
"delete from mcms_stock_info where stock_name like '%东土城路院区_____中心库房';"
if
type
==
1
:
sql
=
"delete from mcms_stock_info where stock_name like '%东土城路院区_____中心库房';"
else
:
sql
=
"delete from mcms_stock_info where stock_name like '%东土城路院区______中心库房';"
print
(
sql
)
print
(
sql
)
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
cursor
.
execute
(
"commit;"
)
cursor
.
execute
(
"commit;"
)
...
...
data/b5_spd3_core_business_flow/message15
View file @
62294e7b
验收单号
:
验收单号
:
CHECK_NO1
:
CHECKh034720240801000
06
CHECK_NO1
:
CHECKh034720240801000
18
CHECK_NO2
:
CHECKh034720240801000
06
CHECK_NO2
:
CHECKh034720240801000
18
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