Commit e40ceec5 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent c9841605
...@@ -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]
# 获取预期结果 # 获取预期结果
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment