feat(report):change report sts
This commit is contained in:
@@ -9,9 +9,12 @@ class ReportRepository():
|
||||
async def project_status(self, _inp: StatusReport, type):
|
||||
if _inp.state:
|
||||
match = {f'{type}.sts': {'$exists': 1}, 'design.state': _inp.state}
|
||||
|
||||
else:
|
||||
match = {f'{type}.sts': {'$exists': 1}}
|
||||
if _inp.type_id:
|
||||
match.update({'design.type_id': _inp.type_id})
|
||||
if _inp.nature_id:
|
||||
match.update({'design.nature_id': _inp.nature_id})
|
||||
report = await use_collection(TaskEnv.CLN_PROJECT).aggregate([
|
||||
{
|
||||
"$match": match
|
||||
@@ -41,12 +44,6 @@ class ReportRepository():
|
||||
match.update({'design.nature_id': _inp.nature_id})
|
||||
if _inp.monitor_type:
|
||||
match.update({'monitor.base_information.type': _inp.monitor_type})
|
||||
|
||||
# count_nature = await use_collection(TaskEnv.CLN_PROJECT).count_documents(
|
||||
# {'design.nature_id':_inp.nature_id,'design.state':_inp.state})
|
||||
# count_type = await use_collection(TaskEnv.CLN_PROJECT).count_documents({'design.type_id': _inp.type_id,'design.state':_inp.state})
|
||||
# count_monitor_type = await use_collection(TaskEnv.CLN_PROJECT).count_documents({'monitor.base_information.type': _inp.monitor_type,'design.state':_inp.state})
|
||||
|
||||
report = await use_collection(TaskEnv.CLN_PROJECT).aggregate([
|
||||
{"$match": match},
|
||||
{'$group': {
|
||||
@@ -132,6 +129,7 @@ class ReportRepository():
|
||||
return report
|
||||
|
||||
async def list_donut(self, _inp: DonutList):
|
||||
_filter = None
|
||||
if _inp.type == 1:
|
||||
_filter = {'design.nature_id': int(_inp.donut_select)}
|
||||
if _inp.type == 2:
|
||||
@@ -173,6 +171,7 @@ class ReportRepository():
|
||||
if report:
|
||||
for i in report:
|
||||
get_list.append(i['_id'])
|
||||
# projects = await use_collection(TaskEnv.CLN_PROJECT).find({"_id":{"$in":get_list}}).to_list(None)
|
||||
return get_list
|
||||
|
||||
async def sum_delay_percent(self):
|
||||
|
||||
Reference in New Issue
Block a user