当前位置: 首页>>代码示例>>Python>>正文


Python AfaFunc.autoPackData方法代码示例

本文整理汇总了Python中AfaFunc.autoPackData方法的典型用法代码示例。如果您正苦于以下问题:Python AfaFunc.autoPackData方法的具体用法?Python AfaFunc.autoPackData怎么用?Python AfaFunc.autoPackData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AfaFunc的用法示例。


在下文中一共展示了AfaFunc.autoPackData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):


    AfaLoggerFunc.tradeInfo('***农信银系统: 往账.回执类操作模板['+TradeContext.TemplateCode+'_'+TradeContext.TransCode+']进入***')


    try:
    
        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]


        #=====================获取系统日期时间==================================
        TradeContext.BJEDTE=AfaUtilTools.GetHostDate( )
        #TradeContext.TRCDAT=AfaUtilTools.GetHostDate( )
        #TradeContext.BJEDTE = PL_BJEDTE
        TradeContext.BJETIM=AfaUtilTools.GetSysTime( )
        #TradeContext.TRCDAT = PL_BJEDTE


        #=====================系统公共校验======================================
        if not rccpsFunc.ChkPubInfo(PL_BRSFLG_RCV) :
            raise AfaFlowControl.flowException( )

        #=====================系统状态校验======================================
        if not rccpsFunc.ChkSysInfo( 'AFA' ) :
            raise AfaFlowControl.flowException( )

        #=====================机构合法性校验====================================
        if not rccpsFunc.ChkUnitInfo(PL_BRSFLG_RCV) :
            raise AfaFlowControl.flowException( )

        #=====================获取中心日期====================================
        if not rccpsFunc.GetNCCDate( ) :
            raise AfaFlowControl.flowException( )

        #=====================动态加载交易脚本==================================
        trxModuleName = 'T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode
        try:
            trxModuleHandle=__import__( trxModuleName )

        except Exception, e:
            AfaLoggerFunc.tradeInfo(e)
            raise AfaFlowControl.flowException( 'A0001', '加载交易脚本失败或交易脚本不存在,执行交易失败' )


        #=====================回执个性化处理(本地操作)==========================
        if not trxModuleHandle.SubModuleDoFst( ) :
            raise AfaFlowControl.flowException( )


        #=====================自动打包==========================================
        AfaFunc.autoPackData()


        #=====================退出模板==========================================
        AfaLoggerFunc.tradeInfo('***农信银系统: 往账.回执类操作模板['+TradeContext.TemplateCode+'_'+TradeContext.TransCode+']退出***')
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:59,代码来源:TRCC004.py

示例2: exitMainFlow

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def exitMainFlow( msgStr='' ):

    if( not TradeContext.existVariable( "errorCode" ) or msgStr ):
        TradeContext.errorCode = 'A9999'
        TradeContext.errorMsg = '系统错误['+msgStr+']'

    if TradeContext.errorCode != '0000' :
        AfaLoggerFunc.tradeFatal( 'errorCode=['+TradeContext.errorCode+']' )
        AfaLoggerFunc.tradeFatal( 'errorMsg=['+TradeContext.errorMsg+']' )
        AfaLoggerFunc.tradeFatal(TradeContext.TransCode+'交易中断')

    if( not AfaFunc.autoPackData() ):
        lenContext=len( TradeContext.tradeResponse )
        chkFlag=0
        for i in range( lenContext ):
            if( type(TradeContext.tradeResponse[i][0]) is str and (TradeContext.tradeResponse[i][0]=='errorCode' or TradeContext.tradeResponse[i][0]=='errorMsg')):
                if(TradeContext.tradeResponse[i][0]=='errorCode'):
                    TradeContext.tradeResponse[i][1]=TradeContext.errorCode
                    chkFlag=chkFlag+1
                if(TradeContext.tradeResponse[i][0]=='errorMsg'):
                    TradeContext.tradeResponse[i][1]=TradeContext.errorMsg
                    chkFlag=chkFlag+1
                if(chkFlag>=2):
                    break
            elif i==lenContext-1 :
                TradeContext.tradeResponse.append( [ 'errorCode', TradeContext.errorCode ] )
                TradeContext.tradeResponse.append( [ 'errorMsg', TradeContext.errorMsg ] )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:29,代码来源:AfaFlowControl.py

示例3: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):

    AfaLoggerFunc.tradeInfo('******代收代付.通用轧帐模板[' + TradeContext.TemplateCode + ']进入******' )

    try:

        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]

        #=====================获取当前系统时间==================================
        TradeContext.workDate=AfaUtilTools.GetSysDate( )
        TradeContext.workTime=AfaUtilTools.GetSysTime( )

        #=====================判断应用系统状态==================================
        #if not AfaFunc.ChkSysStatus( ) :
        #    raise AfaFlowControl.flowException( )
                
        #=====================校验公共节点的有效性==============================
        if( not TradeContext.existVariable( "statType" ) ):
            raise AfaFlowControl.flowException( 'A0001', '轧帐类型[statType]值不存在,不能进行轧帐' )

        if( not TradeContext.existVariable( "TransType" ) ):
            raise AfaFlowControl.flowException( 'A0001', '传输类型[TransType]值不存在,不能进行轧帐' )

        AfaLoggerFunc.tradeInfo( '>>>statType  = ' + TradeContext.statType )
        AfaLoggerFunc.tradeInfo( '>>>TransType = ' + TradeContext.TransType)

        #=====================轧帐操作==========================================
        if not StatAccountInfo( TradeContext.statType ) :
            raise AfaFlowControl.flowException( )

        #=====================自动打包==========================================
        TradeContext.tradeResponse.append( ['errorCode',     '0000'] )
        TradeContext.tradeResponse.append( ['errorMsg',      '交易成功'] )

        AfaFunc.autoPackData()

        #=====================退出模板==========================================
        AfaLoggerFunc.tradeInfo( '******代收代付.通用轧帐模板[' + TradeContext.TemplateCode + ']退出******' )

    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( str(e) )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:44,代码来源:T003102.py

