From 9b2dbb8a0182a66f1aba120c26826f1b8c5ae5ce Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 8 Apr 2024 18:34:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=9F=AB=E6=AD=A3cor?= =?UTF-8?q?rect=5Fmaterial=5Fcount=E7=9A=84task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/tasks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 apps/inm/tasks.py diff --git a/apps/inm/tasks.py b/apps/inm/tasks.py new file mode 100644 index 00000000..cff8fbfa --- /dev/null +++ b/apps/inm/tasks.py @@ -0,0 +1,13 @@ +from __future__ import absolute_import, unicode_literals +from apps.utils.tasks import CustomTask +from celery import shared_task +from apps.mtm.models import Material + +@shared_task(base=CustomTask) +def correct_material_count(): + """ + 矫正现有物料总数量 + """ + from apps.inm.services import InmService + for m in Material.objects.all(): + InmService.cal_mat_count(m) \ No newline at end of file