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-cmdc
Commits
5aa33877
Commit
5aa33877
authored
Jun 05, 2024
by
liguangyu06
Browse files
用例优化
parent
acef7870
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_32st/超发配置导入功能验证.air/超发配置导入功能验证.py
View file @
5aa33877
...
...
@@ -42,16 +42,16 @@ num = 1
# print(productCode)
# 获取文件
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))))
file_path
=
BASE_DIR
+
"/data/cmdc_files/超发配置导入模板1.xlsx"
file_path
=
BASE_DIR
+
"/data/cmdc_files/超发配置导入模板
2
1.xlsx"
# 将商品信息写入文件中
excel
=
HandleExcel
(
file_path
,
"Sheet1"
)
excel
.
write_data
(
row
=
2
,
column
=
1
,
value
=
productCode
)
excel
.
write_data
(
row
=
2
,
column
=
2
,
value
=
productName
)
excel
.
write_data
(
row
=
2
,
column
=
3
,
value
=
specifications
)
excel
.
write_data
(
row
=
2
,
column
=
4
,
value
=
num
)
excel
.
write_data
(
row
=
2
,
column
=
5
,
value
=
num
)
#
# 将商品信息写入文件中
#
excel = HandleExcel(file_path, "Sheet1")
#
#
excel.write_data(row=2, column=1, value=productCode)
#
excel.write_data(row=2, column=2, value=productName)
#
excel.write_data(row=2, column=3, value=specifications)
#
excel.write_data(row=2, column=4, value=num)
#
excel.write_data(row=2, column=5, value=num)
# 第三步进行超发配置导入操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url10"
)
...
...
@@ -80,9 +80,9 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 查询数据库超发配置数量
sql
=
"SELECT t.wholeQuantity FROM `cmdc-order`.tc_supernova t "
\
"WHERE companyCode = 00102 and
productCode = {}"
.
format
(
productCode
)
"WHERE companyCode = 00102 and
materialCode = '507677'"
total
=
int
(
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-order"
,
sql
)[
0
][
0
])
print
(
sql
)
result
=
{
"wholeQuantity"
:
total
}
# 将接口响应时间添加至result
...
...
data/cmdc_files/超发配置导入模板21.xlsx
0 → 100644
View file @
5aa33877
File added
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