fix(excel):change
This commit is contained in:
@@ -50,7 +50,7 @@ class SubRecord(pydantic.BaseModel):
|
||||
class Record(BaseModel):
|
||||
id: Optional[uuid.UUID] = Field(alias='_id')
|
||||
title: str = Field(description='عنوان در این فیلد قرار میگیرد')
|
||||
send: SubRecord = Field(description='اطلاعات ارسال در این فیلد ذخیره می شود')
|
||||
send: Optional[SubRecord] = Field(description='اطلاعات ارسال در این فیلد ذخیره می شود')
|
||||
receive: Optional[SubRecord] = Field(description='اطلاعات دریافت در این فیلد ذخیره می شود')
|
||||
|
||||
class RecordModel(Record):
|
||||
|
||||
@@ -87,6 +87,7 @@ class ContractRepository(BaseRepository):
|
||||
{'$match':query['query']},
|
||||
{'$group': {"_id": None, 'count': {'$sum': 1},'sum':{"$sum":"$amount"}}}
|
||||
]).to_list(None)
|
||||
return count[0]
|
||||
else:
|
||||
return []
|
||||
print(count)
|
||||
if len(count)>0:
|
||||
return count[0]
|
||||
return []
|
||||
|
||||
+740
-652
File diff suppressed because it is too large
Load Diff
@@ -66,14 +66,14 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
|
||||
async def create(self, coding: ProjectModel):
|
||||
coding.counter = 1
|
||||
last_project = await use_collection(COLLECTION).find({}).sort("$natural", -1).to_list(None)
|
||||
last_project = await use_collection(COLLECTION).find({}).sort("counter", -1).to_list(None)
|
||||
if last_project:
|
||||
coding.counter = last_project[0]["counter"] + 1
|
||||
code = self.create_code(coding)
|
||||
coding.design.code = 'D' + code
|
||||
coding.design.code = code
|
||||
coding.init_id().cu_at()
|
||||
if coding.monitor:
|
||||
coding.monitor.code = 'S' + code
|
||||
coding.monitor.code = code
|
||||
coding.has_monitor = True
|
||||
await self.create_report_price(coding)
|
||||
if coding.monitor.detail.date_create_project and coding.monitor.detail.first_time:
|
||||
@@ -95,12 +95,12 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
old_project = ProjectModel(**old_project_dict)
|
||||
if update.monitor and not old_project.monitor:
|
||||
code = self.create_code(update)
|
||||
update.monitor.code = 'S' + code
|
||||
update.monitor.code = code
|
||||
if update.design.nature != old_project.design.nature or update.design.type != old_project.design.type:
|
||||
code = self.create_code(update)
|
||||
update.design.code = 'D' + code
|
||||
update.design.code = code
|
||||
if update.monitor:
|
||||
update.monitor.code = 'S' + code
|
||||
update.monitor.code = code
|
||||
if update.monitor:
|
||||
update.has_monitor = True
|
||||
await self.update_report_price(update)
|
||||
|
||||
+8
-3
@@ -18,9 +18,9 @@ def design():
|
||||
def monitor():
|
||||
pass
|
||||
|
||||
@router.get('/progress1', tags=_tag_base)
|
||||
@shrink(repo.addProgress1)
|
||||
def addProgress1():
|
||||
@router.get('/progress/madarek', tags=_tag_base)
|
||||
@shrink(repo.madarek)
|
||||
def madarek():
|
||||
pass
|
||||
|
||||
@router.get('/progress/physical', tags=_tag_base)
|
||||
@@ -89,6 +89,11 @@ def addProgressTender():
|
||||
def changeStatus():
|
||||
pass
|
||||
|
||||
@router.get('/change/design/metri/sts', tags=_tag_base)
|
||||
@shrink(repo.changeStatusWithMetri)
|
||||
def changeStatusWithMetri():
|
||||
pass
|
||||
|
||||
@router.get('/progress/monitor/physical', tags=_tag_base)
|
||||
@shrink(repo.progressMonitorPhysical)
|
||||
def progressMonitor():
|
||||
|
||||
Reference in New Issue
Block a user