示例4: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):

    AfaLoggerFunc.tradeInfo('********安徽省新农保.批量模板['+TradeContext.TemplateCode+']进入********')

    try:
    
        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]

       
        #=====================获取系统日期时间==================================
        TradeContext.WorkDate=AfaUtilTools.GetSysDate( )
        TradeContext.WorkTime=AfaUtilTools.GetSysTime( )
        
        #=====================判断应用系统状态==================================
        if not AfaFunc.ChkSysStatus( ) :
            raise AfaFlowControl.flowException( )


        #=====================动态加载交易脚本==================================
        trxModuleName = 'T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode
        try:
            trxModuleHandle=__import__( trxModuleName )

        except Exception, e:
            AfaLoggerFunc.tradeInfo(e)
            raise AfaFlowControl.flowException( 'A0001', '加载交易脚本失败或交易脚本不存在' )


        #=====================安徽新农保业务个性化操作==========================
        if not trxModuleHandle.TrxMain( ) :
            raise AfaFlowControl.flowException( TradeContext.errorCode,TradeContext.errorMsg)


        #=====================自动打包==========================================
        AfaFunc.autoPackData()


        #=====================退出模板==========================================
        AfaLoggerFunc.tradeInfo('********安徽省新农保.批量模板['+TradeContext.TemplateCode+']退出********')
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:42,代码来源:TAHXNB003.py

示例5: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):


    AfaLoggerFunc.tradeInfo('********abs.通用模板进入********')


    try:
    
        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]

       
        #=====================获取系统日期时间==================================
        TradeContext.TranDate=AfaUtilTools.GetSysDate( )
        TradeContext.TranTime=AfaUtilTools.GetSysTime( )


        #=====================动态加载交易脚本==================================
        trxModuleName = 'T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode
        try:
            trxModuleHandle=__import__( trxModuleName )


        except Exception, e:
            AfaLoggerFunc.tradeInfo(e)
            raise AfaFlowControl.flowException( 'A0001', '加载交易脚本失败或交易脚本不存在' )


        #=====================批量业务个性化操作================================
        if not trxModuleHandle.TrxMain( ) :
            raise AfaFlowControl.accException( )


        #=====================自动打包==========================================
        AfaFunc.autoPackData()


        #=====================退出模板==========================================
        AfaLoggerFunc.tradeInfo('********批量业务.通用模板['+TradeContext.TemplateCode+']退出********')
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:41,代码来源:TABS001.py

示例6: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):

    AfaLoggerFunc.tradeInfo('******柜面对账['+TradeContext.TemplateCode+']进入******')

    try:

        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]
        
        #=====================获取当前系统时间==================================
        TradeContext.workDate=AfaUtilTools.GetSysDate( )
        TradeContext.workTime=AfaUtilTools.GetSysTime( )
        #=====================柜面对账处理======================================
        admin()
        #=============自动打包====================
        AfaFunc.autoPackData()

        #=====================退出模板==========================================
        AfaLoggerFunc.tradeInfo('******柜面对账['+TradeContext.TemplateCode+']退出******')

    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( str(e) )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:24,代码来源:Tvmenu_admin.py

示例7: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
            TradeContext.billNum = Party3Context.billNum

            if ( TradeContext.TransType=='0' ):
                #变量初始化
                TradeContext.billData = []                  #发票信息
                TradeContext.item1    = []                  #附加项1
                TradeContext.item2    = []                  #附加项2
                TradeContext.item3    = []                  #附加项3
                TradeContext.item4    = []                  #附加项4
                TradeContext.item5    = []                  #附加项5
                TradeContext.item6    = []                  #附加项6
                TradeContext.billserno= []                  #发票序号
                TradeContext.serialno = []                  #中间业务流水号
                TradeContext.prtnum   = []                  #打印次数
                TradeContext.paydate  = []                  #支付日期

                if ( int(Party3Context.billNum) == 1 ):
                    #打包(一张发票)
                        TradeContext.billData   = Party3Context.billData
                        TradeContext.item1      = Party3Context.item1
                        TradeContext.item2      = Party3Context.item2
                        TradeContext.item3      = Party3Context.item3
                        TradeContext.item4      = Party3Context.item4
                        TradeContext.item5      = Party3Context.item5
                        TradeContext.item6      = Party3Context.item6
                        TradeContext.billserno  = Party3Context.billserno
                        TradeContext.serialno   = Party3Context.serialno
                        TradeContext.prtnum     = Party3Context.prtnum
                        TradeContext.paydate    = Party3Context.paydate
                else:
                    #打包(多张发票)
                    for i in range( 0, int(Party3Context.billNum) ):
                        TradeContext.billData.append(Party3Context.billData[i])
                        TradeContext.item1.append(Party3Context.item1[i])
                        TradeContext.item2.append(Party3Context.item2[i])
                        TradeContext.item3.append(Party3Context.item3[i])
                        TradeContext.item4.append(Party3Context.item4[i])
                        TradeContext.item5.append(Party3Context.item5[i])
                        TradeContext.item6.append(Party3Context.item6[i])
                        TradeContext.billserno.append(Party3Context.billserno[i])
                        TradeContext.serialno.append(Party3Context.serialno[i])
                        TradeContext.prtnum.append(Party3Context.prtnum[i])
                        TradeContext.paydate.append(Party3Context.paydate[i])
            else:
                MxFileName = os.environ['AFAP_HOME'] + '/tmp/MX' + TradeContext.zoneno + TradeContext.brno + TradeContext.tellerno + '.TXT'
                AfaLoggerFunc.tradeInfo('>>>明细文件:['+MxFileName+']')

                if (os.path.exists(MxFileName) and os.path.isfile(MxFileName)):
                    #文件存在,先删除-再创建
                    os.system("rm " + MxFileName)

                #创建明细文件
                sfp = open(MxFileName, "w")

                if ( int(Party3Context.billNum) == 1 ):
                    #打包(一张发票)
                        wBuffer = ""
                        wBuffer = wBuffer + Party3Context.billData
                        wBuffer = wBuffer + Party3Context.item1
                        wBuffer = wBuffer + Party3Context.item2
                        wBuffer = wBuffer + Party3Context.item3
                        wBuffer = wBuffer + Party3Context.item4
                        wBuffer = wBuffer + Party3Context.item5
                        wBuffer = wBuffer + Party3Context.item6
                        wBuffer = wBuffer + Party3Context.billserno
                        wBuffer = wBuffer + Party3Context.serialno
                        wBuffer = wBuffer + Party3Context.prtnum
                        wBuffer = wBuffer + Party3Context.paydate
                        sfp.write(wBuffer + '\n')
                        sfp.close()
                else:
                    #打包(多张发票)
                    for i in range( 0, int(Party3Context.billNum) ):
                        wBuffer = ""
                        wBuffer = wBuffer + Party3Context.billData[i]
                        wBuffer = wBuffer + Party3Context.item1[i]
                        wBuffer = wBuffer + Party3Context.item2[i]
                        wBuffer = wBuffer + Party3Context.item3[i]
                        wBuffer = wBuffer + Party3Context.item4[i]
                        wBuffer = wBuffer + Party3Context.item5[i]
                        wBuffer = wBuffer + Party3Context.item6[i]
                        wBuffer = wBuffer + Party3Context.billserno[i]
                        wBuffer = wBuffer + Party3Context.serialno[i]
                        wBuffer = wBuffer + Party3Context.prtnum[i]
                        wBuffer = wBuffer + Party3Context.paydate[i]
                        sfp.write(wBuffer + '\n')
                    sfp.close()

            #=====================外调接口(后处理)==================================
            if ( subModuleExistFlag==1 ) :
                if not subModuleHandle.SubModuleDoSnd():
                    raise AfaFlowControl.flowException( )

        #=====================自动打包==========================================
        TradeContext.errorCode = '0000'
        TradeContext.errorMsg  = '交易成功'
        AfaFunc.autoPackData()

        #=====================程序退出==========================================
        AfaLoggerFunc.tradeInfo('******代收代付.补打发票模板[' + TradeContext.TemplateCode + ']退出******' )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:T003104.py

