From 05ea28f33445bc17388a8d93221687ed3a9f4100 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 5 Aug 2025 14:31:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20wpr=20number=5Fout=5Flast=20=E5=89=8D?= =?UTF-8?q?=E7=BC=80=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpmw/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wpmw/views.py b/apps/wpmw/views.py index 12611df1..f02ad8b4 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -62,7 +62,9 @@ class WprViewSet(CustomListModelMixin, RetrieveModelMixin, ComplexQueryMixin, Cu 获取最新的出库对外编号(get请求传入prefix参数和with_unsubmit参数,with_unsubmit默认为yes,表示是否包含未出库的记录,prefix为前缀,如'WPR-2023-0)""" from apps.inm.models import MIOItemw - prefix = request.query_params.get("prefix") + prefix = request.query_params.get("prefix", None) + if not prefix: + raise ParseError("请传入前缀参数") with_unsubmit = request.query_params.get("with_unsubmit", "yes") wpr_qs_last = Wpr.objects.filter(number_out__startswith=prefix).order_by("number_out").last() number_outs = []