Ejemplo n.º 1
0
def SubModuleDoFst():

    AfaLoggerFunc.tradeInfo( '退付开始' )


    #=====刘雨龙  20080811  新增查找fa15表中财政区划内码,条件为单位内码====
    #sql = "select AAA010 from fs_fa15 where AFA050='" + TradeContext.busiNo + "'"
    sql = "select AAA010 from fs_fa22 where busino='" + TradeContext.busiNo + "'"
    
    #begin 20100629 蔡永贵增加查询条件
    sql = sql + " and AFA101 = '" + TradeContext.bankbm + "'"
    AfaLoggerFunc.tradeInfo( sql )
    #end

    ret = AfaDBFunc.SelectSql( sql )
    if ret == None:
        return AfaFlowControl.ExitThisFlow('0001','通过单位内码查找财政区划内码失败')
    elif len(ret) <= 0:
        return AfaFlowControl.ExitThisFlow('0001','通过单位内码查找财政区划内码无满足条件记录')
    else:
        TradeContext.AAA010  =  ret[0][0]


    TradeContext.__agentEigen__ = '0'   #从表标志

    #将字段转化为退付交易所使用的字段
    TradeContext.AFC060         =   TradeContext.userNo
    TradeContext.AFA050         =   TradeContext.note1
    TradeContext.AFC064         =   TradeContext.amount
    TradeContext.AFC063         =   TradeContext.accno

    #=====刘雨龙  20080811  新增条件财政区划内码====
    #sqlstr                      =   "select flag from fs_fc75 where afc060='" + TradeContext.AFC060 + "'"
    sqlstr                      =   "select flag from fs_fc75 where afc060='" + TradeContext.AFC060 + "'"

    sqlstr = sqlstr + " and AAA010 = '" + TradeContext.AAA010 + "'"

    #===条件增加银行编码字段,张恒修改===
    sqlstr = sqlstr + " and afa101 = '" + TradeContext.bankbm + "'"

    records                     =   AfaDBFunc.SelectSql( sqlstr )

    AfaLoggerFunc.tradeInfo( '退付查询' + sqlstr )

    if ( len(records) > 0 ):
        if records[0][0]   ==  '0':
            TradeContext.errorCode,TradeContext.errorMsg  =   '0001','已经查找到了退付编号,不能再次退付'
            AfaLoggerFunc.tradeInfo( TradeContext.errorMsg )
            return False


        elif records[0][0] != '1':
            TradeContext.errorCode,TradeContext.errorMsg  =   '0002',"缴款书状态位异常"
            AfaLoggerFunc.tradeInfo( TradeContext.errorMsg )
            return False

    return True
Ejemplo n.º 2
0
def SubModuleMainFst( ):
    
    AfaLoggerFunc.tradeInfo( '********************查找数据表结束*******************' )
    TradeContext.__agentEigen__  = '0'   #从表标志
    
    sqlstr      =   "select busino,hostip,upuser,uppasswd,upldir,downuser,downpasswd,downldir from fs_businoconf where busino='" + TradeContext.busiNo + "'"
    AfaLoggerFunc.tradeInfo(sqlstr)
    records = AfaDBFunc.SelectSql( sqlstr )   
    if records == None:
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "操作数据库异常"
        AfaLoggerFunc.tradeInfo(sqlstr+AfaDBFunc.sqlErrMsg)
        return False
        
    if( len( records)==0 ):
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "未找到相应记录"
        AfaLoggerFunc.tradeInfo(sqlstr+AfaDBFunc.sqlErrMsg)
        return False
    else:    
        TradeContext.APPNO      =   'AG2008'
        TradeContext.BUSINO     =   records[0][0]
        TradeContext.HOSTIP     =   records[0][1]
        TradeContext.RDOWNPATH  =   records[0][7]
        TradeContext.RUPPATH    =   records[0][4]
        TradeContext.DOWNUSER   =   records[0][5]
        TradeContext.DOWNPWD    =   records[0][6]
        TradeContext.UPUSER     =   records[0][2]
        TradeContext.UPPD       =   records[0][3]
    
    sqlstr      =   "select date,this from fs_remain where busino='" + TradeContext.busiNo + "'"
    AfaLoggerFunc.tradeInfo(sqlstr)
    records = AfaDBFunc.SelectSql( sqlstr )   
    if records == None:
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "操作数据库异常"
        AfaLoggerFunc.tradeInfo(sqlstr+AfaDBFunc.sqlErrMsg)
        return False
        
    if( len( records)==0 ):
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "未找到相应记录"
        AfaLoggerFunc.tradeInfo(sqlstr+AfaDBFunc.sqlErrMsg)
        return False
    else:    
        AfaLoggerFunc.tradeInfo(records[0][1])
        TradeContext.THIS        =   records[0][1]
        AfaLoggerFunc.tradeInfo(records[0][0])
        TradeContext.ACCDATE     =   records[0][0]
        
    AfaLoggerFunc.tradeInfo( '********************查找数据表结束*******************' )
    TradeContext.errorCode,TradeContext.errorMsg        =   "0000","查找非税数据成功"
    return True
        