示例8: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
            AfaLoggerFunc.tradeInfo(TradeContext.errorMsg)
            
            TradeContext.bodyl    ='243'
            TradeContext.CICS     =''                  
            TradeContext.INFCOD   ='E'                 
            TradeContext.Appcode  =''                  
            TradeContext.RETNO    ='0000'              
            TradeContext.PDTRCD   ='831030'            
            TradeContext.PDTRSQ   =''                  
            TradeContext.PDWSNO   =''                  
            TradeContext.JXACCT   =''                  
            TradeContext.JXCESQ   =''                  
            TradeContext.INFPAD0  =''                  
            TradeContext.INFPAD1  =''                  
            TradeContext.INFPAD2  =''                  
            TradeContext.PDTRDT  =''
            TradeContext.PDTRTM   =''                  
            TradeContext.PDTLSQ   =''
            TradeContext.PAMGID   =TradeContext.errorCode
            TradeContext.BEERTX   =HostContext.O1INFO                 
            AfaLoggerFunc.tradeInfo(HostContext.O1INFO)
            TradeContext.RecNum   =''  
            TradeContext.JXCKFG   =''
            TradeContext.JXTRCU   =''
        else:    
            AfaLoggerFunc.tradeInfo('-----test2-------------')
            TradeContext.JXTRCU   = HostContext.O1NXLN
            TradeContext.JXCKFG   = HostContext.O1MGNO
            AfaLoggerFunc.tradeInfo(HostContext.O1MGNO)
            TradeContext.CICS     =''
            TradeContext.INFCOD   ='N'
            TradeContext.Appcode  =''
            TradeContext.RETNO    ='0000'
            TradeContext.PDTRCD   ='831030'
            TradeContext.PDTRSQ   =''
            TradeContext.PDWSNO   =''
            TradeContext.JXACCT   =''
            TradeContext.JXCESQ   =''
            TradeContext.INFPAD0  =''
            TradeContext.INFPAD1  =''
            TradeContext.INFPAD2  =''
            TradeContext.PDTRTM   =''
            TradeContext.BEERTX   =''
            TradeContext.RecNum   = HostContext.O1ACUR
            
            
            TradeContext.bodyl   =str(int(TradeContext.RecNum)*51+243)
            AfaLoggerFunc.tradeInfo(TradeContext.bodyl) 
            
            if( HostContext.O1ACUR == '00' and HostContext.O1MGNO != '1' ):
                TradeContext.errorCode = '0001'
                TradeContext.errorMsg = "无补登数据"
                AfaLoggerFunc.tradeInfo(TradeContext.errorCode)
                AfaLoggerFunc.tradeInfo(TradeContext.errorMsg)
                TradeContext.PAMGID   =TradeContext.errorCode

            else:
                TradeContext.JXSGDT  = HostContext.O2ORDT 
                #TradeContext.JXCATP  = HostContext.O2SMCD
                
                #转换摘要代码为汉字
                TMP_O2SMCD = []
                for i in xrange(0,len(HostContext.O2SMCD)):
                    sum_sql = "select text from craba where smcd = '" + HostContext.O2SMCD[i] + "'"
                    sum_record = AfaDBFunc.SelectSql(sum_sql)
                    if sum_record == None:
                        TMP_O2SMCD.append("未知")
                    elif len(sum_record) <= 0:
                        TMP_O2SMCD.append("未知")
                    else:
                        TMP_O2SMCD.append(sum_record[0][0])
                TradeContext.JXCATP  = TMP_O2SMCD

                TradeContext.JXBDST  = HostContext.O2AMCD
                TradeContext.JXTRAM  = HostContext.O2TRAM
                TradeContext.JXACBL  = HostContext.O2ACBL
                TradeContext.JXCAUS  = HostContext.O2USID
                AfaLoggerFunc.tradeInfo(TradeContext.JXSGDT)
                AfaLoggerFunc.tradeInfo(TradeContext.JXCATP)
                AfaLoggerFunc.tradeInfo(TradeContext.JXBDST)
                AfaLoggerFunc.tradeInfo(TradeContext.JXTRAM)
                AfaLoggerFunc.tradeInfo(TradeContext.JXACBL)
                AfaLoggerFunc.tradeInfo(TradeContext.JXCAUS)
                
                # TradeContext.ordt  = HostContext.O2SBSQ
                # TradeContext.ordt  = HostContext.O2VLDT
                # TradeContext.ordt  = HostContext.O2PERD
                # TradeContext.ordt  = HostContext.O2ITCD
                # TradeContext.ordt  = HostContext.O2CYNO
                # TradeContext.ordt  = HostContext.O2INRT
                                  
                                  
        #=============自动打包====================
        AfaFunc.autoPackData()
                              
        AfaLoggerFunc.tradeInfo('=======自助业务自由模板结束=======')
                              
    except AfaFlowControl.flowException, e:
        #流程异常             
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:TZZ001.py

