feat(report):add delay_donut_all

This commit is contained in:
shahzeydyfah
2025-01-17 13:25:38 +03:30
parent b5e93ab4e8
commit 9701dc3cd5
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -244,6 +244,17 @@ class ReportRepository():
"totalDeviation": {"$sum": "$deviation"}, }}]).to_list(None)
return report
async def delay_donut_all(self):
report = await use_collection(TaskEnv.CLN_BILL_DELAY).aggregate([
{'$group': {"_id": None, "total_financial": {"$sum": "$financial.total"},
"total_force_major": {"$sum": "$force_major.total"},
"total_technical": {"$sum": "$technical.total"},
"total_extra_new_work": {"$sum": "$extra_new_work"},
"total_other": {"$sum": "$other"},
}}
]).to_list(None)
return report
async def list_delay_donut(self, _select: str):
get_list = []
_map = {'1': 'financial.total', '2': 'force_major.total', '3': 'technical.total', '4': 'extra_new_work',
+4
View File
@@ -58,6 +58,10 @@ def categorize_deviation():
def sum_add_time_end_project():
pass
@router.get('/donut/delay/all', tags=_tag_base)
@shrink(repo.delay_donut_all)
def delay_donut_all():
pass
#لیست پروژه ها را نمایش میده
@router.get('/donut/delay/{_select}', tags=_tag_base)
@shrink(repo.list_delay_donut)