From 95fd22c026bd0af2ead5a744e6cbdd86d77122e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Tue, 14 Jun 2022 09:05:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/develop/views.py | 4 +++- hb_server/apps/mtm/views.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hb_server/apps/develop/views.py b/hb_server/apps/develop/views.py index 96ed853..6364b66 100644 --- a/hb_server/apps/develop/views.py +++ b/hb_server/apps/develop/views.py @@ -25,12 +25,14 @@ class CleanDataView(APIView): """ Order.objects.all().delete(soft=False) ProductionPlan.objects.all().delete(soft=False) - FIFO.objects.all().delete(soft=False) + FIFO.objects.all().delete() Material.objects.filter(type__in=[Material.MA_TYPE_GOOD, Material.MA_TYPE_HALFGOOD]).update(count=0) MaterialBatch.objects.filter(material__type__in=[Material.MA_TYPE_GOOD, Material.MA_TYPE_HALFGOOD]).delete() Inventory.objects.filter(material__type__in=[Material.MA_TYPE_GOOD, Material.MA_TYPE_HALFGOOD]).delete() Ticket.objects.all().delete(soft=False) Operation.objects.all().delete() + from apps.pum.models import PuOrder + PuOrder.objects.all().delete(soft=False) return Response() diff --git a/hb_server/apps/mtm/views.py b/hb_server/apps/mtm/views.py index 9220df3..c5932e5 100644 --- a/hb_server/apps/mtm/views.py +++ b/hb_server/apps/mtm/views.py @@ -35,8 +35,8 @@ class PackItemViewSet(CreateUpdateModelAMixin, ModelViewSet): """ 装箱项目-增删改查 """ - perms_map = {'get': '*', 'post': 'packitem_create', - 'put': 'packitem_update', 'delete': 'packitem_delete'} + perms_map = {'get': '*', 'post': 'material_update', + 'put': 'material_update', 'delete': 'material_update'} queryset = PackItem.objects.all() serializer_class = PackItemSerializer search_fields = ['name', 'number'] From 3773482b937a089eccb965d696b71014e3dc4e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Tue, 14 Jun 2022 09:21:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=87=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E4=B8=8B=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E5=AD=90=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 3b4ab4a..3f623d6 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -50,8 +50,8 @@ class WPlanViewSet(ListModelMixin, GenericViewSet): perms_map = {'get': '*'} queryset = SubProductionPlan.objects.select_related( 'process', 'workshop', 'subproduction', 'product').filter( - production_plan__state__in =[ - ProductionPlan.PLAN_STATE_WORKING, ProductionPlan.PLAN_STATE_ASSGINED + state__in =[ + SubProductionPlan.SUBPLAN_STATE_ASSGINED, SubProductionPlan.SUBPLAN_STATE_WORKING ] ) search_fields = [] From f4906d4d8bc3ae66a311ab3346eba342adc2f935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Tue, 14 Jun 2022 09:23:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=87=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E4=B8=8B=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E5=AD=90=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/views.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 3f623d6..cd002ef 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -49,11 +49,7 @@ class WPlanViewSet(ListModelMixin, GenericViewSet): """ perms_map = {'get': '*'} queryset = SubProductionPlan.objects.select_related( - 'process', 'workshop', 'subproduction', 'product').filter( - state__in =[ - SubProductionPlan.SUBPLAN_STATE_ASSGINED, SubProductionPlan.SUBPLAN_STATE_WORKING - ] - ) + 'process', 'workshop', 'subproduction', 'product').exclude(state=SubProductionPlan.SUBPLAN_STATE_PLANING) search_fields = [] serializer_class = SubProductionPlanListSerializer filterset_fields = ['production_plan',