Ejemplo n.º 1
0
 def test_8(self, login_fix, merchant_login_fix):
     '''单笔放款到银行卡'''
     s = login_fix
     ms = merchant_login_fix
     sj = SF()
     DF = DRG_func(s)
     DM = Drg_merchant(ms)
     #运营端修改商户出金方式为银行卡
     licenceSerialNumber = time.strftime("%Y%m%d%H%M%S")
     smscode = licenceSerialNumber[2:8]
     DF.login_sucess(smscode)
     bankBranchCode = sj.phone()
     # 出金模式银行卡:BANK_CARD
     # 出金模式小程序钱包:APPLET_WALLET
     issuType = "BANK_CARD"
     result = DF.merchant_editDetail_bybankcard(issuType, bankBranchCode)
     #商户端单笔放款到银行卡
     issuname = "郑国"
     issuidCard = "350181199006012155"
     issuamount = "2"
     accountNumber = '6232111820006508170'
     sql = 'select * FROM spman_center.task where  merchant_name = "极限传媒" and status = 1 order by id desc limit 1;'
     r = select_taskid_number(sql)
     taskId = str(r[0]["id"])
     result1 = DM.issu_by_bankcard(issuname, issuidCard, issuamount,
                                   accountNumber, taskId)
     batchNo = result1["data"]["batchNo"]
     result2 = DM.batchIssu_loan(batchNo)
     assert result2["message"]["content"] == "处理中, 请稍后..."
Ejemplo n.º 2
0
def merchant_login_fix():
    s = requests.session()
    username = "******"
    password = "******"
    DM = Drg_merchant(s)
    DM.merchant_login(username, password)
    return s
Ejemplo n.º 3
0
 def test_1(self,merchant_login_fix,test_input,expect):
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     sf = SF()
     channelOrderNumber = sf.channelOrderNumber()
     result = DM.merchant_recharge(test_input,channelOrderNumber)
     assert result["message"]["content"] == expect["message"]["content"]
Ejemplo n.º 4
0
 def test_1(self, login_fix, merchant_login_fix):
     '''确认充值订单'''
     s = login_fix
     ms = merchant_login_fix
     sf = SF()
     channelOrderNumber = sf.channelOrderNumber()
     DM = Drg_merchant(ms)
     DF = DRG_func(s)
     paytime = time.strftime("%Y" + "-" + "%m" + "-" + "%d" + " " + "%H" +
                             ":" + "%M" + ":" + "%S")
     #查询是否有未确认订单
     r1 = DF.all_wait_order()
     #如果等于0
     if r1 == 0:
         #商户端新增充值
         DM.merchant_recharge(channelOrderNumber)
         #运营端确认订单
         sysnb = DF.wait_order()
         sysnumber = sysnb["data"]["resultList"]["dataList"][0][
             "systemOrderNumber"]
         result = DF.sucess_order(paytime, sysnumber)
         assert result["message"]["content"] == "确认成功"
     else:
         #不等于0查询系统单号,确认订单
         sysnb = DF.wait_order()
         sysnumber = sysnb["data"]["resultList"]["dataList"][0][
             "systemOrderNumber"]
         result = DF.sucess_order(paytime, sysnumber)
         assert result["message"]["content"] == "确认成功"
Ejemplo n.º 5
0
 def test_merchant_username(self):
     '''商户端用户名登录测试'''
     s = requests.session()
     username = "******"
     password = "******"
     DM = Drg_merchant(s)
     rsp = DM.merchant_login(username, password)
     assert "未知账号,请联系管理" in rsp
Ejemplo n.º 6
0
 def test_mechant_password(self):
     '''商户端用户密码错误测试'''
     s = requests.session()
     username = "******"
     password = "******"
     DM = Drg_merchant(s)
     rsp = DM.merchant_login(username, password)
     assert "密码错误" in rsp
Ejemplo n.º 7
0
 def test_login_sucess(self):
     '''商户登录成功'''
     s = requests.session()
     username = "******"
     password = "******"
     DM = Drg_merchant(s)
     DM.merchant_login(username, password)
     rsp = DM.merchant_user_info()
     assert "极限传媒" in rsp
