Beispiel #1
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo('>>>开始进入紧急止付申请操作')
    #=====开始取交易流水信息====
    trcbka = {}
    ret = rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka)   
    if ret == False:
        return AfaFlowControl.ExitThisFlow('M999','取交易信息失败')

    AfaLoggerFunc.tradeInfo('trckba=' + str(trcbka))
    TRCCO  =  trcbka['TRCCO']

    #=====是否需要判断状态,何种状态允许此业务发送====
    if trcbka['BJEDTE'] != TradeContext.BJEDTE:
        return AfaFlowControl.ExitThisFlow('M999','当前交易日['+TradeContext.BJEDTE+']不允许发送紧急止付报文')
    if not (trcbka['BCSTAT'] == PL_BCSTAT_MFESTL and trcbka['BDWFLG'] == PL_BDWFLG_SUCC): 
        return AfaFlowControl.ExitThisFlow('M999','当前状态['+str(trcbka['BCSTAT'])+']不允许发送紧急止付报文')
    if TRCCO[0:2]  != '20': 
        return AfaFlowControl.ExitThisFlow('M999','当前业务交易码['+str(trcbka['TRCCO'])+']不允许发送紧急止付报文')
    if trcbka['BRSFLG'] != PL_BRSFLG_SND:
        return AfaFlowControl.ExitThisFlow('M999','当前往来标识['+str(trcbka['BRSFLG'])+']不允许发送紧急止付报文')

    #=====开始向字典赋值====
    TradeContext.ORTRCCO   = trcbka['TRCCO']
    TradeContext.CUR       = trcbka['CUR']
    TradeContext.OCCAMT    = trcbka['OCCAMT']
    TradeContext.RCVBNKCO  = trcbka['RCVBNKCO']
    TradeContext.RCVBNKNM  = trcbka['RCVBNKNM']
    existp_dict = {}
    if not rccpsMap8508CTradeContext2Dexistp_dict.map(existp_dict):
        return AfaFlowControl.ExitThisFlow('M999', '字典赋值出错')

    #=====开始插入撤销止付登记簿====
    if not rccpsDBTrcc_existp.insertCmt(existp_dict):
        return AfaFlowControl.ExitThisFlow('D002', '插入数据库出错,RollBack成功')
    else:
        AfaLoggerFunc.tradeInfo('COMMIT成功')

    #=====通过接收行号取成员行号和行名====
    TradeContext.RCVBNKCO = trcbka['RCVBNKCO']
    TradeContext.RCVBNKNM = trcbka['RCVBNKNM']
    rccpsGetFunc.GetRcvBnkCo(trcbka['RCVBNKCO'])
   
    #=====赋值取中心====
    TradeContext.ORTRCDAT = trcbka['TRCDAT']
    TradeContext.ORTRCNO  = trcbka['TRCNO']
    TradeContext.ORSNDBNK = trcbka['SNDBNKCO']
    TradeContext.ORRCVBNK = trcbka['RCVBNKCO']
    TradeContext.ORCUR    = trcbka['CUR']
    TradeContext.OROCCAMT = str(trcbka['OCCAMT'])
    TradeContext.ORTRCCO  = trcbka['TRCCO']
    TradeContext.OPRTYPNO = '99'
    TradeContext.ROPRTYPNO =TradeContext.ORTRCCO[0:2] 
    return True
Beispiel #2
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.本地类操作(1.本地操作)交易[TRC001_8554]进入***' )
    
    #=====查询汇兑单笔信息====
    trcbka = {}
    bka = rccpsDBFunc.getTransTrc(TradeContext.BJEDTE,TradeContext.BSPSQN,trcbka)
    if bka == False:
        return  AfaFlowControl.ExitThisFlow('M999','查询单笔信息失败') 
    else:
        AfaLoggerFunc.tradeInfo( '>>>查询成功' )
        #=====字典赋值到TradeContext====
        rccpsMap8554Dtrcbka2CTradeContext.map(trcbka)
        
    TradeContext.OCCAMT    = str(trcbka['OCCAMT'])              #金额
    TradeContext.LOCCUSCHRG    = str(trcbka['LOCCUSCHRG'])      #手续费金额 增加于20091228  张恒
    
    TradeContext.errorCode = '0000'
    TradeContext.errorMsg  = '查询成功'

    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.本地类操作(1.本地操作)交易[TRC001_8554]退出***' )
    return True
Beispiel #3
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.本地类操作(1.本地操作)交易[TRC001_8554]进入***' )
    
    ##===张恒增加于20091230==== 
    trcbka_where_dict1={}
    trcbka_where_dict1 = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN}            
 
    #==========查询汇兑登记簿相关业务信息=======================================
    trcbka_dict = rccpsDBTrcc_trcbka.selectu(trcbka_where_dict1)  
    
    if trcbka_dict == None:
        AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg )
        return AfaFlowControl.ExitThisFlow( 'S999', '查询汇兑业务登记簿交易信息异常' )
        
    if len(trcbka_dict) <= 0:
        return AfaFlowControl.ExitThisFlow( 'S999', '汇兑业务登记簿中无此交易信息' )
    if trcbka_dict['BESBNO'] != TradeContext.BESBNO :
        return AfaFlowControl.ExitThisFlow( 'S999', '非本机构业务!' )
    ##====end=================
    
    #=====查询汇兑单笔信息====
    trcbka = {}
    bka = rccpsDBFunc.getTransTrc(TradeContext.BJEDTE,TradeContext.BSPSQN,trcbka)
    if bka == False:
        return  AfaFlowControl.ExitThisFlow('M999','查询单笔信息失败') 
    else:
        AfaLoggerFunc.tradeInfo( '>>>查询成功' )
        #=====字典赋值到TradeContext====
        rccpsMap8554Dtrcbka2CTradeContext.map(trcbka)
        
    TradeContext.OCCAMT    = str(trcbka['OCCAMT'])              #金额
    TradeContext.LOCCUSCHRG    = str(trcbka['LOCCUSCHRG'])      #手续费金额 增加于20091228  张恒
    
    TradeContext.errorCode = '0000'
    TradeContext.errorMsg  = '查询成功'

    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.本地类操作(1.本地操作)交易[TRC001_8554]退出***' )
    return True
 if fp == None:
     rccpsCronFunc.cronExit("S999","打开汇兑对账(主机)明细文件异常")
     
 file_line = ""
 
 if len(hddzmx_list) <= 0:
     AfaLoggerFunc.tradeInfo(">>>汇兑对账明细登记簿中无对应记录")
 else:
     for i in xrange(len(hddzmx_list)):
         
         file_line = file_line + "RCC".ljust(8,' ')                     + '|' #代理业务号
         file_line = file_line + hddzmx_list[i]['BJEDTE'].ljust(8,' ')  + '|' #前置日期
         file_line = file_line + hddzmx_list[i]['BSPSQN'].ljust(12,' ') + '|' #前置流水号
         
         trc_dict = {}
         if not rccpsDBFunc.getTransTrc(hddzmx_list[i]['BJEDTE'],hddzmx_list[i]['BSPSQN'],trc_dict):
             rccpsCronFunc.cronExit("S999","查询交易信息异常")
         
         file_line = file_line + hddzmx_list[i]['SNDBNKCO'].ljust(12,' ') + '|'     #发起行号
         file_line = file_line + hddzmx_list[i]['SNDBNKNM'].ljust(62,' ') + '|'     #发起行名
         file_line = file_line + trc_dict['BRSFLG'].ljust(1,' ')    + '|'     #往来标识
         file_line = file_line + "".ljust(5,' ')                    + '|'     #业务类型
         
         
         #=======根据往来标识获取借贷方信息================================
         if trc_dict['BRSFLG'] == PL_BRSFLG_SND:
             #===往账查询记账状态信息中的借贷方账号信息==================
             stat_dict = {}
             if not rccpsState.getTransStateSet(hddzmx_list[i]['BJEDTE'],hddzmx_list[i]['BSPSQN'],PL_BCSTAT_ACC,PL_BDWFLG_SUCC,stat_dict):
                 rccosCronFunc.cronExit("S999","查询记账状态异常")
                 