Ejemplo n.º 3
0
def AdbSelectQueDtl( ):
   
    AfaLoggerFunc.tradeInfo( '>>>>>>>开始查询原交易<<<<<<<') 
      
    sql = "select * from YBT_INFO "
    sql = sql + " where WORKDATE = '" + TradeContext.workDate.strip() + "'"         #交易日期
    sql = sql + " and   SUBMINO  = '" + TradeContext.applno.strip()   + "'"         #投保单号
    sql = sql + " and   cpicno   = '" + TradeContext.unitno           + "'"         #保险公司单位编码
    sql = sql + " and   tellerno = '" + TradeContext.tellerno         + "'"         #交易柜员号
    
    AfaLoggerFunc.tradeInfo( '>>>>>>>开始查询原交易:'+ str(sql)) 
    
    records = AfaDBFunc.SelectSql( sql ) 
   
    AfaLoggerFunc.tradeInfo('查询到记录条数为:'+str(len(records)))
    
    #没有记录则插入数据
    if(len(records)==0):
        if not AdbInsertQueDtl( ):
            raise AfaFlowControl.flowException() 
        else:
            return True       
   
    #有记录则更新原纪录       
    else:
        if not AdbUpdateQueDtl( ):
            raise AfaFlowControl.flowException()
        else:
            return True    
Ejemplo n.º 4
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BJEDTE,BSPSQN,BRSFLG,BESBNO,BEACSB,BETELR,BEAUUS,NCCWKDAT,TRCCO,TRCDAT,TRCNO,SNDMBRCO,RCVMBRCO,SNDBNKCO,SNDBNKNM,RCVBNKCO,RCVBNKNM,BOJEDT,BOSPSQ,ORTRCCO,CUR,OCCAMT,CONT,NCCTRCST,MBRTRCST,ISDEAL,PRCCO,STRINFO,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_ztcbka WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 5
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT SNDBNKCO,TRCDAT,TRCNO,ROPRTPNO,TRCCO,RCVBNKCO,CUR,RDTCNT,RDTAMT,RCTCNT,RCTAMT,SDTCNT,SDTAMT,SCTCNT,SCTAMT,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_atrchk WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 6
0
def ADBGetInfoByUnitno():
    AfaLoggerFunc.tradeInfo( '>>>>获取保险公司相关信息<<<<' )
    AfaLoggerFunc.tradeInfo("保险公司代码[" + TradeContext.unitno + "]")
    #初始化险种代码和险种名称
    TradeContext.ProCodeStr = ''
    TradeContext.PlanName   = ''
    sql = ""
    sql = "select NOTE2 from afa_unitadm where sysid = '" + TradeContext.sysId + "' and unitno = '" + TradeContext.unitno + "'"
    record = AfaDBFunc.SelectSql( sql )
    if ( record == None ):
        AfaLoggerFunc.tradeInfo( '>>>>获取保险公司相关信息异常<<<<' )
        TradeContext.errorCode,TradeContext.errorMsg='A0100','获取保险公司相关信息异常'
        return False

    if ( len(record) <= 0):
        AfaLoggerFunc.tradeInfo( '>>>>未查到相关保险公司信息<<<<' )
        TradeContext.errorCode,TradeContext.errorMsg='A0100','未查到相关保险公司信息'
        return False

    else:
        tmplist = record[0][0].split("|")
        if len(tmplist) < 2:
            AfaLoggerFunc.tradeInfo(">>>>保险公司配置信息非法<<<<")
            TradeContext.errorCode,TradeContext.errorMsg='A0100','保险公司配置信息非法'
            return False

        TradeContext.ProCodeStr = tmplist[0]
        TradeContext.PlanName = tmplist[1]

        AfaLoggerFunc.tradeInfo( '>>>>数据库配置险种代码[' + TradeContext.ProCodeStr + ']' )
        AfaLoggerFunc.tradeInfo( '>>>>数据库配置险种名称[' + TradeContext.PlanName + ']' )

        return True
