feat(BillDelayModel):add total day
This commit is contained in:
@@ -10,6 +10,7 @@ class BillDelayRepository(BaseRepository):
|
||||
super().__init__(collection=TaskEnv.CLN_BILL_DELAY, model=BillDelayModel)
|
||||
|
||||
def create_sum(self, coding: BillDelayModel) -> BillDelayModel:
|
||||
all_total = 0
|
||||
if coding.financial:
|
||||
total = 0
|
||||
if coding.financial.status:
|
||||
@@ -21,6 +22,7 @@ class BillDelayRepository(BaseRepository):
|
||||
if coding.financial.good_job:
|
||||
total += coding.financial.good_job
|
||||
coding.financial.total = total
|
||||
all_total += total
|
||||
if coding.force_major:
|
||||
total = 0
|
||||
if coding.force_major.force_event:
|
||||
@@ -32,6 +34,7 @@ class BillDelayRepository(BaseRepository):
|
||||
if coding.force_major.define_indicators:
|
||||
total += coding.force_major.define_indicators
|
||||
coding.force_major.total = total
|
||||
all_total += total
|
||||
|
||||
if coding.technical:
|
||||
total = 0
|
||||
@@ -44,6 +47,13 @@ class BillDelayRepository(BaseRepository):
|
||||
if coding.technical.suspense:
|
||||
total += coding.technical.suspense
|
||||
coding.technical.total = total
|
||||
all_total += total
|
||||
if coding.extra_new_work:
|
||||
all_total += coding.extra_new_work
|
||||
if coding.other:
|
||||
all_total += coding.other
|
||||
if all_total:
|
||||
coding.total_day = all_total
|
||||
return coding
|
||||
async def create(self, coding: BillDelayModel):
|
||||
coding = self.create_sum(coding)
|
||||
|
||||
Reference in New Issue
Block a user