Beispiel #5
0
def SubModuleDoFst():
    #====开始取流水号对应信息====
    trcbka_dict = {}
    dict = rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka_dict)
    if dict == False:
        return AfaFlowControl.ExitThisFlow('M999','取交易信息失败')

    #=====判断撤销信息====
    if TradeContext.BESBNO != trcbka_dict["BESBNO"]:
        return AfaFlowControl.ExitThisFlow('M999','不允许跨机构撤销')
    if TradeContext.BETELR != trcbka_dict["BETELR"]:
        return AfaFlowControl.ExitThisFlow('M999','不允许换柜员操作')
    if TradeContext.BJEDTE != trcbka_dict["BJEDTE"]:
        return AfaFlowControl.ExitThisFlow('M999','不允许隔日撤销')
    if trcbka_dict["BCSTAT"] != PL_BCSTAT_MFEQUE:  #41 排队状态 1 成功
         return AfaFlowControl.ExitThisFlow('M999','当前业务状态为['+trcbka_dict["BCSTAT"]+']不允许撤销' )
    if trcbka_dict["BRSFLG"] != PL_BRSFLG_SND:    #往帐
         return AfaFlowControl.ExitThisFlow('M999','当前业务状态为来账业务不允许撤销' )

    #=====开始插入数据库====
    trccan_dict = {}
    if not rccpsMap8507Dtrcbka_dict2Dtrccan_dict.map(trcbka_dict,trccan_dict):
         return AfaFlowControl.ExitThisFlow('M999','字典赋值错误')
    
    trccan_dict["CONT"]   = TradeContext.CONT
    trccan_dict["TRCCO"]  = TradeContext.TRCCO
    trccan_dict["BJEDTE"] = TradeContext.BJEDTE
    trccan_dict["BSPSQN"] = TradeContext.BSPSQN
    trccan_dict['CLRESPN'] = PL_ISDEAL_UNDO
    trccan_dict['RCVBNKCO'] = PL_RCV_CENTER
    trccan_dict['RCVBNKNM'] = PL_RCV_CENNAM 
    trccan_dict['RCVMBRCO'] = PL_RCV_CENTER
    trccan_dict['SNDMBRCO'] = TradeContext.SNDSTLBIN
    trccan_dict['TRCNO']    = TradeContext.SerialNo
    AfaLoggerFunc.tradeInfo( '字典trccan_dict:' + str(trccan_dict) )

    #=====开始插入撤销业务登记簿====
    ret = rccpsDBTrcc_trccan.insert(trccan_dict)
    if ret <= 0:
        #=====RollBack操作====
        AfaDBFunc.RollbackSql()
        return AfaFlowControl.ExitThisFlow('D011','数据库ROLLBAKC失败')

    #=====commit操作====
    AfaDBFunc.CommitSql()
    AfaLoggerFunc.tradeInfo('>>>commit succ')

    #=====从字典向TradeContext赋值====
    if not rccpsMap8507Dtrccan_dict2CTradeContext.map(trccan_dict):
         return AfaFlowControl.ExitThisFlow('M999','字典赋值错误')

    #====手工赋值一些字段====
    TradeContext.OROCCAMT = str(TradeContext.OCCAMT)    #原交易金额
    AfaLoggerFunc.tradeDebug('>>>原交易金额' + str(TradeContext.OROCCAMT))
    TradeContext.ROPRTPNO = trcbka_dict['TRCCO'][:2]           #参考业务类型
    AfaLoggerFunc.tradeDebug('>>>参考业务类型' + TradeContext.ROPRTPNO)
    TradeContext.OPRTYPNO = '99'
    AfaLoggerFunc.tradeDebug('>>>业务类型' + TradeContext.OPRTYPNO)
    TradeContext.ORMFN    = str(trcbka_dict['SNDMBRCO']) + str(trcbka_dict['TRCDAT']) + str(trcbka_dict['TRCNO'])     #参考报文标识号
    AfaLoggerFunc.tradeDebug('>>>参考类型' + TradeContext.ORMFN)
    TradeContext.ORRCVBNK = trcbka_dict['RCVBNKCO']
    TradeContext.RCVBNKCO = PL_RCV_CENTER
    TradeContext.RCVBNKNM = PL_RCV_CENNAM 
    TradeContext.RCVSTLBIN = PL_RCV_CENTER
    TradeContext.ORTRCNO   = trcbka_dict['TRCNO']
    
    TradeContext.ORSNDBNKCO=trccan_dict['SNDBNKCO']
    AfaLoggerFunc.tradeInfo("TradeContext.ORSNDBNKCO:"+TradeContext.ORSNDBNKCO)
    AfaLoggerFunc.tradeInfo("TradeContext.BOSPSQ:"+TradeContext.BOSPSQ)

    return True
Beispiel #6
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).特约电子汇兑查询书发送[TRC003_8518]进入***' )
    
    #=================查询原交易信息============================================
    
    if not TradeContext.existVariable('BOJEDT'):
        return AfaFlowControl.ExitThisFlow("S999", "原交易日期不能为空")
    
    if not TradeContext.existVariable('BOSPSQ'):
        return AfaFlowControl.ExitThisFlow("S999", "原报单序号不能为空")

    AfaLoggerFunc.tradeInfo(">>>开始查询原特约电子汇兑业务交易信息")
    
    trcbka_dict = {}
    ret = rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka_dict)
    
    if not ret:
        return False

    #====刘雨龙 20080701 增加是否来账业务判断====
    if trcbka_dict['BRSFLG'] != PL_BRSFLG_RCV:
        return AfaFlowControl.ExitThisFlow('S999','原交易非来账业务不允许做此业务')
    
    #====刘雨龙 20080701 增加是否特约汇兑业务判断====
    if trcbka_dict['TRCCO'] != '2000009':
        return AfaFlowControl.ExitThisFlow('S999','原交易非特约汇兑业务不允许做此交易')

    AfaLoggerFunc.tradeInfo(">>>开始查询原特约电子汇兑业务交易信息")
    #=================登记查询书信息============================================
    AfaLoggerFunc.tradeInfo(">>>开始登记特约电子汇兑业务查询书信息")
    
    TradeContext.RCVBNKCO = trcbka_dict['SNDBNKCO']
    TradeContext.RCVBNKNM = trcbka_dict['SNDBNKNM']
    TradeContext.NCCWKDAT = TradeContext.NCCworkDate
    TradeContext.ISDEAL   = PL_ISDEAL_UNDO            #查复标识为未查复

    #=====刘雨龙 20080701 增加汇兑业务查询查复登记簿信息====
    TradeContext.RCVSTLBIN= '9999999997'              #特约业务接收行特殊
    TradeContext.BRSFLG   = PL_BRSFLG_SND             #往来标志
    TradeContext.ORTRCCO  = trcbka_dict['TRCCO']      #原交易代码
    TradeContext.CUR      = trcbka_dict['CUR']        #币种
    TradeContext.OCCAMT   = trcbka_dict['OCCAMT']     #交易金额
    TradeContext.PYRACC   = trcbka_dict['PYRACC']     #付款人账号
    TradeContext.PYEACC   = trcbka_dict['PYEACC']     #收款人账号
    TradeContext.PRCCO    = trcbka_dict['PRCCO']      #中心返回码
    TradeContext.NOTE1    = trcbka_dict['NOTE1']      #备注1
    TradeContext.NOTE2    = trcbka_dict['NOTE2']      #备注2
    TradeContext.NOTE3    = trcbka_dict['NOTE3']      #备注3
    TradeContext.NOTE4    = trcbka_dict['NOTE4']      #备注4
    
    #=====PGT 20080728 打印表格中的字段====
    TradeContext.OR_TRCDAT   = trcbka_dict['TRCDAT']    
    TradeContext.OR_SNDBNKCO = trcbka_dict['SNDBNKCO']
    TradeContext.OR_OCCAMT  = trcbka_dict['OCCAMT']
    
    hdcbka_insert_dict = {}
    if not rccpsMap8518CTradeContext2Dhdcbka.map(hdcbka_insert_dict):
        return AfaFlowControl.ExitThisFlow("S999", "为特约电子汇兑业务查询查复登记簿赋值异常")
        
    ret = rccpsDBTrcc_hdcbka.insertCmt(hdcbka_insert_dict)
    
    if ret <= 0:
        return AfaFlowControl.ExitThisFlow("S999", "登记特约电子汇兑业务查询书信息异常")
    
    AfaLoggerFunc.tradeInfo(">>>结束登记特约电子汇兑业务查询书信息")
    
    
    #=================为特约电子汇兑查询书报文赋值======================================
    AfaLoggerFunc.tradeInfo(">>>开始为特约电子汇兑查询书报文赋值")
    
    TradeContext.MSGTYPCO   = 'SET008'
    TradeContext.SNDBRHCO   = TradeContext.BESBNO
    TradeContext.SNDCLKNO   = TradeContext.BETELR
    TradeContext.SNDTRDAT   = TradeContext.BJEDTE
    TradeContext.SNDTRTIM   = TradeContext.BJETIM
    TradeContext.MSGFLGNO   = TradeContext.SNDSTLBIN + TradeContext.TRCDAT + TradeContext.SerialNo
    TradeContext.ORMFN      = trcbka_dict['SNDMBRCO'] + trcbka_dict['TRCDAT'] + trcbka_dict['TRCNO']
    TradeContext.NCCWKDAT   = TradeContext.NCCworkDate
    TradeContext.OPRTYPNO   = '99'
    TradeContext.ROPRTPNO   = '20'
    TradeContext.TRANTYP    = '0'
    TradeContext.TRCDAT     = TradeContext.TRCDAT
    TradeContext.TRCNO      = TradeContext.SerialNo
    TradeContext.ORTRCDAT   = trcbka_dict['TRCDAT']
    TradeContext.ORTRCNO    = trcbka_dict['TRCNO']
    TradeContext.ORSNDBNK   = trcbka_dict['SNDBNKCO']
    TradeContext.ORTRCCO    = trcbka_dict['TRCCO']
    TradeContext.ORCUR      = trcbka_dict['CUR']
    TradeContext.OROCCAMT   = str(trcbka_dict['OCCAMT'])
    TradeContext.PYENAM     = trcbka_dict['PYENAM']
    TradeContext.PYRNAM     = trcbka_dict['PYRNAM']
       
    AfaLoggerFunc.tradeInfo(">>>结束为特约电子汇兑查询书报文赋值")
    
    return True
Beispiel #7
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( '***农信银系统: 往账.本地类操作交易[RCC001_8521]进入***' )

    #=====判断输入接口值是否存在====
    if(not TradeContext.existVariable("OPRTYPNO")):
        return AfaFlowControl.ExitThisFlow('A099', '业务种类[OPRTYPNO]不存在')
    if(not TradeContext.existVariable("PRTFLG")):
        return AfaFlowControl.ExitThisFlow('A099', '打印标志[PRTFLG]不存在')
    if(not TradeContext.existVariable("BJEDTE")):
        return AfaFlowControl.ExitThisFlow('A099', '交易日期[BJEDTE]不存在')
    if(not TradeContext.existVariable("BSPSQN")):
        return AfaFlowControl.ExitThisFlow('A099', '报单序号[BSPSQN]不存在')

    #=====PL_TRCCO_HP 21 汇票====    
    if(TradeContext.OPRTYPNO==PL_TRCCO_HP):
        AfaLoggerFunc.tradeInfo("进入汇票处理")
        
        #=====查询数据库====
        records = {}
        ret = rccpsDBFunc.getTransBil(TradeContext.BJEDTE,TradeContext.BSPSQN,records)
        if( ret == False):
            return AfaFlowControl.ExitThisFlow('A099', '无此数据')
        
        AfaLoggerFunc.tradeInfo("结束数据库查询")
        
        #=====判断是否为签发机构====
        AfaLoggerFunc.tradeInfo("开始判断当前机构是否为交易机构")
        if( records['BESBNO'] != TradeContext.BESBNO ):
            return AfaFlowControl.ExitThisFlow('S999', '未查找到数据')
            
        AfaLoggerFunc.tradeInfo("结束判断当前机构是否为交易机构")
               
        #=====判断当前业务是否为来帐====
        AfaLoggerFunc.tradeInfo("开始判断当前业务是否为来帐")
        if( records['BRSFLG'] == PL_BRSFLG_SND ):
            return AfaFlowControl.ExitThisFlow('S999', '该笔业务为往账业务,请使用[8522 往账凭证补打]交易打印')
        
        AfaLoggerFunc.tradeInfo("结束判断当前业务是否为来帐")
        
        #=====判断当前状态====
        AfaLoggerFunc.tradeInfo("开始判断当前状态")
