Commit 5aa33877 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent acef7870
......@@ -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/超发配置导入模板21.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
......
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