diff --git a/apps/inm/services.py b/apps/inm/services.py index 6f27159a..edcdb208 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -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