#        if( records['BCSTAT'] != PL_MBRTRCST_ACSUC and records['BCSTAT'] != PL_BCSTAT_AUTO ):
#            return AfaFlowControl.ExitThisFlow('A099', "当前状态["+records['BCSTAT']+"]不允许打印")
        #=====pgt 0925 将记账成功改为自动挂账,来帐没有记账,增加判断交易成功的判断====
#        if( records['BCSTAT'] != PL_BCSTAT_HANG and records['BCSTAT'] != PL_BCSTAT_AUTO and records['BDWFLG'] != PL_BDWFLG_SUCC ):
#            return AfaFlowControl.ExitThisFlow('A099', "当前状态["+records['BCSTAT']+"]不允许打印")
        if not ((records['BCSTAT'] == PL_BCSTAT_HANG and records['BDWFLG'] == PL_BDWFLG_SUCC) or (records['BCSTAT'] == PL_BCSTAT_AUTO and records['BDWFLG'] == PL_BDWFLG_SUCC)):
            return AfaFlowControl.ExitThisFlow('A099', "当前状态["+records['BCSTAT']+"]["+records['BDWFLG']+"]不允许打印")
            
        AfaLoggerFunc.tradeInfo("结束判断当前状态")
        
        #=====判断打印状态====
        AfaLoggerFunc.tradeInfo("开始判断当前业务的打印状态")
        if(TradeContext.PRTFLG == "0" and int(records['PRTCNT']) > 0):   #打印,打印次数大于0
            return AfaFlowControl.ExitThisFlow('A099','打印次数大于1,请选择补打' )
        
        if(TradeContext.PRTFLG == "1" and int(records['PRTCNT']) == 0):  #补打,打印次数为0
            return AfaFlowControl.ExitThisFlow('A099','打印次数为0,请选择打印' ) 
            
        AfaLoggerFunc.tradeInfo("结束判断当前业务的打印状态")
        
        #=====查询汇票信息登记簿====
        AfaLoggerFunc.tradeInfo("开始查询汇票信息登记簿")
        bilinf_record = {}
        ret = rccpsDBFunc.getInfoBil(records['BILVER'],records['BILNO'],records['BILRS'],bilinf_record)
        if( ret == False ):
            return AfaFlowControl.ExitThisFlow('S999','查询汇票信息登记簿失败' ) 
        AfaLoggerFunc.tradeInfo("结束查询汇票信息登记簿")
        
        #=====输出接口====
        AfaLoggerFunc.tradeInfo("开始向输出接口赋值")
        TradeContext.PRTDAT     = AfaUtilTools.GetHostDate()     #打印日期
        TradeContext.PRTTIM     = AfaUtilTools.GetSysTime()      #打印时间
        TradeContext.BJEDTE     = records['BJEDTE']              #交易日期
        TradeContext.BSPSQN     = records['BSPSQN']              #报单序号
        TradeContext.BJETIM     = records['BJETIM']              #交易时间
        TradeContext.TRCCO      = records['TRCCO']               #交易代码
        TradeContext.OPRATTNO   = records['OPRATTNO']            #业务熟悉
        TradeContext.TRCDAT     = records['TRCDAT']              #委托日期
        TradeContext.TRCNO      = records['TRCNO']               #交易流水号          
        TradeContext.OCCAMT     = str(bilinf_record['BILAMT'])	 #交易金额        
        TradeContext.BILNO      = records['BILNO']               #汇票号码            
        TradeContext.PYRACC     = bilinf_record['PYRACC']        #付款人账号  
        TradeContext.PYRNAM     = bilinf_record['PYRNAM']        #付款人名称      
        TradeContext.PYRADDR    = bilinf_record['PYRADDR']       #付款人地址      
        TradeContext.PYEACC     = bilinf_record['PYEACC']        #收款人账号      
        TradeContext.PYENAM     = bilinf_record['PYENAM']        #收款人名称      
        TradeContext.PYEADDR    = bilinf_record['PYEADDR']       #收款人地址  
        TradeContext.SEAL       = bilinf_record['SEAL']          #汇票密压            
        TradeContext.TRDT       = records['TRDT']                #主机日期
        TradeContext.TLSQ       = records['TLSQ']                #主机流水号
        TradeContext.ACC1       = records['SBAC']                #借方账号
        TradeContext.ACC2       = records['RBAC']                #贷方账号
        TradeContext.ACC3       = ""                             #备用账号
        TradeContext.DASQ       = records['DASQ']                #销账序号
        TradeContext.SNDBNKCO   = records['SNDBNKCO']            #发送行号
        TradeContext.SNDBNKNM   = records['SNDBNKNM']            #发送行名
        TradeContext.RCVBNKCO   = records['RCVBNKCO']            #接收行号
        TradeContext.RCVBNKNM   = records['RCVBNKNM']            #接收行名
        TradeContext.USE        = bilinf_record['USE']           #用途
        TradeContext.REMARK     = bilinf_record['REMARK']        #备注
        TradeContext.PRTCNT     = str(int(records['PRTCNT'])+1)  #打印次数
        TradeContext.CUR        = bilinf_record['CUR']           #币种
        TradeContext.OPRNO      = records['OPRNO']               #业务类型
        TradeContext.RMNAMT     = str(bilinf_record['RMNAMT'])   #结余余额
        TradeContext.OCCAMT1    = str(bilinf_record['OCCAMT'])   #实际结算金额
        TradeContext.PAYBNKCO   = bilinf_record['PAYBNKCO']      #代理兑付行行号
        TradeContext.PAYBNKNM   = bilinf_record['PAYBNKNM']      #代理兑付行行名
        
        AfaLoggerFunc.tradeInfo("结束向输出结构赋值")
        
        #=====更新打印标志====
        AfaLoggerFunc.tradeInfo("开始更新打印标志")
        
        update_dict={'PRTCNT':records['PRTCNT']+1} 
        where_dict={'BJEDTE':records['BJEDTE'],'BSPSQN':records['BSPSQN'],'BCSTAT':records['BCSTAT']}
        
        rownum=rccpsDBTrcc_sstlog.update(update_dict,where_dict)
        if(rownum<=0):
            AfaDBFunc.RollbackSql()
            return AfaFlowControl.ExitThisFlow('A099','更新打印次数失败' )        	
        
        AfaDBFunc.CommitSql()
        
        AfaLoggerFunc.tradeInfo("结束更新打印标志")         
        AfaLoggerFunc.tradeInfo("结束汇票处理")
        
    #=====PL_TRCCO_HD 20 汇兑====
    elif(TradeContext.OPRTYPNO==PL_TRCCO_HD):
        AfaLoggerFunc.tradeInfo("进入汇兑处理")
        
        #=====查询数据库====
        records = {}
        ret = rccpsDBFunc.getTransTrc(TradeContext.BJEDTE,TradeContext.BSPSQN,records)
        if(ret==False):
            return AfaFlowControl.ExitThisFlow('A099','无此数据' )
            
        #=====判断是否为签发机构====
        AfaLoggerFunc.tradeInfo("开始判断当前机构是否为交易机构")
        if( records['BESBNO'] != TradeContext.BESBNO ):
            return AfaFlowControl.ExitThisFlow('S999', '为查找到数据')
            
        AfaLoggerFunc.tradeInfo("结束判断当前机构是否为交易机构")
        
        #=====刘雨龙 20080702 判断当前业务是否为来账业务====
        if records['BRSFLG'] == PL_BRSFLG_SND:
            return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.BSPSQN+']该笔业务为往账业务,不允许打印')
        
        #=====判断当前状态====
        #=====pgt 0925 增加判断交易成功的判断====
