From 43d297881e279da6e1f04c4398e882d464a19c46 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 16 Nov 2021 17:08:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 8c929c9..8652c4b 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -24,6 +24,7 @@ from rest_framework import exceptions, serializers from apps.wpm.services import WpmServies from django.utils import timezone +import uuid # Create your views here. class WPlanViewSet(ListModelMixin, GenericViewSet): """ @@ -164,7 +165,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet): if obj.is_testok: wproduct.act_state = WProduct.WPR_ACT_STATE_OK if wproduct.number is None: # 产生半成品编号 - wproduct.number = 'BCP' + str(timezone.now()) + wproduct.number = uuid.uuid4() wproduct.save() # 更新子计划状态 # 获取该子计划主产品数, 更新进度