From f5f6c136d9704e5aa80f4c2741424b10769c847f Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sat, 11 Oct 2025 10:21:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20work=5Fstart=5Ftime=20=E5=8F=AF=E4=B8=8D?= =?UTF-8?q?=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 9c4cbd38..cd9f63fe 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -636,18 +636,15 @@ class MlogSerializer(CustomModelSerializer): mgroup:Mgroup = attrs['mgroup'] work_start_time:datetime = attrs.get('work_start_time', None) if work_start_time: - handle_date, attrs["shift"] = mgroup.get_shift(work_start_time) + attrs['handle_date'], attrs["shift"] = mgroup.get_shift(work_start_time) else: if "handle_date" in attrs and attrs["handle_date"]: pass else: raise ParseError('缺少生产日期') if mtask and mtask.start_date == mtask.end_date: - attrs['handle_date'] = mtask.end_date - if attrs['handle_date'] != handle_date: + if attrs['handle_date'] != mtask.end_date: raise ParseError('任务日期与生产日期不一致') - elif work_start_time: - attrs['handle_date'] = handle_date handle_user = attrs.get('handle_user', None) if handle_user is None and hasattr(self, "request"):