fix: get_pcoal_heat 逻辑严谨

This commit is contained in:
caoqianming 2024-05-16 17:18:17 +08:00
parent a90396099b
commit bd33a33ed6
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ def get_pcoal_heat(year_s: int, month_s: int, day_s: int):
try:
qs = SfLog.objects.get(work_date__year=year_s, work_date__month=month_s, work_date__day=day_s,
mgroup__name='回转窑', shift__name__in=['白班', '早班']) # hardcode
if qs.pcoal_heat is None:
if qs.pcoal_heat is None or qs.pcoal_heat <=0:
qs.pcoal_heat = 6000
qs.save(update_fields=['pcoal_heat'])
cache.set(f'pcoal_heat_{year_s}_{month_s}_{day_s}', qs.pcoal_heat)