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() # 更新子计划状态 # 获取该子计划主产品数, 更新进度