Ejemplo n.º 7
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT NCCWKDAT,SCNBBH,SCFEDT,SCRBSQ,SCEYDT,SCTLSQ,SCRVSB,SCCATR,SCWLBZ,SCTRAM,SCFLAG,SCSTCD,SCBYZ1,SCBYZ2,SCBYZ3,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_tdzjmx WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 8
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BJEDTE,BSPSQN,BRSFLG,BESBNO,BEACSB,BETELR,BEAUUS,BEAUPS,TERMID,BBSSRC,DASQ,DCFLG,OPRNO,OPRATTNO,NCCWKDAT,TRCCO,TRCDAT,TRCNO,MSGFLGNO,COTRCDAT,COTRCNO,COMSGFLGNO,SNDMBRCO,RCVMBRCO,SNDBNKCO,SNDBNKNM,RCVBNKCO,RCVBNKNM,CUR,OCCAMT,CHRGTYP,LOCCUSCHRG,CUSCHRG,PYRTYP,PYRACC,PYRNAM,PYRADDR,PYETYP,PYEACC,PYENAM,PYEADDR,STRINFO,CERTTYPE,CERTNO,BNKBKNO,BNKBKBAL,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_wtrbka WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 9
0
def closeCron(taskid):
    #======================查询系统调度信息================================
    sql = "SELECT * FROM AFA_CRONADM WHERE TASKID = '" + taskid + "'"
    
    records = AfaDBFunc.SelectSql(sql)
    
    if records == None:
        rccpsCronFunc.WrtLog( AfaDBFunc.sqlErrMsg )
        WrtLog("获取系统调度[" + taskid + "]信息异常")
        return False
    
    if len(records) <= 0:
        WrtLog("系统调度表中无此调度信息[" + taskid + "]")
        return False
    
    #======================修改系统调度状态为0=============================
    sql = "UPDATE AFA_CRONADM SET STATUS = '0' WHERE TASKID = '" + taskid + "'"
    
    if not AfaDBFunc.UpdateSql(sql):
        rccpsCronFunc.WrtLog( AfaDBFunc.sqlErrMsg )
        WrtLog("关闭系统调度[" + taskid + "]异常")
        return False
        
    WrtLog("关闭系统调度[" + taskid + "]成功")
    return True