#        if records['BCSTAT'] != PL_BCSTAT_HANG and records['BCSTAT'] != PL_BCSTAT_AUTO and records['BCSTAT'] != PL_BCSTAT_QTR and records['BDWFLG'] != PL_BDWFLG_SUCC :
#            return AfaFlowControl.ExitThisFlow('A099',"当前状态[" + records['BCSTAT'] + "]不允许打印")
        if not ((records['BCSTAT'] == PL_BCSTAT_HANG and records['BDWFLG'] == PL_BDWFLG_SUCC) or (records['BCSTAT'] == PL_BCSTAT_AUTO and records['BDWFLG'] == PL_BDWFLG_SUCC) or (records['BCSTAT'] == PL_BCSTAT_QTR and records['BDWFLG'] == PL_BDWFLG_SUCC)):
            return AfaFlowControl.ExitThisFlow('A099',"当前状态[" + records['BCSTAT'] + "]["+records['BDWFLG']+"]不允许打印")
                
        if(TradeContext.PRTFLG == "0" and int(records['PRTCNT']) > 0):   #打印,打印次数大于0
            return AfaFlowControl.ExitThisFlow('A099','打印次数大于1,请选择补打' )
        
        if(TradeContext.PRTFLG == "1" and int(records['PRTCNT']) == 0):  #补打,打印次数为0
            return AfaFlowControl.ExitThisFlow('A099','打印次数未0,请选择打印' )
        
        AfaLoggerFunc.tradeInfo("判断打印标志结束")
        
        #=====输出接口====
        TradeContext.PRTDAT   =  AfaUtilTools.GetHostDate()     #打印日期
        TradeContext.PRTTIM   =  AfaUtilTools.GetSysTime()      #打印时间
        TradeContext.BJEDTE   =  records['BJEDTE']              #交易日期
        TradeContext.BSPSQN   =  records['BSPSQN']              #交易序号
        TradeContext.BJETIM   =  records['BJETIM']              #交易时间
        TradeContext.TRCCO    =  records['TRCCO']               #业务类型
        TradeContext.OPRATTNO =  records['OPRATTNO']            #业务属性
        TradeContext.TRCDAT   =  records['TRCDAT']              #委托日期
        TradeContext.TRCNO    =  records['TRCNO']               #交易流水号
        TradeContext.OCCAMT   =  str(records['OCCAMT'])         #交易金额
        TradeContext.BILNO    =  records['BILNO']               #汇票号码
        TradeContext.PYRACC   =  records['PYRACC']              #付款人账号
        TradeContext.PYRNAM   =  records['PYRNAM']              #付款人名称
        TradeContext.PYRADDR  =  records['PYRADDR']             #付款人地址
        TradeContext.PYEACC   =  records['PYEACC']              #收款人账号
        TradeContext.PYENAM   =  records['PYENAM']              #收款人名称
        TradeContext.PYEADDR  =  records['PYEADDR']             #收款人地址
        TradeContext.SEAL     =  records['SEAL']                #汇票密压
        
        #=====PL_BCSTAT_QTR  80 退汇====
        if records['BCSTAT'] == PL_BCSTAT_QTR:
            #=====退汇业务,返回挂账状态的状态详细信息====
            stat_dict = {}
            if not rccpsState.getTransStateSet(records['BJEDTE'],records['BSPSQN'],PL_BCSTAT_HANG,PL_BDWFLG_SUCC,stat_dict):
                return AfaFlowControl.ExitThisFlow('A099','查询交易自动挂账状态异常' )
            
            TradeContext.TRDT = stat_dict['TRDT']               #主机日期
            TradeContext.TLSQ = stat_dict['TLSQ']               #主机流水号
            TradeContext.ACC1 = stat_dict['SBAC']               #借方账号
            TradeContext.ACC2 = stat_dict['RBAC']               #贷方账号
            TradeContext.ACC3 = ""                              #备用账号
            TradeContext.DASQ = stat_dict['DASQ']               #销账序号
        else:
            #=====非退汇业务,返回当前状态的状态详细信息====
            TradeContext.TRDT = records['TRDT']	                #主机日期
            TradeContext.TLSQ = records['TLSQ']	                #主机流水号
            TradeContext.ACC1 = records['SBAC']                 #借方账号
            TradeContext.ACC2 = records['RBAC']                 #贷方账号
            TradeContext.ACC3 = ""                              #备用账号
            TradeContext.DASQ = records['DASQ']                 #销账序号
            
        TradeContext.SNDBNKCO = records['SNDBNKCO']             #发送行号
        TradeContext.SNDBNKNM = records['SNDBNKNM']             #发送行名
        TradeContext.RCVBNKCO = records['RCVBNKCO']             #接收行号
        TradeContext.RCVBNKNM = records['RCVBNKNM']             #接收行名
        TradeContext.USE      = records['USE']                  #用途
        TradeContext.REMARK   = records['REMARK']               #备注
        TradeContext.PRTCNT   = str(int(records['PRTCNT'])+1)   #打印次数
        TradeContext.OPRNO    = records['OPRNO']                #业务类型
        TradeContext.CUR      = records['CUR']                  #币种
        TradeContext.OCCAMT   = str(records['OCCAMT'])          #业务属性
        
        #=====更新打印标志====
        AfaLoggerFunc.tradeInfo("开始更新打印标志")
        
        update_dict={'PRTCNT':records['PRTCNT']+1}        
        where_dict={'BJEDTE':records['BJEDTE'],'BSPSQN':records['BSPSQN'],'BCSTAT':records['BCSTAT']}
        
        rownum=rccpsDBTrcc_sstlog.update(update_dict,where_dict)
        if(rownum<=0):
            AfaDBFunc.RollbackSql()
            return AfaFlowControl.ExitThisFlow('A099','更新打印次数失败' )        	
        
        AfaDBFunc.CommitSql()
    else:
        return AfaFlowControl.ExitThisFlow('A099','业务类型错')
        
    TradeContext.errorCode="0000"
    TradeContext.errorMsg="查询成功"
    
    AfaLoggerFunc.tradeInfo( '***农信银系统: 往账.本地类操作交易[RCC001_8521]退出***' )

    return True
Beispiel #8
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).汇兑查复书发送[TRC003_8512]进入***' )
    
    #=================查询原查复信息============================================
    
    if not TradeContext.existVariable('ORQYDAT'):
        return AfaFlowControl.ExitThisFlow("S999", "原查询日期不能为空")
    
    if not TradeContext.existVariable('OQTNO'):
        return AfaFlowControl.ExitThisFlow("S999", "原查询号不能为空")
        
    AfaLoggerFunc.tradeInfo(">>>开始查询原查询书信息")
    
    hdcbka_dict = {}
    hdcbka_where_dict = {'BJEDTE':TradeContext.ORQYDAT,'BSPSQN':TradeContext.OQTNO}
    #ret = rccpsDBFunc.getTransTrc(TradeContext.ORQYDAT,TradeContext.OQTNO,hdcbka_dict)
    hdcbka_dict = rccpsDBTrcc_hdcbka.selectu(hdcbka_where_dict)
    if hdcbka_dict == None:
        return AfaFlowControl.ExitThisFlow("S999","数据库操作失败")
    if len(hdcbka_dict) > 0:
        if hdcbka_dict['ISDEAL']  == PL_ISDEAL_ISDO:        #PL_ISDEAL_ISDO  已查复或已处理
            return AfaFlowControl.ExitThisFlow("S999","该查询已被查复")
    
    AfaLoggerFunc.tradeInfo(">>>开始查询汇兑原交易信息")
    trcbka_dict = {}
    ret = rccpsDBFunc.getTransTrc(hdcbka_dict['BOJEDT'],hdcbka_dict['BOSPSQ'],trcbka_dict)
    
    if not ret:
        return False
    
    AfaLoggerFunc.tradeInfo(">>>结束查询数据库信息")
    #=================登记查复书信息============================================
    AfaLoggerFunc.tradeInfo(">>>开始登记汇兑业务查复书信息")
    
    RCVBNKCO=TradeContext.RCVBNKCO #add by pgt 0724
    
#    TradeContext.RCVBNKCO = hdcbka_dict['SNDBNKCO']
#    TradeContext.RCVBNKNM = hdcbka_dict['SNDBNKNM']    注释于0724 by pgt
    TradeContext.NCCWKDAT = TradeContext.NCCworkDate
    TradeContext.ISDEAL   = PL_ISDEAL_ISDO            #查复标识为已处理
    TradeContext.BOJEDT   = TradeContext.ORQYDAT      #原交易日期
    TradeContext.BOSPSQ   = TradeContext.OQTNO        #原报单序号
    TradeContext.ORTRCCO  = hdcbka_dict['TRCCO']      #原交易码
    TradeContext.CUR      = hdcbka_dict['CUR']        #币种
    TradeContext.OCCAMT   = str(trcbka_dict['OCCAMT']) #交易金额
    TradeContext.PYRACC   = trcbka_dict['PYRACC']     #付款人账号
    TradeContext.PYEACC   = trcbka_dict['PYEACC']     #收款人账号
    TradeContext.NOTE1    = hdcbka_dict['NOTE1']
    TradeContext.NOTE2    = hdcbka_dict['NOTE2']
    TradeContext.NOTE3    = hdcbka_dict['NOTE3']
    TradeContext.NOTE4    = hdcbka_dict['NOTE4']
    
    TradeContext.PRT_OROCCAMT = trcbka_dict['OCCAMT']
    
    hdcbka_insert_dict = {}
    if not rccpsMap8512CTradeContext2Dhdcbka.map(hdcbka_insert_dict):
        return AfaFlowControl.ExitThisFlow("S999", "为汇兑业务查询查复登记簿赋值异常")
        
    ret = rccpsDBTrcc_hdcbka.insertCmt(hdcbka_insert_dict)
    
    if ret <= 0:
        return AfaFlowControl.ExitThisFlow("S999", "登记汇兑业务查复书信息异常")
    
    AfaLoggerFunc.tradeInfo(">>>结束登记汇兑业务查复书信息")
    
    
    
    #=================为汇兑查询书报文赋值======================================
    AfaLoggerFunc.tradeInfo(">>>开始为汇兑查复书报文赋值")
    
    TradeContext.TRCCO      = '9900512'
    TradeContext.MSGTYPCO   = 'SET008'
    TradeContext.SNDBRHCO   = TradeContext.BESBNO
    TradeContext.SNDCLKNO   = TradeContext.BETELR
    TradeContext.SNDTRDAT   = TradeContext.BJEDTE
    TradeContext.SNDTRTIM   = TradeContext.BJETIM
    TradeContext.MSGFLGNO   = TradeContext.SNDSTLBIN + TradeContext.TRCDAT + TradeContext.SerialNo
    TradeContext.ORMFN      = TradeContext.RCVSTLBIN + hdcbka_dict['TRCDAT'] + hdcbka_dict['TRCNO']
    TradeContext.NCCWKDAT   = TradeContext.NCCworkDate
    TradeContext.OPRTYPNO   = '99'
    TradeContext.ROPRTPNO   = '99'
    TradeContext.TRANTYP    = '0'
    TradeContext.TRCDAT     = TradeContext.TRCDAT
    TradeContext.TRCNO      = TradeContext.SerialNo
    TradeContext.ORTRCDAT   = trcbka_dict['TRCDAT']
    TradeContext.ORTRCNO    = trcbka_dict['TRCNO']
    TradeContext.ORSNDBNK   = trcbka_dict['SNDBNKCO']
    TradeContext.ORRCVBNK   = trcbka_dict['RCVBNKCO']
    TradeContext.ORTRCCO    = hdcbka_dict['TRCCO']
    TradeContext.ORCUR      = TradeContext.CUR
    TradeContext.OROCCAMT   = str(hdcbka_dict['OCCAMT'])
    TradeContext.ORQYDAT    = hdcbka_dict['BJEDTE']
    TradeContext.OQTSBNK    = hdcbka_dict['SNDBNKCO']
    TradeContext.OQTNO      = hdcbka_dict['TRCNO']
    
    AfaLoggerFunc.tradeInfo(">>>结束为汇兑查复书报文赋值")
    
    return True
