From e40ceec52dcbcb001486f55f757a626103ddaf6d Mon Sep 17 00:00:00 2001 From: liguangyu06 <1666071293@qq.com> Date: Tue, 27 Feb 2024 08:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\344\272\272\345\221\230\344\277\241\346\201\257.py" | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git "a/air_case/cmdc_order_list/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.air/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.py" "b/air_case/cmdc_order_list/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.air/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.py" index 8d159584..a595fe0f 100644 --- "a/air_case/cmdc_order_list/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.air/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.py" +++ "b/air_case/cmdc_order_list/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.air/\350\216\267\345\217\226\344\270\232\345\212\241\344\272\272\345\221\230\344\277\241\346\201\257.py" @@ -58,8 +58,8 @@ result = json.loads(result.content) # 生成随机数 department_random = random.randint(0, len(result["data"]) - 1) # 获取部门信息 -alesDepartmentNo = result["data"][department_random]["alesDepartmentNo"] -alesDepartmentName = result["data"][department_random]["alesDepartmentName"] +alesDepartmentNo = result["data"][0]["alesDepartmentNo"] +alesDepartmentName = result["data"][0]["alesDepartmentName"] # 第五步获取业务人员信息 url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url113") @@ -78,6 +78,7 @@ api_time = float(result.elapsed.total_seconds()) # 获取业务人员信息 result = json.loads(result.content) +print(result) result = {"total": len(result["data"])} # 将接口响应时间添加至result @@ -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 " \ "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] # 获取预期结果 -- GitLab