Commit b6b07a78 authored by Data-韩正辉's avatar Data-韩正辉

本地可用版

parent 22f377b8
......@@ -21,7 +21,7 @@ max_limit = 800000
sql_lm = '''
select ref_id,loan_id,fc.name '资金方',date(loan_paid_at) '放款时间',contract_term '期数'
from all_back_0930.loan_manifest lm
from all_back_0831.loan_manifest lm
join basic.funding_corp fc on fc.funding_code = lm.funding_code
where loan_paid_at>='%s' and loan_paid_at <'%s'
and is_active in (1, -2)
......@@ -34,8 +34,8 @@ sql_repay_frr_2 = '''
urp.term_no '应还期数',
date(urp.deadline) '应还资金方时间',
urp.principle+urp.interest '应还资金方本息'
from all_back_0930.user_repayment_plan urp
join all_back_0930.loan_manifest lm on lm.ref_id = urp.ref_id
from all_back_0831.user_repayment_plan urp
join all_back_0831.loan_manifest lm on lm.ref_id = urp.ref_id
where lm.loan_paid_at>='%s' and loan_paid_at<'%s'
and urp.fund_code in (210,270,310,320,410,430)
'''
......@@ -49,7 +49,7 @@ sql_repay_frr_3 = '''
frp.interest+frp.principle '应还资金方本息'
from audit.funding_repayment_plan frp
join all_back_0930.loan_manifest lm on lm.ref_id = frp.ref_id
join all_back_0831.loan_manifest lm on lm.ref_id = frp.ref_id
WHERE lm.loan_paid_at>='%s' and loan_paid_at<'%s'
and lm.funding_code not in (210,270,310,320,410,430)
'''
......@@ -65,8 +65,8 @@ sql_refund = '''
frr.flow_id '流水号',
frr.term_no '应还期数'
FROM
all_back_0930.funding_repayment_record frr
join all_back_0930.loan_manifest lm on lm.ref_id = frr.ref_id
all_back_0831.funding_repayment_record frr
join all_back_0831.loan_manifest lm on lm.ref_id = frr.ref_id
JOIN basic.funding_corp fc ON fc.funding_code = frr.funding_code
WHERE lm.loan_paid_at>='%s'
and lm.loan_paid_at <'%s'
......@@ -153,11 +153,11 @@ def refund(year,month):
df[i:i + max_limit].to_excel(os.path.join(path, u'0927现金贷—还资金方表-(%s-%02d)-%d.xlsx' % (
year, month, i / max_limit + 1)), index=None, columns = columns)
else:
df.to_excel(path + u'人工控制-现金贷—还资金方表-(%d-%d)-V1.xlsx' % (year, month), index=None, columns = columns)
df.to_excel(path + u'人工控制-现金贷—还资金方表-(%d-%d)-V4.xlsx' % (year, month), index=None, columns = columns)
if __name__ == '__main__':
year = [2017]
month = range(9, 10, 1)
month = range(1, 2, 1)
for year, month in product(year, month):
print('-----------%s-%s begins') %(year,month)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment