當前位置: 首頁>>代碼示例>>Python>>正文


Python AfaFunc類代碼示例

本文整理匯總了Python中AfaFunc的典型用法代碼示例。如果您正苦於以下問題:Python AfaFunc類的具體用法?Python AfaFunc怎麽用?Python AfaFunc使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AfaFunc類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

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,代碼行數:57,代碼來源:TRCC004.py

示例2: exitMainFlow

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,代碼行數:27,代碼來源:AfaFlowControl.py

示例3: main

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,代碼行數:42,代碼來源:T003102.py

示例4: main

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,代碼行數:40,代碼來源:TAHXNB003.py

示例5: main

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,代碼行數:39,代碼來源:TABS001.py

示例6: main

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,代碼行數:22,代碼來源:Tvmenu_admin.py

示例7: main

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( "sysId") ):
            raise AfaFlowControl.flowException( 'A0001', '係統標識[sysId]值不存在,不能進行補打發票' )

        if( not TradeContext.existVariable( "userno") ):
            raise AfaFlowControl.flowException( 'A0001', '用戶號[userno]值不存在,不能進行補打發票' )

        #=====================判斷應用係統狀態==================================
        if not AfaFunc.ChkSysStatus( ) :
            raise AfaFlowControl.flowException( )

        #=====================判斷商戶狀態======================================
        if not AfaFunc.ChkUnitStatus( ) :
            raise AfaFlowControl.flowException( )

        #=====================判斷渠道狀態======================================
        if not AfaFunc.ChkChannelStatus( ) :
            raise AfaFlowControl.flowException( )

        #操作標誌(0-查詢發票信息 1-修改打印次數 2-從第三方獲取發票信息,進行打印)
        if( not TradeContext.existVariable( "procFlag") ):
            raise AfaFlowControl.flowException( 'A0001', '操作標誌[tradeFlag"]值不存在,不能進行補打發票' )

        if(TradeContext.procFlag=="0"):

            #查詢發票信息
            sql="SELECT BILLDATA,ITEM1,ITEM2,ITEM3,ITEM4,ITEM5,ITEM6,BILLSERNO,SERIALNO,PRTNUM,WORKDATE,BILLSTATUS FROM AFA_BILLDTL WHERE "
            sql=sql + " SYSID='"      + TradeContext.sysId  + "'"
            sql=sql + " AND UNITNO='" + TradeContext.unitno + "'"

            if( TradeContext.existVariable( "subUnitno") ):
                sql=sql + " AND SUBUNITNO='" + TradeContext.subUnitno + "'"

            if( TradeContext.existVariable( "userno") ):
                sql=sql + " AND USERNO='" + TradeContext.userno + "'"

            if( TradeContext.existVariable( "payMonth") ):
                sql=sql + " AND WORKDATE LIKE '" + TradeContext.payMonth + "%'"

            if( TradeContext.existVariable( "item1") ):
                sql=sql + " AND ITEM1='"  + TradeContext.item1  + "'"

            if( TradeContext.existVariable( "item2") ):
                sql=sql + " AND ITEM2='"  + TradeContext.item1  + "'"

            if( TradeContext.existVariable( "item3") ):
                sql=sql + " AND ITEM3='"  + TradeContext.item1  + "'"

            if( TradeContext.existVariable( "item4") ):
                sql=sql + " AND ITEM4='"  + TradeContext.item1  + "'"

            if( TradeContext.existVariable( "item5") ):
                sql=sql + " AND ITEM5='"  + TradeContext.item1  + "'"

            if( TradeContext.existVariable( "item6") ):
                sql=sql + " AND ITEM6='"  + TradeContext.item1  + "'"

            sql=sql + " ORDER BY WORKDATE DESC,WORKTIME DESC "

            AfaLoggerFunc.tradeInfo( sql )

            records = AfaDBFunc.SelectSql(sql)

            if( records == None ):
                raise AfaFlowControl.flowException( 'A0002', '數據庫操作異常:' + AfaDBFunc.sqlErrMsg )

            if(len(records)==0):
                raise AfaFlowControl.flowException( 'A0002', '無符合條件的記錄' )

            if(int(records[0][9])==3):
                raise AfaFlowControl.flowException( 'A0002', '最多3次重打' )

            if(int(records[0][11])==1):
               raise AfaFlowControl.flowException( 'A0002', '票據已作廢,不允許打印' )

            TradeContext.billNum = str(len(records))        #發票數量

            if ( TradeContext.TransType=='0' ):
                #變量初始化
                TradeContext.billData = []                  #發票信息
                TradeContext.item1    = []                  #附加項1
                TradeContext.item2    = []                  #附加項2
                TradeContext.item3    = []                  #附加項3
#.........這裏部分代碼省略.........
開發者ID:simonliuyl,項目名稱:AFA1.0,代碼行數:101,代碼來源:T003104.py

示例8: main


#.........這裏部分代碼省略.........
            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,代碼行數:101,代碼來源:TZZ001.py

示例9: main


#.........這裏部分代碼省略.........
        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,代碼行數:101,代碼來源:Tvouh026.py

示例10: main


#.........這裏部分代碼省略.........
            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,代碼行數:101,代碼來源:Tvouh025.py

示例11: main


#.........這裏部分代碼省略.........
                        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,代碼行數:101,代碼來源:Tvouh024.py

示例12: main


#.........這裏部分代碼省略.........
           (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,代碼行數:101,代碼來源:Tvouh003.py

示例13: main

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,代碼行數:74,代碼來源:Tvouh020.py

示例14: main

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,代碼行數:71,代碼來源:T003105.py

示例15: main


#.........這裏部分代碼省略.........
        #=============獲取櫃員尾箱號===============================
        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,代碼行數:101,代碼來源:Tvouh021.py


注:本文中的AfaFunc類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。