feat(report):add activity progress
This commit is contained in:
@@ -196,6 +196,25 @@ class ReportRepository():
|
||||
]).to_list(None)
|
||||
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):
|
||||
get_list = []
|
||||
_map = {'1': 'financial.total', '2': 'force_major.total', '3': 'technical.total', '4': 'extra_new_work',
|
||||
|
||||
Reference in New Issue
Block a user