Ejemplo n.º 8
0
 def test_3(self, merchant_login_fix):
     '''批量新增用户'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     #批量新增用户
     response = DM.user_import()
     batchNo = response["data"]["batchNo"]
     # 通过批次号注册用户信息
     result = DM.user_batchRegister(batchNo)
     assert result["message"]["content"] == "正在注册..."
Ejemplo n.º 9
0
 def test_6(self, merchant_login_fix):
     '''新增和删除邮寄地址'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     #新增邮寄地址
     result1 = DM.address_addAddress()
     result2 = DM.address_findpage()
     id = result2["data"]["dataList"][4]["id"]
     #删除邮寄地址
     result3 = DM.def_address(id)
     assert result3["message"]["content"] == "操作成功"
Ejemplo n.º 10
0
 def test_5(self, merchant_login_fix):
     '''批量放款'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     sql = 'select * FROM spman_center.task where  merchant_name = "极限传媒" and status = 1 order by id desc limit 1;'
     r = select_taskid_number(sql)
     taskId = str(r[0]["id"])
     result1 = DM.batchIssus_form(taskId)
     batchNo = result1["data"]["batchNo"]
     result2 = DM.batchIssu_loan(batchNo)
     assert result2["message"]["content"] == "处理中, 请稍后..."
Ejemplo n.º 11
0
 def test_2(self, merchant_login_fix):
     '''新增用户'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     name = sj.name()
     idcard = sj.idcard()
     mobile = sj.phone()
     #上传用户信息返回批次号
     response = DM.add_user(name, idcard, mobile)
     batchNo = response["data"]["batchNo"]
     #通过批次号注册用户信息
     result = DM.user_batchRegister(batchNo)
     assert result["message"]["content"] == "正在注册..."
