示例#1
0
def starun(etldate):
    Config().etldate = int(etldate)
    ufoi.update_orgid(int(etldate), int(etldate))
    info("run busi_hook star")

    busi_hook(etldate)
    ''' 
    info("run del_dup") 
    uhb.del_dup()
    info("run insert_account_hook_by_cust:存款") 
    uchb.insert_account_hook_by_cust(int(etldate),'存款') #根据客户挂钩补账户挂钩
    info("run insert_account_hook_by_cust:理财") 
    uchb.insert_account_hook_by_cust(int(etldate),'理财') #根据客户挂钩补账户挂钩
    '''
    parent_hook_start(etldate)
    util.fix_seq_id('D_MANAGE', 'D_MANAGE_SEQ')
    util.fix_seq_id('D_MANAGE', 'D_ACCOUNT_SEQ')
示例#2
0
def starun(startdate, enddate, model):
    info("starun:%s-%s,model[%s]" % (str(startdate), str(enddate), model))
    if model == None:
        etldate = startdate
        while int(etldate) <= int(enddate):
            ufoi.update_orgid(int(etldate), int(etldate))
            run_etl(etldate, etldate)
            etldate = daycalc(etldate, 1)
        uhb.del_dup()
        uhb.insert_miss(int(enddate), '存款')  #补齐正常数据
        uhb.insert_miss(int(enddate), '理财')  #补齐正常数据
        uhb.insert_miss_percentage(int(enddate), '存款')  #补齐正常分润数据
        uhb.insert_miss_percentage(int(enddate), '理财')  #补齐正常分润数据
        uhb.update_balance(int(enddate))
        util.fix_seq_id('D_MANAGE', 'D_MANAGE_SEQ')
    else:
        etldate = startdate
        while int(etldate) <= int(enddate):
            run_etl(etldate, etldate, model)
            etldate = daycalc(etldate, 1)
        util.fix_seq_id('D_MANAGE', 'D_MANAGE_SEQ')
示例#3
0
def run_etl_main(startdate, enddate, q1, q2, model=None):
    print "load dims "
    info("start_run_etl_main:%s,model=%s" % (str(startdate), model))
    d1 = datetime.now()
    etldate = int(startdate)
    Config().etldate = etldate
    #load_dims(q1,q2,q3)

    #TBD CCRD MPUR跑,跑完打开 plwu
    load_dims(q2)
    print "load dims ,times=", datetime.now() - d1
    print "run_etl_man step1..."
    print etldate

    if model == 'E':
        util.delete_contract(etldate, int(enddate), '丰收e支付')
        util.delete_contract(etldate, int(enddate), '新丰收e支付')
    elif model == 'L':
        util.delete_contract(etldate, int(enddate), '贷款合同')
    elif model == 'T':
        util.delete_contract(etldate, int(enddate), '自助终端')
    elif model == 'A':
        util.delete_contract(etldate, int(enddate), 'ATM')
    elif model == 'P':
        util.delete_contract(etldate, int(enddate), 'POS')
    elif model == 'Z':
        util.delete_contract(etldate, int(enddate), '支付宝快捷支付')
    elif model == 'C':
        util.delete_creditbad2(etldate, int(enddate))
    elif model == 'CM':
        util.delete_creditmpur(etldate, int(enddate))
        util.delete_creditbad2(etldate, int(enddate))  #TBD
    else:
        util.delete_contract(etldate, int(enddate), '丰收e支付')
        util.delete_contract(etldate, int(enddate), '新丰收e支付')
        util.delete_contract(etldate, int(enddate), '贷款合同')
        util.delete_contract(etldate, int(enddate), '支付宝快捷支付')
        #util.delete_creditmpur(etldate,int(enddate))
        #util.delete_creditbad2(etldate,int(enddate)) #TBD

    while int(etldate) <= int(enddate):
        print "run_etl_main step2...", etldate
        info("run_etl_main step2:%d,model=%s" % (int(etldate), model))
        d1 = datetime.now()
        Config().etldate = etldate
        Config().stretldate = util.tostrdate(etldate)
        if model == 'E':
            info("run EPAY")
            EPay().loadtofact(q1, q1)
        elif model == 'L':
            info("run LOANCONTRACT")
            loanCon().loadtofact(q1, q1)
        elif model == 'CM':
            info("run CCRDMPUR")
        elif model == 'T':
            info("run TERMINAL")
            Terminal().loadtofact(q1, q1)
        elif model == 'A':
            info("run ATM")
            ATM().loadtofact(q1, q1)
        elif model == 'P':
            info("run POS")
            POS().loadtofact(q1, q1)
        elif model == 'Z':
            info("run ZFBKJ")
            ZFBKJ().loadtofact(q1, q1)
        else:
            info("run EPAY")
            EPay().loadtofact(q1, q1)
            info("run CCRDACCT")
            info("run ZFBKJ")
            ZFBKJ().loadtofact(q1, q1)
            loanCon().loadtofact(q1, q1)  #贷款合同
        etldate = int(daycalc(etldate, 1))
        util.fix_seq_id('D_CUST_CONTRACT', 'D_CUST_CONTRACT_SEQ')
    info("finish_run_etl_main:%s,model=%s" % (str(startdate), model))
