From 841815bbb697e09de05245e388c857fe57755b9c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 25 Jul 2023 13:58:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=8F=AD=E6=9C=88=E8=B4=A8=E6=A3=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/tasks.py | 2 +- apps/qm/tasks.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index fbbe5df2..3ba8ddda 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -218,7 +218,7 @@ def compute_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, mont defaults={'type': 'day_s', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'day_s': day_s, 'total_production': 0, 'elec_consume': 0}) elif type == 'month_st': enstat, _ = EnStat.objects.get_or_create(type="month_st", mgroup=mgroup, team=team, year_s=year_s, month_s=month_s, - defaults={'type': 'month_sf', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'team': team, 'total_production': 0, 'elec_consume': 0}) + defaults={'type': 'month_st', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'team': team, 'total_production': 0, 'elec_consume': 0}) elif type == 'month_s': enstat, _ = EnStat.objects.get_or_create(type="month_s", mgroup=mgroup, year_s=year_s, month_s=month_s, defaults={'type': 'month_s', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'total_production': 0, 'elec_consume': 0}) diff --git a/apps/qm/tasks.py b/apps/qm/tasks.py index e2bdd610..b844c1cf 100644 --- a/apps/qm/tasks.py +++ b/apps/qm/tasks.py @@ -142,12 +142,12 @@ ORDER BY mgroup.sort, mtma.sort, qmt.sort and qmq.val_avg is not NULL and qmq.num_test is not NULL and qmq.num_ok is not NULL - GROUP BY mgroup."id", mtma."id", qmt."id", mgroup.sort, mtma.sort, qmt.sort - ORDER BY mgroup.sort, mtma.sort, qmt.sort + GROUP BY mtma."id", qmt."id", mtma.sort, qmt.sort + ORDER BY mtma.sort, qmt.sort """ res3 = query_all_dict(sql_q3) - enstat, _ = EnStat.objects.get_or_create(type="month_sf", mgroup=mgroup, team=team, year_s=year_s, month_s=month_s, - defaults={'type': 'month_sf', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'team': team, 'total_production': 0, 'elec_consume': 0}) + enstat, _ = EnStat.objects.get_or_create(type="month_st", mgroup=mgroup, team=team, year_s=year_s, month_s=month_s, + defaults={'type': 'month_st', 'mgroup': mgroup, 'year_s': year_s, 'month_s': month_s, 'team': team, 'total_production': 0, 'elec_consume': 0}) enstat.qua_data = res3 enstat.save()