From 1bc9cd2c60be037a1710df8b1a19e5e7f1ea1905 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 17 Jul 2025 10:26:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E6=89=B9=E6=AC=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=86=E6=9E=90=E4=B8=AD=E5=85=B3=E4=BA=8Edecimal=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/scripts/batch_bxerp.py | 4 +++- apps/wpm/scripts/batch_gxerp.py | 4 +++- apps/wpm/scripts/batch_gzerp.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/wpm/scripts/batch_bxerp.py b/apps/wpm/scripts/batch_bxerp.py index d198a6b7..8350806d 100644 --- a/apps/wpm/scripts/batch_bxerp.py +++ b/apps/wpm/scripts/batch_bxerp.py @@ -5,6 +5,8 @@ from apps.mtm.models import Mgroup import decimal from django.db.models import Sum from apps.wpm.services_2 import get_f_l_date +import json +from apps.utils.tools import MyJSONEncoder myLogger = logging.getLogger("log") def main(batch: str, mgroup_obj:Mgroup=None): @@ -93,7 +95,7 @@ def main(batch: str, mgroup_obj:Mgroup=None): else: old_data = {} old_data.update(data) - batchst.data = old_data + batchst.data = json.loads(json.dumps(old_data, cls=MyJSONEncoder)) if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time): batchst.first_time = res["first_time"] if batchst.last_time is None or (res["last_time"] and res["last_time"] > batchst.last_time): diff --git a/apps/wpm/scripts/batch_gxerp.py b/apps/wpm/scripts/batch_gxerp.py index c096f74f..3eaf3614 100644 --- a/apps/wpm/scripts/batch_gxerp.py +++ b/apps/wpm/scripts/batch_gxerp.py @@ -7,6 +7,8 @@ import decimal from django.db.models import Sum from datetime import datetime from apps.wpm.services_2 import get_f_l_date +import json +from apps.utils.tools import MyJSONEncoder myLogger = logging.getLogger("log") def main(batch: str, mgroup_obj): @@ -137,7 +139,7 @@ def main(batch: str, mgroup_obj): res = get_f_l_date(data) - batchst.data = data + batchst.data = json.loads(json.dumps(data, cls=MyJSONEncoder)) if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time): batchst.first_time = res["first_time"] if batchst.last_time is None or (res["last_time"] and res["last_time"] > batchst.last_time): diff --git a/apps/wpm/scripts/batch_gzerp.py b/apps/wpm/scripts/batch_gzerp.py index b3559f1e..27a6c508 100644 --- a/apps/wpm/scripts/batch_gzerp.py +++ b/apps/wpm/scripts/batch_gzerp.py @@ -7,6 +7,8 @@ from apps.system.models import Dept from apps.inm.models import MIOItem from apps.qm.models import FtestWork from apps.wpm.services_2 import get_f_l_date +import json +from apps.utils.tools import MyJSONEncoder myLogger = logging.getLogger("log") def main(batch: str, mgroup_obj): @@ -463,7 +465,7 @@ def main(batch: str, mgroup_obj): res = get_f_l_date(data) - batchst.data = data + batchst.data = json.loads(json.dumps(data, cls=MyJSONEncoder)) batchst.material_start = material_start if batchst.first_time is None or (res["first_time"] and res["first_time"] < batchst.first_time): batchst.first_time = res["first_time"]