示例#4
0
def run_etl_main(startdate, enddate, q1, q2, model=None):
    print "load dims "
    info("start_run_etl_main:%s,model=%s" % (str(startdate), model))
    d1 = datetime.now()
    etldate = int(startdate)
    Config().etldate = etldate
    #load_dims(q1,q2,q3)
    load_dims(q2)
    print "load dims ,times=", datetime.now() - d1
    print "run_etl_man step1..."
    print etldate
    if model == 'C':
        util.delete_fcustview(etldate, int(enddate))
    elif model == 'F':
        util.delete_financialsale(etldate, int(enddate))
    elif model == 'T':
        util.delete_blta(etldate, int(enddate))
    elif model == 'BILL':
        util.delete_fbillacount(etldate, int(enddate))
    elif model == 'GAS':
        util.delete_gasaccount(etldate, int(enddate))
    else:
        #util.delete_fcustview(etldate,int(enddate))
        util.delete_financialsale(etldate, int(enddate))
        util.delete_fcacctjrnl(etldate, int(enddate))
        util.delete_fbillacount(etldate, int(enddate))

    while int(etldate) <= int(enddate):
        print "run_etl_main step2...", etldate
        d1 = datetime.now()
        Config().etldate = etldate
        Config().stretldate = util.tostrdate(etldate)
        if model == 'C':
            info("run CUSTVIEW")
            CustView().loaddbtofact(q1, q1)
        elif model == 'F':
            info("run financialsale")
            FinancialSale().loadtofact(q2, q2)
        elif model == 'T':
            info("run FTransAtion")
            FTransAtion().loadtofact(q2, q2)
        elif model == 'BILL':
            info("run Fbill")
            FBillAccount().loadtofact(q2, q2)
        elif model == 'GAS':
            info("run gas")
            GAS().loadtofact(q2, q2)
            GAS_BRANCH().loadtofact(q2, q2)
            GAS_DO6().loadtofact(q2, q2)
            GAS_KJ().loadtofact(q2, q2)
        else:
            #info("run CUSTVIEW")
            #CustView().loaddbtofact(q1,q1)
            info("run financialsale")
            FinancialSale().loadtofact(q2, q2)
            info("run FTransAtion")
            FTransAtion().loadtofact(q2, q2)
            info("run Fbill")
            FBillAccount().loadtofact(q2, q2)
        #update_org_manage_bal(etldate)
        #update_ltd(etldate,etldate)
        #update_orgid(etldate,etldate)
        etldate = int(daycalc(etldate, 1))
        util.fix_seq_id('D_ACCOUNT', 'D_ACCOUNT_SEQ_NEW')
    q1.put(None)
    q2.put(None)
    #q3.put(None)
    info("finish_run_etl_main:%s,model=%s" % (str(startdate), model))