示例9: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
        HostContext.I1SBNO = TradeContext.sBesbNo         #机构号                              
        HostContext.I1USID = '999996'                     #柜员号                              
                                                                                               
        if(not VouhHostFunc.CommHost('2001')):                                                 
            tradeExit( TradeContext.errorCode, TradeContext.errorMsg )                         
            raise AfaFlowControl.flowException( )                                              
        if(TradeContext.errorCode == '0000'):                                                  
            SBNO = HostContext.O1SBCH                                                          
            AfaLoggerFunc.tradeInfo( '机构级别:'+ SBNO )
            
        TradeContext.sDepository=''
                                                                                               
        if(SBNO=='33'):                                                                        
                                                                                               
            if (TradeContext.sTellerTailNo<>'000' or TradeContext.sVouhStatus not in('0','1')):
                tradeExit('A005061', '财务机构库管员尾箱号为000,入库状态0,出库状态1')    
                raise AfaFlowControl.flowException( )                                          
                                                                                               
            if TradeContext.sVouhStatus=='0':
                TradeContext.sDepository='1'
            else:                                                                              
                TradeContext.sDepository=''
            
                                                                                               
        elif(SBNO=='31' or SBNO=='40' or SBNO=='32' or SBNO=='41'):                            
                                                                                               
            if TradeContext.sTellerTailNo=='000':                                              
                TradeContext.sDepository='2'                                                  
                TradeContext.sVouhStatus='2'                                                  
            else:                                                                              
                TradeContext.sDepository='4'                                                  
                                                                                               
        elif(SBNO=='50'):                                                                      
                                                                                               
            if TradeContext.sTellerTailNo=='000':                                              
                TradeContext.sDepository='3'                                                  
                TradeContext.sVouhStatus='2'                                                  
            else:                                                                              
                TradeContext.sDepository='4'                                                   
                                                                                               
        else:                                                                                  
            tradeExit('A005061', '该机构级别不在指定范围内')                                   
            raise AfaFlowControl.flowException( )                                              
        
        
        #=============查询数据库中是否存在需要调整的号段==========================                 
        sqlStr = ""                                                                                
        sqlStr = "select TELLERNO,DEPOSITORY,VOUHSTATUS from VOUH_REGISTER WHERE "                 
        sqlStr = sqlStr + "BESBNO ='" + TradeContext.sBesbNo +"'"                                  
        sqlStr = sqlStr + "AND VOUHTYPE ='" + TradeContext.sVouhType +"'"                          
        sqlStr = sqlStr + "AND STARTNO ='" + TradeContext.sStartNo +"'"                            
        sqlStr = sqlStr + "AND ENDNO ='" + TradeContext.sEndNo +"'"                                
                                                                                                   
        AfaLoggerFunc.tradeInfo( sqlStr )                                                          
        records = AfaDBFunc.SelectSql( sqlStr )                                                    
                                                                                                   
        if( records == None ):                                                                     
            tradeExit('A005061', '查询[凭证登记表]操作异常!')                                      
            raise AfaFlowControl.flowException( )                                                  
                                                                                                   
        elif( len( records ) == 0 ):                                                               
            tradeExit('A005067', '凭证库中不存在此条记录!')                                        
                                                                                                   
        else :                                                                                     
            AfaLoggerFunc.tradeInfo( "原记录尾箱号:" + records[0][0] )                            
            AfaLoggerFunc.tradeInfo( "原记录库箱标识:" + records[0][1] )                          
            AfaLoggerFunc.tradeInfo( "原记录凭证状态:" + records[0][2] )                          
                                                                                                   
            #将凭证号段调整至正常状态
            sql1 = ""                                                                
            sql1 = sql1 + "update vouh_register set "
            sql1 = sql1 + "TELLERNO ='" + TradeContext.sTellerTailNo +"',"
            sql1 = sql1 + "DEPOSITORY ='" + TradeContext.sDepository +"'," 
            sql1 = sql1 + "VOUHSTATUS ='" + TradeContext.sVouhStatus +"'"          
            sql1 = sql1 + "where BESBNO ='" + TradeContext.sBesbNo +"'"                    	  
            sql1 = sql1 + " and VOUHTYPE ='" + TradeContext.sVouhType +"'"                
            sql1 = sql1 + " and STARTNO ='" + TradeContext.sStartNo +"'"                      
            sql1 = sql1 + " and ENDNO ='" + TradeContext.sEndNo +"'"                          
                                                                                         
            AfaLoggerFunc.tradeInfo(sql1)                                                
                                                                                         
            if  AfaDBFunc.UpdateSqlCmt(sql1)<0:                                          
                return AfaFlowControl.ExitThisFlow("A005067","凭证号段调整失败!")
            
            TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
            TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
            TradeContext.tradeResponse.append( ['sVouhType',TradeContext.sVouhType] )
            TradeContext.tradeResponse.append( ['sStartNo',TradeContext.sStartNo] )      
            TradeContext.tradeResponse.append( ['sEndNo',TradeContext.sEndNo] )
            TradeContext.tradeResponse.append( ['errorCode','0000'] )                        
            TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )             
                

        #自动打包
        AfaFunc.autoPackData()

        #=============程序退出====================
        AfaLoggerFunc.tradeInfo( '凭证号段调整['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:Tvouh026.py

示例10: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
            raise AfaFlowControl.flowException( )
        elif len(records) > 0 :
            VouhFunc.tradeExit( 'A005058', '['+TradeContext.sInTellerNo+']柜员不能交接!' )
            raise AfaFlowControl.flowException( )
        
        #================判断柜员是否有凭证==================================
        
        #if((TradeContext.sTellerNo)[4:] == '01' or (TradeContext.sTellerNo)[4:] == '02' or (TradeContext.sTellerNo)[4:] == '03'):
        #    VouhFunc.tradeExit('A005061', '该柜员不能进行此操作!')
        #    raise AfaFlowControl.flowException( )
            
        sqlStr = "select * from VOUH_REGISTER where TELLERNO = '" + TradeContext.sTellerNo + "' and VOUHSTATUS = '3'"
        
        records = AfaDBFunc.SelectSql( sqlStr )
        AfaLoggerFunc.tradeDebug(sqlStr)
        if records==-1 :
            VouhFunc.tradeExit( 'A005057', '查询[凭证登记表]信息异常!' )
            raise AfaFlowControl.flowException( )
        elif records==0 :
            VouhFunc.tradeExit( 'A005058', '无凭证!' )
            raise AfaFlowControl.flowException( )
        
        #======================柜员交接=====================================
        sqlStr = "update VOUH_REGISTER set TELLERNO = '" + TradeContext.sInTellerNo + "' where TELLERNO = '" + TradeContext.sTellerNo + "' and VOUHSTATUS = '3'"
        
        records = AfaDBFunc.UpdateSqlCmt( sqlStr )
        AfaLoggerFunc.tradeDebug(sqlStr)
        if records==-1 :
            VouhFunc.tradeExit( 'A005057', '更新[凭证登记表]信息异常!' )
            raise AfaFlowControl.flowException( )
        elif records==0 :
            VouhFunc.tradeExit( 'A005058', '修改[凭证登记表]基本信息失败!' )
            raise AfaFlowControl.flowException( )

        #更新凭证变更登记表
        VouhFunc.VouhModify()
        #数据库提交
        AfaDBFunc.CommitSql( )
        
        #==================查询交接凭证明细==================================
	#=====李亚杰  20080812  修改凭证查询条件,增加凭证状态为'3'的情况====
        #sqlStr = "select distinct t.VOUHTYPE,t1.VOUHNAME,t.STARTNO,t.ENDNO,t.VOUHNUM FROM VOUH_REGISTER t,VOUH_PARAMETER t1 \
        #         where t.VOUHTYPE = t1.VOUHTYPE AND substr(t.BESBNO,1,6) = substr(t1.BESBNO,1,6) \
        #         AND t.TELLERNO = '" + TradeContext.sInTellerNo + "'"

        sqlStr = "select distinct t.VOUHTYPE,t1.VOUHNAME,t.STARTNO,t.ENDNO,t.VOUHNUM FROM VOUH_REGISTER t,VOUH_PARAMETER t1 \
                 where t.VOUHTYPE = t1.VOUHTYPE AND substr(t.BESBNO,1,6) = substr(t1.BESBNO,1,6) \
                 AND t.VOUHSTATUS = '3' AND t.TELLERNO = '" + TradeContext.sInTellerNo + "'"

        AfaLoggerFunc.tradeDebug(sqlStr);
        #查询数据库并将返回的结果压至对应变量中
        records = AfaDBFunc.SelectSql( sqlStr )
        if( records == None ):
            VouhFunc.tradeExit('A005067', '查询[凭证表]操作异常!')
            raise AfaFlowControl.flowException( )
        elif( len( records ) == 0 ):
            VouhFunc.tradeExit('A005068', '凭证不存在!' )
            raise AfaFlowControl.flowException( )
        else :
            record=AfaUtilTools.ListFilterNone( records )
            total=len( records )
            
            sVouhType = ''
            sVouhName = ''
            sStartNo = ''
            sEndNo = ''
            sVouhNum = ''
            
            for i in range( 0, total ):
                if( i <> 0):
                    strSplit = '|'
                else:
                    strSplit = ''
                sVouhType = sVouhType + strSplit + records[i][0]
                sVouhName = sVouhName + strSplit + records[i][1]
                sStartNo = sStartNo + strSplit + records[i][2]
                sEndNo = sEndNo + strSplit + records[i][3]
                sVouhNum = sVouhNum + strSplit + records[i][4]
                
        TradeContext.tradeResponse.append( ['sVouhType',sVouhType] )
        TradeContext.tradeResponse.append( ['sVouhName',sVouhName] )
        TradeContext.tradeResponse.append( ['sTellerNo',TradeContext.sTellerNo] )
        TradeContext.tradeResponse.append( ['sInTellerNo',TradeContext.sInTellerNo] )
        TradeContext.tradeResponse.append( ['sStartNo',sStartNo] )
        TradeContext.tradeResponse.append( ['sEndNo',sEndNo] )
        TradeContext.tradeResponse.append( ['sVouhNum',sVouhNum] )
        TradeContext.tradeResponse.append( ['sNum',str(total)] )
        TradeContext.tradeResponse.append( ['sVouhSerial',TradeContext.sVouhSerial] )
        TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
        TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
        TradeContext.tradeResponse.append( ['errorCode','0000'] )
        TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )

        #自动打包
        AfaFunc.autoPackData()

        #=============程序退出====================
        AfaLoggerFunc.tradeInfo( '凭证柜员交接['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:Tvouh025.py

示例11: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
                        if(num1 == None):
                            num1 = 0
                            
                    #查询凭证付出数
                    sqlStr = "select SUM(CAST(VOUHNUM AS DECIMAL(25))) from VOUH_MODIFY \
                            where WORKDATE = '" + TradeContext.sWorkDate + "' \
                            and TELLERNO = '" + TradeContext.sTellerTailNo + "' \
                            and BESBNO = '" + TradeContext.sBesbNo + "' \
                            and VOUHTYPE = '" + records[i][0] + "' \
                            and TRANSTATUS = '0' \
                            and EXSTATUS = '3' \
                            and VOUHSTATUS in ('2','4','5','6')"
                    res2 = AfaDBFunc.SelectSql( sqlStr )
                    AfaLoggerFunc.tradeInfo('sql2 = '+sqlStr)
                    if( res2 == None ):
                        tradeExit('A005067', '查询[凭证表]操作异常!')
                        raise AfaFlowControl.flowException( )
                    elif( len( res2 ) == 0 ):
                        num2 = 0
                    else :
                        num2 = res2[0][0]
                        if(num2 == None):
                            num2 = 0
                            
                    #查询凭证余数
                    sqlStr = "select SUM(CAST(VOUHNUM AS DECIMAL(25))) from VOUH_REGISTER \
                            where VOUHTYPE = '" + records[i][0] + "' \
                            and TELLERNO = '" + TradeContext.sTellerTailNo + "' \
                            and BESBNO = '" + TradeContext.sBesbNo + "' \
                            and VOUHSTATUS = '3'"
                    res3 = AfaDBFunc.SelectSql( sqlStr )
                    AfaLoggerFunc.tradeInfo('sql3 = '+sqlStr)
                    if( res3 == None ):
                        tradeExit('A005067', '查询[凭证表]操作异常!')
                        raise AfaFlowControl.flowException( )
                    elif( len( res3 ) == 0 ):
                        num3 = 0
                    else :
                        num3 = res3[0][0]
                        if(num3 == None):
                            num3 = 0
                    
                vouh.append([records[i][0],records[i][1],str(num1),str(num2),str(num3)])
                
                count1 = count1 + num1
                count2 = count2 + num2
                count3 = count3 + num3

        
        rBankFile= os.environ['AFAP_HOME'] + '/data/vouh/vouhtmp.txt'
      

        #创建业务报表文件
        bFp = open(rBankFile, "w")
        AfaLoggerFunc.tradeInfo('-----' + TradeContext.sBesbNo)
        AfaLoggerFunc.tradeInfo('-----' + TradeContext.sBesbName)
        AfaLoggerFunc.tradeInfo('-----' + TradeContext.sTellerTailNo)
        AfaLoggerFunc.tradeInfo('-----' + TradeContext.sWorkDate)
        
        #写入标题
        bFp.write('\n                          **************** 代理业务凭证余额表 ****************                         \n\n')
        bFp.write('              机构号码:' + TradeContext.sBesbNo + '        机构名称: ' + TradeContext.sBesbName +  '\n')
        bFp.write('              柜员号码:' + TradeContext.sTellerTailNo +  '            日期:' + TradeContext.sWorkDate +  '\n')
        bFp.write('    ------------------------------------------------------------------------------------------------------\n')
        bFp.write('    |   序号   | 凭证种类 |          凭证姓名            |   收方发生额  |   付方发生额  |      余额     |\n')
        bFp.write('    |----------|----------|------------------------------|---------------|---------------|---------------|\n')
            
        AfaLoggerFunc.tradeInfo('------------test5')
        for i in range( len( vouh ) ):

            wbuffer = '    |'
            wbuffer = wbuffer + str(i+1).ljust(10,' ') + '|'
            wbuffer = wbuffer +(vouh[i][0].strip()).ljust(10, ' ') + '|'
            wbuffer = wbuffer +(vouh[i][1].strip()).ljust(30, ' ') + '|'
            wbuffer = wbuffer +(vouh[i][2].strip()).rjust(15, ' ') + '|'
            wbuffer = wbuffer +(vouh[i][3].strip()).rjust(15, ' ') + '|'
            wbuffer = wbuffer +(vouh[i][4].strip()).rjust(15, ' ') + '|'

            #写入报表文件
            bFp.write(wbuffer + '\n')
            bFp.write('    |----------|----------|------------------------------|---------------|---------------|---------------|\n')
        
        bFp.write('    |   合计   |          |                              |' + str(count1).rjust(15,' ') + '|' + str(count2).rjust(15,' ') + '|' + str(count3).rjust(15,' ')+ '|\n')
        bFp.write('    ------------------------------------------------------------------------------------------------------\n')
        #关闭文件
        bFp.close()
        
        TradeContext.tradeResponse.append( ['sBesbNo',TradeContext.sBesbNo] )
        TradeContext.tradeResponse.append( ['sTellerTailNo',TradeContext.sTellerTailNo] )
        TradeContext.tradeResponse.append( ['sTellerNo',TradeContext.sTellerNo] )             #凭证优化更改201109 
        TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
        TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
        TradeContext.tradeResponse.append( ['sFileName','vouhtmp.txt'] )
        TradeContext.tradeResponse.append( ['errorCode','0000'] )
        TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )
        AfaFunc.autoPackData()
        #=============程序退出====================
        AfaLoggerFunc.tradeInfo( '打印报表['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:Tvouh024.py

示例12: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
           (SBNO =='32' and INSBNO=='50') or
           (SBNO =='41' and INSBNO=='50')):
            if(TradeContext.sBesbNo <> VouhFunc.SelectSBTPAC(TradeContext.sInBesbNo)):
                VouhFunc.tradeExit('A005061', '该机构柜员不能进行此操作!')
                raise AfaFlowControl.flowException( )
        
        #================机构号的清算上级是否是领用机构号=====================================
        if((SBNO =='50' and INSBNO=='40') or
            (SBNO =='50' and INSBNO=='32') or
            (SBNO =='50' and INSBNO=='41')):
            if(TradeContext.sInBesbNo <> VouhFunc.SelectSBTPAC(TradeContext.sBesbNo)):
                VouhFunc.tradeExit('A005061', '该机构柜员不能进行此操作!')
                raise AfaFlowControl.flowException( )
                
        if((TradeContext.sBesbNo)[:6] <> (TradeContext.sInBesbNo)[:6]):
            VouhFunc.tradeExit('A005061', '该机构柜员不能进行此操作!')
            raise AfaFlowControl.flowException( )
            
        #交易公共部分    
        AfaLoggerFunc.tradeInfo( TradeContext.sExDepos )
        VouhFunc.VouhTrans()

        #更新凭证变更登记薄
        VouhFunc.VouhModify()
        
        #数据库提交
        AfaDBFunc.CommitSql( )
        
        #主机记账
        AfaLoggerFunc.tradeInfo( '------------主机记账' )
        TradeContext.sOperSty = '2'
        VouhHostFunc.VouhCommHost()
        TradeContext.sTranStatus = '0'
        AfaLoggerFunc.tradeInfo( '=======================12'+TradeContext.errorCode )
        
        if(TradeContext.errorCode <> '0000'):
            tmpErrorCode= TradeContext.errorCode
            tmpErrorMsg = TradeContext.errorMsg
        
            #冲正
            
            #=============置凭证操作状态及库箱标志====================
            tmpDepos = TradeContext.sDepository
            TradeContext.sDepository = TradeContext.sExDepos
            TradeContext.sExDepos = tmpDepos

            tmpStatus = TradeContext.sVouhStatus
            TradeContext.sVouhStatus = TradeContext.sExStatus
            TradeContext.sExStatus = tmpStatus

            TradeContext.sRivTeller   = '   '     #对方柜员
            TradeContext.sTransType    = '冲正'
            
            tmpTeller = TradeContext.sInTellerTailNo
            TradeContext.sInTellerTailNo = TradeContext.sTellerTailNo
            TradeContext.sTellerTailNo = tmpTeller
            
            tmpBesbNo = TradeContext.sInBesbNo
            TradeContext.sInBesbNo = TradeContext.sBesbNo
            TradeContext.sBesbNo = tmpBesbNo

            #交易公共部分    
            VouhFunc.VouhTrans()
            AfaDBFunc.CommitSql( )
            
            TradeContext.sTranStatus = '1'
            if(not TradeContext.existVariable( "HostSerno" )):
                TradeContext.HostSerno = ''    
            
            #更新流水表
            VouhFunc.ModifyVouhModify()
            
            AfaLoggerFunc.tradeInfo( '============================自动冲正!' )

            
            VouhFunc.tradeExit(tmpErrorCode, tmpErrorMsg)
            raise AfaFlowControl.flowException( )
            
        #更新流水表
        VouhFunc.ModifyVouhModify()      
        
        TradeContext.tradeResponse.append( ['sVouhSerial',TradeContext.sVouhSerial] )
        TradeContext.tradeResponse.append( ['sVouhType',TradeContext.rVouhType] )
        TradeContext.tradeResponse.append( ['sVouhName',TradeContext.rVouhName] )
        TradeContext.tradeResponse.append( ['sStartNo',TradeContext.rStartNo] )
        TradeContext.tradeResponse.append( ['sEndNo',TradeContext.rEndNo] )
        TradeContext.tradeResponse.append( ['sVouhNum',TradeContext.rVouhNum] )
        TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
        TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
        TradeContext.tradeResponse.append( ['sNum',str(TradeContext.sNum)] )
        TradeContext.tradeResponse.append( ['errorCode','0000'] )
        TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )

        #自动打包
        AfaFunc.autoPackData()

        #=============程序退出=========================================
        AfaLoggerFunc.tradeInfo( '凭证调配['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:Tvouh003.py

示例13: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):
    
    AfaLoggerFunc.tradeInfo( '查询明细交易根据流水号['+TradeContext.TemplateCode+']进入' )
    
    #=============前台上送数据====================
    #TradeContext.oVouhSerial           原流水号 
    #TradeContext.sVouhType             凭证种类
    #TradeContext.sStartNo              起始号码
    #TradeContext.sEndNo                终止号码 
    #TradeContext.sVouhNum              凭证数量
    
    try:
        #=============初始化返回报文变量==================
        TradeContext.tradeResponse = []

        #=============获取当前系统时间====================
        TradeContext.sLstTrxDay = AfaUtilTools.GetSysDate( )
        TradeContext.sLstTrxTime = AfaUtilTools.GetSysTime( ) 
        
        #根据前台输入的凭证种类进行查询并返回前台
        sqlStr = "select distinct t.VOUHTYPE,t1.VOUHNAME,t.TELLERNO,t.STARTNO,t.ENDNO,t.VOUHNUM FROM VOUH_MODIFY t,VOUH_PARAMETER t1 \
                 where VOUHSERIAL='"+TradeContext.sVouhSerial+"' AND t.VOUHTYPE = t1.VOUHTYPE AND substr(t.BESBNO,1,6) = substr(t1.BESBNO,1,6) \
                 AND TRANSTYPE not like '%撤销' AND TRANSTATUS = '0'"

        AfaLoggerFunc.tradeDebug(sqlStr);
        #查询数据库并将返回的结果压至对应变量中
        records = AfaDBFunc.SelectSql( sqlStr )
        if( records == None ):
            tradeExit('A005067', '查询[凭证变更登记表]操作异常!')
            raise AfaFlowControl.flowException( )
        elif( len( records ) == 0 ):
            tradeExit('A005068', '凭证不存在!' )
            raise AfaFlowControl.flowException( )
        else :
            record=AfaUtilTools.ListFilterNone( records )
            total=len( records )
            
            sVouhType = ''
            sVouhName = ''
            sTellerNo = ''
            sStartNo = ''
            sEndNo = ''
            sVouhNum = ''
            
            for i in range( 0, total ):
                if( i <> 0):
                    strSplit = '|'
                else:
                    strSplit = ''
                sVouhType = sVouhType + strSplit + records[i][0]
                sVouhName = sVouhName + strSplit + records[i][1]
                sTellerNo = sTellerNo + strSplit + records[i][2]
                sStartNo = sStartNo + strSplit + records[i][3]
                sEndNo = sEndNo + strSplit + records[i][4]
                sVouhNum = sVouhNum + strSplit + records[i][5]
                
        TradeContext.tradeResponse.append( ['oVouhSerial',TradeContext.sVouhSerial] )
        TradeContext.tradeResponse.append( ['sVouhType',sVouhType] )
        TradeContext.tradeResponse.append( ['sVouhName',sVouhName] )
        TradeContext.tradeResponse.append( ['oTellerNo',sTellerNo] )
        TradeContext.tradeResponse.append( ['sStartNo',sStartNo] )
        TradeContext.tradeResponse.append( ['sEndNo',sEndNo] )
        TradeContext.tradeResponse.append( ['sVouhNum',sVouhNum] )
        TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
        TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
        TradeContext.tradeResponse.append( ['sNum',str(total)] )
        TradeContext.tradeResponse.append( ['errorCode','0000'] )
        TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )

        AfaFunc.autoPackData()
        #=============程序退出====================
        AfaLoggerFunc.tradeInfo( '查询明细交易根据流水号['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:76,代码来源:Tvouh020.py

示例14: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]
def main( ):

    AfaLoggerFunc.tradeInfo('******代收代付.报表处理模板['+TradeContext.TemplateCode+']进入******' )

    try:
    
        #=====================初始化返回报文变量================================
        TradeContext.tradeResponse=[]


        #=====================获取当前系统时间==================================
        TradeContext.workDate=AfaUtilTools.GetSysDate( )
        TradeContext.workTime=AfaUtilTools.GetSysTime( )


        #=====================校验公共节点的有效性==============================
        if( not TradeContext.existVariable( "rptType" ) ):
            raise AfaFlowControl.flowException( 'A0001', '报表类型[rptType]值不存在,不能报表打印操作' )

        if( not TradeContext.existVariable( "zoneno" ) ):
            return AfaFlowControl.ExitThisFlow( 'A0001', '地区号[zoneno]值不存在,不能报表打印操作' )
            
        if( not TradeContext.existVariable( "brno" ) ):
            return AfaFlowControl.ExitThisFlow( 'A0001', '网点号[brno]值不存在,不能报表打印操作' )

        if( not TradeContext.existVariable( "tellerno" ) ):
            return AfaFlowControl.ExitThisFlow( 'A0001', '柜员号[tellerno]值不存在,不能报表打印操作' )

        if( not TradeContext.existVariable( "beginDate" ) ):
            return AfaFlowControl.ExitThisFlow( 'A0001', '起始日期[beginDate]值不存在,不能报表打印操作' )

        if( not TradeContext.existVariable( "endDate" ) ):
            return AfaFlowControl.ExitThisFlow( 'A0001', '截至日期[endDate]值不存在,不能报表打印操作' )


        #判断汇总类型(1-按柜员汇总 2-按网点汇总 3-按支行汇总 4-按总行汇总)
        if( int( TradeContext.rptType )<1 or int( TradeContext.rptType )>4 ):           
            return AfaFlowControl.ExitThisFlow( 'A0019', '非法的汇总类型' )


        #=====================按总行汇总========================================
        if (int( TradeContext.rptType )==4):
            AfaLoggerFunc.tradeInfo( '按总行汇总')



        #=====================按支行汇总========================================
        if(int( TradeContext.rptType )==3):
            AfaLoggerFunc.tradeInfo( '按支行汇总')


        #=====================按网点汇总========================================
        if (int( TradeContext.rptType )==2):
            AfaLoggerFunc.tradeInfo( '按网点汇总')


        #=====================按柜员汇总========================================
        if (int( TradeContext.rptType )==1):
            AfaLoggerFunc.tradeInfo( '按柜员汇总')
  
  
        #=====================自动打包==========================================
        TradeContext.errorCode='0000'
        TradeContext.errorMsg='交易成功'
        AfaFunc.autoPackData()

        #=====================程序退出==========================================
        AfaLoggerFunc.tradeInfo('******代收代付.报表处理模板['+TradeContext.TemplateCode+']退出******' )

    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( str(e) )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:73,代码来源:T003105.py

