Commit 1ba11eca authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent e6d3c2ac
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -51,6 +51,7 @@ result = requests.get(url, params=request_body, headers=headers)
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
# print(result)
# 将接口响应时间添加至result
result["api_time"] = api_time
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -32,7 +32,7 @@ result = json.loads(result.content)
customer_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取客户信息
user_id = result["data"]["list"][customer_random]["userId"]
company_id = "6"
company_id = "7"
# 第三步获取收货地址列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
......@@ -40,6 +40,7 @@ request_body = commonFuc().get_business_data(module, "payload37", company_id, us
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 判断地址是否存在
if result["data"]["addresses"]["list"]:
# 获取收货人手机号
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -32,7 +32,7 @@ result = json.loads(result.content)
customer_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取客户信息
user_id = result["data"]["list"][customer_random]["userId"]
company_id = "6"
company_id = "7"
# 第三步获取收货地址列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -16,8 +16,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -33,7 +33,7 @@ result = json.loads(result.content)
customer_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取客户信息
user_id = result["data"]["list"][customer_random]["userId"]
company_id = "6"
company_id = "7"
# 第三步获取收货地址列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
......@@ -52,7 +52,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中需求单数量
sql = "SELECT count(t.demandId) FROM `cmdc-order`.tc_demand t " \
"WHERE deleteSign = 0 and sellerCompanyCode = 00111 and paymentType is not null"
total = int(mysql_handle.selectSql(host, port, user, pwd, "cmdc-user", sql)[0][0]) - 1
total = int(mysql_handle.selectSql(host, port, user, pwd, "cmdc-user", sql)[0][0])
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict1", total)
......
......@@ -15,8 +15,8 @@ import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......@@ -32,7 +32,7 @@ result = json.loads(result.content)
customer_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取客户信息
user_id = result["data"]["list"][customer_random]["userId"]
company_id = "6"
company_id = "7"
# 第三步获取收货地址列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
......
......@@ -51,6 +51,7 @@ result = requests.post(url, json=request_body, headers=headers)
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
# print(result)
# 将接口响应时间添加至result
result["api_time"] = api_time
......
......@@ -18,8 +18,8 @@ import os
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
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