Commit 5271a37a authored by 周念东's avatar 周念东
Browse files

20240617

parents ced008e1 c3acdd56
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc失效日期排序功能验证_销售明细列表_降序,34,34-42,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按失效日期降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url42")
request_body = commonFuc().get_business_data(module, "payload42")
"""
场景: 失效日期排序功能验证_销售明细列表_降序
用例名称:失效日期排序功能验证_销售明细列表_降序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按失效日期降序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by IOMMEJ desc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict42", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付日期排序功能验证_返利使用报表列表_升序,34,34-37,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付日期升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url37")
request_body = commonFuc().get_business_data(module, "payload37")
"""
场景: 支付日期排序功能验证_返利使用报表列表_升序
用例名称:支付日期排序功能验证_返利使用报表列表_升序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付日期升序查询对应的返利使用信息
sql = "select * from (select subtd.demandCode, td.createTime, td.auditTime, main.paidTime, jd.SDDOCO, " \
" jd.SDTRDJ, subtd.customerCode, subtd.customerName, subsku.productCode, subsku.productName, " \
" jd.DTTUPRC, jd.DTTAEXP, jd.SDUPRC, jd.SDAEXP, jd.IOLOT1, jd.SDLOTN, jd.FCD01, " \
" jd.IOMMEJ, jd.SDADDJ, jd.SDDCTO, jd.SDSOQS, jd.QWDSC, jd.SDPMPN from tc_jde_580_jde jd " \
" inner join tc_demand_sub_sku subsku " \
"on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count order by paidTime asc"
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict37", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付日期排序功能验证_返利使用报表列表_降序,34,34-38,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付日期降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url38")
request_body = commonFuc().get_business_data(module, "payload38")
"""
场景: 支付日期排序功能验证_返利使用报表列表_降序
用例名称:支付日期排序功能验证_返利使用报表列表_降序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付日期降序查询对应的返利使用信息
sql = "select * from (select subtd.demandCode, td.createTime, td.auditTime, main.paidTime, jd.SDDOCO, " \
" jd.SDTRDJ, subtd.customerCode, subtd.customerName, subsku.productCode, subsku.productName, " \
" jd.DTTUPRC, jd.DTTAEXP, jd.SDUPRC, jd.SDAEXP, jd.IOLOT1, jd.SDLOTN, jd.FCD01, " \
" jd.IOMMEJ, jd.SDADDJ, jd.SDDCTO, jd.SDSOQS, jd.QWDSC, jd.SDPMPN from tc_jde_580_jde jd " \
" inner join tc_demand_sub_sku subsku " \
"on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count order by paidTime desc"
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict38", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付日期排序功能验证_退货明细列表_升序,34,34-27,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付日期升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url27")
request_body = commonFuc().get_business_data(module, "payload28")
"""
场景: 支付日期排序功能验证_退货明细列表_升序
用例名称:支付日期排序功能验证_退货明细列表_升序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# print(result)
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付日期升序查询对应的退货明细信息
sql = "select * from (select td.sellerCompanyName, td.sellerCompanyCode, td.demandParentCode,de.SDDOCO as returnGoodCode, de.SDTRDJ as returnGoodTime,td.customerCode,td.customerName,de.SHIR01 shir01,de.SDPMPN sdpmpn,de.qwdsc, sku.productCode,sku.productName ,sku.materialCode,sku.optionStr,sku.productLineCode,sku.productLineName,sku.measuringUnit,(de.SDUORG/10000) as returnQuantity,de.dttuprc/10000 as dttuprc,de.dttaexp/100 as dttaexp,sku.promotionPrice, ((de.SDUORG/10000)*sku.promotionPrice) as rebateTotal, td.demandCode,td.createTime as orderTime,td.auditTime,td.distributionType,td.paymentType,main.paidTime,de.sdocto,de.sdaddj,de.SDOORN soCode ,sku.manufacturerUserNo,sku.manufacturerUserDesc,sku.manufacturerProductNo,sku.manufacturerProductDesc, if(sku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(sku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_returnall_detail de left join tc_demand td on de.demandCode = td.demandCode left join tc_demand_sku sku on sku.demandCode = de.demandCode and sku.lineNumber = de.demandLineNumber left join tc_demand_main main on main.demandParentId = td.demandParentId left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId where de.sdocto !='SN' and td.demandId is not null and td.sellerCompanyCode = '00102' order by de.SDTRDJ desc) tmp_count order by paidTime desc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][3]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict27", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付日期排序功能验证_退货明细列表_降序,34,34-28,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付日期降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url28")
request_body = commonFuc().get_business_data(module, "payload28")
"""
场景: 支付日期排序功能验证_退货明细列表_降序
用例名称:支付日期排序功能验证_退货明细列表_降序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付日期降序查询对应的退货明细信息
sql = "select * " \
"from (select de.SDDOCO, de.SDTRDJ, td.customerCode, td.customerName, de.SHIR01, de.SDPMPN, de.qwdsc, " \
"sku.productCode," \
" sku.productName, sku.productLineCode, sku.productLineName, sku.measuringUnit, td.demandCode," \
" td.createTime, td.auditTime, td.distributionType, td.paymentType, main.paidTime, de.sdocto," \
" de.sdaddj, de.SDOORN from tc_jde_returnall_detail de" \
" left join tc_demand td on de.demandCode = td.demandCode" \
" left join tc_demand_sku sku on sku.demandCode = de.demandCode and " \
"sku.lineNumber = de.demandLineNumber" \
" left join tc_demand_main main on main.demandParentId = td.demandParentId" \
" left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId" \
" left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId" \
" where de.sdocto != 'SN'" \
" and td.demandId is not null" \
" and td.sellerCompanyCode = '00102'" \
" order by de.SDTRDJ desc) tmp_count order by paidTime desc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict28", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付时间排序功能验证_销售明细列表_升序,34,34-13,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付时间升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url13")
request_body = commonFuc().get_business_data(module, "payload13")
"""
场景: 支付时间排序功能验证_销售明细列表_升序
用例名称:支付时间排序功能验证_销售明细列表_升序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付时间升序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by paidTime asc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict13", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc支付时间排序功能验证_销售明细列表_降序,34,34-14,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按支付时间降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url14")
request_body = commonFuc().get_business_data(module, "payload14")
"""
场景: 支付时间排序功能验证_销售明细列表_降序
用例名称:支付时间排序功能验证_销售明细列表_降序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# print(result)
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按支付时间降序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by paidTime desc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict14", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc显示绑定手机号条件验证,34,34-2,sit,be
主数据平台:商城端登录接口
"""
from common.common_func import commonFuc
import requests
import uuid
from common.verification_code_ocr import VerificationCodeOcr
import json
import os
module = "cmdc_34st"
username = commonFuc().get_business_data(module, "username_test0411")
password = commonFuc().get_business_data(module, "password_test0411")
# 获取唯一识别码
uuid_handle = uuid.uuid4()
# 获取验证码报文
param = {"uuid": uuid_handle}
# 获取登录页面获取验证码地址
code_url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "getVerifyCode_url")
# 发送请求获取验证码
result = requests.get(code_url, params=param)
# print(result.content)
# 获取当前文件路径
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
code_path = BASE_DIR + "/verifycode.png"
# 获取到验证码存入本地文件
with open(code_path, 'wb') as f:
f.write(result.content)
# 识别并获取验证码
code = VerificationCodeOcr(code_path, "rainbow123", "rainbow123").base64_api()
# 获取登录地址
cmdc_url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "do_login_url")
# 组装请求报文
request_body = {"userName": username, "password": password, "validateCode": code, "uuid": uuid_handle}
"""
场景: 显示绑定手机号条件验证
用例名称:显示绑定手机号条件验证
输出:{"loginStatus":808,"phoneSign":4}
"""
# 发送请求
result = requests.post(cmdc_url, params=request_body)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取登录接口返回内容
result = json.loads(result.content)
# print(result)
result = {"loginStatus": result["data"]["loginStatus"], "phoneSign": result["data"]["phoneSign"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict2")
# 断言实际结果中是否包含预期结果的内容
# commonFuc().check_result(cmdc_access_token, result)
commonFuc().check_variable_exist(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc生产日期排序功能验证_销售明细列表_升序,34,34-19,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按生产日期升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url19")
request_body = commonFuc().get_business_data(module, "payload19")
"""
场景: 生产日期排序功能验证_销售明细列表_升序
用例名称:生产日期排序功能验证_销售明细列表_升序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按生产日期升序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by FCD01 asc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict19", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc生产日期排序功能验证_销售明细列表_降序,34,34-20,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按生产日期降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url20")
request_body = commonFuc().get_business_data(module, "payload20")
"""
场景: 生产日期排序功能验证_销售明细列表_降序
用例名称:生产日期排序功能验证_销售明细列表_降序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按生产日期降序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by FCD01 desc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict20", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_返利使用报表列表_升序,34,34-31,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商下单时间升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url31")
request_body = commonFuc().get_business_data(module, "payload31")
"""
场景: 电商下单时间排序功能验证_返利使用报表列表_升序
用例名称:电商下单时间排序功能验证_返利使用报表列表_升序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商下单时间升序查询对应的返利使用信息
sql = "select demandCode from (select createTime, demandCode " \
" from (select subtd.demandCode, td.createTime from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku " \
" on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null " \
" and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count) t order by createTime asc"
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict31", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_返利使用报表列表_降序,34,34-32,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商下单时间降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url32")
request_body = commonFuc().get_business_data(module, "payload32")
"""
场景: 电商下单时间排序功能验证_返利使用报表列表_降序
用例名称:电商下单时间排序功能验证_返利使用报表列表_降序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商下单时间降序查询对应的返利使用信息
sql = "select demandCode from (select createTime, demandCode " \
" from (select subtd.demandCode, td.createTime from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku " \
" on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null " \
" and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count) t order by createTime desc "
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict32", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_退货明细列表_升序,34,34-23,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按退电商下单时间升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url23")
request_body = commonFuc().get_business_data(module, "payload23")
"""
场景: 电商下单时间排序功能验证_退货明细列表_升序
用例名称:电商下单时间排序功能验证_退货明细列表_升序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电扇下单时间升序查询对应的退货明细信息
sql = "select * " \
"from (select de.SDDOCO, de.SDTRDJ, td.customerCode, td.customerName, de.SHIR01, de.SDPMPN, de.qwdsc, " \
"sku.productCode," \
" sku.productName, sku.productLineCode, sku.productLineName, sku.measuringUnit, td.demandCode," \
" td.createTime, td.auditTime, td.distributionType, td.paymentType, main.paidTime, de.sdocto," \
" de.sdaddj, de.SDOORN from tc_jde_returnall_detail de" \
" left join tc_demand td on de.demandCode = td.demandCode" \
" left join tc_demand_sku sku on sku.demandCode = de.demandCode and " \
"sku.lineNumber = de.demandLineNumber" \
" left join tc_demand_main main on main.demandParentId = td.demandParentId" \
" left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId" \
" left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId" \
" where de.sdocto != 'SN'" \
" and td.demandId is not null" \
" and td.sellerCompanyCode = '00102'" \
" order by de.SDTRDJ desc) tmp_count order by createTime asc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict23", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_退货明细列表_降序,34,34-24,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按退电商下单时间降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url24")
request_body = commonFuc().get_business_data(module, "payload24")
"""
场景: 电商下单时间排序功能验证_退货明细列表_降序
用例名称:电商下单时间排序功能验证_退货明细列表_降序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电扇下单时间降序查询对应的退货明细信息
sql = "select * " \
"from (select de.SDDOCO, de.SDTRDJ, td.customerCode, td.customerName, de.SHIR01, de.SDPMPN, de.qwdsc, " \
"sku.productCode," \
" sku.productName, sku.productLineCode, sku.productLineName, sku.measuringUnit, td.demandCode," \
" td.createTime, td.auditTime, td.distributionType, td.paymentType, main.paidTime, de.sdocto," \
" de.sdaddj, de.SDOORN from tc_jde_returnall_detail de" \
" left join tc_demand td on de.demandCode = td.demandCode" \
" left join tc_demand_sku sku on sku.demandCode = de.demandCode and " \
"sku.lineNumber = de.demandLineNumber" \
" left join tc_demand_main main on main.demandParentId = td.demandParentId" \
" left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId" \
" left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId" \
" where de.sdocto != 'SN'" \
" and td.demandId is not null" \
" and td.sellerCompanyCode = '00102'" \
" order by de.SDTRDJ desc) tmp_count order by createTime desc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict24", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_销售明细列表_升序,34,34-9,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商下单时间升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url9")
request_body = commonFuc().get_business_data(module, "payload9")
"""
场景: 电商下单时间排序功能验证_销售明细列表_升序
用例名称:电商下单时间排序功能验证_销售明细列表_升序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电扇下单时间升序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by createTime asc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict9", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商下单时间排序功能验证_销售明细列表_降序,34,34-10,sit,be
主数据平台:后台运营系统销售明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商下单时间降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url10")
request_body = commonFuc().get_business_data(module, "payload10")
"""
场景: 电商下单时间排序功能验证_销售明细列表_降序
用例名称:电商下单时间排序功能验证_销售明细列表_降序
输出:{"demandParentCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取销售明细列表
result = json.loads(result.content)
result = {"demandParentCode": result["data"]["list"][0]["demandParentCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电扇下单时间降序查询对应的销售明细信息
sql = "select * from (select main.demandParentCode,subtd.sellerCompanyCode as companyCode,subtd.sellerCompanyName,subtd.demandCode,td.createTime,td.auditTime,subtd.distributionType,td.paymentType, main.paidTime,jd.SDDOCO as soCode,jd.SDTRDJ, subtd.customerCode,subtd.customerName,subsku.productCode,subsku.productName, subsku.materialCode,subsku.optionStr,subsku.manufacturer,subtd.productLineCode,subtd.productLineName,subsku.measuringUnit,subsku.sendQuantity,jd.DTTUPRC,jd.DTTAEXP,jd.SDUPRC,jd.SDAEXP, jd.IOLOT1,jd.SDLOTN,jd.FCD01,jd.IOMMEJ ,jd.SDADDJ,jd.SDDCTO ,jd.SDSOQS, jd.QWDSC, jd.SDPMPN, subsku.price, subsku.promotionPrice, (subsku.realPay/subsku.quantity) as realUnitPrice, subsku.price*jd.SDSOQS as originalTotalAmount, subsku.promotionPrice*jd.SDSOQS as rebateTotalAmount, (subsku.realPay/subsku.quantity)*jd.SDSOQS as realTotalAmount, subsku.manufacturerUserNo,subsku.manufacturerUserDesc,subsku.manufacturerProductNo,subsku.manufacturerProductDesc, if(subsku.manufacturerUserNo is not null,if(mu.id is null,1,0),0) as manufacturerUserDeleteSign, if(subsku.manufacturerProductNo is not null,if(mp.id is null,1,0),0) as manufacturerProductDeleteSign from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode inner join tc_demand td on jd.demandCode = td.demandCode inner join tc_demand_main main on subsku.demandParentId = main.demandParentId left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId where subtd.demandId is not null and subtd.sellerCompanyCode = '00102' order by td.createTime desc) tmp_count order by createTime desc"
demandParentCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict10", demandParentCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商审核日期排序功能验证_退货明细列表_升序,34,34-25,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商审核日期升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url25")
request_body = commonFuc().get_business_data(module, "payload25")
"""
场景: 电商审核日期排序功能验证_退货明细列表_升序
用例名称:电商审核日期排序功能验证_退货明细列表_升序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商审核日期升序查询对应的退货明细信息
sql = "select * " \
"from (select de.SDDOCO, de.SDTRDJ, td.customerCode, td.customerName, de.SHIR01, de.SDPMPN, de.qwdsc, " \
"sku.productCode," \
" sku.productName, sku.productLineCode, sku.productLineName, sku.measuringUnit, td.demandCode," \
" td.createTime, td.auditTime, td.distributionType, td.paymentType, main.paidTime, de.sdocto," \
" de.sdaddj, de.SDOORN from tc_jde_returnall_detail de" \
" left join tc_demand td on de.demandCode = td.demandCode" \
" left join tc_demand_sku sku on sku.demandCode = de.demandCode and " \
"sku.lineNumber = de.demandLineNumber" \
" left join tc_demand_main main on main.demandParentId = td.demandParentId" \
" left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId" \
" left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId" \
" where de.sdocto != 'SN'" \
" and td.demandId is not null" \
" and td.sellerCompanyCode = '00102'" \
" order by de.SDTRDJ desc) tmp_count order by auditTime asc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict25", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商审核日期排序功能验证_退货明细列表_降序,34,34-26,sit,be
主数据平台:后台运营系统获取退货明细列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商审核日期降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url26")
request_body = commonFuc().get_business_data(module, "payload26")
"""
场景: 电商审核日期排序功能验证_退货明细列表_降序
用例名称:电商审核日期排序功能验证_退货明细列表_降序
输出:{"returnGoodCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取退货明细信息
result = json.loads(result.content)
result = {"returnGoodCode": result["data"]["list"][0]["returnGoodCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商审核日期降序查询对应的退货明细信息
sql = "select * " \
"from (select de.SDDOCO, de.SDTRDJ, td.customerCode, td.customerName, de.SHIR01, de.SDPMPN, de.qwdsc, " \
"sku.productCode," \
" sku.productName, sku.productLineCode, sku.productLineName, sku.measuringUnit, td.demandCode," \
" td.createTime, td.auditTime, td.distributionType, td.paymentType, main.paidTime, de.sdocto," \
" de.sdaddj, de.SDOORN from tc_jde_returnall_detail de" \
" left join tc_demand td on de.demandCode = td.demandCode" \
" left join tc_demand_sku sku on sku.demandCode = de.demandCode and " \
"sku.lineNumber = de.demandLineNumber" \
" left join tc_demand_main main on main.demandParentId = td.demandParentId" \
" left join tc_manufacturer_user mu on mu.id = sku.manufacturerUserId" \
" left join tc_manufacturer_product mp on mp.id = sku.manufacturerProductId" \
" where de.sdocto != 'SN'" \
" and td.demandId is not null" \
" and td.sellerCompanyCode = '00102'" \
" order by de.SDTRDJ desc) tmp_count order by auditTime desc"
returnGoodCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict26", returnGoodCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商审核时间排序功能验证_返利使用报表列表_升序,34,34-33,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商审核时间升序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url33")
request_body = commonFuc().get_business_data(module, "payload33")
"""
场景: 电商审核时间排序功能验证_返利使用报表列表_升序
用例名称:电商审核时间排序功能验证_返利使用报表列表_升序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商审核时间升序查询对应的返利使用信息
sql = "select demandCode from (select auditTime, demandCode " \
" from (select subtd.demandCode, td.auditTime from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku " \
" on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null " \
" and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count) t order by auditTime asc "
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict33", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc电商审核时间排序功能验证_返利使用报表列表_降序,34,34-34,sit,be
主数据平台:后台运营系统获取返利使用报表列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_34st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步按电商审核时间降序排列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url34")
request_body = commonFuc().get_business_data(module, "payload34")
"""
场景: 电商审核时间排序功能验证_返利使用报表列表_降序
用例名称:电商审核时间排序功能验证_返利使用报表列表_降序
输出:{"demandCode":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取返利使用报表信息
result = json.loads(result.content)
result = {"demandCode": result["data"]["list"][0]["demandCode"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 数据库操作
mysql_handle = mySql()
# 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db_be")
# 在数据库中按电商审核时间降序查询对应的返利使用信息
sql = "select demandCode from (select auditTime, demandCode " \
" from (select subtd.demandCode, td.auditTime from tc_jde_580_jde jd inner join tc_demand_sub_sku subsku " \
" on jd.demandSubCode = subsku.demandSubCode and jd.SDKCOO = subsku.sellerCompanyCode and " \
" jd.SDLTTR < 980 and jd.subLineNumber = subsku.subLineNumber " \
" inner join tc_demand_sub subtd on subsku.demandSubCode = subtd.demandSubCode " \
" inner join tc_demand td on jd.demandCode = td.demandCode " \
" inner join tc_demand_main main on subsku.demandParentId = main.demandParentId " \
" left join tc_manufacturer_user mu on mu.id = subsku.manufacturerUserId " \
" left join tc_manufacturer_product mp on mp.id = subsku.manufacturerProductId " \
" where subtd.demandId is not null " \
" and subtd.sellerCompanyCode = '00102' " \
" and ((subsku.promotionPrice is not null and subsku.promotionPrice > 0) or (subtd.rebateAmount > 0)) " \
" order by td.createTime desc) tmp_count) t order by auditTime desc "
demandCode = mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict34", demandCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, 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