Esempio n. 1
0
def SubModuleDoSnd():
    AfaLoggerFunc.tradeInfo('进入查询交易[T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode+']与第三方通讯后处理' )
    try:
        Party3Context.unitno      = TradeContext.unitno
        Party3Context.ProCode = TradeContext.ProCode
        names = Party3Context.getNames( )
        for name in names:
            value = getattr( Party3Context, name )
            setattr( TradeContext, name, value )
            #AfaLoggerFunc.tradeInfo("字段名称  ["+str(name)+"] =  "+str(value))
        if( TradeContext.errorCode == '0000' ):
        #    if( TradeContext.existVariable( "ProCodeStr" ) ):
        #        if (TradeContext.ProCodeStr == "EL5601"):            
        #            TradeContext.ProCode = "0"                      #安贷宝A
        #        elif (TradeContext.ProCodeStr == "EL5602"):
        #            TradeContext.ProCode = "1"                      #安贷宝B
        #        elif (TradeContext.ProCodeStr == "211610"):
        #            TradeContext.ProCode = "2"                      #华夏借款人意外伤害保险
            if not AfaAhAdb.AdbInsertQueDtl( ):
                raise AfaFlowControl.accException()
        AfaLoggerFunc.tradeInfo('退出查询交易与第三方通讯后处理' )
        return True
        
    except AfaFlowControl.flowException, e:
        AfaFlowControl.exitMainFlow( str(e) )
Esempio n. 2
0
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+']退出********')
Esempio n. 3
0
def SubModuleDoSnd( ):
    AfaLoggerFunc.tradeInfo('进入缴费反交易[T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode+']与第三方通讯后处理' )
    try:
        
        Party3Context.preAgentSerno = TradeContext.preAgentSerno
        Party3Context.Amount        = TradeContext.amount        
        Party3Context.workDate      = TradeContext.workDate      

        names = Party3Context.getNames( )
        for name in names:
            value = getattr( Party3Context, name )
            setattr( TradeContext, name, value )
            #AfaLoggerFunc.tradeInfo("字段名称  ["+str(name)+"] =  "+str(value))

        if( TradeContext.errorCode != '0000' ):
            AfaLoggerFunc.tradeInfo("太保返回错误代码 ["+TradeContext.errorCode+"]")
            AfaLoggerFunc.tradeInfo("太保返回错误信息 ["+TradeContext.errorMsg+"]")
            #第三方交易失败后记录错误码和错误信息
            if not AfaAhAdb.ADBUpdateTransdtlRev( ):
                raise AfaFlowControl.accException()
        return True
    except Exception, e:
        AfaFlowControl.exitMainFlow(str(e))
Esempio n. 4
0
def SubModuleDoSnd( ):
    AfaLoggerFunc.tradeInfo('进入缴费反交易[T'+TradeContext.TemplateCode+'_'+TradeContext.TransCode+']与第三方通讯后处理' )
    
    try:
        names = Party3Context.getNames( )
        
        for name in names:
            value = getattr( Party3Context, name )
            if ( not name.startswith( '__' ) and type(value) is StringType) :
                setattr( TradeContext, name, value )
           
        if( TradeContext.errorCode != '0000' ):
            
            AfaLoggerFunc.tradeInfo("银保通返回错误代码 ["+TradeContext.errorCode+"]")
            AfaLoggerFunc.tradeInfo("银保通返回错误信息 ["+TradeContext.errorMsg+"]")
            
            #第三方交易失败后记录错误码和错误信息
            if not AfaYbtdb.ADBUpdateTransdtlRev( ):
                raise AfaFlowControl.accException()
       
        return True
    
    except Exception, e:
        AfaFlowControl.exitMainFlow(str(e))
Esempio n. 5
0
            raise AfaFlowControl.flowException( )


        #=====================插入流水表========================================
        if not AfaTransDtlFunc.InsertDtl( ) :
            raise AfaFlowControl.flowException( )


        #=====================与主机通讯========================================
        AfaHostFunc.CommHost()


        #=====================更新主机返回状态==================================
        if( not AfaTransDtlFunc.UpdateDtl( 'BANK' ) ):
            if( TradeContext.__status__=='2' ):
                raise AfaFlowControl.accException( )
                
            raise AfaFlowControl.flowException( )


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


        #=====================与通讯前置交换====================================
        AfaAfeFunc.CommAfe()
        
        
        #=====================更新第三方返回状态================================