Beispiel #9
0
def SubModuleDoFst():
    AfaLoggerFunc.tradeInfo( "进入查询 ")
    #=====判断接口是否存在====
    if( not TradeContext.existVariable( "BOJEDT" ) ):
        return AfaFlowControl.ExitThisFlow('A099', '无报单日期,处理失败')
    if( not TradeContext.existVariable( "BOSPSQ" ) ):
        return AfaFlowControl.ExitThisFlow('A099', '无交易序号,处理失败')
    if( not TradeContext.existVariable( "CONT" ) ):
        return AfaFlowControl.ExitThisFlow('A099', '无查询内容,处理失败')
    
    #=====判断业务类型=====
    AfaLoggerFunc.tradeInfo("开始判断业务类型")
    
    if( TradeContext.OPRTYPNO == '20' ):    #汇兑
        AfaLoggerFunc.tradeInfo("进入汇兑处理")
            
        #=====查询数据库====
        trcbka_dict = {}
        res=rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka_dict)
        if(res==False):
            return AfaFlowControl.ExitThisFlow('S999','数据库中无记录') 
        
        #=====刘雨龙 2008-07-21 新增往来账标志判断====
        if trcbka_dict['BRSFLG']  ==  PL_BRSFLG_RCV:
            return AfaFlowControl.ExitThisFlow('S999','非往帐业务不允许此操作')
        
        ztcbka_dict={}
        #=====设置插入字典====
        if not rccpsMap8529Dtrcbka_dict2Dztcbka_dict.map(trcbka_dict,ztcbka_dict):
            return AfaFlowControl.ExitThisFlow('M999','字典赋值错误')
 
        ztcbka_dict['CONT']=TradeContext.CONT   #手工添加的字段
        #=====刘雨龙 20080702 修改交易日期和报单序号====
        ztcbka_dict['BJEDTE']   =  TradeContext.BJEDTE
        ztcbka_dict['BSPSQN']   =  TradeContext.BSPSQN
        ztcbka_dict['ORTRCCO']  =  ztcbka_dict['TRCCO']
        ztcbka_dict['NCCWKDAT'] =  TradeContext.NCCworkDate
        ztcbka_dict['TRCCO']    =  "9900506"             #9900506 止付业务状态查询
        ztcbka_dict['TRCNO']    =  TradeContext.SerialNo
        ztcbka_dict['SNDMBRCO'] =  TradeContext.SNDSTLBIN
        ztcbka_dict['RCVMBRCO'] =  TradeContext.RCVSTLBIN
        ztcbka_dict['ISDEAL']   =  PL_ISDEAL_UNDO
        ztcbka_dict['BOJEDT']   =  TradeContext.BOJEDT
        ztcbka_dict['BOSPSQ']   =  TradeContext.BOSPSQ
    
        AfaLoggerFunc.tradeInfo("ztcbka_dict:"+str(ztcbka_dict))
        
        #=====插入数据库====
        AfaLoggerFunc.tradeInfo("开始插入数据库")
        #=====刘雨龙 20080702 修改insert_dict为ztcbka_dict====
        rowcount=rccpsDBTrcc_ztcbka.insertCmt(ztcbka_dict)
        if(rowcount==-1):
            return AfaFlowControl.ExitThisFlow('A099','插入数据库失败' )
    
        #=====刘雨龙 20080702 新增发送农信银中心字段====
        TradeContext.ORTRCCO  = ztcbka_dict['ORTRCCO']
        TradeContext.ORTRCDAT = ztcbka_dict['TRCDAT']
        TradeContext.ORTRCNO  = ztcbka_dict['TRCNO']
        TradeContext.ORSNDBNK = ztcbka_dict['SNDBNKCO']
        TradeContext.ORRCVBNK = ztcbka_dict['RCVBNKCO']
        TradeContext.OROCCAMT = str(ztcbka_dict['OCCAMT'])
        #TradeContext.OPRTYPNO = TradeContext.OPRTYPNO[0:2]
        TradeContext.OPRTYPNO = '99'
        TradeContext.ROPRTPNO = TradeContext.ORTRCCO[0:2]
        
        
    elif( TradeContext.OPRTYPNO == '21' ):    #汇票
        AfaLoggerFunc.tradeInfo("进入汇票处理")
        
        #=====查询数据库====
        bilbka_dict = {}
        res = rccpsDBFunc.getTransBil(TradeContext.BOJEDT,TradeContext.BOSPSQ,bilbka_dict)
        if( res == False ):
            return AfaFlowControl.ExitThisFlow('S999','数据库中无记录')
            
        #=====判断往来标志====
        if( bilbka_dict['BRSFLG'] == PL_BRSFLG_RCV ):
            return AfaFlowControl.ExitThisFlow('S999','非往帐业务不允许此操作')
        
        #=====查询汇票信息登记簿====
        bilinf_dict = {}
        ret = rccpsDBFunc.getInfoBil(bilbka_dict['BILVER'],bilbka_dict['BILNO'],bilbka_dict['BILRS'],bilinf_dict)
        if( ret == False ):
            return AfaFlowControl.ExitThisFlow('S999','汇票信息登记簿中无记录')
        
        #=====给插入字典赋值====
#        ztcbka_dict={}
#        if not rccpsMap8529Dbilbka2Dztcbka.map(bilbka_dict,ztcbka_dict):
#            return AfaFlowControl.ExitThisFlow('M999','字典赋值错误')
        AfaLoggerFunc.tradeInfo("开始给插入字典赋值")
        ztcbka_dict = {}
        
        ztcbka_dict['BJEDTE']   = TradeContext.BJEDTE
        ztcbka_dict['BSPSQN']   = TradeContext.BSPSQN
        ztcbka_dict['BRSFLG']   = PL_BRSFLG_SND
        ztcbka_dict['BESBNO']   = TradeContext.BESBNO
        ztcbka_dict['BEACSB']   = ""
        ztcbka_dict['BETELR']   = TradeContext.BETELR
        ztcbka_dict['BEAUUS']   = ""
        ztcbka_dict['NCCWKDAT'] = TradeContext.NCCworkDate
        ztcbka_dict['TRCCO']    = '9900506'
        ztcbka_dict['TRCDAT']   = TradeContext.TRCDAT
        ztcbka_dict['TRCNO']    = TradeContext.SerialNo
        ztcbka_dict['SNDMBRCO'] = bilbka_dict['SNDMBRCO']
        ztcbka_dict['RCVMBRCO'] = bilbka_dict['RCVMBRCO']
        ztcbka_dict['SNDBNKCO'] = TradeContext.SNDBNKCO
        ztcbka_dict['SNDBNKNM'] = TradeContext.SNDBNKNM
        ztcbka_dict['RCVBNKCO'] = bilbka_dict['RCVBNKCO']
        ztcbka_dict['RCVBNKNM'] = bilbka_dict['RCVBNKNM']
        ztcbka_dict['BOJEDT']   = bilbka_dict['BJEDTE']
        ztcbka_dict['BOSPSQ']   = bilbka_dict['BSPSQN']
        ztcbka_dict['ORTRCCO']  = bilbka_dict['TRCCO']
        ztcbka_dict['CUR']      = bilinf_dict['CUR']
        #=====判断业务状态====
        if( bilbka_dict['HPSTAT'] == PL_HPSTAT_PAYC ):  #解付
            ztcbka_dict['OCCAMT'] = bilinf_dict['OCCAMT']
        else:
            ztcbka_dict['OCCAMT'] = bilinf_dict['BILAMT']
        ztcbka_dict['CONT']     = TradeContext.CONT
        ztcbka_dict['NCCTRCST'] = ""
        ztcbka_dict['MBRTRCST'] = ""
        ztcbka_dict['ISDEAL']   = PL_ISDEAL_UNDO
        ztcbka_dict['PRCCO']    = ""
        ztcbka_dict['STRINFO']  = ""
        ztcbka_dict['NOTE1']    = bilbka_dict['NOTE1']
        ztcbka_dict['NOTE2']    = bilbka_dict['NOTE2']
        ztcbka_dict['NOTE3']    = bilbka_dict['NOTE3']
        ztcbka_dict['NOTE4']    = bilbka_dict['NOTE4']
        
        AfaLoggerFunc.tradeInfo("OCCAMT="+str(bilinf_dict['OCCAMT']))
        
        #=====登记业务状态查询查复登记簿====
        AfaLoggerFunc.tradeInfo("开始插入业务状态查询查复登记簿")
        rowcount=rccpsDBTrcc_ztcbka.insertCmt(ztcbka_dict)
        if(rowcount==-1):
            return AfaFlowControl.ExitThisFlow('A099','插入数据库失败' )
            
        #=====给业务状态查询报文赋值====
        AfaLoggerFunc.tradeInfo("开始给业务状态查询报文赋值")
        #=====报文头====
        TradeContext.NCCWKDAT = TradeContext.NCCworkDate
        TradeContext.RCVMBRCO = bilbka_dict['RCVMBRCO']
        TradeContext.RCVSTLBIN = bilbka_dict['RCVMBRCO']
        TradeContext.SNDSTLBIN = TradeContext.SNDSTLBIN
        TradeContext.SNDMBRCO = TradeContext.SNDSTLBIN
        TradeContext.SNDBRHCO = TradeContext.BESBNO
        TradeContext.SNDCLKNO = TradeContext.BETELR
#        TradeContext.SNDTRDAT = TradeContext.BJEDTE
#        TradeContext.SNDTRTIM = TradeContext.BJETIM
        TradeContext.ORMFN    = TradeContext.RCVSTLBIN+TradeContext.BJEDTE+TradeContext.SerialNo
        TradeContext.OPRTYPNO = '99'
        TradeContext.ROPRTPNO = '21'
        TradeContext.TRANTYP  = '0'
        #=====业务要素集====
        TradeContext.TRCCO    = '9900506'
#        TradeContext.SNDBNKCO = 
#        TradeContext.SNDBNKNM = 
        TradeContext.RCVBNKCO = bilbka_dict['RCVBNKCO']
        TradeContext.RCVBNKNM = bilbka_dict['RCVBNKNM']
        TradeContext.TRCDAT   = TradeContext.BJEDTE
        TradeContext.TRCNO    = TradeContext.SerialNo
        TradeContext.ORTRCCO  = bilbka_dict['TRCCO']
        TradeContext.ORTRCDAT = bilbka_dict['TRCDAT']
        TradeContext.ORTRCNO  = bilbka_dict['TRCNO']
        TradeContext.ORSNDBNK = bilbka_dict['SNDBNKCO']
        TradeContext.ORRCVBNK = bilbka_dict['RCVBNKCO']
        TradeContext.ORCUR    = bilinf_dict['CUR']        #11
        TradeContext.OROCCAMT = str(bilinf_dict['OCCAMT'])
        
        AfaLoggerFunc.tradeInfo("支付业务状态查询,汇票处理结束")
        
    #=====通存通兑=====
    elif( TradeContext.OPRTYPNO == '30' ):
        AfaLoggerFunc.tradeInfo("开始通存通兑处理")
        
        #=====判断要查询的交易是否为当日交易====
        if( TradeContext.BOJEDT != TradeContext.BJEDTE ):
            return AfaFlowControl.ExitThisFlow('A009','原交易不是当日交易')
        
        #=====查询通存通兑业务登记簿====
        AfaLoggerFunc.tradeInfo("查询通存通兑业务登记簿")
        where_dict = {'BJEDTE':TradeContext.BOJEDT,'BSPSQN':TradeContext.BOSPSQ}
        wtrbka_dict = rccpsDBTrcc_wtrbka.selectu(where_dict)
        if( wtrbka_dict == None ):
            return AfaFlowControl.ExitThisFlow('A009','查询通存通兑业务登记簿失败')
            
        if( len(wtrbka_dict) == 0 ):
            return AfaFlowControl.ExitThisFlow('A009','查询通存通兑业务登记簿结果为空') 
            
        #=====判断要查询的交易是否是本机构发起的====
        AfaLoggerFunc.tradeInfo("判断要查询的交易是否是本机构发起的")
        if( wtrbka_dict['BESBNO'] != TradeContext.BESBNO ):
            return AfaFlowControl.ExitThisFlow('A009','要查询的交易不是本机构发起的') 
            
        #=====登记业务状态查询查复登记簿====
        AfaLoggerFunc.tradeInfo("登记业务状态查询查复登记簿")
        
        #=====给插入字典赋值====
        AfaLoggerFunc.tradeInfo("给插入字典赋值")
        ztcbka_dict = {}
        ztcbka_dict['BJEDTE']   = TradeContext.BJEDTE
        ztcbka_dict['BSPSQN']   = TradeContext.BSPSQN
        ztcbka_dict['BRSFLG']   = PL_BRSFLG_SND
        ztcbka_dict['BESBNO']   = TradeContext.BESBNO
        ztcbka_dict['BEACSB']   = ""
        ztcbka_dict['BETELR']   = TradeContext.BETELR
        ztcbka_dict['BEAUUS']   = ""
        ztcbka_dict['NCCWKDAT'] = TradeContext.NCCworkDate
        ztcbka_dict['TRCCO']    = '9900506'
        ztcbka_dict['TRCDAT']   = TradeContext.TRCDAT
        ztcbka_dict['TRCNO']    = TradeContext.SerialNo
        ztcbka_dict['SNDMBRCO'] = wtrbka_dict['SNDMBRCO']
        ztcbka_dict['RCVMBRCO'] = wtrbka_dict['RCVMBRCO']
        ztcbka_dict['SNDBNKCO'] = TradeContext.SNDBNKCO
        ztcbka_dict['SNDBNKNM'] = TradeContext.SNDBNKNM
        ztcbka_dict['RCVBNKCO'] = wtrbka_dict['RCVBNKCO']
        ztcbka_dict['RCVBNKNM'] = wtrbka_dict['RCVBNKNM']
        ztcbka_dict['BOJEDT']   = wtrbka_dict['BJEDTE']
        ztcbka_dict['BOSPSQ']   = wtrbka_dict['BSPSQN']
        ztcbka_dict['ORTRCCO']  = wtrbka_dict['TRCCO']
        ztcbka_dict['CUR']      = wtrbka_dict['CUR']
        ztcbka_dict['OCCAMT']   = wtrbka_dict['OCCAMT']
        ztcbka_dict['CONT']     = TradeContext.CONT
        ztcbka_dict['NCCTRCST'] = ""
        ztcbka_dict['MBRTRCST'] = ""
        ztcbka_dict['ISDEAL']   = PL_ISDEAL_UNDO
        ztcbka_dict['PRCCO']    = ""
        ztcbka_dict['STRINFO']  = ""
        ztcbka_dict['NOTE1']    = wtrbka_dict['NOTE1']
        ztcbka_dict['NOTE2']    = wtrbka_dict['NOTE2']
        ztcbka_dict['NOTE3']    = wtrbka_dict['NOTE3']
        ztcbka_dict['NOTE4']    = wtrbka_dict['NOTE4']
        
        AfaLoggerFunc.tradeInfo("开始插入业务状态查询查复登记簿")
        rowcount=rccpsDBTrcc_ztcbka.insertCmt(ztcbka_dict)
        if(rowcount==-1):
            return AfaFlowControl.ExitThisFlow('A099','插入数据库失败' )
        
        #=====开始给也务状态查询报文赋值====
        #=====报文头====
        TradeContext.MSGTYPCO  = "SET008"
        TradeContext.NCCWKDAT  = TradeContext.NCCworkDate
        TradeContext.RCVMBRCO  = wtrbka_dict['RCVMBRCO']
        TradeContext.RCVSTLBIN = wtrbka_dict['RCVMBRCO']
        TradeContext.SNDSTLBIN = TradeContext.SNDSTLBIN
        TradeContext.SNDMBRCO  = TradeContext.SNDSTLBIN
        TradeContext.SNDBRHCO  = TradeContext.BESBNO
        TradeContext.SNDCLKNO  = TradeContext.BETELR
#        TradeContext.SNDTRDAT  = TradeContext.BJEDTE
#        TradeContext.SNDTRTIM  = TradeContext.BJETIM
        TradeContext.ORMFN     = wtrbka_dict['MSGFLGNO']
        TradeContext.OPRTYPNO  = '99'
        TradeContext.ROPRTPNO  = '30'
        TradeContext.TRANTYP   = '0'
        #=====业务要素集====
        TradeContext.TRCCO    = '9900506'
#        TradeContext.SNDBNKCO = 
#        TradeContext.SNDBNKNM = 
        TradeContext.RCVBNKCO = wtrbka_dict['RCVBNKCO']
        TradeContext.RCVBNKNM = wtrbka_dict['RCVBNKNM']
#        TradeContext.TRCDAT   = TradeContext.BJEDTE
        TradeContext.TRCNO    = TradeContext.SerialNo
        TradeContext.ORTRCCO  = wtrbka_dict['TRCCO']
        TradeContext.ORTRCDAT = wtrbka_dict['TRCDAT']
        TradeContext.ORTRCNO  = wtrbka_dict['TRCNO']
        TradeContext.ORSNDBNK = wtrbka_dict['SNDBNKCO']
        TradeContext.ORRCVBNK = wtrbka_dict['RCVBNKCO']
        TradeContext.ORCUR    = wtrbka_dict['CUR']        #11
        TradeContext.OROCCAMT = str(wtrbka_dict['OCCAMT'])
#        TradeContext.CONT     = 
    else:
        return AfaFlowControl.ExitThisFlow('S999','业务类型错误')
        
        
    return True
