diff --git a/apps/wpm/services.py b/apps/wpm/services.py index e53e2a5e..c9788c08 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -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)