Commit ac823a59 authored by 赵杰's avatar 赵杰

性别

parent e207beb6
......@@ -36,6 +36,7 @@ class UserCustomerDataAdaptor:
self.user_id = user_id
self.customer_id = customer_id
self.compare_index_id = index_id
self.valueSex = ''
p_end_date = pd.to_datetime(end_date).date()
p_end_date = datetime.date(year=p_end_date.year, month=p_end_date.month, day=1) - datetime.timedelta(days=1)
self.end_date = pd.to_datetime(str(p_end_date))
......@@ -80,10 +81,10 @@ class UserCustomerDataAdaptor:
tamp_diagnose_app_session = tamp_diagnose_app.session
tamp_product_session = tamp_product.session
tamp_fund_session = tamp_fund.session
sql_user = """select f1.fund_id, f2.realname,f3.customer_name,f1.type,f1.order_type,f1.pay_date,f1.subscription_fee,f1.confirm_share_date,f1.confirm_share,f1.confirm_amount,f1.nav,f1.folio_name from tamp_order.customer_order_view f1, tamp_user.user_info f2,tamp_user.customer_info f3 where f2.id=f1.user_id and f3.id=f1.customer_id and f1.delete_tag=0 and user_id='{}' and customer_id='{}'""".format(self.user_id, self.customer_id)
sql_user = """select f1.fund_id, f2.realname,f3.customer_name,f3.valueSex,f1.type,f1.order_type,f1.pay_date,f1.subscription_fee,f1.confirm_share_date,f1.confirm_share,f1.confirm_amount,f1.nav,f1.folio_name from tamp_order.customer_order_view f1, tamp_user.user_info f2,tamp_user.customer_info f3 where f2.id=f1.user_id and f3.id=f1.customer_id and f1.delete_tag=0 and user_id='{}' and customer_id='{}'""".format(self.user_id, self.customer_id)
cur = tamp_diagnose_app_session.execute(sql_user)
data = cur.fetchall()
order_df = pd.DataFrame(list(data), columns=['fund_id', 'username', 'customer_name', 'type', 'order_type', 'pay_date',
order_df = pd.DataFrame(list(data), columns=['fund_id', 'username', 'customer_name', 'valueSex', 'type', 'order_type', 'pay_date',
'subscription_fee', 'confirm_share_date', 'confirm_share',
'confirm_amount', 'nav', 'folio_name'])
cur_fund_id = list(order_df["fund_id"].unique())
......@@ -108,6 +109,7 @@ class UserCustomerDataAdaptor:
user_customer_order_df["confirm_share_date"] = user_customer_order_df["confirm_share_date"].apply(lambda x: pd.to_datetime(x.date()))
self.customer_real_name = user_customer_order_df["customer_name"].values[0]
self.ifa_real_name = user_customer_order_df["username"].values[0]
self.valueSex = user_customer_order_df["valueSex"].values[0]
user_customer_order_df = user_customer_order_df[user_customer_order_df["confirm_share_date"] <= self.end_date]
user_customer_order_df["confirm_amount"] = user_customer_order_df["confirm_amount"] - user_customer_order_df["subscription_fee"]
user_customer_order_df.index = pd.Series(range(len(user_customer_order_df)))
......
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