Beispiel #10
0
def SubModuleDoFst():
    #=================查询原查复信息============================================
    
    if not TradeContext.existVariable('ORQYDAT'):
        return AfaFlowControl.ExitThisFlow("S999", "原查询日期不能为空")
    
    if not TradeContext.existVariable('OQTNO'):
        return AfaFlowControl.ExitThisFlow("S999", "原查询号不能为空")
        
    #=====刘雨龙 20080701 修改查询函数====
    #=====使用错误函数,应该查询 查询查复登记簿 中关于特约汇兑查询的信息====
    AfaLoggerFunc.tradeInfo(">>>开始查询原查询书信息")
    hdcbka = {}
    hdcbka['BJEDTE']   =  TradeContext.ORQYDAT     #查询日期
    hdcbka['BSPSQN']   =  TradeContext.OQTNO       #报单序号

    hdcbka_dict = rccpsDBTrcc_hdcbka.selectu(hdcbka)

    if hdcbka_dict == None:
        return AfaFlowControl.ExitThisFlow('S999','查询数据库出错')
    if len(hdcbka_dict) <= 0:
        return AfaFlowControl.ExitThisFlow('S999','数据库中无相应记录')


    #=====刘雨龙 20080702 增加判断是否已查复====
    if hdcbka_dict['ISDEAL'] == PL_ISDEAL_ISDO:
        return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.OQTNO+']该笔业务已查复')

    #=====刘雨龙 20080725 增加判断是否来账====
    if hdcbka_dict['BRSFLG'] != PL_BRSFLG_RCV:
        return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.OQTNO+']该笔业务不为来账查询书')

    #=====刘雨龙 20080722 增加判断原交易代码是否为:特约汇兑查询书 9900522====
    if hdcbka_dict['TRCCO'] != '9900522':
        return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.OQTNO+']该笔业务不为特约汇兑查询书')

    AfaLoggerFunc.tradeInfo(">>>开始查询原交易信息")
    trcbka_dict = {}
    ret = rccpsDBFunc.getTransTrc(hdcbka_dict['BOJEDT'],hdcbka_dict['BOSPSQ'],trcbka_dict)
    
    if not ret:
        return AfaFlowControl.ExitThisFlow('S999','查询原交易信息失败') 
    
    AfaLoggerFunc.tradeInfo(">>>结束查询数据库信息")
    #=================登记查复书信息============================================
    AfaLoggerFunc.tradeInfo(">>>开始登记特约电子汇兑业务查复书信息")
    
    #TradeContext.RCVBNKCO = hdcbka_dict['SNDBNKCO']
    #TradeContext.RCVBNKNM = hdcbka_dict['SNDBNKNM']
    TradeContext.NCCWKDAT = TradeContext.NCCworkDate
    TradeContext.ISDEAL   = PL_ISDEAL_ISDO            #查复标识为已处理
    
    #=====刘雨龙 20080701 增加数据库内容====
    TradeContext.CUR      = trcbka_dict['CUR']        #币种
    TradeContext.ORTRCCO  = hdcbka_dict['TRCCO']      #原交易代码
    TradeContext.OCCAMT   = trcbka_dict['OCCAMT']     #交易金额
    TradeContext.PYRACC   = trcbka_dict['PYRACC']     #付款人账号
    TradeContext.PYEACC   = trcbka_dict['PYEACC']     #收款人账号
    TradeContext.NOTE1    = hdcbka_dict['NOTE1']      #备注1
    TradeContext.NOTE2    = hdcbka_dict['NOTE2']      #备注2
    TradeContext.NOTE3    = hdcbka_dict['NOTE3']      #备注3
    TradeContext.NOTE4    = hdcbka_dict['NOTE4']      #备注4
    TradeContext.BRSFLG   = PL_BRSFLG_SND             #往来标志
    
    hdcbka_insert_dict = {}
    if not rccpsMap8519CTradeContext2Dhdcbka.map(hdcbka_insert_dict):
        return AfaFlowControl.ExitThisFlow("S999", "为特约电子汇兑业务查询查复登记簿赋值异常")
  
    #关彬捷 20080728 BJEDTE和BSPSQN在map函数中已赋值
    #hdcbka_insert_dict['BJEDTE']  =  TradeContext.BJEDTE
    #hdcbka_insert_dict['BSPSQN']  =  TradeContext.BSPSQN
    
    #=====潘广通 20080729 生成打印表格中的数据====
    TradeContext.OR_SNDBNKCO = trcbka_dict['SNDBNKCO']
    TradeContext.OR_TRCDAT   = trcbka_dict['TRCDAT']
    TradeContext.OR_TRCNO    = trcbka_dict['TRCNO']
    TradeContext.OR_OCCAMT   = trcbka_dict['OCCAMT']
        
    ret = rccpsDBTrcc_hdcbka.insertCmt(hdcbka_insert_dict)
    
    if ret <= 0:
        return AfaFlowControl.ExitThisFlow("S999", "登记特约电子汇兑业务查复书信息异常")
    
    AfaLoggerFunc.tradeInfo(">>>结束登记特约电子汇兑业务查复书信息")
    
    #=================为特约电子汇兑查复书报文赋值======================================
    AfaLoggerFunc.tradeInfo(">>>开始为特约电子汇兑查复书报文赋值")
    
    TradeContext.MSGTYPCO   = 'SET008'
    TradeContext.SNDBRHCO   = TradeContext.BESBNO
    TradeContext.SNDCLKNO   = TradeContext.BETELR
    TradeContext.SNDTRDAT   = TradeContext.BJEDTE
    TradeContext.SNDTRTIM   = TradeContext.BJETIM
    #TradeContext.MSGFLGNO   = TradeContext.SNDSTLBIN + TradeContext.TRCDAT + TradeContext.SerialNo
    TradeContext.ORMFN      = hdcbka_dict['SNDMBRCO'] + hdcbka_dict['TRCDAT'] + hdcbka_dict['TRCNO']
    TradeContext.NCCWKDAT   = TradeContext.NCCworkDate
    TradeContext.OPRTYPNO   = '99'
    TradeContext.ROPRTPNO   = '99'
    TradeContext.TRANTYP    = '0'
    TradeContext.TRCDAT     = TradeContext.TRCDAT
    TradeContext.TRCNO      = TradeContext.SerialNo
    TradeContext.ORTRCDAT   = hdcbka_dict['TRCDAT']
    TradeContext.ORTRCNO    = hdcbka_dict['TRCNO']
    TradeContext.ORSNDBNK   = hdcbka_dict['SNDBNKCO']
    TradeContext.ORRCVBNK   = hdcbka_dict['RCVBNKCO']
    TradeContext.ORTRCCO    = hdcbka_dict['TRCCO']
    TradeContext.ORCUR      = trcbka_dict['CUR']
    TradeContext.OROCCAMT   = str(trcbka_dict['OCCAMT'])
    TradeContext.ORQYDAT    = hdcbka_dict['BJEDTE']
    TradeContext.OQTSBNK    = hdcbka_dict['SNDBNKCO']

    #=====刘雨龙 20080701 新增收/付款人名称====
    TradeContext.PYENAM     = trcbka_dict['PYENAM']       #收款人名称
    TradeContext.PYRNAM     = trcbka_dict['PYRNAM']       #付款人名称
    TradeContext.OROQTNO    = hdcbka_dict['TRCNO']        #原特约查询交易流水号
    TradeContext.BOJEDT     = hdcbka_dict['BJEDTE']
    TradeContext.BOSPSQ     = hdcbka_dict['BSPSQN']
    
    
    AfaLoggerFunc.tradeInfo(">>>结束为特约电子汇兑查复书报文赋值")
    
   
    return True
Beispiel #11
0
def SubModuleDoFst():
    #=================查询原交易信息============================================
    
    if not TradeContext.existVariable('BOJEDT'):
        return AfaFlowControl.ExitThisFlow("S999", "原交易日期不能为空")
    
    if not TradeContext.existVariable('BOSPSQ'):
        return AfaFlowControl.ExitThisFlow("S999", "原报单序号不能为空")
        
    AfaLoggerFunc.tradeInfo(">>>开始查询原汇兑业务交易信息")
    
    trcbka_dict = {}
    ret = rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka_dict)
    
    if not ret:
        return False
    
    AfaLoggerFunc.tradeInfo(">>>开始查询原汇兑业务交易信息")
    #=================登记查询书信息============================================
    AfaLoggerFunc.tradeInfo(">>>开始登记汇兑业务查询书信息")
    
    #TradeContext.RCVBNKCO = trcbka_dict['RCVBNKCO']
    #TradeContext.RCVBNKNM = trcbka_dict['RCVBNKNM']
    TradeContext.NCCWKDAT = TradeContext.NCCworkDate
    TradeContext.ISDEAL   = PL_ISDEAL_UNDO            #查复标识为未查复
    
    #=====刘雨龙 20080701 新增汇兑业务查询查复登记簿信息====
    TradeContext.TRCNO    = TradeContext.SerialNo       #交易流水号
    TradeContext.ORTRCCO    = trcbka_dict['TRCCO']      #原交易代码
    TradeContext.CUR      = trcbka_dict['CUR']          #原币种
    TradeContext.OCCAMT   = str(trcbka_dict['OCCAMT'])  #原交易金额
    TradeContext.PYRACC   = trcbka_dict['PYRACC']       #原付款人账号
    TradeContext.PYEACC   = trcbka_dict['PYEACC']       #原收款人账号
    #TradeContext.PRCCO    = trcbka_dict['PRCCO']        #中心返回代码   关彬捷 删除 20080728
    TradeContext.NOTE1    = trcbka_dict['NOTE1']        #备注1
    TradeContext.NOTE2    = trcbka_dict['NOTE2']        #备注2
    TradeContext.NOTE3    = trcbka_dict['NOTE3']        #备注3
    TradeContext.NOTE4    = trcbka_dict['NOTE4']        #备注4
    
    TradeContext.PRT_OROCCAMT = trcbka_dict['OCCAMT']
    
    hdcbka_insert_dict = {}
    if not rccpsMap8511CTradeContext2Dhdcbka.map(hdcbka_insert_dict):
        return AfaFlowControl.ExitThisFlow("S999", "为汇兑业务查询查复登记簿赋值异常")
        
    ret = rccpsDBTrcc_hdcbka.insertCmt(hdcbka_insert_dict)
    
    if ret <= 0:
        return AfaFlowControl.ExitThisFlow("S999", "登记汇兑业务查询书信息异常")
    
    AfaLoggerFunc.tradeInfo(">>>结束登记汇兑业务查询书信息")
    
    #=====赋值给打印表单中的变量====
    TradeContext.OROCCAMT=str(trcbka_dict['OCCAMT'])
    TradeContext.ORSNDBNKCO=trcbka_dict['SNDBNKCO']
    TradeContext.ORRCVBNKCO=trcbka_dict['RCVBNKCO']
    
    
    #=================为汇兑查询书报文赋值=====================================
    AfaLoggerFunc.tradeInfo(">>>开始为汇兑查询书报文赋值")
    
    TradeContext.TRCCO      = '9900511'
    TradeContext.MSGTYPCO   = 'SET008'
    TradeContext.SNDBRHCO   = TradeContext.BESBNO
    TradeContext.SNDCLKNO   = TradeContext.BETELR
    TradeContext.SNDTRDAT   = TradeContext.BJEDTE
    TradeContext.SNDTRTIM   = TradeContext.BJETIM
    TradeContext.MSGFLGNO   = TradeContext.SNDSTLBIN + TradeContext.TRCDAT + TradeContext.SerialNo
    TradeContext.ORMFN      = trcbka_dict['SNDMBRCO'] + trcbka_dict['TRCDAT'] + trcbka_dict['TRCNO']
    TradeContext.NCCWKDAT   = TradeContext.NCCworkDate
    TradeContext.OPRTYPNO   = '99'
    TradeContext.ROPRTPNO   = '20'
    TradeContext.TRANTYP    = '0'
    TradeContext.TRCDAT     = TradeContext.TRCDAT
    TradeContext.TRCNO      = TradeContext.SerialNo
    TradeContext.ORTRCDAT   = trcbka_dict['TRCDAT']
    TradeContext.ORTRCNO    = trcbka_dict['TRCNO']
    TradeContext.ORSNDBNK   = trcbka_dict['SNDBNKCO']
    TradeContext.ORRCVBNK   = trcbka_dict['RCVBNKCO']
    TradeContext.ORCUR      = trcbka_dict['CUR']
    TradeContext.OROCCAMT   = str(trcbka_dict['OCCAMT'])
    
    AfaLoggerFunc.tradeInfo(">>>结束为汇兑查询书报文赋值")
    
    
    return True