示例15: main

# 需要导入模块: import AfaFunc [as 别名]
# 或者: from AfaFunc import autoPackData [as 别名]

#.........这里部分代码省略.........
        #=============获取柜员尾箱号===============================
        HostContext.I1SBNO = TradeContext.sBesbNo         #机构号
        HostContext.I1USID = TradeContext.sTellerNo       #柜员号
        HostContext.I1WSNO = TradeContext.sWSNO           #终端号
        HostContext.I1EDDT = TradeContext.sLstTrxDay      #终止日期
        HostContext.I1TELR = TradeContext.sTellerNo       #柜员代号
        
        if(not VouhHostFunc.CommHost('0104')):
            VouhFunc.tradeExit( TradeContext.errorCode, TradeContext.errorMsg )
            raise AfaFlowControl.flowException( )
        if(TradeContext.errorCode == '0000'):
            TradeContext.sTellerTailNobak = HostContext.O2CABO
            TradeContext.sTellerTailNo    = TradeContext.sTellerTailNobak[0]                 
            AfaLoggerFunc.tradeInfo( '交易柜员尾箱号:' + TradeContext.sTellerTailNo ) 
        #end   
        
        #==============判断凭证状态===========================================
        sqlStr = "SELECT VOUHTYPE,VOUHNAME,BESBNO FROM VOUH_PARAMETER WHERE (SUBSTR(BESBNO,1,6) = '"+ (TradeContext.sBesbNo)[:6] +"' \
                    or BESBNO ='3400008887')"
        if (len(TradeContext.sVouhType)!=0 and len(TradeContext.sVouhType)!=0):
            sqlStr = sqlStr + " AND VOUHTYPE = '" + TradeContext.sVouhType + "' AND STATUS = '1'"
        
        AfaLoggerFunc.tradeInfo( 'sqlStr = ' + sqlStr )
        records = AfaDBFunc.SelectSql( sqlStr )
        if( records == None ):
            TradeContext.tradeResponse.append( ['retCount','0'] )
            tradeExit( 'A005052', '查询[凭证参数维护表]操作异常!'  )
            raise AfaFlowControl.flowException( )
        elif( len( records )==0 ):
            TradeContext.tradeResponse.append( ['retCount','0'] )
            tradeExit( 'A005059', '查询[凭证参数维护表]基本信息不存在!' )
            raise AfaFlowControl.flowException( )
        
        #===================判断是否为连续号段=======================================
        
        sqlStr = "select STARTNO,ENDNO,LSTTRXDAY,LSTTRXTIME,RIVTELLER,TELLERNO \
            from VOUH_REGISTER \
            where VOUHTYPE = '" + TradeContext.sVouhType+ "' \
            and BESBNO = '" + TradeContext.sBesbNo + "'\
            and TELLERNO = '" + TradeContext.sTellerTailNo + "'\
            and VOUHSTATUS = '3' \
            and ( ENDNO >= '" + TradeContext.sEndNo + "' and STARTNO <= '" + TradeContext.sStartNo + "' )"
        records = AfaDBFunc.SelectSql( sqlStr )
        AfaLoggerFunc.tradeDebug(sqlStr)
        if( records == None ):          #查询凭证登记表异常
            tradeExit('A005061', '查询[凭证登记表]操作异常!')
            raise AfaFlowControl.flowException( )
        elif( len( records ) == 0 ):    #如果凭证登记表中无对应记录
            tradeExit('A005067', '凭证操作失败,凭证库中不存在本次操作的凭证!')
            raise AfaFlowControl.flowException( )

        TradeContext.sVouhNo=TradeContext.sStartNo


        sqlStr = "select STARTNO,ENDNO from VOUH_REGISTER \
            where TELLERNO = '" + TradeContext.sTellerTailNo + "' \
            and BESBNO = '" + TradeContext.sBesbNo + "'\
            and VOUHTYPE = '" + TradeContext.sVouhType + "'\
            and VOUHSTATUS = '3' \
            and STARTNO = '" + TradeContext.sVouhNo + "'"

        records = AfaDBFunc.SelectSql( sqlStr )
        AfaLoggerFunc.tradeDebug(sqlStr)
        if( records == None ):          #查询凭证登记表异常
            tradeExit('A005061', '查询[凭证登记表]操作异常!')
            raise AfaFlowControl.flowException( )
        elif( len( records ) == 0 ):    #如果凭证登记表中无对应记录
            tradeExit('A005067', '凭证操作失败,凭证库中不存在本次操作的凭证!')
            sStatus = '1'
            #raise AfaFlowControl.flowException( )
        else :
            vouhNos = []
            for i in range(len(records)):
                vouhNos.append(int(records[i][0]))
            if(int(TradeContext.sVouhNo)== min(vouhNos)):
                tradeExit('0000', '凭证号码确认无误!')
                sStatus = '0'
            else:
                tradeExit('A005061', '凭证号码错误!!')
                sStatus = '1'
                #raise AfaFlowControl.flowException( )

        TradeContext.tradeResponse.append( ['sVouhType',TradeContext.sVouhType] )
        TradeContext.tradeResponse.append( ['sVouhName',''] )
        TradeContext.tradeResponse.append( ['sStartNo',TradeContext.sVouhNo] )
        TradeContext.tradeResponse.append( ['sEndNo',TradeContext.sVouhNo] )
        TradeContext.tradeResponse.append( ['sVouhNum','1'] )
        TradeContext.tradeResponse.append( ['sStatus',sStatus] )
        TradeContext.tradeResponse.append( ['sLstTrxDay',TradeContext.sLstTrxDay] )
        TradeContext.tradeResponse.append( ['sLstTrxTime',TradeContext.sLstTrxTime] )
        TradeContext.tradeResponse.append( ['sNum','1'] )
        TradeContext.tradeResponse.append( ['errorCode','0000'] )
        TradeContext.tradeResponse.append( ['errorMsg','交易成功'] )
        #自动打包
        AfaFunc.autoPackData()

        #=============程序退出=========================================
        AfaLoggerFunc.tradeInfo( '凭证使用查询['+TradeContext.TemplateCode+']退出' )
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( )
开发者ID:simonliuyl,项目名称:AFA1.0,代码行数:104,代码来源:Tvouh021.py


注:本文中的AfaFunc.autoPackData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。