Commit b1ce71cd authored by xianyang's avatar xianyang

账户增加受益人,第四层查询增加字段

parent 1e14b02f
......@@ -169,8 +169,8 @@ def create_account(param):
# account_uuid = result['data']['result']['data']['uuid']
if result['status']:
account_uuid = result['data']['uuid']
sql = f"insert into fi_account(name, unique_tag, config_key, description, uuid, income, output, create_time) " \
f"values('{param.name}', '{param.unique_tag}', '{param.config_key}', '{param.remark}', '{account_uuid}', '{income}', '{output}', {get_now_timestamp()});"
sql = f"insert into fi_account(name, unique_tag, beneficiary, config_key, description, uuid, income, output, create_time) " \
f"values('{param.name}', '{param.unique_tag}', '{param.beneficiary}','{param.config_key}', '{param.remark}', '{account_uuid}', '{income}', '{output}', {get_now_timestamp()});"
LinkMysql(env.DB_3YV2).perform_mysql(sql)
except Exception as e:
Logger(40).logger.error(f"创建新账户失败,原因:{str(e)}")
......@@ -186,7 +186,7 @@ def update_account_info(old_data):
output = ','.join(map(str, old_data.output))
try:
sql = f"update fi_account set name='{old_data.name}',income='{income}', output='{output}', " \
f"description='{old_data.remark}' where id = {old_data.id}"
f"description='{old_data.remark}',beneficiary='{old_data.beneficiary}' where id = {old_data.id}"
LinkMysql(env.DB_3YV2).perform_mysql(sql)
except Exception as e:
Logger(40).logger.error(f"修改账户sql:{sql},原因:{str(e)}")
......@@ -709,6 +709,8 @@ class SpecificAccountQuery(object):
for i in res:
i['reference_name'] = TYPE_NAME[i['reference_type']] if TYPE_NAME.get(i['reference_type']) else i[
'reference_type']
if self.unique_tag == 'guild_account':
i['amount_type'] = '可消费' if i['amount_type'] == 'consumable' else '可提现'
data_pd = pd.DataFrame(self.total_list)
amount_total = data_pd['amount'].sum()
return res, total, float(amount_total)
......
......@@ -16,6 +16,7 @@ class AccountCreate(BaseModel):
remark: Optional[str] = ''
unique_tag: Optional[str] = ''
config_key: Optional[str] = ''
beneficiary: Optional[str] = ''
income: Optional[list] = []
output: Optional[list] = []
......@@ -32,6 +33,7 @@ class AccountUpdate(BaseModel):
remark: str
income: list
output: list
beneficiary: Optional[str] = ''
class FinanceInfo(PublicModel):
......
......@@ -112,6 +112,7 @@ def reference_type_total(date: str, type: str):
def abnormal_total(date: str, type: str, page: Optional[int] = None, size: Optional[int] = None,
token=Depends(login_required)):
"""异常数据详情"""
# 我们的第二个情人节,也陪你走过了春夏秋冬,从陌生的彼此走到了一起,完成了爱你所爱,喜你所喜,弃你所恶这样的转变
if not all([date, type]):
return HttpResultResponse(code=500, msg='缺少必传参数')
result, tota = crud.AbnormalDataDetails(date, type, page, size).abnormal_task()
......
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