Ejemplo n.º 12
0
 def test_4(self, merchant_login_fix):
     '''单笔放款'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     issuname = "郑国"
     issuidCard = "350181199006012155"
     issuamount = "1"
     sql = 'select * FROM spman_center.task where  merchant_name = "极限传媒" and status = 1 order by id desc limit 1;'
     r = select_taskid_number(sql)
     taskId = str(r[0]["id"])
     result1 = DM.batchIssu_form(issuname, issuidCard, issuamount, taskId)
     batchNo = result1["data"]["batchNo"]
     result2 = DM.batchIssu_loan(batchNo)
     assert result2["message"]["content"] == "处理中, 请稍后..."
Ejemplo n.º 13
0
    def test_1(self, merchant_login_fix, login_fix):
        '''开票申请'''
        sf = SF()
        channelOrderNumber = sf.channelOrderNumber()
        amount = sf.day()
        s = login_fix
        DF = DRG_func(s)
        paytime = time.strftime("%Y" + "-" + "%m" + "-" + "%d" + " " + "%H" +
                                ":" + "%M" + ":" + "%S")
        ms = merchant_login_fix
        DM = Drg_merchant(ms)
        #查询是否有开票充值记录
        r = DM.rechargeOrder_wait()
        rechargeCount = r["data"]["rechargeCount"]
        #判断充值记录为0的情况下
        if rechargeCount == 0:
            #新增充值记录
            print("新增充值")
            DM.merchant_recharge(amount, channelOrderNumber)
            #运营端确认
            sysnumber1 = DF.wait_order()
            sysnumber = sysnumber1["data"]["resultList"]["dataList"][0][
                "systemOrderNumber"]
            DF.sucess_order(paytime, sysnumber)
            print("运营端确认充值记录")
            # 查询开票充值几率不为0的情况下开票申请,先查询出开票充值记录里面的充值金额和系统单号
            recharge_detail = DM.rechargeOrder_wait()
            totalAmount = recharge_detail["data"]["resultList"]["dataList"][0][
                "amountStr"]
            s_totalAmount = recharge_detail["data"]["resultList"]["dataList"][
                0]["amountStr"]
            systemOrderNumbers = recharge_detail["data"]["resultList"][
                "dataList"][0]["systemOrderNumber"]
            print("查询开票充值记录,返回税价合计金额、放款单号")
            # 提交开票申请
            result = DM.invoice_apply(totalAmount, systemOrderNumbers,
                                      s_totalAmount)
            print("提交开票申请成功")
            assert result["message"]["content"] == "操作成功"

        else:
            #不为0的情况下开票申请,先查询出开票充值记录里面的充值金额和系统单号
            print("查询开票充值记录,返回税价合计金额、放款单号")
            recharge_detail = DM.rechargeOrder_wait()
            totalAmount = recharge_detail["data"]["resultList"]["dataList"][0][
                "amountStr"]
            s_totalAmount = recharge_detail["data"]["resultList"]["dataList"][
                0]["amountStr"]
            systemOrderNumbers = recharge_detail["data"]["resultList"][
                "dataList"][0]["systemOrderNumber"]
            #提交开票申请
            result = DM.invoice_apply(totalAmount, systemOrderNumbers,
                                      s_totalAmount)
            print("提交开票申请成功")
            assert result["message"]["content"] == "操作成功"
Ejemplo n.º 14
0
 def test_7(self, merchant_login_fix):
     '''取消订单'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     issuname = "张飞"
     issuidCard = "320123198507124578"
     issuamount = "1"
     sql = 'select * FROM spman_center.task where  merchant_name = "极限传媒" and status = 1 order by id desc limit 1;'
     r = select_taskid_number(sql)
     taskId = str(r[0]["id"])
     #放款未实名用户
     result1 = DM.batchIssu_form(issuname, issuidCard, issuamount, taskId)
     batchNo = result1["data"]["batchNo"]
     #放款成功,订单状态为,未放款-待支付
     DM.batchIssu_loan(batchNo)
     #通过批次号查询放款详情,获取充值单号systemOrderNumber
     result2 = DM.issu_detail_batchNumber(batchNo)
     time.sleep(1)
     systemOrderNumber = result2["data"]["dataList"][0]["systemOrderNumber"]
     #通过systemOrderNumber取消订单
     result3 = DM.issu_cancel(systemOrderNumber)
     assert result3["message"]["content"] == "取消成功"
Ejemplo n.º 15
0
 def test_10(self, login_fix, merchant_login_fix):
     '''保存订单至:未支付-待放款后,放款至银行卡'''
     s = login_fix
     ms = merchant_login_fix
     sj = SF()
     DF = DRG_func(s)
     DM = Drg_merchant(ms)
     # 运营端修改商户出金方式为银行卡
     licenceSerialNumber = time.strftime("%Y%m%d%H%M%S")
     smscode = licenceSerialNumber[2:8]
     DF.login_sucess(smscode)
     bankBranchCode = sj.phone()
     # 出金模式银行卡:BANK_CARD
     # 出金模式小程序钱包:APPLET_WALLET
     issuType = "BANK_CARD"
     result = DF.merchant_editDetail_bybankcard(issuType, bankBranchCode)
     # 商户端单笔放款到银行卡
     issuname = "郑国"
     issuidCard = "350181199006012155"
     issuamount = "2"
     accountNumber = '6232111820006508170'
     sql = 'select * FROM spman_center.task where  merchant_name = "极限传媒" and status = 1 order by id desc limit 1;'
     r = select_taskid_number(sql)
     taskId = str(r[0]["id"])
     result1 = DM.issu_by_bankcard(issuname, issuidCard, issuamount,
                                   accountNumber, taskId)
     batchNo = result1["data"]["batchNo"]
     #保存验证成功订单
     result2 = DM.save_Verify_SuccessOrder(batchNo)
     #查询订单详情
     result3 = DM.SuccessOrder_list(batchNo)
     #查询放款单号
     systemOrderNumbers = result3["data"]["dataList"][0][
         "systemOrderNumber"]
     #未支付-待放款后,放款至银行卡
     result4 = DM.preSave_Loan(systemOrderNumbers)
     assert result4["message"]["content"] == "处理中, 请稍后..."