Ejemplo n.º 10
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BESBNO,BESBNM,BESBTP,BTOPSB,BEACSB,BANKBIN,STRINFO,SUBFLG,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_subbra WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 11
0
def Query():
    try:
        if( TradeContext.existVariable( "BRNO" ) and len(TradeContext.BRNO)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[分行行号]:不能为空')
        sql="SELECT BRNO,PAYBKCODE,BANKNO,BANKACCT,BANKNAME,PAYEEBANKNO,STATUS,ACCNO,NOTE1,NOTE2,NOTE3,NOTE4,NOTE5 "
        sql=sql+" FROM TIPS_BRANCH_ADM WHERE 1=1 "
        sql=sql+"AND BRNO='"+ TradeContext.BRNO+"'"
        AfaLoggerFunc.tradeInfo(sql)
        records = AfaDBFunc.SelectSql(sql)
        if( records == None ):
            AfaLoggerFunc.tradeFatal(sql)
            return AfaFlowControl.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
        elif( len( records )==0 ):
            return AfaFlowControl.ExitThisFlow( 'A0027', '未定义信息' )
        elif( len( records )>1 ):
            return AfaFlowControl.ExitThisFlow( 'A0027', 'TIPS_BRANCH_ADM表配置错误' )
        else:
            #if records[0][5]=='0':
               # return AfaFlowControl.ExitThisFlow( 'A0027', '业务已停止' )
          #  if records[0][5]=='2':
           #     return AfaFlowControl.ExitThisFlow( 'A0027', '业务已暂停' )
            TradeContext.BRNO        = records[0][0]
            TradeContext.PAYBKCODE   = records[0][1]
            TradeContext.BANKNO      = records[0][2]
            TradeContext.BANKACCT    = records[0][3]
            TradeContext.BANKNAME    = records[0][4]
            TradeContext.PAYEEBANKNO = records[0][5]
            TradeContext.STATUS      = records[0][6]
            TradeContext.ACCNO       = records[0][7]
            TradeContext.ACCNAME     = records[0][10]
            
        return True
    except Exception, e:
        AfaLoggerFunc.tradeInfo(e)
        return AfaFlowControl.ExitThisFlow('9999', '程序处理异常'+str(e))
Ejemplo n.º 12
0
def Delete():
    try:
        if( TradeContext.existVariable( "BRNO" ) and len(TradeContext.BRNO)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[分行行号]:不能为空')

        sql="SELECT BRNO,PAYBKCODE,BANKNO,BANKACCT,BANKNAME,PAYEEBANKNO,STATUS,ACCNO,NOTE1,NOTE2,NOTE3,NOTE4,NOTE5 "
        sql=sql+" FROM TIPS_BRANCH_ADM WHERE 1=1 "
        sql=sql+"AND BRNO='"+ TradeContext.BRNO+"'"
        AfaLoggerFunc.tradeInfo(sql)
        records = AfaDBFunc.SelectSql(sql)
        if( records == None ):
            AfaLoggerFunc.tradeFatal(sql)
            return AfaFlowControl.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
        elif( len( records ) == 0 ):
            return AfaFlowControl.ExitThisFlow( 'A0027', '不存在此上线行信息' )

            
        sql="DELETE "
        sql=sql+" FROM TIPS_BRANCH_ADM WHERE 1=1 "
        if( TradeContext.existVariable( "BRNO" ) and len(TradeContext.BRNO)>0):
            sql=sql+"AND BRNO='"+ TradeContext.BRNO+"'"
        AfaLoggerFunc.tradeInfo(sql)
        records = AfaDBFunc.DeleteSqlCmt(sql)
        if( records == None or records <=0 ):
            AfaLoggerFunc.tradeFatal(sql)
            return AfaFlowControl.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
        return True
    except Exception, e:
        AfaLoggerFunc.tradeInfo(e)
        return AfaFlowControl.ExitThisFlow('9999', '程序处理异常'+str(e))
Ejemplo n.º 13
0
def SubModuleMainFst( ):

    TradeContext.__agentEigen__  = '0'   #从表标志

    AfaLoggerFunc.tradeInfo( "单位编码信息查询开始" )

    #在中台数据库中查询
    sqlstr =   "select ACCNO,NAME,AAA010 ,AAA012,BANKNO,BANKNAME  from fs_businoinfo where busino='" + TradeContext.busiNo + "' and bankno = '" + TradeContext.bankbm  + "'"

    AfaLoggerFunc.tradeInfo( sqlstr )
    records = AfaDBFunc.SelectSql( sqlstr )
    if( records == None ):
        TradeContext.errorCode  =   "9999"
        TradeContext.errorMsg   =   "查找单位编码信息异常"
        return False

    elif ( len( records)==0 ):
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "没有查找到单位编码信息"
        return False

    else:
        TradeContext.O1ACCN     =   records[0][0]           #收款人帐号
        TradeContext.O1NAME     =   records[0][1]           #收款人名字
        TradeContext.O1AAA010   =   records[0][2]           #财政区划内码
        TradeContext.O1AAA012   =   records[0][3]           #区划名称
        TradeContext.O1BANKNO   =   records[0][4]           #收款人开户行编码
        TradeContext.O1BANKNAME =   records[0][5]           #收款人开户行名称

    TradeContext.errorCode  =   "0000"
    TradeContext.errorMsg   =   "查找单位编码信息成功"
    AfaLoggerFunc.tradeInfo( "********************中台单位编码信息查询结束***************" )
    return True
Ejemplo n.º 14
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT NCCWKDAT,SNDBNKCO,TRCDAT,TRCNO,RCVBNKCO,SNDMBRCO,RCVMBRCO,TRCCO,DCFLG,PYRACC,PYEACC,CUR,OCCAMT,LOCOCCAMT,CUSCHRG,LOCCUSCHRG,ORTRCNO,BJEDTE,BSPSQN,EACTYP,EACINF,LOCEACTYP,LOCEACINF,ISDEAL,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_tddzcz WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 15
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BJEDTE,BSPSQN,BRSFLG,TRCCO,NCCWKDAT,TRCDAT,TRCNO,SNDMBRCO,RCVMBRCO,SNDBNKCO,SNDBNKNM,RCVBNKCO,RCVBNKNM,CUR,LBDCFLG,LSTDTBAL,NTTDCFLG,NTTBAL,BALDCFLG,TODAYBAL,AVLBAL,NTODAYBAL,CHKRST,BOJEDT,BOSPSQ,PRCCO,STRINFO,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_rekbal WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 16
0
def TrxMain( ):


    AfaLoggerFunc.tradeInfo('**********批量处理多笔查询(8490)开始**********')

    TradeContext.O1AFAPDATE                =           TradeContext.TranDate    #工作日期
    TradeContext.O1AFAPTIME                =           TradeContext.TranTime    #工作日期

    #查询单位信息,获得单位编号
    try:
        sql = ""
        sql = "SELECT BUSINO FROM ABDT_UNITINFO WHERE "
        sql = sql + "APPNO="  + "'" + TradeContext.I1APPNO  + "'" + " AND "        #业务编号
        sql = sql + "ACCNO="  + "'" + TradeContext.I1ACCNO  + "'"                  #对公账户
        
        AfaLoggerFunc.tradeInfo( sql )
        
        results = AfaDBFunc.SelectSql( sql )
        
        if ( results == None ):
            AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg )
            return ExitSubTrade( '9000', '查询单位信息异常' )
        
        if ( len(results) <= 0 ):
            return ExitSubTrade( '9000', '没有单位信息,不能进行此类操作')
        
    except Exception, e:
        AfaLoggerFunc.tradeFatal( str(e) )
        return ExitSubTrade( '9999', '查询单位信息失败')
Ejemplo n.º 17
0
def Insert():
    try:
        if( TradeContext.existVariable( "PAYEEBANKNO" ) and len(TradeContext.PAYEEBANKNO)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算国库支付系统行号]:不能为空')
        if( TradeContext.existVariable( "TRECODE" ) and len(TradeContext.TRECODE)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算国库代码]:不能为空')
        if( TradeContext.existVariable( "TRENAME" ) and len(TradeContext.TRENAME)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算国库名称]:不能为空')
        if( TradeContext.existVariable( "PAYEEACCT" ) and len(TradeContext.PAYEEACCT)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算国库收款账号]:不能为空')
        if( TradeContext.existVariable( "PAYEEACCTNAME" ) and len(TradeContext.PAYEEACCTNAME)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算国库收款账户名称]:不能为空')
        if( TradeContext.existVariable( "PAYBKCODE" ) and len(TradeContext.PAYBKCODE)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[国库关联行行号]:不能为空')
        if( TradeContext.existVariable( "PAYBKNAME" ) and len(TradeContext.PAYBKNAME)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[国库关联行名称]:不能为空')
        if( TradeContext.existVariable( "LIQUIDATEMODE" ) and len(TradeContext.LIQUIDATEMODE)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[清算模式]:不能为空')
        if( TradeContext.existVariable( "BRNO" ) and len(TradeContext.BRNO)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[机构代码]:不能为空')
        if( TradeContext.existVariable( "TELLERNO" ) and len(TradeContext.TELLERNO)<=0):
            return AfaFlowControl.ExitThisFlow( 'A0027', '[交易柜员]:不能为空')

        sql="SELECT PAYEEBANKNO,TRECODE,TRENAME,PAYEEACCT,PAYEEACCTNAME,PAYBKCODE,PAYBKNAME,LIQUIDATEMODE,STATUS,BRNO,TELLERNO,NOTE1,NOTE2,NOTE3,NOTE4,NOTE5 "
        sql=sql+" FROM TIPS_LIQUIDATE_ADM WHERE 1=1 "
        sql=sql+"AND PAYEEBANKNO='"+ TradeContext.PAYEEBANKNO+"'"
        sql=sql+"AND PAYBKCODE='"+ TradeContext.PAYBKCODE+"'"
        AfaLoggerFunc.tradeInfo(sql)
        records = AfaDBFunc.SelectSql(sql)
        if( records == None ):
            AfaLoggerFunc.tradeFatal(sql)
            return AfaFlowControl.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
        elif( len(records) > 0 ):
            return AfaFlowControl.ExitThisFlow( 'A0027', '已存在此清算信息' )

            
        sql="INSERT INTO  TIPS_LIQUIDATE_ADM(PAYEEBANKNO,TRECODE,TRENAME,PAYEEACCT,PAYEEACCTNAME,PAYBKCODE,PAYBKNAME,LIQUIDATEMODE,STATUS,BRNO,TELLERNO) "
        sql=sql+" VALUES "
        sql=sql+"('"+ TradeContext.PAYEEBANKNO  +"'"
        sql=sql+",'"+ TradeContext.TRECODE      +"'"
        sql=sql+",'"+ TradeContext.TRENAME      +"'"
        sql=sql+",'"+ TradeContext.PAYEEACCT    +"'"
        sql=sql+",'"+ TradeContext.PAYEEACCTNAME+"'"
        sql=sql+",'"+ TradeContext.PAYBKCODE    +"'"
        sql=sql+",'"+ TradeContext.PAYBKNAME    +"'"
        sql=sql+",'"+ TradeContext.LIQUIDATEMODE+"'"
        sql=sql+",'"+ '1'                       +"'"
        sql=sql+",'"+ TradeContext.BRNO         +"'"
        sql=sql+",'"+ TradeContext.TELLERNO     +"'"
        sql=sql+" ) "              
        AfaLoggerFunc.tradeInfo(sql)
        records = AfaDBFunc.InsertSqlCmt(sql)
        
        if( records == None or records <=0  ):
            AfaLoggerFunc.tradeFatal(sql)
            return AfaFlowControl.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
        return True
    except Exception, e:
        AfaLoggerFunc.tradeInfo(e)
        return AfaFlowControl.ExitThisFlow('9999', '程序处理异常'+str(e))
Ejemplo n.º 18
0
def GetFtpConfig( ):

    #---------------从数据库中提取信息--------------
    sqlstr =   "select hostip,downuser,downpasswd,downldir,downrdir from fs_businoconf where busino='" + TradeContext.busiNo + "'"

    AfaLoggerFunc.tradeInfo( sqlstr )

    records = AfaDBFunc.SelectSql( sqlstr )
    if( records == None ):
        AfaLoggerFunc.tradeInfo( "查找数据库异常:单位编码ftp配置信息表,联系科技人员" )
        return False

    if( len( records)==0 ):
        AfaLoggerFunc.tradeInfo( "没有查找到单位配置信息,联系科技人员" )
        return False

    else:
        TradeContext.CROP_HOSTIP   = records[0][0].strip()
        TradeContext.CROP_USERNO   = records[0][1].strip()
        TradeContext.CROP_PASSWD   = records[0][2].strip()
        TradeContext.CROP_LDIR     = records[0][3].strip()
        TradeContext.CROP_RDIR     = records[0][4].strip()

        AfaLoggerFunc.tradeInfo( "当前单位编码:%s" %TradeContext.busiNo )
        AfaLoggerFunc.tradeInfo( "当前主机地址:%s" %TradeContext.CROP_HOSTIP )
        AfaLoggerFunc.tradeInfo( "账户:%s"         %TradeContext.CROP_USERNO )
        AfaLoggerFunc.tradeInfo( "密码:%s"         %TradeContext.CROP_PASSWD )
        AfaLoggerFunc.tradeInfo( "本地路径:%s"     %TradeContext.CROP_LDIR )
        return True
Ejemplo n.º 19
0
def UpdateUserPass():

    sql = "SELECT PASSWORD FROM ABDT_USERINFO WHERE STATUS='1' AND USERNO = '" + TradeContext.USERNO + "'"

    AfaLoggerFunc.tradeInfo(sql)
        
    records =  AfaDBFunc.SelectSql( sql )

    if (records == None or len(records)==0) :
        return ExitSubTrade( '9000', '不存在用户信息' )

    if (records[0][0] != TradeContext.OLDPASSWD):
        return ExitSubTrade( '9000', '旧密码不符' )

    sql = "UPDATE ABDT_USERINFO SET PASSWORD='******'"

    sql = sql + " WHERE "

    sql = sql + "USERNO="  + "'" + TradeContext.USERNO  + "'"              #用户号

    AfaLoggerFunc.tradeInfo(sql)

    ret = AfaDBFunc.UpdateSqlCmt( sql )
    if (ret < 0):
        return ExitSubTrade('9000', '修改用户密码失败')

    return True
Ejemplo n.º 20
0
def GetConfig( CfgFileName = None ):

    #---------------从数据库中提取信息--------------
    
    #begin 20100528 蔡永贵修改
    #sqlstr =   "select hostip,upuser,uppasswd,upldir,uprdir from fs_businoconf where busino='" + TradeContext.busiNo + "'"
    sqlstr =   "select hostip,upuser,uppasswd,upldir,uprdir from fs_businoconf where busino='" + TradeContext.busiNo + "'"
    sqlstr = sqlstr + " and bankno='" + TradeContext.bankCode + "'"
    #end
    
    AfaLoggerFunc.tradeInfo( sqlstr )
    records = AfaDBFunc.SelectSql( sqlstr )
    if( records == None ):
        AfaLoggerFunc.tradeInfo( "查找数据库异常:单位编码ftp配置信息表,联系科技人员" )
        return False
        
    if( len( records)==0 ):
        AfaLoggerFunc.tradeInfo( "没有查找到单位配置信息,联系科技人员" )
        return False
    else:  
        TradeContext.CROP_HOSTIP   = records[0][0].strip()
        TradeContext.CROP_USERNO   = records[0][1].strip()
        TradeContext.CROP_PASSWD   = records[0][2].strip()
        TradeContext.CROP_LDIR     = records[0][3].strip()
        TradeContext.CROP_RDIR     = records[0][4].strip()
        
        AfaLoggerFunc.tradeInfo( "当前单位编码:%s" %TradeContext.busiNo )
        AfaLoggerFunc.tradeInfo( "当前主机地址:%s" %TradeContext.CROP_HOSTIP )
        AfaLoggerFunc.tradeInfo( "账户:%s"         %TradeContext.CROP_USERNO )
        AfaLoggerFunc.tradeInfo( "密码:%s"         %TradeContext.CROP_PASSWD )
        AfaLoggerFunc.tradeInfo( "本地路径:%s"     %TradeContext.CROP_LDIR )
        return True   
Ejemplo n.º 21
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BJEDTE,BSPSQN,BCURSQ,BCSTAT,BDWFLG,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_spbsta WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeDebug(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 22
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT SNDBNKCO,TRCDAT,TRCNO,NCCWKDAT,TRCCO,MSGTYPCO,RCVMBRCO,SNDMBRCO,SNDBRHCO,SNDCLKNO,SNDTRDAT,SNDTRTIM,MSGFLGNO,ORMFN,OPRTYPNO,ROPRTPNO,SNDBNKNM,RCVBNKCO,RCVBNKNM,CUR,OCCAMT,CUSCHRG,PYRMBRCO,PYRACC,PYEMBRCO,PYEACC,ORTRCCO,ORTRCNO,DCFLG,CBFLG,CONFFLG,CANCFLG,STRINFO,BJEDTE,BSPSQN,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_tddzmx WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 23
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT TRCDAT,BSPSQN,MSGFLGNO,ORMFN,TRCCO,BRSFLG,BESBNO,BEACSB,BETELR,BEAUUS,BEAUPS,TERMID,OPTYPE,NCCWKDAT,TRCNO,SNDMBRCO,RCVMBRCO,SNDBNKCO,SNDBNKNM,RCVBNKCO,RCVBNKNM,ORTRCDAT,ORTRCCO,ORTRCNO,ORSNDSUBBNK,ORSNDBNK,ORRCVSUBBNK,ORRCVBNK,ORPYRACC,ORPYRNAM,ORPYEACC,ORPYENAM,CUR,OCCAMT,CHRG,ERRCONBAL,BALANCE,UNCONRST,CONSTS,PRCCO,STRINFO,NOTE1,NOTE2,NOTE3,NOTE4,NOTE5 FROM rcc_acckj WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 24
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BESBNO,BPSBNO,CHGTYP,TRCCO,CHGNAM,CHGDATA,EFCTDAT,INVDATE,UPDTIME FROM rcc_chgtbl WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 25
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT BANKBIN,BANKSTATUS,BANKATTR,STLBANKBIN,BANKNAM,BANKADDR,BANKPC,BANKTEL,EFCTDAT,INVDAT,ALTTYPE,PRIVILEGE,NEWOFLG,STRINFO,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_paybnk WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict
Ejemplo n.º 26
0
def ChkCustInfo( ):

    #AfaLoggerFunc.tradeInfo('>>>判断个人协议是否存在')

    try:
        sql = ""
        sql = "SELECT PROTOCOLNO,BUSIUSERNO,ACCNO FROM ABDT_CUSTINFO WHERE "
        sql = sql + "APPNO='AG1014' AND "                                                  #业务编号
        sql = sql + "BUSINO="     + "'" + TradeContext.I1BUSINO    + "'" + " AND ("       #单位编号
        sql = sql + "BUSIUSERNO=" + "'" + TradeContext.SBNO         + "'" + " OR "         #商户客户编号
        sql = sql + "ACCNO="      + "'" + TradeContext.ACCNO        + "'" + " )AND "       #银行账号
        sql = sql + "STATUS="     + "'" + "1"                       + "'"                  #状态

        #AfaLoggerFunc.tradeInfo( sql )

        records = AfaDBFunc.SelectSql( sql )
        if ( records == None ):
            #AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg )
            return ExitSubTrade( '9000', '查询个人协议信息异常' )
        
        if ( len(records) > 0 ):
            #201208 中间业务优化 llj 判断是社保编号重复,还是账号重复
            if records[0][1]== TradeContext.SBNO:
                return ExitSubTrade( '9000', '该个人协议的社保编号已经被注册,不能再次进行注册')
            if records[0][2]== TradeContext.ACCNO: 
                return ExitSubTrade( '9000', '该个人协议的账号已经被注册,不能再次进行注册')  
            else:
                return ExitSubTrade( '9000', '该个人协议已经被注册,不能再次进行注册')    

        return True


    except Exception, e:
        AfaLoggerFunc.tradeFatal( str(e) )
        return ExitSubTrade( '9999', '判断个人协议信息是否存在异常')
Ejemplo n.º 27
0
def SubModuleMainFst( ):
    TradeContext.__agentEigen__  = '0'   #从表标志

    AfaLoggerFunc.tradeInfo( "中台查找流水金额数据库开始" )

    #在中台数据库中查询
    sqlstr = "select afc011 from fs_fc74 where afc401='" + TradeContext.serNo + "' and busino='" + TradeContext.busiNo + "' and afc016='" + TradeContext.brno + "' and afc015='" + TradeContext.AFC015 + "'"

    #===条件增加银行编码字段,张恒修改===
    sqlstr  =   sqlstr + " and afa101 = '" + TradeContext.bankbm + "'"

    records = AfaDBFunc.SelectSql( sqlstr )
    if( records == None ):
        AfaLoggerFunc.tradeInfo( sqlstr )
        TradeContext.errorCode  =   "9999"
        TradeContext.errorMsg   =   "查找流水金额失败"
        return False

    elif ( len(records)==0 ):
        AfaLoggerFunc.tradeInfo( sqlstr )
        TradeContext.errorCode  =   "0001"
        TradeContext.errorMsg   =   "没有查找到流水金额"
        return False

    else:
        TradeContext.totalAmt   =   records[0][0]

    TradeContext.errorCode  =   "0000"
    TradeContext.errorMsg   =   "查找流水金额成功"
    AfaLoggerFunc.tradeInfo( "********************中台查找流水金额数据库开始***************" )
    return True
Ejemplo n.º 28
0
def TrxMain():
    

    AfaLoggerFunc.tradeInfo('**********用户登陆(8800)开始**********')


    sqlStr = "SELECT ZONENO,BRNO,USERNAME,TEL,ADDRESS,PASSWORD FROM ABDT_USERINFO WHERE STATUS='1'"
    sqlStr = sqlStr + " AND USERNO = '" + TradeContext.USERNO + "'"

    AfaLoggerFunc.tradeInfo(sqlStr)

    records =  AfaDBFunc.SelectSql( sqlStr )
        
    if (records == None):
        AfaLoggerFunc.tradeFatal( AfaDBFunc.sqlErrMsg )
        return ExitSubTrade( '9999', '查询用户信息异常' )

    if (len(records)==0) :
        return ExitSubTrade( '9000', '该用户号不存在' )

    else:
        if ( records[0][5] == TradeContext.PASSWD ):
            TradeContext.tradeResponse.append(['ZONENO',    records[0][0]])
            TradeContext.tradeResponse.append(['BRNO',      records[0][1]])
            TradeContext.tradeResponse.append(['USERNAME',  records[0][2]])
        else:
            return ExitSubTrade( '9999', '密码错误,请重试!')

    AfaLoggerFunc.tradeInfo('**********用户登陆(8800)结束**********')

    #返回
    TradeContext.tradeResponse.append(['errorCode', '0000'])
    TradeContext.tradeResponse.append(['errorMsg',  '交易成功'])
    return True
Ejemplo n.º 29
0
def ChkLiquidStatus():
    AfaLoggerFunc.tradeInfo( '>>>获取清算信息' )
    
    sql ="SELECT PAYBKCODE,PAYEEBANKNO,TRECODE,TRENAME,PAYEEACCT,PAYBKNAME,STATUS FROM TIPS_LIQUIDATE_ADM WHERE "
    sql =sql + "BRNO = '" + TradeContext.brno + "'"
    
    AfaLoggerFunc.tradeInfo(sql)
    
    records = AfaDBFunc.SelectSql(sql)
    
    if( records == None ):
        AfaLoggerFunc.tradeFatal(sql)
        return TipsFunc.ExitThisFlow( 'A0002', '数据库操作异常:'+AfaDBFunc.sqlErrMsg )
    elif( len( records )==0 ):
        return  TipsFunc.ExitThisFlow( 'A0027', '本机构不是清算行,不可以进行对账差错查询' )
    else:
        if records[0][6]=='0':
            return TipsFunc.ExitThisFlow( 'A0027', '业务已停止,不可进行查询' )
        if records[0][6]=='2':
            return TipsFunc.ExitThisFlow( 'A0027', '业务已暂停,不可进行查询' )
        AfaLoggerFunc.tradeInfo('本机构的清算行号为'+ records[0][0])
        AfaLoggerFunc.tradeInfo('柜面送的清算行号为'+ TradeContext.payBkCode)
        if(records[0][0]!=TradeContext.payBkCode):
            return TipsFunc.ExitThisFlow( 'A0002', '清算行行号不正确,不允许做此交易')
            
    AfaLoggerFunc.tradeInfo( '>>>获取清算信息完成' )
    return True    
Ejemplo n.º 30
0
def selectu( where_dict ):
    if not chk(where_dict):
        return None

    wheresql = ""
    for where_item in where_dict.keys():
        if table_dict[where_item] == 'S':
            wheresql = wheresql + where_item + " LIKE '" + where_dict[where_item] + "' and  "
        else:
            wheresql = wheresql + where_item + " = " + str(where_dict[where_item]) + " and "

    sql = "SELECT SNDBNKCO,TRCDAT,TRCNO,NCCWKDAT,MSGTYPCO,RCVMBRCO,SNDMBRCO,TRCCO,SNDBRHCO,SNDCLKNO,SNDTRDAT,SNDTRTIM,MSGFLGNO,ORMFN,OPRTYPNO,ROPRTPNO,SNDBNKNM,RCVBNKCO,RCVBNKNM,CUR,OCCAMT,PYRACC,PYRNAM,PYRADDR,PYEACC,PYENAM,PYEADDR,OPRATTNO,SEAL,BILDAT,BILNO,BILVER,PAYWAY,BILAMT,RMNAMT,USE,REMARK,BJEDTE,BSPSQN,BCSTAT,BDWFLG,EACTYP,NOTE1,NOTE2,NOTE3,NOTE4 FROM rcc_hpdzmx WHERE " + wheresql[0:-5]
    AfaLoggerFunc.tradeInfo(sql)
    records = AfaDBFunc.SelectSql( sql )
    if (records == None):
        return None
    elif (len(records) > 1):
        AfaLoggerFunc.tradeError("查询结果非唯一,请检查查询条件[" + wheresql[0:-5] + "]")
        return None
    elif (len(records) == 0):
        AfaLoggerFunc.tradeError("查询结果为空,查询条件[" + wheresql[0:-5] + "]")
        tmp_dict = {}
        return tmp_dict
    else:
        tmp_dict = {}
        for i in xrange(0,len(table_tuple)):
            if len(str(records[0][i])) == 0:
                tmp_dict[table_tuple[i]] = ""
            else:
                tmp_dict[table_tuple[i]] = records[0][i]
        #AfaLoggerFunc.tradeInfo("return return_dict:" + str(tmp_dict))
        return tmp_dict