if not rccpsState.newBilState(hpdzcz_list[i]['BJEDTE'],hpdzcz_list[i]['BSPSQN'],HPSTAT): rccpsCronFunc.cronExit('S999', '设置汇票状态异常') AfaLoggerFunc.tradeInfo(">>>结束设置汇票状态") AfaLoggerFunc.tradeInfo(">>>开始设置短款成功状态") tmp_stat = {} tmp_stat['BJEDTE'] = hpdzcz_list[i]['BJEDTE'] tmp_stat['BSPSQN'] = hpdzcz_list[i]['BSPSQN'] tmptrc_dict = {} if not rccpsDBFunc.getTransBil(hpdzcz_list[i]['BJEDTE'],hpdzcz_list[i]['BSPSQN'],tmptrc_dict): rccpsCronFunc.cronExit('S999', '查询汇票交易业务信息异常') if not rccpsDBFunc.getInfoBil(tmptrc_dict['BILVER'],tmptrc_dict['BILNO'],tmptrc_dict['BILRS'],tmptrc_dict): rccpsCronFunc.cronExit('S999', '查询汇票信息异常') TradeContext.SBAC = TradeContext.BESBNO + PL_ACC_NXYDQSWZ #借农信银待清算往账 TradeContext.ACNM = "农信银待清算往账" TradeContext.RBAC = tmptrc_dict['PYHACC'] #贷持票人账号 TradeContext.OTNM = tmptrc_dict['PYHNAM'] #=====开始调函数拼贷方账号第25位校验位==== TradeContext.SBAC = rccpsHostFunc.CrtAcc(TradeContext.SBAC, 25) tmp_stat['BCSTAT'] = PL_BCSTAT_SHORT tmp_stat['BDWFLG'] = PL_BDWFLG_SUCC if not rccpsState.setTransState(tmp_stat): rccpsCronFunc.cronExit('S999', '设置短款成功状态异常')
def SubModuleDoFst(): AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).汇票撤销[TRCC003_8503]进入***' ) #====begin 蔡永贵 20110215 增加==== #新票据号是16位,需要取后8位,版本号为02,同时要兼容老票据号8位,版本号为01 if TradeContext.BILVER == '02': TradeContext.TMP_BILNO = TradeContext.BILNO[-8:] else: TradeContext.TMP_BILNO = TradeContext.BILNO #============end============ #校验当前汇票状态是否为签发或解挂 AfaLoggerFunc.tradeInfo(">>>开始校验当前汇票状态是否为签发或解挂") bilinf_dict = {} if not rccpsDBFunc.getInfoBil(TradeContext.BILVER,TradeContext.BILNO,PL_BILRS_INN,bilinf_dict): return AfaFlowControl.ExitThisFlow("S999","查询汇票信息异常") if bilinf_dict['REMBNKCO'] != TradeContext.SNDBNKCO: return AfaFlowControl.ExitThisFlow("S999","本行非此汇票出票行,禁止提交") if bilinf_dict['BILDAT'] != TradeContext.BJEDTE: return AfaFlowControl.ExitThisFlow("S999","非今日签发的汇票,禁止提交") if bilinf_dict['HPSTAT'] != PL_HPSTAT_SIGN and bilinf_dict['HPSTAT'] != PL_HPSTAT_DEHG and bilinf_dict['HPSTAT'] != PL_HPSTAT_HANG: return AfaFlowControl.ExitThisFlow("S999","此汇票当前状态非[签发,挂失,解挂],禁止提交") #=====通过日期+报单序号查询汇票业务登记簿rcc_bilbka,取“资金来源”==== #=====潘广通来负责完成==== bilbka_where_dict = {'BJEDTE':bilinf_dict['NOTE1'],'BSPSQN':bilinf_dict['NOTE2']} bilbka_dict = rccpsDBTrcc_bilbka.selectu(bilbka_where_dict) if( bilbka_dict == None ): return AfaFlowControl.ExitThisFlow("S999","查询汇票业务登记簿异常") if( len(bilbka_dict) <= 0 ): return AfaFlowControl.ExitThisFlow("S999","查询汇票业务登记簿为空") #=====潘广通 0916 判断柜员和机构是否为签发柜员和机构==== if( bilbka_dict['BETELR'] != TradeContext.BETELR ): return AfaFlowControl.ExitThisFlow("S999","此柜员不是录入柜员") #if( bilbka_dict['BESBNO'] != TradeContext.BESBNO): # return AfaFlowControl.ExitThisFlow("S999","此机构不是录入机构") #将签发交易的资金来源赋值到上下文 TradeContext.BBSSRC = bilbka_dict['BBSSRC'] #将汇票信息映射到TradeContext中 if not rccpsMap8503Dbilinf2CTradeContext.map(bilinf_dict): return False AfaLoggerFunc.tradeInfo(">>>结束校验当前汇票状态是否为签发或解挂") #汇票类交易接收成员行为总中心 TradeContext.RCVSTLBIN = PL_RCV_CENTER #接收行为签发时的代理付款行 TradeContext.RCVBNKCO = TradeContext.PAYBNKCO TradeContext.RCVBNKNM = TradeContext.PAYBNKNM #登记汇票业务登记簿 AfaLoggerFunc.tradeInfo(">>>开始登记汇票业务登记簿") TradeContext.SNDMBRCO = TradeContext.SNDSTLBIN TradeContext.RCVMBRCO = TradeContext.RCVSTLBIN TradeContext.TRCNO = TradeContext.SerialNo TradeContext.NCCWKDAT = TradeContext.NCCworkDate TradeContext.OPRNO = PL_HPOPRNO_CX #业务种类:撤销 TradeContext.DCFLG = PL_DCFLG_DEB #借贷标识:借记 TradeContext.BRSFLG = PL_BRSFLG_SND #往来标识:往账 TradeContext.TRCCO = '2100101' #交易代码:2100101汇票撤销 bilbka_dict = {} if not rccpsMap8503CTradeContext2Dbilbka.map(bilbka_dict): return False if not rccpsDBFunc.insTransBil(bilbka_dict): return AfaFlowControl.ExitThisFlow('S999','登记汇票业务登记簿异常') AfaLoggerFunc.tradeInfo(">>>结束登记汇票业务登记簿") #设置业务状态为发送处理中 AfaLoggerFunc.tradeInfo(">>>开始设置业务状态为发送处理中") stat_dict = {} stat_dict['BJEDTE'] = TradeContext.BJEDTE stat_dict['BSPSQN'] = TradeContext.BSPSQN stat_dict['BCSTAT'] = PL_BCSTAT_SND stat_dict['BDWFLG'] = PL_BDWFLG_WAIT if not rccpsState.setTransState(stat_dict): return AfaFlowControl.ExitThisFlow('S999','设置状态为发送处理中异常') AfaLoggerFunc.tradeInfo(">>>结束设置业务状态为发送处理中") #COMMIT if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") #为发送农信银中心做准备 AfaLoggerFunc.tradeInfo(">>>开始为发送农信银中心做准备") TradeContext.MSGTYPCO = 'SET001' TradeContext.TRCCO = '2100101' TradeContext.SNDBRHCO = TradeContext.BESBNO TradeContext.SNDCLKNO = TradeContext.BETELR TradeContext.SNDTRDAT = TradeContext.BJEDTE TradeContext.SNDTRTIM = TradeContext.BJETIM TradeContext.MSGFLGNO = TradeContext.SNDMBRCO + TradeContext.BJEDTE + TradeContext.TRCNO TradeContext.ORMFN = "" TradeContext.OPRTYPNO = '21' TradeContext.ROPRTPNO = '' TradeContext.TRANTYP = '0' TradeContext.OCCAMT = str(TradeContext.BILAMT) TradeContext.BILAMT = str(TradeContext.BILAMT) #begin 20110614 曾照泰 修改 送往农信银中心的票号为8位 TradeContext.BILNO = TradeContext.BILNO[-8:] #end AfaLoggerFunc.tradeInfo(">>>结束为发送农信银中心做准备") AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).汇票撤销[TRCC003_8503]退出***' ) return True
def SubModuleDoFst(): AfaLoggerFunc.tradeInfo('>>>进入汇票挂失/解挂操作') #====begin 蔡永贵 20110215 增加==== #新票据号是16位,需要取后8位,版本号为02,同时要兼容老票据号8位,版本号为01 if TradeContext.BILVER == '02': TradeContext.TMP_BILNO = TradeContext.BILNO[-8:] else: TradeContext.TMP_BILNO = TradeContext.BILNO #============end============ #=====开始查询汇票信息==== AfaLoggerFunc.tradeDebug('>>>开始查询汇票信息') bil_dict = {} if not rccpsDBFunc.getInfoBil(TradeContext.BILVER,TradeContext.BILNO,TradeContext.BILRS,bil_dict): return AfaFlowControl.ExitThisFlow('S999','查询汇票信息出错') AfaLoggerFunc.tradeDebug('>>>结束查询汇票信息') #=====判断现金或者转账汇票,只有现金汇票可以进行挂失==== #if bil_dict['PAYWAY'] != '0': # return AfaFlowControl.ExitThisFlow('S999','转账汇票不允许挂失/解挂') AfaLoggerFunc.tradeDebug('>>>判断汇票是否允许挂失') if bil_dict['REMBNKCO'] != TradeContext.SNDBNKCO: return AfaFlowControl.ExitThisFlow('S999','只能由签发行进行挂失操作') AfaLoggerFunc.tradeDebug('>>>判断签发行和挂失行是否一致') if bil_dict['SEAL'] == '': return AfaFlowControl.ExitThisFlow('S999','密押空错误') else: TradeContext.SEAL = bil_dict['SEAL'] AfaLoggerFunc.tradeDebug('>>>结束密押判断') #=====查询数据库==== records = {} ret = rccpsDBFunc.getTransBil(bil_dict['NOTE1'],bil_dict['NOTE2'],records) if( ret == False): return AfaFlowControl.ExitThisFlow('A099', '无此数据') if str(bil_dict['BILAMT']) == '': return AfaFlowControl.ExitThisFlow('S999','金额空错误') else: TradeContext.OCCAMT = str(bil_dict['BILAMT']) TradeContext.PYRACC = bil_dict['PYRACC'] TradeContext.PYRNAM = bil_dict['PYRNAM'] TradeContext.PYRADDR = bil_dict['PYRADDR'] TradeContext.PYEACC = bil_dict['PYEACC'] TradeContext.PYENAM = bil_dict['PYENAM'] TradeContext.PYEADDR = bil_dict['PYEADDR'] TradeContext.BILDAT = bil_dict['BILDAT'] TradeContext.RCVBNKCO = bil_dict['PAYBNKCO'] TradeContext.RCVBNKNM = bil_dict['PAYBNKNM'] TradeContext.BBSSRC = records['BBSSRC'] TradeContext.OPRNO = records['OPRNO'] AfaLoggerFunc.tradeDebug('>>>开始判断汇票操作类型') #=====判断TRCCO汇票操作类型==== if TradeContext.TRCCO == '2100102': #=====汇票挂失==== if TradeContext.SNDBNKCO != bil_dict['REMBNKCO']: return AfaFlowControl.ExitThisFlow('S999','汇票必须由签发行进行挂失') #=====判断汇票状态是否 签发 或者 解挂 状态==== if not (bil_dict['HPSTAT'] == PL_HPSTAT_SIGN or bil_dict['HPSTAT'] == PL_HPSTAT_DEHG): return AfaFlowControl.ExitThisFlow('S999','汇票当前状态[' + bil_dict['HPSTAT'] + ']不允许进行挂失') #=====添加OPRNO PL_HPOPRNO_GS 挂失==== TradeContext.OPRNO = PL_HPOPRNO_GS elif TradeContext.TRCCO == '2100104': #=====汇票解挂==== if TradeContext.SNDBNKCO != bil_dict['REMBNKCO']: return AfaFlowControl.ExitThisFlow('S999','汇票必须由挂失行进行解挂') #=====判断汇票状态是否 挂失 状态==== if not bil_dict['HPSTAT'] == PL_HPSTAT_HANG: return AfaFlowControl.ExitThisFlow('S999','汇票当前状态[' + bil_dict['HPSTAT'] + ']不允许进行解挂') #=====添加OPRNO PL_HPOPRNO_JG 解挂==== TradeContext.OPRNO = PL_HPOPRNO_JG else: return AfaFlowControl.ExitThisFlow('S999','汇票操作类型错误') AfaLoggerFunc.tradeDebug('>>>结束判断汇票操作类型') #=====PL_BILTYP_CASH 0 现金==== if bil_dict['BILTYP'] == PL_BILTYP_CASH: #=====现金汇票==== TradeContext.ROPRTPNO = '' else: #=====转账汇票==== TradeContext.ROPRTPNO = '21' AfaLoggerFunc.tradeDebug('>>>结束判断汇票类型') #=====字典赋值==== TradeContext.DCFLG = PL_DCFLG_DEB bilbka_dict = {} if not rccpsMap8505CTradeContext2Dbilbka_dict.map(bilbka_dict): return AfaFlowControl.ExitThisFlow('S999','字典赋值出错') AfaLoggerFunc.tradeDebug('>>>结束字典赋值') AfaLoggerFunc.tradeDebug('>>>开始登记汇票业务信息登记簿') #=====登记汇票业务信息登记簿==== if not rccpsDBFunc.insTransBil(bilbka_dict): return AfaFlowControl.ExitThisFlow('S999','登记汇票业务信息登记簿出错') AfaDBFunc.CommitSql() AfaLoggerFunc.tradeDebug('>>>结束登记汇票业务信息登记簿') AfaLoggerFunc.tradeDebug('>>>开始发送农信银中心') TradeContext.TRANTYP = '0' #传输类型 TradeContext.OPRTYPNO = PL_TRCCO_HP #业务属性 PL_TRCCO_HP 21 汇票 #begin 20110614 曾照泰 修改 送往农信银中心的票号为8位 TradeContext.BILNO = TradeContext.BILNO[-8:] #end return True
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
file_line = "" if len(hpdzmx_list) <= 0: AfaLoggerFunc.tradeInfo(">>>汇票对账明细登记簿中无对应记录") else: for i in xrange(len(hpdzmx_list)): file_line = file_line + "RCC".ljust(8,' ') + '|' #代理业务号 file_line = file_line + hpdzmx_list[i]['BJEDTE'].ljust(8,' ') + '|' #前置日期 file_line = file_line + hpdzmx_list[i]['BSPSQN'].ljust(12,' ') + '|' #前置流水号 trc_dict = {} if not rccpsDBFunc.getTransBil(hpdzmx_list[i]['BJEDTE'],hpdzmx_list[i]['BSPSQN'],trc_dict): rccpsCronFunc.cronExit("S999","查询汇票业务信息异常") if not rccpsDBFunc.getInfoBil(trc_dict['BILVER'],trc_dict['BILNO'],trc_dict['BILRS'],trc_dict): rccpsCronFunc.cronExit("S999","查询汇票详细信息异常") file_line = file_line + hpdzmx_list[i]['SNDBNKCO'].ljust(12,' ') + '|' #发起行号 file_line = file_line + hpdzmx_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: #===往账查询记账/短款成功状态信息中的借贷方账号信息======== if trc_dict['TRCCO'] == '2100101': tmpBCSTAT = PL_BCSTAT_HCAC tmpstr = '抹账'
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
def SubModuleDoFst(): AfaLoggerFunc.tradeInfo( '***农信银系统:往账.回执类操作(1.本地操作).业务回执报文接收[TRCC006_1110]进入***' ) #=================初始化返回信息============================================ if AfaUtilTools.trim(TradeContext.STRINFO) == "": TradeContext.STRINFO = rccpsDBFunc.getErrInfo(TradeContext.PRCCO) AfaLoggerFunc.tradeDebug("TradeContext.STRINFO=" + TradeContext.STRINFO) #==========检查业务类型========== if TradeContext.ROPRTPNO == "20": #==========实时汇兑业务============================================= AfaLoggerFunc.tradeInfo(">>>原业务类型为20,汇兑业务") #==========根据发送行号,委托日期,交易流水号查询原交易信息=========== AfaLoggerFunc.tradeInfo(">>>开始根据发送行号,委托日期,交易流水号查询交易信息") ORSNDMBRCO = TradeContext.ORMFN[:10] ORTRCDAT = TradeContext.ORMFN[10:18] ORTRCNO = TradeContext.ORMFN[18:] trc_dict = {} if not rccpsDBFunc.getTransTrcPK(ORSNDMBRCO,ORTRCDAT,ORTRCNO,trc_dict): return False AfaLoggerFunc.tradeInfo(">>>结束根据发送行号,委托日期,交易流水号查询交易信息") #==========检查原业务是否MFE收妥=================================== tmp_stat_dict = {} if not rccpsState.getTransStateSet(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFERCV,PL_BDWFLG_SUCC,tmp_stat_dict): return AfaFlowControl.ExitThisFlow("S999","原汇兑业务MFE尚未收妥,停止处理") #==========根据中心返回码设置原交易状态============================ AfaLoggerFunc.tradeInfo(">>>中心处理码为[" + TradeContext.PRCCO + "]") stat_dict = {} stat_dict['BJEDTE'] = trc_dict['BJEDTE'] stat_dict['BSPSQN'] = trc_dict['BSPSQN'] stat_dict['BESBNO'] = trc_dict['BESBNO'] stat_dict['BETELR'] = TradeContext.BETELR stat_dict['PRCCO'] = TradeContext.PRCCO #stat_dict['STRINFO']= TradeContext.STRINFO if TradeContext.PRCCO == "RCCI0000": return AfaFlowControl.ExitThisFlow("S999","业务回执报文中心处理码不应为RCCI0000") elif TradeContext.PRCCO == "RCCO1078" or TradeContext.PRCCO == "RCCO1079": #==========中心返回表示排队的处理码,开始设置状态为排队===== AfaLoggerFunc.tradeInfo(">>>开始设置状态为排队") if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFEQUE,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") stat_dict['BCSTAT'] = PL_BCSTAT_MFEQUE stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为排队") else: #==========中心返回表示拒绝的处理码,开始设置状态为拒绝===== AfaLoggerFunc.tradeInfo(">>>开始设置状态为拒绝") if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFERFE,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") stat_dict['BCSTAT'] = PL_BCSTAT_MFERFE stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为拒绝") if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") #==========设置当前机构为原机构============================ TradeContext.BESBNO = trc_dict['BESBNO'] TradeContext.BETELR = trc_dict['BETELR'] TradeContext.TERMID = trc_dict['TERMID'] #==========设置原交易状态为抹账处理中====================== AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账处理中") TradeContext.NOTE3 = "中心拒绝,行内自动抹账" if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_HCAC,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账处理中") #==========发起主机抹账==================================== AfaLoggerFunc.tradeInfo(">>>开始主机抹账") ##====== 张恒 抹账操作 增加于20091112 ==============## #汇兑往帐抹帐字典赋值 input_dict = {} input_dict['BJEDTE'] = trc_dict['BJEDTE'] input_dict['BSPSQN'] = trc_dict['BSPSQN'] if len(trc_dict['PYRACC']) != 0 : input_dict['PYRACC'] = trc_dict['PYRACC'] else: input_dict['PYRACC'] = '' input_dict['OCCAMT'] = str(trc_dict['OCCAMT']) input_dict['BBSSRC'] = trc_dict['BBSSRC'] input_dict['BESBNO'] = TradeContext.BESBNO #调用汇兑往帐抹帐 rccpsEntries.HDWZMZ(input_dict) #=====设置记账函数接口==== rccpsHostFunc.CommHost( TradeContext.HostCode ) AfaLoggerFunc.tradeInfo(">>>结束主机抹账") stat_dict['PRCCO'] = '' if TradeContext.errorCode == '0000': #==========设置原交易状态为抹账成功============================ AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账成功") stat_dict['BCSTAT'] = PL_BCSTAT_HCAC stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if TradeContext.existVariable('TRDT'): AfaLoggerFunc.tradeInfo("TRDT:" + TradeContext.TRDT) stat_dict['TRDT'] = TradeContext.TRDT if TradeContext.existVariable('TLSQ'): AfaLoggerFunc.tradeInfo("TLSQ:" + TradeContext.TLSQ) stat_dict['TLSQ'] = TradeContext.TLSQ if TradeContext.existVariable('DASQ'): AfaLoggerFunc.tradeInfo("DASQ:" + TradeContext.DASQ) stat_dict['DASQ'] = TradeContext.DASQ stat_dict['MGID'] = TradeContext.errorCode stat_dict['STRINFO']= TradeContext.errorMsg if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账成功") if trc_dict['TRCCO'] == '2000004': #===========退汇业务,更新原交易挂账代销账序号============== AfaLoggerFunc.tradeInfo(">>>开始更新原交易挂账代销账序号") orstat_dict = {} orstat_dict['BJEDTE'] = trc_dict['BOJEDT'] orstat_dict['BSPSQN'] = trc_dict['BOSPSQ'] orstat_dict['BCSTAT'] = PL_BCSTAT_HANG orstat_dict['BDWFLG'] = PL_BDWFLG_SUCC if TradeContext.existVariable('DASQ'): orstat_dict['DASQ'] = TradeContext.DASQ if not rccpsState.setTransState(orstat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束更新原交易挂账代销账序号") else: #==========设置原交易状态为抹账失败======================== AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账失败") stat_dict['BCSTAT'] = PL_BCSTAT_HCAC stat_dict['BDWFLG'] = PL_BDWFLG_FAIL if TradeContext.existVariable('TRDT'): AfaLoggerFunc.tradeInfo("TRDT:" + TradeContext.TRDT) stat_dict['TRDT'] = TradeContext.TRDT if TradeContext.existVariable('TLSQ'): AfaLoggerFunc.tradeInfo("TLSQ:" + TradeContext.TLSQ) stat_dict['TLSQ'] = TradeContext.TLSQ if TradeContext.existVariable('DASQ'): AfaLoggerFunc.tradeInfo("DASQ:" + TradeContext.DASQ) stat_dict['DASQ'] = TradeContext.DASQ stat_dict['MGID'] = TradeContext.errorCode stat_dict['STRINFO']= TradeContext.errorMsg if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账失败") elif TradeContext.ROPRTPNO == "21": #==========全国汇票业务============================================ AfaLoggerFunc.tradeInfo(">>>原业务类型为21,汇票业务") #==========根据发送行号,委托日期,交易流水号查询原交易信息========== AfaLoggerFunc.tradeInfo(">>>开始根据发送行号,委托日期,交易流水号查询交易信息") ORSNDMBRCO = TradeContext.ORMFN[:10] ORTRCDAT = TradeContext.ORMFN[10:18] ORTRCNO = TradeContext.ORMFN[18:] trc_dict = {} if not rccpsDBFunc.getTransBilPK(ORSNDMBRCO,ORTRCDAT,ORTRCNO,trc_dict): return False if not rccpsDBFunc.getInfoBil(trc_dict['BILVER'],trc_dict['BILNO'],trc_dict['BILRS'],trc_dict): return False TradeContext.ORTRCCO = trc_dict['TRCCO'] AfaLoggerFunc.tradeInfo(">>>结束根据发送行号,委托日期,交易流水号查询交易信息") #==========检查原业务是否MFE收妥=================================== tmp_stat_dict = {} if not rccpsState.getTransStateSet(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFERCV,PL_BDWFLG_SUCC,tmp_stat_dict): return AfaFlowControl.ExitThisFlow("S999","原汇票业务MFE尚未收妥,停止处理") #==========根据中心返回码设置原交易状态============================ AfaLoggerFunc.tradeInfo(">>>中心处理码为[" + TradeContext.PRCCO + "]") stat_dict = {} stat_dict['BJEDTE'] = trc_dict['BJEDTE'] stat_dict['BSPSQN'] = trc_dict['BSPSQN'] stat_dict['BESBNO'] = trc_dict['BESBNO'] stat_dict['BETELR'] = TradeContext.BETELR stat_dict['PRCCO'] = TradeContext.PRCCO stat_dict['STRINFO']= TradeContext.STRINFO if TradeContext.PRCCO == "RCCI0000": return AfaFlowControl.ExitThisFlow("S999","业务回执报文中心处理码不应为RCCI0000") elif TradeContext.PRCCO == "RCCO1078" or TradeContext.PRCCO == "RCCO1079": #==========中心返回表示排队的处理码,开始设置状态为排队====== AfaLoggerFunc.tradeInfo(">>>开始设置状态为排队") if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFEQUE,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") stat_dict['BCSTAT'] = PL_BCSTAT_MFEQUE stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为排队") else: #==========中心返回表示拒绝的处理码,开始设置状态为拒绝====== AfaLoggerFunc.tradeInfo(">>>开始设置状态为拒绝") if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_MFERFE,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") stat_dict['BCSTAT'] = PL_BCSTAT_MFERFE stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为拒绝") if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") #==========如果原交易为汇票签发,需自动抹账======= if TradeContext.ORTRCCO == '2100001': #==========设置当前机构为原机构,当前柜员为原柜员=========== TradeContext.BESBNO = trc_dict['BESBNO'] TradeContext.BETELR = trc_dict['BETELR'] TradeContext.TERMID = trc_dict['TERMID'] #==========设置原交易状态为抹账处理中====================== AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账处理中") TradeContext.NOTE3 = "中心拒绝,行内自动抹账" if not rccpsState.newTransState(trc_dict['BJEDTE'],trc_dict['BSPSQN'],PL_BCSTAT_HCAC,PL_BDWFLG_WAIT): return False if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账处理中") #==========发起主机抹账==================================== AfaLoggerFunc.tradeInfo(">>>开始主机抹账") #=====如果资金来源为代销账,使用8813红字冲销==== if trc_dict['BBSSRC'] == '3': #待销账 TradeContext.BJEDTE = trc_dict['BJEDTE'] TradeContext.BSPSQN = trc_dict['BSPSQN'] TradeContext.OCCAMT = str(trc_dict['BILAMT']) #抹账金额为出票金额 TradeContext.HostCode = '8813' TradeContext.RCCSMCD = PL_RCCSMCD_HPQF #主机摘要码:汇票签发 TradeContext.DASQ = '' TradeContext.RVFG = '0' #红蓝字标志 0 TradeContext.SBAC = TradeContext.BESBNO + PL_ACC_HCHK #借方账号(汇票签发,借汇出汇款) TradeContext.RBAC = TradeContext.BESBNO + PL_ACC_NXYDXZ #贷方账号(贷农信银代销账) #=====开始调函数拼贷方账号第25位校验位==== TradeContext.SBAC = rccpsHostFunc.CrtAcc(TradeContext.SBAC, 25) TradeContext.RBAC = rccpsHostFunc.CrtAcc(TradeContext.RBAC, 25) AfaLoggerFunc.tradeInfo( '借方账号:' + TradeContext.SBAC ) AfaLoggerFunc.tradeInfo( '贷方账号:' + TradeContext.RBAC ) else: TradeContext.BOJEDT = trc_dict['BJEDTE'] TradeContext.BOSPSQ = trc_dict['BSPSQN'] TradeContext.HostCode='8820' #=====调起主机记账接口==== rccpsHostFunc.CommHost( TradeContext.HostCode ) AfaLoggerFunc.tradeInfo(">>>结束主机抹账") if TradeContext.errorCode == '0000': #==========设置原交易状态为抹账成功======================== AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账成功") stat_dict['BCSTAT'] = PL_BCSTAT_HCAC stat_dict['BDWFLG'] = PL_BDWFLG_SUCC if TradeContext.existVariable('TRDT'): AfaLoggerFunc.tradeInfo("TRDT:" + TradeContext.TRDT) stat_dict['TRDT'] = TradeContext.TRDT if TradeContext.existVariable('TLSQ'): AfaLoggerFunc.tradeInfo("TLSQ:" + TradeContext.TLSQ) stat_dict['TLSQ'] = TradeContext.TLSQ if TradeContext.existVariable('DASQ'): AfaLoggerFunc.tradeInfo("DASQ:" + TradeContext.DASQ) stat_dict['DASQ'] = TradeContext.DASQ stat_dict['MGID'] = TradeContext.errorCode stat_dict['STRINFO']= TradeContext.errorMsg if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账成功") else: #==========设置原交易状态为抹账失败======================== AfaLoggerFunc.tradeInfo(">>>开始设置状态为抹账失败") stat_dict['BCSTAT'] = PL_BCSTAT_HCAC stat_dict['BDWFLG'] = PL_BDWFLG_FAIL if TradeContext.existVariable('TRDT'): AfaLoggerFunc.tradeInfo("TRDT:" + TradeContext.TRDT) stat_dict['TRDT'] = TradeContext.TRDT if TradeContext.existVariable('TLSQ'): AfaLoggerFunc.tradeInfo("TLSQ:" + TradeContext.TLSQ) stat_dict['TLSQ'] = TradeContext.TLSQ if TradeContext.existVariable('DASQ'): AfaLoggerFunc.tradeInfo("DASQ:" + TradeContext.DASQ) stat_dict['DASQ'] = TradeContext.DASQ stat_dict['MGID'] = TradeContext.errorCode stat_dict['STRINFO']= TradeContext.errorMsg if not rccpsState.setTransState(stat_dict): return False AfaLoggerFunc.tradeInfo(">>>结束设置状态为抹账失败") #==========如果原交易为汇票退票,需重置实际结算金额和结余金额======= if TradeContext.ORTRCCO == '2100103': AfaLoggerFunc.tradeInfo(">>>汇票退票,开始重置实际结算金额和结余金额") bilinf_update_dict = {} bilinf_update_dict['OCCAMT'] = "0.00" bilinf_update_dict['RMNAMT'] = "0.00" bilinf_where_dict = {} bilinf_where_dict['BILVER'] = trc_dict['BILVER'] bilinf_where_dict['BILNO'] = trc_dict['BILNO'] ret = rccpsDBTrcc_bilinf.update(bilinf_update_dict,bilinf_where_dict) if ret == None: return AfaFlowControl.ExitThisFlow("S999","更新汇票信息登记簿异常") if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","无对应的汇票信息") AfaLoggerFunc.tradeInfo(">>>汇票退票,结束重置实际结算金额和结余金额") elif TradeContext.ROPRTPNO == "99": #==========信息类业务=============================================== AfaLoggerFunc.tradeInfo(">>>原业务类型为99,信息类业务") #==========根据发送行号,委托日期,交易流水号查询原交易信息=========== AfaLoggerFunc.tradeInfo(">>>开始根据发送行号,委托日期,交易流水号查询交易信息") bka_where_dict = {} bka_where_dict['SNDMBRCO'] = TradeContext.ORMFN[:10] bka_where_dict['TRCDAT'] = TradeContext.ORMFN[10:18] bka_where_dict['TRCNO'] = TradeContext.ORMFN[18:] bka_update_dict = {} bka_update_dict['PRCCO'] = TradeContext.PRCCO bka_update_dict['STRINFO'] = TradeContext.STRINFO #==========查询汇兑查询查复登记簿====================================== AfaLoggerFunc.tradeInfo(">>>开始查询汇兑查询查复登记簿") bka_dict = rccpsDBTrcc_hdcbka.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询汇兑查询业务登记簿异常") if len(bka_dict) > 0: #======汇兑查询查复登记簿中找到原交易信息,开始更新回执信息========= AfaLoggerFunc.tradeInfo(">>>汇兑查询查复登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_hdcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") if (bka_dict['TRCCO'] == '9900512' or bka_dict['TRCCO'] == '9900523') and TradeContext.PRCCO != 'RCCI0000': #======汇兑\特约汇兑查复业务,中心返回码非成功,修改原查询交易查询查复标识为未查复== AfaLoggerFunc.tradeInfo(">>>汇兑\特约汇兑查复业务,中心返回码非成功") AfaLoggerFunc.tradeInfo(">>>开始修改原汇兑\特约汇兑查询交易查询查复标识为未查复") bka_update_dict = {'ISDEAL':PL_ISDEAL_UNDO} bka_where_dict = {'BJEDTE':bka_dict['BOJEDT'],'BSPSQN':bka_dict['BOSPSQ']} ret = rccpsDBTrcc_hdcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新原汇兑\特约汇兑查询交易查询查复标识为未查复异常") AfaLoggerFunc.tradeInfo(">>>结束修改原汇兑\特约汇兑查询交易查询查复标识为未查复") else: #======汇兑查询查复登记簿中未找到原交易信息,开始查询票据查询查复登记簿==== AfaLoggerFunc.tradeInfo(">>>汇兑查询查复登记簿中未找到原交易信息,开始查询票据查询查复登记簿") bka_dict = rccpsDBTrcc_pjcbka.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询票据查询业务登记簿异常") if len(bka_dict) > 0: #======票据查询查复登记簿中找到原交易信息,开始更新回执信息==== AfaLoggerFunc.tradeInfo(">>>票据查询查复登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_pjcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") if bka_dict['TRCCO'] == '9900521' and TradeContext.PRCCO != 'RCCI0000': #======票据查复业务,中心返回码非成功,修改原查询交易查询查复标识为未查复== AfaLoggerFunc.tradeInfo(">>>票据查复业务,中心返回码非成功") AfaLoggerFunc.tradeInfo(">>>开始修改原票据查询交易查询查复标识为未查复") bka_update_dict = {'ISDEAL':PL_ISDEAL_UNDO} bka_where_dict = {'BJEDTE':bka_dict['BOJEDT'],'BSPSQN':bka_dict['BOSPSQ']} ret = rccpsDBTrcc_pjcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新原票据查询交易查询查复标识为未查复异常") AfaLoggerFunc.tradeInfo(">>>结束修改原票据查询交易查询查复标识为未查复") else: #======票据查询查复登记簿中未找到原交易信息,开始查询汇票查询查复登记簿==== AfaLoggerFunc.tradeInfo(">>>票据查询查复登记簿中未找到原交易信息,开始查询汇票查询查复登记簿") bka_dict = rccpsDBTrcc_hpcbka.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询汇票查询业务登记簿异常") if len(bka_dict) > 0: #======汇票查询查复登记簿中找到原交易信息,开始更新回执信息==== AfaLoggerFunc.tradeInfo(">>>汇票查询查复登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_hpcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") if bka_dict['TRCCO'] == '9900527' and TradeContext.PRCCO != 'RCCI0000': #======汇票查复业务,中心返回码非成功,修改原查询交易查询查复标识为未查复== AfaLoggerFunc.tradeInfo(">>>汇票查复业务,中心返回码非成功") AfaLoggerFunc.tradeInfo(">>>开始修改原汇票查询交易查询查复标识为未查复") bka_update_dict = {'ISDEAL':PL_ISDEAL_UNDO} bka_where_dict = {'BJEDTE':bka_dict['BOJEDT'],'BSPSQN':bka_dict['BOSPSQ']} ret = rccpsDBTrcc_hpcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新原汇票查询交易查询查复标识为未查复异常") AfaLoggerFunc.tradeInfo(">>>结束修改原汇票查询交易查询查复标识为未查复") else: #======汇票查询查复登记簿中未找到原交易信息,开始查询支付业务状态查询查复登记簿==== AfaLoggerFunc.tradeInfo(">>>汇票查询查复登记簿中未找到原交易信息,开始查询支付业务状态查询查复登记簿") bka_dict = rccpsDBTrcc_ztcbka.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询业务状态查询业务登记簿异常") if len(bka_dict) > 0: #======业务状态查询查复登记簿中找到原交易信息,开始更新回执信息==== AfaLoggerFunc.tradeInfo(">>>业务状态查询查复登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_ztcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") if bka_dict['TRCCO'] == '9900507' and TradeContext.PRCCO != 'RCCI0000': #======支付业务状态查复业务,中心返回码非成功,修改原查询交易查询查复标识为未查复== AfaLoggerFunc.tradeInfo(">>>支付业务状态查复业务,中心返回码非成功") AfaLoggerFunc.tradeInfo(">>>开始修改原支付业务状态查询交易查询查复标识为未查复") bka_update_dict = {'ISDEAL':PL_ISDEAL_UNDO} bka_where_dict = {'BJEDTE':bka_dict['BOJEDT'],'BSPSQN':bka_dict['BOSPSQ']} ret = rccpsDBTrcc_hpcbka.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999", "更新原支付业务状态查询交易查询查复标识为未查复异常") AfaLoggerFunc.tradeInfo(">>>结束修改原支付业务状态查询交易查询查复标识为未查复") else: #==支付业务状态查询查复登记簿中未找到原交易信息,开始查询撤销申请登记簿== AfaLoggerFunc.tradeInfo(">>>支付业务状态查询查复登记簿中未找到原交易信息,开始查询撤销申请登记簿") bka_dict = rccpsDBTrcc_trccan.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询资金调拨申请登记簿异常") if len(bka_dict) > 0: #==撤销申请登记簿中找到原交易信息,开始更新回执信息========= AfaLoggerFunc.tradeInfo(">>>撤销申请登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_trccan.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") else: #==撤销申请登记簿中未找到原交易信息,开始查询紧急止付登记簿== AfaLoggerFunc.tradeInfo(">>>支付业务状态查询查复登记簿中未找到原交易信息,开始查询紧急止付登记簿") bka_dict = rccpsDBTrcc_existp.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询紧急止付登记簿异常") if len(bka_dict) > 0: #==紧急止付登记簿中找到原交易信息,开始更新回执信息=========== AfaLoggerFunc.tradeInfo(">>>紧急止付登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_existp.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") else: #==紧急止付登记簿中未找到原交易信息,开始查询资金调拨申请登记簿== AfaLoggerFunc.tradeInfo(">>>紧急止付登记簿中未找到原交易信息,开始查询资金调拨申请登记簿") bka_dict = rccpsDBTrcc_mrqtbl.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询资金调拨申请登记簿异常") if len(bka_dict) > 0: #==资金调拨申请登记簿中找到原交易信息,开始更新回执信息========= AfaLoggerFunc.tradeInfo(">>>资金调拨申请登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_mrqtbl.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") else: #==资金调拨申请登记簿中未找到原交易信息,开始查询清算账户余额通知登记簿== AfaLoggerFunc.tradeInfo(">>>资金调拨申请登记簿中未找到原交易信息,开始查询清算账户余额通知登记簿") bka_dict = rccpsDBTrcc_rekbal.selectu(bka_where_dict) if bka_dict == None: return AfaFlowControl.ExitThisFlow("S999", "查询清算账户余额通知登记簿异常") if len(bka_dict) > 0: #==清算账户余额通知登记簿中找到原交易信息,开始更新回执信息== AfaLoggerFunc.tradeInfo(">>清算账户余额通知登记簿中找到原交易信息,开始更新回执信息") ret = rccpsDBTrcc_rekbal.updateCmt(bka_update_dict,bka_where_dict) if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","更新回执信息异常") AfaLoggerFunc.tradeInfo(">>>结束更新回执信息") else: #==未找到原交易信息,丢弃报文=========== return AfaFlowControl.ExitThisFlow("S999", "未找到原交易信息,丢弃报文") else: #==========原业务类型非法=========================================== return AfaFlowControl.ExitThisFlow("S999", "原业务类型[" + TradeContext.ROPRTPNO + "]非法") if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") #================为通讯回执报文赋值========================================= AfaLoggerFunc.tradeInfo(">>>开始为通讯回执报文赋值") #======为通讯回执报文赋值=================================================== out_context_dict = {} out_context_dict['sysType'] = 'rccpst' out_context_dict['TRCCO'] = '9900503' out_context_dict['MSGTYPCO'] = 'SET008' out_context_dict['RCVMBRCO'] = TradeContext.SNDMBRCO out_context_dict['SNDMBRCO'] = TradeContext.RCVMBRCO out_context_dict['SNDBRHCO'] = TradeContext.BESBNO out_context_dict['SNDCLKNO'] = TradeContext.BETELR out_context_dict['SNDTRDAT'] = TradeContext.BJEDTE out_context_dict['SNDTRTIM'] = TradeContext.BJETIM out_context_dict['MSGFLGNO'] = out_context_dict['SNDMBRCO'] + TradeContext.BJEDTE + TradeContext.SerialNo out_context_dict['ORMFN'] = TradeContext.MSGFLGNO out_context_dict['NCCWKDAT'] = TradeContext.NCCworkDate out_context_dict['OPRTYPNO'] = '99' out_context_dict['ROPRTPNO'] = TradeContext.OPRTYPNO out_context_dict['TRANTYP'] = '0' out_context_dict['ORTRCCO'] = TradeContext.TRCCO out_context_dict['PRCCO'] = 'RCCI0000' out_context_dict['STRINFO'] = '成功' rccpsMap0000Dout_context2CTradeContext.map(out_context_dict) AfaLoggerFunc.tradeInfo(">>>结束为通讯回执报文赋值") AfaLoggerFunc.tradeInfo( '***农信银系统:往账.回执类操作(1.本地操作).业务回执报文接收[TRCC006_1110]退出***' ) return True
def SubModuleDoFst(): AfaLoggerFunc.tradeInfo( '***农信银系统: 往账.本地类操作交易[RCC001_8522]进入***' ) #=====判断接口是否存在==== if( not TradeContext.existVariable( "BJEDTE" ) ): return AfaFlowControl.ExitThisFlow('A099', '交易日期[BJEDTE]不存在') if( not TradeContext.existVariable( "BSPSQN" ) ): return AfaFlowControl.ExitThisFlow('A099', '报单序号[BSPSQN]不存在') if( not TradeContext.existVariable( "OPRTYPNO" ) ): return AfaFlowControl.ExitThisFlow('A099', '业务种类[OPRTYPNO]不存在') if( not TradeContext.existVariable( "BCURSQ" ) ): return AfaFlowControl.ExitThisFlow('A099', '当前处理编号[BCURSQ]不存在') #=====查询历史状态表得到主机日期和主机流水号==== where_sql={'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCURSQ':TradeContext.BCURSQ} ret=rccpsDBTrcc_sstlog.selectu(where_sql) if(ret==None): return AfaFlowControl.ExitThisFlow('A099', '查询历史状态表失败') if(len(ret)==0): return AfaFlowControl.ExitThisFlow('A099', '查询历史状态表结果为空') if(ret['TRDT']=="" or ret['TLSQ']==""): return AfaFlowControl.ExitThisFlow('A099', '此序号状态非成功的账务状态') #=====PL_TRCCO_HP 21 汇票==== if(TradeContext.OPRTYPNO==PL_TRCCO_HP): AfaLoggerFunc.tradeInfo("进入汇票处理") records1={} #=====查询汇票业务登记簿==== bilbka_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN} res_bilbka = rccpsDBTrcc_bilbka.selectu(bilbka_where_dict) if( res_bilbka == None): return AfaFlowControl.ExitThisFlow('S999', '查询汇票交易登记簿失败') if( len(res_bilbka) == 0 ): return AfaFlowControl.ExitThisFlow('S999', '查询汇票交易登记簿结果为空') #=====查询状态明细表==== sstlog_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCURSQ':TradeContext.BCURSQ} res_sstlog = rccpsDBTrcc_sstlog.selectu(sstlog_where_dict) if( res_sstlog == None): return AfaFlowControl.ExitThisFlow('S999', '查询历史状态登记簿失败') if( len(res_sstlog) == 0): return AfaFlowControl.ExitThisFlow('S999', '查询历史状态登记簿结果为空') #=====给resords1赋值,字典相加赋值到新的字典==== records1.update(res_bilbka) records1.update(res_sstlog) #=====判断是否为签发机构==== AfaLoggerFunc.tradeInfo("开始判断当前机构是否为交易机构") if( records1['BESBNO'] != TradeContext.BESBNO ): return AfaFlowControl.ExitThisFlow('S999', '为查找到数据') AfaLoggerFunc.tradeInfo("结束判断当前机构是否为交易机构") #=====判断是否为往账业务==== if records1['BRSFLG'] != PL_BRSFLG_SND: return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.BSPSQN+']该笔业务为来账业务,不允许打印') # #=====判断汇票状态,如果是撤销则不让打印==== # if(records1['HPSTAT'] == PL_HPSTAT_CANC ): # return AfaFlowControl.ExitThisFlow('S999','此汇票为撤销状态,不允许打印') #=====判断当前状态==== #=====PL_BCSTAT_ACC 20 记账==== #=====PL_BCSTAT_HCAC 21 抹账==== if(records1['BCSTAT']!=PL_BCSTAT_ACC and records1['BCSTAT']!=PL_BCSTAT_HCAC): return AfaFlowControl.ExitThisFlow('A009',"当前状态[" + records1['BCSTAT'] + "]不允许打印") records2={} #=====查询汇票信息登记簿==== res=rccpsDBFunc.getInfoBil(records1['BILVER'],records1['BILNO'],records1['BILRS'],records2) if(res==False): return AfaFlowControl.ExitThisFlow('D003','汇票信息登记簿中无记录') #=====输出接口==== rccpsMap8522DTrans2CTradeContext.map(records1) rccpsMap8522DInfo2CTradeContext.map(records2) TradeContext.PRTDAT = AfaUtilTools.GetHostDate() #打印日期 TradeContext.PRTTIM = AfaUtilTools.GetSysTime() #打印时间 TradeContext.PRTCNT = str(int(TradeContext.PRTCNT)+1) #打印次数 TradeContext.BCSTAT = ret['BCSTAT'] #当前状态 TradeContext.BDWFLG = ret['BDWFLG'] #流转处理标识 TradeContext.TRDT = ret['TRDT'] #主机日期 TradeContext.TLSQ = ret['TLSQ'] #主机流水 TradeContext.OCCAMT = str(TradeContext.OCCAMT) #交易金额 TradeContext.BILAMT = str(TradeContext.BILAMT) #出票金额 TradeContext.RMNAMT = str(TradeContext.RMNAMT) #结余金额 #=====更新打印标志==== AfaLoggerFunc.tradeInfo("开始更新打印标志") update_dict={'PRTCNT':TradeContext.PRTCNT} where_dict={'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCSTAT':TradeContext.BCSTAT} rownum=rccpsDBTrcc_sstlog.update(update_dict,where_dict) if(rownum<=0): AfaDBFunc.RollbackSql() return AfaFlowControl.ExitThisFlow('S999','修改数据库打印次数失败') else: AfaLoggerFunc.tradeDebug('>>>commit 成功') AfaDBFunc.CommitSql() TradeContext.errorCode="0000" TradeContext.errorMsg="查询成功" #=====PL_TRCCO_HD 20 汇兑==== elif(TradeContext.OPRTYPNO==PL_TRCCO_HD): AfaLoggerFunc.tradeInfo("进入汇兑处理") records={} #=====查询汇兑登记簿==== trcbka_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN} res_trcbka = rccpsDBTrcc_trcbka.selectu(trcbka_where_dict) if( res_trcbka == None ): return AfaFlowControl.ExitThisFlow('S999', '查询汇兑登记簿异常') if( len(res_trcbka) == 0 ): return AfaFlowControl.ExitThisFlow('S999', '查询汇兑登记簿结果为空') #=====查询历史状态表==== sstlog_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCURSQ':TradeContext.BCURSQ} res_sstlog = rccpsDBTrcc_sstlog.selectu(sstlog_where_dict) if( res_sstlog == None): return AfaFlowControl.ExitThisFlow('S999', '查询历史状态登记簿失败') if( len(res_sstlog) == 0): return AfaFlowControl.ExitThisFlow('S999', '查询历史状态登记簿结果为空') #=====给records赋值,字典相加赋值到新的字典==== records.update(res_trcbka) records.update(res_sstlog) #=====判断是否为签发机构==== AfaLoggerFunc.tradeInfo("开始判断当前机构是否为交易机构") if( records['BESBNO'] != TradeContext.BESBNO ): return AfaFlowControl.ExitThisFlow('S999', '非签发机构') AfaLoggerFunc.tradeInfo("结束判断当前机构是否为交易机构") #=====判断是否为往账业务==== if records['BRSFLG'] != PL_BRSFLG_SND: return AfaFlowControl.ExitThisFlow('S999','报单序号['+TradeContext.BSPSQN+']该笔业务为来账业务,不允许打印') #=====判断当前状态==== #=====PL_BCSTAT_ACC 20 记账==== #=====PL_BCSTAT_HCAC 21 抹账==== if not (records['BCSTAT']==PL_BCSTAT_ACC or records['BCSTAT'] == PL_BCSTAT_HCAC): return AfaFlowControl.ExitThisFlow('A009',"当前状态[" + records1['BCSTAT'] + "]不允许打印") rccpsMap8522DTransTrc2CTradeContext.map(records) #=====输出接口==== TradeContext.PRTDAT = AfaUtilTools.GetHostDate() #打印日期 TradeContext.PRTTIM = AfaUtilTools.GetSysTime() #打印时间 TradeContext.PRTCNT = str(int(TradeContext.PRTCNT)+1) #打印次数 TradeContext.OCCAMT = str(TradeContext.OCCAMT) #交易金额 TradeContext.BILAMT = str(TradeContext.COMAMT) #出票金额 TradeContext.BCSTAT = ret['BCSTAT'] #当前状态 TradeContext.BDWFLG = ret['BDWFLG'] #流转处理标识 TradeContext.TRDT = ret['TRDT'] #主机日期 TradeContext.TLSQ = ret['TLSQ'] #主机流水号 #=====更新打印标志==== AfaLoggerFunc.tradeInfo("开始更新打印标志") update_dict={'PRTCNT':TradeContext.PRTCNT} where_dict={'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCSTAT':TradeContext.BCSTAT} rownum=rccpsDBTrcc_sstlog.update(update_dict,where_dict) if(rownum<=0): AfaDBFunc.RollbackSql() return AfaFlowControl.ExitThisFlow('S999','修改数据库打印次数失败') AfaDBFunc.CommitSql() TradeContext.errorCode="0000" TradeContext.errorMsg="查询成功" #=====30 通存通兑==== elif( TradeContext.OPRTYPNO == PL_TRCCO_TCTD ): AfaLoggerFunc.tradeInfo("进入通存通兑处理") records = {} #=====查询交易信息==== AfaLoggerFunc.tradeInfo("查询交易信息") wtrbka_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN} res_wtrbka = rccpsDBTrcc_wtrbka.selectu(wtrbka_where_dict) if( len(res_wtrbka) == 0 ): return AfaFlowControl.ExitThisFlow('A009','查询交易信息结果为空') if( res_wtrbka == None ): return AfaFlowControl.ExitThisFlow('A009','查询交易信息失败') #=====查询交易的历史状态==== AfaLoggerFunc.tradeInfo("查询交易的历史状态") sstlog_where_dict = {'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCURSQ':TradeContext.BCURSQ} res_sstlog = rccpsDBTrcc_sstlog.selectu(sstlog_where_dict) if( len(res_sstlog) == 0 ): return AfaFlowControl.ExitThisFlow('A009','查询交易历史状态结果为空') if( res_sstlog == None ): return AfaFlowControl.ExitThisFlow('A009','查询交易历史状态失败') #=====给records字典赋值,字典相加,赋值到新的字典==== records.update(res_wtrbka) records.update(res_sstlog) #=====判断是否为签发机构==== AfaLoggerFunc.tradeInfo("判断是否为签发机构") if( records['BESBNO'] != TradeContext.BESBNO ): return AfaFlowControl.ExitThisFlow('A009','此机构不是签发机构') #=====判断此交易是否为往账==== AfaLoggerFunc.tradeInfo("判断此交易是否为往账") if( records['BRSFLG'] != PL_BRSFLG_SND ): return AfaFlowControl.ExitThisFlow('A009','此交易不是往账交易') #=====判断交易状态==== AfaLoggerFunc.tradeInfo("判断此交易状态") if not ( records['BCSTAT'] == PL_BCSTAT_ACC or records['BCSTAT'] == PL_BCSTAT_HCAC or records['BCSTAT'] == PL_BCSTAT_CANCEL or records['BCSTAT'] == PL_BCSTAT_CANC): return AfaFlowControl.ExitThisFlow('A009','此状态不允许打印') if(records['BCSTAT'] == PL_BCSTAT_CANCEL or records['BCSTAT'] == PL_BCSTAT_CANC): if(records['TRDT'] == "" or records['TLSQ'] == ""): return AfaFlowControl.ExitThisFlow('A009','此笔业务没有产生产生账务') rccpsMap8522Drecords2CTradeContext.map(records) #=====输出接口==== AfaLoggerFunc.tradeInfo("给输出接口赋值") TradeContext.PRTDAT = AfaUtilTools.GetHostDate() TradeContext.PRTTIM = AfaUtilTools.GetSysTime() TradeContext.PRTCNT = str(int(records['PRTCNT'])+1) TradeContext.USE = "" TradeContext.BILAMT = str(records['OCCAMT']) TradeContext.BCSTAT = ret['BCSTAT'] #当前状态 TradeContext.BDWFLG = ret['BDWFLG'] #流转处理标识 TradeContext.TRDT = ret['TRDT'] #主机日期 TradeContext.TLSQ = ret['TLSQ'] #主机流水号 TradeContext.REMARK = "" TradeContext.DASQ = records['DASQ'] #销账序号 TradeContext.BNKBKNO = records['BNKBKNO'] #存折号码 TradeContext.CHSHTP = records['CHRGTYP'] #手续费收取方式 if(records['TRCCO'] in ('3000002','30000102')): #卡折标志 TradeContext.PYITYP = records['PYETYP'] else: TradeContext.PYITYP = records['PYRTYP'] #=====更新打印标志==== AfaLoggerFunc.tradeInfo("开始更新打印标志") update_dict={'PRTCNT':str(int(records['PRTCNT'])+1)} where_dict={'BJEDTE':TradeContext.BJEDTE,'BSPSQN':TradeContext.BSPSQN,'BCURSQ':TradeContext.BCURSQ} rownum=rccpsDBTrcc_sstlog.update(update_dict,where_dict) if(rownum<=0): AfaDBFunc.RollbackSql() return AfaFlowControl.ExitThisFlow('S999','修改数据库打印次数失败') AfaDBFunc.CommitSql() TradeContext.errorCode="0000" TradeContext.errorMsg="查询成功" else: return AfaFlowControl.ExitThisFlow('A009','业务种类非法') AfaLoggerFunc.tradeInfo( '***农信银系统: 往账.本地类操作交易[RCC001_8522]退出***' ) return True
def SubModuleDoFst(): AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).汇票退票[TRCC003_8504]进入***' ) #====begin 蔡永贵 20110215 增加==== #新票据号是16位,需要取后8位,版本号为02,同时要兼容老票据号8位,版本号为01 if TradeContext.BILVER == '02': TradeContext.TMP_BILNO = TradeContext.BILNO[-8:] else: TradeContext.TMP_BILNO = TradeContext.BILNO #============end============ AfaLoggerFunc.tradeInfo("BJEDTE=[" + TradeContext.BJEDTE + "]") #检查汇票状态,非签发或解付状态禁止提交 AfaLoggerFunc.tradeInfo(">>>开始检查汇票状态") bilinf_dict = {} if not rccpsDBFunc.getInfoBil(TradeContext.BILVER,TradeContext.BILNO,PL_BILRS_INN,bilinf_dict): return AfaFlowControl.ExitThisFlow("S999","查询汇票信息异常") AfaLoggerFunc.tradeInfo("----->" + bilinf_dict['REMBNKCO']) AfaLoggerFunc.tradeInfo("----->" + TradeContext.SNDBNKCO) if bilinf_dict['REMBNKCO'] != TradeContext.SNDBNKCO: return AfaFlowControl.ExitThisFlow("S999","本行非此汇票出票行,禁止提交") if bilinf_dict['HPSTAT'] != PL_HPSTAT_SIGN and bilinf_dict['HPSTAT'] != PL_HPSTAT_DEHG and bilinf_dict['HPSTAT'] != PL_HPSTAT_HANG: return AfaFlowControl.ExitThisFlow("S999","此汇票当前状态非[签发,挂失,解挂],禁止提交") #=====增加查询汇票业务登记簿rcc_bilbka信息,查询条件为:汇票信息rcc_bilinf登记簿note1、note2==== #bilbka_dict = {} #bilbka_where_dict = {'BJEDTE':bilinf_dict['NOTE1'],'BSPSQN':bilinf_dict['NOTE2']} #bilbka_dict = rccpsDBTrcc_bilbka.selectu(bilbka_where_dict) #if( bilbka_dict == None ): # return AfaFlowControl.ExitThisFlow("S999","查询汇票业务登记簿异常") # #if( len(bilbka_dict) == 0 ): # return AfaFlowControl.ExitThisFlow("S999","查询汇票业务登记为空") #bilinf_dict['BBSSRC'] = bilbka_dict['BBSSRC'] #bilinf_dict['DASQ'] = bilbka_dict['DASQ'] #=====取签发交易的BBSSRC、DASQ字段,赋值到bilinf_dict字典中==== #=====例:bilinf_dict['BBSSRC'] = bilbka_dict['BBSSRC']==== #将汇票信息映射到TradeContext中 if not rccpsMap8504Dbilinf2CTradeContext.map(bilinf_dict): return False AfaLoggerFunc.tradeInfo(">>>结束检查汇票状态") #汇票类交易接收成员行为总中心 TradeContext.RCVSTLBIN = PL_RCV_CENTER #接收行为签发时的代理付款行 TradeContext.RCVBNKCO = TradeContext.PAYBNKCO TradeContext.RCVBNKNM = TradeContext.PAYBNKNM #登记汇票业务登记簿 AfaLoggerFunc.tradeInfo(">>>开始登记汇票业务登记簿") TradeContext.SNDMBRCO = TradeContext.SNDSTLBIN TradeContext.RCVMBRCO = TradeContext.RCVSTLBIN TradeContext.TRCNO = TradeContext.SerialNo TradeContext.NCCWKDAT = TradeContext.NCCworkDate if TradeContext.OPRFLG == '0': TradeContext.OPRNO = PL_HPOPRNO_TP #业务种类:汇票退票 else: TradeContext.OPRNO = PL_HPOPRNO_CF #业务种类:汇票超期付款 TradeContext.DCFLG = PL_DCFLG_DEB #借贷标识:借记 TradeContext.BRSFLG = PL_BRSFLG_SND #往来标识:往账 TradeContext.TRCCO = '2100103' #交易代码:2100103汇票退票 bilbka_dict = {} if not rccpsMap8504CTradeContext2Dbilbka.map(bilbka_dict): return False if not rccpsDBFunc.insTransBil(bilbka_dict): return AfaFlowControl.ExitThisFlow('S999','登记汇票业务登记簿异常') AfaLoggerFunc.tradeInfo(">>>结束登记汇票业务登记簿") #更新汇票信息登记簿 AfaLoggerFunc.tradeInfo(">>>开始更新汇票信息登记簿") bilinf_update_dict = {} if TradeContext.OPRFLG == '0': #=================校验入账账号户名====================================== AfaLoggerFunc.tradeInfo(">>>开始校验入账账号户名") TradeContext.HostCode = '8810' TradeContext.ACCNO = bilinf_dict['PYRACC'] AfaLoggerFunc.tradeDebug("gbj test :" + TradeContext.ACCNO) rccpsHostFunc.CommHost( TradeContext.HostCode ) if TradeContext.errorCode != '0000': return AfaFlowControl.ExitThisFlow(TradeContext.errorCode,TradeContext.errorMsg) AfaLoggerFunc.tradeDebug("gbj test :" + TradeContext.ACCNM) if TradeContext.ACCNM != bilinf_dict['PYRNAM']: return AfaFlowControl.ExitThisFlow('S999',"入账账号户名不符") if TradeContext.ACCST != '0' and TradeContext.ACCST != '2': return AfaFlowControl.ExitThisFlow('S999','入账账号状态不正常') AfaLoggerFunc.tradeInfo(">>>结束校验入账账号户名") bilinf_update_dict['PYIACC'] = bilinf_dict['PYRACC'] bilinf_update_dict['PYINAM'] = bilinf_dict['PYRNAM'] elif TradeContext.OPRFLG == '1': #bilinf_update_dict['PYIACC'] = TradeContext.PYIACC #bilinf_update_dict['PYINAM'] = TradeContext.PYINAM #操作类型为超期付款时,入账账号为待销账账号 bilinf_update_dict['PYIACC'] = TradeContext.BESBNO + PL_ACC_NXYDXZ bilinf_update_dict['PYINAM'] = "农信银待销账" else: return AfaFlowControl.ExitThisFlow('S999','操作类型非法') bilinf_update_dict['OCCAMT'] = TradeContext.OCCAMT bilinf_update_dict['RMNAMT'] = TradeContext.RMNAMT bilinf_where_dict = {} bilinf_where_dict['BILVER'] = TradeContext.BILVER bilinf_where_dict['BILNO'] = TradeContext.BILNO ret = rccpsDBTrcc_bilinf.update(bilinf_update_dict,bilinf_where_dict) if ret == None: return AfaFlowControl.ExitThisFlow("S999","更新汇票信息登记簿异常") if ret <= 0: return AfaFlowControl.ExitThisFlow("S999","无对应的汇票信息") AfaLoggerFunc.tradeInfo(">>>结束更新汇票信息登记簿") #设置交易状态为发送处理中 AfaLoggerFunc.tradeInfo(">>>开始设置业务状态为发送处理中") stat_dict = {} stat_dict['BJEDTE'] = TradeContext.BJEDTE stat_dict['BSPSQN'] = TradeContext.BSPSQN stat_dict['BCSTAT'] = PL_BCSTAT_SND stat_dict['BDWFLG'] = PL_BDWFLG_WAIT if not rccpsState.setTransState(stat_dict): return AfaFlowControl.ExitThisFlow('S999','设置状态为发送处理中异常') AfaLoggerFunc.tradeInfo(">>>结束设置业务状态为发送处理中") #COMMIT if not AfaDBFunc.CommitSql( ): AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg ) return AfaFlowControl.ExitThisFlow("S999","Commit异常") AfaLoggerFunc.tradeInfo(">>>Commit成功") #为发送农信银做准备 AfaLoggerFunc.tradeInfo(">>>开始为发送农信银做准备") TradeContext.MSGTYPCO = 'SET002' TradeContext.TRCCO = '2100103' TradeContext.SNDBRHCO = TradeContext.BESBNO TradeContext.SNDCLKNO = TradeContext.BETELR TradeContext.SNDTRDAT = TradeContext.BJEDTE TradeContext.SNDTRTIM = TradeContext.BJETIM TradeContext.MSGFLGNO = TradeContext.SNDMBRCO + TradeContext.BJEDTE + TradeContext.TRCNO TradeContext.ORMFN = '' TradeContext.OPRTYPNO = '21' TradeContext.ROPRTPNO = '' TradeContext.TRANTYP = '0' TradeContext.OCCAMT = str(TradeContext.BILAMT) TradeContext.BILAMT = str(TradeContext.BILAMT) #begin 20110614 曾照泰 修改 送往农信银中心的票号为8位 TradeContext.BILNO = TradeContext.BILNO[-8:] #end AfaLoggerFunc.tradeInfo(">>>结束为发送农信银做准备") AfaLoggerFunc.tradeInfo( '***农信银系统:往账.中心类操作(1.本地操作).汇票退票[TRCC003_8504]退出***' ) return True