Ejemplo n.º 16
0
 def test_6(self, merchant_login_fix):
     '''批量放款记录'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.batchIssu_list()
     assert result["data"]["success"] == True
Ejemplo n.º 17
0
 def test_3(self, merchant_login_fix):
     '''未放款-待支付'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.issu_unpaid()
     assert result["data"]["success"] == True
Ejemplo n.º 18
0
 def test_2(self, merchant_login_fix):
     '''放款详情页面-放款单号查询'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.issu_detail_systemOrderNumber()
     assert result["data"]["batchNumber"] == "BATCH00001930"
Ejemplo n.º 19
0
 def test_3(self, merchant_login_fix):
     '''已开发票'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.info_list()
     assert result["data"]["count"] > 0
Ejemplo n.º 20
0
 def test_3(self,merchant_login_fix):
     '''充值记录详情页面'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.rechargeOrder_detail()
     assert result["data"]["systemOrderNumber"] == "10200512180603020000002137"
Ejemplo n.º 21
0
 def test_1(self, merchant_login_fix):
     '''商户信息'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.account_merchantInfo()
     assert result["message"]["content"] == "获取商户用户信息成功"
Ejemplo n.º 22
0
 def test_5(self, merchant_login_fix):
     '''邮寄地址'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.address_findpage()
     assert result["message"]["content"] == "查询成功"
Ejemplo n.º 23
0
 def test_4(self, merchant_login_fix):
     '''已开发票详情'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.info_detail()
     assert result["data"]["merchantName"] == "极限传媒"
Ejemplo n.º 24
0
 def test_1(self, merchant_login_fix):
     ''''放款列表'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.issu_list()
     assert result["data"]["success"] == True
Ejemplo n.º 25
0
 def test_1(self, merchant_login_fix):
     '''用户列表'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.user_list()
     assert result["message"]["content"] == "查询成功"
