From bd33a33ed664c9b6d6dd6a101ddec742e18f8206 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 16 May 2024 17:18:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20get=5Fpcoal=5Fheat=20=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=B8=A5=E8=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)