feat(project):add delay date
This commit is contained in:
@@ -3,6 +3,7 @@ import uuid
|
||||
from uuid import UUID
|
||||
|
||||
import requests
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from fastapi import HTTPException
|
||||
|
||||
from app.config import TaskEnv
|
||||
@@ -62,6 +63,10 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
coding.monitor.code = 'S'+code
|
||||
coding.has_monitor = True
|
||||
await self.create_report_price(coding)
|
||||
if coding.monitor.detail.date_create_project and coding.monitor.detail.first_time:
|
||||
date_create = coding.monitor.detail.date_create_project
|
||||
months = int(coding.monitor.detail.first_time)
|
||||
coding.date_delay = date_create + relativedelta(months=months)
|
||||
else:
|
||||
coding.has_monitor = False
|
||||
|
||||
@@ -72,7 +77,6 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
status= coding.design.status_agreement
|
||||
).init_id().cu_at()
|
||||
await use_collection(TaskEnv.CLN_PROJECT_AGREEMENT).insert_one(_model.mongo_dict())
|
||||
|
||||
return await self.get(coding.id)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user