fix: inm校验非正数

This commit is contained in:
caoqianming 2025-04-19 23:24:43 +08:00
parent e24d92fe9b
commit 0489a545e8
1 changed files with 5 additions and 1 deletions

View File

@ -63,6 +63,8 @@ def do_out(item: MIOItem):
xbatch:str = al[1]
xcount:str = al[2]
xbatches.append(xbatch)
if xcount <= 0:
raise ParseError("存在非正数!")
mb = None
if not is_zhj:
try:
@ -140,6 +142,8 @@ def do_in(item: MIOItem):
xbatchs = []
for al in action_list:
xmaterial, xbatch, xcount = al
if xcount <= 0:
raise ParseError("存在非正数!")
xbatchs.append(xbatch)
# 扣减车间库存
wm_qs = WMaterial.objects.filter(
@ -353,7 +357,7 @@ class InmService:
for material, warehouse, batch, change_count, defect, mioitem in m_list:
if change_count <= 0:
continue
raise ParseError("存在非正数!")
state = WMaterial.WM_OK
if defect:
state = WMaterial.WM_NOTOK