diff --git a/hb_server/apps/wpm/signals.py b/hb_server/apps/wpm/signals.py index 04455d7..67ba2d2 100644 --- a/hb_server/apps/wpm/signals.py +++ b/hb_server/apps/wpm/signals.py @@ -71,6 +71,8 @@ def handleTicket(sender, instance, created, **kwargs): elif decision in [WProduct.NG_ACCEPT, WProduct.NG_PERMIT]: wp.act_state = WProduct.WPR_ACT_STATE_OK + if wp.test_wproduct.filter(is_submited=True).order_by('-id').last().type == TestRecord.TEST_PROCESS_RE: + wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT wp.ng_sign = decision wt.save() wp.ticket = None # 解除当前工单 diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 00410a0..9e53ef9 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -331,6 +331,8 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet): ip = {} ip['fifoitem'] = fifoitem ip['wproduct'] = i + if i.number is None: + raise exceptions.APIException('缺少编号') ip['number'] = i.number ip['material'] = material ips.append(FIFOItemProduct(**ip)) @@ -658,7 +660,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd if set(list(sps_omi_l)) != set(list(sps_omo_l)): raise exceptions.APIException('消耗与产出不一致') else: - if not omis.exists() and processId !=1: # 不是冷加工 + if omis.exists() and processId !=1: # 不是冷加工 raise exceptions.APIException('请选择消耗物料') # 检查自定义表单填写