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
e40ceec5
Commit
e40ceec5
authored
Feb 27, 2024
by
liguangyu06
Browse files
优化
parent
c9841605
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_order_list/获取业务人员信息.air/获取业务人员信息.py
View file @
e40ceec5
...
@@ -58,8 +58,8 @@ result = json.loads(result.content)
...
@@ -58,8 +58,8 @@ result = json.loads(result.content)
# 生成随机数
# 生成随机数
department_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
])
-
1
)
department_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
])
-
1
)
# 获取部门信息
# 获取部门信息
alesDepartmentNo
=
result
[
"data"
][
department_random
][
"alesDepartmentNo"
]
alesDepartmentNo
=
result
[
"data"
][
0
][
"alesDepartmentNo"
]
alesDepartmentName
=
result
[
"data"
][
department_random
][
"alesDepartmentName"
]
alesDepartmentName
=
result
[
"data"
][
0
][
"alesDepartmentName"
]
# 第五步获取业务人员信息
# 第五步获取业务人员信息
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url113"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url113"
)
...
@@ -78,6 +78,7 @@ api_time = float(result.elapsed.total_seconds())
...
@@ -78,6 +78,7 @@ api_time = float(result.elapsed.total_seconds())
# 获取业务人员信息
# 获取业务人员信息
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
result
=
{
"total"
:
len
(
result
[
"data"
])}
result
=
{
"total"
:
len
(
result
[
"data"
])}
# 将接口响应时间添加至result
# 将接口响应时间添加至result
...
@@ -91,6 +92,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
...
@@ -91,6 +92,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中对应部门的业务人员数量
# 查询数据库中对应部门的业务人员数量
sql
=
"SELECT count(t.personId) FROM `cmdc-user`.cmdc_person t "
\
sql
=
"SELECT count(t.personId) FROM `cmdc-user`.cmdc_person t "
\
"WHERE belong = 00102 and BussinessUnitDesc = '{}' and useFlag = 1"
.
format
(
alesDepartmentName
)
"WHERE belong = 00102 and BussinessUnitDesc = '{}' and useFlag = 1"
.
format
(
alesDepartmentName
)
# print(sql)
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-user"
,
sql
)[
0
][
0
]
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-user"
,
sql
)[
0
][
0
]
# 获取预期结果
# 获取预期结果
...
...
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