feat(report):add activity progress
This commit is contained in:
@@ -196,6 +196,25 @@ class ReportRepository():
|
|||||||
]).to_list(None)
|
]).to_list(None)
|
||||||
return report
|
return report
|
||||||
|
|
||||||
|
async def progress_activity(self,project_id:uuid.UUID):
|
||||||
|
secondary = await use_collection(TaskEnv.CLN_MONITOR_SECONDARY).find({"project_id":project_id}).to_list(None)
|
||||||
|
_obj = {}
|
||||||
|
for i in secondary:
|
||||||
|
_obj[str(i["_id"])] = i['title']
|
||||||
|
ids = [i["_id"] for i in secondary]
|
||||||
|
report = await use_collection(TaskEnv.CLN_MONITOR_SUB_SECONDARY).aggregate([
|
||||||
|
{"$match": {"parent_id": {"$in": ids}}},
|
||||||
|
{"$group": {
|
||||||
|
"_id":"$parent_id",
|
||||||
|
"total_program": {"$sum": "$program"},
|
||||||
|
"total_real": {"$sum": "$real"},
|
||||||
|
}}
|
||||||
|
]).to_list(None)
|
||||||
|
if report:
|
||||||
|
for i in report:
|
||||||
|
i["title"] = _obj[str(i["_id"])]
|
||||||
|
return report
|
||||||
|
|
||||||
async def list_delay_donut(self, _select: str):
|
async def list_delay_donut(self, _select: str):
|
||||||
get_list = []
|
get_list = []
|
||||||
_map = {'1': 'financial.total', '2': 'force_major.total', '3': 'technical.total', '4': 'extra_new_work',
|
_map = {'1': 'financial.total', '2': 'force_major.total', '3': 'technical.total', '4': 'extra_new_work',
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ def delay_donut(project_id:uuid.UUID):
|
|||||||
@shrink(repo.delay_donut_detail)
|
@shrink(repo.delay_donut_detail)
|
||||||
def delay_donut_detail(_inp: DelayDonutDetail = Body(...)):
|
def delay_donut_detail(_inp: DelayDonutDetail = Body(...)):
|
||||||
pass
|
pass
|
||||||
|
#نمودار پیشرفت فعالیت ها
|
||||||
|
@router.get('/progress_activity/{project_id}', tags=_tag_base)
|
||||||
|
@shrink(repo.progress_activity)
|
||||||
|
def progress_activity(project_id:uuid.UUID):
|
||||||
|
pass
|
||||||
|
|
||||||
@router.get('/donut/delay/percent', tags=_tag_base)
|
@router.get('/donut/delay/percent', tags=_tag_base)
|
||||||
@shrink(repo.sum_delay_percent)
|
@shrink(repo.sum_delay_percent)
|
||||||
|
|||||||
Reference in New Issue
Block a user