Commit 4291f70d authored by xianyang's avatar xianyang

优化异常修复报表

parent 9fd00077
......@@ -75,12 +75,12 @@ class Recovery_fix(PublicModel):
class RecoveryTable(BaseModel):
uuid: str
uuid: Optional[str] = ''
type: int
out_money: int
entry_money: int
from_time: str
cont: str
out_money: Optional[int] = None
entry_money: Optional[int] = None
from_time: Optional[str] = ''
cont: Optional[str] = ''
@validator('cont')
def cont_must_contain_space(cls, c):
......
......@@ -455,7 +455,7 @@ def update_recovery_table(data):
change_out_price = data.out_money - old_this_info[0]['out_money']
change_entry_money = data.entry_money - old_this_info[0]['entry_money']
try:
update_sql = f"update finance_error_transverse_log set uuid='{data.uuid}',type={data.type},out_money={data.out_money},entry_money={data.entry_money},befor_out_money=befor_out_money+{change_out_price},befor_entry_money=befor_entry_money+{change_entry_money},from_time='{data.from_time}',cont='{data.cont}' where id={data.id}"
update_sql = f"update finance_error_transverse_log set type={data.type},out_money={data.out_money},entry_money={data.entry_money},befor_out_money=befor_out_money+{change_out_price},befor_entry_money=befor_entry_money+{change_entry_money},cont='{data.cont}' where id={data.id}"
LinkMysql(env.DB_3YV2).perform_mysql(update_sql)
except Exception as e:
return e
......
......@@ -177,6 +177,8 @@ def recovery_fix(page: int,
@router.post("/submit/recovery")
def finance_fix(data: acc_schemas.RecoveryTable, token=Depends(login_required), db: Session = Depends(get_db)):
"""新增异常数据修复"""
if not all([data.uuid, data.out_money, data.entry_money, data.from_time, data.cont]):
return HttpResultResponse(code=500, msg='缺少必传参数')
res = guild.create_recovery_table(data)
if res:
return HttpResultResponse(code=500, msg=res)
......
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