示例#5
0
def run_etl_main(startdate, enddate, q1, q2, model=None):
    info("start_run_etl_main:%s,model=%s" % (str(startdate), model))
    d1 = datetime.now()
    etldate = int(startdate)
    Config().etldate = etldate
    #load_dims(q1,q2,q3)
    load_dims(q2)
    if model == 'C':
        util.delete_fcustview(etldate, int(enddate))
    elif model == 'F':
        util.delete_financialsale(etldate, int(enddate))
    elif model == 'T':
        util.delete_fcacctjrnl(etldate, int(enddate))
    elif model == 'POS':
        util.delete_pos_insert(etldate, int(enddate))
    elif model == 'CORP':  #国际业务按客户
        util.delete_ebills_qry_settlement_corp(etldate, int(enddate))
    elif model == 'CASH_INFO':  #现金调拨信息信息
        util.delete_core_bhfmcmrd(etldate, int(enddate))
    elif model == 'CASH_DIR':  #现金调拨方向
        util.delete_CORE_BHFMCMRM_DIRECT(etldate, int(enddate))
    elif model == 'ATM':
        util.delete_atm_insert(etldate, int(enddate))
    elif model == 'FTBHB':
        util.delete_financialsale(etldate, int(enddate))
        util.delete_fcacctjrnl(etldate, int(enddate))
        util.delete_fbillacount(etldate, int(enddate))
        util.delete_blfm(etldate, int(enddate))
        util.delete_blfmmtrn(etldate, int(enddate))
    elif model == 'BILL':
        util.delete_fbillacount(etldate, int(enddate))
    elif model == 'HXHK':  #核销清单
        util.delete_blfm(etldate, int(enddate))
    elif model == 'BLFMM':  #逾期还款清单
        util.delete_blfmmtrn(etldate, int(enddate))
    else:
        pass

    while int(etldate) <= int(enddate):
        print "run_etl_main step2...", etldate
        d1 = datetime.now()
        Config().etldate = etldate
        Config().stretldate = util.tostrdate(etldate)
        if model == 'C':
            info("run CUSTVIEW")
            CustView().loaddbtofact(q1, q1)
        elif model == 'F':
            info("run financialsale")
            FinancialSale().loadtofact(q2, q2)
        elif model == 'T':
            info("run FTransAtion")
            FTransAtion().loadtofact(q2, q2)
        elif model == 'CORP':  #国际业务按客户
            qry_settlement_corp().loadtofact(q2, q2)
        elif model == 'CASH_INFO':  #现金调拨信息信息
            corp_bhfmcmrd().loadtofact(q2, q2)
        elif model == 'CASH_DIR':  #现金调拨方向
            core_bhfmcmrm_direct().loadtofact(q2, q2)
        elif model == 'POS':  #新增POS助农
            PosInsert().loadtofact(q2, q2)
        elif model == 'ATM':  #新增ATM助农
            AtmInsert().loadtofact(q2, q2)
        elif model == 'FTBHB':
            info("run financialsale")
            FinancialSale().loadtofact(q2, q2)
            info("run FTransAtion")
            FTransAtion().loadtofact(q2, q2)
            info("run Fbill")
            FBillAccount().loadtofact(q2, q2)
            info("run Blfmcnaf")
            Blfmcnaf().loadtofact(q2, q2)
            info("run Blfmmtrn")
            Blfmmtrn().loadtofact(q2, q2)
        elif model == 'BILL':
            info("run Fbill")
            FBillAccount().loadtofact(q2, q2)
        elif model == 'HXHK':  #核销清单       F_CORE_BLFMCNAF
            Blfmcnaf().loadtofact(q2, q2)
        elif model == 'BLFMM':  ##逾期还款清单  F_CORE_BLFMMTRN
            Blfmmtrn().loadtofact(q2, q2)
        else:
            pass
        etldate = int(daycalc(etldate, 1))
        util.fix_seq_id('D_ACCOUNT', 'D_ACCOUNT_SEQ_NEW')
    info("finish_run_etl_main:%s,model=%s" % (str(startdate), model))
示例#6
0
def sequence():
    util.fix_seq_id('D_MANAGE', 'D_MANAGE_SEQ')
    util.fix_seq_id('D_CUST_CONTRACT', 'D_CUST_CONTRACT_SEQ')
    util.fix_seq_id('D_ACCOUNT', 'D_ACCOUNT_SEQ_NEW')
    util.fix_seq_id('MENU', 'MENU_ID_SEQ')