Beispiel #12
0
def SubModuleDoFst():
    #====开始取流水号对应信息====
    trcbka_dict = {}
    dict = rccpsDBFunc.getTransTrc(TradeContext.BOJEDT,TradeContext.BOSPSQ,trcbka_dict)
    if dict == False:
        return AfaFlowControl.ExitThisFlow('M999','取交易信息失败')

    #=====判断撤销信息====
    if trcbka_dict['BRSFLG'] != PL_BRSFLG_RCV:
        return AfaFlowControl.ExitThisFlow('M999','原交易为往帐业务,不允许退汇操作')
    if TradeContext.BESBNO != trcbka_dict["BESBNO"]:
        return AfaFlowControl.ExitThisFlow('M999','不允许跨机构退汇')
    if str(trcbka_dict['TRCCO']) == '2000009':
        return AfaFlowControl.ExitThisFlow('M999','特约汇兑业务不允许退汇')
    if str(trcbka_dict['TRCCO']) == '2000004':
        return AfaFlowControl.ExitThisFlow('M999','退汇业务不允许再次退汇')
    if str(trcbka_dict['TRCCO'])[0:2] != '20':
        return AfaFlowControl.ExitThisFlow('M999','非汇兑业务不允许退汇')
    if trcbka_dict["BCSTAT"] != PL_BCSTAT_HANG:   #自动挂账状态 1 成功
         return AfaFlowControl.ExitThisFlow('M999','当前业务状态为['+str(trcbka_dict["BCSTAT"])+']不允许退汇' )

    TradeContext.ORSNDBNK    = trcbka_dict['SNDBNKCO']
    TradeContext.ORRCVBNK    = trcbka_dict['RCVBNKCO']
    TradeContext.ORSNDBNKNM  = trcbka_dict['SNDBNKNM']
    TradeContext.ORRCVBNKNM  = trcbka_dict['RCVBNKNM']

    #=====开始插入数据库====
    trcbka_dict["BRSFLG"]    = TradeContext.BRSFLG
    trcbka_dict["BOJEDT"]    = trcbka_dict["BJEDTE"]
    trcbka_dict["BOSPSQ"]    = trcbka_dict["BSPSQN"]
    trcbka_dict["ORTRCDAT"]  = trcbka_dict["TRCDAT"]
    trcbka_dict["ORTRCCO"]   = trcbka_dict["TRCCO"] 
    trcbka_dict["ORTRCNO"]   = trcbka_dict["TRCNO"] 
    trcbka_dict["ORSNDBNK"]  = trcbka_dict["SNDBNKCO"]
    trcbka_dict["ORRCVBNK"]  = trcbka_dict["RCVBNKCO"]
    trcbka_dict["BJEDTE"]    = TradeContext.BJEDTE
    trcbka_dict["BSPSQN"]    = TradeContext.BSPSQN
    trcbka_dict["BJETIM"]    = TradeContext.BJETIM
    trcbka_dict["TRCDAT"]    = TradeContext.TRCDAT
    trcbka_dict["STRINFO"]   = TradeContext.STRINFO
    trcbka_dict["TRCCO"]     = TradeContext.TRCCO
    trcbka_dict["TRCNO"]     = TradeContext.SerialNo
    trcbka_dict["SNDBNKCO"]  = TradeContext.SNDBNKCO
    trcbka_dict["SNDBNKNM"]  = TradeContext.SNDBNKNM
    trcbka_dict["SNDMBRCO"]  = TradeContext.SNDSTLBIN
    trcbka_dict["RCVBNKCO"]  = TradeContext.RCVBNKCO
    trcbka_dict["RCVBNKNM"]  = TradeContext.RCVBNKNM
    trcbka_dict["RCVMBRCO"]  = TradeContext.RCVSTLBIN
    trcbka_dict["OPRNO"]     = "09"
    trcbka_dict["BBSSRC"]    = "3"
    trcbka_dict["BETELR"]    = TradeContext.BETELR
    trcbka_dict["TERMID"]    = TradeContext.TERMID
    
    #=====刘雨龙 2008-09-17 注释对业务类型的赋空操作====
    #trcbka_dict["OPRATTNO"]  = ""
    
    trcbka_dict["NCCWKDAT"]  = TradeContext.NCCworkDate
    trcbka_dict["SEAL"]      = ""

    #=====为发送退汇报文赋值====
    TradeContext.OPRTYPNO    =  '20'   #汇兑
    TradeContext.ORTRCCO     = trcbka_dict['ORTRCCO']
    TradeContext.ORTRCDAT    = trcbka_dict['ORTRCDAT']
    TradeContext.ORTRCNO     = trcbka_dict['ORTRCNO']
    TradeContext.ORPYRACC    = trcbka_dict['PYRACC']
    TradeContext.ORPYRNAM    = trcbka_dict['PYRNAM']
    TradeContext.ORPYEACC    = trcbka_dict['PYEACC']
    TradeContext.ORPYENAM    = trcbka_dict['PYENAM']
    TradeContext.PYRACC      = trcbka_dict['PYRACC']
    TradeContext.PYRNAM      = trcbka_dict['PYRNAM']
    TradeContext.PYRADDR     = trcbka_dict['PYRADDR']
    TradeContext.PYEACC      = trcbka_dict['PYEACC']
    TradeContext.PYENAM      = trcbka_dict['PYENAM']
    TradeContext.PYEADDR     = trcbka_dict['PYEADDR']
    
    
    
    AfaLoggerFunc.tradeInfo( '字典trccan_dict:' + str(trcbka_dict) )

    #=====开始插入数据库====
    if not rccpsDBFunc.insTransTrc(trcbka_dict):
        #=====RollBack操作====
        AfaDBFunc.RollbackSql()
        return AfaFlowControl.ExitThisFlow('D002', '插入数据库出错,RollBack成功')

    #=====commit操作====
    if not AfaDBFunc.CommitSql():
        #=====RollBack操作====
        AfaDBFunc.RollbackSql()
        return AfaFlowControl.ExitThisFlow('D011', '数据库Commit失败')
    else:
        AfaLoggerFunc.tradeDebug('COMMIT成功')


    #=====设置sstlog表中状态为:记账-处理中====
    status = {}
    status['BJEDTE']     = TradeContext.BJEDTE
    status['BSPSQN']     = TradeContext.BSPSQN
    status['BCSTAT']     = PL_BCSTAT_ACC
    status['BDWFLG']     = PL_BDWFLG_WAIT

    if not rccpsState.setTransState(status):
        #=====RollBack操作====
        AfaDBFunc.RollbackSql()
        return AfaFlowControl.ExitThisFlow(TradeContext.errorCode, TradeContext.errorMsg)
    else:
        #=====commit操作====
        AfaDBFunc.CommitSql()
        AfaLoggerFunc.tradeInfo('>>>commit成功')

    #=====主机记账8813====
    TradeContext.HostCode  = '8813'
    TradeContext.OCCAMT    = str(trcbka_dict['OCCAMT'])     #金额
    TradeContext.RCCSMCD   = PL_RCCSMCD_LTH                 #主机摘要代码:来账退汇
    TradeContext.DASQ      = trcbka_dict['DASQ']
    #=====开始拼借贷方账号====
    TradeContext.RBAC =  TradeContext.BESBNO + PL_ACC_NXYDQSWZ
    #TradeContext.SBAC =  TradeContext.BESBNO + PL_ACC_NXYDXZ

    #=====开始调函数拼贷方账号第25位校验位====
    TradeContext.RBAC = rccpsHostFunc.CrtAcc(TradeContext.RBAC, 25)
    #TradeContext.SBAC = rccpsHostFunc.CrtAcc(TradeContext.SBAC, 25)
    AfaLoggerFunc.tradeInfo( '贷方账号:' + TradeContext.RBAC )
    #AfaLoggerFunc.tradeInfo( '借方账号:' + TradeContext.SBAC )

    return True