Ejemplo n.º 26
0
 def test_2(self, merchant_login_fix):
     '''申请记录'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.apply_list()
     assert result["message"]["content"] == "查询成功"
Ejemplo n.º 27
0
 def test_2(self,merchant_login_fix):
     '''查询充值管理'''
     ms = merchant_login_fix
     DM = Drg_merchant(ms)
     result = DM.rechargeOrder_list()
     assert result["data"]["rechargeCount"] > 0
Ejemplo n.º 28
0
 def test_5(self, login_fix, merchant_login_fix):
     '''开票申请'''
     s = login_fix
     ms = merchant_login_fix
     sj = SF()
     DF = DRG_func(s)
     DM = Drg_merchant(ms)
     #运营端开票时间
     invoiceDate = time.strftime("%Y" + "-" + "%m" + "-" + "%d" + " " +
                                 "%H" + ":" + "%M" + ":" + "%S")
     #发票代码
     invoiceCode = sj.phone()
     #发票号码
     invoiceNumber = sj.phone()
     #快递单号
     emsOrderNumber = sj.phone()
     #商户端充值通道单号(随机生成)
     channelOrderNumber = sj.channelOrderNumber()
     #商户端充值金额
     recharge_amount = sj.day()
     #---------运营端确认充值订单,查询放款单号-------------------------------------------------
     sysnumber1 = DF.wait_order()
     sysnumber = sysnumber1["data"]["resultList"]["dataList"][0][
         "systemOrderNumber"]
     # ----------商户端,查询出开票充值记录里面的充值金额和系统单号---------------------------------
     recharge_detail = DM.rechargeOrder_wait()
     m_totalAmount = recharge_detail["data"]["resultList"]["dataList"][0][
         "amountStr"]
     s_totalAmount = recharge_detail["data"]["resultList"]["dataList"][0][
         "amountStr"]  #格式化输出,将字典里面的值参数化
     systemOrderNumbers = recharge_detail["data"]["resultList"]["dataList"][
         0]["systemOrderNumber"]
     #-------查询是否有待处理开票订单-------------------------------------------------------------------------------------
     applyStatus = 'WAIT'
     apply = DF.invoice_apply_list(applyStatus)
     apply_result = apply["data"]["count"]
     if apply_result == 0:
         #新增开票申请
         # ------查询是否有开票充值记录-----
         r = DM.rechargeOrder_wait()
         rechargeCount = r["data"]["rechargeCount"]
         # 判断充值记录为0的情况下
         if rechargeCount == 0:
             # 新增充值记录
             DM.merchant_recharge(recharge_amount, channelOrderNumber)
             # 运营端确认
             DF.sucess_order(invoiceDate, sysnumber)
             # 商户端提交开票申请
             DM.invoice_apply(m_totalAmount, systemOrderNumbers,
                              s_totalAmount)
             # 运营端新增开票信息
             # --------运营端查询,返回税价合计金额、批次号、用户编号、根据税价合计计算出 金额和 税额-----------
             applyStatus = 'WAIT'
             r2 = DF.invoice_apply_list(applyStatus)
             totalAmount1 = r2["data"]["resultList"]["dataList"][0][
                 "totalAmount"]  # 获取税价合计金额,类型为 str
             batchNumber = r2["data"]["resultList"]["dataList"][0][
                 "batchNumber"]  # 获取批次号
             merchantNumber = r2["data"]["resultList"]["dataList"][0][
                 "merchantNumber"]  # 获取用户编号
             f_totalAmount = float(totalAmount1)  # 类型为str的金额转化为 浮点型
             y_totalAmount = round(f_totalAmount, 2)  # 浮点型 税价合计金额 四舍五入
             f_amount = y_totalAmount / (1 + 0.1)  # 税率10%
             amount = round(f_amount, 2)  # 金额
             f_taxAmount = y_totalAmount - amount
             taxAmount = round(f_taxAmount, 2)  # 税额
             # 申请合并开票
             r3 = DF.invoice_merger(batchNumber, merchantNumber)
             # 查询开票中订单
             applyStatus = 'HANDLE'
             r4 = DF.invoice_apply_list(applyStatus)
             # 返回合并开票批次号 invoiceBatchNumber
             invoiceBatchNumber = r4["data"]["resultList"]["dataList"][0][
                 "invoiceBatchNumber"]
             DF.invoice_add(invoiceCode, invoiceDate, invoiceNumber,
                            taxAmount, y_totalAmount, amount,
                            invoiceBatchNumber, merchantNumber)
             # 填写快递单号,确认开票申请
             result = DF.invoice_addEmsInfo(batchNumber, merchantNumber,
                                            invoiceBatchNumber,
                                            emsOrderNumber)
             assert result["message"]["content"] == "操作成功"
         else:
             # 商户端提交开票申请
             DM.invoice_apply(m_totalAmount, systemOrderNumbers,
                              s_totalAmount)
             # 运营端新增开票信息
             # --------运营端查询,返回税价合计金额、批次号、用户编号、根据税价合计计算出 金额和 税额-----------
             applyStatus = 'WAIT'
             r2 = DF.invoice_apply_list(applyStatus)
             totalAmount1 = r2["data"]["resultList"]["dataList"][0][
                 "totalAmount"]  # 获取税价合计金额,类型为 str
             batchNumber = r2["data"]["resultList"]["dataList"][0][
                 "batchNumber"]  # 获取批次号
             merchantNumber = r2["data"]["resultList"]["dataList"][0][
                 "merchantNumber"]  # 获取用户编号
             f_totalAmount = float(totalAmount1)  # 类型为str的金额转化为 浮点型
             y_totalAmount = round(f_totalAmount, 2)  # 浮点型 税价合计金额 四舍五入
             f_amount = y_totalAmount / (1 + 0.1)  # 税率10%
             amount = round(f_amount, 2)  # 金额
             f_taxAmount = y_totalAmount - amount
             taxAmount = round(f_taxAmount, 2)  # 税额
             # 申请合并开票
             r3 = DF.invoice_merger(batchNumber, merchantNumber)
             # 查询开票中订单
             applyStatus = 'HANDLE'
             r4 = DF.invoice_apply_list(applyStatus)
             # 返回合并开票批次号 invoiceBatchNumber
             invoiceBatchNumber = r4["data"]["resultList"]["dataList"][0][
                 "invoiceBatchNumber"]
             DF.invoice_add(invoiceCode, invoiceDate, invoiceNumber,
                            taxAmount, y_totalAmount, amount,
                            invoiceBatchNumber, merchantNumber)
             # 填写快递单号,确认开票申请
             result = DF.invoice_addEmsInfo(batchNumber, merchantNumber,
                                            invoiceBatchNumber,
                                            emsOrderNumber)
             assert result["message"]["content"] == "操作成功"
     else:
         # 运营端新增开票信息
         # --------运营端查询,返回税价合计金额、批次号、用户编号、根据税价合计计算出 金额和 税额-----------
         applyStatus = 'WAIT'
         r2 = DF.invoice_apply_list(applyStatus)
         totalAmount1 = r2["data"]["resultList"]["dataList"][0][
             "totalAmount"]  # 获取税价合计金额,类型为 str
         batchNumber = r2["data"]["resultList"]["dataList"][0][
             "batchNumber"]  # 获取批次号
         merchantNumber = r2["data"]["resultList"]["dataList"][0][
             "merchantNumber"]  # 获取用户编号
         f_totalAmount = float(totalAmount1)  # 类型为str的金额转化为 浮点型
         y_totalAmount = round(f_totalAmount, 2)  # 浮点型 税价合计金额 四舍五入
         f_amount = y_totalAmount / (1 + 0.1)  # 税率10%
         amount = round(f_amount, 2)  # 金额
         f_taxAmount = y_totalAmount - amount
         taxAmount = round(f_taxAmount, 2)  # 税额
         # 申请合并开票
         r3 = DF.invoice_merger(batchNumber, merchantNumber)
         # 查询开票中订单
         applyStatus = 'HANDLE'
         r4 = DF.invoice_apply_list(applyStatus)
         # 返回合并开票批次号 invoiceBatchNumber
         invoiceBatchNumber = r4["data"]["resultList"]["dataList"][0][
             "invoiceBatchNumber"]
         DF.invoice_add(invoiceCode, invoiceDate, invoiceNumber, taxAmount,
                        y_totalAmount, amount, invoiceBatchNumber,
                        merchantNumber)
         # 填写快递单号,确认开票申请
         result = DF.invoice_addEmsInfo(batchNumber, merchantNumber,
                                        invoiceBatchNumber, emsOrderNumber)
         assert result["message"]["content"] == "操作成功"
Ejemplo n.º 29
0
from common.common_func import DRG_func
from common.common_func_merchant import Drg_merchant
import requests
from aip import AipOcr
import datetime
import time
""" 你的 APPID AK SK """
APP_ID = '19611635'
API_KEY = '5kn9XvSsF19BPNuTtYeuPghP'
SECRET_KEY = 'oRAxD3tm0ducNoF3dbzaVfBh9EQHiP6W'
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

s = requests.session()
#DF = DRG_func(s)
DM = Drg_merchant(s)
DM.merchant_login(username='******', password='******')

#获取图片验证码,毫秒级时间戳
t = int(time.time() * 1000)
smscode = 'https://spman.shb02.net/common/jcaptcha/create?%s' % t
respnose = s.get(smscode)

#图片验证码存储路径
path = 'F:\\dx.jpg'
with open(path, 'wb') as f:
    f.write(respnose.content)
    f.close()
""" 读取图片 """


def get_file_content(filePath):
Ejemplo n.º 30
0
    def test_6(self, login_fix, merchant_login_fix):
        '''驳回开票申请'''
        s = login_fix
        ms = merchant_login_fix
        sj = SF()
        DF = DRG_func(s)
        DM = Drg_merchant(ms)
        #--------------充值订单确认时间-------------------------------------------------------
        invoiceDate = time.strftime("%Y" + "-" + "%m" + "-" + "%d" + " " +
                                    "%H" + ":" + "%M" + ":" + "%S")
        # ---------运营端确认充值订单,查询放款单号-------------------------------------------------
        sysnumber1 = DF.wait_order()
        sysnumber = sysnumber1["data"]["resultList"]["dataList"][0][
            "systemOrderNumber"]
        # 商户端充值通道单号(随机生成)
        channelOrderNumber = sj.channelOrderNumber()
        # 商户端充值金额
        recharge_amount = sj.day()
        #------查询是否有待处理开票订单----------------
        applyStatus = 'WAIT'
        apply = DF.invoice_apply_list(applyStatus)
        apply_result = apply["data"]["count"]
        if apply_result == 0:
            # 新增开票申请
            # ------查询是否有开票充值记录-----
            r = DM.rechargeOrder_wait()
            rechargeCount = r["data"]["rechargeCount"]
            # 判断充值记录为0的情况下
            if rechargeCount == 0:
                # 新增充值记录
                DM.merchant_recharge(recharge_amount, channelOrderNumber)
                # 运营端确认
                DF.sucess_order(invoiceDate, sysnumber)
                # ----------商户端,查询出开票充值记录里面的充值金额和系统单号
                recharge_detail = DM.rechargeOrder_wait()
                m_totalAmount = recharge_detail["data"]["resultList"][
                    "dataList"][0]["amountStr"]
                s_totalAmount = recharge_detail["data"]["resultList"][
                    "dataList"][0]["amountStr"]  # 格式化输出,将字典里面的值参数化
                systemOrderNumbers = recharge_detail["data"]["resultList"][
                    "dataList"][0]["systemOrderNumber"]
                # 商户端提交开票申请
                DM.invoice_apply(m_totalAmount, systemOrderNumbers,
                                 s_totalAmount)
                # --------查询待处理订单,返回批次号和用户编号---------------
                applyStatus = 'WAIT'
                result = DF.invoice_apply_list(applyStatus)
                merchantNumber = result["data"]["resultList"]["dataList"][0][
                    "merchantNumber"]
                batchNumber = result["data"]["resultList"]["dataList"][0][
                    "batchNumber"]
                # 驳回开票申请
                respnose = DF.unpass_invoice(batchNumber, merchantNumber)
                assert respnose["message"]["content"] == "操作成功"

            else:
                # ----------商户端,查询出开票充值记录里面的充值金额和系统单号
                recharge_detail = DM.rechargeOrder_wait()
                m_totalAmount = recharge_detail["data"]["resultList"][
                    "dataList"][0]["amountStr"]
                s_totalAmount = recharge_detail["data"]["resultList"][
                    "dataList"][0]["amountStr"]  # 格式化输出,将字典里面的值参数化
                systemOrderNumbers = recharge_detail["data"]["resultList"][
                    "dataList"][0]["systemOrderNumber"]
                # 商户端提交开票申请
                DM.invoice_apply(m_totalAmount, systemOrderNumbers,
                                 s_totalAmount)
                # --------查询待处理订单,返回批次号和用户编号---------------
                applyStatus = 'WAIT'
                result = DF.invoice_apply_list(applyStatus)
                merchantNumber = result["data"]["resultList"]["dataList"][0][
                    "merchantNumber"]
                batchNumber = result["data"]["resultList"]["dataList"][0][
                    "batchNumber"]
                # 驳回开票申请
                respnose = DF.unpass_invoice(batchNumber, merchantNumber)
                assert respnose["message"]["content"] == "操作成功"

        else:
            # --------查询待处理订单,返回批次号和用户编号---------------
            applyStatus = 'WAIT'
            result = DF.invoice_apply_list(applyStatus)
            merchantNumber = result["data"]["resultList"]["dataList"][0][
                "merchantNumber"]
            batchNumber = result["data"]["resultList"]["dataList"][0][
                "batchNumber"]
            # 驳回开票申请
            respnose = DF.unpass_invoice(batchNumber, merchantNumber)
            assert respnose["message"]["content"] == "操作成功"